[PATCH v1] vexpress_ca9x4: Enable DM_SERIAL

This commit enables support for DM_SERIAL in the vexpress_ca9x4 boards.
When running the board with the DM_SERIAL driver, the board ran out of memory in SPL when initialising the DM serial driver.
Thus this required an increase in the pre-allocated SRAM memory. I did increase it to 0x800, and it now works graciously.
It could probably be set lower, but I do not see any reason not to use the available SRAM at this point.
Also adds stdout-path to the 'chosen' node in the device tree.
Signed-off-by: Ole P. Orhagen ole.orhagen@northern.tech
---
arch/arm/Kconfig | 2 +- arch/arm/dts/vexpress-v2p-ca9.dts | 4 +++- configs/vexpress_ca9x4_defconfig | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index abd7c6c79a..8e9aaf70d2 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -678,7 +678,7 @@ config ARCH_BCMBCA config TARGET_VEXPRESS_CA9X4 bool "Support vexpress_ca9x4" select CPU_V7A - select PL011_SERIAL + select PL01X_SERIAL
config TARGET_BCMNS bool "Support Broadcom Northstar" diff --git a/arch/arm/dts/vexpress-v2p-ca9.dts b/arch/arm/dts/vexpress-v2p-ca9.dts index bf00c62bcf..e5b86c0d67 100644 --- a/arch/arm/dts/vexpress-v2p-ca9.dts +++ b/arch/arm/dts/vexpress-v2p-ca9.dts @@ -20,7 +20,9 @@ #address-cells = <1>; #size-cells = <1>;
- chosen { }; + chosen { + stdout-path = &v2m_serial0; + };
aliases { serial0 = &v2m_serial0; diff --git a/configs/vexpress_ca9x4_defconfig b/configs/vexpress_ca9x4_defconfig index 2601e55ebf..f8e93bef4e 100644 --- a/configs/vexpress_ca9x4_defconfig +++ b/configs/vexpress_ca9x4_defconfig @@ -2,7 +2,7 @@ CONFIG_ARM=y CONFIG_SYS_L2CACHE_OFF=y CONFIG_TARGET_VEXPRESS_CA9X4=y CONFIG_TEXT_BASE=0x60800000 -CONFIG_SYS_MALLOC_F_LEN=0x400 +CONFIG_SYS_MALLOC_F_LEN=0x800 CONFIG_NR_DRAM_BANKS=2 CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x60000f10 @@ -41,6 +41,7 @@ CONFIG_ARM_PL180_MMCI=y CONFIG_SYS_MMC_MAX_BLK_COUNT=127 CONFIG_MTD=y CONFIG_DM_MTD=y +CONFIG_DM_SERIAL=y CONFIG_MTD_NOR_FLASH=y CONFIG_SYS_FLASH_CFI_WIDTH_32BIT=y CONFIG_FLASH_SHOW_PROGRESS=0

On Fri, Jan 26, 2024 at 1:48 PM Ole P. Orhagen ole.orhagen@northern.tech wrote:
This commit enables support for DM_SERIAL in the vexpress_ca9x4 boards.
When running the board with the DM_SERIAL driver, the board ran out of memory in SPL when initialising the DM serial driver.
Thus this required an increase in the pre-allocated SRAM memory. I did increase it to 0x800, and it now works graciously.
It could probably be set lower, but I do not see any reason not to use the available SRAM at this point.
Also adds stdout-path to the 'chosen' node in the device tree.
Signed-off-by: Ole P. Orhagen ole.orhagen@northern.tech
Nice! Reviewed-by: Linus Walleij linus.walleij@linaro.org
Are you using the actual hardware, or QEMU?
chosen { };
chosen {
stdout-path = &v2m_serial0;
};
Can you please send this patch also to the Linux codebase.
Yours, Linus Walleij

On Fri, Jan 26, 2024 at 8:57 PM Linus Walleij linus.walleij@linaro.org wrote:
On Fri, Jan 26, 2024 at 1:48 PM Ole P. Orhagen ole.orhagen@northern.tech wrote:
This commit enables support for DM_SERIAL in the vexpress_ca9x4 boards.
When running the board with the DM_SERIAL driver, the board ran out of memory in SPL when initialising the DM serial driver.
Thus this required an increase in the pre-allocated SRAM memory. I did increase it to 0x800, and it now works graciously.
It could probably be set lower, but I do not see any reason not to use
the
available SRAM at this point.
Also adds stdout-path to the 'chosen' node in the device tree.
Signed-off-by: Ole P. Orhagen ole.orhagen@northern.tech
Nice! Reviewed-by: Linus Walleij linus.walleij@linaro.org
Are you using the actual hardware, or QEMU?
I only have QEMU available, unfortunately.
chosen { };
chosen {
stdout-path = &v2m_serial0;
};
Can you please send this patch also to the Linux codebase.
Sure can!
Yours, Linus Walleij

On 29/01/2024 12:41, Ole Orhagen wrote:
On Fri, Jan 26, 2024 at 8:57 PM Linus Walleij <linus.walleij@linaro.org mailto:linus.walleij@linaro.org> wrote:
On Fri, Jan 26, 2024 at 1:48 PM Ole P. Orhagen <ole.orhagen@northern.tech> wrote: > This commit enables support for DM_SERIAL in the vexpress_ca9x4 boards. > > When running the board with the DM_SERIAL driver, the board ran out of > memory in SPL when initialising the DM serial driver. > > Thus this required an increase in the pre-allocated SRAM memory. I did > increase it to 0x800, and it now works graciously. > > It could probably be set lower, but I do not see any reason not to use the > available SRAM at this point. > > Also adds stdout-path to the 'chosen' node in the device tree. > > Signed-off-by: Ole P. Orhagen <ole.orhagen@northern.tech> Nice! Reviewed-by: Linus Walleij <linus.walleij@linaro.org <mailto:linus.walleij@linaro.org>> Are you using the actual hardware, or QEMU?
I only have QEMU available, unfortunately.
Just providing some context, since I'm listed as maintainer: This board was going to be removed some time ago, but was resurrected specifically to work with QEMU. The "virt" board, at least at that time, did not support some key ARM features that we need in our testing, such as SD cards and Flash. Hence we opted to keep this board around. So compatibility with hardware is not important to us at least, unless someone else is requesting it.

On Mon, Jan 29, 2024 at 12:54 PM Kristian Amlie kristian.amlie@northern.tech wrote:
On 29/01/2024 12:41, Ole Orhagen wrote:
On Fri, Jan 26, 2024 at 8:57 PM Linus Walleij <linus.walleij@linaro.org mailto:linus.walleij@linaro.org> wrote:
Are you using the actual hardware, or QEMU?
I only have QEMU available, unfortunately.
Just providing some context, since I'm listed as maintainer: This board was going to be removed some time ago, but was resurrected specifically to work with QEMU. The "virt" board, at least at that time, did not support some key ARM features that we need in our testing, such as SD cards and Flash. Hence we opted to keep this board around. So compatibility with hardware is not important to us at least, unless someone else is requesting it.
I actually have this hardware.
Last time I tried to bring it up it had severe problems with caches, especially following the meltdown/spectre workarounds that start to really stress the cache, and probably the caches simply have to be disabled to make it work.
But I will try to dust it off and test it again.
Yours, Linus Walleij

On Mon, Jan 29, 2024 at 2:31 PM Linus Walleij linus.walleij@linaro.org wrote:
On Mon, Jan 29, 2024 at 12:54 PM Kristian Amlie kristian.amlie@northern.tech wrote:
On 29/01/2024 12:41, Ole Orhagen wrote:
On Fri, Jan 26, 2024 at 8:57 PM Linus Walleij <
linus.walleij@linaro.org
mailto:linus.walleij@linaro.org> wrote:
Are you using the actual hardware, or QEMU?
I only have QEMU available, unfortunately.
Just providing some context, since I'm listed as maintainer: This board was going to be removed some time ago, but was resurrected specifically to work with QEMU. The "virt" board, at least at that time, did not support some key ARM features that we need in our testing, such as SD cards and Flash. Hence we opted to keep this board around. So compatibility with hardware is not important to us at least, unless someone else is requesting it.
I actually have this hardware.
Last time I tried to bring it up it had severe problems with caches, especially following the meltdown/spectre workarounds that start to really stress the cache, and probably the caches simply have to be disabled to make it work.
But I will try to dust it off and test it again.
Did you get any results from the tests?
Yours, Linus Walleij

On Mon, Feb 5, 2024 at 9:18 AM Ole Orhagen ole.orhagen@northern.tech wrote:
But I will try to dust it off and test it again.
Did you get any results from the tests?
Yes!
It works fine both before and after the patch. Latest log from the actual hardware:
Cmd> usb_on Enabling debug USB...
(here I copy over the binary to the internal SD-card which is presented over USB mass storage)
Cmd> reboot
Powering up system... Daughterboard fitted to site 1.
Switching on ATXPSU... ATX3V3: ON VIOset: 1.8V MBtemp: 29 degC
Configuring motherboard (rev D, var A)... IOFPGA config: PASSED MUXFPGA config: PASSED OSC CLK config: PASSED Programming image \SOFTWARE\boot-a9.bin Erasing Flash image boot.bin ... Erasing Flash ... Writing Flash ..... Updating eeprom with image boot.bin Image: boot.bin UPDATED from \SOFTWARE\boot-a9.bin
Testing SMC devices (FPGA build 8)... SRAM 32MB test: PASSED VRAM 8MB test: PASSED LAN9118 test: PASSED USB & OTG test: PASSED KMI1/KMI2 test: PASSED MMC & SD test: PASSED DVI image test: PASSED AACI AC97 test: PASSED CF card test: PASSED UART port test: PASSED MAC addrs test: PASSED
Reading Site 1 Board File \SITE1\HBI0191B\board.txt DB1 JTAG configuration complete. Setting DB1 OSCCLKS... DB1.0 DCC 0 SPI configuration complete.
Writing SCC 0x40610000 with 0xBB8A802A Writing SCC 0x40610001 with 0x00001F09 Writing SCC 0x40610002 with 0x00000000 DB1.0 DCC 0 SCC configuration complete.
DB SMB clock enabled. Waiting for SITE1 CB_READY... Testing SMB clock... Configuring MUXFPGA for DB1. Setting DVI mode for XGA. Releasing Daughterboard resets. Switching MCC log to UART1.
ARM Versatile Express Boot Monitor Version: V5.2.1 Build Date: Apr 4 2013 Daughterboard Site 1: V2P-CA9 Cortex A9 Daughterboard Site 2: Not Used Running boot script from flash - BOOTSCRIPT
U-Boot 2024.04-rc1-00101-g0101a2ffe125 (Feb 08 2024 - 09:21:31 +0100)
DRAM: 512 MiB (effective 1 GiB) WARNING: Caches not enabled Core: 22 devices, 11 uclasses, devicetree: embed Flash: 128 MiB MMC: mmci@5000: 0 Loading Environment from Flash... OK In: uart@9000 Out: uart@9000 Err: uart@9000 Net: eth0: ethernet@3,02000000 Hit any key to stop autoboot: 0 smc911x: detected LAN9118 controller smc911x: phy initialized smc911x: MAC 00:02:f7:00:3c:9d Using ethernet@3,02000000 device TFTP from server 192.168.1.140; our IP address is 192.168.1.35 Filename 'zImage'. Load address: 0x62000000 Loading: smc911x: MAC 00:02:f7:00:3c:9d
Yours, Linus Walleij

On Thu, Feb 8, 2024 at 9:27 AM Linus Walleij linus.walleij@linaro.org wrote:
On Mon, Feb 5, 2024 at 9:18 AM Ole Orhagen ole.orhagen@northern.tech wrote:
But I will try to dust it off and test it again.
Did you get any results from the tests?
Yes!
It works fine both before and after the patch. Latest log from the actual hardware:
Cmd> usb_on Enabling debug USB...
(here I copy over the binary to the internal SD-card which is presented over USB mass storage)
Cmd> reboot
Powering up system... Daughterboard fitted to site 1.
Switching on ATXPSU... ATX3V3: ON VIOset: 1.8V MBtemp: 29 degC
Configuring motherboard (rev D, var A)... IOFPGA config: PASSED MUXFPGA config: PASSED OSC CLK config: PASSED Programming image \SOFTWARE\boot-a9.bin Erasing Flash image boot.bin ... Erasing Flash ... Writing Flash ..... Updating eeprom with image boot.bin Image: boot.bin UPDATED from \SOFTWARE\boot-a9.bin
Testing SMC devices (FPGA build 8)... SRAM 32MB test: PASSED VRAM 8MB test: PASSED LAN9118 test: PASSED USB & OTG test: PASSED KMI1/KMI2 test: PASSED MMC & SD test: PASSED DVI image test: PASSED AACI AC97 test: PASSED CF card test: PASSED UART port test: PASSED MAC addrs test: PASSED
Reading Site 1 Board File \SITE1\HBI0191B\board.txt DB1 JTAG configuration complete. Setting DB1 OSCCLKS... DB1.0 DCC 0 SPI configuration complete.
Writing SCC 0x40610000 with 0xBB8A802A Writing SCC 0x40610001 with 0x00001F09 Writing SCC 0x40610002 with 0x00000000 DB1.0 DCC 0 SCC configuration complete.
DB SMB clock enabled. Waiting for SITE1 CB_READY... Testing SMB clock... Configuring MUXFPGA for DB1. Setting DVI mode for XGA. Releasing Daughterboard resets. Switching MCC log to UART1.
ARM Versatile Express Boot Monitor Version: V5.2.1 Build Date: Apr 4 2013 Daughterboard Site 1: V2P-CA9 Cortex A9 Daughterboard Site 2: Not Used Running boot script from flash - BOOTSCRIPT
U-Boot 2024.04-rc1-00101-g0101a2ffe125 (Feb 08 2024 - 09:21:31 +0100)
DRAM: 512 MiB (effective 1 GiB) WARNING: Caches not enabled Core: 22 devices, 11 uclasses, devicetree: embed Flash: 128 MiB MMC: mmci@5000: 0 Loading Environment from Flash... OK In: uart@9000 Out: uart@9000 Err: uart@9000 Net: eth0: ethernet@3,02000000 Hit any key to stop autoboot: 0 smc911x: detected LAN9118 controller smc911x: phy initialized smc911x: MAC 00:02:f7:00:3c:9d Using ethernet@3,02000000 device TFTP from server 192.168.1.140; our IP address is 192.168.1.35 Filename 'zImage'. Load address: 0x62000000 Loading: smc911x: MAC 00:02:f7:00:3c:9d
Yours, Linus Walleij
Great :)
Thanks for taking the time!

