Orange Pi Zero / how to access internal flash device

Well this page confirms what I already knew. The SPI dev is disabled on OPi Zero

Looks like you will need to use flashrom.

Did you check your board?
PLEASE BE SURE you have a OPI zero with a spi ic :) Some version came w/o spi
 
Did you check your board?
Sorry I see you already have.

What I wonder is did I mess up on DT overlay you should use.
Maybe you need this one:

That seems to be what the above github says. Try this overlay instead.

This command seems to indicate you have a supported flash chip.
flashrom -p linux_spi:dev=/dev/spidev0.0 -w spi.img -c MX25L1605A/MX25L1606E/MX25L1608E
 
Even the compatible line can throw fatal errors:
compatible = "allwinner,sun8i-h3"

I would be stripping frangment@2 out for starters. Get one SPI device working.
So which address is your SPI device using??

I would fire up Armbian and study where the SPI ROM is and only concentrate on enabling that in your FreeBSD overlay..
These CPU class overlays have every possible SOC connection possible in the overlays.
Some platforms may only enable a sub-set of these features.
For example only one SPI device might be exposed.
Use Linux as a tool and probe the SPI with it. Also take note of the actual SPI ROM chip in use.
Then verify there is a FreeBSD driver for it.
You could get your overlay working only to discover that there is no FreeBSD driver for the particular SPI ROM chip.

Here is an example of the SPI chip driver I have dealt with:
I still have the Armbian SD-card that I used to make them bootable without SD-card. Serial works too. I will try to look up for the chip model.

The /boot/dtb/overlays directory of the GENERIC-SD image seems to contain files related to this, Also, the 13.2 source contains the arm kernel config file GENERIC-MMCCAM that says "Custom kernel for GENERIC plus MMCCAM as opposed to the prior MMC stack" It tried it and it shows a different sd cardreader device name but I didn't notice anything else.
Unfortunately, I can't find any information about it.

Code:
spigen-rpi-b.dtbo
spigen-rpi2.dtbo
sun8i-a83t-sid.dtbo
sun8i-h3-i2c0.dtbo
sun8i-h3-i2c1.dtbo
sun8i-h3-mmc0-disable.dtbo
sun8i-h3-mmc1-disable.dtbo
sun8i-h3-mmc2-disable.dtbo
sun8i-h3-spi0.dtbo

All sun8i overlays result in "not compatible" on the serial boot screen. Decompile/recompile of sun8i-h3-spi0.dtbo makes no difference.

I ordered another "clean" testing OPI-0 to make sure I didn't somehow write a wrong SPI image using Armbian that causes this incompatibility problem.


Missed your last comments. Tried to compile that, but dtc says "Bad magic token in header. Got 2f647473 expected 0xd00dfeed"
Hex numbers with and without leading 0xd but is it the problem?

flashrom says:
Code:
Using clock_gettime for delay loops (clk_id: 4, resolution: 42ns).
Error: Unknown programmer "linux_spi:dev=/dev/spidev0.0". Valid choices are:
dummy, serprog, buspirate_spi, pony_spi.
It needs a spidev0.0 device?

This is all getting complex to me now, I'll keep on experimenting.
 
Back
Top