November 7, 2018

Orange Pi PC 2 - network booting - Putting U-Boot into NOR flash

The following interesting note can be found in the file u-boot-2018.09/board/sunxi/README.sunxi64 .

The PC 2 has 2M of NOR flash, and the current U-Boot uses about 700K, so this ought to work just fine.

One thing will need to be addressed when and if this is done, and that is where the environment settings will go. U-Boot will expect to find them in a FAT partition on the SD card and we won't have an SD card. U-Boot has config variables like CONFIG_ENV_IS_IN_MMC, perhaps found in the file include/configs/sunxi-common.h, but this remains to be seen.

The best thing may be to find the compiled in environment variable settings and make them correct and immutable for our purposes.

NOR flash
---------
Some boards (like the SoPine, Pinebook or the OrangePi PC2) come with a
soldered SPI NOR flash chip. On other boards like the Pine64 such a chip
can be connected to the SPI0/CS0 pins on the PI-2 headers.
Create the SPL and FIT image like described above for the SD card.
Now connect either an "A to A" USB cable to the upper USB port on the Pine64
or get an adaptor and use a regular A-microB cable connected to it. Other
boards often have a proper micro-B USB socket connected to the USB OTB port.
Remove a microSD card from the slot and power on the board.
On your host computer download and build the sunxi-tools package[2], then
use "sunxi-fel" to access the board:
$ ./sunxi-fel ver -v -p
This should give you an output starting with: AWUSBFEX soc=00001689(A64) ...
Now use the sunxi-fel tool to write to the NOR flash:
$ ./sunxi-fel spiflash-write 0 spl/sunxi-spl.bin
$ ./sunxi-fel spiflash-write 32768 u-boot.itb
Now boot the board without an SD card inserted and you should see the
U-Boot prompt on the serial console.


Have any comments? Questions? Drop me a line!

Tom's electronics pages / tom@mmto.org