Jump to content

Espressobin: rescue instruction for macronix SPI chip


FoodGenius

Recommended Posts

33 minutes ago, ebin-dev said:

The 1g-2cs images are confirmed to be working.
 

 

all these confirmation-tests (you mentioned in https://pastebin.com/mfrDk4AQ, )
shows boards with SPI w25q32dw  - thats the old winbond SPI.


we have only those problems with the new one...
macronix SPI  mx25u3235f

 

it seems, your build only supports these macronix SPI

mx25u1635e and mx25u6435f

http://www.macronix.com/Lists/Datasheet/Attachments/7412/MX25U1635E, 1.8V, 16Mb, v2.1.pdf
http://www.macronix.com/Lists/Datasheet/Attachments/7411/MX25U6435F, 1.8V, 64Mb, v1.5.pdf


but mx25u3235f is needed
http://www.macronix.com/Lists/Datasheet/Attachments/7438/MX25U3235F, 1.8V, 32Mb, v1.6.pdf


since the new espresso board use a Macronix MXIC MX 25V3 2311 ->  SF: Detected mx25u3235f with page size 256 Bytes, erase size 64 KiB, total 4 MiB

(shown by vendor/manufacturer shipped bootloader)

U-Boot 2017.03-armada-17.10.2-g14aeedc (Jun 01 2018 - 15:39:10 +0800)
aarch64-linux-gnu-gcc (Linaro GCC 5.2-2015.11-2) 5.2.1 20151005
GNU ld (GNU Binutils) 2.25.0 Linaro 2015_10

Link to comment
Share on other sites

1 minute ago, ebin-dev said:

The issue with your Macronix chip needs to be dealt with by the manufacturer - unannounced board changes leading to unsupported systems are not very pleasant.

 

that is right. i known this. thank you for you work.

but it means, that any new user who's buying an actual espresso bin board and using armbian with the current provided armbian bootloader...

will "brick" the board, can't use bubt oder or save env, and so.. can't use armbian.

armbian espressobin release only works with old espresso bin boards (those with winbond SPI).

This hint should be clearly visible at https://www.armbian.com/espressobin/

since support ist now "broken", until we have a bootloader that supports mx25u3235f.

 

I have no response from espressobin yet.  I referenced this thread.

 

Link to comment
Share on other sites

 

1 hour ago, FoodGenius said:

I have no response from espressobin yet.  I referenced this thread.

 

Thank you for making public the issue with the unsupported Macronix chip.

There is a corresponding warning on the EspressoBin download page.

I have a reason to assume that this issue is already being dealt with.

 

We have reverted back the flash-images to 17.10 as compiled on Aug. 26th since there still seem to exist some issues with the new 18.09 images that need to be resolved.

 

 

Link to comment
Share on other sites

3 hours ago, ebin-dev said:

 

 

We have reverted back the flash-images to 17.10 as compiled on Aug. 26th since there still seem to exist some issues with the new 18.09 images that need to be resolved.

 

 

U-boot-2017 18.09 is still good. I tried it and it seems to boot normally:

IM-1.0
WTMI-devel-18.07.0-6050fd5
WTMI: system early-init
CPU VDD voltage default value: 1.108V
NOTICE:  Booting Trusted Firmware
NOTICE:  BL1: v1.5(release):v1.5-221-g9e22043 (Marvell-devel-18.09.0)
NOTICE:  BL1: Built : 16:51:14, Sep  5 2018
NOTICE:  BL1: Booting BL2
NOTICE:  BL2: v1.5(release):v1.5-221-g9e22043 (Marvell-devel-18.09.0)
NOTICE:  BL2: Built : 16:51:15, Sep  5 2018
WARNING: Failed to obtain reference to image id=4 (-2)
WARNING: Failed to load BL32 (-2)
NOTICE:  BL1: Booting BL31
NOTICE:  BL31: v1.5(release):v1.5-221-g9e22043 (Marvell-devel-18.09.0)
NOTICE:  BL31: Built : 16:51:18

U-Boot 2017.03-devel-18.09.0-00814-g09e03ea-dirty (Sep 05 2018 - 16:45:31 +0300)

Model: Marvell Armada 3720 Community Board ESPRESSOBin
       CPU     800 [MHz]
       L2      800 [MHz]
       NB AXI  200 [MHz]
       SB AXI  250 [MHz]
       DDR     800 [MHz]
DRAM:  1 GiB
U-Boot DT blob at : 000000003f7142d8
Comphy chip #0:
Comphy-0: USB3          5 Gbps    
Comphy-1: PEX0          2.5 Gbps  
Comphy-2: SATA0         6 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 down
MMC:   sdhci@d0000: 0
SF: Detected w25q32dw with page size 256 Bytes, erase size 4 KiB, total 4 MiB
Net:   eth0: neta@30000 [PRIME]
Hit any key to stop autoboot:  0 
Marvell>> 

Marvell>> version

U-Boot 2017.03-devel-18.09.0-00814-g09e03ea-dirty (Sep 05 2018 - 16:45:31 +0300)
aarch64-linux-gnu-gcc (Linaro GCC 7.3-2018.05) 7.3.1 20180425 [linaro-7.3-2018.05 revision d29120a424ecfbc167ef90065c0eeb7f91977701]
GNU ld (Linaro_Binutils-2018.05) 2.28.2.20170706
 

0001-drivers-spi-Add-support-for-Macronix-mx25u3235f-devi.patch

Link to comment
Share on other sites

On 9/5/2018 at 11:44 AM, FoodGenius said:

we have only those problems with the new one...
macronix SPI  mx25u3235f

 

So here there is finally a set of new flash-images-18.09 (with u-boot 2017.03-18.09 and with macronix support - not tested)  (patch provided by @kostap - thanks!).

 

The official Armbian flash images are still version 17.10 as compiled on Aug. 26th (without macronix support).

 

Edit: 18.09 images compiled with u-boot 2017.03-18.09, macronix support

Edit: 18.09 images are confirmed to work on the 1g-2cs EspressoBin, but changes to the Armbian bootscript are necessary in order to boot Armbian images with the environment settings shown on the EspressoBin download page.

Link to comment
Share on other sites

19 minutes ago, ebin-dev said:

Edit: U-boot 2018.03-18.09 does not correctly display available DDR RAM - but it is supposed to be available

Just remember that Marvell release 18.09 contains both u-boot 2017.03 and 2018.03. It turns out that A3700 support in the new 2018 u-boot is not yet mature. So I would recommend to take all the component of 18.09 release (ATF, DDR code, A3700 utilities) and build the image with u-boot 2017.03-18.09 (the last one after applying Macronix patch on top). So you will benefit from all extensions and fixes in the boot loader code up to current date.

Link to comment
Share on other sites

I'm currently using this Image 
kostap-flash-image-espressobin-1g-2cs-1000_800_v2017.bin
a predecessor of flash-images-18.09/flash-image-1g-2cs-1000_800_boot_sd_and_usb.bin
out of https://www.dropbox.com/s/sn8bafe250s8r2c/flash-images-18.09.tar.gz?dl=1
which was also provided by kostap.

 

Marvell>> version

U-Boot 2017.03-devel-18.09.0-00814-g09e03ea-dirty (Sep 05 2018 - 16:45:31 +0300)
aarch64-linux-gnu-gcc (Linaro GCC 7.3-2018.05) 7.3.1 20180425 [linaro-7.3-2018.05 revision d29120a424ecfbc167ef90065c0eeb7f91977701]
GNU ld (Linaro_Binutils-2018.05) 2.28.2.20170706

and modified env to boot armbian from mmc.
still not sure about the address ranges, but until now it runs stable. will do some further testing.

 

setenv default -a

setenv verbosity "2"
setenv boot_interface mmc
setenv image_name boot/Image
setenv initrd_image "boot/uInitrd"
setenv fdt_name boot/dtb/marvell/armada-3720-community.dtb
setenv fdt_high "0xffffffffffffffff"

setenv rootdev "/dev/mmcblk0p1"
setenv rootfstype "ext4"


setenv initrd_addr "0x1100000"
setenv usbstoragequirks "0x2537:0x1066:u,0x2537:0x1068:u"

setenv fdt_addr "0x6000000"
setenv kernel_addr "0x7000000"
setenv loadaddr "0x8000000"
setenv initrd_size "0x2000000"

setenv bootcmd 'mmc dev 0; ext4load mmc 0:1 $kernel_addr $image_name;ext4load mmc 0:1 $initrd_addr $initrd_image; ext4load mmc 0:1 $fdt_addr $fdt_name; setenv bootargs $console root=$rootdev rw rootwait; booti $kernel_addr $initrd_addr $fdt_addr'

setenv ethaddr F0:AD:4E:.....
setenv eth1addr F0:AD:4E:.....
setenv eth2addr F0:AD:4E:.....
setenv eth3addr F0:AD:4E:.....

env save

 

and this works an boots into armbian on actual espresso bin board with macronix chip.

 

I will also test the current releases from kostap.

 

Edit: OK.  fine.
flash-images-18.09/flash-image-1g-2cs-800_800_boot_sd_and_usb.bin
 

Marvell>> version

U-Boot 2017.03-armada-18.09.1-ga92bd86-armbian (Sep 05 2018 - 21:49:34 +0200)
aarch64-linux-gnu-gcc (Linaro GCC 7.3-2018.05) 7.3.1 20180425 [linaro-7.3-2018.05 revision d29120a424ecfbc167ef90065c0eeb7f91977701]
GNU ld (Linaro_Binutils-2018.05) 2.28.2.20170706

Marvell>> sspi
SF: Detected mx25u3235f with page size 256 Bytes, erase size 64 KiB, total 4 MiB



works for me and booting into armbian with my posted environment.

Many Thanks @kostap ,  @skandalfo and @ebin-dev
Thank you. :rolleyes:

still have to do some stability test and recover the stack of all "burned" testboards.


 

Link to comment
Share on other sites

The current 18.09 bootloader images (compiled Sept. 5th, 21:49) do work fine with the adapted address ranges.

(u-boot 2017.03-18.09 used, macronix support confirmed by @FoodGenius, 1g-2cs images tested)

 

Booting from SD into the current Armbian Stretch 4.18.y image works fine with these environment settings:

setenv default -a

setenv verbosity "2"
setenv boot_interface mmc
setenv image_name boot/Image
setenv initrd_image "boot/uInitrd"
setenv fdt_name boot/dtb/marvell/armada-3720-espressobin.dtb
setenv fdt_high "0xffffffffffffffff"

setenv rootdev "/dev/mmcblk1p1"
setenv rootfstype "ext4"


setenv initrd_addr "0x1100000"
setenv usbstoragequirks "0x2537:0x1066:u,0x2537:0x1068:u"

setenv fdt_addr "0x6000000"
setenv kernel_addr "0x7000000"
setenv loadaddr "0x8000000"
setenv initrd_size "0x2000000"

setenv bootcmd 'mmc dev 0; ext4load mmc 0:1 $kernel_addr $image_name;ext4load mmc 0:1 $initrd_addr $initrd_image; ext4load mmc 0:1 $fdt_addr $fdt_name; setenv bootargs $console root=$rootdev rw rootwait; booti $kernel_addr $initrd_addr $fdt_addr'

setenv ethaddr F0:AD:4E:.....
setenv eth1addr F0:AD:4E:.....
setenv eth2addr F0:AD:4E:.....
setenv eth3addr F0:AD:4E:.....

env save

 

... and the environment to boot from SCSI into a current Armbian Stretch 4.18.y image:

 

setenv default -a

setenv verbosity "2"
setenv boot_interface scsi
setenv image_name boot/Image
setenv initrd_image "boot/uInitrd"
setenv fdt_name boot/dtb/marvell/armada-3720-espressobin.dtb
setenv fdt_high "0xffffffffffffffff"

setenv rootdev "/dev/sda1"
setenv rootfstype "ext4"

setenv initrd_addr "0x1100000"
setenv usbstoragequirks "0x2537:0x1066:u,0x2537:0x1068:u"

setenv fdt_addr "0x6000000"
setenv kernel_addr "0x7000000"
setenv loadaddr "0x8000000"
setenv initrd_size "0x2000000"

setenv bootcmd 'scsi scan; scsi dev 0; ext4load scsi 0:1 $kernel_addr $image_name;ext4load scsi 0:1 $initrd_addr $initrd_image; ext4load scsi 0:1 $fdt_addr $fdt_name; setenv bootargs $console root=$rootdev rw rootwait; booti $kernel_addr $initrd_addr $fdt_addr'

setenv ethaddr F0:AD:4E:.....
setenv eth1addr F0:AD:4E:.....
setenv eth2addr F0:AD:4E:.....
setenv eth3addr F0:AD:4E:.....

env save

 

Edit: SCSI environment added

Edit: Linked to https://dl.armbian.com/espressobin/u-boot/

Link to comment
Share on other sites

Unable to boot with new u-boot image 1g-2cs-1000_800 using Armbian_5.59_Espressobin_Debian_stretch_next_4.18.5.img.

https://dl.armbian.com/espressobin/u-boot/archive/flash-image-1g-2cs-1000_800_boot_sd_and_usb.bin

 

TIM-1.0
WTMI-armada-17.10.5-177ba47
WTMI: system early-init
SVC REV: 4, CPU VDD voltage: 1.143V

Fill memory before self refresh...done

Fill memory before self refresh...done

Now in Self-refresh Mode
Restore termination values to original values
Exited self-refresh ...


Self refresh Pass.
DDR self test mode test done!!

Self refresh Pass.
DDR self test mode test done!!

QS GATING
=============
Calibration done: cycle = 0x00 tap =0x62
CH0_PHY_RL_Control_CS0_B0[0xC0001180]: 0x00000062
CH0_PHY_RL_Control_CS0_B1[0xC0001184]: 0x00000062


QS GATING
=============
Calibration done: cycle = 0x00 tap =0x61
CH0_PHY_RL_Control_CS1_B0[0xC00011A4]: 0x00000061
CH0_PHY_RL_Control_CS1_B1[0xC00011A8]: 0x00000061

DLL TUNING
==============
   DLL 0xc0001050[21:16]: [0,20,10]
   DLL 0xc0001050[29:24]: [6,30,1b]
   DLL 0xc0001054[21:16]: [0,23,11]
   DLL 0xc0001054[29:24]: [6,33,1c]
   DLL 0xc0001074[21:16]: [0,3f,1f]
   DLL 0xc0001074NOTICE:  Booting Trusted Firmware
NOTICE:  BL1: v1.3(release):armada-17.10.8:34247e0
NOTICE:  BL1: Built : 19:00:29, Aug 26 2NOTICE:  BL2: v1.3(release):armada-17.10.8:34247e0
NOTICE:  BL2: Built : 19:00:29, Aug 26 2018
NNOTICE:  BL31: v1.3(release):armada-17.10.8:34247e0
NOTICE:  BL31:

U-Boot 2017.03-armada-17.10.3-g06ad760 (Aug 26 2018 - 19:00:03 +0200)

Model: Marvell Armada 3720 Community Board ESPRESSOBin
       CPU    @ 1000 [MHz]
       L2     @ 800 [MHz]
       TClock @ 200 [MHz]
       DDR    @ 800 [MHz]
DRAM:  1 GiB
U-Boot DT blob at : 000000003f7182d8
Comphy-0: USB3          5 Gbps    
Comphy-1: PEX0          2.5 Gbps  
Comphy-2: SATA0         6 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@d0000: 0
SF: Detected w25q32dw with page size 256 Bytes, erase size 4 KiB, total 4 MiB
Net:   eth0: neta@30000 [PRIME]
Hit any key to stop autoboot:  0 
switch to partitions #0, OK
mmc0 is current device
ext4load - load binary file from a Ext4 filesystem

Usage:
ext4load <interface> [<dev[:part]> [addr [filename [bytes [pos]]]]]
    - load binary file 'filename' from 'dev' on 'interface'
      to address 'addr' from ext4 filesystem
4589284 bytes read in 212 ms (20.6 MiB/s)
8607 bytes read in 18 ms (466.8 KiB/s)
Bad Linux ARM64 Image magic!

printenv

baudrate=115200
boot_interface=mmc
bootargs=console=ttyMV0,115200 earlycon=ar3700_uart,0xd0012000 root=UUID=d556ab78-e4f7-4914-bfd1-7e3fb44f7a54 rw rootwait
bootcmd=mmc dev 0; ext4load mmc 0:1 $kernel_addr $image_name;ext4load mmc 0:1 $initrd_addr $initrd_image; ext4load mmc 0:1 $fdt_addr $fdt_name; setenv bootargs $console root=$rootdev rw rootwait; booti $kernel_addr $initrd_addr $fdt_addr
bootdelay=2
bootmmc=mmc dev 0; ext4load mmc 0:1 $kernel_addr $image_name;ext4load mmc 0:1 $fdt_addr $fdt_name;setenv bootargs $console root=/dev/mmcblk0p1 initrd=initrd.img rw rootwait; booti $kernel_addr - $fdt_addr
console=console=ttyMV0,115200 earlycon=ar3700_uart,0xd0012000
default=-a
emmc_fix=off
eth1addr=00:50:43:...
eth2addr=00:50:43:...
eth3addr=00:50:43:...
ethact=neta@30000
ethaddr=F0:AD:4E:...
ethaddr=F0:AD:4E:...
ethprime=eth0
fdt_addr=0x6000000
fdt_addr=0x6000000
fdt_high=0xffffffffffffffff
fdt_name=boot/dtb/marvell/armada-3720-espressobin.dtb
fdt_name_a=boot/dtb/marvell/armada-3720-community.dtb
fdt_name_b=boot/dtb/marvell/armada-3720-espressobin.dtb
fdtcontroladdr=3f7182d8
fileaddr=6000000
filesize=219f
gatewayip=10.4.50.254
get_images=tftpboot $kernel_addr $image_name; tftpboot $fdt_addr $fdt_name; run get_ramfs
get_ramfs=if test "${ramfs_name}" != "-"; then setenv ramfs_addr 0x8000000; tftpboot $ramfs_addr $ramfs_name; else setenv ramfs_addr -;fi
hostname=marvell
image_name=boot/Image
initrd_addr=0x1100000
initrd_image=boot/uInitrd
initrd_size=0x2000000
ipaddr=0.0.0.0
kernel_addr=0x7000000
load_script=if test -e mmc 0:1 boot/boot.scr; then echo "... booting from SD";setenv boot_interface mmc;else echo "... booting from USB/SATA";usb start;setenv boot_interface usb;fi;if test -e $boot_interface 0:1 boot/boot.scr;then ext4load $boot_interface 0:1 0x00800000 boot/boot.scr; source; fi
loadaddr=0x8000000
netdev=eth0
netmask=255.255.255.0
ramfs_addr=-
ramfs_name=-
root=root=/dev/nfs rw
rootdev=UUID=d556ab78-e4f7-4914-bfd1-7e3fb44f7a54
rootfstype=ext4
rootpath=/srv/nfs/
serverip=0.0.0.0
set_bootargs=setenv bootargs $console $root ip=$ipaddr:$serverip:$gatewayip:$netmask:$hostname:$netdev:none nfsroot=$serverip:$rootpath $extra_params
stderr=serial@12000
stdin=serial@12000
stdout=serial@12000
usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u
verbosity=1

Environment size: 2440/65532 bytes

 

Link to comment
Share on other sites

@jrtaylor You are using the official 17.10 image: U-Boot 2017.03-armada-17.10.3-g06ad760 (Aug 26 2018 - 19:00:03 +0200).

You need to set the environment settings as specified on the EspressoBin download page (bootloader script).

(Before you apply the settings you can reset your environment to default values with Marvell>> env default -a )

 

The new 18.09 images as linked in my previous posting (not yet official) currently do not work with that script since load addresses were moved - therefore you need to use the environment settings shown above - only for those 18.09 images.

Link to comment
Share on other sites

Loaded correct u-boot image but same problem.

TIM-1.0
WTMI-devel-18.07.0-6050fd5
WTMI: system early-init
SVC REV: 4, CPU VDD voltage: 1.143V
NOTICE:  Booting Trusted Firmware
NOTICE:  BL1: v1.5(release):711ecd3 (Marvell-armada-18.09.4)
NOTICE:  BL1: Built : 21:52:23, Sep  5 2018
NOTICE:  BL1: Booting BL2
NOTICE:  BL2: v1.5(release):711ecd3 (Marvell-armada-18.09.4)
NOTICE:  BL2: Built : 21:52:26, Sep  5 2018
NOTICE:  BL1: Booting BL31
NOTICE:  BL31: v1.5(release):711ecd3 (Marvell-armada-18.09.4)
NOTICE:  BL31: Built : 21:5

U-Boot 2017.03-armada-18.09.1-ga92bd86-armbian (Sep 05 2018 - 21:49:34 +0200)

Model: Marvell Armada 3720 Community Board ESPRESSOBin
       CPU     1000 [MHz]
       L2      1000 [MHz]
       NB AXI  250 [MHz]
       SB AXI  250 [MHz]
       DDR     800 [MHz]
DRAM:  1 GiB
U-Boot DT blob at : 000000003f7142d8
Comphy chip #0:
Comphy-0: USB3          5 Gbps    
Comphy-1: PEX0          2.5 Gbps  
Comphy-2: SATA0         6 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@d0000: 0
SF: Detected w25q32dw with page size 256 Bytes, erase size 4 KiB, total 4 MiB
Net:   eth0: neta@30000 [PRIME]
Hit any key to stop autoboot:  0 
switch to partitions #0, OK
mmc0 is current device
ext4load - load binary file from a Ext4 filesystem

Usage:
ext4load <interface> [<dev[:part]> [addr [filename [bytes [pos]]]]]
    - load binary file 'filename' from 'dev' on 'interface'
      to address 'addr' from ext4 filesystem
4589284 bytes read in 212 ms (20.6 MiB/s)
ext4load - load binary file from a Ext4 filesystem

Usage:
ext4load <interface> [<dev[:part]> [addr [filename [bytes [pos]]]]]
    - load binary file 'filename' from 'dev' on 'interface'
      to address 'addr' from ext4 filesystem
Bad Linux ARM64 Image magic!
Marvell>> printenv
arch=arm
baudrate=115200
board=mvebu_armada-37xx
board_name=mvebu_armada-37xx
boot_a_script=load ${devtype} ${devnum}:${distro_bootpart} ${scriptaddr} ${prefix}${script}; source ${scriptaddr}
boot_efi_binary=load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} efi/boot/bootaa64.efi; if fdt addr ${fdt_addr_r}; then bootefi ${kernel_addr_r} ${fdt_addr_r};else bootefi ${kernel_addr_r} ${fdtcontroladdr};fi
boot_extlinux=sysboot ${devtype} ${devnum}:${distro_bootpart} any ${scriptaddr} ${prefix}extlinux/extlinux.conf
boot_interface=mmc
boot_net_pci_enum=pci enum
boot_net_usb_start=usb start
boot_prefixes=/ /boot/
boot_script_dhcp=boot.scr.uimg
boot_scripts=boot.scr.uimg boot.scr
boot_targets=mmc1 mmc0 usb0 scsi0 pxe dhcp 
bootargs=console=ttyMV0,115200 earlycon=ar3700_uart,0xd0012000 root=/dev/mmcblk1p1 rw rootwait
bootcmd=mmc dev 0; ext4load mmc 0:1 $kernel_addr $image_name;ext4load mmc 0:1 $initrd_addr $initrd_image; ext4load mmc 0:1 $fdt_addr $fdt_name; setenv bootargs $console root=$rootdev rw rootwait; booti $kernel_addr $initrd_addr $fdt_addr
bootcmd_dhcp=run boot_net_usb_start; run boot_net_pci_enum; if dhcp ${scriptaddr} ${boot_script_dhcp}; then source ${scriptaddr}; fi;setenv efi_fdtfile ${fdtfile}; setenv efi_old_vci ${bootp_vci};setenv efi_old_arch ${bootp_arch};setenv bootp_vci PXEClient:Arch:00011:UNDI:003000;setenv bootp_arch 0xb;if dhcp ${kernel_addr_r}; then tftpboot ${fdt_addr_r} dtb/${efi_fdtfile};if fdt addr ${fdt_addr_r}; then bootefi ${kernel_addr_r} ${fdt_addr_r}; else bootefi ${kernel_addr_r} ${fdtcontroladdr};fi;fi;setenv bootp_vci ${efi_old_vci};setenv bootp_arch ${efi_old_arch};setenv efi_fdtfile;setenv efi_old_arch;setenv efi_old_vci;
bootcmd_mmc0=setenv devnum 0; run mmc_boot
bootcmd_mmc1=setenv devnum 1; run mmc_boot
bootcmd_nfs=run get_images; run set_bootargs; booti $kernel_addr_r $ramdisk_addr_r $fdt_addr_r
bootcmd_pxe=run boot_net_usb_start; run boot_net_pci_enum; dhcp; if pxe get; then pxe boot; fi
bootcmd_scsi0=setenv devnum 0; run scsi_boot
bootcmd_usb0=setenv devnum 0; run usb_boot
bootdelay=2
console=console=ttyMV0,115200 earlycon=ar3700_uart,0xd0012000
cpu=armv8
distro_bootcmd=setenv scsi_need_init; for target in ${boot_targets}; do run bootcmd_${target}; done
efi_dtb_prefixes=/ /dtb/ /dtb/current/
eth1addr=F0:AD:4E:...
eth2addr=F0:AD:4E:...
eth3addr=F0:AD:4E:...
ethact=neta@30000
ethaddr=F0:AD:4E:...
ethprime=eth0
extra_params=pci=pcie_bus_safe
fdt_addr=0x6000000
fdt_addr_r=0x6f00000
fdt_high=0xffffffffffffffff
fdt_name=boot/dtb/marvell/armada-3720-espressobin.dtb
fdtcontroladdr=3f7142d8
fileaddr=1100000
filesize=4606e4
gatewayip=10.4.50.254
get_images=tftpboot $kernel_addr_r $image_name; tftpboot $fdt_addr_r $fdt_name; run get_ramdisk
get_ramdisk=if test "${ramdisk_name}" != "-"; then tftpboot $ramdisk_addr_r $ramdisk_name; else setenv ramdisk_addr_r -;fi
hostname=marvell
image_name=boot/Image
initrd_addr=0x1100000
initrd_image=boot/uInitrd
initrd_size=0x2000000
ipaddr=0.0.0.0
kernel_addr=0x7000000
kernel_addr_r=0x7000000
load_efi_dtb=load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} ${prefix}${efi_fdtfile}
loadaddr=0x8000000
mmc_boot=if mmc dev ${devnum}; then setenv devtype mmc; run scan_dev_for_boot_part; fi
netdev=eth0
netmask=255.255.255.0
pxefile_addr_r=0x6e00000
ramdisk_addr_r=0xa000000
ramdisk_name=-
root=root=/dev/nfs rw
rootdev=/dev/mmcblk1p1
rootfstype=ext4
rootpath=/srv/nfs
scan_dev_for_boot=echo Scanning ${devtype} ${devnum}:${distro_bootpart}...; for prefix in ${boot_prefixes}; do run scan_dev_for_extlinux; run scan_dev_for_scripts; done;run scan_dev_for_efi;
scan_dev_for_boot_part=part list ${devtype} ${devnum} -bootable devplist; env exists devplist || setenv devplist 1; for distro_bootpart in ${devplist}; do if fstype ${devtype} ${devnum}:${distro_bootpart} bootfstype; then run scan_dev_for_boot; fi; done
scan_dev_for_efi=setenv efi_fdtfile ${fdtfile}; for prefix in ${efi_dtb_prefixes}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${efi_fdtfile}; then run load_efi_dtb; fi;done;if test -e ${devtype} ${devnum}:${distro_bootpart} efi/boot/bootaa64.efi; then echo Found EFI removable media binary efi/boot/bootaa64.efi; run boot_efi_binary; echo EFI LOAD FAILED: continuing...; fi; setenv efi_fdtfile
scan_dev_for_extlinux=if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}extlinux/extlinux.conf; then echo Found ${prefix}extlinux/extlinux.conf; run boot_extlinux; echo SCRIPT FAILED: continuing...; fi
scan_dev_for_scripts=for script in ${boot_scripts}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${script}; then echo Found U-Boot script ${prefix}${script}; run boot_a_script; echo SCRIPT FAILED: continuing...; fi; done
scriptaddr=0x6d00000
scsi_boot=run scsi_init; if scsi dev ${devnum}; then setenv devtype scsi; run scan_dev_for_boot_part; fi
scsi_init=if ${scsi_need_init}; then setenv scsi_need_init false; scsi scan; fi
serverip=0.0.0.0
set_bootargs=setenv bootargs $console $root ip=$ipaddr:$serverip:$gatewayip:$netmask:$hostname:$netdev:none nfsroot=$serverip:$rootpath $extra_params $cpuidle
soc=mvebu
stderr=serial@12000
stdin=serial@12000
stdout=serial@12000
usb_boot=usb start; if usb dev ${devnum}; then setenv devtype usb; run scan_dev_for_boot_part; fi
usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u
vendor=Marvell
verbosity=2

