From 15e30106ce624ade62ba87c2defe7ea67c88f1b5 Mon Sep 17 00:00:00 2001 From: Kristian Amlie Date: Tue, 7 Sep 2021 08:37:51 +0200 Subject: ARM: vexpress_ca9x4: Reintroduce board in order to use with QEMU. vexpress_ca9x4 is seemingly the only board except for qemu_arm which is able to run U-Boot correctly, using the `-M vexpress-a9` option to QEMU. Building for qemu_arm and running qemu-system-arm with the `-M virt` argument has a number of downsides, most importantly that it only supports virtio storage drivers. This significantly reduces its usefulness in testing memory card and Flash solutions, especially when the tested images are from a third party source. So therefore we reintroduce the vexpress_ca9x4 board in this commit, with the explicit goal of using it with QEMU. A number of differences to note from the original: * Since the board was apparently unmaintained, I have now set myself as the maintainer. * The board has been converted to use the driver model, which was the reason it was removed in the first place. * The vexpress_ca15_tc2 and vexpress_ca5x2 boards, which were removed in the same commit, are not necessary for the QEMU use case, and have been omitted. * An `mmc0` alias was introduced in the dts file. The mmc is not detected correctly without this, now that it's based on the device tree instead of the board's init function. * A couple of other nodes were removed because they were problematic when trying to run the UEFI bootmgr. Once again, the primary use case here is QEMU, and these nodes are not needed for that to work. * Unnecessary board init code has been removed, thanks to driver model and device tree. * `CONFIG_OF_EMBED` has been enabled. I know this goes against recommended practice, but there doesn't seem to be any other way to pass the dtb to U-Boot in the QEMU scenario. Using the -dtb argument does not work, I suppose because U-Boot doesn't use the same mechanics as the kernel when it's booting. * Load addresses have been changed to fit QEMU use case. People wanting to get a more detailed, yet somewhat isolated, diff between this and the original, can run this command: git diff c6c26a05b89f25a06e7562f8c2071b60fd0c9eac~1 -- \ $( git diff-tree --diff-filter=A -r --name-only HEAD~1 HEAD) (Make sure to either check out this commit first, or replace HEAD with the commit ID of this commit) Signed-off-by: Kristian Amlie --- include/configs/vexpress_ca9x4.h | 16 ++++++++++++++++ include/configs/vexpress_common.h | 25 +++---------------------- 2 files changed, 19 insertions(+), 22 deletions(-) create mode 100644 include/configs/vexpress_ca9x4.h (limited to 'include') diff --git a/include/configs/vexpress_ca9x4.h b/include/configs/vexpress_ca9x4.h new file mode 100644 index 00000000000..8157a5868d6 --- /dev/null +++ b/include/configs/vexpress_ca9x4.h @@ -0,0 +1,16 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * (C) Copyright 2011 Linaro + * Ryan Harkin, + * + * Configuration for Versatile Express. Parts were derived from other ARM + * configurations. + */ + +#ifndef __VEXPRESS_CA9X4_H +#define __VEXPRESS_CA9X4_H + +#define CONFIG_VEXPRESS_ORIGINAL_MEMORY_MAP +#include "vexpress_common.h" + +#endif /* VEXPRESS_CA9X4_H */ diff --git a/include/configs/vexpress_common.h b/include/configs/vexpress_common.h index 25088da8ed5..46565db1510 100644 --- a/include/configs/vexpress_common.h +++ b/include/configs/vexpress_common.h @@ -158,29 +158,10 @@ func(DHCP, dhcp, na) #include -#ifdef CONFIG_VEXPRESS_ORIGINAL_MEMORY_MAP -#define CONFIG_PLATFORM_ENV_SETTINGS \ - "loadaddr=0x80008000\0" \ - "ramdisk_addr_r=0x61000000\0" \ - "kernel_addr=0x44100000\0" \ - "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 \ - "loadaddr=0xa0008000\0" \ - "ramdisk_addr_r=0x81000000\0" \ - "kernel_addr=0x0c100000\0" \ - "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 \ + "kernel_addr_r=0x60100000\0" \ + "fdt_addr_r=0x60000000\0" \ + "bootargs=console=tty0 console=ttyAMA0,38400n8\0" \ BOOTENV \ "console=ttyAMA0,38400n8\0" \ "dram=1024M\0" \ -- cgit v1.3.1 From 8a0f5f6e70b32f04bd0a3eb845df7c55a3690e3b Mon Sep 17 00:00:00 2001 From: Kristian Amlie Date: Fri, 10 Sep 2021 08:19:19 +0200 Subject: Avoid polluting CONFIG_ namespace with board specific define. Signed-off-by: Kristian Amlie Reviewed-by: Tom Rini --- include/configs/vexpress_ca9x4.h | 2 +- include/configs/vexpress_common.h | 2 +- scripts/config_whitelist.txt | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/configs/vexpress_ca9x4.h b/include/configs/vexpress_ca9x4.h index 8157a5868d6..ba3f9797a5b 100644 --- a/include/configs/vexpress_ca9x4.h +++ b/include/configs/vexpress_ca9x4.h @@ -10,7 +10,7 @@ #ifndef __VEXPRESS_CA9X4_H #define __VEXPRESS_CA9X4_H -#define CONFIG_VEXPRESS_ORIGINAL_MEMORY_MAP +#define VEXPRESS_ORIGINAL_MEMORY_MAP #include "vexpress_common.h" #endif /* VEXPRESS_CA9X4_H */ diff --git a/include/configs/vexpress_common.h b/include/configs/vexpress_common.h index 46565db1510..02fd9636110 100644 --- a/include/configs/vexpress_common.h +++ b/include/configs/vexpress_common.h @@ -15,7 +15,7 @@ * Definitions copied from linux kernel: * arch/arm/mach-vexpress/include/mach/motherboard.h */ -#ifdef CONFIG_VEXPRESS_ORIGINAL_MEMORY_MAP +#ifdef VEXPRESS_ORIGINAL_MEMORY_MAP /* CS register bases for the original memory map. */ #define V2M_PA_CS0 0x40000000 #define V2M_PA_CS1 0x44000000 diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt index bf7a7d39f60..0fab768713d 100644 --- a/scripts/config_whitelist.txt +++ b/scripts/config_whitelist.txt @@ -3194,7 +3194,6 @@ CONFIG_U_BOOT_HDR_SIZE CONFIG_VAL CONFIG_VAR_SIZE_SPL CONFIG_VERY_BIG_RAM -CONFIG_VEXPRESS_ORIGINAL_MEMORY_MAP CONFIG_VIDEO_BCM2835 CONFIG_VIDEO_BMP_LOGO CONFIG_VIDEO_DA8XX -- cgit v1.3.1