U-Boot with direct NVMe boot support for eMMC/SPI Flash
#21
(12-03-2019, 06:28 AM)pcm720 Wrote: No, the details are in the opening post of this very same thread.

Okay, so now we just have to check it we also need to wipe those boot partitions from eMMC.
  Reply
#22
I tried it but this is the output:

dd: writing to '/dev/mtd0': No space left on device
8129+0 records in
8128+0 records out
4161536 bytes (4.2 MB, 4.0 MiB) copied, 12.889 s, 323 kB/s

I see in lsblk there is no mtd0 device, just this:

mtdblock0     31:0    0     4M  0 disk
mtdblock1     31:1    0    32K  0 disk
mtdblock2     31:2    0   256K  0 disk

So I am a little afraid to reboot now Smile

I tried to PM, but you have the PMs disabled, so I think I can reply here:


pcm720 Wrote:SPI flash is not supposed to show up in lsblk because it's not a block device.
Which Linux distribution did you use to flash the image? You should've checked the target before doing any writes.
Execute `dmesg | grep spi` and make sure spi-nor module was loaded correctly. There should be something along these lines:

Code:
spi-nor spi0.0: gd25q128 (16384 Kbytes)

Try to read the image back from /dev/mtd0 and check its contents.
If they represent the first 4 Mbytes of spiflash.bin and spi-nor was loaded properly, you can try to erase the contents by executing
Code:
flash_erase /dev/mtd0 0 0

Don't do this unless you're sure that /dev/mtd0 is indeed an SPI flash.

Thanks, but it seems it is late for me, I rebooted already and PBP does not start now. I used Ubuntu Mate distro.
I just tried cat /dev/mtd0 and the result was empty.
I also found some 16 MB device in lsblk, but as you said, it should not be SPI flash.
I know, it is just my fault, so I will try something with the SD cards now. I made those steps to clean those booting code from SD card but still does not boot. I guess I cannot just replace the SPi flash because it is a part of PCB, right?
  Reply
#23
It is possible, but you have to unsolder the NOR flash.
I did this in the past on a board to change a sound codec.
You then have to solder a new NOR flash if you want to try to flash u-boot again on it.
To unsolder such chip, the best is to use a knife first to cut the feets, then remove them with the iron.
Use a lot of flux and copper braid.
You should train yourself to solder and unsolder SMD on old broken electronics.
  Reply
#24
Just a thought :
The 'legs' look fairly long in the wiki pictures.
Would it be possible to cut the legs close to the chip itself ? and solder your new chip to the existing 'legs' ? ?
MAY be ugly, but a bit easier..? AS I said, Just a Thought or Question.
      LINUX = CHOICES
         **BCnAZ**
               Idea
   Donate to $upport
your favorite OS Team
  Reply
#25
FWIW
http://opensource.rock-chips.com/wiki_Rockusb

Maskrom mode

If there is no bootable firmware found on board, the SoC will run Rockusb driver automatically, we call it Bootrom mode or Maskrom mode.

If firmware is at somewhere of the board, in order to get into this mode, we can do something to prevent cpu read the firmware successful:

   for SD-card, unplug the SD-card;
   for eMMC, short the eMMC clock to GND;
   for NAND, short the data line or clock line;
   for SPI, short the spi signal to GND;
   By "reboot bootrom" command in U-Boot and Kernel, WIP.
   erase bootable region with non-bootable data in eMMC or other media devices

ayufan has some descrition for rock64
https://github.com/ayufan-rock64/linux-b...ash-spi.md
should be (almost ?) same with pinebookpro not tested and not wrapped my mind around this

currently reading/following/whatever the whole thread
anyway of this
u-boot supports boot script, so it's possible to check for a bootable device/partition/network

I don't know if u-boot can use/supports a watchdog as barebox does
It's a nice feature

You should check the partition size first
  Reply
#26
I solved that by flashing SPI directly from rkdeveloptool, thank to @pcm720 .

It boots after I cleaned all the boot code from my eMMC, so will try my SD cards later.
  Reply
#27
(12-03-2019, 12:05 PM)Wizzard Wrote: I tried it but this is the output:

dd: writing to '/dev/mtd0': No space left on device
8129+0 records in
8128+0 records out
4161536 bytes (4.2 MB, 4.0 MiB) copied, 12.889 s, 323 kB/s

I see in lsblk there is no mtd0 device, just this:

mtdblock0     31:0    0     4M  0 disk
mtdblock1     31:1    0    32K  0 disk
mtdblock2     31:2    0   256K  0 disk

So I am a little afraid to reboot now Smile

@Wizzard was able to fix incomplete SPI flash using Rockchip's rkdeveloptool.
Since the first 4 Mbytes of SPI image contain only DDR initialization and SPI bootcode, device got stuck in Loader mode.
Connecting it with USB-C cable to PC and executing the following was enough to fix it:
Code:
rkdeveloptool wl 0 /path/to/spiflash.bin
  Reply
#28
I am not sure if it is related, but I am seeing the errors like this when booting and in dmesg since yesterday:

Code:
rockchip-dmc dmc: Get wrong frequency, Request 800000000, Current 856000000
  Reply
#29
(12-04-2019, 12:28 PM)Wizzard Wrote: I am not sure if it is related, but I am seeing the errors like this when booting and in dmesg since yesterday:

Code:
rockchip-dmc dmc: Get wrong frequency, Request 800000000, Current 856000000

rockchip-dmc is Dynamic Memory Controller driver that dynamically adjusts DRAM frequency:
http://archive.lwn.net:8080/devicetree/2...ora.com/t/
There are probably some incompatibilities between the current Trusted Firmware and kernel your distro is using: it's pretty clear that rockchip-dmc can't set the frequency it wants.
I guess you can try building your own SPI image with different ATF binary (e.g. the one used in stock U-Boot) and see if that fixes these errors.
  Reply
#30
Building is not for me, but I would like to know if I am the only one with this issue and if someone alse also tried this new SPI flash.

If it is only warning, it is not a big problem for me.
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Pinebook Boot CharlesBunders 10 179 Yesterday, 07:44 AM
Last Post: tophneal
  Broken Boot djhnsn 15 302 05-05-2021, 04:14 PM
Last Post: djhnsn
  NVMe SSD and battery life? dieselnutjob 3 418 04-19-2021, 01:55 PM
Last Post: slyecho
  PBP won't boot (no amber or green LED) ian-s-mcb 46 8,347 04-15-2021, 09:58 AM
Last Post: SnowyMountainWeb
Question erase spi flash aiminick 1 148 04-07-2021, 06:50 AM
Last Post: tophneal
  PIneBook Pro - Boot from SD mcdomx 12 9,446 03-29-2021, 01:13 AM
Last Post: 5825bc9762
  Selling Pinebook Pro 128GB version (w/ NVMe adaptor) due to lack of use VoT 3 862 03-19-2021, 03:11 AM
Last Post: jj282
  Happy eMMC and SDcard OS usage for Pinebook Pro Newbies... Paulie420 40 16,382 02-27-2021, 11:01 AM
Last Post: wdt
  Novice question: Pinebook Pro does boot (does it?) but black screen Gert V. 21 3,298 01-27-2021, 10:48 PM
Last Post: rimaille
  [split] U-Boot with NVMe support, keyboard & display working as400 83 30,755 01-27-2021, 12:48 AM
Last Post: as400

Forum Jump:


Users browsing this thread: 1 Guest(s)