diff options
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) |