1 1
kope

SPI+USB boot (Orange PI PC2 )

Recommended Posts

Hi,

 

https://www.armbian.com/orange-pi-pc2/ states: "Following features should work:" ... "SPI+USB boot" .

 

I was trying to load u-boot from the SPI (but without success).

I followed the instructions in  u-boot/board/sunxi/README.sunxi64 :

$ ./sunxi-fel spiflash-write 0 spl/sunxi-spl.bin
$ ./sunxi-fel spiflash-write 32768 u-boot.itb

 

Booting from SPI ends with an exception:

U-Boot SPL 2017.09-armbian (Sep 13 2017 - 12:23:18)
DRAM: 1024 MiB
Trying to boot from sunxi SPI
"Synchronous Abort" handler, esr 0x02000000
ELR:     4a000000
LR:      125cc
x 0: 000000004a000000 x 1: 0000000000000000
x 2: 0000000000007000 x 3: 0000000077777777

 

As if SPL could find/execute u-boot or SPI at all.

 

Does anybody have any success with booting from SPI on OPI PC2?

Share this post


Link to post
Share on other sites

It been a while since I've checked/tested SPI-NOR ...

Effectively, it seems broken now, probably since several u-boot versions.

Fortunately, I still had a old u-boot working build in last March, and I've put back this one into SPI_NOR.

 

EDIT : since I'm keeping a lost of previous images, I found out that another image build back in May was also working, we were still using Apriztel u-boot tree at that time. So the issue come most probably when we switched to Mainline u-boot recently ...

 

Share this post


Link to post
Share on other sites

:) yes. I reported it to Apriztel. Patch is included in the link above and is working. It should be included in mainline u-boot starting with v2017.11

Share this post


Link to post
Share on other sites

If I remember (I'm chasing soo many things in recent days), OPiPC2 works for me, but OPiPrime getting floods of "Synchronous Abort", I had no choice to use older u-boot built somewhen in August.

 

Share this post


Link to post
Share on other sites

I've built a fresh OPiPC2 today, and yes I've got one "Synchronous Abort", but it rebooted and boot fine ...

Looking back to OPiPrime, it wasn't flood of "Synchronous Abort", but simply kernel oops, but replacing u-boot with older, the same kernel boot fine.

 

Share this post


Link to post
Share on other sites

Hello,

I don't understand this new procedure. Previously I have copied with flashcp, how can I made this work?

Thanks in advance.

Share this post


Link to post
Share on other sites
3 hours ago, martinayotte said:

What do you mean by "new procedure" ?

Previously this year I asked about boot from USB without SD card. Solution was flashing u boot to spi flash. With this new image doesn't work. So I would like to know how to update u boot on SPI so it will boot from USB without SD card.

Thanks

Share this post


Link to post
Share on other sites

The procedure didn't really change, you need to activate the spi-jedec-nor overlay in /boot/armbianEnv.txt :

overlays=spi-jedec-nor
param_spinor_spi_bus=0

Then, after reboot, you should get from "cat /proc/mtd", something like that :

dev:    size   erasesize  name
mtd0: 00200000 00001000 "spi0.0"

This mean you can use "flashcp" to place the u-boot image into the flash.

 

Share this post


Link to post
Share on other sites

Hello, I tried your solution, but I am doing something wrong, flashcp doesn't output nothing. Is that right? When I connect HDD and try to boot, I get error

Trying to boot from sunxi SPI
No matching DT out of these options:
   Configuration to load ATF before U-Boot
No matching DT out of these options:
   Configuration to load ATF before U-Boot
SPL: failed to boot from all boot devices
### ERROR ### Please RESET the board ###

What am I doing wrong?

Share this post


Link to post
Share on other sites

Maybe I don't understand the steps you achieve successfully and the one that maybe failed ...

Using the overlay, did you successfully got "cat /proc/mtd ".

If Yes, then you did the flashcp and got no errors.

Next , you've halted the board, remove the SDCard, and repower the board, and U-Boot from Flash actually executed display the output you've mentioned above. Right ?

This means the USB storage you used isn't discovered. I've got such issue with some USB thumb dongles. Did you tried a real USB-HDD drive ?

You should see something like "USB 1 Storage detected" or similar message ...

If you have placed a copy of /boot into that USB drive,  you should see u-boot loading the DT/uInitrd/Image followed by "Starting kernel"

 

Share this post


Link to post
Share on other sites

Finaly I understood why this procedure with flashcp doesn't work as it did with previous images. U-boot is split between spl.bin and u-boot file. Previously it was one file with all-in-one. So I don't know how to flash to SPI-NOR with two files. Anybody with ideas are welcome.

Share this post


Link to post
Share on other sites

Ah ! Ok ! Now I understand ...

Simply concatenate both files into one :

cat /usr/lib/linux-u-boot-next-orangepipc2_5.34_arm64/sunxi-spl.bin /usr/lib/linux-u-boot-next-orangepipc2_5.34_arm64/u-boot.itb > /usr/lib/linux-u-boot-next-orangepipc2_5.34_arm64/u-boot-sunxi-with-spl.bin

Then, you can use normal "flashcp" cmdline :

flashcp /usr/lib/linux-u-boot-next-orangepipc2_5.34_arm64/u-boot-sunxi-with-spl.bin /dev/mtd0

 

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
1 1