Skip to contentSkip to conversation

VExpress64 board family improvements

PATCH In review Peter Hoyes 3 participants 16 messages Nov 11, 2021 – Jan 7, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

v2 cover VExpress64 board family improvements

From: Peter Hoyes <[email protected]>

These patches add the follow improvements to the VExpress64 board family (BASE_FVP and Juno):

* Add documentation
* Allow use of OF_BOARD for BASE_FVP (off by default)
* Allow use of the virtio-net driver (off by default)
* Refactor header file to make it easier to add new FVPs with similar
* memory layouts
* Fix issue where fdt is called with invalid arguments during BASE_FVP boot
* Update BASE_FVP env vars to recommended names

This is towards future work to add support for the FVP_BaseR_AEMv8R.

Changes in v2:
* Add note about building U-Boot with TF-A to FVP doc
* Modify BASE_FVP env var addresses to allow space for larger kernels
* OF_BOARD cleanups

Peter Hoyes (5):
doc: Add documentation for the Arm VExpress64 board configs
vexpress64: Refactor header file to make it easier to add new FVPs
vexpress64: Clean up BASE_FVP boot configuration
vexpress64: Enable OF_CONTROL and OF_BOARD for VExpress64
vexpress64: Enable VIRTIO_NET network driver

 board/armltd/vexpress64/Kconfig               |   2 +-
 board/armltd/vexpress64/Makefile              |   2 +-
 board/armltd/vexpress64/lowlevel_init.S       |  12 +++
 board/armltd/vexpress64/vexpress64.c          |  33 ++++++
 doc/README.semihosting                        |   2 +-
 doc/board/armltd/index.rst                    |   9 ++
 doc/board/armltd/vexpress64.rst               |  51 +++++++++
 doc/board/index.rst                           |   1 +
 .../{vexpress_aemv8a.h => vexpress_aemv8.h}   | 102 ++++++++++--------
 9 files changed, 167 insertions(+), 47 deletions(-)
 create mode 100644 board/armltd/vexpress64/lowlevel_init.S
 create mode 100644 doc/board/armltd/index.rst
 create mode 100644 doc/board/armltd/vexpress64.rst
 rename include/configs/{vexpress_aemv8a.h => vexpress_aemv8.h} (72%)
Signature · 1 line
2.25.1
#1 lore raw

PATCH v2 1/5 doc: Add documentation for the Arm VExpress64 board configs

From: Peter Hoyes <[email protected]>

Create a new documentation section for Arm Ltd boards with a sub-page for the VExpress64 boards (FVP-A and Juno).

---
 doc/board/armltd/index.rst      |  9 ++++++
 doc/board/armltd/vexpress64.rst | 51 +++++++++++++++++++++++++++++++++
 doc/board/index.rst             |  1 +
 3 files changed, 61 insertions(+)
 create mode 100644 doc/board/armltd/index.rst
 create mode 100644 doc/board/armltd/vexpress64.rst
doc/board/armltd/index.rst new file +9 -0
new file mode 100644
index 0000000000..c20d8a0a26
@@ -0,0 +1,9 @@
+.. SPDX-License-Identifier: GPL-2.0
+
+Arm Ltd
+=============
+
+.. toctree::
+   :maxdepth: 2
+
+   vexpress64.rst
doc/board/armltd/vexpress64.rst new file +51 -0

52 lines not on this page · raw message

doc/board/index.rst +1 -0
index 74ea33e081..78b486538b 100644
@@ -11,6 +11,7 @@ Board-specific doc
    AndesTech/index
    amlogic/index
    apple/index
+   armltd/index
    atmel/index
    congatec/index
    coreboot/index
Signature · 1 line
2.25.1
Reviewed-by on v2 1/5
#2 lore raw

Re: [PATCH v2 1/5] doc: Add documentation for the Arm VExpress64 board configs

Quoted 4 lines · On Thu, 11 Nov 2021 09:25:59 +0000 Peter Hoyes <[email protected]> wrote:

From: Peter Hoyes <[email protected]>

Create a new documentation section for Arm Ltd boards with a sub-page for the VExpress64 boards (FVP-A and Juno).

Thanks for the changes, looks good now:

Quoted 1 line

Cheers,
Andre

Quoted 93 lines
---
 doc/board/armltd/index.rst      |  9 ++++++
 doc/board/armltd/vexpress64.rst | 51 +++++++++++++++++++++++++++++++++
 doc/board/index.rst             |  1 +
 3 files changed, 61 insertions(+)
 create mode 100644 doc/board/armltd/index.rst
 create mode 100644 doc/board/armltd/vexpress64.rst
