Open ftyghome opened 2 years ago
I read the code carefully today, does the code only work for mmc boot and not for spi nor and nand flash for now?
Personally, I have only used the code in this repository with MMC. It is based on what Allwinner included in the D1 Tina SDK, which I believe was used to build the images pre-installed in SPI NAND in some Nezha boards. So it should at least work with SPI NAND. As far as I am aware, you are the first person to try using this code with SPI NOR.
Two things I would suggest:
SPI_DEBUG
in drivers/spi.c
. This will provide a better log of what is happening.sunxi_spi_gpio_init
, it uses the storage_gpio
settings from the boot0 header if those are defined. But the boot0 header in nboot/main/boot0_head.c
has pin configuration for MMC0 on PF0-PF6, not SPI. You can try changing the settings in storage_gpio
, or you can force sunxi_spi_gpio_init
to take the "else" case and use the default configuration (which is inside the CONFIG_ARCH_SUN20IW1P1
check).Thank you for the detailed answer :) I managed to get a Nezha board today which has a 2Gb MX35LF2GE4AD SPI NAND Flash. I am trying to make it able to boot from SPI NAND and SPI NOR Flash. Once I have made any progress, I will pull a request here.
Hi :) I am using the Lichee RV Dock board with Allwinner D1 SOC. I soldered an SPI nor flash modeled Winbond w25q128jvpiq on the dock and the XFEL can detect this flash successfully. I compile and flash the SPL using these command
make CROSS_COMPILE=riscv64-linux-gnu- p=sun20iw1p1 spinor
~/xfel/xfel spinor write 0x00000000 nboot/boot0_spinor_sun20iw1p1.bin
However, in the booting process, it failed on printing
[207]spinor init fail
To figure out what the problem is, I edited the code on drivers/spinor/spinor.c, tried to print the SPI nor's id before the SPL exits abnormally, then I get that the spi_init() and spinor_read_id(id) finished successfully, but the spi nor id obtained is 00 00 00. After so much debugging effort, I found that I was unable to find out what is going wrong. Can someone help me please? Thanks so much :DThe detailed startup log is here