x1000: Bootloader now probes for the ONFI flash header at multiple addesses
rockbox-gerrit-noreply--- via rockbox-cvs <[email protected]>
| Newsgroups | gmane.comp.systems.archos.rockbox.cvs |
|---|---|
| Message-ID | <[email protected]> |
commit 8baeeda23fb21f136fe65a0aa1f9904b268888a2 Author: Solomon Peachy <[email protected]> Date: Tue Feb 3 06:24:22 2026 -0500 x1000: Bootloader now probes for the ONFI flash header at multiple addesses The location (and number of pages) is apparently manufacturer-dependent. here are some known so far: Winbond: page 1 gigadevice: page 4 This info is only queried/dumped when explicitly requested for debug purposes. Change-Id: Icc4f9c0d4f2cc9097b2295c8f42a22aab392d0d5 diff --git a/bootloader/x1000/utils.c b/bootloader/x1000/utils.c index fecf7908d1..5aeb0d8a25 100644 --- a/bootloader/x1000/utils.c +++ b/bootloader/x1000/utils.c @@ -437,15 +437,29 @@ static int dump_flash_onfi_info(int fd) nand_enable_otp(ndrv, true); + int i; + bool is_onfi; + uint8_t* buf = ndrv->page_buf; + /* read ONFI parameter page */ - ret = nand_page_read(ndrv, 0x01, ndrv->page_buf); - if(ret != NAND_SUCCESS) { - splashf(5*HZ, "Dump failed\nNAND read error"); - goto out; + for (i = 1; i <= 4; i++) { + ret = nand_page_read(ndrv, i, ndrv->page_buf); + if(ret != NAND_SUCCESS) { + splashf(5*HZ, "Dump failed\nNAND read error"); + goto out; + } + + is_onfi = buf[0] == 'O' && buf[1] == 'N' && buf[2] == 'F' && buf[3] == 'I'; + if (is_onfi) + break; } - uint8_t* buf = ndrv->page_buf; + if(!is_onfi) { + fdprintf(fd, "No ONFI Page!"); + goto out; + } + fdprintf(fd, "ONFI Page = %02x\n", i); fdprintf(fd, "signature = %08lx\n", load_le32(buf)); fdprintf(fd, "revision = %04x\n", load_le16(buf+4)); -- rockbox-cvs mailing list [email protected] https://lists.haxx.se/mailman/listinfo/rockbox-cvs