[U-Boot] [PATCH] wandboard: add pxe support, set default boot command like highbank

Robert Nelson robertcnelson at gmail.com
Thu Aug 1 01:27:12 CEST 2013


On Wed, Jul 31, 2013 at 6:01 PM, Rob Herring <robherring2 at gmail.com> wrote:
> Dennis,
>
> On Thu, Jul 25, 2013 at 4:13 PM,  <dgilmore at fedoraproject.org> wrote:
>> From: Dennis Gilmore <dennis at ausil.us>
>>
>> Signed-off-by: Dennis Gilmore <dennis at ausil.us>
>> ---
>>  include/configs/wandboard.h | 42 +++++++++++++++++++++++++++++++++++++++---
>>  1 file changed, 39 insertions(+), 3 deletions(-)
>>
>> diff --git a/include/configs/wandboard.h b/include/configs/wandboard.h
>> index ee6bf21..a5052c5 100644
>> --- a/include/configs/wandboard.h
>> +++ b/include/configs/wandboard.h
>> @@ -58,6 +58,8 @@
>>  #define CONFIG_LOADADDR                        0x12000000
>>  #define CONFIG_SYS_TEXT_BASE           0x17800000
>>
>> +#define CONFIG_SUPPORT_RAW_INITRD
>> +
>>  /* MMC Configuration */
>>  #define CONFIG_FSL_ESDHC
>>  #define CONFIG_FSL_USDHC
>> @@ -72,6 +74,14 @@
>>  #define CONFIG_CMD_FAT
>>  #define CONFIG_DOS_PARTITION
>>
>> +/* PXE support */
>> +#define CONFIG_BOOTP_PXE
>> +#define CONFIG_BOOTP_PXE_CLIENTARCH     0x100
>> +#define CONFIG_BOOTP_VCI_STRING         "U-boot.armv7.wandboard"
>> +#define CONFIG_CMD_PXE
>> +#define CONFIG_MENU
>> +
>> +
>>  /* Ethernet Configuration */
>>  #define CONFIG_CMD_PING
>>  #define CONFIG_CMD_DHCP
>> @@ -117,7 +127,32 @@
>>         "initrd_high=0xffffffff\0" \
>>         "fdt_file=" CONFIG_DEFAULT_FDT_FILE "\0" \
>>         "fdt_addr=0x11000000\0" \
>> +       "pxefile_addr_r=0x12000000\0" \
>> +       "kernel_addr_r=0x13000000\0" \
>> +       "ramdisk_addr_r=0x32000000\0" \
>> +       "fdt_addr_r=0x11000000\0" \
>>         "boot_fdt=try\0" \
>> +       "bootcmd_setup=mmc rescan\0" \
>> +       "bootcmd_pxe=setenv bootfile \"\" ;dhcp; pxe get; pxe boot\0" \
>> +       "bootcmd_disk_scr=ext2load ${boot_ifc} ${bootdevice} ${scr_addr_r} boot.scr && source ${scr_addr_r}\0" \
>> +       "bootcmd_disk_sysboot1=setenv bootfile /boot/extlinux/extlinux.conf; sysboot ${boot_ifc} ${bootdevice} ext2\0" \
>> +       "bootcmd_disk_sysboot2=setenv bootfile /extlinux/extlinux.conf; sysboot ${boot_ifc} ${bootdevice} ext2\0" \
>> +       "bootcmd_disk_uenv=ext2load ${boot_ifc} ${bootdevice} ${uenv_addr_r} uEnv.txt; env import -t ${uenv_addr_r} ${filesize}; run bootcmd_uenv\0" \
>> +       "bootcmd_disk_kernel=ext2load ${boot_ifc} ${bootdevice} ${kernel_addr_r} vmlinuz && ext2load ${boot_ifc} ${bootdevice} ${ramdisk_addr_r} initrd.img && bootz ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr}\0" \
>> +       "bootcmd_disk=run bootcmd_disk_sysboot1; run bootcmd_disk_sysboot2; run bootcmd_disk_uenv; run bootcmd_disk_scr; run bootcmd_disk_kernel\0" \
>> +       "bootcmd_sata=setenv boot_ifc scsi; scsi scan && run bootcmd_disk\0" \
>> +       "bootcmd_mmc=setenv boot_ifc mmc; mmc rescan && run bootcmd_disk\0" \
>> +       "bootcmd_default=run bootcmd_mmc; run bootcmd_sata; run bootcmd_pxe\0" \
>
> I really would not like to see this propagated to another board. I've
> completely redone the env for highbank based on what Stephen Warren
> did for Tegra. It would be good to come up with a common version
> rather than duplicating for each board. This is now what the env looks
> like for highbank in current firmware:
>
> kernel_boot=echo Trying kernel...; ${fs}load ${devtype} ${devnum}
> ${kernel_addr_r} ${prefix}vmlinuz && ${fs}load ${devtype} ${devnum}
> ${ramdisk_addr_r} ${prefix}initrd.img && bootz ${kernel_addr_r}
> ${ramdisk_addr_r}:${filesize} ${fdt_addr}
> script_boot=echo Trying script images...; for script in
> ${boot_scripts}; do ${fs}load ${devtype} ${devnum} ${script_addr}
> ${prefix}${script} && echo Executing ${prefix}${script}... && source
> ${script_addr}; done;
> env_boot=echo Trying environment file...; ${fs}load ${devtype}
> ${devnum} ${script_addr} ${prefix}uEnv.txt && Executing
> ${prefix}uEnv.txt... && env import -t  ${script_addr} ${filesize}};

Guys, this is just silly.. Your using both uEnv.txt/boot.scr scripts
by default, which you could use to "hide" all this extra stuff in a
text file on the boot drive, that way mainline u-boot doesn't have to
be patched for every little change. ;)

I know it's bikeshedding, but most boards can be converted to just:

#define CONFIG_BOOTCOMMAND \
	"mmc dev ${mmcdev};" \
	"if mmc rescan; then " \
		"echo SD/MMC found on device ${mmcdev};" \
		"if run loadbootenv; then " \
			"run importbootenv;" \
		"fi;" \
		"if test -n $uenvcmd; then " \
			"echo Running uenvcmd ...;" \
			"run uenvcmd;" \
		"fi;" \
		"if run loadsomefailsafedefault; then " \
			"run mmcboot;" \
		"fi;" \
	"fi;"
#endif

where:

"loadbootenv=load mmc ${mmcdev}:${mmcpart} ${loadaddr} uEnv.txt\0" \
"importbootenv=echo Importing environment from mmc (uEnv.txt)...; " \
	"env import -t ${loadaddr} ${filesize}\0" \

Regards,

-- 
Robert Nelson
http://www.rcn-ee.com/


More information about the U-Boot mailing list