On Fri, Jan 26, 2024 at 01:47:50PM +0100, Ole P. Orhagen wrote:
This commit enables support for DM_SERIAL in the vexpress_ca9x4 boards.
When running the board with the DM_SERIAL driver, the board ran out of memory in SPL when initialising the DM serial driver.
Thus this required an increase in the pre-allocated SRAM memory. I did increase it to 0x800, and it now works graciously.
It could probably be set lower, but I do not see any reason not to use the available SRAM at this point.
Also adds stdout-path to the 'chosen' node in the device tree.
Signed-off-by: Ole P. Orhagen ole.orhagen@northern.tech Reviewed-by: Linus Walleij linus.walleij@linaro.org
Applied to u-boot/master, thanks!

Awesome, thanks!
:)
On Wed, Feb 7, 2024 at 4:45 PM Tom Rini trini@konsulko.com wrote:
On Fri, Jan 26, 2024 at 01:47:50PM +0100, Ole P. Orhagen wrote:
This commit enables support for DM_SERIAL in the vexpress_ca9x4 boards.
When running the board with the DM_SERIAL driver, the board ran out of memory in SPL when initialising the DM serial driver.
Thus this required an increase in the pre-allocated SRAM memory. I did increase it to 0x800, and it now works graciously.
It could probably be set lower, but I do not see any reason not to use
the
available SRAM at this point.
Also adds stdout-path to the 'chosen' node in the device tree.
Signed-off-by: Ole P. Orhagen ole.orhagen@northern.tech Reviewed-by: Linus Walleij linus.walleij@linaro.org
Applied to u-boot/master, thanks!
-- Tom
participants (5)
-
Kristian Amlie
-
Linus Walleij
-
Ole Orhagen
-
Ole P. Orhagen
-
Tom Rini