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?
  Reply
#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 >>
  Reply
#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.
  Reply
#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?
  Reply
#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
  Reply
#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.
  Reply
#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
  Reply
#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.
  Reply
#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.
  Reply
#20
Well, I happen to have one of those already, nice. I guess I'm already set to experiment without worry.
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  PBP won't boot (no amber or green LED) ian-s-mcb 39 7,233 2 hours ago
Last Post: SnowyMountainWeb
Question erase spi flash aiminick 1 72 04-07-2021, 06:50 AM
Last Post: tophneal
  PIneBook Pro - Boot from SD mcdomx 12 8,733 03-29-2021, 01:13 AM
Last Post: 5825bc9762
  Novice question: Pinebook Pro does boot (does it?) but black screen Gert V. 21 2,910 01-27-2021, 10:48 PM
Last Post: rimaille
  [split] U-Boot with NVMe support, keyboard & display working as400 83 29,153 01-27-2021, 12:48 AM
Last Post: as400
  Sudden Pinebook Pro boot problems ndp 3 699 01-21-2021, 09:51 AM
Last Post: ndp
  How to determine which U-boot I am using edandjeanmcknight@gmail.com 0 302 01-15-2021, 08:25 AM
Last Post: edandjeanmcknight@gmail.com
  U-Boot with direct NVMe boot support for eMMC/SPI Flash pcm720 115 80,120 01-04-2021, 09:57 AM
Last Post: wdt
  Booting to sdcard stopped working after emmc flash techiedog 3 873 12-31-2020, 06:30 PM
Last Post: Anarethos
  Flash non-bootable eMMC? midnightcheese 2 467 12-24-2020, 08:01 AM
Last Post: midnightcheese

Forum Jump:


Users browsing this thread: 1 Guest(s)