Skip to contentSkip to conversation

arm: mvebu: Espressobin: Move env load addresses

PATCH Superseded Pali Rohár 3 participants 47 messages Aug 24, 2020 – Aug 31, 2020 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/5 arm: mvebu: Espressobin: Move env load addresses

According to Marvell's U-Boot description [1] current env load addresses overlaps with ATF RT services region and TEE. Because the ATF RT service and TEE region is going to be marked as secure and can't be overwritten, use different different addresses for envs.

[1] - https://github.com/MarvellEmbeddedProcessors/u-boot-marvell/commit/0a5b159806baa0746b6449920e450498bc269ba7

---
 include/configs/mvebu_armada-37xx.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
include/configs/mvebu_armada-37xx.h +4 -4
index ca662b0ce7..ac0998a2d4 100644
@@ -91,10 +91,10 @@
 #include <config_distro_bootcmd.h>
 
 #define CONFIG_EXTRA_ENV_SETTINGS	\
-	"scriptaddr=0x4d00000\0"	\
-	"pxefile_addr_r=0x4e00000\0"	\
-	"fdt_addr_r=0x4f00000\0"	\
-	"kernel_addr_r=0x5000000\0"	\
+	"scriptaddr=0x6d00000\0"	\
+	"pxefile_addr_r=0x6e00000\0"	\
+	"fdt_addr_r=0x6f00000\0"	\
+	"kernel_addr_r=0x7000000\0"	\
 	"ramdisk_addr_r=0x8000000\0"	\
 	BOOTENV
 
Signature · 1 line
2.20.1
#1 lore raw

PATCH 2/5 arm: mvebu: Espressobin: Change default loadaddr

Current loadaddr is not writable on Espressobin and 'loadb' command cause rebooting board. Marvell's U-Boot already set default loadaddr to value 0x06000000 [1] and after this change 'loadb' is working fine.

[1] - https://github.com/MarvellEmbeddedProcessors/u-boot-marvell/commit/0a5b159806baa0746b6449920e450498bc269ba7

---
 include/configs/mvebu_armada-37xx.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/configs/mvebu_armada-37xx.h +1 -1
index ac0998a2d4..c6b0e2573a 100644
@@ -37,7 +37,7 @@
 /*
  * Other required minimal configurations
  */
-#define CONFIG_SYS_LOAD_ADDR	0x00800000	/* default load adr- 8M */
+#define CONFIG_SYS_LOAD_ADDR	0x06000000	/* default load adr */
 #define CONFIG_SYS_RESET_ADDRESS 0xffff0000	/* Rst Vector Adr */
 #define CONFIG_SYS_MAXARGS	32	/* max number of command args */
 
Signature · 1 line
2.20.1
#2 lore raw

PATCH 2/5 arm: mvebu: Espressobin: Change default loadaddr

Quoted 7 lines · Pali Roh?r

Current loadaddr is not writable on Espressobin and 'loadb' command cause rebooting board. Marvell's U-Boot already set default loadaddr to value 0x06000000 [1] and after this change 'loadb' is working fine.

[1] - https://github.com/MarvellEmbeddedProcessors/u-boot-marvell/commit/0a5b159806baa0746b6449920e450498bc269ba7

Thanks,
Stefan

#3 lore raw

PATCH 3/5 arm: mvebu: Espressobin: Define fdt_addr and kernel_addr env aliases

In reply to Pali Rohár

Boot scripts for existing Espressobin Linux distributions, like OpenWRT, expect that U-Boot set fdt_addr and kernel_addr envs. So add env aliases from fdt_addr_r and kernel_addr_r values.

---
 include/configs/mvebu_armada-37xx.h | 3 +++
 1 file changed, 3 insertions(+)
include/configs/mvebu_armada-37xx.h +3 -0
index c6b0e2573a..6feceda757 100644
@@ -90,10 +90,13 @@
 
 #include <config_distro_bootcmd.h>
 
+/* fdt_addr and kernel_addr are needed for existing distribution boot scripts */
 #define CONFIG_EXTRA_ENV_SETTINGS	\
 	"scriptaddr=0x6d00000\0"	\
 	"pxefile_addr_r=0x6e00000\0"	\
+	"fdt_addr=0x6f00000\0"		\
 	"fdt_addr_r=0x6f00000\0"	\
+	"kernel_addr=0x7000000\0"	\
 	"kernel_addr_r=0x7000000\0"	\
 	"ramdisk_addr_r=0x8000000\0"	\
 	BOOTENV
Signature · 1 line
2.20.1
#4 lore raw

PATCH 3/5 arm: mvebu: Espressobin: Define fdt_addr and kernel_addr env aliases

Quoted 5 lines · Pali Roh?r

Boot scripts for existing Espressobin Linux distributions, like OpenWRT, expect that U-Boot set fdt_addr and kernel_addr envs. So add env aliases from fdt_addr_r and kernel_addr_r values.

Thanks,
Stefan

#5 lore raw

PATCH 4/5 arm: mvebu: Espressobin: Define console env

In reply to Pali Rohár

Some distribution bootscripts append console env into boot cmdline. So define console env correctly to have early console access.

---
 include/configs/mvebu_armada-37xx.h | 2 ++
 1 file changed, 2 insertions(+)
include/configs/mvebu_armada-37xx.h +2 -0
index 6feceda757..b473072976 100644
@@ -17,6 +17,7 @@
 
 #define CONFIG_SYS_BAUDRATE_TABLE	{ 9600, 19200, 38400, 57600, \
 					  115200, 230400, 460800, 921600 }
+#define CONFIG_DEFAULT_CONSOLE "console=ttyMV0,115200 earlycon=ar3700_uart,0xd0012000"
 
 /*
  * For booting Linux, the board info and command line data
@@ -99,6 +100,7 @@
 	"kernel_addr=0x7000000\0"	\
 	"kernel_addr_r=0x7000000\0"	\
 	"ramdisk_addr_r=0x8000000\0"	\
+	"console=" CONFIG_DEFAULT_CONSOLE "\0" \
 	BOOTENV
 
 #endif /* _CONFIG_MVEBU_ARMADA_37XX_H */
Signature · 1 line
2.20.1
#7 lore raw

PATCH 4/5 arm: mvebu: Espressobin: Define console env

In reply to Pali Rohár

Hi,

Quoted 22 lines · Pali Roh?r

Some distribution bootscripts append console env into boot cmdline. So define console env correctly to have early console access.

---
  include/configs/mvebu_armada-37xx.h | 2 ++
  1 file changed, 2 insertions(+)
include/configs/mvebu_armada-37xx.h +1 -0
index 6feceda757..b473072976 100644
@@ -17,6 +17,7 @@
 
  #define CONFIG_SYS_BAUDRATE_TABLE	{ 9600, 19200, 38400, 57600, \
  					  115200, 230400, 460800, 921600 }
+#define CONFIG_DEFAULT_CONSOLE "console=ttyMV0,115200 earlycon=ar3700_uart,0xd0012000"
 
  /*
   * For booting Linux, the board info and command line data

include/configs/mvebu_armada-37xx.h line 106

Quoted 7 lines
include/configs/mvebu_armada-37xx.h +1 -0
@@ -99,6 +100,7 @@
  	"kernel_addr=0x7000000\0"	\
  	"kernel_addr_r=0x7000000\0"	\
  	"ramdisk_addr_r=0x8000000\0"	\
+	"console=" CONFIG_DEFAULT_CONSOLE "\0" \
  	BOOTENV
 
  #endif /* _CONFIG_MVEBU_ARMADA_37XX_H */

this breaks booting debian with systemd for me:

[    4.632197] systemd-udevd[90]: Starting version 241
[    4.639324] systemd-udevd[91]: Failed to create udev control event 

source: Operation not permitted

"env delete console" and it works again.

The device tree already has 'stdout-path = "serial0:115200n8";' btw.

Regards,
Andre

#8 lore raw

PATCH 4/5 arm: mvebu: Espressobin: Define console env

Quoted 31 lines · On Wednesday 26 August 2020 15:22:26 Andre Heider wrote:

Hi,

Quoted 19 lines · Pali Roh?r

Some distribution bootscripts append console env into boot cmdline. So define console env correctly to have early console access.

---
  include/configs/mvebu_armada-37xx.h | 2 ++
  1 file changed, 2 insertions(+)
include/configs/mvebu_armada-37xx.h +1 -0
index 6feceda757..b473072976 100644
@@ -17,6 +17,7 @@
  #define CONFIG_SYS_BAUDRATE_TABLE	{ 9600, 19200, 38400, 57600, \
  					  115200, 230400, 460800, 921600 }
+#define CONFIG_DEFAULT_CONSOLE "console=ttyMV0,115200 earlycon=ar3700_uart,0xd0012000"
  /*
   * For booting Linux, the board info and command line data

include/configs/mvebu_armada-37xx.h line 106

Quoted 7 lines
include/configs/mvebu_armada-37xx.h +1 -0
@@ -99,6 +100,7 @@
  	"kernel_addr=0x7000000\0"	\
  	"kernel_addr_r=0x7000000\0"	\
  	"ramdisk_addr_r=0x8000000\0"	\
+	"console=" CONFIG_DEFAULT_CONSOLE "\0" \
  	BOOTENV
  #endif /* _CONFIG_MVEBU_ARMADA_37XX_H */
 

this breaks booting debian with systemd for me:

Quoted 5 lines
[    4.632197] systemd-udevd[90]: Starting version 241
[    4.639324] systemd-udevd[91]: Failed to create udev control event

source: Operation not permitted

"env delete console" and it works again.

This is really suspicious. Why systemd has problems with control socket when console= parameter is specified on boot command line? And if console= parameter is problematic on command line, why console output is working fine? For me it looks like this variable controls something different, not (only) console output. Maybe some bootscript sets something more when it see u-boot env ${console} non-empty?

Quoted 1 line

The device tree already has 'stdout-path = "serial0:115200n8";' btw.

I see. But it does not initialize earlycon.

#9 lore raw

PATCH 4/5 arm: mvebu: Espressobin: Define console env

Quoted 36 lines · Pali Roh?r
Quoted 35 lines · On Wednesday 26 August 2020 15:22:26 Andre Heider wrote:

Hi,

Quoted 19 lines · Pali Roh?r

Some distribution bootscripts append console env into boot cmdline. So define console env correctly to have early console access.

---
   include/configs/mvebu_armada-37xx.h | 2 ++
   1 file changed, 2 insertions(+)
include/configs/mvebu_armada-37xx.h +1 -0
index 6feceda757..b473072976 100644
@@ -17,6 +17,7 @@
   #define CONFIG_SYS_BAUDRATE_TABLE	{ 9600, 19200, 38400, 57600, \
   					  115200, 230400, 460800, 921600 }
+#define CONFIG_DEFAULT_CONSOLE "console=ttyMV0,115200 earlycon=ar3700_uart,0xd0012000"
   /*
    * For booting Linux, the board info and command line data

include/configs/mvebu_armada-37xx.h line 106

Quoted 7 lines
include/configs/mvebu_armada-37xx.h +1 -0
@@ -99,6 +100,7 @@
   	"kernel_addr=0x7000000\0"	\
   	"kernel_addr_r=0x7000000\0"	\
   	"ramdisk_addr_r=0x8000000\0"	\
+	"console=" CONFIG_DEFAULT_CONSOLE "\0" \
   	BOOTENV
   #endif /* _CONFIG_MVEBU_ARMADA_37XX_H */
 

this breaks booting debian with systemd for me:

[    4.632197] systemd-udevd[90]: Starting version 241
[    4.639324] systemd-udevd[91]: Failed to create udev control event

source: Operation not permitted

Quoted 8 lines
Quoted 1 line

"env delete console" and it works again.

This is really suspicious. Why systemd has problems with control socket when console= parameter is specified on boot command line? And if console= parameter is problematic on command line, why console output is working fine? For me it looks like this variable controls something different, not (only) console output. Maybe some bootscript sets something more when it see u-boot env ${console} non-empty?

It sounds like a bug in systemd, this may be related:
https://github.com/systemd/systemd/issues/13332

With ugly workarounds like:
https://github.com/openembedded/openembedded-core/commit/dd6ee0b06cd8df6204cf600050516d15172302ea

This is easy for to me to work around, but note that this systemd version is the one shipping with current debian stable.

#10 lore raw

PATCH 4/5 arm: mvebu: Espressobin: Define console env

Quoted 46 lines · On Wednesday 26 August 2020 16:00:05 Andre Heider wrote:
Quoted 36 lines · Pali Roh?r
Quoted 35 lines · On Wednesday 26 August 2020 15:22:26 Andre Heider wrote:

Hi,

Quoted 19 lines · Pali Roh?r

Some distribution bootscripts append console env into boot cmdline. So define console env correctly to have early console access.

---
   include/configs/mvebu_armada-37xx.h | 2 ++
   1 file changed, 2 insertions(+)
include/configs/mvebu_armada-37xx.h +1 -0
index 6feceda757..b473072976 100644
@@ -17,6 +17,7 @@
   #define CONFIG_SYS_BAUDRATE_TABLE	{ 9600, 19200, 38400, 57600, \
   					  115200, 230400, 460800, 921600 }
+#define CONFIG_DEFAULT_CONSOLE "console=ttyMV0,115200 earlycon=ar3700_uart,0xd0012000"
   /*
    * For booting Linux, the board info and command line data

include/configs/mvebu_armada-37xx.h line 106

Quoted 7 lines
include/configs/mvebu_armada-37xx.h +1 -0
@@ -99,6 +100,7 @@
   	"kernel_addr=0x7000000\0"	\
   	"kernel_addr_r=0x7000000\0"	\
   	"ramdisk_addr_r=0x8000000\0"	\
+	"console=" CONFIG_DEFAULT_CONSOLE "\0" \
   	BOOTENV
   #endif /* _CONFIG_MVEBU_ARMADA_37XX_H */
 

this breaks booting debian with systemd for me:

[    4.632197] systemd-udevd[90]: Starting version 241
[    4.639324] systemd-udevd[91]: Failed to create udev control event

source: Operation not permitted

Quoted 8 lines
Quoted 1 line

"env delete console" and it works again.

This is really suspicious. Why systemd has problems with control socket when console= parameter is specified on boot command line? And if console= parameter is problematic on command line, why console output is working fine? For me it looks like this variable controls something different, not (only) console output. Maybe some bootscript sets something more when it see u-boot env ${console} non-empty?

Quoted 8 lines

It sounds like a bug in systemd, this may be related:
https://github.com/systemd/systemd/issues/13332

With ugly workarounds like:
https://github.com/openembedded/openembedded-core/commit/dd6ee0b06cd8df6204cf600050516d15172302ea

This is easy for to me to work around, but note that this systemd version is the one shipping with current debian stable.

But this looks like to be related to command line 'console=null'.

Can you check which parameter is causing problem? console=... or earlycon=... ? Also do you have /dev/ttyMV0 in your system?

#11 lore raw

PATCH 4/5 arm: mvebu: Espressobin: Define console env

Quoted 53 lines · Pali Roh?r
Quoted 52 lines · On Wednesday 26 August 2020 16:00:05 Andre Heider wrote:
Quoted 36 lines · Pali Roh?r
Quoted 35 lines · On Wednesday 26 August 2020 15:22:26 Andre Heider wrote:

Hi,

Quoted 19 lines · Pali Roh?r

Some distribution bootscripts append console env into boot cmdline. So define console env correctly to have early console access.

---
    include/configs/mvebu_armada-37xx.h | 2 ++
    1 file changed, 2 insertions(+)
include/configs/mvebu_armada-37xx.h +1 -0
index 6feceda757..b473072976 100644
@@ -17,6 +17,7 @@
    #define CONFIG_SYS_BAUDRATE_TABLE	{ 9600, 19200, 38400, 57600, \
    					  115200, 230400, 460800, 921600 }
+#define CONFIG_DEFAULT_CONSOLE "console=ttyMV0,115200 earlycon=ar3700_uart,0xd0012000"
    /*
     * For booting Linux, the board info and command line data

include/configs/mvebu_armada-37xx.h line 106

Quoted 7 lines
include/configs/mvebu_armada-37xx.h +1 -0
@@ -99,6 +100,7 @@
    	"kernel_addr=0x7000000\0"	\
    	"kernel_addr_r=0x7000000\0"	\
    	"ramdisk_addr_r=0x8000000\0"	\
+	"console=" CONFIG_DEFAULT_CONSOLE "\0" \
    	BOOTENV
    #endif /* _CONFIG_MVEBU_ARMADA_37XX_H */
 

