mirror of
https://github.com/Rockbox/rockbox.git
synced 2026-04-12 00:47:49 -04:00
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
This commit is contained in:
parent
78542df466
commit
8baeeda23f
1 changed files with 19 additions and 5 deletions
|
|
@ -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");
|
||||
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;
|
||||
}
|
||||
|
||||
if(!is_onfi) {
|
||||
fdprintf(fd, "No ONFI Page!");
|
||||
goto out;
|
||||
}
|
||||
|
||||
uint8_t* buf = ndrv->page_buf;
|
||||
|
||||
fdprintf(fd, "ONFI Page = %02x\n", i);
|
||||
fdprintf(fd, "signature = %08lx\n", load_le32(buf));
|
||||
fdprintf(fd, "revision = %04x\n", load_le16(buf+4));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue