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

Hi Stefan, here is v2 of the last fixes for Turris Omnia.
Changes: - removed the #ifdef you asked for - added a patch changing the bootargs setting in Omnia rescue bootcmd
Marek
Marek Behún (7): 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 arm: mvebu: turris_omnia: fix rescue mode bootcmd bootargs setting
board/CZ.NIC/turris_omnia/turris_omnia.c | 10 ++++++---- include/configs/turris_omnia.h | 12 ++++-------- 2 files changed, 10 insertions(+), 12 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 */

On 24.05.19 14:57, Marek Behún wrote:
Set default value for the ethact variable to the WAN port.
Signed-off-by: Marek Behún marek.behun@nic.cz
Reviewed-by: Stefan Roese sr@denx.de
Thanks, Stefan

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;

On 24.05.19 14:57, Marek Behún wrote:
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
Reviewed-by: Stefan Roese sr@denx.de
Thanks, Stefan

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 */

On 24.05.19 14:57, Marek Behún wrote:
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
Reviewed-by: Stefan Roese sr@denx.de
Thanks, Stefan

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" \

On 24.05.19 14:57, Marek Behún wrote:
This is not needed here since Omnia is using DM_PCI now.
Signed-off-by: Marek Behún marek.behun@nic.cz
Reviewed-by: Stefan Roese sr@denx.de
Thanks, Stefan

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)

On 24.05.19 14:57, Marek Behún wrote:
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
Reviewed-by: Stefan Roese sr@denx.de
Thanks, Stefan

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 | 1 + 1 file changed, 1 insertion(+)
diff --git a/board/CZ.NIC/turris_omnia/turris_omnia.c b/board/CZ.NIC/turris_omnia/turris_omnia.c index cddde50b96..eee150892a 100644 --- a/board/CZ.NIC/turris_omnia/turris_omnia.c +++ b/board/CZ.NIC/turris_omnia/turris_omnia.c @@ -412,6 +412,7 @@ int board_late_init(void) set_regdomain(); handle_reset_button(); #endif + pci_init();
return 0; }

On 24.05.19 14:57, 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
Reviewed-by: Stefan Roese sr@denx.de
Thanks, Stefan
BTW: There should be no any such dependencies, that the bootloader has already done some initializations on some subsystems. Linux should be able to function correctly on all interfaces without any such pre- configurations. So you might want to look into the Linux drivers here to find the root cause for this.

Rescue mode bootcmd currently only appends the "omniarescue" parameter to the bootargs variable. We do not want the user to be able to change rescue mode bootargs. Therefore change this so that bootcmd sets the bootargs variable in an absolute way (adding console device information and the omniarescue paramterer).
Signed-off-by: Marek Behún marek.behun@nic.cz --- board/CZ.NIC/turris_omnia/turris_omnia.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/board/CZ.NIC/turris_omnia/turris_omnia.c b/board/CZ.NIC/turris_omnia/turris_omnia.c index eee150892a..5f6ea35e5f 100644 --- a/board/CZ.NIC/turris_omnia/turris_omnia.c +++ b/board/CZ.NIC/turris_omnia/turris_omnia.c @@ -340,7 +340,8 @@ static int set_regdomain(void) "i2c mw 0x2a.1 0x4 0x1c 1; " \ "mw.l 0x01000000 0x00ff000c; " \ "i2c write 0x01000000 0x2a.1 0x5 4 -s; " \ - "setenv bootargs "$bootargs omniarescue=$omnia_reset"; " \ + "setenv bootargs "earlyprintk console=ttyS0,115200" \ + " omniarescue=$omnia_reset"; " \ "sf probe; " \ "sf read 0x1000000 0x100000 0x700000; " \ "bootm 0x1000000; " \

On 24.05.19 14:57, Marek Behún wrote:
Rescue mode bootcmd currently only appends the "omniarescue" parameter to the bootargs variable. We do not want the user to be able to change rescue mode bootargs. Therefore change this so that bootcmd sets the bootargs variable in an absolute way (adding console device information and the omniarescue paramterer).
Signed-off-by: Marek Behún marek.behun@nic.cz
Reviewed-by: Stefan Roese sr@denx.de
Thanks, Stefan
participants (2)
-
Marek Behún
-
Stefan Roese