diff --git a/board/avaota-a1/board.c b/board/avaota-a1/board.c index e14d8f7a..e5b942e4 100644 --- a/board/avaota-a1/board.c +++ b/board/avaota-a1/board.c @@ -164,6 +164,14 @@ void neon_enable(void) { asm volatile("MCR p10, 7, r3, c8, c0, 0"); } +void gicr_set_waker(void) { + uint32_t gicr_waker = read32(GICR_WAKER(0)); + if ((gicr_waker & 2) == 0) { + gicr_waker |= 2; + write32(GICR_WAKER(0), gicr_waker); + } +} + void clean_syterkit_data(void) { /* Disable MMU, data cache, instruction cache, interrupts */ arm32_mmu_disable(); diff --git a/board/avaota-a1/extlinux_boot/main.c b/board/avaota-a1/extlinux_boot/main.c index afaa51b1..ee52939e 100644 --- a/board/avaota-a1/extlinux_boot/main.c +++ b/board/avaota-a1/extlinux_boot/main.c @@ -73,6 +73,7 @@ extern void enable_sram_a3(); extern void rtc_set_vccio_det_spare(); extern void set_rpio_power_mode(void); extern void sunxi_nsi_init(); +extern void gicr_set_waker(void); typedef struct atf_head { uint32_t jump_instruction; /* jumping to real code */ @@ -821,6 +822,8 @@ int main(void) { clean_syterkit_data(); + gicr_set_waker(); + jmp_to_arm64(CONFIG_BL31_LOAD_ADDR); printk_info("Back to SyterKit\n"); diff --git a/board/avaota-a1/syter_boot/main.c b/board/avaota-a1/syter_boot/main.c index 2d3a4977..e097f8f7 100644 --- a/board/avaota-a1/syter_boot/main.c +++ b/board/avaota-a1/syter_boot/main.c @@ -66,6 +66,7 @@ extern void enable_sram_a3(); extern void rtc_set_vccio_det_spare(); extern void set_rpio_power_mode(void); extern void sunxi_nsi_init(); +extern void gicr_set_waker(void); typedef struct atf_head { uint32_t jump_instruction; /* jumping to real code */ @@ -272,6 +273,8 @@ int cmd_boot(int argc, const char **argv) { clean_syterkit_data(); + gicr_set_waker(); + jmp_to_arm64(CONFIG_BL31_LOAD_ADDR); printk_info("Back to SyterKit\n"); diff --git a/board/avaota-a1/syter_boot_bl33/main.c b/board/avaota-a1/syter_boot_bl33/main.c index a067eb99..36a4d5ce 100644 --- a/board/avaota-a1/syter_boot_bl33/main.c +++ b/board/avaota-a1/syter_boot_bl33/main.c @@ -66,6 +66,7 @@ extern void enable_sram_a3(); extern void rtc_set_vccio_det_spare(); extern void set_rpio_power_mode(void); extern void sunxi_nsi_init(); +extern void gicr_set_waker(void); typedef struct atf_head { uint32_t jump_instruction; /* jumping to real code */ @@ -272,6 +273,8 @@ int cmd_boot(int argc, const char **argv) { clean_syterkit_data(); + gicr_set_waker(); + jmp_to_arm64(CONFIG_BL31_LOAD_ADDR); printk_info("Back to SyterKit\n"); diff --git a/board/avaota-a1/syter_boot_uboot/main.c b/board/avaota-a1/syter_boot_uboot/main.c index 0494151a..91dca5c3 100644 --- a/board/avaota-a1/syter_boot_uboot/main.c +++ b/board/avaota-a1/syter_boot_uboot/main.c @@ -63,6 +63,7 @@ extern void enable_sram_a3(); extern void rtc_set_vccio_det_spare(); extern void set_rpio_power_mode(void); extern void sunxi_nsi_init(); +extern void gicr_set_waker(void); typedef struct atf_head { uint32_t jump_instruction; /* jumping to real code */ @@ -261,6 +262,8 @@ int cmd_boot(int argc, const char **argv) { clean_syterkit_data(); + gicr_set_waker(); + jmp_to_arm64(CONFIG_BL31_LOAD_ADDR); printk_info("Back to SyterKit\n"); diff --git a/include/drivers/sun55iw3/reg/reg-ncat.h b/include/drivers/sun55iw3/reg/reg-ncat.h index 778ee434..0d37ee39 100644 --- a/include/drivers/sun55iw3/reg/reg-ncat.h +++ b/include/drivers/sun55iw3/reg/reg-ncat.h @@ -194,6 +194,16 @@ #define GPIO_3_3V_MODE 0 #define GPIO_1_8V_MODE 1 +/* GIC600 */ +#define GIC_IROUTR(_n) (SUNXI_CPU_GIC600_BASE + 0x6000 + 8 * (_n)) +#define GICR_LPI_BASE(n) (SUNXI_CPU_GIC600_BASE + 0x60000 + n*0x20000) +#define GICR_WAKER(m) (GICR_LPI_BASE(m) + 0x0014) +#define GICR_PWRR(m) (GICR_LPI_BASE(m) + 0x0024) +#define LEVEL_TRIGERRED (0) +#define EDGE_TRIGERRED (1) +#define GIC_IRQ_TYPE_CFG(_n) (SUNXI_CPU_GIC600_BASE + 0xc00 + 4 * (_n)) +#define GIC_IRQ_MOD_CFG(_n) (SUNXI_CPU_GIC600_BASE + 0xd00 + 4 * (_n)) + #define PIOC_REG_o_POW_MOD_SEL 0x380 #define PIOC_REG_o_POW_MS_CTL 0x384 #define PIOC_REG_o_POW_MS_VAL 0x388 @@ -231,4 +241,4 @@ #define SUNXI_S_SPI_CLK_REG 0x0150 #define SUNXI_S_SPI_BGR_REG 0x015C -#endif// __SUN55IW3_REG_NCAT_H__ \ No newline at end of file +#endif// __SUN55IW3_REG_NCAT_H__