Skip to content

Commit a3266a8

Browse files
ChiHuaLnashif
authored andcommitted
drivers: espi: host_subs: npcx: fix LDN register definition of PMCH
The register offset definition of the I/O port Data Base Address register (0x60, 0x61) and Command/Status Base Address register (0x62, 0x63) are reversed. This commit fixes it to avoid confusion. Signed-off-by: Jun Lin <[email protected]> (cherry picked from commit 51cfbd8)
1 parent 793065c commit a3266a8

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

drivers/espi/host_subs_npcx.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -199,12 +199,12 @@ struct host_sub_npcx_data host_sub_data;
199199
#define EC_CFG_LDN_HCMD 0x12 /* PM Channel 2 */
200200

201201
/* Index of EC (4E/4F) Configuration Register */
202-
#define EC_CFG_IDX_LDN 0x07
203-
#define EC_CFG_IDX_CTRL 0x30
204-
#define EC_CFG_IDX_CMD_IO_ADDR_H 0x60
205-
#define EC_CFG_IDX_CMD_IO_ADDR_L 0x61
206-
#define EC_CFG_IDX_DATA_IO_ADDR_H 0x62
207-
#define EC_CFG_IDX_DATA_IO_ADDR_L 0x63
202+
#define EC_CFG_IDX_LDN 0x07
203+
#define EC_CFG_IDX_CTRL 0x30
204+
#define EC_CFG_IDX_DATA_IO_ADDR_H 0x60
205+
#define EC_CFG_IDX_DATA_IO_ADDR_L 0x61
206+
#define EC_CFG_IDX_CMD_IO_ADDR_H 0x62
207+
#define EC_CFG_IDX_CMD_IO_ADDR_L 0x63
208208

209209
/* LDN Activation Enable */
210210
#define EC_CFG_IDX_CTRL_LDN_ENABLE 0x01
@@ -1029,15 +1029,15 @@ void npcx_host_init_subs_host_domain(void)
10291029
host_c2h_write_io_cfg_reg(EC_CFG_IDX_LDN, EC_CFG_LDN_HCMD);
10301030
#if defined(CONFIG_ESPI_PERIPHERAL_HOST_CMD_DATA_PORT_NUM)
10311031
/* Configure IO address of CMD portt (default: 0x200) */
1032-
host_c2h_write_io_cfg_reg(EC_CFG_IDX_CMD_IO_ADDR_H,
1032+
host_c2h_write_io_cfg_reg(EC_CFG_IDX_DATA_IO_ADDR_H,
10331033
(CONFIG_ESPI_PERIPHERAL_HOST_CMD_DATA_PORT_NUM >> 8) & 0xff);
1034-
host_c2h_write_io_cfg_reg(EC_CFG_IDX_CMD_IO_ADDR_L,
1034+
host_c2h_write_io_cfg_reg(EC_CFG_IDX_DATA_IO_ADDR_L,
10351035
CONFIG_ESPI_PERIPHERAL_HOST_CMD_DATA_PORT_NUM & 0xff);
10361036
/* Configure IO address of Data portt (default: 0x204) */
1037-
host_c2h_write_io_cfg_reg(EC_CFG_IDX_DATA_IO_ADDR_H,
1037+
host_c2h_write_io_cfg_reg(EC_CFG_IDX_CMD_IO_ADDR_H,
10381038
((CONFIG_ESPI_PERIPHERAL_HOST_CMD_DATA_PORT_NUM + 4) >> 8)
10391039
& 0xff);
1040-
host_c2h_write_io_cfg_reg(EC_CFG_IDX_DATA_IO_ADDR_L,
1040+
host_c2h_write_io_cfg_reg(EC_CFG_IDX_CMD_IO_ADDR_L,
10411041
(CONFIG_ESPI_PERIPHERAL_HOST_CMD_DATA_PORT_NUM + 4) & 0xff);
10421042
#endif
10431043
/* Enable 'Host Command' io port (PM Channel 2) */

0 commit comments

Comments
 (0)