Environment size: 5575/65532 bytes

 

Link to comment
Share on other sites

8 hours ago, jrtaylor said:

mmc0 is current device

 

Did you reset your environment settings ? Please use the new ones:

setenv default -a

setenv verbosity "2"
setenv boot_interface mmc
setenv image_name boot/Image
setenv initrd_image "boot/uInitrd"
setenv fdt_name boot/dtb/marvell/armada-3720-espressobin.dtb
setenv fdt_high "0xffffffffffffffff"

setenv rootdev "/dev/mmcblk1p1"
setenv rootfstype "ext4"


setenv initrd_addr "0x1100000"
setenv usbstoragequirks "0x2537:0x1066:u,0x2537:0x1068:u"

setenv fdt_addr "0x6000000"
setenv kernel_addr "0x7000000"
setenv loadaddr "0x8000000"
setenv initrd_size "0x2000000"

setenv bootcmd 'mmc dev 0; ext4load mmc 0:1 $kernel_addr $image_name;ext4load mmc 0:1 $initrd_addr $initrd_image; ext4load mmc 0:1 $fdt_addr $fdt_name; setenv bootargs $console root=$rootdev rw rootwait; booti $kernel_addr $initrd_addr $fdt_addr'

setenv ethaddr F0:AD:4E:.....
setenv eth1addr F0:AD:4E:.....
setenv eth2addr F0:AD:4E:.....
setenv eth3addr F0:AD:4E:.....