this breaks booting debian with systemd for me:

[    4.632197] systemd-udevd[90]: Starting version 241
[    4.639324] systemd-udevd[91]: Failed to create udev control event

source: Operation not permitted

Quoted 8 lines
Quoted 1 line

"env delete console" and it works again.

This is really suspicious. Why systemd has problems with control socket when console= parameter is specified on boot command line? And if console= parameter is problematic on command line, why console output is working fine? For me it looks like this variable controls something different, not (only) console output. Maybe some bootscript sets something more when it see u-boot env ${console} non-empty?

It sounds like a bug in systemd, this may be related:
https://github.com/systemd/systemd/issues/13332

With ugly workarounds like:
https://github.com/openembedded/openembedded-core/commit/dd6ee0b06cd8df6204cf600050516d15172302ea

Quoted 8 lines
Quoted 2 lines

This is easy for to me to work around, but note that this systemd version is the one shipping with current debian stable.

But this looks like to be related to command line 'console=null'.

Can you check which parameter is causing problem? console=... or earlycon=... ? Also do you have /dev/ttyMV0 in your system?

yup, it's there:
crw--w---- 1 root tty 253, 0 Aug 26 15:09 /dev/ttyMV0

But I think it's related to console=null because it ends up as invalid:
Your patch sets "console" to "console=...".
Debian's boot.scr set "bootargs" to "... console=${console}". So we end up with with kernel args "console=console=..." :)

So we need to strip one "console=", at least for debian's boot scripts:
"setenv console ttyMV0,115200 earlycon=ar3700_uart,0xd0012000" and it works again, including earlycon.

Regards,
Andre

#12 lore raw

PATCH 4/5 arm: mvebu: Espressobin: Define console env

Quoted 63 lines · On Wednesday 26 August 2020 16:43:10 Andre Heider wrote:
Quoted 53 lines · Pali Roh?r
Quoted 52 lines · On Wednesday 26 August 2020 16:00:05 Andre Heider wrote:
Quoted 36 lines · Pali Roh?r
Quoted 35 lines · On Wednesday 26 August 2020 15:22:26 Andre Heider wrote:

Hi,

Quoted 19 lines · Pali Roh?r

Some distribution bootscripts append console env into boot cmdline. So define console env correctly to have early console access.

---
    include/configs/mvebu_armada-37xx.h | 2 ++
    1 file changed, 2 insertions(+)
include/configs/mvebu_armada-37xx.h +1 -0
index 6feceda757..b473072976 100644
@@ -17,6 +17,7 @@
    #define CONFIG_SYS_BAUDRATE_TABLE	{ 9600, 19200, 38400, 57600, \
    					  115200, 230400, 460800, 921600 }
+#define CONFIG_DEFAULT_CONSOLE "console=ttyMV0,115200 earlycon=ar3700_uart,0xd0012000"
    /*
     * For booting Linux, the board info and command line data

include/configs/mvebu_armada-37xx.h line 106

Quoted 7 lines
include/configs/mvebu_armada-37xx.h +1 -0
@@ -99,6 +100,7 @@
    	"kernel_addr=0x7000000\0"	\
    	"kernel_addr_r=0x7000000\0"	\
    	"ramdisk_addr_r=0x8000000\0"	\
+	"console=" CONFIG_DEFAULT_CONSOLE "\0" \
    	BOOTENV
    #endif /* _CONFIG_MVEBU_ARMADA_37XX_H */
 

this breaks booting debian with systemd for me:

[    4.632197] systemd-udevd[90]: Starting version 241
[    4.639324] systemd-udevd[91]: Failed to create udev control event

source: Operation not permitted

Quoted 8 lines
Quoted 1 line

"env delete console" and it works again.

This is really suspicious. Why systemd has problems with control socket when console= parameter is specified on boot command line? And if console= parameter is problematic on command line, why console output is working fine? For me it looks like this variable controls something different, not (only) console output. Maybe some bootscript sets something more when it see u-boot env ${console} non-empty?

It sounds like a bug in systemd, this may be related:
https://github.com/systemd/systemd/issues/13332

With ugly workarounds like:
https://github.com/openembedded/openembedded-core/commit/dd6ee0b06cd8df6204cf600050516d15172302ea

Quoted 8 lines
Quoted 2 lines

This is easy for to me to work around, but note that this systemd version is the one shipping with current debian stable.

But this looks like to be related to command line 'console=null'.

Can you check which parameter is causing problem? console=... or earlycon=... ? Also do you have /dev/ttyMV0 in your system?

Quoted 5 lines

yup, it's there:
crw--w---- 1 root tty 253, 0 Aug 26 15:09 /dev/ttyMV0

But I think it's related to console=null because it ends up as invalid:
Your patch sets "console" to "console=...".

It is doing same thing as other boards in U-Boot, see:

$ git grep 'define.*CONFIG_DEFAULT_CONSOLE'
include/configs/arndale.h:#define CONFIG_DEFAULT_CONSOLE                "console=ttySAC2,115200n8\0"
include/configs/espresso7420.h:#define CONFIG_DEFAULT_CONSOLE   "console=ttySAC1,115200n8\0"
include/configs/odroid.h:#define CONFIG_DEFAULT_CONSOLE         "console=ttySAC1,115200n8\0"
include/configs/odroid_xu3.h:#define CONFIG_DEFAULT_CONSOLE             "console=ttySAC2,115200n8\0"
include/configs/origen.h:#define CONFIG_DEFAULT_CONSOLE         "console=ttySAC1,115200n8\0"
include/configs/peach-pi.h:#define CONFIG_DEFAULT_CONSOLE       "console=ttySAC1,115200n8\0"
include/configs/peach-pit.h:#define CONFIG_DEFAULT_CONSOLE      "console=ttySAC1,115200n8\0"
include/configs/s5p_goni.h:#define CONFIG_DEFAULT_CONSOLE       "console=ttySAC2,115200n8\0"
include/configs/s5pc210_universal.h:#define CONFIG_DEFAULT_CONSOLE              "console=ttySAC1,115200n8\0"
include/configs/smdk5250.h:#define CONFIG_DEFAULT_CONSOLE               "console=ttySAC1,115200n8\0"
include/configs/smdk5420.h:#define CONFIG_DEFAULT_CONSOLE       "console=ttySAC1,115200n8\0"
include/configs/smdk5420.h:#define CONFIG_DEFAULT_CONSOLE               "console=ttySAC1,115200n8\0"
include/configs/smdkv310.h:#define CONFIG_DEFAULT_CONSOLE               "console=ttySAC2,115200n8\0"
include/configs/snow.h:#define CONFIG_DEFAULT_CONSOLE           "console=ttySAC1,115200n8\0"
include/configs/spring.h:#define CONFIG_DEFAULT_CONSOLE         "console=ttySAC1,115200n8\0"
include/configs/trats.h:#define CONFIG_DEFAULT_CONSOLE          "console=ttySAC2,115200n8\0"
include/configs/trats2.h:#define CONFIG_DEFAULT_CONSOLE         "console=ttySAC2,115200n8\0"

and:

$ git grep 'CONFIG_DEFAULT_CONSOLE' | grep -v ':#define'
include/configs/odroid.h:       "console=" CONFIG_DEFAULT_CONSOLE \
include/configs/odroid_xu3.h:   "console=" CONFIG_DEFAULT_CONSOLE \
include/configs/s5p_goni.h:     "console=" CONFIG_DEFAULT_CONSOLE \
include/configs/s5pc210_universal.h:    "console=" CONFIG_DEFAULT_CONSOLE \
include/configs/trats.h:        "console=" CONFIG_DEFAULT_CONSOLE \
include/configs/trats2.h:       "console=" CONFIG_DEFAULT_CONSOLE \
scripts/config_whitelist.txt:CONFIG_DEFAULT_CONSOLE
Quoted 2 lines

Debian's boot.scr set "bootargs" to "... console=${console}". So we end up with with kernel args "console=console=..." :)

So then also other U-Boot boards are broken in Debian... Where is that Debian's boot.scr file? In which package?

Armbian has 'setenv bootargs "$console ...'
https://dl.armbian.com/espressobin/u-boot/bootscript/boot.cmd

OpenWRT has 'setenv bootargs "${bootargs} ${console}"'
https://github.com/openwrt/openwrt/blob/master/target/linux/mvebu/image/generic-arm64.bootscript

So it seems that all expects that ${console} env contains 'console=tty...'

Quoted 6 lines

So we need to strip one "console=", at least for debian's boot scripts:
"setenv console ttyMV0,115200 earlycon=ar3700_uart,0xd0012000" and it works again, including earlycon.

Regards,
Andre

#13 lore raw

PATCH 4/5 arm: mvebu: Espressobin: Define console env

Quoted 102 lines · Pali Roh?r
Quoted 63 lines · On Wednesday 26 August 2020 16:43:10 Andre Heider wrote:
Quoted 53 lines · Pali Roh?r
Quoted 52 lines · On Wednesday 26 August 2020 16:00:05 Andre Heider wrote:
Quoted 36 lines · Pali Roh?r
Quoted 35 lines · On Wednesday 26 August 2020 15:22:26 Andre Heider wrote:

Hi,

Quoted 19 lines · Pali Roh?r

Some distribution bootscripts append console env into boot cmdline. So define console env correctly to have early console access.

---
     include/configs/mvebu_armada-37xx.h | 2 ++
     1 file changed, 2 insertions(+)
include/configs/mvebu_armada-37xx.h +1 -0
index 6feceda757..b473072976 100644
@@ -17,6 +17,7 @@
     #define CONFIG_SYS_BAUDRATE_TABLE	{ 9600, 19200, 38400, 57600, \
     					  115200, 230400, 460800, 921600 }
+#define CONFIG_DEFAULT_CONSOLE "console=ttyMV0,115200 earlycon=ar3700_uart,0xd0012000"
     /*
      * For booting Linux, the board info and command line data

include/configs/mvebu_armada-37xx.h line 106

Quoted 7 lines
include/configs/mvebu_armada-37xx.h +1 -0
@@ -99,6 +100,7 @@
     	"kernel_addr=0x7000000\0"	\
     	"kernel_addr_r=0x7000000\0"	\
     	"ramdisk_addr_r=0x8000000\0"	\
+	"console=" CONFIG_DEFAULT_CONSOLE "\0" \
     	BOOTENV
     #endif /* _CONFIG_MVEBU_ARMADA_37XX_H */
 

this breaks booting debian with systemd for me:

[    4.632197] systemd-udevd[90]: Starting version 241
[    4.639324] systemd-udevd[91]: Failed to create udev control event

source: Operation not permitted

Quoted 8 lines
Quoted 1 line

"env delete console" and it works again.

This is really suspicious. Why systemd has problems with control socket when console= parameter is specified on boot command line? And if console= parameter is problematic on command line, why console output is working fine? For me it looks like this variable controls something different, not (only) console output. Maybe some bootscript sets something more when it see u-boot env ${console} non-empty?

It sounds like a bug in systemd, this may be related:
https://github.com/systemd/systemd/issues/13332

With ugly workarounds like:
https://github.com/openembedded/openembedded-core/commit/dd6ee0b06cd8df6204cf600050516d15172302ea

Quoted 8 lines
Quoted 2 lines

This is easy for to me to work around, but note that this systemd version is the one shipping with current debian stable.

But this looks like to be related to command line 'console=null'.

Can you check which parameter is causing problem? console=... or earlycon=... ? Also do you have /dev/ttyMV0 in your system?

Quoted 5 lines

yup, it's there:
crw--w---- 1 root tty 253, 0 Aug 26 15:09 /dev/ttyMV0

But I think it's related to console=null because it ends up as invalid:
Your patch sets "console" to "console=...".

It is doing same thing as other boards in U-Boot, see:

$ git grep 'define.*CONFIG_DEFAULT_CONSOLE'
include/configs/arndale.h:#define CONFIG_DEFAULT_CONSOLE                "console=ttySAC2,115200n8\0"
include/configs/espresso7420.h:#define CONFIG_DEFAULT_CONSOLE   "console=ttySAC1,115200n8\0"
include/configs/odroid.h:#define CONFIG_DEFAULT_CONSOLE         "console=ttySAC1,115200n8\0"
include/configs/odroid_xu3.h:#define CONFIG_DEFAULT_CONSOLE             "console=ttySAC2,115200n8\0"
include/configs/origen.h:#define CONFIG_DEFAULT_CONSOLE         "console=ttySAC1,115200n8\0"
include/configs/peach-pi.h:#define CONFIG_DEFAULT_CONSOLE       "console=ttySAC1,115200n8\0"
include/configs/peach-pit.h:#define CONFIG_DEFAULT_CONSOLE      "console=ttySAC1,115200n8\0"
include/configs/s5p_goni.h:#define CONFIG_DEFAULT_CONSOLE       "console=ttySAC2,115200n8\0"
include/configs/s5pc210_universal.h:#define CONFIG_DEFAULT_CONSOLE              "console=ttySAC1,115200n8\0"
include/configs/smdk5250.h:#define CONFIG_DEFAULT_CONSOLE               "console=ttySAC1,115200n8\0"
include/configs/smdk5420.h:#define CONFIG_DEFAULT_CONSOLE       "console=ttySAC1,115200n8\0"
include/configs/smdk5420.h:#define CONFIG_DEFAULT_CONSOLE               "console=ttySAC1,115200n8\0"
include/configs/smdkv310.h:#define CONFIG_DEFAULT_CONSOLE               "console=ttySAC2,115200n8\0"
include/configs/snow.h:#define CONFIG_DEFAULT_CONSOLE           "console=ttySAC1,115200n8\0"
include/configs/spring.h:#define CONFIG_DEFAULT_CONSOLE         "console=ttySAC1,115200n8\0"
include/configs/trats.h:#define CONFIG_DEFAULT_CONSOLE          "console=ttySAC2,115200n8\0"
include/configs/trats2.h:#define CONFIG_DEFAULT_CONSOLE         "console=ttySAC2,115200n8\0"

and:

$ git grep 'CONFIG_DEFAULT_CONSOLE' | grep -v ':#define'
include/configs/odroid.h:       "console=" CONFIG_DEFAULT_CONSOLE \
include/configs/odroid_xu3.h:   "console=" CONFIG_DEFAULT_CONSOLE \
include/configs/s5p_goni.h:     "console=" CONFIG_DEFAULT_CONSOLE \
include/configs/s5pc210_universal.h:    "console=" CONFIG_DEFAULT_CONSOLE \
include/configs/trats.h:        "console=" CONFIG_DEFAULT_CONSOLE \
include/configs/trats2.h:       "console=" CONFIG_DEFAULT_CONSOLE \
scripts/config_whitelist.txt:CONFIG_DEFAULT_CONSOLE
Quoted 5 lines
Quoted 2 lines

Debian's boot.scr set "bootargs" to "... console=${console}". So we end up with with kernel args "console=console=..." :)

So then also other U-Boot boards are broken in Debian... Where is that Debian's boot.scr file? In which package?

That would be flash-kernel:
https://packages.qa.debian.org/f/flash-kernel.html

bootscript/all/bootscr.uboot-generic: setenv bootargs "${bootargs} console=${console}" bootscript/arm64/bootscr.uboot-generic: setenv bootargs "${bootargs} console=${console}"
bootscript/armhf/bootscr.cubox:setenv bootargs @@LINUX_KERNEL_CMDLINE_DEFAULTS@@ console=${console} @@LINUX_KERNEL_CMDLINE@@
bootscript/armhf/bootscr.sunxi: setenv bootargs "${bootargs} console=${console}"
debian/changelog: - If ${console} is set then add
"console=${console}" to the bootargs.

The last entry points to:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=783074

Which has:

Quoted 2 lines

I suppose hush doesn't have sufficient power to check for an existing console= in bootargs?

Not that I'm aware of.

So yeah...

Regards,
Andre

Quoted 15 lines

Armbian has 'setenv bootargs "$console ...'
https://dl.armbian.com/espressobin/u-boot/bootscript/boot.cmd

OpenWRT has 'setenv bootargs "${bootargs} ${console}"'
https://github.com/openwrt/openwrt/blob/master/target/linux/mvebu/image/generic-arm64.bootscript

So it seems that all expects that ${console} env contains 'console=tty...'

Quoted 6 lines

So we need to strip one "console=", at least for debian's boot scripts:
"setenv console ttyMV0,115200 earlycon=ar3700_uart,0xd0012000" and it works again, including earlycon.

Regards,
Andre

#14 lore raw

PATCH 4/5 arm: mvebu: Espressobin: Define console env

In reply to Pali Rohár
Quoted 93 lines · Pali Roh?r
Quoted 63 lines · On Wednesday 26 August 2020 16:43:10 Andre Heider wrote:
Quoted 53 lines · Pali Roh?r
Quoted 52 lines · On Wednesday 26 August 2020 16:00:05 Andre Heider wrote:
Quoted 36 lines · Pali Roh?r
Quoted 35 lines · On Wednesday 26 August 2020 15:22:26 Andre Heider wrote:

Hi,

Quoted 19 lines · Pali Roh?r

Some distribution bootscripts append console env into boot cmdline. So define console env correctly to have early console access.

---
     include/configs/mvebu_armada-37xx.h | 2 ++
     1 file changed, 2 insertions(+)
include/configs/mvebu_armada-37xx.h +1 -0
index 6feceda757..b473072976 100644
@@ -17,6 +17,7 @@
     #define CONFIG_SYS_BAUDRATE_TABLE	{ 9600, 19200, 38400, 57600, \
     					  115200, 230400, 460800, 921600 }
+#define CONFIG_DEFAULT_CONSOLE "console=ttyMV0,115200 earlycon=ar3700_uart,0xd0012000"
     /*
      * For booting Linux, the board info and command line data

include/configs/mvebu_armada-37xx.h line 106

Quoted 7 lines
include/configs/mvebu_armada-37xx.h +1 -0
@@ -99,6 +100,7 @@
     	"kernel_addr=0x7000000\0"	\
     	"kernel_addr_r=0x7000000\0"	\
     	"ramdisk_addr_r=0x8000000\0"	\
+	"console=" CONFIG_DEFAULT_CONSOLE "\0" \
     	BOOTENV
     #endif /* _CONFIG_MVEBU_ARMADA_37XX_H */
 

this breaks booting debian with systemd for me:

[    4.632197] systemd-udevd[90]: Starting version 241
[    4.639324] systemd-udevd[91]: Failed to create udev control event

source: Operation not permitted

Quoted 8 lines
Quoted 1 line

"env delete console" and it works again.

This is really suspicious. Why systemd has problems with control socket when console= parameter is specified on boot command line? And if console= parameter is problematic on command line, why console output is working fine? For me it looks like this variable controls something different, not (only) console output. Maybe some bootscript sets something more when it see u-boot env ${console} non-empty?

It sounds like a bug in systemd, this may be related:
https://github.com/systemd/systemd/issues/13332

With ugly workarounds like:
https://github.com/openembedded/openembedded-core/commit/dd6ee0b06cd8df6204cf600050516d15172302ea

Quoted 8 lines
Quoted 2 lines

This is easy for to me to work around, but note that this systemd version is the one shipping with current debian stable.

But this looks like to be related to command line 'console=null'.

Can you check which parameter is causing problem? console=... or earlycon=... ? Also do you have /dev/ttyMV0 in your system?

Quoted 5 lines

yup, it's there:
crw--w---- 1 root tty 253, 0 Aug 26 15:09 /dev/ttyMV0

But I think it's related to console=null because it ends up as invalid:
Your patch sets "console" to "console=...".

It is doing same thing as other boards in U-Boot, see:

$ git grep 'define.*CONFIG_DEFAULT_CONSOLE'
include/configs/arndale.h:#define CONFIG_DEFAULT_CONSOLE                "console=ttySAC2,115200n8\0"
include/configs/espresso7420.h:#define CONFIG_DEFAULT_CONSOLE   "console=ttySAC1,115200n8\0"
include/configs/odroid.h:#define CONFIG_DEFAULT_CONSOLE         "console=ttySAC1,115200n8\0"
include/configs/odroid_xu3.h:#define CONFIG_DEFAULT_CONSOLE             "console=ttySAC2,115200n8\0"
include/configs/origen.h:#define CONFIG_DEFAULT_CONSOLE         "console=ttySAC1,115200n8\0"
include/configs/peach-pi.h:#define CONFIG_DEFAULT_CONSOLE       "console=ttySAC1,115200n8\0"
include/configs/peach-pit.h:#define CONFIG_DEFAULT_CONSOLE      "console=ttySAC1,115200n8\0"
include/configs/s5p_goni.h:#define CONFIG_DEFAULT_CONSOLE       "console=ttySAC2,115200n8\0"
include/configs/s5pc210_universal.h:#define CONFIG_DEFAULT_CONSOLE              "console=ttySAC1,115200n8\0"
include/configs/smdk5250.h:#define CONFIG_DEFAULT_CONSOLE               "console=ttySAC1,115200n8\0"
include/configs/smdk5420.h:#define CONFIG_DEFAULT_CONSOLE       "console=ttySAC1,115200n8\0"
include/configs/smdk5420.h:#define CONFIG_DEFAULT_CONSOLE               "console=ttySAC1,115200n8\0"
include/configs/smdkv310.h:#define CONFIG_DEFAULT_CONSOLE               "console=ttySAC2,115200n8\0"
include/configs/snow.h:#define CONFIG_DEFAULT_CONSOLE           "console=ttySAC1,115200n8\0"
include/configs/spring.h:#define CONFIG_DEFAULT_CONSOLE         "console=ttySAC1,115200n8\0"
include/configs/trats.h:#define CONFIG_DEFAULT_CONSOLE          "console=ttySAC2,115200n8\0"
include/configs/trats2.h:#define CONFIG_DEFAULT_CONSOLE         "console=ttySAC2,115200n8\0"

and:

Quoted 8 lines
$ git grep 'CONFIG_DEFAULT_CONSOLE' | grep -v ':#define'
include/configs/odroid.h:       "console=" CONFIG_DEFAULT_CONSOLE \
include/configs/odroid_xu3.h:   "console=" CONFIG_DEFAULT_CONSOLE \
include/configs/s5p_goni.h:     "console=" CONFIG_DEFAULT_CONSOLE \
include/configs/s5pc210_universal.h:    "console=" CONFIG_DEFAULT_CONSOLE \
include/configs/trats.h:        "console=" CONFIG_DEFAULT_CONSOLE \
include/configs/trats2.h:       "console=" CONFIG_DEFAULT_CONSOLE \
scripts/config_whitelist.txt:CONFIG_DEFAULT_CONSOLE

Looking at this again, CONFIG_DEFAULT_CONSOLE with "console=" doesn't look like a de facto standard to me:

$ ll include/configs/|wc -l
712
$ git grep CONFIG_DEFAULT_CONSOLE|grep define|wc -l
18

Only 18 out of +700 boards use it, and all of them ttySAC*, so probably just copy pasta.
CONFIG_DEFAULT_CONSOLE looks like a leftover, it's not used anywhere except in those config headers. Some boards even define it, but don't use it, making it effectively dead.

On the other hand, check "git grep 'console='". So why not just add the earlycon to bootargs directly so it works everywhere?

Regards,
Andre

#15 lore raw

PATCH 4/5 arm: mvebu: Espressobin: Define console env

Quoted 2 lines · On Thursday 27 August 2020 06:51:57 Andre Heider wrote:

On the other hand, check "git grep 'console='". So why not just add the earlycon to bootargs directly so it works everywhere?

The only useful thing about CONFIG_DEFAULT_CONSOLE and ${console} env is to propagate earlycon argument to kernel. As console kernel argument is already set via chosen/stdout in DTS.

Setting earlycon directly to ${bootargs} env does not work as basically all distribution scripts set/overwrite ${bootargs} on their own.

So we need to store earlycon argument into some other uboot env and then teach these distribution scripts to append that new uboot env into their bootargs...

Or is there any other way?

#16 lore raw

PATCH 4/5 arm: mvebu: Espressobin: Define console env

Quoted 8 lines · Pali Roh?r
Quoted 2 lines · On Thursday 27 August 2020 06:51:57 Andre Heider wrote:

On the other hand, check "git grep 'console='". So why not just add the earlycon to bootargs directly so it works everywhere?

The only useful thing about CONFIG_DEFAULT_CONSOLE and ${console} env is to propagate earlycon argument to kernel. As console kernel argument is already set via chosen/stdout in DTS.

Quoted 8 lines

Setting earlycon directly to ${bootargs} env does not work as basically all distribution scripts set/overwrite ${bootargs} on their own.

So we need to store earlycon argument into some other uboot env and then teach these distribution scripts to append that new uboot env into their bootargs...

Or is there any other way?

I don't know the answer to that, but as we've seen with $console, it's hard to get everyone on the same page.

But maybe it's not worth the hassle, since console works, and earlycon may only be interesting to ppl who know how to enable it anyway.

Regards,
Andre

#17 lore raw

PATCH 4/5 arm: mvebu: Espressobin: Define console env

In reply to Pali Rohár
Quoted 6 lines · Pali Roh?r
Quoted 2 lines · On Wednesday 26 August 2020 16:43:10 Andre Heider wrote:

Debian's boot.scr set "bootargs" to "... console=${console}". So we end up with with kernel args "console=console=..." :)

So then also other U-Boot boards are broken in Debian...

fyi: I opened a bug for this:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=969070

Regards,
Andre

#18 lore raw

PATCH 5/5 arm: mvebu: Espressobin: Update README.marvell file

In reply to Pali Rohár

Include information about permanent ethernet MAC address and add link how to build ATF as U-Boot on Espressobin cannot be flashed without ATF.

---
 doc/README.marvell | 40 +++++++++++++++++++++++++++++++++++++---
 1 file changed, 37 insertions(+), 3 deletions(-)
doc/README.marvell +37 -3
index 336461745c..da16316407 100644
@@ -13,7 +13,8 @@ Build Procedure
 
 2. Set the cross compiler:
 
-		# export CROSS_COMPILE=/path/to/toolchain/aarch64-marvell-linux-gnu-
+		# sudo apt-get install gcc-aarch64-linux-gnu
+		# export CROSS_COMPILE=aarch64-linux-gnu-
 
 3. Clean-up old residuals:
 
@@ -30,7 +31,7 @@ Build Procedure
 
 5. Configure the device-tree and build the U-Boot image:
 
-	Compile u-boot and set the required device-tree using:
+	For the Armada-70x0/80x0 DB board compile u-boot and set the required device-tree using:
 
 		# make DEVICE_TREE=<name>
 
@@ -42,12 +43,45 @@ Build Procedure
         In order to prevent this, the required device-tree MUST be set during compilation.
         All device-tree files are located in ./arch/arm/dts/ folder.
 
+	For other DB boards (MacchiatoBin, EsspressoBin and 3700 DB board) compile u-boot with
+	just default device-tree from defconfig using:
+
+		# make
+
 	NOTE:
 	The u-boot.bin should not be used as a stand-alone image.
 	The ARM Trusted Firmware (ATF) build process uses this image to generate the
-	flash image.
+	flash image. See TF-A Build Instructions for Marvell Platforms for more details at:
+	https://trustedfirmware-a.readthedocs.io/en/latest/plat/marvell/armada/build.html
 
 Configuration update
 ---------------------
 	To update the U-Boot configuration, please refer to doc/README.kconfig
 
+
+Permanent ethernet MAC address
+-------------------------------
+	Prior flashing new U-Boot version (as part of ATF image) it is suggested to backup
+	permanent ethernet MAC address as it is stored only in U-Boot env storage (SPI or eMMC).
+	Some boards like EspressoBin have MAC address printed on sticker. To print current MAC
+	address run:
+
+		# echo $ethaddr
+
+	MAC addresses 00:51:82:11:22:00, 00:51:82:11:22:01, 00:51:82:11:22:02, 00:51:82:11:22:03
+	and F0:AD:4E:03:64:7F are default hardcoded values found in Marvell's and Armbian U-Boot
+	forks and therefore *not* unique. Usage of static hardcoded MAC addresses should be avoided.
+	When original address is lost (e.g. erased by Armbian boot scripts for EspressoBin) it is
+	suggested to generate new random one.
+
+	After flashing new U-Boot version it is suggested to reset U-Boot env variables to default
+	and then set correct permanent ethernet MAC address.
+
+		# env default -a
+		# setenv ethaddr XX:XX:XX:XX:XX:XX
+		# saveenv
+
+	Where XX:XX:XX:XX:XX:XX is permanent ethernet MAC address.
+
+	Recent Linux kernel versions use correct permanent ethernet MAC address from U-Boot env as
+	U-Boot will inject it into kernel's device-tree.
Signature · 1 line
2.20.1
#20 lore raw

PATCH 1/5 arm: mvebu: Espressobin: Move env load addresses

In reply to Pali Rohár
Quoted 8 lines · Pali Roh?r

According to Marvell's U-Boot description [1] current env load addresses overlaps with ATF RT services region and TEE. Because the ATF RT service and TEE region is going to be marked as secure and can't be overwritten, use different different addresses for envs.

[1] - https://github.com/MarvellEmbeddedProcessors/u-boot-marvell/commit/0a5b159806baa0746b6449920e450498bc269ba7

Thanks,
Stefan

#21 lore raw

PATCH 1/5 arm: mvebu: Espressobin: Move env load addresses

In reply to Pali Rohár

Pali,

thank you for all these espressobin fixes, much appreciated!

This isn't directly related to the patch I'm replying to, but since you seem to be syncing down- with upstream:

Upstream u-boot doesn't detect my sata ssd ("SATA link 0 timeout"), nor is it able to run debian's kernel (hangs after "Starting kernel"). Both work with armbian's downstream flash-image.bin.

I'm using the espressobin v1 with these patches from the list on top of 2020.07:
arm64: a37xx: pci: Depends on DM_GPIO
arm: mvebu: Espressobin: Update README.marvell file
arm: mvebu: Espressobin: Define console env
arm: mvebu: Espressobin: Define fdt_addr and kernel_addr env aliases
arm: mvebu: Espressobin: Change default loadaddr
arm: mvebu: Espressobin: Move env load addresses
arm: mvebu: Espressobin: Setup MTD partitions when booting kernel
arm: mvebu: Espressobin: Make SPI env offset compatible with Marvell's U-Boot
arm: dts: a37x0: enable sd card support on espressobin
mmc: xenon: set signal voltage and max base clock
arm64: a37xx: pci: Assert PERST# signal when unloading driver
arm64: a37xx: pci: Make PCIe Reset GPIO DT compatible with Linux kernel DT
arm64: dts: armada-3720-espressobin: fix COMPHY nodes
arm: mvebu: Espressobin: Enable CONFIG_MVNETA
arm: mvebu: Espressobin: Disallow forwarding packets between wan and lan ports

Bootlog:

TIM-1.0
WTMI-devel-18.12.1-

WTMI: system early-init
CPU VDD voltage default value: 1.108V
NOTICE:  Booting Trusted Firmware
NOTICE:  BL1: v2.3(): (Marvell-devel-18.12.0)
NOTICE:  BL1: Built : 06:12:46, Aug 26 2020
NOTICE:  BL1: Booting BL2
NOTICE:  BL2: v2.3(): (Marvell-devel-18.12.0)
NOTICE:  BL2: Built : 06:12:46, Aug 26 2020
NOTICE:  BL1: Booting BL31
NOTICE:  BL31: v2.3(): (Marvell-devel-18.12.0)
NOTICE:  BL31: Built : 06:12:46

U-Boot 2020.07 (Aug 26 2020 - 06:12:46 +0000)

DRAM: 1 GiB
Comphy-0: USB3_HOST0 5 Gbps
Comphy-1: PEX0 2.5 Gbps
Comphy-2: SATA0 5 Gbps
SATA link 0 timeout.
AHCI 0001.0300 32 slots 1 ports 6 Gbps 0x1 impl SATA mode
flags: ncq led only pmp fbss pio slum part sxs
PCIE-0: Link up
MMC: sdhci at d0000: 0
Loading Environment from SPI Flash... SF: Detected w25q32dw with page size 256 Bytes, erase size 4 KiB, total 4 MiB
OK

Model: Marvell Armada 3720 Community Board ESPRESSOBin
Net:   eth0: neta at 30000
Hit any key to stop autoboot:  0

MMC Device 1 not found
no mmc device at slot 1
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
Found U-Boot script /boot.scr
2250 bytes read in 12 ms (182.6 KiB/s)
## Executing script at 06d00000
22079344 bytes read in 1219 ms (17.3 MiB/s) 10671 bytes read in 24 ms (433.6 KiB/s) 27689238 bytes read in 1555 ms (17 MiB/s) Booting Debian 5.7.0-0.bpo.2-arm64 from mmc 0:1... ## Flattened Device Tree blob at 06f00000

    Booting using the fdt blob at 0x6f00000
    Loading Ramdisk to 3e0be000, end 3fb26116 ... OK
    Loading Device Tree to 000000003e0b8000, end 000000003e0bd9ae ... OK

Starting kernel ...
<hangs here>

Bootlog with armbian's flash-image-ddr3-1g-2cs-800_800.bin:
TIM-1.0
WTMI-devel-18.12.1-e6bb176

WTMI: system early-init
CPU VDD voltage default value: 1.108V
NOTICE:  Booting Trusted Firmware
NOTICE:  BL1: v1.5(release):1f8ca7e (Marvell-devel-18.12.2)
NOTICE:  BL1: Built : 16:22:53, May 21 2019
NOTICE:  BL1: Booting BL2
NOTICE:  BL2: v1.5(release):1f8ca7e (Marvell-devel-18.12.2)
NOTICE:  BL2: Built : 16:22:55, May 21 2019
NOTICE:  BL1: Booting BL31
NOTICE:  BL31: v1.5(release):1f8ca7e (Marvell-devel-18.12.2)
NOTICE:  BL31: Built : 16:22:58

U-Boot 2018.03-devel-18.12.3-gc9aa92c-armbian (Feb 20 2019 - 09:45:04 +0100)

Model: Marvell Armada 3720 Community Board ESPRESSOBin

        CPU     800 [MHz]
        L2      800 [MHz]
        TClock  200 [MHz]
        DDR     800 [MHz]

DRAM: 1 GiB
Comphy chip #0:
Comphy-0: USB3 5 Gbps
Comphy-1: PEX0 2.5 Gbps
Comphy-2: SATA0 6 Gbps
Target spinup took 0 ms.
AHCI 0001.0300 32 slots 1 ports 6 Gbps 0x1 impl SATA mode
flags: ncq led only pmp fbss pio slum part sxs
PCIE-0: Link up
MMC: sdhci at d0000: 0, sdhci at d8000: 1
Loading Environment from SPI Flash... SF: Detected w25q32dw with page size 256 Bytes, erase size 4 KiB, total 4 MiB
OK

Model: Marvell Armada 3720 Community Board ESPRESSOBin
Net:   eth0: neta at 30000 [PRIME]
Hit any key to stop autoboot:  0

/
2250 bytes read in 10 ms (219.7 KiB/s)
## Executing script at 06d00000
22079344 bytes read in 1231 ms (17.1 MiB/s)
10671 bytes read in 20 ms (520.5 KiB/s)
27689238 bytes read in 1570 ms (16.8 MiB/s)
Booting Debian 5.7.0-0.bpo.2-arm64 from mmc 0:...
## Flattened Device Tree blob at 06000000

    Booting using the fdt blob at 0x6000000
    Loading Ramdisk to 3dbc2000, end 3f62a116 ... OK
    Using Device Tree in place at 0000000006000000, end 00000000060059ae

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
[    0.000000] Linux version 5.7.0-0.bpo.2-arm64 
(debian-kernel at lists.debian.org) (gcc version 8.3.0 (Debian 8.3.0-6), 
GNU ld (GNU Binutils for Debian) 2.31.1) #1 SMP Debian 5.7.10-1~bpo10+1 
(2020-07-30)
[    0.000000] Machine model: Globalscale Marvell ESPRESSOBin Board

Any idea?

Thanks in advance!
Andre

#22 lore raw

Espressobin booting (Was: Re: [PATCH 1/5] arm: mvebu: Espressobin: Move env load addresses)

Hello!

Quoted 8 lines · On Wednesday 26 August 2020 09:30:11 Andre Heider wrote:

Pali,

thank you for all these espressobin fixes, much appreciated!

This isn't directly related to the patch I'm replying to, but since you seem to be syncing down- with upstream:

Upstream u-boot doesn't detect my sata ssd ("SATA link 0 timeout"), nor is

Could you try following Marvell SATA/AHCI patch?
https://github.com/MarvellEmbeddedProcessors/u-boot-marvell/commit/2c1571432e4fd298be0236b53511f415bbdd21ac

Quoted 4 lines

it able to run debian's kernel (hangs after "Starting kernel"). Both work with armbian's downstream flash-image.bin.

I'm using the espressobin v1 with these patches from the list on top of

Do you really have espressobin v1? I saw hw schemas and diagrams only for V3, V4, V5 and V7. And I tested only V5 as I do not have any other revisions.

Quoted 69 lines

2020.07:
arm64: a37xx: pci: Depends on DM_GPIO
arm: mvebu: Espressobin: Update README.marvell file
arm: mvebu: Espressobin: Define console env
arm: mvebu: Espressobin: Define fdt_addr and kernel_addr env aliases
arm: mvebu: Espressobin: Change default loadaddr
arm: mvebu: Espressobin: Move env load addresses
arm: mvebu: Espressobin: Setup MTD partitions when booting kernel
arm: mvebu: Espressobin: Make SPI env offset compatible with Marvell's U-Boot
arm: dts: a37x0: enable sd card support on espressobin
mmc: xenon: set signal voltage and max base clock
arm64: a37xx: pci: Assert PERST# signal when unloading driver
arm64: a37xx: pci: Make PCIe Reset GPIO DT compatible with Linux kernel DT
arm64: dts: armada-3720-espressobin: fix COMPHY nodes
arm: mvebu: Espressobin: Enable CONFIG_MVNETA
arm: mvebu: Espressobin: Disallow forwarding packets between wan and lan ports

Bootlog:

TIM-1.0
WTMI-devel-18.12.1-

WTMI: system early-init
CPU VDD voltage default value: 1.108V
NOTICE:  Booting Trusted Firmware
NOTICE:  BL1: v2.3(): (Marvell-devel-18.12.0)
NOTICE:  BL1: Built : 06:12:46, Aug 26 2020
NOTICE:  BL1: Booting BL2
NOTICE:  BL2: v2.3(): (Marvell-devel-18.12.0)
NOTICE:  BL2: Built : 06:12:46, Aug 26 2020
NOTICE:  BL1: Booting BL31
NOTICE:  BL31: v2.3(): (Marvell-devel-18.12.0)
NOTICE:  BL31: Built : 06:12:46

U-Boot 2020.07 (Aug 26 2020 - 06:12:46 +0000)

DRAM: 1 GiB
Comphy-0: USB3_HOST0 5 Gbps
Comphy-1: PEX0 2.5 Gbps
Comphy-2: SATA0 5 Gbps
SATA link 0 timeout.
AHCI 0001.0300 32 slots 1 ports 6 Gbps 0x1 impl SATA mode
flags: ncq led only pmp fbss pio slum part sxs
PCIE-0: Link up
MMC: sdhci at d0000: 0
Loading Environment from SPI Flash... SF: Detected w25q32dw with page size 256 Bytes, erase size 4 KiB, total 4 MiB
OK

Model: Marvell Armada 3720 Community Board ESPRESSOBin
Net:   eth0: neta at 30000
Hit any key to stop autoboot:  0

MMC Device 1 not found
no mmc device at slot 1
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
Found U-Boot script /boot.scr
2250 bytes read in 12 ms (182.6 KiB/s)
## Executing script at 06d00000
22079344 bytes read in 1219 ms (17.3 MiB/s)
10671 bytes read in 24 ms (433.6 KiB/s)
27689238 bytes read in 1555 ms (17 MiB/s)
Booting Debian 5.7.0-0.bpo.2-arm64 from mmc 0:1...
## Flattened Device Tree blob at 06f00000
Booting using the fdt blob at 0x6f00000
Loading Ramdisk to 3e0be000, end 3fb26116 ... OK
Loading Device Tree to 000000003e0b8000, end 000000003e0bd9ae ... OK

Quoted 2 lines

Starting kernel ...
<hangs here>

Can you write which commands you have run to load & boot kernel? What are command line arguments for kernel?

Also have you reset env variables to default?

#23 lore raw

Espressobin booting (Was: Re: [PATCH 1/5] arm: mvebu: Espressobin: Move env load addresses)

Hi,

Quoted 7 lines · Pali Roh?r

Hello!

Quoted 4 lines · On Wednesday 26 August 2020 09:30:11 Andre Heider wrote:

Pali,

thank you for all these espressobin fixes, much appreciated!

Quoted 7 lines
Quoted 4 lines

This isn't directly related to the patch I'm replying to, but since you seem to be syncing down- with upstream:

Upstream u-boot doesn't detect my sata ssd ("SATA link 0 timeout"), nor is

Could you try following Marvell SATA/AHCI patch?
https://github.com/MarvellEmbeddedProcessors/u-boot-marvell/commit/2c1571432e4fd298be0236b53511f415bbdd21ac

will do that later and report my findings, thanks!

Quoted 8 lines
Quoted 4 lines

it able to run debian's kernel (hangs after "Starting kernel"). Both work with armbian's downstream flash-image.bin.

I'm using the espressobin v1 with these patches from the list on top of

Do you really have espressobin v1? I saw hw schemas and diagrams only for V3, V4, V5 and V7. And I tested only V5 as I do not have any other revisions.

Oh sorry, I meant the first public version, the one with ddr3 memory. Which would be the V5 schematics iirc.

Quoted 69 lines
Quoted 69 lines

2020.07:
arm64: a37xx: pci: Depends on DM_GPIO
arm: mvebu: Espressobin: Update README.marvell file
arm: mvebu: Espressobin: Define console env
arm: mvebu: Espressobin: Define fdt_addr and kernel_addr env aliases
arm: mvebu: Espressobin: Change default loadaddr
arm: mvebu: Espressobin: Move env load addresses
arm: mvebu: Espressobin: Setup MTD partitions when booting kernel
arm: mvebu: Espressobin: Make SPI env offset compatible with Marvell's U-Boot
arm: dts: a37x0: enable sd card support on espressobin
mmc: xenon: set signal voltage and max base clock
arm64: a37xx: pci: Assert PERST# signal when unloading driver
arm64: a37xx: pci: Make PCIe Reset GPIO DT compatible with Linux kernel DT
arm64: dts: armada-3720-espressobin: fix COMPHY nodes
arm: mvebu: Espressobin: Enable CONFIG_MVNETA
arm: mvebu: Espressobin: Disallow forwarding packets between wan and lan ports

Bootlog:

TIM-1.0
WTMI-devel-18.12.1-

WTMI: system early-init
CPU VDD voltage default value: 1.108V
NOTICE:  Booting Trusted Firmware
NOTICE:  BL1: v2.3(): (Marvell-devel-18.12.0)
NOTICE:  BL1: Built : 06:12:46, Aug 26 2020
NOTICE:  BL1: Booting BL2
NOTICE:  BL2: v2.3(): (Marvell-devel-18.12.0)
NOTICE:  BL2: Built : 06:12:46, Aug 26 2020
NOTICE:  BL1: Booting BL31
NOTICE:  BL31: v2.3(): (Marvell-devel-18.12.0)
NOTICE:  BL31: Built : 06:12:46

U-Boot 2020.07 (Aug 26 2020 - 06:12:46 +0000)

DRAM: 1 GiB
Comphy-0: USB3_HOST0 5 Gbps
Comphy-1: PEX0 2.5 Gbps
Comphy-2: SATA0 5 Gbps
SATA link 0 timeout.
AHCI 0001.0300 32 slots 1 ports 6 Gbps 0x1 impl SATA mode
flags: ncq led only pmp fbss pio slum part sxs
PCIE-0: Link up
MMC: sdhci at d0000: 0
Loading Environment from SPI Flash... SF: Detected w25q32dw with page size 256 Bytes, erase size 4 KiB, total 4 MiB
OK

Model: Marvell Armada 3720 Community Board ESPRESSOBin
Net:   eth0: neta at 30000
Hit any key to stop autoboot:  0

MMC Device 1 not found
no mmc device at slot 1
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
Found U-Boot script /boot.scr
2250 bytes read in 12 ms (182.6 KiB/s)
## Executing script at 06d00000
22079344 bytes read in 1219 ms (17.3 MiB/s) 10671 bytes read in 24 ms (433.6 KiB/s) 27689238 bytes read in 1555 ms (17 MiB/s) Booting Debian 5.7.0-0.bpo.2-arm64 from mmc 0:1... ## Flattened Device Tree blob at 06f00000

    Booting using the fdt blob at 0x6f00000
    Loading Ramdisk to 3e0be000, end 3fb26116 ... OK
    Loading Device Tree to 000000003e0b8000, end 000000003e0bd9ae ... OK
Quoted 7 lines
Quoted 2 lines

Starting kernel ...
<hangs here>

Can you write which commands you have run to load & boot kernel? What are command line arguments for kernel?

Also have you reset env variables to default?

Yeah, I do reset the full env when switching between the flash images.

For the upstream version:
env default -a
setenv ethaddr f0:ad:4e:03:86:cd
setenv eth1addr f0:ad:4e:03:86:cd
setenv eth2addr f0:ad:4e:03:86:cd
setenv serverip 192.168.0.40
setenv ipaddr 192.168.0.2
saveenv

For the downstream version:
env default -a
env delete console
setenv fdt_addr_r 0x6000000
setenv kernel_addr_r 0x7000000
setenv ramdisk_addr_r 0x1100000
setenv ethaddr f0:ad:4e:03:86:cd
setenv eth1addr f0:ad:4e:03:86:cd
setenv eth2addr f0:ad:4e:03:86:cd
setenv serverip 192.168.0.40
setenv ipaddr 192.168.0.2
setenv fdt_addr 0x6000000
setenv kernel_addr 0x7000000
setenv loadaddr 0x8000000
setenv initrd_size 0x2000000
setenv initrd_addr 0x1100000
setenv scriptaddr 0x6d00000
setenv initrd_image uInitrd
setenv image_name Image
setenv boot_targets 'mmc0 usb sata mmc1'
setenv boot_prefixes '/ /boot/'
setenv bootcmd_mmc0 'setenv devnum 0; setenv devtype mmc; run scan_dev_for_boot;'
setenv bootcmd_mmc1 'setenv devnum 1; setenv devtype mmc; run scan_dev_for_boot;'
setenv bootcmd_sata 'setenv devnum 0; scsi scan; scsi dev 0; setenv devtype scsi; run scan_dev_for_boot;'
setenv bootcmd_usb 'setenv devnum 0; usb start;setenv devtype usb; run scan_dev_for_boot;'
setenv bootcmd 'for target in ${boot_targets}; do run bootcmd_${target}; done'
setenv scan_dev_for_boot 'for prefix in ${boot_prefixes}; do echo ${prefix};run boot_a_script; done'
setenv boot_a_script 'ext4load ${devtype} ${devnum}:1 ${scriptaddr} ${prefix}boot.scr;source ${scriptaddr};'
saveenv

Debian's boot.scr relies on u-boot's distro boot. Downstream still fails to enable it (even managed to break my patch to enable it...), so most of my env is to make it compatible again so I can use an unmodified userland.

Debian's script is rather boring then:

$ strings /boot/boot.scr
boot script
# flash-kernel: bootscr.uboot-generic
# Bootscript using the new unified bootcmd handling
# Expects to be called with the following environment variables set:
#  devtype              e.g. mmc/scsi etc
#  devnum               The device number of the given type
#  bootpart             The partition containing the boot files
#  distro_bootpart      The partition containing the boot files
#                       (introduced in u-boot mainline 2016.01)
#  prefix               Prefix within the boot partiion to the boot files
#  kernel_addr_r        Address to load the kernel to
#  fdt_addr_r           Address to load the FDT to
#  ramdisk_addr_r       Address to load the initrd to.
# The uboot must support the booti and generic filesystem load commands.
if test -n "${console}"; then
   setenv bootargs "${bootargs} console=${console}"
