[v3] rockchip: Enable SF distro bootcmd

Message ID 20200428100428.19739-1-jagan@amarulasolutions.com
State New
Headers show
Series
  • [v3] rockchip: Enable SF distro bootcmd
Related show

Commit Message

Jagan Teki April 28, 2020, 10:04 a.m. UTC
Enable SPI flash(SF) distro boot command in Rockchip.

This distro boot will read the boot script at specific
location at the flash and start sourcing the same.

Included the SF device at the last of the target devices
list since all the rest of the devices on the list have
more possibility to boot the distribution due to the
size of the SPI flash is concern.

Cc: Tom Rini <trini@konsulko.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
---
Changes for v3:
- Don't use SF distro px30

 include/configs/rk3399_common.h   |  1 +
 include/configs/rockchip-common.h | 15 +++++++++++++++
 2 files changed, 16 insertions(+)

Comments

Kever Yang April 28, 2020, 2:15 p.m. UTC | #1
On 2020/4/28 下午6:04, Jagan Teki wrote:
> Enable SPI flash(SF) distro boot command in Rockchip.
>
> This distro boot will read the boot script at specific
> location at the flash and start sourcing the same.
>
> Included the SF device at the last of the target devices
> list since all the rest of the devices on the list have
> more possibility to boot the distribution due to the
> size of the SPI flash is concern.
>
> Cc: Tom Rini <trini@konsulko.com>
> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>


Reviewed-by: Kever Yang <kever.yang@rock-chips.com>

Thanks,
- Kever
> ---
> Changes for v3:
> - Don't use SF distro px30
>
>   include/configs/rk3399_common.h   |  1 +
>   include/configs/rockchip-common.h | 15 +++++++++++++++
>   2 files changed, 16 insertions(+)
>
> diff --git a/include/configs/rk3399_common.h b/include/configs/rk3399_common.h
> index 01a9174bd2..f0ae6e67a7 100644
> --- a/include/configs/rk3399_common.h
> +++ b/include/configs/rk3399_common.h
> @@ -60,6 +60,7 @@
>   #endif
>   
>   #include <config_distro_bootcmd.h>
> +#include <environment/distro/sf.h>
>   #define CONFIG_EXTRA_ENV_SETTINGS \
>   	ENV_MEM_LAYOUT_SETTINGS \
>   	"fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \
> diff --git a/include/configs/rockchip-common.h b/include/configs/rockchip-common.h
> index b55e09a9ca..2d5d29849d 100644
> --- a/include/configs/rockchip-common.h
> +++ b/include/configs/rockchip-common.h
> @@ -41,11 +41,26 @@
>   	#define BOOT_TARGET_DHCP(func)
>   #endif
>   
> +#if CONFIG_IS_ENABLED(CMD_SF)
> +	#define BOOT_TARGET_SF(func)	func(SF, sf, 0)
> +#else
> +	#define BOOT_TARGET_SF(func)
> +#endif
> +
> +#ifndef CONFIG_ROCKCHIP_PX30
> +#define BOOT_TARGET_DEVICES(func) \
> +	BOOT_TARGET_MMC(func) \
> +	BOOT_TARGET_USB(func) \
> +	BOOT_TARGET_PXE(func) \
> +	BOOT_TARGET_DHCP(func) \
> +	BOOT_TARGET_SF(func)
> +#else
>   #define BOOT_TARGET_DEVICES(func) \
>   	BOOT_TARGET_MMC(func) \
>   	BOOT_TARGET_USB(func) \
>   	BOOT_TARGET_PXE(func) \
>   	BOOT_TARGET_DHCP(func)
> +#endif
>   
>   #ifdef CONFIG_ARM64
>   #define ROOT_UUID "B921B045-1DF0-41C3-AF44-4C6F280D3FAE;\0"

Patch

diff --git a/include/configs/rk3399_common.h b/include/configs/rk3399_common.h
index 01a9174bd2..f0ae6e67a7 100644
--- a/include/configs/rk3399_common.h
+++ b/include/configs/rk3399_common.h
@@ -60,6 +60,7 @@ 
 #endif
 
 #include <config_distro_bootcmd.h>
+#include <environment/distro/sf.h>
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	ENV_MEM_LAYOUT_SETTINGS \
 	"fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \
diff --git a/include/configs/rockchip-common.h b/include/configs/rockchip-common.h
index b55e09a9ca..2d5d29849d 100644
--- a/include/configs/rockchip-common.h
+++ b/include/configs/rockchip-common.h
@@ -41,11 +41,26 @@ 
 	#define BOOT_TARGET_DHCP(func)
 #endif
 
+#if CONFIG_IS_ENABLED(CMD_SF)
+	#define BOOT_TARGET_SF(func)	func(SF, sf, 0)
+#else
+	#define BOOT_TARGET_SF(func)
+#endif
+
+#ifndef CONFIG_ROCKCHIP_PX30
+#define BOOT_TARGET_DEVICES(func) \
+	BOOT_TARGET_MMC(func) \
+	BOOT_TARGET_USB(func) \
+	BOOT_TARGET_PXE(func) \
+	BOOT_TARGET_DHCP(func) \
+	BOOT_TARGET_SF(func)
+#else
 #define BOOT_TARGET_DEVICES(func) \
 	BOOT_TARGET_MMC(func) \
 	BOOT_TARGET_USB(func) \
 	BOOT_TARGET_PXE(func) \
 	BOOT_TARGET_DHCP(func)
+#endif
 
 #ifdef CONFIG_ARM64
 #define ROOT_UUID "B921B045-1DF0-41C3-AF44-4C6F280D3FAE;\0"