szemzoa / awboot

small linux bootloader for Allwinner T113-S3 and V851s
72 stars 33 forks source link

LittleFS for nand flash #5

Closed fpoussin closed 1 year ago

fpoussin commented 1 year ago

Since bad blocks can happen with NAND flash, we need a reliable filesystem that can handle those. I've also added all the required tools with it and cleanup the Makefiles.

This is a work in progress, I'll be doing more testing.

szemzoa commented 1 year ago

Please give me a few days to test it. Regarding the sunxi_spi: set clock to 96MHz, I think it's not right. The formula is (User manual page 121): SCLK = Clock Source/M/N. I reworked the spi clock setup, but had not time to test it properly, can you look at it?

spi_clk_rework.txt

fpoussin commented 1 year ago

No worries, I'll still need some time for testing as well. As for SPI, I assumed (SCLK/M)*N as it's the usual way PLL works but you are right, so I've dropped that commit. I'll give your code a try. Thanks

fpoussin commented 1 year ago

Well, it loads. Now I can have a look at the LFS code.

Allwinner T113-loader
DRAM SIZE = 128M
DRAM simple test OK.
CPU freq=1200 MHz
spi-nand: set spi clock=50MHz, mclk=200MHz
CDR1 - n = 2
spi-nand: W25N01GV detected
oops, something went wrong..
fpoussin commented 1 year ago

I've opened another PR with all the changes without LFS as it's taking me more time to test than expected. This will be easier to review and merge.

fpoussin commented 1 year ago

Closing, I'll make a new one later on.