doc/board/armltd/index.rst new file +9 -0
new file mode 100644
index 0000000000..c20d8a0a26
@@ -0,0 +1,9 @@
+.. SPDX-License-Identifier: GPL-2.0
+
+Arm Ltd
+=============
+
+.. toctree::
+   :maxdepth: 2
+
+   vexpress64.rst
doc/board/armltd/vexpress64.rst new file +51 -0
new file mode 100644
index 0000000000..d87b1c38f5
@@ -0,0 +1,51 @@
+.. SPDX-License-Identifier: GPL-2.0
+
+Arm Versatile Express
+=====================
+
+The vexpress_* board configuration supports the following platforms:
+
+ * FVP_Base_RevC-2xAEMvA
+ * Juno development board
+
+Fixed Virtual Platforms
+-----------------------
+
+The Fixed Virtual Platforms (FVP) are complete simulations of an Arm system,
+including processor, memory and peripherals. They are set out in a "programmer's
+view", which gives a comprehensive model on which to build and test software.
+
+The supported FVPs are available free of charge and can be downloaded from the
+Arm developer site [1]_ (user registration might be required).
+
+Supported features:
+
+ * GICv3
+ * Generic timer
+ * PL011 UART
+
+The default configuration assumes that U-Boot is bootstrapped using a suitable
+bootloader, such as Trusted Firmware-A [4]_. The u-boot binary can be passed
+into the TF-A build: ``make PLAT=<platform> all fip BL33=u-boot.bin``
+
+The FVPs can be debugged using Arm Development Studio [2]_.
+
+Juno
+----
+
+Juno is an Arm development board with the following features:
+
+ * Arm Cortex-A72/A57 and Arm Cortex-A53 in a "big.LITTLE" configuration
+ * A PCIe Gen2.0 bus with 4 lanes
+ * 8GB of DRAM
+ * GICv2
+
+More details can be found in the board documentation [3]_.
+
+References
+----------
+
+.. [1] https://developer.arm.com/tools-and-software/simulation-models/fixed-virtual-platforms
+.. [2] https://developer.arm.com/tools-and-software/embedded/arm-development-studio
+.. [3] https://developer.arm.com/tools-and-software/development-boards/juno-development-board
+.. [4] https://trustedfirmware-a.readthedocs.io/
\ No newline at end of file
doc/board/index.rst +1 -0
index 74ea33e081..78b486538b 100644
@@ -11,6 +11,7 @@ Board-specific doc
    AndesTech/index
    amlogic/index
    apple/index
+   armltd/index
    atmel/index
    congatec/index
    coreboot/index
#4 lore raw

PATCH v2 2/5 vexpress64: Refactor header file to make it easier to add new FVPs

In reply to Peter Hoyes

From: Peter Hoyes <[email protected]>

Rename from vexpress_aemv8a.h -> vepxress_aemv8.h as new FVPs may not be v8-A. No change in behavior.

This is towards future work to enable support for the FVP_BaseR.

---
 board/armltd/vexpress64/Kconfig               |  2 +-
 doc/README.semihosting                        |  2 +-
 .../{vexpress_aemv8a.h => vexpress_aemv8.h}   | 48 ++++++++++---------
 3 files changed, 27 insertions(+), 25 deletions(-)
 rename include/configs/{vexpress_aemv8a.h => vexpress_aemv8.h} (88%)
board/armltd/vexpress64/Kconfig +1 -1
index 1d13f542e6..4aab3f092e 100644
@@ -7,7 +7,7 @@ config SYS_VENDOR
 	default "armltd"
 
 config SYS_CONFIG_NAME
-	default "vexpress_aemv8a"
+	default "vexpress_aemv8"
 
 config JUNO_DTB_PART
 	string "NOR flash partition holding DTB"
doc/README.semihosting +1 -1
index c019999bed..f382d0131e 100644
@@ -25,7 +25,7 @@ or turning on CONFIG_BASE_FVP for the more full featured model.
 Rather than create a new armv8 board similar to armltd/vexpress64, add
 semihosting calls to the existing one, enabled with CONFIG_SEMIHOSTING
 and CONFIG_BASE_FVP both set. Also reuse the existing board config file
-vexpress_aemv8a.h but differentiate the two models by the presence or
+vexpress_aemv8.h but differentiate the two models by the presence or
 absence of CONFIG_BASE_FVP. This change is tested and works on both the
 Foundation and Base fastmodel simulators.
 
include/configs/vexpress_aemv8.h renamed from include/configs/vexpress_aemv8a.h +25 -23

108 lines not on this page · raw message

Signature · 1 line
2.25.1
Reviewed-by on v2 2/5
#5 lore raw

Re: [PATCH v2 2/5] vexpress64: Refactor header file to make it easier to add new FVPs

On Thu, 11 Nov 2021 09:26:00 +0000
Peter Hoyes <[email protected]> wrote:

Hi Peter,

Quoted 8 lines

From: Peter Hoyes <[email protected]>

Rename from vexpress_aemv8a.h -> vepxress_aemv8.h as new FVPs may not be v8-A. No change in behavior.

This is towards future work to enable support for the FVP_BaseR.

Please carry over Reviewed-by: tags from former revisions, when you don't change a patch. That not only helps the maintainer to see at one glance what is missing, but also the reviewers, who know what patch to skip ;-)

As diff told me that v1 and v2 are identical, for the records:

Cheers,
Andre