env save

 

 

Link to comment
Share on other sites

1 hour ago, ebin-dev said:

The new 18.09 bootloader flash images are now available through the EspressoBin downoad page.

Please remember that it is mandatory to reset the environment settings once the 18.09 image is loaded the first time (Marvell>> env default -a).

Then the updated environment settings as shown on the EspressoBin download page should be used.  


Images have also been rebuilt, kernel 4.18.6

Link to comment
Share on other sites

8 hours ago, ebin-dev said:

 

Did you reset your environment settings ? Please use the new ones:


setenv default -a

setenv verbosity "2"
setenv boot_interface mmc
setenv image_name boot/Image
setenv initrd_image "boot/uInitrd"
setenv fdt_name boot/dtb/marvell/armada-3720-espressobin.dtb
setenv fdt_high "0xffffffffffffffff"

setenv rootdev "/dev/mmcblk1p1"
setenv rootfstype "ext4"


setenv initrd_addr "0x1100000"
setenv usbstoragequirks "0x2537:0x1066:u,0x2537:0x1068:u"

setenv fdt_addr "0x6000000"
setenv kernel_addr "0x7000000"
setenv loadaddr "0x8000000"
setenv initrd_size "0x2000000"

setenv bootcmd 'mmc dev 0; ext4load mmc 0:1 $kernel_addr $image_name;ext4load mmc 0:1 $initrd_addr $initrd_image; ext4load mmc 0:1 $fdt_addr $fdt_name; setenv bootargs $console root=$rootdev rw rootwait; booti $kernel_addr $initrd_addr $fdt_addr'

