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

Philipp Tomsich philipp.tomsich at theobroma-systems.com
Tue Sep 12 16:17:58 UTC 2017



On Tue, 22 Aug 2017, Kever Yang wrote:

> 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>

Reviewed-by: Philipp Tomsich <philipp.tomsich at theobroma-systems.com>

See blow for requested changes.

> ---
>
> 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;

Looks like this is duplicated code across all our boards.
Can you please factor this out and call into common code for this?

> 	}
> }
>
> 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;
> 	}
> }
>
>


More information about the U-Boot mailing list