diff options
author | Jack Rosenthal <jrosenth@chromium.org> | 2019-05-01 14:08:33 -0600 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2019-05-04 03:17:25 -0700 |
commit | acb893a320f0398d25083a9ea102329c619845ab (patch) | |
tree | 36b90b5b5224595b63b0c402aba55e361a0d620f /chip/ish/aontaskfw | |
parent | a87deb3376ca76e76c734f3204a776e828011b5b (diff) | |
download | chrome-ec-acb893a320f0398d25083a9ea102329c619845ab.tar.gz |
ish: ensure all CONFIGs are undef'ed in include/config.h
Some people have been bypassing the pre-submit checks:
confs=($(grep -Eor "\bCONFIG_[A-Z_]*" chip/ish/config_chip.h
| sort | uniq))
for opt in "${confs[@]}"; do
grep "$opt" include/config.h >/dev/null ||
echo "$opt is not defined in include/config.h!"
done
>>>
CONFIG_ISH_AON_SRAM_BASE_END is not defined in include/config.h!
CONFIG_ISH_AON_SRAM_BASE_START is not defined in include/config.h!
CONFIG_ISH_AON_SRAM_ROM_SIZE is not defined in include/config.h!
CONFIG_ISH_AON_SRAM_ROM_START is not defined in include/config.h!
CONFIG_ISH_AON_SRAM_SIZE is not defined in include/config.h!
CONFIG_ISH_SRAM_BANKS is not defined in include/config.h!
CONFIG_ISH_SRAM_BANK_SIZE is not defined in include/config.h!
CONFIG_ISH_SRAM_BASE_END is not defined in include/config.h!
CONFIG_ISH_SRAM_BASE_START is not defined in include/config.h!
CONFIG_ISH_SRAM_SIZE is not defined in include/config.h!
This is not good! This commit renames each of these to an existing
option defined in include/config.h, or undefs the relevant option in
include/config.h.
BUG=b:131749055
BRANCH=none
TEST=make buildall -j
TEST=script above reports no options which weren't defined
TEST=arcada_ish, (specifically power management, which was greatly
affected by this commit) functions as normal
Change-Id: Idfbd1105880174b5e160c47c4ec1d88c352d6bc6
Signed-off-by: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1592420
Reviewed-by: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'chip/ish/aontaskfw')
-rw-r--r-- | chip/ish/aontaskfw/ish_aontask.c | 57 | ||||
-rw-r--r-- | chip/ish/aontaskfw/ish_aontask.ld.in | 6 |
2 files changed, 33 insertions, 30 deletions
diff --git a/chip/ish/aontaskfw/ish_aontask.c b/chip/ish/aontaskfw/ish_aontask.c index f90ec94d8c..187d073671 100644 --- a/chip/ish/aontaskfw/ish_aontask.c +++ b/chip/ish/aontaskfw/ish_aontask.c @@ -172,7 +172,7 @@ void ish_aon_main(void); static struct tss_entry aon_tss = { .prev_task_link = 0, .reserved1 = 0, - .esp0 = (uint8_t *)(CONFIG_ISH_AON_SRAM_ROM_START - AON_SP_RESERVED), + .esp0 = (uint8_t *)(CONFIG_AON_ROM_BASE - AON_SP_RESERVED), /* entry 1 in LDT for data segment */ .ss0 = 0xc, .reserved2 = 0, @@ -191,7 +191,7 @@ static struct tss_entry aon_tss = { .edx = 0, .ebx = 0, /* set stack top pointer at the end of usable aon memory */ - .esp = CONFIG_ISH_AON_SRAM_ROM_START - AON_SP_RESERVED, + .esp = CONFIG_AON_ROM_BASE - AON_SP_RESERVED, .ebp = AON_SP_RESERVED, .esi = 0, .edi = 0, @@ -295,20 +295,20 @@ static int store_main_fw(void) SNOWBALL_FW_OFFSET + ISH_FW_IMAGE_MANIFEST_HEADER_SIZE; - imr_fw_rw_addr = imr_fw_addr + aon_share.main_fw_rw_addr - - CONFIG_ISH_SRAM_BASE_START; + imr_fw_rw_addr = (imr_fw_addr + + aon_share.main_fw_rw_addr + - CONFIG_RAM_BASE); /* disable BCG (Block Clock Gating) for DMA, DMA can be accessed now */ CCU_BCG_EN = CCU_BCG_EN & ~CCU_BCG_BIT_DMA; /* store main FW's read and write data region to IMR/UMA DDR */ ret = ish_dma_copy( - PAGING_CHAN, - imr_fw_rw_addr, - aon_share.main_fw_rw_addr, - aon_share.main_fw_rw_size, - SRAM_TO_UMA - ); + PAGING_CHAN, + imr_fw_rw_addr, + aon_share.main_fw_rw_addr, + aon_share.main_fw_rw_size, + SRAM_TO_UMA); /* enable BCG for DMA, DMA can't be accessed now */ CCU_BCG_EN = CCU_BCG_EN | CCU_BCG_BIT_DMA; @@ -336,23 +336,24 @@ static int restore_main_fw(void) SNOWBALL_FW_OFFSET + ISH_FW_IMAGE_MANIFEST_HEADER_SIZE; - imr_fw_ro_addr = imr_fw_addr + aon_share.main_fw_ro_addr - - CONFIG_ISH_SRAM_BASE_START; + imr_fw_ro_addr = (imr_fw_addr + + aon_share.main_fw_ro_addr + - CONFIG_RAM_BASE); - imr_fw_rw_addr = imr_fw_addr + aon_share.main_fw_rw_addr - - CONFIG_ISH_SRAM_BASE_START; + imr_fw_rw_addr = (imr_fw_addr + + aon_share.main_fw_rw_addr + - CONFIG_RAM_BASE); /* disable BCG (Block Clock Gating) for DMA, DMA can be accessed now */ CCU_BCG_EN = CCU_BCG_EN & ~CCU_BCG_BIT_DMA; /* restore main FW's read only code and data region from IMR/UMA DDR */ ret = ish_dma_copy( - PAGING_CHAN, - aon_share.main_fw_ro_addr, - imr_fw_ro_addr, - aon_share.main_fw_ro_size, - UMA_TO_SRAM - ); + PAGING_CHAN, + aon_share.main_fw_ro_addr, + imr_fw_ro_addr, + aon_share.main_fw_ro_size, + UMA_TO_SRAM); if (ret != DMA_RC_OK) { @@ -388,12 +389,14 @@ static int restore_main_fw(void) return AON_SUCCESS; } -#ifdef CHIP_FAMILY_ISH3 -/* on ISH3, need reserve last SRAM bank for AON use */ -#define SRAM_POWER_OFF_BANKS (CONFIG_ISH_SRAM_BANKS - 1) +#if defined(CHIP_FAMILY_ISH3) +/* on ISH3, the last SRAM bank is reserved for AON use */ +#define SRAM_POWER_OFF_BANKS (CONFIG_RAM_BANKS - 1) +#elif defined(CHIP_FAMILY_ISH4) || defined(CHIP_FAMILY_ISH5) +/* ISH4 and ISH5 have separate AON memory, can power off entire main SRAM */ +#define SRAM_POWER_OFF_BANKS CONFIG_RAM_BANKS #else -/* from ISH4, has seprated AON memory, can power off entire main SRAM */ -#define SRAM_POWER_OFF_BANKS CONFIG_ISH_SRAM_BANKS +#error "CHIP_FAMILY_ISH(3|4|5) must be defined" #endif /** @@ -435,8 +438,8 @@ static void sram_power(int on) uint32_t sram_addr; uint32_t erase_cfg; - bank_size = CONFIG_ISH_SRAM_BANK_SIZE; - sram_addr = CONFIG_ISH_SRAM_BASE_START; + bank_size = CONFIG_RAM_BANK_SIZE; + sram_addr = CONFIG_RAM_BASE; /** * set erase size as one bank, erase control register using DWORD as diff --git a/chip/ish/aontaskfw/ish_aontask.ld.in b/chip/ish/aontaskfw/ish_aontask.ld.in index 3525519d5b..55ae99a88c 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_ISH_AON_SRAM_BASE_START -#define SRAM_RW_LEN (CONFIG_ISH_AON_SRAM_SIZE - CONFIG_ISH_AON_SRAM_ROM_SIZE) +#define SRAM_START CONFIG_AON_RAM_BASE +#define SRAM_RW_LEN (CONFIG_AON_RAM_SIZE - CONFIG_AON_ROM_SIZE) /* reserved stack size */ #define STACK_SIZE (256) @@ -37,7 +37,7 @@ MEMORY SECTIONS { /* AON parts visible to FW are linked to the beginning of the AON area */ - .data.aon_share : AT(CONFIG_ISH_AON_SRAM_BASE_START) + .data.aon_share : AT(SRAM_START) { KEEP(*(.data.aon_share)) } > RAM |