Quoted 154 lines
---
 board/armltd/vexpress64/Kconfig               |  2 +-
 doc/README.semihosting                        |  2 +-
 .../{vexpress_aemv8a.h => vexpress_aemv8.h}   | 48 ++++++++++---------
 3 files changed, 27 insertions(+), 25 deletions(-)
 rename include/configs/{vexpress_aemv8a.h => vexpress_aemv8.h} (88%)
(quoted diff) +0 -0

b/board/armltd/vexpress64/Kconfig index 1d13f542e6..4aab3f092e 100644

board/armltd/vexpress64/Kconfig +1 -1
@@ -7,7 +7,7 @@ config SYS_VENDOR
 	default "armltd"
 
 config SYS_CONFIG_NAME
-	default "vexpress_aemv8a"
+	default "vexpress_aemv8"
 
 config JUNO_DTB_PART
 	string "NOR flash partition holding DTB"
doc/README.semihosting +0 -0
index c019999bed..f382d0131e 100644
@@ -25,7 +25,7 @@ or turning on CONFIG_BASE_FVP for the more full

featured model. Rather than create a new armv8 board similar to armltd/vexpress64, add semihosting calls to the existing one, enabled with CONFIG_SEMIHOSTING and CONFIG_BASE_FVP both set. Also reuse the existing board config file -vexpress_aemv8a.h but differentiate the two models by the presence or +vexpress_aemv8.h but differentiate the two models by the presence or absence of CONFIG_BASE_FVP. This change is tested and works on both the Foundation and Base fastmodel simulators.

(quoted diff) +0 -0

b/include/configs/vexpress_aemv8.h similarity index 88% rename from include/configs/vexpress_aemv8a.h rename to include/configs/vexpress_aemv8.h index df22584d9a..49517a60b0 100644

include/configs/vexpress_aemv8.h renamed from include/configs/vexpress_aemv8a.h +4 -3
@@ -4,36 +4,37 @@
  *   configurations.
  */
 
-#ifndef __VEXPRESS_AEMV8A_H
-#define __VEXPRESS_AEMV8A_H
+#ifndef __VEXPRESS_AEMV8_H
+#define __VEXPRESS_AEMV8_H
 
 #define CONFIG_REMAKE_ELF
 
 /* Link Definitions */
-#ifdef CONFIG_TARGET_VEXPRESS64_BASE_FVP
+#ifdef CONFIG_TARGET_VEXPRESS64_JUNO
+#define CONFIG_SYS_INIT_SP_ADDR         (CONFIG_SYS_SDRAM_BASE +

0x7fff0) +#else
/* ATF loads u-boot here for BASE_FVP model */
#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_SDRAM_BASE +
0x03f00000) -#elif CONFIG_TARGET_VEXPRESS64_JUNO
-#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_SDRAM_BASE +
0x7fff0) #endif

#define CONFIG_SYS_BOOTM_LEN (64 << 20) /* Increase max gunzip
size */
/* CS register bases for the original memory map. */

include/configs/vexpress_aemv8.h renamed from include/configs/vexpress_aemv8a.h +9 -6
-#define V2M_PA_CS0			0x00000000
-#define V2M_PA_CS1			0x14000000
-#define V2M_PA_CS2			0x18000000
-#define V2M_PA_CS3			0x1c000000
-#define V2M_PA_CS4			0x0c000000
-#define V2M_PA_CS5			0x10000000
+#define V2M_BASE			0x80000000
+#define V2M_PA_BASE			0x00000000
+
+#define V2M_PA_CS0			(V2M_PA_BASE + 0x00000000)
+#define V2M_PA_CS1			(V2M_PA_BASE + 0x14000000)
+#define V2M_PA_CS2			(V2M_PA_BASE + 0x18000000)
+#define V2M_PA_CS3			(V2M_PA_BASE + 0x1c000000)
+#define V2M_PA_CS4			(V2M_PA_BASE + 0x0c000000)
+#define V2M_PA_CS5			(V2M_PA_BASE + 0x10000000)
 
 #define V2M_PERIPH_OFFSET(x)		(x << 16)
 #define V2M_SYSREGS			(V2M_PA_CS3 +

V2M_PERIPH_OFFSET(1)) #define V2M_SYSCTL
(V2M_PA_CS3 + V2M_PERIPH_OFFSET(2)) #define V2M_SERIAL_BUS_PCI

	(V2M_PA_CS3 + V2M_PERIPH_OFFSET(3)) 
include/configs/vexpress_aemv8.h renamed from include/configs/vexpress_aemv8a.h +0 -2
-#define V2M_BASE			0x80000000
-
 /* Common peripherals relative to CS7. */
 #define V2M_AACI			(V2M_PA_CS3 +

V2M_PERIPH_OFFSET(4)) #define V2M_MMCI (V2M_PA_CS3 + V2M_PERIPH_OFFSET(5)) @@ -72,23 +73,23 @@

/* Generic Interrupt Controller Definitions */
#ifdef CONFIG_GICV3