setenv ethaddr F0:AD:4E:.....
setenv eth1addr F0:AD:4E:.....
setenv eth2addr F0:AD:4E:.....
setenv eth3addr F0:AD:4E:.....

env save

 

 

I did a reset and I used those values. Will try again.

Link to comment
Share on other sites

5 minutes ago, jrtaylor said:

I did a reset and I used those values. Will try again.

 

May be you did a reset while the 17.10 image was still loaded.

 

Anyway - you can now also use the adapted environment settings on the EspressoBin download page (just changed by Igor).

Boot priority with the load_script is: 1. USB, 2. SATA, 3. SD card, 4. eMMC

Link to comment
Share on other sites

1 minute ago, ebin-dev said:

 

May be you did a reset while the 17.10 image was still loaded.

 

Anyway - you can now also use the adapted environment settings on the EspressoBin download page (just changed by Igor).

Boot priority with the load_script is: 1. USB, 2. SATA, 3. SD card, 4. eMMC

Nope I loaded the new image. Then did a reset and then env default -a.

Link to comment
Share on other sites

On 9/8/2018 at 3:38 AM, martinayotte said:

Beware that even if a specific flash chip is supported, DT requires to have partition table in flash node definition ...

 

Realized that. I managed to build a patched kernel/DT combination including:

  • Patched spi-nor.c to recognize the new Macronix chip.
  • Patched DT to set the SPI flash partitions to the locations I found 18.09 uboot is using (environment is in the final 64kB of the 4MB chip), and set state to okay.
  • Added support for GPIO LEDs to the kernel config.
  • Added a GPIO LED entry to DT so that the onboard red LED is accessible through sysfs.

