Felix Held | 875e5aa | 2020-12-01 00:34:11 +0100 | [diff] [blame^] | 1 | /* SPDX-License-Identifier: GPL-2.0-or-later */ |
| 2 | |
| 3 | #ifndef AMD_BLOCK_SMBUS_H |
| 4 | #define AMD_BLOCK_SMBUS_H |
| 5 | |
| 6 | /* SMBUS MMIO offsets 0xfed80a00 */ |
| 7 | #define SMBHSTSTAT 0x0 |
| 8 | #define SMBHST_STAT_FAILED (1 << 4) |
| 9 | #define SMBHST_STAT_COLLISION (1 << 3) |
| 10 | #define SMBHST_STAT_ERROR (1 << 2) |
| 11 | #define SMBHST_STAT_INTERRUPT (1 << 1) |
| 12 | #define SMBHST_STAT_BUSY (1 << 0) |
| 13 | #define SMBHST_STAT_CLEAR 0xff |
| 14 | #define SMBHST_STAT_NOERROR (1 << 1) /* TODO: this one looks odd */ |
| 15 | #define SMBHST_STAT_VAL_BITS 0x1f |
| 16 | #define SMBHST_STAT_ERROR_BITS 0x1c |
| 17 | |
| 18 | #define SMBSLVSTAT 0x1 |
| 19 | #define SMBSLV_STAT_ALERT (1 << 5) |
| 20 | #define SMBSLV_STAT_SHADOW2 (1 << 4) |
| 21 | #define SMBSLV_STAT_SHADOW1 (1 << 3) |
| 22 | #define SMBSLV_STAT_SLV_STS (1 << 2) |
| 23 | #define SMBSLV_STAT_SLV_INIT (1 << 1) |
| 24 | #define SMBSLV_STAT_SLV_BUSY (1 << 0) |
| 25 | #define SMBSLV_STAT_CLEAR 0x1f |
| 26 | |
| 27 | #define SMBHSTCTRL 0x2 |
| 28 | #define SMBHST_CTRL_RST (1 << 7) |
| 29 | #define SMBHST_CTRL_STRT (1 << 6) |
| 30 | #define SMBHST_CTRL_QCK_RW (0x0 << 2) |
| 31 | #define SMBHST_CTRL_BTE_RW (0x1 << 2) |
| 32 | #define SMBHST_CTRL_BDT_RW (0x2 << 2) |
| 33 | #define SMBHST_CTRL_WDT_RW (0x3 << 2) |
| 34 | #define SMBHST_CTRL_BLK_RW (0x5 << 2) |
| 35 | #define SMBHST_CTRL_MODE_BITS (0x7 << 2) |
| 36 | #define SMBHST_CTRL_KILL (1 << 1) |
| 37 | #define SMBHST_CTRL_IEN (1 << 0) |
| 38 | |
| 39 | #define SMBHSTCMD 0x3 |
| 40 | #define SMBHSTADDR 0x4 |
| 41 | #define SMBHSTDAT0 0x5 |
| 42 | #define SMBHSTDAT1 0x6 |
| 43 | #define SMBHSTBLKDAT 0x7 |
| 44 | #define SMBSLVCTRL 0x8 |
| 45 | #define SMBSLVCMD_SHADOW 0x9 |
| 46 | #define SMBSLVEVT 0xa |
| 47 | #define SMBSLVDAT 0xc |
| 48 | #define SMBTIMING 0xe |
| 49 | |
| 50 | #endif /* AMD_BLOCK_SMBUS_H */ |