include/configs/vexpress_aemv8.h renamed from include/configs/vexpress_aemv8a.h +10 -9
-#define GICD_BASE			(0x2f000000)
-#define GICR_BASE			(0x2f100000)
+#define GICD_BASE			(V2M_PA_BASE + 0x2f000000)
+#define GICR_BASE			(V2M_PA_BASE + 0x2f100000)
 #else
 
-#ifdef CONFIG_TARGET_VEXPRESS64_BASE_FVP
-#define GICD_BASE			(0x2f000000)
-#define GICC_BASE			(0x2c000000)
-#elif CONFIG_TARGET_VEXPRESS64_JUNO
+#ifdef CONFIG_TARGET_VEXPRESS64_JUNO
 #define GICD_BASE			(0x2C010000)
 #define GICC_BASE			(0x2C02f000)
+#else
+#define GICD_BASE			(V2M_PA_BASE + 0x2f000000)
+#define GICC_BASE			(V2M_PA_BASE + 0x2c000000)
 #endif
 #endif /* !CONFIG_GICV3 */
 
 #ifndef CONFIG_TARGET_VEXPRESS64_JUNO
 /* The Vexpress64 simulators use SMSC91C111 */
 #define CONFIG_SMC91111			1
-#define CONFIG_SMC91111_BASE		(0x01A000000)
+#define CONFIG_SMC91111_BASE		(V2M_PA_BASE + 0x01A000000)
 #endif
 
 /* PL011 Serial Configuration */
@@ -113,7 +114,7 @@
 #ifdef CONFIG_TARGET_VEXPRESS64_JUNO
 #define PHYS_SDRAM_2			(0x880000000)
 #define PHYS_SDRAM_2_SIZE		0x180000000
-#elif CONFIG_TARGET_VEXPRESS64_BASE_FVP && CONFIG_NR_DRAM_BANKS == 2
+#elif CONFIG_NR_DRAM_BANKS == 2
 #define PHYS_SDRAM_2			(0x880000000)
 #define PHYS_SDRAM_2_SIZE		0x80000000
 #endif
@@ -200,6 +201,7 @@
 				"  booti $kernel_addr - $fdt_addr; " \
 				"fi"
 #endif
+
 #endif
 
 /* Monitor Command Prompt */
@@ -213,7 +215,7 @@
 /* Store environment at top of flash in the same location as blank.img
 */ /* in the Juno firmware. */
 #else
-#define CONFIG_SYS_FLASH_BASE		0x0C000000
+#define CONFIG_SYS_FLASH_BASE		(V2M_PA_BASE + 0x0C000000)
 /* 256 x 256KiB sectors */
 #define CONFIG_SYS_MAX_FLASH_SECT	256
 /* Store environment at top of flash */
@@ -230,4 +232,4 @@
 #define CONFIG_SYS_FLASH_EMPTY_INFO	/* flinfo indicates empty

blocks */ #define FLASH_MAX_SECTOR_SIZE 0x00040000

include/configs/vexpress_aemv8.h renamed from include/configs/vexpress_aemv8a.h +1 -1
-#endif /* __VEXPRESS_AEMV8A_H */
+#endif /* __VEXPRESS_AEMV8_H */
#6 lore raw

Re: [PATCH v2 2/5] vexpress64: Refactor header file to make it easier to add new FVPs

In reply to Peter Hoyes
Quoted 9 lines · Peter Hoyes

From: Peter Hoyes <[email protected]>

Rename from vexpress_aemv8a.h -> vepxress_aemv8.h as new FVPs may not be v8-A. No change in behavior.

This is towards future work to enable support for the FVP_BaseR.

Applied to u-boot/next, thanks!

Signature · 1 line
Tom
#7 lore raw

PATCH v2 3/5 vexpress64: Clean up BASE_FVP boot configuration

In reply to Peter Hoyes

From: Peter Hoyes <[email protected]>

Move env var address values to #defines so they can be reused elsewhere.

Rename env var names to those recommended in the README and modify addresses to allow more space for the kernel.

Fix issue where fdt is called with invalid arguments when booting without a ramdisk.

---
 include/configs/vexpress_aemv8.h | 50 ++++++++++++++++++++------------
 1 file changed, 31 insertions(+), 19 deletions(-)
include/configs/vexpress_aemv8.h +31 -19
index 49517a60b0..7cdfc30649 100644
@@ -7,6 +7,8 @@
 #ifndef __VEXPRESS_AEMV8_H
 #define __VEXPRESS_AEMV8_H
 
+#include <linux/stringify.h>
+
 #define CONFIG_REMAKE_ELF
 
 /* Link Definitions */
@@ -172,33 +174,43 @@
 				BOOTENV
 
 #elif CONFIG_TARGET_VEXPRESS64_BASE_FVP
+
+#define VEXPRESS_KERNEL_ADDR	0x80080000
+#define VEXPRESS_FDT_ADDR	0x8fc00000
+#define VEXPRESS_BOOT_ADDR	0x8fd00000
+#define VEXPRESS_RAMDISK_ADDR	0x8fe00000
+
 #define CONFIG_EXTRA_ENV_SETTINGS	\
 				"kernel_name=Image\0"		\
