Setting up vexpress u-boot for distro configs and use in virt
Hi all,
The attached patches fix up a minor noise issue if a board defines its own value for CONFIG_BOOTP_VCI_STRING, makes sure we do not hit any noise on vexpress and port to the distro boot configs while maintaining the existing boot setup.
I have built and tested for vexpress_ca15_tc2 using qemu-system-arm, however I hit a snag with an illegal instruction.
U-Boot 2015.07-rc2-00140-gef0f2f5-dirty (Jun 27 2015 - 06:42:35 -0500)
DRAM: 1 GiB WARNING: Caches not enabled Flash: 128 MiB MMC: MMC: 0
*** Warning - bad CRC, using default environment
In: serial Out: serial Err: serial Net: smc911x-0 Warning: smc911x-0 using MAC address from net device
Hit any key to stop autoboot: 0
MMC Device 1 not found
no mmc device at slot 1
switch to partitions #0, OK
mmc0 is current device
env - environment handling commands
Usage:
env default [-f] -a - [forcibly] reset default environment
env default [-f] var [...] - [forcibly] reset variable(s) to their default values env delete [-f] var [...] - [forcibly] delete variable(s)
env export [-t | -b | -c] [-s size] addr [var ...] - export environment env import [-d] [-t [-r] | -b | -c] addr [size] - import environment env print [-a | name ...] - print environment
env run var [...] - run commands in an environment variable
env save - save environment
env set [-f] name [arg ...]
Scanning mmc 0:1...
Found /extlinux/extlinux.conf
Retrieving file: /extlinux/extlinux.conf
486 bytes read in 32 ms (14.6 KiB/s)
Ignoring unknown command: ui Ignoring malformed menu command: autoboot Ignoring malformed menu command: hidden Ignoring unknown command: totaltimeout
Fedora-Server-armhfp-22-3 Boot Options.
1: Fedora-Server-armhfp-22-3 (4.0.4-301.fc22.armv7hl)
Enter choice: 1
1: Fedora-Server-armhfp-22-3 (4.0.4-301.fc22.armv7hl)
Retrieving file: /initramfs-4.0.4-301.fc22.armv7hl.img
38558585 bytes read in 4209 ms (8.7 MiB/s)
Retrieving file: /vmlinuz-4.0.4-301.fc22.armv7hl
5645832 bytes read in 688 ms (7.8 MiB/s)
append: ro root=UUID=fe0fbdbc-e734-4f07-9b1c-7564e3a356b9 console=ttyAMA0,38400n8 Kernel image @ 0xa0008000 [ 0x000000 - 0x562608 ]
Starting kernel ...
undefined instruction
pc : [<9ffac060>] lr : [<9ff83b24>]
sp : 9fee1be8 ip : a0008000 fp : 9ff83b50
r10: 00000000 r9 : 9fee2f00 r8 : 9fee1ce4
r7 : 00000000 r6 : 0000001a r5 : 00000131 r4 : 00000000
r3 : 80002000 r2 : 80002000 r1 : 000008e0 r0 : 00000000
Flags: nzcv IRQs off FIQs off Mode UK6_32
Resetting CPU ...
resetting ...
In the end my goal here is to have a u-boot that works with qemu-system-arm so that the user never needs to extract files out of the system in order to get a booting vm. The answer may well be to make a virt specific u-boot that can set the amount of ram, cpu, etc based on what qemu tells it is there.
Regards
Dennis
PATCH 1/3 PXE: if a board has set its own value for CONFIG_BOOTP_VCI_STRING do not set the default one. Use the board set value instead
--- include/config_distro_defaults.h | 6 ++++++ 1 file changed, 6 insertions(+)
include/config_distro_defaults.h +6 -0
@@ -23,12 +23,18 @@#if defined(__arm__) || defined(__aarch64__)#define CONFIG_BOOTP_PXE_CLIENTARCH 0x100#if defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) +#if !defined(CONFIG_BOOTP_VCI_STRING )#define CONFIG_BOOTP_VCI_STRING "U-boot.armv7" +#endif #elif defined(__aarch64__) +#if !defined(CONFIG_BOOTP_VCI_STRING )#define CONFIG_BOOTP_VCI_STRING "U-boot.armv8" +#endif #else +#if !defined(CONFIG_BOOTP_VCI_STRING )#define CONFIG_BOOTP_VCI_STRING "U-boot.arm"#endif +#endif #elif defined(__i386__)#define CONFIG_BOOTP_PXE_CLIENTARCH 0x0#elif defined(__x86_64__)
Signature · 1 line
2.4.3
PATCH 1/3 PXE: if a board has set its own value for CONFIG_BOOTP_VCI_STRING do not set the default one. Use the board set value instead
This isn't a proper patch setup - please try to add short note line on subject head and description on body.
Quoted 29 lines · Dennis Gilmore
Signed-off-by Dennis Gilmore <[email protected]>--- include/config_distro_defaults.h | 6 ++++++ 1 file changed, 6 insertions(+)include/config_distro_defaults.h +6
-1@@ -23,12 +23,18 @@#if defined(__arm__) || defined(__aarch64__)#define CONFIG_BOOTP_PXE_CLIENTARCH 0x100#if defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) +#if !defined(CONFIG_BOOTP_VCI_STRING )#define CONFIG_BOOTP_VCI_STRING "U-boot.armv7" +#endif #elif defined(__aarch64__) +#if !defined(CONFIG_BOOTP_VCI_STRING )#define CONFIG_BOOTP_VCI_STRING "U-boot.armv8" +#endif #else +#if !defined(CONFIG_BOOTP_VCI_STRING )#define CONFIG_BOOTP_VCI_STRING "U-boot.arm"#endif +#endif #elif defined(__i386__)#define CONFIG_BOOTP_PXE_CLIENTARCH 0x0#elif defined(__x86_64__) --
Quoted 2 lines
2.4.3
thanks!
Signature · 1 line
Jagan | openedev.
PATCH 1/3 PXE: if a board has set its own value for CONFIG_BOOTP_VCI_STRING do not set the default one. Use the board set value instead
In reply to Dennis GilmoreQuoted 1 line · Dennis Gilmore
Signed-off-by Dennis Gilmore <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150813/460f8f60/attachment.sig>
PATCH 2/3 Move setting CONFIG_BOOTP_VCI_STRING to before including the vexpress-common header
In reply to Dennis Gilmore--- include/configs/vexpress_ca15_tc2.h | 2 +- include/configs/vexpress_ca5x2.h | 2 +- include/configs/vexpress_ca9x4.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
include/configs/vexpress_ca15_tc2.h +1 -1
@@ -12,8 +12,8 @@#define __VEXPRESS_CA15X2_TC2_h#define CONFIG_VEXPRESS_EXTENDED_MEMORY_MAP -#include "vexpress_common.h" #define CONFIG_BOOTP_VCI_STRING "U-boot.armv7.vexpress_ca15x2_tc2" +#include "vexpress_common.h" #define CONFIG_SYSFLAGS_ADDR 0x1c010030#define CONFIG_SMP_PEN_ADDR CONFIG_SYSFLAGS_ADDR
include/configs/vexpress_ca5x2.h +1 -1
@@ -12,7 +12,7 @@#define __VEXPRESS_CA5X2_h#define CONFIG_VEXPRESS_EXTENDED_MEMORY_MAP -#include "vexpress_common.h" #define CONFIG_BOOTP_VCI_STRING "U-boot.armv7.vexpress_ca5x2" +#include "vexpress_common.h" #endif /* __VEXPRESS_CA5X2_h */
include/configs/vexpress_ca9x4.h +1 -1
@@ -12,7 +12,7 @@#define __VEXPRESS_CA9X4_H#define CONFIG_VEXPRESS_ORIGINAL_MEMORY_MAP -#include "vexpress_common.h" #define CONFIG_BOOTP_VCI_STRING "U-boot.armv7.vexpress_ca9x4" +#include "vexpress_common.h" #endif /* VEXPRESS_CA9X4_H */
Signature · 1 line
2.4.3
PATCH 2/3 Move setting CONFIG_BOOTP_VCI_STRING to before including the vexpress-common header
Quoted 1 line · Dennis Gilmore
Signed-off-by Dennis Gilmore <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150813/c33846d7/attachment.sig>
PATCH 3/3 port vexpress to use distro boot commands
In reply to Dennis Gilmoreremove options defined in the distro defaults
add distro bot commands
set scriptaddr value
--- include/configs/vexpress_common.h | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-)
include/configs/vexpress_common.h +17 -17
@@ -123,7 +123,6 @@#define CONFIG_SYS_L2CACHE_OFF 1#define CONFIG_INITRD_TAG 1#define CONFIG_SYS_GENERIC_BOARD -#define CONFIG_OF_LIBFDT 1/* Size of malloc() pool */ #define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 128 * 1024)
@@ -152,18 +151,6 @@#define CONFIG_SYS_SERIAL0 V2M_UART0#define CONFIG_SYS_SERIAL1 V2M_UART1 -/* Command line configuration */ -#define CONFIG_CMD_DHCP -#define CONFIG_CMD_PXE -#define CONFIG_MENU -#define CONFIG_CMD_ELF -#define CONFIG_CMD_ENV -#define CONFIG_CMD_PING -#define CONFIG_CMD_BOOTZ -#define CONFIG_SUPPORT_RAW_INITRD - -#define CONFIG_CMD_FAT -#define CONFIG_DOS_PARTITION 1#define CONFIG_MMC 1#define CONFIG_CMD_MMC #define CONFIG_GENERIC_MMC
@@ -177,8 +164,6 @@#define CONFIG_BOOTP_BOOTPATH #define CONFIG_BOOTP_GATEWAY #define CONFIG_BOOTP_HOSTNAME -#define CONFIG_BOOTP_PXE -#define CONFIG_BOOTP_PXE_CLIENTARCH 0x100/* Miscellaneous configurable options */ #define CONFIG_SYS_LOAD_ADDR (V2M_BASE + 0x8000)
@@ -200,9 +185,22 @@ CONFIG_SYS_INIT_RAM_SIZE - \ GENERATED_GBL_DATA_SIZE)#define CONFIG_SYS_INIT_SP_ADDR CONFIG_SYS_GBL_DATA_OFFSET +#define CONFIG_CMD_ECHO + +#include <config_distro_defaults.h> /* Basic environment settings */ -#define CONFIG_BOOTCOMMAND "run bootflash;" +#define CONFIG_BOOTCOMMAND \ + "run distro_bootcmd; " \ + "run bootflash; " + +#define BOOT_TARGET_DEVICES (func) \ + func(MMC, mmc, 1) \ + func(MMC, mmc, 0) \ + func(PXE, pxe, na) \ + func(DHCP, dhcp, na) +#include <config_distro_bootcmd.h> +#ifdef CONFIG_VEXPRESS_ORIGINAL_MEMORY_MAP #define CONFIG_PLATFORM_ENV_SETTINGS \ "loadaddr=0x80008000\0" \
@@ -211,6 +209,7 @@"ramdisk_addr=0x44800000\0" \"maxramdisk=0x1800000\0" \"pxefile_addr_r=0x88000000\0" \ +"scriptaddr=0x88000000\0" \ "kernel_addr_r=0x80008000\0"#elif defined(CONFIG_VEXPRESS_EXTENDED_MEMORY_MAP )#define CONFIG_PLATFORM_ENV_SETTINGS \
@@ -220,10 +219,12 @@"ramdisk_addr=0x0c800000\0" \"maxramdisk=0x1800000\0" \"pxefile_addr_r=0xa8000000\0" \ +"scriptaddr=0xa8000000\0" \ "kernel_addr_r=0xa0008000\0"#endif #define CONFIG_EXTRA_ENV_SETTINGS \ CONFIG_PLATFORM_ENV_SETTINGS \ + BOOTENV \ "console=ttyAMA0,38400n8\0" \ "dram=1024M\0" \ "root=/dev/sda1 rw\0" \
@@ -287,7 +288,6 @@#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE/* Boot args buffer */ #define CONFIG_SYS_LONGHELP -#define CONFIG_CMDLINE_EDITING 1#define CONFIG_SYS_MAXARGS 16/* max command args */ #endif /* VEXPRESS_COMMON_H */
Signature · 1 line
2.4.3
PATCH 3/3 port vexpress to use distro boot commands
Quoted 5 lines · Dennis Gilmore
remove options defined in the distro defaults
add distro bot commands
set scriptaddr valueSigned-off-by Dennis Gilmore <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150813/d3170d1f/attachment.sig>