Commit 6bc50a8f69920b2d2b0c5890e2133748b62656c3
1 parent
bea3d82620
Exists in
smarc_8mq_lf_v2020.04
and in
11 other branches
ARM: uniphier: do not modify bootcmd environment variable at run-time
Some users might want to modify 'bootcmd' at compile-time by editing include/configs/uniphier.h, but overwriting it at run-time makes it impossible. Instead, set 'bootdev' at run-time, which contains the boot device the system is booting from, then indirectly reference it from 'bootcmd'. It is up to users whether to override 'bootcmd'. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Showing 5 changed files with 11 additions and 4 deletions Side-by-side Diff
arch/arm/mach-uniphier/board_late_init.c
... | ... | @@ -66,20 +66,20 @@ |
66 | 66 | switch (uniphier_boot_device_raw()) { |
67 | 67 | case BOOT_DEVICE_MMC1: |
68 | 68 | printf("eMMC Boot"); |
69 | - env_set("bootcmd", "run bootcmd_mmc0; run distro_bootcmd"); | |
69 | + env_set("bootdev", "emmc"); | |
70 | 70 | break; |
71 | 71 | case BOOT_DEVICE_NAND: |
72 | 72 | printf("NAND Boot"); |
73 | - env_set("bootcmd", "run bootcmd_ubifs0; run distro_bootcmd"); | |
73 | + env_set("bootdev", "nand"); | |
74 | 74 | nand_denali_wp_disable(); |
75 | 75 | break; |
76 | 76 | case BOOT_DEVICE_NOR: |
77 | 77 | printf("NOR Boot"); |
78 | - env_set("bootcmd", "run tftpboot; run distro_bootcmd"); | |
78 | + env_set("bootdev", "nor"); | |
79 | 79 | break; |
80 | 80 | case BOOT_DEVICE_USB: |
81 | 81 | printf("USB Boot"); |
82 | - env_set("bootcmd", "run bootcmd_usb0; run distro_bootcmd"); | |
82 | + env_set("bootdev", "usb"); | |
83 | 83 | break; |
84 | 84 | default: |
85 | 85 | printf("Unknown"); |
configs/uniphier_ld4_sld8_defconfig
configs/uniphier_v7_defconfig
configs/uniphier_v8_defconfig
include/configs/uniphier.h
... | ... | @@ -171,6 +171,10 @@ |
171 | 171 | "initrd_high=0xffffffffffffffff\0" \ |
172 | 172 | "scriptaddr=0x85000000\0" \ |
173 | 173 | "nor_base=0x42000000\0" \ |
174 | + "emmcboot=mmcsetn && run bootcmd_mmc${mmc_first_dev}\0" \ | |
175 | + "nandboot=run bootcmd_ubifs0\0" \ | |
176 | + "norboot=run tftpboot\0" \ | |
177 | + "usbboot=run bootcmd_usb0\0" \ | |
174 | 178 | "sramupdate=setexpr tmp_addr $nor_base + 0x50000 &&" \ |
175 | 179 | "tftpboot $tmp_addr $second_image && " \ |
176 | 180 | "setexpr tmp_addr $nor_base + 0x70000 && " \ |