PINE64
SoPine SPI booting - Printable Version

+- PINE64 (https://forum.pine64.org)
+-- Forum: PINE A64-LTS / SOPINE Compute Module (https://forum.pine64.org/forumdisplay.php?fid=66)
+--- Forum: Linux on PINE A64-LTS / SOPINE (https://forum.pine64.org/forumdisplay.php?fid=69)
+--- Thread: SoPine SPI booting (/showthread.php?tid=5581)

Pages: 1 2 3 4


RE: SoPine SPI booting - aww - 05-04-2018

(05-04-2018, 09:18 AM)hexalyn Wrote: @aww I see... If I understand correctly, here: https://patchwork.ozlabs.org/patch/873752/ they patch mainline u-boot with the realtek stuff.
As I have seen, every modified file in this patch has the same "pre-patch" state as the files in your modified u-boot version.
Couldn't we juste apply this patch onto your repo if this is the realtek only patch ?

Thanks

Lets try it? 

I was also looking at just building mainline u-boot. It supposedly has support for a64 now.


RE: SoPine SPI booting - hexalyn - 05-04-2018

@aww Can you give it a try on your repo in another branch ? Do you want me to build it the way @ayufan does it ?
I also think that what you linked previously in the network issue topic was a much more complete patch : https://github.com/armbian/build/blob/master/patch/kernel/sunxi-next/sunxi64-pine64-plus-ethernet-fix.patch
It seems that this patch has everything that you linked regarding this realtek issue.

I have no idea if it would work on mainline u-boot. It seems there are a lot of fixes in sunxi-u-boot :/
If you think it will work, I can try building from mainline u-boot.


RE: SoPine SPI booting - aww - 05-04-2018

So good news, bad news:

Good news: Mainline u-boot just works! It can see networking just fine.

Bad news: It can only see networking on the baseboard, still no luck on clusterboard. However I have only tried with enabling and disabling that realtek config, let me play with rgmii-txid now.

Other Good News: Mainline sees MMC


RE: SoPine SPI booting - aww - 05-05-2018

Code:
ethernet@1c30000 Waiting for PHY auto negotiation to complete...... done
BOOTP broadcast 1
BOOTP broadcast 2
DHCP client bound to address 192.168.2.46 (256 ms)
*** Warning: no boot file name; using 'C0A8022E.img'
Using ethernet@1c30000 device
TFTP from server 0.0.0.0; our IP address is 192.168.2.46; sending through gateway 192.168.2.1
Filename 'C0A8022E.img'.
Load address: 0x42000000


In mainline u-boot add the following to: /u-boot/configs/sopine_baseboard_defconfig
Code:
CONFIG_RTL8211E_PINE64_GIGABIT_FIX=y
CONFIG_PHY_REALTEK=y

I'll try and build an image like ayufan did that will flash the SPI.


RE: SoPine SPI booting - aww - 05-05-2018

So ayufan's script relies on a command not found in mainline u-boot. I am waiting for a usb-a to usb-a male cable to flash all the sopines.


RE: SoPine SPI booting - aww - 05-05-2018

And thanks to latest u-boot, iPXE works, which should enable iSCSI as well.


RE: SoPine SPI booting - hexalyn - 05-07-2018

You want me to give a try to modify a bit ayufan's scripts to release a new image to flash mainline u-boot in the SPI ?
@aww : Thanks a lot for your efforts !

@aww : here is a version using Ayufan's scripts with mainline u-boot : https://transfer.sh/4h6rM/u-boot-mainline-sopine-flash-spi.img.xz
Could you try it and tell me if it works as expected ? I had no issues with any command not found. What command was it ?


RE: SoPine SPI booting - aww - 05-07-2018

The script looks for the sf command in u-boot to flash the spi, and I wasn't able to get mainline to compile with it.

I'll try it after I get off work. I honestly spent more time focused on the iscsi stuff, which is somewhat of a nightmare because of iPXE and efi.


RE: SoPine SPI booting - pfeerick - 05-08-2018

(05-07-2018, 02:10 AM)hexalyn Wrote: You want me to give a try to modify a bit ayufan's scripts to release a new image to flash mainline u-boot in the SPI ?
@aww : Thanks a lot for your efforts !

@aww : here is a version using Ayufan's scripts with mainline u-boot : https://transfer.sh/4h6rM/u-boot-mainline-sopine-flash-spi.img.xz
Could you try it and tell me if it works as expected ? I had no issues with any command not found. What command was it ?

Thanks for generating that (and the previous image, although I haven't gotten around to trying it... should do that right now just for giggles...)

The image boots, but it fails to erase or write to the SPI... that sf command must be something to do interacting with the spi flash...

https://pastebin.com/VUJtee2b

I'll boot the image up again with network connected and see if it actually pokes the ethernet... it looks promising as it did indicate phy negotiation was complete. I'll run through that, and add a second boot log or comment shortly...

A little later...

Well, I booted the pine64 master box up, and watching the log from dnsmasq (sudo tailf /var/log/syslog | grep dnsmasq-dhcp), I was starting to get

Code:
May  4 06:39:33 localhost dnsmasq-dhcp[1246]: 154664209 available DHCP subnet: 192.168.0.0/255.255.255.0
May  4 06:39:33 localhost dnsmasq-dhcp[1246]: 154664209 vendor class: U-Boot.armv8


repeated endlessly once the sopine got it's act together and was doing the BOOTP broadcast, so networking is indeed working, and it is trying! Smile

Also, sudo tcpdump -i eth0 port 67 or port 68 -e -n was giving me

Code:
06:45:08.378427 02:ba:09:37:bd:8b > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 342: 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 02:ba:09:37:bd:8b, length 300


And at some point, also got some

Code:
May  4 06:40:19 localhost dnsmasq-dhcp[1246]: 154710342 available DHCP subnet: 192.168.0.0/255.255.255.0
May  4 06:40:19 localhost dnsmasq-dhcp[1246]: 154710342 vendor class: PXEClient:Arch:00011:UNDI:003000
May  4 06:40:19 localhost dnsmasq-dhcp[1246]: 154710342 PXE(eth0) 02:ba:09:37:bd:8b proxy
May  4 06:40:19 localhost dnsmasq-dhcp[1246]: 154710342 tags: eth0
May  4 06:40:19 localhost dnsmasq-dhcp[1246]: 154710342 broadcast response
May  4 06:40:19 localhost dnsmasq-dhcp[1246]: 154710342 sent size:  1 option: 53 message-type  2
May  4 06:40:19 localhost dnsmasq-dhcp[1246]: 154710342 sent size:  4 option: 54 server-identifier  192.168.0.250
May  4 06:40:19 localhost dnsmasq-dhcp[1246]: 154710342 sent size:  9 option: 60 vendor-class  50:58:45:43:6c:69:65:6e:74
May  4 06:40:19 localhost dnsmasq-dhcp[1246]: 154710342 sent size: 29 option: 43 vendor-encap  06:01:08:0a:17:05:42:6f:6f:74:69:6e:67:20...

happening also... did somebody say PXE? :-D

So getting warmer! And btw, the older earlier image writes the SPI flash properly, but the ethernet doesn't work. So it looks like mainline may be the best way for now if we can get uboot on the spi flash...


RE: SoPine SPI booting - hexalyn - 05-08-2018

Hello Smile

For the sf command I may have an idea. There is an option not enabled in our /u-boot/configs/sopine_baseboard_defconfig that I found reading ayufan's commits : "CONFIG_CMD_SF=y"
But @ayufan made a lot of other changes to dts and other files : https://github.com/ayufan-pine64/u-boot-sunxi/commit/bd2dc6149489b655d4ba420c972a646c850419dd

@aww Do you think that if we replicate those modifications on a fork of the mainline u-boot it would work ? He also made more modifications related to SPI beforehand here : https://github.com/ayufan-pine64/u-boot-sunxi/commit/2486281374a6da4d86f7e597a7b9536318658ba2

I will try to create such a fork and replicate the modifications that seem relevant for me and create a new build of the image that makes the flash. Thanks for all your help @pfeerick and @aww.