Re: [PATCH v6 061/102] x86: Make MSR_PKG_POWER_SKU common

2019-12-07 Thread Bin Meng
On Sat, Dec 7, 2019 at 12:49 PM Simon Glass  wrote:
>
> This is used on several boards so add it to the common file. Also add a
> useful power-limit value while we are here.
>
> Reviewed-by: Bin Meng 
> Signed-off-by: Simon Glass 
> ---
>
> Changes in v6: None
> Changes in v5: None
> Changes in v4: None
> Changes in v3: None
> Changes in v2: None
>
>  arch/x86/include/asm/arch-broadwell/cpu.h | 1 -
>  arch/x86/include/asm/arch-ivybridge/model_206ax.h | 1 -
>  arch/x86/include/asm/msr-index.h  | 9 -
>  3 files changed, 8 insertions(+), 3 deletions(-)
>

applied to u-boot-x86/next, thanks!


[PATCH v6 061/102] x86: Make MSR_PKG_POWER_SKU common

2019-12-06 Thread Simon Glass
This is used on several boards so add it to the common file. Also add a
useful power-limit value while we are here.

Reviewed-by: Bin Meng 
Signed-off-by: Simon Glass 
---

Changes in v6: None
Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 arch/x86/include/asm/arch-broadwell/cpu.h | 1 -
 arch/x86/include/asm/arch-ivybridge/model_206ax.h | 1 -
 arch/x86/include/asm/msr-index.h  | 9 -
 3 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/arch/x86/include/asm/arch-broadwell/cpu.h 
b/arch/x86/include/asm/arch-broadwell/cpu.h
index 3bc3bd6609..2b39a76fbd 100644
--- a/arch/x86/include/asm/arch-broadwell/cpu.h
+++ b/arch/x86/include/asm/arch-broadwell/cpu.h
@@ -27,7 +27,6 @@
 
 #define MSR_VR_CURRENT_CONFIG  0x601
 #define MSR_VR_MISC_CONFIG 0x603
-#define MSR_PKG_POWER_SKU  0x614
 #define MSR_DDR_RAPL_LIMIT 0x618
 #define MSR_VR_MISC_CONFIG20x636
 
diff --git a/arch/x86/include/asm/arch-ivybridge/model_206ax.h 
b/arch/x86/include/asm/arch-ivybridge/model_206ax.h
index 4839ebc312..5c066294bc 100644
--- a/arch/x86/include/asm/arch-ivybridge/model_206ax.h
+++ b/arch/x86/include/asm/arch-ivybridge/model_206ax.h
@@ -43,7 +43,6 @@
 #define MSR_PP1_CURRENT_CONFIG 0x602
 #define  PP1_CURRENT_LIMIT_SNB (35 << 3) /* 35 A */
 #define  PP1_CURRENT_LIMIT_IVB (50 << 3) /* 50 A */
-#define MSR_PKG_POWER_SKU  0x614
 
 #define IVB_CONFIG_TDP_MIN_CPUID   0x306a2
 #define MSR_CONFIG_TDP_LEVEL1  0x649
diff --git a/arch/x86/include/asm/msr-index.h b/arch/x86/include/asm/msr-index.h
index 5bc8b6c22c..79a9369de1 100644
--- a/arch/x86/include/asm/msr-index.h
+++ b/arch/x86/include/asm/msr-index.h
@@ -241,10 +241,17 @@
 #define  PKG_POWER_LIMIT_CLAMP (1 << 16)
 #define  PKG_POWER_LIMIT_TIME_SHIFT17
 #define  PKG_POWER_LIMIT_TIME_MASK 0x7f
+/*
+ * For Mobile, RAPL default PL1 time window value set to 28 seconds.
+ * RAPL time window calculation defined as follows:
+ * Time Window = (float)((1+X/4)*(2*^Y), X Corresponds to [23:22],
+ * Y to [21:17] in MSR 0x610. 28 sec is equal to 0x6e.
+ */
+#define  MB_POWER_LIMIT1_TIME_DEFAULT  0x6e
 
 #define MSR_PKG_ENERGY_STATUS  0x0611
 #define MSR_PKG_PERF_STATUS0x0613
-#define MSR_PKG_POWER_INFO 0x0614
+#define MSR_PKG_POWER_SKU  0x614
 
 #define MSR_DRAM_POWER_LIMIT   0x0618
 #define MSR_DRAM_ENERGY_STATUS 0x0619
-- 
2.24.0.393.g34dc348eaf-goog