diff options
-rw-r--r-- | chip/it83xx/config_chip_it8xxx2.h | 8 | ||||
-rw-r--r-- | core/riscv-rv32i/init.S | 17 |
2 files changed, 14 insertions, 11 deletions
diff --git a/chip/it83xx/config_chip_it8xxx2.h b/chip/it83xx/config_chip_it8xxx2.h index 19437e5154..8ad440c685 100644 --- a/chip/it83xx/config_chip_it8xxx2.h +++ b/chip/it83xx/config_chip_it8xxx2.h @@ -9,11 +9,17 @@ /* CPU core BFD configuration */ #include "core/riscv-rv32i/config_core.h" - /* RISCV core */ +/* RISCV core */ #define CHIP_CORE_RISCV #define CHIP_ILM_DLM_ORDER /* The base address of EC interrupt controller registers. */ #define CHIP_EC_INTC_BASE 0x00F03F00 +/* + * ILM/DLM size register. + * bit[3-0] ILM size: + * 7: 512K byte (default setting), 8: 1M byte + */ +#define IT83XX_GCTRL_EIDSR 0xf02031 /****************************************************************************/ /* Memory mapping */ diff --git a/core/riscv-rv32i/init.S b/core/riscv-rv32i/init.S index dedd7a644f..844a49d7c3 100644 --- a/core/riscv-rv32i/init.S +++ b/core/riscv-rv32i/init.S @@ -7,13 +7,6 @@ #include "config.h" -/* - * ILM/DLM size register. - * bit[3-0] ILM size: - * 7: 512K byte (default setting), 8: 1M byte - */ -#define IT83XX_GCTRL_EIDSR 0xf02031 - .macro vector name .set \name\()_handler, unhandled_ec_irq .weak \name\()_handler @@ -36,6 +29,7 @@ __startup: __irq: j __irq_isr /* interrupts / exceptions */ +#ifdef CHIP_FAMILY_IT8XXX2 /* * E-flash signature used to enable specific function after power-on reset. * (HW mechanism) @@ -69,6 +63,7 @@ eflash_sig: .byte 0xB4 /* flag of signature */ .byte 0x85, 0x12, 0x5A, 0x5A, 0xAA, 0xAA, 0x55, 0x55 /* flags: internal oscillator + implicit location */ +#endif /* CHIP_FAMILY_IT8XXX2 */ .align 2 __ec_intc: @@ -290,7 +285,7 @@ __reset: /* The M-mode handles interrupt/exception */ csrwi mideleg, 0 csrwi medeleg, 0 -#ifdef IT83XX_CHIP_FLASH_SIZE_1MB +#if defined(IT83XX_CHIP_FLASH_SIZE_1MB) && defined(CHIP_FAMILY_IT8XXX2) /* ILM size is 1M bytes */ la t0, IT83XX_GCTRL_EIDSR lb t1, 0(t0) @@ -318,8 +313,10 @@ data_loop: /* store the content of t5 (ra after reset) into "ec_reset_lp" */ la t0, ec_reset_lp sw t5, 0(t0) - /* clear BRAM if it is not valid */ - jal chip_bram_valid +#ifdef CHIP_FAMILY_IT8XXX2 + /* clear BRAM if it is not valid */ + jal chip_bram_valid +#endif /* Jump to C routine */ jal main /* That should not return. If it does, loop forever. */ |