-				"kernel_addr=0x80080000\0"	\
-				"initrd_name=ramdisk.img\0"	\
-				"initrd_addr=0x88000000\0"	\
-				"fdtfile=devtree.dtb\0"		\
-				"fdt_addr=0x83000000\0"		\
-				"boot_name=boot.img\0"		\
-				"boot_addr=0x8007f800\0"
+				"kernel_addr_r=" __stringify(VEXPRESS_KERNEL_ADDR) "\0"	\
+				"ramdisk_name=ramdisk.img\0"	\
+				"ramdisk_addr_r=" __stringify(VEXPRESS_RAMDISK_ADDR) "\0" \
+				"fdtfile=devtree.dtb\0"	\
+				"fdt_addr_r=" __stringify(VEXPRESS_FDT_ADDR) "\0"	\
+				"boot_name=boot.img\0" \
+				"boot_addr_r=" __stringify(VEXPRESS_BOOT_ADDR) "\0"
 
 #ifndef CONFIG_BOOTCOMMAND
-#define CONFIG_BOOTCOMMAND	"if smhload ${boot_name} ${boot_addr}; then " \
+#define CONFIG_BOOTCOMMAND	"if smhload ${boot_name} ${boot_addr_r}; then " \
 				"  set bootargs; " \
-				"  abootimg addr ${boot_addr}; " \
-				"  abootimg get dtb --index=0 fdt_addr; " \
-				"  bootm ${boot_addr} ${boot_addr} " \
-				"  ${fdt_addr}; " \
+				"  abootimg addr ${boot_addr_r}; " \
+				"  abootimg get dtb --index=0 fdt_addr_r; " \
+				"  bootm ${boot_addr_r} ${boot_addr_r} " \
+				"  ${fdt_addr_r}; " \
 				"else; " \
 				"  set fdt_high 0xffffffffffffffff; " \
 				"  set initrd_high 0xffffffffffffffff; " \
-				"  smhload ${kernel_name} ${kernel_addr}; " \
-				"  smhload ${fdtfile} ${fdt_addr}; " \
-				"  smhload ${initrd_name} ${initrd_addr} "\
-				"  initrd_end; " \
-				"  fdt addr ${fdt_addr}; fdt resize; " \
-				"  fdt chosen ${initrd_addr} ${initrd_end}; " \
-				"  booti $kernel_addr - $fdt_addr; " \
+				"  smhload ${kernel_name} ${kernel_addr_r}; " \
+				"  smhload ${fdtfile} ${fdt_addr_r}; " \
+				"  smhload ${ramdisk_name} ${ramdisk_addr_r} "\
+				"  ramdisk_end; " \
+				"  fdt addr ${fdt_addr_r}; fdt resize; " \
+				"  if test -n ${ramdisk_end}; then "\
+				"    fdt chosen ${ramdisk_addr_r} ${ramdisk_end}; " \
+				"  else; " \
+				"    fdt chosen; " \
+				"  fi; " \
+				"  booti $kernel_addr_r - $fdt_addr_r; " \
 				"fi"
 #endif
 
Signature · 1 line
2.25.1
Reviewed-by on v2 3/5
#8 lore raw

Re: [PATCH v2 3/5] vexpress64: Clean up BASE_FVP boot configuration

Quoted 11 lines · On Thu, 11 Nov 2021 09:26:01 +0000 Peter Hoyes <[email protected]> wrote:

From: Peter Hoyes <[email protected]>

Move env var address values to #defines so they can be reused elsewhere.

Rename env var names to those recommended in the README and modify addresses to allow more space for the kernel.

Fix issue where fdt is called with invalid arguments when booting without a ramdisk.

Ah, more air to breathe now, thanks!

Cheers,
Andre

Quoted 80 lines
---
 include/configs/vexpress_aemv8.h | 50 ++++++++++++++++++++------------
 1 file changed, 31 insertions(+), 19 deletions(-)
include/configs/vexpress_aemv8.h +31 -19
index 49517a60b0..7cdfc30649 100644
@@ -7,6 +7,8 @@
 #ifndef __VEXPRESS_AEMV8_H
 #define __VEXPRESS_AEMV8_H
 
+#include <linux/stringify.h>
+
 #define CONFIG_REMAKE_ELF
 
 /* Link Definitions */
@@ -172,33 +174,43 @@
 				BOOTENV
 
 #elif CONFIG_TARGET_VEXPRESS64_BASE_FVP
+
+#define VEXPRESS_KERNEL_ADDR	0x80080000
+#define VEXPRESS_FDT_ADDR	0x8fc00000
+#define VEXPRESS_BOOT_ADDR	0x8fd00000
+#define VEXPRESS_RAMDISK_ADDR	0x8fe00000
+
 #define CONFIG_EXTRA_ENV_SETTINGS	\
 				"kernel_name=Image\0"		\