setenv bootargs  ${bootargs} root=LABEL=espresso-root
if test -z "${fk_kvers}"; then
    setenv fk_kvers '5.7.0-0.bpo.2-arm64'
# These two blocks should be the same apart from the use of
# ${fk_kvers} in the first, the syntax supported by u-boot does not
# lend itself to removing this duplication.
if test -n "${fdtfile}"; then
    setenv fdtpath dtbs/${fk_kvers}/${fdtfile}
else
    setenv fdtpath dtb-${fk_kvers}
if test -z "${distro_bootpart}"; then
   setenv partition ${bootpart}
else
   setenv partition ${distro_bootpart}
load ${devtype} ${devnum}:${partition} ${kernel_addr_r} 
${prefix}vmlinuz-${fk_kvers} \
&& load ${devtype} ${devnum}:${partition} ${fdt_addr_r} 
${prefix}${fdtpath} \
&& load ${devtype} ${devnum}:${partition} ${ramdisk_addr_r} 
${prefix}initrd.img-${fk_kvers} \
&& echo "Booting Debian ${fk_kvers} from ${devtype} 
${devnum}:${partition}..." \
&& booti ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr_r}
load ${devtype} ${devnum}:${partition} ${kernel_addr_r} ${prefix}vmlinuz \
&& load ${devtype} ${devnum}:${partition} ${fdt_addr_r} ${prefix}dtb \
&& load ${devtype} ${devnum}:${partition} ${ramdisk_addr_r} 
${prefix}initrd.img \
&& echo "Booting Debian from ${devtype} ${devnum}:${partition}..." \
&& booti ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr_r}

Regards,
Andre

#24 lore raw

Espressobin booting (Was: Re: [PATCH 1/5] arm: mvebu: Espressobin: Move env load addresses)

Quoted 104 lines · On Wednesday 26 August 2020 11:57:01 Andre Heider wrote:

Hi,

Quoted 7 lines · Pali Roh?r

Hello!

Quoted 4 lines · On Wednesday 26 August 2020 09:30:11 Andre Heider wrote:

Pali,

thank you for all these espressobin fixes, much appreciated!

Quoted 7 lines
Quoted 4 lines

This isn't directly related to the patch I'm replying to, but since you seem to be syncing down- with upstream:

Upstream u-boot doesn't detect my sata ssd ("SATA link 0 timeout"), nor is

Could you try following Marvell SATA/AHCI patch?
https://github.com/MarvellEmbeddedProcessors/u-boot-marvell/commit/2c1571432e4fd298be0236b53511f415bbdd21ac

will do that later and report my findings, thanks!

Quoted 8 lines
Quoted 4 lines

it able to run debian's kernel (hangs after "Starting kernel"). Both work with armbian's downstream flash-image.bin.

I'm using the espressobin v1 with these patches from the list on top of

Do you really have espressobin v1? I saw hw schemas and diagrams only for V3, V4, V5 and V7. And I tested only V5 as I do not have any other revisions.

Oh sorry, I meant the first public version, the one with ddr3 memory. Which would be the V5 schematics iirc.

Quoted 72 lines
Quoted 71 lines

2020.07:
arm64: a37xx: pci: Depends on DM_GPIO
arm: mvebu: Espressobin: Update README.marvell file
arm: mvebu: Espressobin: Define console env
arm: mvebu: Espressobin: Define fdt_addr and kernel_addr env aliases
arm: mvebu: Espressobin: Change default loadaddr
arm: mvebu: Espressobin: Move env load addresses
arm: mvebu: Espressobin: Setup MTD partitions when booting kernel
arm: mvebu: Espressobin: Make SPI env offset compatible with Marvell's U-Boot
arm: dts: a37x0: enable sd card support on espressobin
mmc: xenon: set signal voltage and max base clock
arm64: a37xx: pci: Assert PERST# signal when unloading driver
arm64: a37xx: pci: Make PCIe Reset GPIO DT compatible with Linux kernel DT
arm64: dts: armada-3720-espressobin: fix COMPHY nodes
arm: mvebu: Espressobin: Enable CONFIG_MVNETA
arm: mvebu: Espressobin: Disallow forwarding packets between wan and lan ports

Bootlog:

TIM-1.0
WTMI-devel-18.12.1-

WTMI: system early-init
CPU VDD voltage default value: 1.108V
NOTICE:  Booting Trusted Firmware
NOTICE:  BL1: v2.3(): (Marvell-devel-18.12.0)
NOTICE:  BL1: Built : 06:12:46, Aug 26 2020
NOTICE:  BL1: Booting BL2
NOTICE:  BL2: v2.3(): (Marvell-devel-18.12.0)
NOTICE:  BL2: Built : 06:12:46, Aug 26 2020
NOTICE:  BL1: Booting BL31
NOTICE:  BL31: v2.3(): (Marvell-devel-18.12.0)
NOTICE:  BL31: Built : 06:12:46

U-Boot 2020.07 (Aug 26 2020 - 06:12:46 +0000)

DRAM: 1 GiB
Comphy-0: USB3_HOST0 5 Gbps
Comphy-1: PEX0 2.5 Gbps
Comphy-2: SATA0 5 Gbps
SATA link 0 timeout.
AHCI 0001.0300 32 slots 1 ports 6 Gbps 0x1 impl SATA mode
flags: ncq led only pmp fbss pio slum part sxs
PCIE-0: Link up
MMC: sdhci at d0000: 0
Loading Environment from SPI Flash... SF: Detected w25q32dw with page size 256 Bytes, erase size 4 KiB, total 4 MiB
OK

Model: Marvell Armada 3720 Community Board ESPRESSOBin
Net:   eth0: neta at 30000
Hit any key to stop autoboot:  0

MMC Device 1 not found
no mmc device at slot 1
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
Found U-Boot script /boot.scr
2250 bytes read in 12 ms (182.6 KiB/s)
## Executing script at 06d00000
22079344 bytes read in 1219 ms (17.3 MiB/s) 10671 bytes read in 24 ms (433.6 KiB/s) 27689238 bytes read in 1555 ms (17 MiB/s) Booting Debian 5.7.0-0.bpo.2-arm64 from mmc 0:1... ## Flattened Device Tree blob at 06f00000

    Booting using the fdt blob at 0x6f00000
    Loading Ramdisk to 3e0be000, end 3fb26116 ... OK
    Loading Device Tree to 000000003e0b8000, end 000000003e0bd9ae ... OK

Starting kernel ...
<hangs here>

Quoted 6 lines
Quoted 4 lines

Can you write which commands you have run to load & boot kernel? What are command line arguments for kernel?

Also have you reset env variables to default?

Yeah, I do reset the full env when switching between the flash images.

Now I tried to boot openwrt kernel image and it is working fine on tested espressobin v5 unit. I compiled u-boot with all those a37xx patches.

DRAM: 512 MiB
Comphy-0: USB3_HOST0 5 Gbps
Comphy-1: PEX0 2.5 Gbps
Comphy-2: SATA0 5 Gbps
SATA link 0 timeout.
AHCI 0001.0300 32 slots 1 ports 6 Gbps 0x1 impl SATA mode
flags: ncq led only pmp fbss pio slum part sxs
PCIE-0: Link up
MMC: sdhci at d0000: 0
Loading Environment from SPIFlash... SF: Detected w25q32dw with page size 256 Bytes, erase size 4 KiB, total 4 MiB OK

Model: Marvell Armada 3720 Community Board ESPRESSOBin
Net:   eth0: neta at 30000 [PRIME]
Hit any key to stop autoboot:  0 

=> env default -a
## Resetting to default environment
=> setenv bootargs "root=PARTUUID=aefd80c5-02 rw rootwait" => setenv bootargs "${bootargs} ${console}"
=> mmc dev 0
switch to partitions #0, OK
mmc0 is current device
=> load mmc 0:1 ${fdt_addr} armada-3720-espressobin.dtb 10630 bytes read in 11 ms (943.4 KiB/s)
=> load mmc 0:1 ${kernel_addr} Image
10197000 bytes read in 436 ms (22.3 MiB/s)
=> booti ${kernel_addr} - ${fdt_addr}
Moving Image from 0x7000000 to 0x7080000, end=7a82000
## Flattened Device Tree blob at 06f00000
Booting using the fdt blob at 0x6f00000
Loading Device Tree to 000000001fb20000, end 000000001fb25985 ... OK

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
[    0.000000] Linux version 5.4.59 (builder at buildhost) (gcc version 8.4.0 (OpenWrt GCC 8.4.0 r14241-ba2ddba56b)) #0 SMP Mon Aug 24 00:09:30 2020
[    0.000000] Machine model: Globalscale Marvell ESPRESSOBin Board
[    0.000000] earlycon: ar3700_uart0 at MMIO 0x00000000d0012000 (options '')
[    0.000000] printk: bootconsole [ar3700_uart0] enabled
[    0.000000] psci: probing for conduit method from DT.
[    0.000000] psci: PSCIv1.1 detected in firmware.
[    0.000000] psci: Using standard PSCI v0.2 function IDs
[    0.000000] psci: MIGRATE_INFO_TYPE not supported.
[    0.000000] psci: SMC Calling Convention v1.1
[    0.000000] percpu: Embedded 16 pages/cpu s26520 r8192 d30824 u65536
[    0.000000] Detected VIPT I-cache on CPU0
[    0.000000] CPU features: detected: GIC system register CPU interface
[    0.000000] Speculative Store Bypass Disable mitigation not required
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 128512
[    0.000000] Kernel command line: root=PARTUUID=aefd80c5-02 rw rootwait console=ttyMV0,115200 earlycon=ar3700_uart,0xd0012000

...

#25 lore raw

Espressobin booting (Was: Re: [PATCH 1/5] arm: mvebu: Espressobin: Move env load addresses)

Quoted 108 lines · On Wednesday 26 August 2020 12:51:18 Pali Roh?r wrote:
Quoted 107 lines · On Wednesday 26 August 2020 11:57:01 Andre Heider wrote:

Hi,

Quoted 7 lines · Pali Roh?r

Hello!

Quoted 4 lines · On Wednesday 26 August 2020 09:30:11 Andre Heider wrote:

Pali,

thank you for all these espressobin fixes, much appreciated!

Quoted 7 lines
Quoted 4 lines

This isn't directly related to the patch I'm replying to, but since you seem to be syncing down- with upstream:

Upstream u-boot doesn't detect my sata ssd ("SATA link 0 timeout"), nor is

Could you try following Marvell SATA/AHCI patch?
https://github.com/MarvellEmbeddedProcessors/u-boot-marvell/commit/2c1571432e4fd298be0236b53511f415bbdd21ac

will do that later and report my findings, thanks!

Quoted 8 lines
Quoted 4 lines

it able to run debian's kernel (hangs after "Starting kernel"). Both work with armbian's downstream flash-image.bin.

I'm using the espressobin v1 with these patches from the list on top of

Do you really have espressobin v1? I saw hw schemas and diagrams only for V3, V4, V5 and V7. And I tested only V5 as I do not have any other revisions.

Oh sorry, I meant the first public version, the one with ddr3 memory. Which would be the V5 schematics iirc.

Quoted 75 lines
Quoted 65 lines

2020.07:
arm64: a37xx: pci: Depends on DM_GPIO
arm: mvebu: Espressobin: Update README.marvell file
arm: mvebu: Espressobin: Define console env
arm: mvebu: Espressobin: Define fdt_addr and kernel_addr env aliases
arm: mvebu: Espressobin: Change default loadaddr
arm: mvebu: Espressobin: Move env load addresses
arm: mvebu: Espressobin: Setup MTD partitions when booting kernel
arm: mvebu: Espressobin: Make SPI env offset compatible with Marvell's U-Boot
arm: dts: a37x0: enable sd card support on espressobin
mmc: xenon: set signal voltage and max base clock
arm64: a37xx: pci: Assert PERST# signal when unloading driver
arm64: a37xx: pci: Make PCIe Reset GPIO DT compatible with Linux kernel DT
arm64: dts: armada-3720-espressobin: fix COMPHY nodes
arm: mvebu: Espressobin: Enable CONFIG_MVNETA
arm: mvebu: Espressobin: Disallow forwarding packets between wan and lan ports

Bootlog:

TIM-1.0
WTMI-devel-18.12.1-

WTMI: system early-init
CPU VDD voltage default value: 1.108V
NOTICE:  Booting Trusted Firmware
NOTICE:  BL1: v2.3(): (Marvell-devel-18.12.0)
NOTICE:  BL1: Built : 06:12:46, Aug 26 2020
NOTICE:  BL1: Booting BL2
NOTICE:  BL2: v2.3(): (Marvell-devel-18.12.0)
NOTICE:  BL2: Built : 06:12:46, Aug 26 2020
NOTICE:  BL1: Booting BL31
NOTICE:  BL31: v2.3(): (Marvell-devel-18.12.0)
NOTICE:  BL31: Built : 06:12:46

U-Boot 2020.07 (Aug 26 2020 - 06:12:46 +0000)

DRAM: 1 GiB
Comphy-0: USB3_HOST0 5 Gbps
Comphy-1: PEX0 2.5 Gbps
Comphy-2: SATA0 5 Gbps
SATA link 0 timeout.
AHCI 0001.0300 32 slots 1 ports 6 Gbps 0x1 impl SATA mode
flags: ncq led only pmp fbss pio slum part sxs
PCIE-0: Link up
MMC: sdhci at d0000: 0
Loading Environment from SPI Flash... SF: Detected w25q32dw with page size 256 Bytes, erase size 4 KiB, total 4 MiB
OK

Model: Marvell Armada 3720 Community Board ESPRESSOBin
Net:   eth0: neta at 30000
Hit any key to stop autoboot:  0

MMC Device 1 not found
no mmc device at slot 1
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
Found U-Boot script /boot.scr
2250 bytes read in 12 ms (182.6 KiB/s)
## Executing script at 06d00000
22079344 bytes read in 1219 ms (17.3 MiB/s) 10671 bytes read in 24 ms (433.6 KiB/s) 27689238 bytes read in 1555 ms (17 MiB/s) Booting Debian 5.7.0-0.bpo.2-arm64 from mmc 0:1... ## Flattened Device Tree blob at 06f00000

Quoted 6 lines
    Booting using the fdt blob at 0x6f00000
    Loading Ramdisk to 3e0be000, end 3fb26116 ... OK
    Loading Device Tree to 000000003e0b8000, end 000000003e0bd9ae ... OK

Starting kernel ...
<hangs here>

Can you write which commands you have run to load & boot kernel? What are command line arguments for kernel?

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

Also have you reset env variables to default?

Yeah, I do reset the full env when switching between the flash images.

Now I tried to boot openwrt kernel image and it is working fine on tested espressobin v5 unit. I compiled u-boot with all those a37xx patches.

I looked at Debian and booting Debian kernel with Debian initrd failed:

=> booti ${kernel_addr_r} ${ramdisk_addr_r}:{filesize} ${fdt_addr_r} Moving Image from 0x7000000 to 0x7080000, end=82f2000
ERROR: RD image overlaps OS image (OS=0x7080000..0x82f2000)

Debian's kernel is big, so it is needed to move also ramdisk_addr_r env variable. Following patch helped:

include/configs/mvebu_armada-37xx.h +1 -1
index 6f72a13301..8929fcf390 100644
@@ -99,7 +99,7 @@
 	"fdt_addr_r=0x6f00000\0"	\
 	"kernel_addr=0x7000000\0"	\
 	"kernel_addr_r=0x7000000\0"	\
-	"ramdisk_addr_r=0x8000000\0"	\
+	"ramdisk_addr_r=0xa000000\0"	\
 	"console=" CONFIG_DEFAULT_CONSOLE "\0" \
 	BOOTENV
 

And after that Debian kernel with Debian initrd and FDT was booted:

