It would seem I am a bit out of my depth in accomplishing this goal. Nonetheless, I have been working towards it for the past week. The main issue I have identified is that our prototype boards are using a NAND chip with very different specification than the reference SAMA5D44-xplained board.
More specifically, the reference board uses a MT29F4G08ABAEA 4 Gbit NAND flash and our prototype for revision 2 uses MT29F2G08ABAEAWP 2 Gbit NAND flash. I have identified that this particular NAND flash requires the following PMECC header: 0xC0902405 based on the NAND and SAMA5D44 datasheets.
spareSize = 64, eccBitReq = 4, sectorSize = 512, nbSectorPerPage = 4, usePmecc = 1, eccOffset = 36
Upon changing the nand flash header in the demo_linux_nandflash_usb.qml to reflect the correct PMECC header, I was able to get past the RomBoot prompt on our board. This is when I discovered that the PMECC settings must be changed in the AT91Bootstrap, U-boot and the Linux Kernel as well. I discovered this when U-boot showed the following:
Code: Select all
U-Boot 2019.04-linux4sam_6.1 (Oct 29 2019 - 18:35:53 +0000)
CPU: SAMA5D44
Crystal frequency: 12 MHz
CPU clock : 600 MHz
Master clock : 200 MHz
DRAM: 256 MiB
NAND: 256 MiB
MMC: Atmel mci: 0
Loading Environment from NAND... PMECC: Too many errors
NAND read from offset 140000 failed -74
*** Warning - some problems detected reading environment; recovered successfully
*** Warning - bad CRC, using default environment
In: serial@fc00c000
Out: serial@fc00c000
Err: serial@fc00c000
Net: eth0: ethernet@f8020000
Hit any key to stop autoboot: 0
NAND read: device 0 offset 0x180000, size 0x80000
PMECC: Too many errors
NAND read from offset 180000 failed -74
0 bytes read: ERROR
NAND read: device 0 offset 0x200000, size 0x600000
PMECC: Too many errors
NAND read from offset 200000 failed -74
0 bytes read: ERROR
Code: Select all
#define CONFIG_SYS_NAND_U_BOOT_OFFS 0x40000
#define CONFIG_SYS_NAND_5_ADDR_CYCLE
#define CONFIG_SYS_NAND_PAGE_SIZE 0x800
#define CONFIG_SYS_NAND_PAGE_COUNT 64
#define CONFIG_SYS_NAND_OOBSIZE 64
#define CONFIG_SYS_NAND_BLOCK_SIZE 0x20000
#define CONFIG_SYS_NAND_BAD_BLOCK_POS 0x0
Code: Select all
#define CONFIG_SYS_SDRAM_BASE 0x10000000
#define CONFIG_SYS_SDRAM_SIZE 0x10000000
Code: Select all
AT91Bootstrap 3.8.13 (Tue Oct 29 17:30:33 UTC 2019)
EEPROM: Loading AT24xx information ...
EEPROM: BoardName | [Revid] | VendorName
EEPROM: Using default information
EEPROM: Board sn: 0x1012420 revision: 0x680820
NAND: ONFI flash detected
NAND: Manufacturer ID: 0x2c Chip ID: 0xda
NAND: Page Bytes: 2048, Spare Bytes: 64
NAND: ECC Correctability Bits: 4, ECC Sector Bytes: 512
NAND: Disable On-Die ECC
NAND: Initialize PMECC params, cap: 4, sector: 512
NAND: Image: Copy 0xa0000 bytes from 0x40000 to 0x26f00000
NAND: Done to load image
AT91Bootstrap 3.8.13 (Tue Oct 29 17:30:33 UTC 2019)
EEPROM: Loading AT24xx information ...
EEPROM: BoardName | [Revid] | VendorName
EEPROM: Using default information
EEPROM: Board sn: 0x1012420 revision: 0x680820
NAND: ONFI flash detected
NAND: Manufacturer ID: 0x2c Chip ID: 0xda
NAND: Page Bytes: 2048, Spare Bytes: 64
NAND: ECC Correctability Bits: 4, ECC Sector Bytes: 512
NAND: Disable On-Die ECC
NAND: Initialize PMECC params, cap: 4, sector: 512
NAND: Image: Copy 0xa0000 bytes from 0x40000 to 0x26f00000
NAND: Done to load image
I have two questions.
1) Is there anyone my company can hire as an outside contractor to help rectify some of these problems? Does Microchip offer these services?
2) Where can I learn more about configuring u-boot for a particular model of NAND flash? Researching PMECC settings and more broadly how to program u-boot for SAMA5D devices has given me very little information to work with. I may be able to get more completed with some concentrated research, however I also have a lot of other work to do in relation to our application layer and I fear working on this may lead down a rabbit hole.