[U-Boot] [PATCH v2 3/4] rockchip: add BOOT_LOADER support for boot mode

Kever Yang kever.yang at rock-chips.com
Tue Aug 22 07:34:59 UTC 2017


Rockchip using rockusb for flash emmc via USB, people
use 'reboot loader' in kernel and then want to get a rockusb
device in bootloader for firmware update.

Signed-off-by: Kever Yang <kever.yang at rock-chips.com>
---

Changes in v2:
- use env_set() instead of setenv()

 arch/arm/mach-rockchip/rk3036-board.c | 4 ++++
 arch/arm/mach-rockchip/rk322x-board.c | 4 ++++
 arch/arm/mach-rockchip/rk3288-board.c | 4 ++++
 3 files changed, 12 insertions(+)

diff --git a/arch/arm/mach-rockchip/rk3036-board.c b/arch/arm/mach-rockchip/rk3036-board.c
index a3457f3..1f11f8e 100644
--- a/arch/arm/mach-rockchip/rk3036-board.c
+++ b/arch/arm/mach-rockchip/rk3036-board.c
@@ -40,6 +40,10 @@ static void setup_boot_mode(void)
 		printf("enter UMS!\n");
 		env_set("preboot", "setenv preboot; ums mmc 0");
 		break;
+	case BOOT_LOADER:
+		printf("enter Rockusb!\n");
+		env_set("preboot", "setenv preboot; rockusb 0 mmc 0");
+		break;
 	}
 }
 
diff --git a/arch/arm/mach-rockchip/rk322x-board.c b/arch/arm/mach-rockchip/rk322x-board.c
index 91e3c90..8c77977 100644
--- a/arch/arm/mach-rockchip/rk322x-board.c
+++ b/arch/arm/mach-rockchip/rk322x-board.c
@@ -36,6 +36,10 @@ static void setup_boot_mode(void)
 		printf("enter UMS!\n");
 		env_set("preboot", "setenv preboot; ums mmc 0");
 		break;
+	case BOOT_LOADER:
+		printf("enter Rockusb!\n");
+		env_set("preboot", "setenv preboot; rockusb 0 mmc 0");
+		break;
 	}
 }
 
diff --git a/arch/arm/mach-rockchip/rk3288-board.c b/arch/arm/mach-rockchip/rk3288-board.c
index 74c6cc1..a08658a 100644
--- a/arch/arm/mach-rockchip/rk3288-board.c
+++ b/arch/arm/mach-rockchip/rk3288-board.c
@@ -44,6 +44,10 @@ static void setup_boot_mode(void)
 		env_set("preboot", "setenv preboot; if mmc dev 0;"
 		       "then ums mmc 0; else ums mmc 1;fi");
 		break;
+	case BOOT_LOADER:
+		printf("enter Rockusb!\n");
+		env_set("preboot", "setenv preboot; rockusb 0 mmc 0");
+		break;
 	}
 }
 
-- 
1.9.1



More information about the U-Boot mailing list