DRAM: 512 MiB
Comphy-0: USB3_HOST0 5 Gbps
Comphy-1: PEX0 2.5 Gbps
Comphy-2: SATA0 5 Gbps
SATA link 0 timeout.
AHCI 0001.0300 32 slots 1 ports 6 Gbps 0x1 impl SATA mode
flags: ncq led only pmp fbss pio slum part sxs
PCIE-0: Link up
MMC: sdhci at d0000: 0
Loading Environment from SPIFlash... SF: Detected w25q32dw with page size 256 Bytes, erase size 4 KiB, total 4 MiB OK

Model: Marvell Armada 3720 Community Board ESPRESSOBin
Net:   eth0: neta at 30000 [PRIME]
Hit any key to stop autoboot:  0 

=> env default -a
## Resetting to default environment
=> mmc dev 0
switch to partitions #0, OK
mmc0 is current device
=> load mmc 0:2 ${fdt_addr_r} debian/armada-3720-espressobin.dtb
10553 bytes read in 17 ms (605.5 KiB/s)
=> load mmc 0:2 ${kernel_addr_r} debian/vmlinuz-4.19.0-10-arm64
18759536 bytes read in 804 ms (22.3 MiB/s)
=> load mmc 0:2 ${ramdisk_addr_r} debian/initrd.img-4.19.0-10-arm64
23890636 bytes read in 1013 ms (22.5 MiB/s)
=> setenv bootargs "$console root=/dev/mmcblk0p2 ro rootwait net.ifnames=0 biosdevname=0"
=> echo $bootargs
console=ttyMV0,115200 earlycon=ar3700_uart,0xd0012000 root=/dev/mmcblk0p2 ro rootwait net.ifnames=0 biosdevname=0 => echo ${filesize}
16c8acc
=> booti ${kernel_addr_r} ${ramdisk_addr_r}:{filesize} ${fdt_addr_r}
Moving Image from 0x7000000 to 0x7080000, end=82f2000
## Flattened Device Tree blob at 06f00000
Booting using the fdt blob at 0x6f00000
Loading Ramdisk to 20000000, end 20000000 ... OK
Loading Device Tree to 000000001f620000, end 000000001f625938 ... OK

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
[    0.000000] Linux version 4.19.0-10-arm64 (debian-kernel at lists.debian.org) (gcc version 8.3.0 (Debian 8.3.0-6)) #1 SMP Debian 4.19.132-1 (2020-07-24)
[    0.000000] Machine model: Globalscale Marvell ESPRESSOBin Board
[    0.000000] earlycon: ar3700_uart0 at MMIO 0x00000000d0012000 (options '')
[    0.000000] bootconsole [ar3700_uart0] enabled
[    0.000000] efi: Getting EFI parameters from FDT:
[    0.000000] efi: UEFI not found.
[    0.000000] cma: Reserved 64 MiB at 0x000000001b400000
[    0.000000] NUMA: No NUMA configuration found
[    0.000000] NUMA: Faking a node at [mem 0x0000000000000000-0x000000001fffffff]
[    0.000000] NUMA: NODE_DATA [mem 0x1ffe6600-0x1ffe7dbf]
[    0.000000] Zone ranges:
[    0.000000]   DMA32    [mem 0x0000000000000000-0x000000001fffffff]
[    0.000000]   Normal   empty
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000]   node   0: [mem 0x0000000004200000-0x000000001fffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x000000001fffffff]
[    0.000000] psci: probing for conduit method from DT.
[    0.000000] psci: PSCIv1.1 detected in firmware.
[    0.000000] psci: Using standard PSCI v0.2 function IDs
[    0.000000] psci: MIGRATE_INFO_TYPE not supported.
[    0.000000] psci: SMC Calling Convention v1.1
[    0.000000] random: get_random_bytes called from start_kernel+0x9c/0x4c0 with crng_init=0
[    0.000000] percpu: Embedded 25 pages/cpu s61976 r8192 d32232 u102400
[    0.000000] Detected VIPT I-cache on CPU0
[    0.000000] CPU features: enabling workaround for ARM erratum 845719
[    0.000000] Speculative Store Bypass Disable mitigation not required
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 128512
[    0.000000] Policy zone: DMA32
[    0.000000] Kernel command line: console=ttyMV0,115200 earlycon=ar3700_uart,0xd0012000 root=/dev/mmcblk0p2 ro rootwait net.ifnames=0 biosdevname=0

...

#26 lore raw

Espressobin booting (Was: Re: [PATCH 1/5] arm: mvebu: Espressobin: Move env load addresses)

Hi,

Quoted 15 lines · Pali Roh?r
Quoted 14 lines · On Wednesday 26 August 2020 12:51:18 Pali Roh?r wrote:
Quoted 13 lines · On Wednesday 26 August 2020 11:57:01 Andre Heider wrote:

Hi,

Quoted 10 lines · Pali Roh?r

Hello!

Quoted 7 lines · On Wednesday 26 August 2020 09:30:11 Andre Heider wrote:

Pali,

thank you for all these espressobin fixes, much appreciated!

This isn't directly related to the patch I'm replying to, but since you seem to be syncing down- with upstream:

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 4 lines
Quoted 1 line

Upstream u-boot doesn't detect my sata ssd ("SATA link 0 timeout"), nor is

Could you try following Marvell SATA/AHCI patch?
https://github.com/MarvellEmbeddedProcessors/u-boot-marvell/commit/2c1571432e4fd298be0236b53511f415bbdd21ac

will do that later and report my findings, thanks!

That one didn't help unfortunately. u-boot still prints "SATA link 0 timeout". Booting kernel 5.7.0-0.bpo.2-arm64 with that and sata works, but booting 4.19.0-10-arm64 and it doesn't: "ata1: SATA link down (SStatus 131 SControl 300)" is printed all over again.

Quoted 119 lines
Quoted 88 lines
Quoted 88 lines
Quoted 9 lines
Quoted 5 lines

it able to run debian's kernel (hangs after "Starting kernel"). Both work with armbian's downstream flash-image.bin.

I'm using the espressobin v1 with these patches from the list on top of

Do you really have espressobin v1? I saw hw schemas and diagrams only for V3, V4, V5 and V7. And I tested only V5 as I do not have any other revisions.

Oh sorry, I meant the first public version, the one with ddr3 memory. Which would be the V5 schematics iirc.

Quoted 75 lines
Quoted 65 lines

2020.07:
arm64: a37xx: pci: Depends on DM_GPIO
arm: mvebu: Espressobin: Update README.marvell file
arm: mvebu: Espressobin: Define console env
arm: mvebu: Espressobin: Define fdt_addr and kernel_addr env aliases
arm: mvebu: Espressobin: Change default loadaddr
arm: mvebu: Espressobin: Move env load addresses
arm: mvebu: Espressobin: Setup MTD partitions when booting kernel
arm: mvebu: Espressobin: Make SPI env offset compatible with Marvell's U-Boot
arm: dts: a37x0: enable sd card support on espressobin
mmc: xenon: set signal voltage and max base clock
arm64: a37xx: pci: Assert PERST# signal when unloading driver
arm64: a37xx: pci: Make PCIe Reset GPIO DT compatible with Linux kernel DT
arm64: dts: armada-3720-espressobin: fix COMPHY nodes
arm: mvebu: Espressobin: Enable CONFIG_MVNETA
arm: mvebu: Espressobin: Disallow forwarding packets between wan and lan ports

Bootlog:

TIM-1.0
WTMI-devel-18.12.1-

WTMI: system early-init
CPU VDD voltage default value: 1.108V
NOTICE:  Booting Trusted Firmware
NOTICE:  BL1: v2.3(): (Marvell-devel-18.12.0)
NOTICE:  BL1: Built : 06:12:46, Aug 26 2020
NOTICE:  BL1: Booting BL2
NOTICE:  BL2: v2.3(): (Marvell-devel-18.12.0)
NOTICE:  BL2: Built : 06:12:46, Aug 26 2020
NOTICE:  BL1: Booting BL31
NOTICE:  BL31: v2.3(): (Marvell-devel-18.12.0)
NOTICE:  BL31: Built : 06:12:46

U-Boot 2020.07 (Aug 26 2020 - 06:12:46 +0000)

DRAM: 1 GiB
Comphy-0: USB3_HOST0 5 Gbps
Comphy-1: PEX0 2.5 Gbps
Comphy-2: SATA0 5 Gbps
SATA link 0 timeout.
AHCI 0001.0300 32 slots 1 ports 6 Gbps 0x1 impl SATA mode
flags: ncq led only pmp fbss pio slum part sxs
PCIE-0: Link up
MMC: sdhci at d0000: 0
Loading Environment from SPI Flash... SF: Detected w25q32dw with page size 256 Bytes, erase size 4 KiB, total 4 MiB
OK

Model: Marvell Armada 3720 Community Board ESPRESSOBin
Net:   eth0: neta at 30000
Hit any key to stop autoboot:  0

MMC Device 1 not found
no mmc device at slot 1
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
Found U-Boot script /boot.scr
2250 bytes read in 12 ms (182.6 KiB/s)
## Executing script at 06d00000
22079344 bytes read in 1219 ms (17.3 MiB/s) 10671 bytes read in 24 ms (433.6 KiB/s) 27689238 bytes read in 1555 ms (17 MiB/s) Booting Debian 5.7.0-0.bpo.2-arm64 from mmc 0:1... ## Flattened Device Tree blob at 06f00000

Quoted 6 lines
     Booting using the fdt blob at 0x6f00000
     Loading Ramdisk to 3e0be000, end 3fb26116 ... OK
     Loading Device Tree to 000000003e0b8000, end 000000003e0bd9ae ... OK

Starting kernel ...
<hangs here>

Can you write which commands you have run to load & boot kernel? What are command line arguments for kernel?

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

Also have you reset env variables to default?

Yeah, I do reset the full env when switching between the flash images.

Now I tried to boot openwrt kernel image and it is working fine on tested espressobin v5 unit. I compiled u-boot with all those a37xx patches.

I looked at Debian and booting Debian kernel with Debian initrd failed:

=> booti ${kernel_addr_r} ${ramdisk_addr_r}:{filesize} ${fdt_addr_r} Moving Image from 0x7000000 to 0x7080000, end=82f2000
ERROR: RD image overlaps OS image (OS=0x7080000..0x82f2000)

Debian's kernel is big, so it is needed to move also ramdisk_addr_r env variable. Following patch helped:

include/configs/mvebu_armada-37xx.h +1 -1
index 6f72a13301..8929fcf390 100644
@@ -99,7 +99,7 @@
  	"fdt_addr_r=0x6f00000\0"	\
  	"kernel_addr=0x7000000\0"	\
  	"kernel_addr_r=0x7000000\0"	\
-	"ramdisk_addr_r=0x8000000\0"	\
+	"ramdisk_addr_r=0xa000000\0"	\
  	"console=" CONFIG_DEFAULT_CONSOLE "\0" \
  	BOOTENV
 
Quoted 1 line

And after that Debian kernel with Debian initrd and FDT was booted:

Heh, nice. That indeed works!

Well minus one thing, see my reply to "arm: mvebu: Espressobin: Define console env".

Thanks,
Andre

#27 lore raw

Espressobin booting (Was: Re: [PATCH 1/5] arm: mvebu: Espressobin: Move env load addresses)

Quoted 23 lines · On Wednesday 26 August 2020 15:22:37 Andre Heider wrote:

Hi,

Quoted 20 lines · Pali Roh?r
Quoted 19 lines · On Wednesday 26 August 2020 12:51:18 Pali Roh?r wrote:
Quoted 18 lines · On Wednesday 26 August 2020 11:57:01 Andre Heider wrote:

Hi,

Quoted 14 lines · Pali Roh?r

Hello!

Quoted 8 lines · On Wednesday 26 August 2020 09:30:11 Andre Heider wrote:

Pali,

thank you for all these espressobin fixes, much appreciated!

This isn't directly related to the patch I'm replying to, but since you seem to be syncing down- with upstream:

Upstream u-boot doesn't detect my sata ssd ("SATA link 0 timeout"), nor is

Could you try following Marvell SATA/AHCI patch?
https://github.com/MarvellEmbeddedProcessors/u-boot-marvell/commit/2c1571432e4fd298be0236b53511f415bbdd21ac

Quoted 6 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

will do that later and report my findings, thanks!

That one didn't help unfortunately. u-boot still prints "SATA link 0 timeout". Booting kernel 5.7.0-0.bpo.2-arm64 with that and sata works, but booting 4.19.0-10-arm64 and it doesn't: "ata1: SATA link down (SStatus 131 SControl 300)" is printed all over again.

I guess it was broken also prior applying all those patches. So for now I do not have any fix for this. Somebody else would need to look at it.

Quoted 22 lines
Quoted 22 lines

I looked at Debian and booting Debian kernel with Debian initrd failed:

=> booti ${kernel_addr_r} ${ramdisk_addr_r}:{filesize} ${fdt_addr_r} Moving Image from 0x7000000 to 0x7080000, end=82f2000
ERROR: RD image overlaps OS image (OS=0x7080000..0x82f2000)

Debian's kernel is big, so it is needed to move also ramdisk_addr_r env variable. Following patch helped:

include/configs/mvebu_armada-37xx.h +1 -1
index 6f72a13301..8929fcf390 100644
@@ -99,7 +99,7 @@
  	"fdt_addr_r=0x6f00000\0"	\
  	"kernel_addr=0x7000000\0"	\
  	"kernel_addr_r=0x7000000\0"	\
-	"ramdisk_addr_r=0x8000000\0"	\
+	"ramdisk_addr_r=0xa000000\0"	\
  	"console=" CONFIG_DEFAULT_CONSOLE "\0" \
  	BOOTENV
 
Quoted 3 lines
Quoted 1 line

And after that Debian kernel with Debian initrd and FDT was booted:

Heh, nice. That indeed works!

Ok, I have sent a new version V2 of this patch series and updated first patch which fix also ramdisk_addr_r.

Quoted 2 lines

Well minus one thing, see my reply to "arm: mvebu: Espressobin: Define console env".

For now I have dropped this patch for V2, until it is solved/fixed in some way.

#28 lore raw

Espressobin booting (Was: Re: [PATCH 1/5] arm: mvebu: Espressobin: Move env load addresses)

In reply to Andre Heider
Quoted 23 lines · On Wednesday 26 August 2020 15:22:37 Andre Heider wrote:

Hi,

Quoted 20 lines · Pali Roh?r
Quoted 19 lines · On Wednesday 26 August 2020 12:51:18 Pali Roh?r wrote:
Quoted 18 lines · On Wednesday 26 August 2020 11:57:01 Andre Heider wrote:

Hi,

Quoted 14 lines · Pali Roh?r

Hello!

Quoted 8 lines · On Wednesday 26 August 2020 09:30:11 Andre Heider wrote:

Pali,

thank you for all these espressobin fixes, much appreciated!

This isn't directly related to the patch I'm replying to, but since you seem to be syncing down- with upstream:

Upstream u-boot doesn't detect my sata ssd ("SATA link 0 timeout"), nor is

Could you try following Marvell SATA/AHCI patch?
https://github.com/MarvellEmbeddedProcessors/u-boot-marvell/commit/2c1571432e4fd298be0236b53511f415bbdd21ac

Quoted 6 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

will do that later and report my findings, thanks!

That one didn't help unfortunately. u-boot still prints "SATA link 0 timeout". Booting kernel 5.7.0-0.bpo.2-arm64 with that and sata works, but booting 4.19.0-10-arm64 and it doesn't: "ata1: SATA link down (SStatus 131 SControl 300)" is printed all over again.

I found another patch which could maybe help:
https://github.com/MarvellEmbeddedProcessors/u-boot-marvell/commit/6c6b2088f83b992d03e0d56f92c4dda7d44a7dc0

Or maybe with this patch:

arch/arm/dts/armada-3720-espressobin.dts +1 -0
index 4534f5ff29..c5eea978f6 100644
@@ -95,6 +95,7 @@
 	phy2 {
 		phy-type = <PHY_TYPE_SATA0>;
 		phy-speed = <PHY_SPEED_5G>;
+		phy-invert = <COMPHY_POLARITY_NO_INVERT>;
 	};
 };
 
#29 lore raw

Espressobin booting (Was: Re: [PATCH 1/5] arm: mvebu: Espressobin: Move env load addresses)

Quoted 26 lines · Pali Roh?r
Quoted 25 lines · On Wednesday 26 August 2020 15:22:37 Andre Heider wrote:

Hi,

Quoted 21 lines · Pali Roh?r
Quoted 20 lines · On Wednesday 26 August 2020 12:51:18 Pali Roh?r wrote:
Quoted 19 lines · On Wednesday 26 August 2020 11:57:01 Andre Heider wrote:

Hi,

Quoted 7 lines · Pali Roh?r

Hello!

Quoted 4 lines · On Wednesday 26 August 2020 09:30:11 Andre Heider wrote:

Pali,

thank you for all these espressobin fixes, much appreciated!

Quoted 7 lines
Quoted 4 lines

This isn't directly related to the patch I'm replying to, but since you seem to be syncing down- with upstream:

Upstream u-boot doesn't detect my sata ssd ("SATA link 0 timeout"), nor is

Could you try following Marvell SATA/AHCI patch?
https://github.com/MarvellEmbeddedProcessors/u-boot-marvell/commit/2c1571432e4fd298be0236b53511f415bbdd21ac

will do that later and report my findings, thanks!

Quoted 7 lines
Quoted 4 lines

That one didn't help unfortunately. u-boot still prints "SATA link 0 timeout". Booting kernel 5.7.0-0.bpo.2-arm64 with that and sata works, but booting 4.19.0-10-arm64 and it doesn't: "ata1: SATA link down (SStatus 131 SControl 300)" is printed all over again.

I found another patch which could maybe help:
https://github.com/MarvellEmbeddedProcessors/u-boot-marvell/commit/6c6b2088f83b992d03e0d56f92c4dda7d44a7dc0

I think we have a winner:

U-Boot 2020.10-rc3-00020-gbcf6779d94 (Aug 28 2020 - 16:23:44 +0200)

DRAM: 1 GiB
Comphy-0: USB3_HOST0 5 Gbps
Comphy-1: PEX0 2.5 Gbps
Comphy-2: SATA0 5 Gbps
Target spinup took 0 ms.
AHCI 0001.0300 32 slots 1 ports 6 Gbps 0x1 impl SATA mode
flags: ncq led only pmp fbss pio slum part sxs
PCIE-0: Link up
MMC: sdhci at d0000: 0
Loading Environment from SPIFlash... SF: Detected w25q32dw with page size 256 Bytes, erase size 4 KiB, total 4 MiB
OK

Model: Marvell Armada 3720 Community Board ESPRESSOBin
Net:   eth0: neta at 30000
Hit any key to stop autoboot:  0

=> scsi scan
scanning bus for devices...
Device 0: (0:0) Vendor: ATA Prod.: Crucial_CT250MX2 Rev: MU05
Type: Hard Disk
Capacity: 238475.1 MB = 232.8 GB (488397168 x 512)

:)

Nice, thanks! Will send the patch soon,
Andre

#30 lore raw

Espressobin booting (Was: Re: [PATCH 1/5] arm: mvebu: Espressobin: Move env load addresses)

Quoted 60 lines · On Friday 28 August 2020 16:35:22 Andre Heider wrote:
Quoted 26 lines · Pali Roh?r
Quoted 25 lines · On Wednesday 26 August 2020 15:22:37 Andre Heider wrote:

Hi,

Quoted 21 lines · Pali Roh?r
Quoted 20 lines · On Wednesday 26 August 2020 12:51:18 Pali Roh?r wrote:
Quoted 19 lines · On Wednesday 26 August 2020 11:57:01 Andre Heider wrote:

Hi,

Quoted 7 lines · Pali Roh?r

Hello!

Quoted 4 lines · On Wednesday 26 August 2020 09:30:11 Andre Heider wrote:

Pali,

thank you for all these espressobin fixes, much appreciated!

Quoted 7 lines
Quoted 4 lines

This isn't directly related to the patch I'm replying to, but since you seem to be syncing down- with upstream:

Upstream u-boot doesn't detect my sata ssd ("SATA link 0 timeout"), nor is

Could you try following Marvell SATA/AHCI patch?
https://github.com/MarvellEmbeddedProcessors/u-boot-marvell/commit/2c1571432e4fd298be0236b53511f415bbdd21ac

will do that later and report my findings, thanks!

Quoted 7 lines
Quoted 4 lines

That one didn't help unfortunately. u-boot still prints "SATA link 0 timeout". Booting kernel 5.7.0-0.bpo.2-arm64 with that and sata works, but booting 4.19.0-10-arm64 and it doesn't: "ata1: SATA link down (SStatus 131 SControl 300)" is printed all over again.

I found another patch which could maybe help:
https://github.com/MarvellEmbeddedProcessors/u-boot-marvell/commit/6c6b2088f83b992d03e0d56f92c4dda7d44a7dc0

I think we have a winner:

U-Boot 2020.10-rc3-00020-gbcf6779d94 (Aug 28 2020 - 16:23:44 +0200)

DRAM: 1 GiB
Comphy-0: USB3_HOST0 5 Gbps
Comphy-1: PEX0 2.5 Gbps
Comphy-2: SATA0 5 Gbps
Target spinup took 0 ms.
AHCI 0001.0300 32 slots 1 ports 6 Gbps 0x1 impl SATA mode
flags: ncq led only pmp fbss pio slum part sxs
PCIE-0: Link up
MMC: sdhci at d0000: 0
Loading Environment from SPIFlash... SF: Detected w25q32dw with page size 256 Bytes, erase size 4 KiB, total 4 MiB
OK

Model: Marvell Armada 3720 Community Board ESPRESSOBin
Net:   eth0: neta at 30000
Hit any key to stop autoboot:  0

=> scsi scan
scanning bus for devices...
Device 0: (0:0) Vendor: ATA Prod.: Crucial_CT250MX2 Rev: MU05
Type: Hard Disk
Capacity: 238475.1 MB = 232.8 GB (488397168 x 512)

Quoted 4 lines

:)

Nice, thanks! Will send the patch soon,
Andre

Excellent!

#31 lore raw

PATCH v2 1/4 arm: mvebu: Espressobin: Move env load addresses

In reply to Pali Rohár

According to Marvell's U-Boot description [1] current env load addresses overlaps with ATF RT services region and TEE. Because the ATF RT service and TEE region is going to be marked as secure and can't be overwritten, use different different addresses for envs.

[1] - https://github.com/MarvellEmbeddedProcessors/u-boot-marvell/commit/0a5b159806baa0746b6449920e450498bc269ba7

---
Changes in V2:
* Move also ramdisk_addr_r, so there is enough space for kernel
* Drop patch "Define console env" as it cause problems for Debian bootscript

---
 include/configs/mvebu_armada-37xx.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
include/configs/mvebu_armada-37xx.h +5 -5
index ca662b0ce7..a9ed0a838f 100644
@@ -91,11 +91,11 @@
 #include <config_distro_bootcmd.h>
 
 #define CONFIG_EXTRA_ENV_SETTINGS	\
-	"scriptaddr=0x4d00000\0"	\
-	"pxefile_addr_r=0x4e00000\0"	\
-	"fdt_addr_r=0x4f00000\0"	\
-	"kernel_addr_r=0x5000000\0"	\
-	"ramdisk_addr_r=0x8000000\0"	\
+	"scriptaddr=0x6d00000\0"	\
+	"pxefile_addr_r=0x6e00000\0"	\
+	"fdt_addr_r=0x6f00000\0"	\
+	"kernel_addr_r=0x7000000\0"	\
+	"ramdisk_addr_r=0xa000000\0"	\
 	BOOTENV
 
 #endif /* _CONFIG_MVEBU_ARMADA_37XX_H */
Signature · 1 line
2.20.1
#32 lore raw

PATCH v2 2/4 arm: mvebu: Espressobin: Change default loadaddr

Current loadaddr is not writable on Espressobin and 'loadb' command cause rebooting board. Marvell's U-Boot already set default loadaddr to value 0x06000000 [1] and after this change 'loadb' is working fine.

[1] - https://github.com/MarvellEmbeddedProcessors/u-boot-marvell/commit/0a5b159806baa0746b6449920e450498bc269ba7

---
 include/configs/mvebu_armada-37xx.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/configs/mvebu_armada-37xx.h +1 -1
index a9ed0a838f..93c05e30cc 100644
@@ -37,7 +37,7 @@
 /*
  * Other required minimal configurations
  */
-#define CONFIG_SYS_LOAD_ADDR	0x00800000	/* default load adr- 8M */
+#define CONFIG_SYS_LOAD_ADDR	0x06000000	/* default load adr */
 #define CONFIG_SYS_RESET_ADDRESS 0xffff0000	/* Rst Vector Adr */
 #define CONFIG_SYS_MAXARGS	32	/* max number of command args */
 
Signature · 1 line
2.20.1
#33 lore raw

PATCH v2 2/4 arm: mvebu: Espressobin: Change default loadaddr

Quoted 7 lines · Pali Roh?r

Current loadaddr is not writable on Espressobin and 'loadb' command cause rebooting board. Marvell's U-Boot already set default loadaddr to value 0x06000000 [1] and after this change 'loadb' is working fine.

[1] - https://github.com/MarvellEmbeddedProcessors/u-boot-marvell/commit/0a5b159806baa0746b6449920e450498bc269ba7

Thanks,
Stefan

Quoted 10 lines
---
  include/configs/mvebu_armada-37xx.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
include/configs/mvebu_armada-37xx.h +0 -0
index a9ed0a838f..93c05e30cc 100644

include/configs/mvebu_armada-37xx.h line 43

Quoted 8 lines
include/configs/mvebu_armada-37xx.h +1 -1
@@ -37,7 +37,7 @@
  /*
   * Other required minimal configurations
   */
-#define CONFIG_SYS_LOAD_ADDR	0x00800000	/* default load adr- 8M */
+#define CONFIG_SYS_LOAD_ADDR	0x06000000	/* default load adr */
  #define CONFIG_SYS_RESET_ADDRESS 0xffff0000	/* Rst Vector Adr */
  #define CONFIG_SYS_MAXARGS	32	/* max number of command args */
 

Viele Gr??e,
Stefan

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr at denx.de
#34 lore raw

PATCH v2 2/4 arm: mvebu: Espressobin: Change default loadaddr

In reply to Pali Rohár
Quoted 7 lines · Pali Roh?r

Current loadaddr is not writable on Espressobin and 'loadb' command cause rebooting board. Marvell's U-Boot already set default loadaddr to value 0x06000000 [1] and after this change 'loadb' is working fine.

[1] - https://github.com/MarvellEmbeddedProcessors/u-boot-marvell/commit/0a5b159806baa0746b6449920e450498bc269ba7

#35 lore raw

PATCH v2 2/4 arm: mvebu: Espressobin: Change default loadaddr

In reply to Pali Rohár
Quoted 7 lines · Pali Roh?r

Current loadaddr is not writable on Espressobin and 'loadb' command cause rebooting board. Marvell's U-Boot already set default loadaddr to value 0x06000000 [1] and after this change 'loadb' is working fine.

[1] - https://github.com/MarvellEmbeddedProcessors/u-boot-marvell/commit/0a5b159806baa0746b6449920e450498bc269ba7

Applied to u-boot-marvell/master

Thanks,
Stefan

Quoted 10 lines
---
  include/configs/mvebu_armada-37xx.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
include/configs/mvebu_armada-37xx.h +0 -0
index a9ed0a838f..93c05e30cc 100644

include/configs/mvebu_armada-37xx.h line 43

Quoted 8 lines
include/configs/mvebu_armada-37xx.h +1 -1
@@ -37,7 +37,7 @@
  /*
   * Other required minimal configurations
   */
-#define CONFIG_SYS_LOAD_ADDR	0x00800000	/* default load adr- 8M */
+#define CONFIG_SYS_LOAD_ADDR	0x06000000	/* default load adr */
  #define CONFIG_SYS_RESET_ADDRESS 0xffff0000	/* Rst Vector Adr */
  #define CONFIG_SYS_MAXARGS	32	/* max number of command args */
 

Viele Gr??e,
Stefan

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr at denx.de
#36 lore raw

PATCH v2 3/4 arm: mvebu: Espressobin: Define fdt_addr and kernel_addr env aliases

In reply to Pali Rohár

Boot scripts for existing Espressobin Linux distributions, like OpenWRT, expect that U-Boot set fdt_addr and kernel_addr envs. So add env aliases from fdt_addr_r and kernel_addr_r values.

---
 include/configs/mvebu_armada-37xx.h | 3 +++
 1 file changed, 3 insertions(+)
include/configs/mvebu_armada-37xx.h +3 -0
index 93c05e30cc..905ce09b7a 100644
@@ -90,10 +90,13 @@
 
 #include <config_distro_bootcmd.h>
 
+/* fdt_addr and kernel_addr are needed for existing distribution boot scripts */
 #define CONFIG_EXTRA_ENV_SETTINGS	\
 	"scriptaddr=0x6d00000\0"	\
 	"pxefile_addr_r=0x6e00000\0"	\
+	"fdt_addr=0x6f00000\0"		\
 	"fdt_addr_r=0x6f00000\0"	\
+	"kernel_addr=0x7000000\0"	\
 	"kernel_addr_r=0x7000000\0"	\
 	"ramdisk_addr_r=0xa000000\0"	\
 	BOOTENV
Signature · 1 line
2.20.1
#37 lore raw

PATCH v2 3/4 arm: mvebu: Espressobin: Define fdt_addr and kernel_addr env aliases

Quoted 5 lines · Pali Roh?r

Boot scripts for existing Espressobin Linux distributions, like OpenWRT, expect that U-Boot set fdt_addr and kernel_addr envs. So add env aliases from fdt_addr_r and kernel_addr_r values.

Thanks,
Stefan

Quoted 13 lines
---
  include/configs/mvebu_armada-37xx.h | 3 +++
  1 file changed, 3 insertions(+)
include/configs/mvebu_armada-37xx.h +0 -0
index 93c05e30cc..905ce09b7a 100644
@@ -90,10 +90,13 @@
 
  #include <config_distro_bootcmd.h>
 

include/configs/mvebu_armada-37xx.h line 102

Quoted 10 lines
include/configs/mvebu_armada-37xx.h +3 -0
+/* fdt_addr and kernel_addr are needed for existing distribution boot scripts */
  #define CONFIG_EXTRA_ENV_SETTINGS	\
  	"scriptaddr=0x6d00000\0"	\
  	"pxefile_addr_r=0x6e00000\0"	\
+	"fdt_addr=0x6f00000\0"		\
  	"fdt_addr_r=0x6f00000\0"	\
+	"kernel_addr=0x7000000\0"	\
  	"kernel_addr_r=0x7000000\0"	\
  	"ramdisk_addr_r=0xa000000\0"	\
  	BOOTENV

Viele Gr??e,
Stefan

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr at denx.de
#39 lore raw

PATCH v2 3/4 arm: mvebu: Espressobin: Define fdt_addr and kernel_addr env aliases

In reply to Pali Rohár
Quoted 5 lines · Pali Roh?r

Boot scripts for existing Espressobin Linux distributions, like OpenWRT, expect that U-Boot set fdt_addr and kernel_addr envs. So add env aliases from fdt_addr_r and kernel_addr_r values.

Applied to u-boot-marvell/master

Thanks,
Stefan

Quoted 13 lines
---
  include/configs/mvebu_armada-37xx.h | 3 +++
  1 file changed, 3 insertions(+)
include/configs/mvebu_armada-37xx.h +0 -0
index 93c05e30cc..905ce09b7a 100644
@@ -90,10 +90,13 @@
 
  #include <config_distro_bootcmd.h>
 

include/configs/mvebu_armada-37xx.h line 102

Quoted 10 lines
include/configs/mvebu_armada-37xx.h +3 -0
+/* fdt_addr and kernel_addr are needed for existing distribution boot scripts */
  #define CONFIG_EXTRA_ENV_SETTINGS	\
  	"scriptaddr=0x6d00000\0"	\
  	"pxefile_addr_r=0x6e00000\0"	\
+	"fdt_addr=0x6f00000\0"		\
  	"fdt_addr_r=0x6f00000\0"	\
