summaryrefslogtreecommitdiff
path: root/chip/ish/aontaskfw/ish_aontask.c
diff options
context:
space:
mode:
authorDenis Brockus <dbrockus@chromium.org>2019-06-18 10:24:34 -0600
committerCommit Bot <commit-bot@chromium.org>2019-06-18 21:23:07 +0000
commit47253f9f4b3968c3bd8e1a731e730fe2aab614c6 (patch)
tree825b095fe7b46aafdd0203e598c1fcbf076c209f /chip/ish/aontaskfw/ish_aontask.c
parentefbdc0df890dc45ef7baddc85a1649e9dd2983d8 (diff)
downloadchrome-ec-47253f9f4b3968c3bd8e1a731e730fe2aab614c6.tar.gz
ish: snowball linker cleanup
Change AON_ROM references to be AON_PERSISTENT, these are not readonly Use the linker to set a snowball structure in the right place so we do not have to maintain hardcoded addresses in the register file BUG=b:132690500 BRANCH=none TEST=make buildall -j and check map location of snowball to be correct Change-Id: I4983a078fbd067b9c7ec9f0c49f962a4cb1581b7 Signed-off-by: Denis Brockus <dbrockus@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1664593 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Diffstat (limited to 'chip/ish/aontaskfw/ish_aontask.c')
-rw-r--r--chip/ish/aontaskfw/ish_aontask.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/chip/ish/aontaskfw/ish_aontask.c b/chip/ish/aontaskfw/ish_aontask.c
index 996827e8c9..bc8b2f6084 100644
--- a/chip/ish/aontaskfw/ish_aontask.c
+++ b/chip/ish/aontaskfw/ish_aontask.c
@@ -167,7 +167,7 @@ void ish_aon_main(void);
static struct tss_entry aon_tss = {
.prev_task_link = 0,
.reserved1 = 0,
- .esp0 = (uint8_t *)(CONFIG_AON_ROM_BASE - AON_SP_RESERVED),
+ .esp0 = (uint8_t *)(CONFIG_AON_PERSISTENT_BASE - AON_SP_RESERVED),
/* entry 1 in LDT for data segment */
.ss0 = 0xc,
.reserved2 = 0,
@@ -186,8 +186,8 @@ static struct tss_entry aon_tss = {
.edx = 0,
.ebx = 0,
/* set stack top pointer at the end of usable aon memory */
- .esp = CONFIG_AON_ROM_BASE - AON_SP_RESERVED,
- .ebp = CONFIG_AON_ROM_BASE - AON_SP_RESERVED,
+ .esp = CONFIG_AON_PERSISTENT_BASE - AON_SP_RESERVED,
+ .ebp = CONFIG_AON_PERSISTENT_BASE - AON_SP_RESERVED,
.esi = 0,
.edi = 0,
/* entry 1 in LDT for data segment */
@@ -269,6 +269,10 @@ struct ish_aon_share aon_share = {
.aon_ldt_size = sizeof(aon_ldt),
};
+/* snowball structure */
+__attribute__((section(".data.snowball"))) volatile
+struct snowball_struct snowball;
+
/* In IMR DDR, ISH FW image has a manifest header */
#define ISH_FW_IMAGE_MANIFEST_HEADER_SIZE (0x1000)
@@ -285,10 +289,10 @@ 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 +
- ISH_FW_IMAGE_MANIFEST_HEADER_SIZE;
+ 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
+ aon_share.main_fw_rw_addr
@@ -326,10 +330,10 @@ 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 +
- ISH_FW_IMAGE_MANIFEST_HEADER_SIZE;
+ 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
+ aon_share.main_fw_ro_addr