U-Boot on SPI flash - discussion
#11
(12-02-2019, 11:09 AM)xalius Wrote: You can write SPI flash from u-boot or from Linux, for emergency recovery even in the PBP, two IC test clips are probably the easiest solution...

By shunting the clock pin to ground?
#12
(12-02-2019, 02:01 PM)zaius Wrote:
(12-02-2019, 11:09 AM)xalius Wrote: You can write SPI flash from u-boot or from Linux, for emergency recovery even in the PBP, two IC test clips are probably the easiest solution...

By shunting the clock pin to ground?

Yes
Come have a chat in the Pine IRC channel >>
#13
While it's not something you're really after, after a lot of frustration and head-scratching I was able to build a working SPI flash image for my fork of U-Boot:

[Image: nz86P8H.png]

I ended up using Rockchip's firmwareMerger with the following config to build the image:
Code:
[System]
FwVersion=19.12.03
BLANK_GAP=1
FILL_BYTE=0
[UserPart1]
Name=IDBlock
Flag=0
Type=2
File=rkbin/bin/rk33/rk3399_ddr_933MHz_v1.24.bin,rkbin/bin/rk33/rk3399_miniloader_spinor_v1.14.bin
PartOffset=0x40
PartSize=0x7C0
[UserPart2]
Name=uboot
Type=0x20
Flag=0
File=u-boot.img
PartOffset=0x4000
PartSize=0x2000
[UserPart3]
Name=trust
Type=0x10
Flag=0
File=out/sd/trust.img
PartOffset=0x6000
PartSize=0x2000

For some reason, firmwareMerger from Rockchip repository doesn't work properly, so I had to use the version from Radxa's repository to get proper image.
It should also be possible to use U-Boot TPL and SPL instead of Rockchip blobs, but haven't found any concrete answer on how to build the image using these. Documentation just isn't clear enough, and recovery process is too cumbersome and annoying.

dd is good enough for flashing the image to the SPI. Just make sure to use flash_erase beforehand.
In case something goes wrong and PBP gets stuck somewhere in early boot, the easiest recovery method I found is taking off the metal shield and shorting SPI clock to ground until ARM Trusted Firmware (BL31) initialization. After Linux boots, you can just use dd or flash_erase to reflash/erase the chip.

Overall, it works fine on my device, so there's no more eMMC in my Pinebook Pro Smile
You can find the image here. The build scripts for everything are here.
#14
So if I just flash that SPI image, it will boot directly from SD, then NMVe and then eMMC? No other uboot flash for eMMC is needed?
#15
@pcm720, Thank you for both trying and making your results available to all.

Does your SPI version support booting off SD card if one is installed?

Edit: Never mind, just read your latest post in the "U-Boot with direct NVMe boot support", it answers yes, we can boot SD cards with your SPI image.
--
Arwen Evenstar
Princess of Rivendale
#16
Yes. However, pre-made SD images do not work:
[Image: tTMBMZP.png]
For some reason Rockchip's SPL tries (and fails) to initialize trust mode with the microSD, so it must not contain any of the bootcode.
In other words, SD has to be partitioned just like any block device. The same most likely goes for the eMMC.
#17
(12-03-2019, 06:18 AM)pcm720 Wrote: Yes. However, pre-made SD images do not work:

For some reason, Rockchip's SPL tries to use SD card and fails to initialize trust mode, so the microSD should not contain any of the bootloaders.
In other words, SD should be partitioned just like any block device. The same most likely goes for the eMMC.

So, it will not boot SD cards like Ubuntu or Debian or any of other PBP images? How to fix that?

edit: answer: here: https://forum.pine64.org/showthread.php?tid=8439
#18
Maybe a silly question, but is the SPI flash not clippable? I haven't seen the hardware itself so I don't know. If one can use a pomona clip and flashrom or s/t then it's a fairly easy recovery.
#19
(01-05-2020, 11:19 PM)aaspectre Wrote: Maybe a silly question, but is the SPI flash not clippable? I haven't seen the hardware itself so I don't know. If one can use a pomona clip and flashrom or s/t then it's a fairly easy recovery.

The Pomona 5250 clip works well. There are cheap knockoffs but the reviews of them are not favorable. The authentic version runs about $15.50 USD before shipping. If you are in the US, you can pick one up at Grainger and save yourself shipping.
#20
Well, I happen to have one of those already, nice. I guess I'm already set to experiment without worry.


Possibly Related Threads…
Thread Author Replies Views Last Post
  Cant boot into an OS trashtendenz 3 689 10-23-2024, 03:49 AM
Last Post: chaylengordon
  3 days in, slow/stuck or no boot. lgmpbp2 30 3,771 09-05-2024, 08:49 AM
Last Post: lgmpbp2
  Unable to boot? YossiS 4 397 09-04-2024, 10:35 AM
Last Post: wdt
  upgrading u-boot--what version? where to get it? bsammon 11 2,735 05-22-2024, 09:33 AM
Last Post: wdt
  uboot wont boot to SD card after upgrade jbradley419 7 2,318 01-19-2024, 02:29 PM
Last Post: wdt
  Video Flashing/adjusting on boot and reboot jbradley419 0 636 01-16-2024, 09:17 AM
Last Post: jbradley419
  Brand new Pinebook Pro doesn't boot after Manjaro update johnboiles 8 3,758 12-15-2023, 02:11 PM
Last Post: wdt
  PBP won't boot after trying to reinstall Manjaro ARM soupgirl 3 1,473 12-13-2023, 08:17 PM
Last Post: trillobite
  Various freezes during boot & while running several Linux distros - hardware error? donuts 1 1,057 11-22-2023, 11:47 AM
Last Post: fxc
  Cannot boot to Kali SD card after uboot upgrade jbradley419 4 1,946 09-19-2023, 08:48 AM
Last Post: dachalife

Forum Jump:


Users browsing this thread: 1 Guest(s)