+	"kernel_addr=0x7000000\0"	\
  	"kernel_addr_r=0x7000000\0"	\
  	"ramdisk_addr_r=0xa000000\0"	\
  	BOOTENV

Viele Gr??e,
Stefan

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr at denx.de
#40 lore raw

PATCH v2 4/4 arm: mvebu: Espressobin: Update README.marvell file

In reply to Pali Rohár

Include information about permanent ethernet MAC address and add link how to build ATF as U-Boot on Espressobin cannot be flashed without ATF.

---
 doc/README.marvell | 40 +++++++++++++++++++++++++++++++++++++---
 1 file changed, 37 insertions(+), 3 deletions(-)
doc/README.marvell +37 -3
index 336461745c..da16316407 100644
@@ -13,7 +13,8 @@ Build Procedure
 
 2. Set the cross compiler:
 
-		# export CROSS_COMPILE=/path/to/toolchain/aarch64-marvell-linux-gnu-
+		# sudo apt-get install gcc-aarch64-linux-gnu
+		# export CROSS_COMPILE=aarch64-linux-gnu-
 
 3. Clean-up old residuals:
 
@@ -30,7 +31,7 @@ Build Procedure
 
 5. Configure the device-tree and build the U-Boot image:
 
-	Compile u-boot and set the required device-tree using:
+	For the Armada-70x0/80x0 DB board compile u-boot and set the required device-tree using:
 
 		# make DEVICE_TREE=<name>
 
@@ -42,12 +43,45 @@ Build Procedure
         In order to prevent this, the required device-tree MUST be set during compilation.
         All device-tree files are located in ./arch/arm/dts/ folder.
 
+	For other DB boards (MacchiatoBin, EspressoBin and 3700 DB board) compile u-boot with
+	just default device-tree from defconfig using:
+
+		# make
+
 	NOTE:
 	The u-boot.bin should not be used as a stand-alone image.
 	The ARM Trusted Firmware (ATF) build process uses this image to generate the
-	flash image.
+	flash image. See TF-A Build Instructions for Marvell Platforms for more details at:
+	https://trustedfirmware-a.readthedocs.io/en/latest/plat/marvell/armada/build.html
 
 Configuration update
 ---------------------
 	To update the U-Boot configuration, please refer to doc/README.kconfig
 
+
+Permanent ethernet MAC address
+-------------------------------
+	Prior flashing new U-Boot version (as part of ATF image) it is suggested to backup
+	permanent ethernet MAC address as it is stored only in U-Boot env storage (SPI or eMMC).
+	Some boards like EspressoBin have MAC address printed on sticker. To print current MAC
+	address run:
+
+		# echo $ethaddr
+
+	MAC addresses 00:51:82:11:22:00, 00:51:82:11:22:01, 00:51:82:11:22:02, 00:51:82:11:22:03
+	and F0:AD:4E:03:64:7F are default hardcoded values found in Marvell's and Armbian U-Boot
+	forks and therefore *not* unique. Usage of static hardcoded MAC addresses should be avoided.
+	When original address is lost (e.g. erased by Armbian boot scripts for EspressoBin) it is
+	suggested to generate new random one.
+
+	After flashing new U-Boot version it is suggested to reset U-Boot env variables to default
+	and then set correct permanent ethernet MAC address.
+
+		# env default -a
+		# setenv ethaddr XX:XX:XX:XX:XX:XX
+		# saveenv
+
+	Where XX:XX:XX:XX:XX:XX is permanent ethernet MAC address.
+
+	Recent Linux kernel versions use correct permanent ethernet MAC address from U-Boot env as
+	U-Boot will inject it into kernel's device-tree.
Signature · 1 line
2.20.1
#41 lore raw

PATCH v2 4/4 arm: mvebu: Espressobin: Update README.marvell file

Quoted 4 lines · Pali Roh?r

Include information about permanent ethernet MAC address and add link how to build ATF as U-Boot on Espressobin cannot be flashed without ATF.

Thanks,
Stefan

Quoted 65 lines
---
  doc/README.marvell | 40 +++++++++++++++++++++++++++++++++++++---
  1 file changed, 37 insertions(+), 3 deletions(-)
doc/README.marvell +27 -3
index 336461745c..da16316407 100644
@@ -13,7 +13,8 @@ Build Procedure
 
  2. Set the cross compiler:
 
-		# export CROSS_COMPILE=/path/to/toolchain/aarch64-marvell-linux-gnu-
+		# sudo apt-get install gcc-aarch64-linux-gnu
+		# export CROSS_COMPILE=aarch64-linux-gnu-
 
  3. Clean-up old residuals:
 
@@ -30,7 +31,7 @@ Build Procedure
 
  5. Configure the device-tree and build the U-Boot image:
 
-	Compile u-boot and set the required device-tree using:
+	For the Armada-70x0/80x0 DB board compile u-boot and set the required device-tree using:
 
  		# make DEVICE_TREE=<name>
 
@@ -42,12 +43,45 @@ Build Procedure
          In order to prevent this, the required device-tree MUST be set during compilation.
          All device-tree files are located in ./arch/arm/dts/ folder.
 
+	For other DB boards (MacchiatoBin, EspressoBin and 3700 DB board) compile u-boot with
+	just default device-tree from defconfig using:
+
+		# make
+
  	NOTE:
  	The u-boot.bin should not be used as a stand-alone image.
  	The ARM Trusted Firmware (ATF) build process uses this image to generate the
-	flash image.
+	flash image. See TF-A Build Instructions for Marvell Platforms for more details at:
+	https://trustedfirmware-a.readthedocs.io/en/latest/plat/marvell/armada/build.html
 
  Configuration update
  ---------------------
  	To update the U-Boot configuration, please refer to doc/README.kconfig
 
+
+Permanent ethernet MAC address
+-------------------------------
+	Prior flashing new U-Boot version (as part of ATF image) it is suggested to backup
+	permanent ethernet MAC address as it is stored only in U-Boot env storage (SPI or eMMC).
+	Some boards like EspressoBin have MAC address printed on sticker. To print current MAC
+	address run:
+
+		# echo $ethaddr
+
+	MAC addresses 00:51:82:11:22:00, 00:51:82:11:22:01, 00:51:82:11:22:02, 00:51:82:11:22:03
+	and F0:AD:4E:03:64:7F are default hardcoded values found in Marvell's and Armbian U-Boot
+	forks and therefore *not* unique. Usage of static hardcoded MAC addresses should be avoided.
+	When original address is lost (e.g. erased by Armbian boot scripts for EspressoBin) it is
+	suggested to generate new random one.
+
+	After flashing new U-Boot version it is suggested to reset U-Boot env variables to default

doc/README.marvell Build Procedure · line 87

Quoted 10 lines
doc/README.marvell +10 -0
+	and then set correct permanent ethernet MAC address.
+
+		# env default -a
+		# setenv ethaddr XX:XX:XX:XX:XX:XX
+		# saveenv
+
+	Where XX:XX:XX:XX:XX:XX is permanent ethernet MAC address.
+
+	Recent Linux kernel versions use correct permanent ethernet MAC address from U-Boot env as
+	U-Boot will inject it into kernel's device-tree.

Viele Gr??e,
Stefan

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr at denx.de
#42 lore raw

PATCH v2 4/4 arm: mvebu: Espressobin: Update README.marvell file

In reply to Pali Rohár
Quoted 4 lines · Pali Roh?r

Include information about permanent ethernet MAC address and add link how to build ATF as U-Boot on Espressobin cannot be flashed without ATF.

Applied to u-boot-marvell/master

Thanks,
Stefan

Quoted 65 lines
---
  doc/README.marvell | 40 +++++++++++++++++++++++++++++++++++++---
  1 file changed, 37 insertions(+), 3 deletions(-)
doc/README.marvell +27 -3
index 336461745c..da16316407 100644
@@ -13,7 +13,8 @@ Build Procedure
 
  2. Set the cross compiler:
 
-		# export CROSS_COMPILE=/path/to/toolchain/aarch64-marvell-linux-gnu-
+		# sudo apt-get install gcc-aarch64-linux-gnu
+		# export CROSS_COMPILE=aarch64-linux-gnu-
 
  3. Clean-up old residuals:
 
@@ -30,7 +31,7 @@ Build Procedure
 
  5. Configure the device-tree and build the U-Boot image:
 
-	Compile u-boot and set the required device-tree using:
+	For the Armada-70x0/80x0 DB board compile u-boot and set the required device-tree using:
 
  		# make DEVICE_TREE=<name>
 
@@ -42,12 +43,45 @@ Build Procedure
          In order to prevent this, the required device-tree MUST be set during compilation.
          All device-tree files are located in ./arch/arm/dts/ folder.
 
+	For other DB boards (MacchiatoBin, EspressoBin and 3700 DB board) compile u-boot with
+	just default device-tree from defconfig using:
+
+		# make
+
  	NOTE:
  	The u-boot.bin should not be used as a stand-alone image.
  	The ARM Trusted Firmware (ATF) build process uses this image to generate the
-	flash image.
+	flash image. See TF-A Build Instructions for Marvell Platforms for more details at:
+	https://trustedfirmware-a.readthedocs.io/en/latest/plat/marvell/armada/build.html
 
  Configuration update
  ---------------------
  	To update the U-Boot configuration, please refer to doc/README.kconfig
 
+
+Permanent ethernet MAC address
+-------------------------------
+	Prior flashing new U-Boot version (as part of ATF image) it is suggested to backup
+	permanent ethernet MAC address as it is stored only in U-Boot env storage (SPI or eMMC).
+	Some boards like EspressoBin have MAC address printed on sticker. To print current MAC
+	address run:
+
+		# echo $ethaddr
+
+	MAC addresses 00:51:82:11:22:00, 00:51:82:11:22:01, 00:51:82:11:22:02, 00:51:82:11:22:03
+	and F0:AD:4E:03:64:7F are default hardcoded values found in Marvell's and Armbian U-Boot
+	forks and therefore *not* unique. Usage of static hardcoded MAC addresses should be avoided.
+	When original address is lost (e.g. erased by Armbian boot scripts for EspressoBin) it is
+	suggested to generate new random one.
+
+	After flashing new U-Boot version it is suggested to reset U-Boot env variables to default

doc/README.marvell Build Procedure · line 87

Quoted 10 lines
doc/README.marvell +10 -0
+	and then set correct permanent ethernet MAC address.
+
+		# env default -a
+		# setenv ethaddr XX:XX:XX:XX:XX:XX
+		# saveenv
+
+	Where XX:XX:XX:XX:XX:XX is permanent ethernet MAC address.
+
+	Recent Linux kernel versions use correct permanent ethernet MAC address from U-Boot env as
+	U-Boot will inject it into kernel's device-tree.

Viele Gr??e,
Stefan

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr at denx.de
#43 lore raw

PATCH v2 1/4 arm: mvebu: Espressobin: Move env load addresses

In reply to Pali Rohár
Quoted 8 lines · Pali Roh?r

According to Marvell's U-Boot description [1] current env load addresses overlaps with ATF RT services region and TEE. Because the ATF RT service and TEE region is going to be marked as secure and can't be overwritten, use different different addresses for envs.

[1] - https://github.com/MarvellEmbeddedProcessors/u-boot-marvell/commit/0a5b159806baa0746b6449920e450498bc269ba7

For the series:

Thanks again, finally I'm able to boot with an upstream atf/u-boot!

#44 lore raw

PATCH v2 1/4 arm: mvebu: Espressobin: Move env load addresses

Hi Andre,

Quoted 6 lines · Andre Heider
Quoted 5 lines · Pali Roh?r

According to Marvell's U-Boot description [1] current env load addresses overlaps with ATF RT services region and TEE. Because the ATF RT service and TEE region is going to be marked as secure and can't be overwritten, use different different addresses for envs.

Quoted 8 lines
Quoted 5 lines

[1] -
https://github.com/MarvellEmbeddedProcessors/u-boot-marvell/commit/0a5b159806baa0746b6449920e450498bc269ba7

For the series:

Could you please send such a mail with the TB tag for all the 4 out of 4 patches from this series? Reason being, that patchwork automatically collects these tags making it easier for me (and other maintainers) to keep track of these tags.

Thanks,
Stefan

#45 lore raw

PATCH v2 1/4 arm: mvebu: Espressobin: Move env load addresses

In reply to Pali Rohár
Quoted 8 lines · Pali Roh?r

According to Marvell's U-Boot description [1] current env load addresses overlaps with ATF RT services region and TEE. Because the ATF RT service and TEE region is going to be marked as secure and can't be overwritten, use different different addresses for envs.

[1] - https://github.com/MarvellEmbeddedProcessors/u-boot-marvell/commit/0a5b159806baa0746b6449920e450498bc269ba7

Thanks,
Stefan

Quoted 20 lines

---
Changes in V2:
* Move also ramdisk_addr_r, so there is enough space for kernel
* Drop patch "Define console env" as it cause problems for Debian bootscript

---
  include/configs/mvebu_armada-37xx.h | 10 +++++-----
  1 file changed, 5 insertions(+), 5 deletions(-)
include/configs/mvebu_armada-37xx.h +0 -3
index ca662b0ce7..a9ed0a838f 100644
@@ -91,11 +91,11 @@
  #include <config_distro_bootcmd.h>
 
  #define CONFIG_EXTRA_ENV_SETTINGS	\
-	"scriptaddr=0x4d00000\0"	\
-	"pxefile_addr_r=0x4e00000\0"	\
-	"fdt_addr_r=0x4f00000\0"	\

include/configs/mvebu_armada-37xx.h line 101

Quoted 10 lines
include/configs/mvebu_armada-37xx.h +5 -2
-	"kernel_addr_r=0x5000000\0"	\
-	"ramdisk_addr_r=0x8000000\0"	\
+	"scriptaddr=0x6d00000\0"	\
+	"pxefile_addr_r=0x6e00000\0"	\
+	"fdt_addr_r=0x6f00000\0"	\
+	"kernel_addr_r=0x7000000\0"	\
+	"ramdisk_addr_r=0xa000000\0"	\
  	BOOTENV
 
  #endif /* _CONFIG_MVEBU_ARMADA_37XX_H */

Viele Gr??e,
Stefan

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr at denx.de
#46 lore raw

PATCH v2 1/4 arm: mvebu: Espressobin: Move env load addresses

In reply to Pali Rohár
Quoted 8 lines · Pali Roh?r

According to Marvell's U-Boot description [1] current env load addresses overlaps with ATF RT services region and TEE. Because the ATF RT service and TEE region is going to be marked as secure and can't be overwritten, use different different addresses for envs.

[1] - https://github.com/MarvellEmbeddedProcessors/u-boot-marvell/commit/0a5b159806baa0746b6449920e450498bc269ba7

Applied to u-boot-marvell/master

Thanks,
Stefan

Quoted 20 lines

---
Changes in V2:
* Move also ramdisk_addr_r, so there is enough space for kernel
* Drop patch "Define console env" as it cause problems for Debian bootscript

---
  include/configs/mvebu_armada-37xx.h | 10 +++++-----
  1 file changed, 5 insertions(+), 5 deletions(-)
include/configs/mvebu_armada-37xx.h +0 -3
index ca662b0ce7..a9ed0a838f 100644
@@ -91,11 +91,11 @@
  #include <config_distro_bootcmd.h>
 
  #define CONFIG_EXTRA_ENV_SETTINGS	\
-	"scriptaddr=0x4d00000\0"	\
-	"pxefile_addr_r=0x4e00000\0"	\
-	"fdt_addr_r=0x4f00000\0"	\

include/configs/mvebu_armada-37xx.h line 101

Quoted 10 lines
include/configs/mvebu_armada-37xx.h +5 -2
-	"kernel_addr_r=0x5000000\0"	\
-	"ramdisk_addr_r=0x8000000\0"	\
+	"scriptaddr=0x6d00000\0"	\
+	"pxefile_addr_r=0x6e00000\0"	\
+	"fdt_addr_r=0x6f00000\0"	\
+	"kernel_addr_r=0x7000000\0"	\
+	"ramdisk_addr_r=0xa000000\0"	\
  	BOOTENV
 
  #endif /* _CONFIG_MVEBU_ARMADA_37XX_H */

Viele Gr??e,
Stefan

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr at denx.de