-				"kernel_addr=0x80080000\0"	\
-				"initrd_name=ramdisk.img\0"	\
-				"initrd_addr=0x88000000\0"	\
-				"fdtfile=devtree.dtb\0"		\
-				"fdt_addr=0x83000000\0"		\
-				"boot_name=boot.img\0"		\
-				"boot_addr=0x8007f800\0"
+				"kernel_addr_r=" __stringify(VEXPRESS_KERNEL_ADDR) "\0"	\
+				"ramdisk_name=ramdisk.img\0"	\
+				"ramdisk_addr_r=" __stringify(VEXPRESS_RAMDISK_ADDR) "\0" \
+				"fdtfile=devtree.dtb\0"	\
+				"fdt_addr_r=" __stringify(VEXPRESS_FDT_ADDR) "\0"	\
+				"boot_name=boot.img\0" \
+				"boot_addr_r=" __stringify(VEXPRESS_BOOT_ADDR) "\0"
 
 #ifndef CONFIG_BOOTCOMMAND
-#define CONFIG_BOOTCOMMAND	"if smhload ${boot_name} ${boot_addr}; then " \
+#define CONFIG_BOOTCOMMAND	"if smhload ${boot_name} ${boot_addr_r}; then " \
 				"  set bootargs; " \
-				"  abootimg addr ${boot_addr}; " \
-				"  abootimg get dtb --index=0 fdt_addr; " \
-				"  bootm ${boot_addr} ${boot_addr} " \
-				"  ${fdt_addr}; " \
+				"  abootimg addr ${boot_addr_r}; " \
+				"  abootimg get dtb --index=0 fdt_addr_r; " \
+				"  bootm ${boot_addr_r} ${boot_addr_r} " \
+				"  ${fdt_addr_r}; " \
 				"else; " \
 				"  set fdt_high 0xffffffffffffffff; " \
 				"  set initrd_high 0xffffffffffffffff; " \
-				"  smhload ${kernel_name} ${kernel_addr}; " \
-				"  smhload ${fdtfile} ${fdt_addr}; " \
-				"  smhload ${initrd_name} ${initrd_addr} "\
-				"  initrd_end; " \
-				"  fdt addr ${fdt_addr}; fdt resize; " \
-				"  fdt chosen ${initrd_addr} ${initrd_end}; " \
-				"  booti $kernel_addr - $fdt_addr; " \
+				"  smhload ${kernel_name} ${kernel_addr_r}; " \
+				"  smhload ${fdtfile} ${fdt_addr_r}; " \
+				"  smhload ${ramdisk_name} ${ramdisk_addr_r} "\
+				"  ramdisk_end; " \
+				"  fdt addr ${fdt_addr_r}; fdt resize; " \
+				"  if test -n ${ramdisk_end}; then "\
+				"    fdt chosen ${ramdisk_addr_r} ${ramdisk_end}; " \
+				"  else; " \
+				"    fdt chosen; " \
+				"  fi; " \
+				"  booti $kernel_addr_r - $fdt_addr_r; " \
 				"fi"
 #endif
 
#9 lore raw

Re: [PATCH v2 3/5] vexpress64: Clean up BASE_FVP boot configuration

In reply to Peter Hoyes
Quoted 4 lines · Peter Hoyes

From: Peter Hoyes <[email protected]>

Move env var address values to #defines so they can be reused elsewhere.

Quoted 8 lines

Rename env var names to those recommended in the README and modify addresses to allow more space for the kernel.

Fix issue where fdt is called with invalid arguments when booting without a ramdisk.

Applied to u-boot/next, thanks!

Signature · 1 line
Tom
#10 lore raw

PATCH v2 4/5 vexpress64: Enable OF_CONTROL and OF_BOARD for VExpress64

In reply to Peter Hoyes

From: Peter Hoyes <[email protected]>

Capture x0 in lowlevel_init.S as potential fdt address. Modify board_fdt_blob_setup to use fdt address from either vexpress_aemv8.h or lowlevel_init.S.

---
 board/armltd/vexpress64/Makefile        |  2 +-
 board/armltd/vexpress64/lowlevel_init.S | 12 ++++++++++++
 board/armltd/vexpress64/vexpress64.c    | 26 +++++++++++++++++++++++++
 3 files changed, 39 insertions(+), 1 deletion(-)
 create mode 100644 board/armltd/vexpress64/lowlevel_init.S
board/armltd/vexpress64/Makefile +1 -1
index 868dc4f629..1878fbed4e 100644
@@ -3,5 +3,5 @@
 # (C) Copyright 2000-2004
 # Wolfgang Denk, DENX Software Engineering, [email protected].
 
-obj-y	:= vexpress64.o
+obj-y	:= vexpress64.o lowlevel_init.o
 obj-$(CONFIG_TARGET_VEXPRESS64_JUNO)	+= pcie.o
board/armltd/vexpress64/lowlevel_init.S new file +12 -0
new file mode 100644
index 0000000000..3dcfb85d0e
@@ -0,0 +1,12 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * (C) Copyright 2021 Arm Limited
+ */
+
+.global save_boot_params
+save_boot_params:
+
+	adr	x8, prior_stage_fdt_address
+	str	x0, [x8]
+
+	b	save_boot_params_ret
board/armltd/vexpress64/vexpress64.c +26 -0
index d2f307cca5..d17b463be5 100644
@@ -85,7 +85,15 @@ int dram_init_banksize(void)
 	return 0;
 }
 
