[U-Boot] [PATCH 1/4] configs: pcm051: Support distro bootcmds

Add support for distro bootcmds.
Signed-off-by: Matwey V. Kornilov matwey.kornilov@gmail.com --- include/configs/pcm051.h | 49 ++++++++++++++++++++++++++++-------------------- 1 file changed, 29 insertions(+), 20 deletions(-)
diff --git a/include/configs/pcm051.h b/include/configs/pcm051.h index a59e88171f..c1a5c6fe32 100644 --- a/include/configs/pcm051.h +++ b/include/configs/pcm051.h @@ -25,6 +25,34 @@ #define CONFIG_MACH_TYPE MACH_TYPE_PCM051
/* set to negative value for no autoboot */ +#define BOOTENV_DEV_LEGACY_MMC(devtypeu, devtypel, instance) \ + "bootcmd_" #devtypel #instance "=" \ + "setenv mmcdev " #instance"; "\ + "setenv bootpart " #instance":2 ; "\ + "run mmcboot\0" + +#define BOOTENV_DEV_NAME_LEGACY_MMC(devtypeu, devtypel, instance) \ + #devtypel #instance " " + +#define BOOTENV_DEV_NAND(devtypeu, devtypel, instance) \ + "bootcmd_" #devtypel "=" \ + "run nandboot\0" + +#define BOOTENV_DEV_NAME_NAND(devtypeu, devtypel, instance) \ + #devtypel #instance " " + +#define BOOT_TARGET_DEVICES(func) \ + func(MMC, mmc, 0) \ + func(LEGACY_MMC, legacy_mmc, 0) \ + func(MMC, mmc, 1) \ + func(LEGACY_MMC, legacy_mmc, 1) \ + func(NAND, nand, 0) + +#define CONFIG_BOOTCOMMAND \ + "run distro_bootcmd" + +#include <config_distro_bootcmd.h> + #define CONFIG_EXTRA_ENV_SETTINGS \ "loadaddr=0x80007fc0\0" \ "fdtaddr=0x80000000\0" \ @@ -62,26 +90,7 @@ "ramboot=echo Booting from ramdisk ...; " \ "run ramargs; " \ "bootm ${loadaddr}\0" \ - -#define CONFIG_BOOTCOMMAND \ - "mmc dev ${mmcdev}; if mmc rescan; then " \ - "echo SD/MMC found on device ${mmcdev};" \ - "if run loadbootscript; then " \ - "run bootscript;" \ - "else " \ - "if run loadbootenv; then " \ - "echo Loaded environment from ${bootenv};" \ - "run importbootenv;" \ - "fi;" \ - "if test -n $uenvcmd; then " \ - "echo Running uenvcmd ...;" \ - "run uenvcmd;" \ - "fi;" \ - "if run loaduimage; then " \ - "run mmcboot;" \ - "fi;" \ - "fi ;" \ - "fi;" \ + BOOTENV
/* Clock Defines */ #define V_OSCK 25000000 /* Clock output from T2 */

Signed-off-by: Matwey V. Kornilov matwey.kornilov@gmail.com --- include/configs/pcm051.h | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/include/configs/pcm051.h b/include/configs/pcm051.h index c1a5c6fe32..3bdd30d84f 100644 --- a/include/configs/pcm051.h +++ b/include/configs/pcm051.h @@ -53,7 +53,11 @@
#include <config_distro_bootcmd.h>
+#include <environment/ti/dfu.h> +#include <environment/ti/mmc.h> + #define CONFIG_EXTRA_ENV_SETTINGS \ + DEFAULT_MMC_TI_ARGS \ "loadaddr=0x80007fc0\0" \ "fdtaddr=0x80000000\0" \ "rdaddr=0x81000000\0" \ @@ -61,15 +65,8 @@ "fdtfile=pcm051.dtb\0" \ "console=ttyO0,115200n8\0" \ "optargs=\0" \ - "mmcdev=0\0" \ - "mmcroot=/dev/mmcblk0p2 ro\0" \ - "mmcrootfstype=ext4 rootwait\0" \ "ramroot=/dev/ram0 rw ramdisk_size=65536 initrd=${rdaddr},64M\0" \ "ramrootfstype=ext2\0" \ - "mmcargs=setenv bootargs console=${console} " \ - "${optargs} " \ - "root=${mmcroot} " \ - "rootfstype=${mmcrootfstype}\0" \ "bootenv=uEnv.txt\0" \ "loadbootscript=load mmc ${mmcdev} ${loadaddr} boot.scr\0" \ "bootscript=echo Running bootscript from mmc${mmcdev} ...; " \ @@ -85,7 +82,7 @@ "loaduimagefat=fatload mmc ${mmcdev} ${loadaddr} ${bootfile}\0" \ "loaduimage=ext2load mmc ${mmcdev}:2 ${loadaddr} ${bootfile}\0" \ "mmcboot=echo Booting from mmc ...; " \ - "run mmcargs; " \ + "run args_mmc; " \ "bootm ${loadaddr}\0" \ "ramboot=echo Booting from ramdisk ...; " \ "run ramargs; " \

