summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chip/ish/aontaskfw/ish_aontask.c24
-rw-r--r--chip/ish/aontaskfw/ish_aontask.lds.S18
-rw-r--r--chip/ish/ish_persistent_data.h8
3 files changed, 20 insertions, 30 deletions
diff --git a/chip/ish/aontaskfw/ish_aontask.c b/chip/ish/aontaskfw/ish_aontask.c
index d066e86754..183c61f97a 100644
--- a/chip/ish/aontaskfw/ish_aontask.c
+++ b/chip/ish/aontaskfw/ish_aontask.c
@@ -270,8 +270,16 @@ struct ish_aon_share aon_share = {
};
/* snowball structure */
-__attribute__((section(".data.snowball"))) volatile
-struct snowball_struct snowball;
+#if defined(CHIP_FAMILY_ISH3)
+/* on ISH3, reused ISH2PMC IPC message registers */
+#define SNOWBALL_BASE IPC_ISH2PMC_MSG_BASE
+#else
+/* from ISH4, used reserved rom part of AON memory */
+#define SNOWBALL_BASE (CONFIG_AON_PERSISTENT_BASE + 256)
+#endif
+
+struct snowball_struct *snowball = (void *)SNOWBALL_BASE;
+
/* In IMR DDR, ISH FW image has a manifest header */
#define ISH_FW_IMAGE_MANIFEST_HEADER_SIZE (0x1000)
@@ -289,9 +297,9 @@ static int store_main_fw(void)
uint64_t imr_fw_addr;
uint64_t imr_fw_rw_addr;
- imr_fw_addr = (((uint64_t)snowball.uma_base_hi << 32) +
- snowball.uma_base_lo +
- snowball.fw_offset +
+ imr_fw_addr = (((uint64_t)snowball->uma_base_hi << 32) +
+ snowball->uma_base_lo +
+ snowball->fw_offset +
ISH_FW_IMAGE_MANIFEST_HEADER_SIZE);
imr_fw_rw_addr = (imr_fw_addr
@@ -330,9 +338,9 @@ static int restore_main_fw(void)
uint64_t imr_fw_ro_addr;
uint64_t imr_fw_rw_addr;
- imr_fw_addr = (((uint64_t)snowball.uma_base_hi << 32) +
- snowball.uma_base_lo +
- snowball.fw_offset +
+ imr_fw_addr = (((uint64_t)snowball->uma_base_hi << 32) +
+ snowball->uma_base_lo +
+ snowball->fw_offset +
ISH_FW_IMAGE_MANIFEST_HEADER_SIZE);
imr_fw_ro_addr = (imr_fw_addr
diff --git a/chip/ish/aontaskfw/ish_aontask.lds.S b/chip/ish/aontaskfw/ish_aontask.lds.S
index b5361432a2..ca5f54f705 100644
--- a/chip/ish/aontaskfw/ish_aontask.lds.S
+++ b/chip/ish/aontaskfw/ish_aontask.lds.S
@@ -32,23 +32,10 @@ ENTRY(ish_aon_main);
* loader.
*/
-/**
- * Snowball data
- */
-#if defined(CHIP_FAMILY_ISH3)
-/* on ISH3, reused ISH2PMC IPC message registers */
-#define SNOWBALL_BASE IPC_ISH2PMC_MSG_BASE
-#else
-/* from ISH4, used reserved rom part of AON memory */
-#define SNOWBALL_BASE (CONFIG_AON_PERSISTENT_BASE + 256)
-#endif
-#define SNOWBALL_LEN (4*32)
-
MEMORY
{
/* leave STACK_SIZE bytes in the end of memory for stack */
RAM : ORIGIN = SRAM_START, LENGTH = RAM_LEN
- SNOWBALL : ORIGIN = SNOWBALL_BASE, LENGTH = SNOWBALL_LEN
}
SECTIONS
@@ -59,11 +46,6 @@ SECTIONS
KEEP(*(.data.aon_share))
} > RAM
- .data.snowball : AT(SNOWBALL_BASE)
- {
- KEEP(*(.data.snowball))
- } > SNOWBALL
-
.data :
{
*(.data)
diff --git a/chip/ish/ish_persistent_data.h b/chip/ish/ish_persistent_data.h
index e10e4d127c..0fd973e1bb 100644
--- a/chip/ish/ish_persistent_data.h
+++ b/chip/ish/ish_persistent_data.h
@@ -44,10 +44,10 @@ void ish_persistent_data_commit(void);
*/
struct snowball_struct {
uint32_t reserved[28];
- uint32_t uma_base_hi;
- uint32_t uma_base_lo;
- uint32_t uma_limit;
- uint32_t fw_offset;
+ uint32_t volatile uma_base_hi;
+ uint32_t volatile uma_base_lo;
+ uint32_t volatile uma_limit;
+ uint32_t volatile fw_offset;
};
#endif /* __CROS_EC_ISH_PERSISTENT_DATA_H */