Now the LED, /proc/mtd and fw_printenv are working as expected. I only get a complaint at boot time when the SPI flash is probed that a Macronix chip has been found rather than a Winbond one. Maybe adding more "compatible" entries there will be enough to fix that.

 

If anyone's interested in these changes, let me know.

Link to comment
Share on other sites

this is for everyone, who "bricked" a board by flashing old or testing bootloader, that can't reflash from uboot, because macronix SPI is not detected
or uboot won't answer at all.

I revived the board this way:

* use the old UART recovery images from globalscale (even if they don't detect macronix SPI NOR Flash)
so download them from http://espressobin.net/wp-content/uploads/2018/07/ebin-17.10-uart.zip

unfortunately globalscale still won't provide newer image.
following these instructions http://wiki.espressobin.net/tiki-index.php?page=Bootloader+recovery+via+UART

in short...
 

* jumper your board to "UART-Bootmode"
* use a terminal and connect to espressobin by usb
* you now see the recovery prompt ">" instead of "Marvell>>"

  so type the command

wtp

followed by enter. board is now in a mode to receive the temporary bootloader.. so close the terminal.

*  use the marvell tool to flash the UART recovery images to RAM
./WtpDownload_linux -P UART -C 0 -R 115200 -B TIM_ATF.bin -I wtmi_h.bin -I boot-image_h.bin -E
* do not reset the board now. just start the terminal again to connect to espressobin by usb
* you should see the prompt "Marvell>>" now and can use the command "version" to show uboot version.
*  now we are able to boot a linux kernel

I build a small kernel, with patches from skandalfo. so this kernel can access macronix SPI and you can reflash the
SPI from userspace, instead from uboot.

this is my kernel build process


 

mkdir espresso_rescue_kernel_build
cd espresso_rescue_kernel_build

# get kernelsource
wget https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.18.7.tar.xz
tar xvf linux-4.18.7.tar.xz

# patch kernel
wget https://download.foodgenius.de/data/patches/espressobin/201809/armada-3720-espressobin.dts.patch
wget https://download.foodgenius.de/data/patches/espressobin/201809/spi-nor.c.patch
patch linux-4.18.7/arch/arm64/boot/dts/marvell/armada-3720-espressobin.dts < armada-3720-espressobin.dts.patch
patch linux-4.18.7/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c < spi-nor.c.patch

# you can you espressobin kernel default config
wget https://raw.githubusercontent.com/MarvellEmbeddedProcessors/linux-marvell/linux-4.14.22-armada-18.09/arch/arm64/configs/mvebu_v8_lsp_defconfig
cp mvebu_v8_lsp_defconfig linux-4.18.7/arch/arm64/configs/

# .... but we need a rootfs, and i build it as initramfs in the kernel
# download my modified config with initramfs (path ../initramfs in config and user_id mapping = 1000 to 0. change this!)
wget https://download.foodgenius.de/data/patches/espressobin/201809/kernel_config

# since user_id mapping for initramfs is 1000 to 0, you have to change this to your current userid (user for build process) in the kernel_config file. so do this...

sed -i "s/CONFIG_INITRAMFS_ROOT_UID=1000/CONFIG_INITRAMFS_ROOT_UID=`id -u`/g" kernel_config 
sed -i "s/CONFIG_INITRAMFS_ROOT_UID=1000/CONFIG_INITRAMFS_ROOT_GID=`id -g`/g" kernel_config 

# use the kernel_config for your kernel def config
cp kernel_config linux-4.18.7/arch/arm64/configs/mvebu_v8_lsp_defconfig
  
# you can download my initramfs, but also can build your own (with buildroot)
wget https://download.foodgenius.de/data/patches/espressobin/201809/initramfs.tar.gz
tar xvfz initramfs.tar.gz

# build_kernel now
cd linux-4.18.7/
export ARCH=arm64
export CROSS_COMPILE=aarch64-linux-gnu-
make mvebu_v8_lsp_defconfig
make -j4

# you have to run a tftp-hpa on your machine for tftp boot
# you will find more information in https://help.ubuntu.com/community/TFTP
# so i am assuming you have tftpd-hpa up and running. base path /srv/tftp/
mkdir /srv/tftp/espresso_recovery

# copy new kernel and dts to tftp path on my machine
cp arch/arm64/boot/dts/marvell/armada-3720-espressobin.dtb /srv/tftp/espresso_recovery/
cp arch/arm64/boot/Image /srv/tftp/espresso_recovery/


(+++ additionally ++++
# if you want to download and extract buildroot source 
wget https://buildroot.org/downloads/buildroot-2018.08.tar.gz
tar xvfz buildroot-2018.08.tar.gz
# buildroot default config
https://raw.githubusercontent.com/MarvellEmbeddedProcessors/buildroot-marvell/buildroot-2015.11-16.08/configs/mvebu_armv8_le_defconfig
cp mvebu_armv8_le_defconfig buildroot-2018.08/configs/
# build buildroot
cd  buildroot-2018.08
make mvebu_armv8_le_defconfig
make menuconfig
#you have to rebuild your kernel then)

but i didn't use full buildroot. just uses busybox and a handmade minimal init script in the initramfs of the kernel
 

#!/bin/busybox sh
/bin/busybox --install /bin/
mount -t proc none /proc
mount -t sysfs none /sys
mknod /dev/sda  b 8 0
mknod /dev/sda1 b 8 1
mknod /dev/mtd0 c 90 0
/bin/busybox/sh

then i boot my new kernel via tftp and this environment. my tftpd machine had 192.168.5.5 ... you have to change this in your setting

setenv default -a
setenv baudrate '115200'
setenv bootdelay 2
setenv ethact 'neta@30000'
setenv ethaddr '00:51:82:11:22:00'
setenv ethprime 'eth0'
setenv fdt_addr '0x4f00000'
setenv fdt_high '0xffffffffffffffff'
setenv get_images 'tftpboot $kernel_addr $image_name; tftpboot $fdt_addr $fdt_name; run get_ramfs'
setenv get_ramfs 'if test "${ramfs_name}" != "-"; then setenv ramfs_addr 0x8000000; tftpboot $ramfs_addr $ramfs_name; else setenv ramfs_addr -;fi'
setenv set_bootargs 'setenv bootargs $console $root ip=$ipaddr:$serverip:$gatewayip:$netmask:$hostname:$netdev:none'
setenv bootcmd 'run get_images; run set_bootargs; booti $kernel_addr $ramfs_addr $fdt_addr'
setenv hostname 'marvell'
setenv initrd_addr '0xa00000'
setenv initrd_size '0x2000000'
setenv kernel_addr '0x8000000'
setenv fdt_addr '0x7000000'
setenv loadaddr '0x8000000'
setenv ramfs_addr '0x9000000'
setenv ramfs_name -
setenv netdev 'eth0'
setenv netmask '255.255.255.0'
setenv stderr 'serial@12000'
setenv stdin 'serial@12000'
setenv stdout 'serial@12000'
setenv serverip '192.168.5.5'
setenv gatewayip '192.168.5.250'
setenv ipaddr '192.168.5.10'
setenv image_name 'espresso_recovery/Image'
setenv fdt_name 'espresso_recovery/armada-3720-espressobin.dtb'
setenv root ''
setenv console 'console=ttyMV0,115200 earlycon=ar3700_uart,0xd0012000'
dhcp
boot 

 

so now you should boot into the kernel

download https://download.foodgenius.de/data/patches/espressobin/201809/mtd0.img.gz

this file is a compressed dump of the uboot, supporting macronix spi.

unpack it and copy the uncompressed(!) img to a usb stick  (assuming partitioned usb stick, partition 1)

connect the usb-stick with to your espresso board.

 

run the following commands in the rescue kernel linux, to flash SPI from userspace

 


# connect usb stick
mkdir -p /mnt/a
mount /dev/sda1 /mnt/a
cd /mnt/a

# dd image from usb stick to nor flash
dd if=mtd0.img of=/dev/mtd0
cd /
umount /mnt/a


now you can reset the board.
the current uboot should support macronix spi.  test in "Marvell>> " prompt with
 

version
sspi



so you can use https://www.armbian.com/espressobin/

bubt flash-image-MEM-RAM_CHIPS-CPU_DDR_boot_sd_and_usb.bin spi usb

or any other image and environment


 

Link to comment
Share on other sites

  • Igor changed the title to Espressobin: rescue instruction for macronix SPI chip
  • Igor pinned this topic
On 9/20/2018 at 11:13 AM, FoodGenius said:

use the old UART recovery images from globalscale

 

New UART images are created with every build (uart-images.tgz).

 

Edit: uart-images-18.09 and sata-images-18.09 with Macronix support are available. EspressoBin should be recovered after './WtpDownload_linux -P UART -C 0 -R 115200 -B TIM_ATF.bin -I wtmi_h.bin -I boot-image_h.bin -E' as described above followed by a reset. 

 

Edit: Links adapted to subfolder rescue

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines