[U-Boot] [PATCH u-boot-marvell 0/6] More fixes for Turris Omnia

Hi Stefan, I am sending five another fixes for Turris Omnia.
Marek
Marek Behún (6): arm: mvebu: turris_omnia: set default ethernet adapter arm: mvebu: turris_omnia: fix adapters MAC addresses arm: mvebu: turris_omnia: change environment address in SPI flash arm: mvebu: turris_omnia: remove unneeded macro from board config arm: mvebu: turris_omnia: prefer SCSI booting before USB arm: mvebu: turris_omnia: call pci_init from board init code
board/CZ.NIC/turris_omnia/turris_omnia.c | 9 ++++++--- include/configs/turris_omnia.h | 12 ++++-------- 2 files changed, 10 insertions(+), 11 deletions(-)

Set default value for the ethact variable to the WAN port.
Signed-off-by: Marek Behún marek.behun@nic.cz --- include/configs/turris_omnia.h | 1 + 1 file changed, 1 insertion(+)
diff --git a/include/configs/turris_omnia.h b/include/configs/turris_omnia.h index 018f54428b..290828d73e 100644 --- a/include/configs/turris_omnia.h +++ b/include/configs/turris_omnia.h @@ -122,6 +122,7 @@ LOAD_ADDRESS_ENV_SETTINGS \ "fdtfile=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \ "console=ttyS0,115200\0" \ + "ethact=ethernet@34000\0" \ BOOTENV
#endif /* CONFIG_SPL_BUILD */

The board code reads MAC addresses from the ATSHA204A cryptochip. For compatibility reasons the ethernet adapters on this SOC are not enumerated in register address order. But when Omnia was first manufactured this was done differently.
Change setting of MAC addresses to conform to the description on the stickers sticked on actual Omnias.
Signed-off-by: Marek Behún marek.behun@nic.cz --- board/CZ.NIC/turris_omnia/turris_omnia.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/board/CZ.NIC/turris_omnia/turris_omnia.c b/board/CZ.NIC/turris_omnia/turris_omnia.c index ad6e29021e..cddde50b96 100644 --- a/board/CZ.NIC/turris_omnia/turris_omnia.c +++ b/board/CZ.NIC/turris_omnia/turris_omnia.c @@ -514,17 +514,17 @@ int misc_init_r(void) mac[5] = mac1[3];
if (is_valid_ethaddr(mac)) - eth_env_set_enetaddr("ethaddr", mac); + eth_env_set_enetaddr("eth1addr", mac);
increment_mac(mac);
if (is_valid_ethaddr(mac)) - eth_env_set_enetaddr("eth1addr", mac); + eth_env_set_enetaddr("eth2addr", mac);
increment_mac(mac);
if (is_valid_ethaddr(mac)) - eth_env_set_enetaddr("eth2addr", mac); + eth_env_set_enetaddr("ethaddr", mac);
out: return 0;

The U-Boot partition is 1 MiB and environment is 64 KiB. It does not make sense to have environment at 0xc0000 when it could be at 0xf0000 and we can have more space for U-Boot binary.
Signed-off-by: Marek Behún marek.behun@nic.cz --- include/configs/turris_omnia.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/configs/turris_omnia.h b/include/configs/turris_omnia.h index 290828d73e..8e3d5cc8cf 100644 --- a/include/configs/turris_omnia.h +++ b/include/configs/turris_omnia.h @@ -22,9 +22,9 @@ #define CONFIG_EHCI_IS_TDI
/* Environment in SPI NOR flash */ -#define CONFIG_ENV_OFFSET (3*(1 << 18)) /* 768KiB in */ #define CONFIG_ENV_SIZE (64 << 10) /* 64KiB */ -#define CONFIG_ENV_SECT_SIZE (256 << 10) /* 256KiB sectors */ +#define CONFIG_ENV_OFFSET ((1 << 20) - CONFIG_ENV_SIZE) +#define CONFIG_ENV_SECT_SIZE (64 << 10) /* 64KiB */
#define PHY_ANEG_TIMEOUT 8000 /* PHY needs a longer aneg time */

This is not needed here since Omnia is using DM_PCI now.
Signed-off-by: Marek Behún marek.behun@nic.cz --- include/configs/turris_omnia.h | 5 ----- 1 file changed, 5 deletions(-)
diff --git a/include/configs/turris_omnia.h b/include/configs/turris_omnia.h index 8e3d5cc8cf..26f85466a4 100644 --- a/include/configs/turris_omnia.h +++ b/include/configs/turris_omnia.h @@ -28,11 +28,6 @@
#define PHY_ANEG_TIMEOUT 8000 /* PHY needs a longer aneg time */
-/* PCIe support */ -#ifndef CONFIG_SPL_BUILD -#define CONFIG_PCI_SCAN_SHOW -#endif - /* Keep device tree and initrd in lower memory so the kernel can access them */ #define RELOCATION_LIMITS_ENV_SETTINGS \ "fdt_high=0x10000000\0" \

If SCSI and USB boot options are both available, try to boot from SCSI first.
Signed-off-by: Marek Behún marek.behun@nic.cz --- include/configs/turris_omnia.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/configs/turris_omnia.h b/include/configs/turris_omnia.h index 26f85466a4..edd776ec70 100644 --- a/include/configs/turris_omnia.h +++ b/include/configs/turris_omnia.h @@ -92,8 +92,8 @@
#define BOOT_TARGET_DEVICES(func) \ BOOT_TARGET_DEVICES_MMC(func) \ - BOOT_TARGET_DEVICES_USB(func) \ BOOT_TARGET_DEVICES_SCSI(func) \ + BOOT_TARGET_DEVICES_USB(func) \ func(PXE, pxe, na) \ func(DHCP, dhcp, na)

We always want to enumerate PCIe devices, because withouth this they won't work in Linux.
Signed-off-by: Marek Behún marek.behun@nic.cz --- board/CZ.NIC/turris_omnia/turris_omnia.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/board/CZ.NIC/turris_omnia/turris_omnia.c b/board/CZ.NIC/turris_omnia/turris_omnia.c index cddde50b96..db99db0ccf 100644 --- a/board/CZ.NIC/turris_omnia/turris_omnia.c +++ b/board/CZ.NIC/turris_omnia/turris_omnia.c @@ -412,6 +412,9 @@ int board_late_init(void) set_regdomain(); handle_reset_button(); #endif +#ifdef CONFIG_PCI_MVEBU + pci_init(); +#endif
return 0; }

On 10.05.19 05:10, Marek Behún wrote:
We always want to enumerate PCIe devices, because withouth this they won't work in Linux.
Signed-off-by: Marek Behún marek.behun@nic.cz
board/CZ.NIC/turris_omnia/turris_omnia.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/board/CZ.NIC/turris_omnia/turris_omnia.c b/board/CZ.NIC/turris_omnia/turris_omnia.c index cddde50b96..db99db0ccf 100644 --- a/board/CZ.NIC/turris_omnia/turris_omnia.c +++ b/board/CZ.NIC/turris_omnia/turris_omnia.c @@ -412,6 +412,9 @@ int board_late_init(void) set_regdomain(); handle_reset_button(); #endif +#ifdef CONFIG_PCI_MVEBU
- pci_init();
+#endif
Do you have CONFIG_PCI_MVEBU enabled on this board defconfig? If yes, then please remove the #ifdef here.
Thanks, Stefan

Hi Marek,
(Added Chris to Cc)
On 10.05.19 05:10, Marek Behún wrote:
Hi Stefan, I am sending five another fixes for Turris Omnia.
Thanks. I'll queue those once they are ready for the next merge window.
BTW: I'm currently testing latest mainline on an Armada XP target (theadorable). And it fails in SPL without any output on the UART. v2019.04 works just fine. I'm debugging right now...
Did you already test latest mainline on turris_omnia?
Chris, could you please also do a quick test on an Armada XP / 38x (or similar) board with latest mainline?
Thanks, Stefan

On Fri, May 10, 2019 at 8:23 PM Stefan Roese sr@denx.de wrote:
Hi Marek,
(Added Chris to Cc)
On 10.05.19 05:10, Marek Behún wrote:
Hi Stefan, I am sending five another fixes for Turris Omnia.
Thanks. I'll queue those once they are ready for the next merge window.
BTW: I'm currently testing latest mainline on an Armada XP target (theadorable). And it fails in SPL without any output on the UART. v2019.04 works just fine. I'm debugging right now...
Did you already test latest mainline on turris_omnia?
Chris, could you please also do a quick test on an Armada XP / 38x (or similar) board with latest mainline?
Tested master@commit f30f268a07b0 ("Merge tag 'rockchip-for-v2019.07-rc1' of git://git.denx.de/u-boot-rockchip") on the x530 and it works fine. I haven't got any other boards accessible at the moment (plus I've killed my Armada XP board).
Thanks, Stefan
participants (4)
-
Chris Packham
-
Marek Behun
-
Marek Behún
-
Stefan Roese