environment: distro: Add SF distro support
v2 cover environment: distro: Add SF distro support
This patch is based on Tom comments from previous version[1] for adding new distro support separately as in include/environment/distro/sf.h
This new sf distro command not touch the existinginclude/config_distro_bootcmd.h.
Used this new SF distro command in rk3399 platform.
[1] https://patchwork.ozlabs.org/patch/1232666/
Any inputs?
Jagan.
Jagan Teki (3):
environment: distro: Add SF distro command
rk3399: Add boot flash script offset, size
rockchip: Enable SF distro bootcmd
include/configs/rk3399_common.h | 3 +++ include/configs/rockchip-common.h | 9 ++++++- include/environment/distro/sf.h | 41 +++++++++++++++++++++++++++++++ 3 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 include/environment/distro/sf.h
Signature · 1 line
2.17.1
A message that is not in the archive (sent off-list or not yet received): 20200410182631.11951-1-jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org
PATCH v2 1/3 environment: distro: Add SF distro command
Add distro boot command support for SPI flash (SF).
This distro boot will read the boot script at specific location at the flash and start sourcing the same.
This file need to include on required include/config file.
---
Changes for v2:
- new patch
include/environment/distro/sf.h | 41 +++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 include/environment/distro/sf.h
include/environment/distro/sf.h new file +41 -0
@@ -0,0 +1,41 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* +* Copyright (C) 2020 Amarula Solutions(India) +* +* SF distro configurations. +*/ + +#ifndef __DISTRO_SF_CONFIG_H +#define __DISTRO_SF_CONFIG_H + +#if CONFIG_IS_ENABLED (CMD_SF ) +#define BOOTENV_SHARED_SF (devtypel) \ + #devtypel "_boot=" \ + "if " #devtypel " probe ${busnum}; then " \ + "devtype=" #devtypel "; " \ + "run scan_sf_for_scripts; " \ + "fi\0" +#define BOOTENV_DEV_SF (devtypeu, devtypel, instance) \ + "bootcmd_" #devtypel #instance "=" \ + "busnum=" #instance "; " \ + "run " #devtypel "_boot\0" +#define BOOTENV_DEV_NAME_SF (devtypeu, devtypel, instance) \ + #devtypel #instance " " +#else +#define BOOTENV_SHARED_SF (devtypel) +#define BOOTENV_DEV_SF \ + BOOT_TARGET_DEVICES_references_SF_without_CONFIG_CMD_SF +#define BOOTENV_DEV_NAME_SF \ + BOOT_TARGET_DEVICES_references_SF_without_CONFIG_CMD_SF + +#endif /* CONFIG_CMD_SF */ + +#define BOOTENV_SF \ + BOOTENV_SHARED_SF(sf) \ + "scan_sf_for_scripts=" \ + "${devtype} read ${scriptaddr} " \ + "${script_offset_f} ${script_size_f}; " \ + "source ${scriptaddr}; " \ + "echo SCRIPT FAILED: continuing...\0" + +#endif /* __DISTRO_SF_CONFIG_H */
Signature · 1 line
2.17.1
Re: [PATCH v2 1/3] environment: distro: Add SF distro command
Quoted 10 lines · Jagan Teki
Add distro boot command support for SPI flash (SF).
This distro boot will read the boot script at specific location at the flash and start sourcing the same.
This file need to include on required
include/configfile.Cc Tom Rini <[email protected]>Signed-off-by Jagan Teki <[email protected]>
Signature · 1 line
Tom
PATCH v2 2/3 rk3399: Add boot flash script offset, size
In reply to a message not in the archiveMost of the SPI flash devices in rockchip (rk3399) are 16MiB size. So, let's use the script offset at the end of 8K.
This way it cannot overlap any offsets being used by software components in flash layout.
---
Changes for v2:
- new patch
include/configs/rk3399_common.h | 2 ++ 1 file changed, 2 insertions(+)
include/configs/rk3399_common.h +2 -0
@@ -48,6 +48,8 @@#define ENV_MEM_LAYOUT_SETTINGS \ "scriptaddr=0x00500000\0" \ + "script_offset_f=0xffe000\0" \ + "script_size_f=0x2000\0" \ "pxefile_addr_r=0x00600000\0" \ "fdt_addr_r=0x01f00000\0" \ "kernel_addr_r=0x02080000\0" \
Signature · 7 lines
2.17.1 _______________________________________________ Linux-rockchip mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-rockchip
A message that is not in the archive (sent off-list or not yet received): 20200410182631.11951-3-jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org
Re: [PATCH v2 2/3] rk3399: Add boot flash script offset, size
Quoted 3 lines
Most of the SPI flash devices in rockchip (rk3399) are 16MiB size. So, let's use the script offset at the end of 8K.
You wouldn't have the commands for writing the idbloader.img/u-boot.itb to these SPI flash on one of these devices by chance?
Peter
Quoted 28 lines
This way it cannot overlap any offsets being used
by software components in flash layout.Reviewed-by Kever Yang <[email protected]>---
Changes for v2:
- new patchinclude/configs/rk3399_common.h | 2 ++ 1 file changed, 2 insertions(+)include/configs/rk3399_common.h +2
-1@@ -48,6 +48,8 @@#define ENV_MEM_LAYOUT_SETTINGS \ "scriptaddr=0x00500000\0" \ + "script_offset_f=0xffe000\0" \ + "script_size_f=0x2000\0" \ "pxefile_addr_r=0x00600000\0" \ "fdt_addr_r=0x01f00000\0" \ "kernel_addr_r=0x02080000\0" \ --2.17.1
A message that is not in the archive (sent off-list or not yet received): CALeDE9O2QaO7CnHPb1nQ2-J6NCWYD=PDSbhtMi-3N68Azm=nVw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Re: [PATCH v2 2/3] rk3399: Add boot flash script offset, size
Quoted 8 lines · Peter Robinson
Quoted 4 lines
Most of the SPI flash devices in rockchip (rk3399) are 16MiB size. So, let's use the script offset at the end of 8K.
You wouldn't have the commands for writing the idbloader.img/u-boot.itb to these SPI flash on one of these devices by chance?
https://wiki.amarulasolutions.com/bsp/rockchip/rk3399/roc-rk3399-pc.html#booting-from
PATCH v2 3/3 rockchip: Enable SF distro bootcmd
In reply to a message not in the archiveEnable 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.
---
Changes for v2:
- update BOOT_TARGET_SF
include/configs/rk3399_common.h | 1 + include/configs/rockchip-common.h | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-)
include/configs/rk3399_common.h +1 -0
@@ -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" \
include/configs/rockchip-common.h +8 -1
@@ -41,11 +41,18 @@#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 +#define BOOT_TARGET_DEVICES (func) \ BOOT_TARGET_MMC(func) \ BOOT_TARGET_USB(func) \ BOOT_TARGET_PXE(func) \ - BOOT_TARGET_DHCP(func) + BOOT_TARGET_DHCP(func) \ + BOOT_TARGET_SF(func)#ifdef CONFIG_ARM64 #define ROOT_UUID "B921B045-1DF0-41C3-AF44-4C6F280D3FAE;\0"
Signature · 1 line
2.17.1
Quoted 12 lines · Jagan Teki
This patch is based on Tom comments from previous version[1] for adding new distro support separately as in
include/environment/distro/sf.hThis new sf distro command not touch the existing
include/config_distro_bootcmd.h.Used this new SF distro command in rk3399 platform.
Quoted 7 lines
Any inputs?
Jagan.Jagan Teki (3):
environment: distro: Add SF distro command
rk3399: Add boot flash script offset, size
rockchip: Enable SF distro bootcmd
Applied to u-boot-spi/master