+/* Assigned in lowlevel_init.S
+ * Push the variable into the .data section so that it
+ * does not get cleared later.
+ */
+unsigned long __section(".data") prior_stage_fdt_address;
+
 #ifdef CONFIG_OF_BOARD
+
+#ifdef CONFIG_TARGET_VEXPRESS64_JUNO
 #define JUNO_FLASH_SEC_SIZE	(256 * 1024)
 static phys_addr_t find_dtb_in_nor_flash(const char *partname)
 {
@@ -130,9 +138,11 @@ static phys_addr_t find_dtb_in_nor_flash(const char *partname)
 
 	return ~0;
 }
+#endif
 
 void *board_fdt_blob_setup(int *err)
 {
+#ifdef CONFIG_TARGET_VEXPRESS64_JUNO
 	phys_addr_t fdt_rom_addr = find_dtb_in_nor_flash(CONFIG_JUNO_DTB_PART);
 
 	*err = 0;
@@ -142,6 +152,22 @@ void *board_fdt_blob_setup(int *err)
 	}
 
 	return (void *)fdt_rom_addr;
+#endif
+
+#ifdef VEXPRESS_FDT_ADDR
+	if (fdt_magic(VEXPRESS_FDT_ADDR) == FDT_MAGIC) {
+		*err = 0;
+		return (void *)VEXPRESS_FDT_ADDR;
+	}
+#endif
+
+	if (fdt_magic(prior_stage_fdt_address) == FDT_MAGIC) {
+		*err = 0;
+		return (void *)prior_stage_fdt_address;
+	}
+
+	*err = -ENXIO;
+	return NULL;
 }
 #endif
 
Signature · 1 line
2.25.1
Reviewed-by on v2 4/5
#11 lore raw

Re: [PATCH v2 4/5] vexpress64: Enable OF_CONTROL and OF_BOARD for VExpress64

Quoted 6 lines · On Thu, 11 Nov 2021 09:26:02 +0000 Peter Hoyes <[email protected]> wrote:

From: Peter Hoyes <[email protected]>

Capture x0 in lowlevel_init.S as potential fdt address. Modify board_fdt_blob_setup to use fdt address from either vexpress_aemv8.h or lowlevel_init.S.

Thanks, looks good now:

Quoted 1 line

Cheers,
Andre

Quoted 91 lines
---
 board/armltd/vexpress64/Makefile        |  2 +-
 board/armltd/vexpress64/lowlevel_init.S | 12 ++++++++++++
 board/armltd/vexpress64/vexpress64.c    | 26 +++++++++++++++++++++++++
 3 files changed, 39 insertions(+), 1 deletion(-)
 create mode 100644 board/armltd/vexpress64/lowlevel_init.S
board/armltd/vexpress64/Makefile +1 -1
index 868dc4f629..1878fbed4e 100644
@@ -3,5 +3,5 @@
 # (C) Copyright 2000-2004
 # Wolfgang Denk, DENX Software Engineering, [email protected].
 
-obj-y	:= vexpress64.o
+obj-y	:= vexpress64.o lowlevel_init.o
 obj-$(CONFIG_TARGET_VEXPRESS64_JUNO)	+= pcie.o
board/armltd/vexpress64/lowlevel_init.S new file +12 -0
new file mode 100644
index 0000000000..3dcfb85d0e
@@ -0,0 +1,12 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * (C) Copyright 2021 Arm Limited
+ */
+
+.global save_boot_params
+save_boot_params:
+
+	adr	x8, prior_stage_fdt_address
+	str	x0, [x8]
+
+	b	save_boot_params_ret
board/armltd/vexpress64/vexpress64.c +26 -0
index d2f307cca5..d17b463be5 100644
@@ -85,7 +85,15 @@ int dram_init_banksize(void)
 	return 0;
 }
 
+/* Assigned in lowlevel_init.S
+ * Push the variable into the .data section so that it
+ * does not get cleared later.
+ */
+unsigned long __section(".data") prior_stage_fdt_address;
+
 #ifdef CONFIG_OF_BOARD
+
+#ifdef CONFIG_TARGET_VEXPRESS64_JUNO
 #define JUNO_FLASH_SEC_SIZE	(256 * 1024)
 static phys_addr_t find_dtb_in_nor_flash(const char *partname)
 {
@@ -130,9 +138,11 @@ static phys_addr_t find_dtb_in_nor_flash(const char *partname)
 
 	return ~0;
 }
+#endif
 
 void *board_fdt_blob_setup(int *err)
 {
+#ifdef CONFIG_TARGET_VEXPRESS64_JUNO
 	phys_addr_t fdt_rom_addr = find_dtb_in_nor_flash(CONFIG_JUNO_DTB_PART);
 
 	*err = 0;
@@ -142,6 +152,22 @@ void *board_fdt_blob_setup(int *err)
 	}
 
 	return (void *)fdt_rom_addr;
