summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJun Lin <CHLin56@nuvoton.com>2021-09-10 13:36:17 +0800
committerCommit Bot <commit-bot@chromium.org>2021-09-28 03:15:37 +0000
commit2452efe31f80997023fec542456f89da1bc41e21 (patch)
tree1fa911eef3dbf6259ad1a568a02fe2d8a1cedeb7
parent3932100f6df604496d3d19e0247df6c52359f0a6 (diff)
downloadchrome-ec-2452efe31f80997023fec542456f89da1bc41e21.tar.gz
npcx: Correct the image copies indication bits for npcx9
In npcx5/7, we use two reserved bits in the BSC1 register (offset 0x07 of the MDC register) to indicate what the current image copy is. In npcx9, these two bits are used by the booter. We need to change them to another two empty scratch bits which are not used by the booter. BUG=b:165777478, b:200642229 BRANCH=none TEST=pass "make buildall" TEST=check the related bits changed by "sysump ro" and "sysjump rw" TEST=jump to RW & check sysinfo after reset-pin/watchdog/debug reset Signed-off-by: Jun Lin <CHLin56@nuvoton.com> Signed-off-by: Wealian Liao <whliao@nuvoton.corp-partner.google.com> Change-Id: I9801efe7fe7645e7b81df9c5cc69372df0a178a8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3178700 Tested-by: caveh jalali <caveh@chromium.org> Reviewed-by: Yuval Peress <peress@google.com> Reviewed-by: caveh jalali <caveh@chromium.org> Commit-Queue: caveh jalali <caveh@chromium.org>
-rw-r--r--chip/npcx/registers-npcx5.h8
-rw-r--r--chip/npcx/registers-npcx7.h8
-rw-r--r--chip/npcx/registers-npcx9.h8
-rw-r--r--chip/npcx/registers.h8
4 files changed, 24 insertions, 8 deletions
diff --git a/chip/npcx/registers-npcx5.h b/chip/npcx/registers-npcx5.h
index 3d241a1984..c441c1c926 100644
--- a/chip/npcx/registers-npcx5.h
+++ b/chip/npcx/registers-npcx5.h
@@ -87,6 +87,14 @@
#define NPCX_IRQ_WKINTD_2 NPCX_IRQ_63
/* Modules Map */
+
+/* Miscellaneous Device Control (MDC) registers */
+#define NPCX_FWCTRL REG8(NPCX_MDC_BASE_ADDR + 0x007)
+
+/* MDC register fields */
+#define NPCX_FWCTRL_RO_REGION 0
+#define NPCX_FWCTRL_FW_SLOT 1
+
#define NPCX_ITIM32_BASE_ADDR 0x400BC000
#define NPCX_CR_UART_BASE_ADDR(mdl) (0x400C4000 + ((mdl) * 0x2000L))
#define NPCX_SMB_BASE_ADDR(mdl) (((mdl) < 2) ? \
diff --git a/chip/npcx/registers-npcx7.h b/chip/npcx/registers-npcx7.h
index cbd9be30dc..535abfbf0f 100644
--- a/chip/npcx/registers-npcx7.h
+++ b/chip/npcx/registers-npcx7.h
@@ -104,6 +104,14 @@
#define NPCX_IRQ_WKINTD_2 NPCX_IRQ_63
/* Modules Map */
+
+/* Miscellaneous Device Control (MDC) registers */
+#define NPCX_FWCTRL REG8(NPCX_MDC_BASE_ADDR + 0x007)
+
+/* MDC register fields */
+#define NPCX_FWCTRL_RO_REGION 0
+#define NPCX_FWCTRL_FW_SLOT 1
+
#define NPCX_ITIM32_BASE_ADDR 0x400BC000
#define NPCX_CR_UART_BASE_ADDR(mdl) (0x400C4000 + ((mdl) * 0x2000L))
#define NPCX_SMB_BASE_ADDR(mdl) (((mdl) < 2) ? \
diff --git a/chip/npcx/registers-npcx9.h b/chip/npcx/registers-npcx9.h
index 296f1af25c..1d2a02084c 100644
--- a/chip/npcx/registers-npcx9.h
+++ b/chip/npcx/registers-npcx9.h
@@ -90,6 +90,14 @@
#define LCT_WUI_MASK MASK_PIN7
/* Modules Map */
+
+/* Miscellaneous Device Control (MDC) registers */
+#define NPCX_FWCTRL REG8(NPCX_MDC_BASE_ADDR + 0x009)
+
+/* MDC register fields */
+#define NPCX_FWCTRL_RO_REGION 6
+#define NPCX_FWCTRL_FW_SLOT 7
+
#define NPCX_CR_UART_BASE_ADDR(mdl) (0x400E0000 + ((mdl) * 0x2000L))
#define NPCX_LCT_BASE_ADDR 0x400D7000
#define NPCX_SMB_BASE_ADDR(mdl) (((mdl) < 2) ? \
diff --git a/chip/npcx/registers.h b/chip/npcx/registers.h
index 374e9d58ba..f0c241e7f9 100644
--- a/chip/npcx/registers.h
+++ b/chip/npcx/registers.h
@@ -175,14 +175,6 @@
#define NPCX_IRQ_COUNT 64
/******************************************************************************/
-/* Miscellaneous Device Control (MDC) registers */
-#define NPCX_FWCTRL REG8(NPCX_MDC_BASE_ADDR + 0x007)
-
-/* MDC register fields */
-#define NPCX_FWCTRL_RO_REGION 0
-#define NPCX_FWCTRL_FW_SLOT 1
-
-/******************************************************************************/
/* High Frequency Clock Generator (HFCG) registers */
#define NPCX_HFCGCTRL REG8(NPCX_HFCG_BASE_ADDR + 0x000)
#define NPCX_HFCGML REG8(NPCX_HFCG_BASE_ADDR + 0x002)