From 67171e13a3e0665b18c657a6704a22ca7900f4c3 Mon Sep 17 00:00:00 2001 From: Jacob Chen Date: Mon, 19 Sep 2016 18:46:28 +0800 Subject: rockchip: add boot-mode support for rk3288, rk3036 rockchip platform have a protocol to pass the the kernel reboot mode to bootloader by some special registers when system reboot. In bootloader we should read it and take action. We can only setup boot_mode in board_late_init becasue "setenv" need env setuped. So add CONFIG_BOARD_LATE_INIT to common header and use a entry "rk_board_late_init" to replace "board_late_init" in board file. Signed-off-by: Jacob Chen Acked-by: Simon Glass --- board/rockchip/kylin_rk3036/kylin_rk3036.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'board/rockchip') diff --git a/board/rockchip/kylin_rk3036/kylin_rk3036.c b/board/rockchip/kylin_rk3036/kylin_rk3036.c index 848f23d..7e2edf4 100644 --- a/board/rockchip/kylin_rk3036/kylin_rk3036.c +++ b/board/rockchip/kylin_rk3036/kylin_rk3036.c @@ -8,14 +8,11 @@ #include #include #include -#include #include #include DECLARE_GLOBAL_DATA_PTR; -#define GRF_BASE 0x20008000 - void get_ddr_config(struct rk3036_ddr_config *config) { /* K4B4G1646Q config */ @@ -43,16 +40,9 @@ int fastboot_key_pressed(void) #define ROCKCHIP_BOOT_MODE_FASTBOOT 0x5242C309 -int board_late_init(void) +int rk_board_late_init(void) { - struct rk3036_grf * const grf = (void *)GRF_BASE; - int boot_mode = readl(&grf->os_reg[4]); - - /* Clear boot mode */ - writel(0, &grf->os_reg[4]); - - if (boot_mode == ROCKCHIP_BOOT_MODE_FASTBOOT || - fastboot_key_pressed()) { + if (fastboot_key_pressed()) { printf("enter fastboot!\n"); setenv("preboot", "setenv preboot; fastboot usb0"); } -- cgit v1.1