+#endif
+
+#ifdef VEXPRESS_FDT_ADDR
+	if (fdt_magic(VEXPRESS_FDT_ADDR) == FDT_MAGIC) {
+		*err = 0;
+		return (void *)VEXPRESS_FDT_ADDR;
+	}
+#endif
+
+	if (fdt_magic(prior_stage_fdt_address) == FDT_MAGIC) {
+		*err = 0;
+		return (void *)prior_stage_fdt_address;
+	}
+
+	*err = -ENXIO;
+	return NULL;
 }
 #endif
 
#12 lore raw

Re: [PATCH v2 4/5] vexpress64: Enable OF_CONTROL and OF_BOARD for VExpress64

In reply to Peter Hoyes
Quoted 8 lines · Peter Hoyes

From: Peter Hoyes <[email protected]>

Capture x0 in lowlevel_init.S as potential fdt address. Modify board_fdt_blob_setup to use fdt address from either vexpress_aemv8.h or lowlevel_init.S.

Applied to u-boot/next, thanks!

Signature · 1 line
Tom
#13 lore raw

PATCH v2 5/5 vexpress64: Enable VIRTIO_NET network driver

In reply to Peter Hoyes

From: Peter Hoyes <[email protected]>

The SMSC driver is using the old driver model.

Init the virtio system in vexpress64.c so that the network device is discovered.

---
 board/armltd/vexpress64/vexpress64.c | 7 +++++++
 include/configs/vexpress_aemv8.h     | 4 ++--
 2 files changed, 9 insertions(+), 2 deletions(-)
board/armltd/vexpress64/vexpress64.c +7 -0
index d17b463be5..5e22e89824 100644
@@ -18,6 +18,10 @@
 #include <dm/platform_data/serial_pl01x.h>
 #include "pcie.h"
 #include <asm/armv8/mmu.h>
+#ifdef CONFIG_VIRTIO_NET
+#include <virtio_types.h>
+#include <virtio.h>
+#endif
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -64,6 +68,9 @@ __weak void vexpress64_pcie_init(void)
 int board_init(void)
 {
 	vexpress64_pcie_init();
+#ifdef CONFIG_VIRTIO_NET
+	virtio_init();
+#endif
 	return 0;
 }
 
include/configs/vexpress_aemv8.h +2 -2
index 7cdfc30649..faa7065086 100644
@@ -88,8 +88,8 @@
 #endif
 #endif /* !CONFIG_GICV3 */
 
-#ifndef CONFIG_TARGET_VEXPRESS64_JUNO
-/* The Vexpress64 simulators use SMSC91C111 */
+#if defined(CONFIG_TARGET_VEXPRESS64_BASE_FVP) && !defined(CONFIG_DM_ETH)
+/* The Vexpress64 BASE_FVP simulator uses SMSC91C111 */
 #define CONFIG_SMC91111			1
 #define CONFIG_SMC91111_BASE		(V2M_PA_BASE + 0x01A000000)
 #endif
Signature · 1 line
2.25.1
Reviewed-by on v2 5/5
#14 lore raw

Re: [PATCH v2 5/5] vexpress64: Enable VIRTIO_NET network driver

Quoted 8 lines · On Thu, 11 Nov 2021 09:26:03 +0000 Peter Hoyes <[email protected]> wrote:

From: Peter Hoyes <[email protected]>

The SMSC driver is using the old driver model.

Init the virtio system in vexpress64.c so that the network device is discovered.

Looks like the same as v1, so repeating my tag:

Cheers,
Andre

Quoted 45 lines
---
 board/armltd/vexpress64/vexpress64.c | 7 +++++++
 include/configs/vexpress_aemv8.h     | 4 ++--
 2 files changed, 9 insertions(+), 2 deletions(-)
board/armltd/vexpress64/vexpress64.c +7 -0
index d17b463be5..5e22e89824 100644
@@ -18,6 +18,10 @@
 #include <dm/platform_data/serial_pl01x.h>
 #include "pcie.h"
 #include <asm/armv8/mmu.h>
+#ifdef CONFIG_VIRTIO_NET
+#include <virtio_types.h>
+#include <virtio.h>
+#endif
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -64,6 +68,9 @@ __weak void vexpress64_pcie_init(void)
 int board_init(void)
 {
 	vexpress64_pcie_init();
+#ifdef CONFIG_VIRTIO_NET
+	virtio_init();
+#endif
 	return 0;
 }
 
include/configs/vexpress_aemv8.h +2 -2
index 7cdfc30649..faa7065086 100644
@@ -88,8 +88,8 @@
 #endif
 #endif /* !CONFIG_GICV3 */
 
-#ifndef CONFIG_TARGET_VEXPRESS64_JUNO
-/* The Vexpress64 simulators use SMSC91C111 */
+#if defined(CONFIG_TARGET_VEXPRESS64_BASE_FVP) && !defined(CONFIG_DM_ETH)
+/* The Vexpress64 BASE_FVP simulator uses SMSC91C111 */
 #define CONFIG_SMC91111			1
 #define CONFIG_SMC91111_BASE		(V2M_PA_BASE + 0x01A000000)
 #endif