diff options
author | Denis Brockus <dbrockus@chromium.org> | 2019-06-18 10:24:34 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-06-18 21:23:07 +0000 |
commit | 47253f9f4b3968c3bd8e1a731e730fe2aab614c6 (patch) | |
tree | 825b095fe7b46aafdd0203e598c1fcbf076c209f /chip/ish/aontaskfw | |
parent | efbdc0df890dc45ef7baddc85a1649e9dd2983d8 (diff) | |
download | chrome-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')
-rw-r--r-- | chip/ish/aontaskfw/ish_aontask.c | 26 | ||||
-rw-r--r-- | chip/ish/aontaskfw/ish_aontask.ld.in | 22 |
2 files changed, 35 insertions, 13 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 diff --git a/chip/ish/aontaskfw/ish_aontask.ld.in b/chip/ish/aontaskfw/ish_aontask.ld.in index a839146a92..b5361432a2 100644 --- a/chip/ish/aontaskfw/ish_aontask.ld.in +++ b/chip/ish/aontaskfw/ish_aontask.ld.in @@ -7,8 +7,8 @@ ENTRY(ish_aon_main); -#define SRAM_START CONFIG_AON_RAM_BASE -#define SRAM_RW_LEN (CONFIG_AON_RAM_SIZE - CONFIG_AON_ROM_SIZE) +#define SRAM_START CONFIG_AON_RAM_BASE +#define SRAM_RW_LEN (CONFIG_AON_RAM_SIZE - CONFIG_AON_PERSISTENT_SIZE) /* reserved stack size */ #define STACK_SIZE (256) @@ -32,10 +32,23 @@ 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 @@ -46,6 +59,11 @@ SECTIONS KEEP(*(.data.aon_share)) } > RAM + .data.snowball : AT(SNOWBALL_BASE) + { + KEEP(*(.data.snowball)) + } > SNOWBALL + .data : { *(.data) |