On Sat, Jun 02, 2018 at 08:22:26PM +0300, Matwey V. Kornilov wrote:
Signed-off-by: Matwey V. Kornilov matwey.kornilov@gmail.com
Applied to u-boot/master, thanks!

It appears that DEFAULT_LINUX_BOOT_ENV can be used to boot pcm051 board.
Signed-off-by: Matwey V. Kornilov matwey.kornilov@gmail.com --- include/configs/pcm051.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/include/configs/pcm051.h b/include/configs/pcm051.h index 3bdd30d84f..0475d80666 100644 --- a/include/configs/pcm051.h +++ b/include/configs/pcm051.h @@ -57,10 +57,8 @@ #include <environment/ti/mmc.h>
#define CONFIG_EXTRA_ENV_SETTINGS \ + DEFAULT_LINUX_BOOT_ENV \ DEFAULT_MMC_TI_ARGS \ - "loadaddr=0x80007fc0\0" \ - "fdtaddr=0x80000000\0" \ - "rdaddr=0x81000000\0" \ "bootfile=uImage\0" \ "fdtfile=pcm051.dtb\0" \ "console=ttyO0,115200n8\0" \

On Sat, Jun 02, 2018 at 08:22:27PM +0300, Matwey V. Kornilov wrote:
It appears that DEFAULT_LINUX_BOOT_ENV can be used to boot pcm051 board.
Signed-off-by: Matwey V. Kornilov matwey.kornilov@gmail.com
Applied to u-boot/master, thanks!

In upstream Linux kernel, the fdtfile for this specific board is called am335x-wega-rdk.dtb
Signed-off-by: Matwey V. Kornilov matwey.kornilov@gmail.com --- include/configs/pcm051.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/configs/pcm051.h b/include/configs/pcm051.h index 0475d80666..5381ed1f45 100644 --- a/include/configs/pcm051.h +++ b/include/configs/pcm051.h @@ -60,7 +60,7 @@ DEFAULT_LINUX_BOOT_ENV \ DEFAULT_MMC_TI_ARGS \ "bootfile=uImage\0" \ - "fdtfile=pcm051.dtb\0" \ + "fdtfile=am335x-wega-rdk.dtb\0" \ "console=ttyO0,115200n8\0" \ "optargs=\0" \ "ramroot=/dev/ram0 rw ramdisk_size=65536 initrd=${rdaddr},64M\0" \

On Sat, Jun 02, 2018 at 08:22:28PM +0300, Matwey V. Kornilov wrote:
In upstream Linux kernel, the fdtfile for this specific board is called am335x-wega-rdk.dtb
Signed-off-by: Matwey V. Kornilov matwey.kornilov@gmail.com
Applied to u-boot/master, thanks!

On Sat, Jun 02, 2018 at 08:22:25PM +0300, Matwey V. Kornilov wrote:
Add support for distro bootcmds.
Signed-off-by: Matwey V. Kornilov matwey.kornilov@gmail.com
Applied to u-boot/master, thanks!
participants (2)
-
Matwey V. Kornilov
-
Tom Rini