@@ -183,85 +183,21 @@ enum {
183
183
#define IS_HSMP_OOO (_rx ) (_rx == HSMP_UNSPECIFIED \
184
184
|| (_rx >= HSMP_FAIL_BGN && _rx <= HSMP_FAIL_END))
185
185
186
- /* Sources: PPR for AMD Family 17h */
187
- #define AMD_FCH_PM_CSTATE_EN 0x0000007e
188
-
189
- #define AMD_FCH_READ16 (_data , _reg ) \
190
- ({ \
191
- __asm__ volatile \
192
- ( \
193
- "movl %1 , %%eax" "\n\t" \
194
- "movl $0xcd6 , %%edx" "\n\t" \
195
- "outl %%eax , %%dx" "\n\t" \
196
- "movl $0xcd7 , %%edx" "\n\t" \
197
- "inw %%dx , %%ax" "\n\t" \
198
- "movw %%ax , %0" \
199
- : "=m" (_data) \
200
- : "i" (_reg) \
201
- : "%rax", "%rdx", "memory" \
202
- ); \
203
- })
204
-
205
- #define AMD_FCH_WRITE16 (_data , _reg ) \
206
- ({ \
207
- __asm__ volatile \
208
- ( \
209
- "movl %1 , %%eax" "\n\t" \
210
- "movl $0xcd6 , %%edx" "\n\t" \
211
- "outl %%eax , %%dx" "\n\t" \
212
- "movw %0 , %%ax" "\n\t" \
213
- "movl $0xcd7 , %%edx" "\n\t" \
214
- "outw %%ax , %%dx" "\n\t" \
215
- : \
216
- : "im" (_data), \
217
- "i" (_reg) \
218
- : "%rax", "%rdx", "memory" \
219
- ); \
220
- })
221
-
222
- #define AMD_FCH_PM_Read16 (IndexRegister , DataRegister ) \
223
- ({ \
224
- unsigned int tries = BIT_IO_RETRIES_COUNT; \
225
- unsigned char ret; \
226
- do { \
227
- ret = BIT_ATOM_TRYLOCK( BUS_LOCK, \
228
- PRIVATE(OF(AMD_FCH_LOCK)), \
229
- ATOMIC_SEED) ; \
230
- if (ret == 0) { \
231
- udelay(BIT_IO_DELAY_INTERVAL); \
232
- } else { \
233
- AMD_FCH_READ16(DataRegister.value, IndexRegister); \
234
- \
235
- BIT_ATOM_UNLOCK(BUS_LOCK, \
236
- PRIVATE(OF(AMD_FCH_LOCK)), \
237
- ATOMIC_SEED); \
238
- } \
239
- tries--; \
240
- } while ( (tries != 0) && (ret != 1) ); \
241
- })
242
-
243
- #define AMD_FCH_PM_Write16 (IndexRegister , DataRegister ) \
244
- ({ \
245
- unsigned int tries = BIT_IO_RETRIES_COUNT; \
246
- unsigned char ret; \
247
- do { \
248
- ret = BIT_ATOM_TRYLOCK( BUS_LOCK, \
249
- PRIVATE(OF(AMD_FCH_LOCK)), \
250
- ATOMIC_SEED ); \
251
- if (ret == 0) { \
252
- udelay(BIT_IO_DELAY_INTERVAL); \
253
- } else { \
254
- AMD_FCH_WRITE16(DataRegister.value, IndexRegister); \
255
- \
256
- BIT_ATOM_UNLOCK(BUS_LOCK, \
257
- PRIVATE(OF(AMD_FCH_LOCK)), \
258
- ATOMIC_SEED); \
259
- } \
260
- tries--; \
261
- } while ( (tries != 0) && (ret != 1) ); \
262
- })
186
+ enum SBRMI_REGISTER {
187
+ SBRMI_REVISION = 0x0 ,
188
+ SBRMI_CONTROL = 0x1 ,
189
+ SBRMI_STATUS = 0x2 ,
190
+ SBRMI_OUT_BOUND = 0x30 ,
191
+ SBRMI_IN_BOUND = 0x38 ,
192
+ SBRMI_INTERRUPT = 0x40
193
+ };
263
194
195
+ enum SBRMI_FUNC {
196
+ SBRMI_RD_PKG_TDP = 0x1 , /* Package power cTDP[31:0] (mWatts) */
197
+ SBRMI_WR_PKG_TDP = 0x2 , /* SoC package power [31:0] (mWatts) */
198
+ };
264
199
200
+ /* Sources: BKDG for AMD Families 0Fh, 10h up to 16h */
265
201
const struct {
266
202
unsigned int MCF ,
267
203
PCF [5 ];
@@ -1746,3 +1682,39 @@ typedef union
1746
1682
VID : 32 - 24 ; /* Voltage ID */
1747
1683
};
1748
1684
} AMD_17_CORE_VID ;
1685
+
1686
+ /* Sources: Advanced Platform Management Link (APML) Specification */
1687
+ typedef union
1688
+ { /* I2C: address = 0x0 */
1689
+ unsigned char value ;
1690
+ struct {
1691
+ unsigned char
1692
+ Revision : 8 - 0 ;
1693
+ };
1694
+ } AMD_SBRMI_REVISION ;
1695
+
1696
+ typedef union
1697
+ { /* I2C: address = 0x1 */
1698
+ unsigned char value ;
1699
+ struct {
1700
+ unsigned char
1701
+ AlertMask : 1 - 0 ,
1702
+ AraDis : 2 - 1 ,
1703
+ TimeoutDis : 3 - 2 ,
1704
+ BlkRWEn : 4 - 3 ,
1705
+ SwAlertMask : 5 - 4 ,
1706
+ ReservedBits : 7 - 5 ,
1707
+ PECEn : 8 - 7 ;
1708
+ };
1709
+ } AMD_SBRMI_CONTROL ;
1710
+
1711
+ typedef union
1712
+ { /* I2C: address = 0x2 */
1713
+ unsigned char value ;
1714
+ struct {
1715
+ unsigned char
1716
+ AlertSts : 1 - 0 ,
1717
+ SwAlertSts : 2 - 1 ,
1718
+ ReservedBits : 8 - 2 ;
1719
+ };
1720
+ } AMD_SBRMI_STATUS ;
0 commit comments