diff options
author | Aidan MacDonald <amachronic@protonmail.com> | 2022-07-11 21:08:40 +0100 |
---|---|---|
committer | Aidan MacDonald <amachronic@protonmail.com> | 2022-07-21 11:39:19 +0100 |
commit | 4101aeac54ded9591c52ac03a1b765afc394d6c0 (patch) | |
tree | ad845c30964efdf55c32fd43fb066ccfc3c7796c /bootloader | |
parent | 9ab5d311cba93ce9fe1409b9dbb6ed2da24830c9 (diff) | |
download | rockbox-4101aeac54ded9591c52ac03a1b765afc394d6c0.tar.gz rockbox-4101aeac54ded9591c52ac03a1b765afc394d6c0.zip |
x1000: simplify NAND command macros
There is actually no need to parameterize most commands with row
or column cycles, usually the opcode and row/column address width
are linked. When this is not the case we can use raw SFC commands
or define new macros.
Change-Id: I22459d732dc01012e6a8ae026c4fb85495d372b4
Diffstat (limited to 'bootloader')
-rw-r--r-- | bootloader/x1000/utils.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/bootloader/x1000/utils.c b/bootloader/x1000/utils.c index 5bad511b23..a2fd500f5d 100644 --- a/bootloader/x1000/utils.c +++ b/bootloader/x1000/utils.c | |||
@@ -375,22 +375,22 @@ static void probe_flash(int log_fd) | |||
375 | mdelay(10); | 375 | mdelay(10); |
376 | 376 | ||
377 | /* Try various read ID commands (cf. Linux's SPI NAND identify routine) */ | 377 | /* Try various read ID commands (cf. Linux's SPI NAND identify routine) */ |
378 | sfc_exec(NANDCMD_READID(0, 0), 0, buffer, readid_len|SFC_READ); | 378 | sfc_exec(NANDCMD_READID_OPCODE, 0, buffer, readid_len|SFC_READ); |
379 | fdprintf(log_fd, "readID opcode = %02x %02x %02x %02x\n", | 379 | fdprintf(log_fd, "readID opcode = %02x %02x %02x %02x\n", |
380 | buffer[0], buffer[1], buffer[2], buffer[3]); | 380 | buffer[0], buffer[1], buffer[2], buffer[3]); |
381 | 381 | ||
382 | sfc_exec(NANDCMD_READID(1, 0), 0, buffer, readid_len|SFC_READ); | 382 | sfc_exec(NANDCMD_READID_ADDR, 0, buffer, readid_len|SFC_READ); |
383 | fdprintf(log_fd, "readID address = %02x %02x %02x %02x\n", | 383 | fdprintf(log_fd, "readID address = %02x %02x %02x %02x\n", |
384 | buffer[0], buffer[1], buffer[2], buffer[3]); | 384 | buffer[0], buffer[1], buffer[2], buffer[3]); |
385 | 385 | ||
386 | sfc_exec(NANDCMD_READID(0, 8), 0, buffer, readid_len|SFC_READ); | 386 | sfc_exec(NANDCMD_READID_DUMMY, 0, buffer, readid_len|SFC_READ); |
387 | fdprintf(log_fd, "readID dummy = %02x %02x %02x %02x\n", | 387 | fdprintf(log_fd, "readID dummy = %02x %02x %02x %02x\n", |
388 | buffer[0], buffer[1], buffer[2], buffer[3]); | 388 | buffer[0], buffer[1], buffer[2], buffer[3]); |
389 | 389 | ||
390 | /* Try reading Ingenic SFC boot block */ | 390 | /* Try reading Ingenic SFC boot block */ |
391 | sfc_exec(NANDCMD_PAGE_READ(3), 0, NULL, 0); | 391 | sfc_exec(NANDCMD_PAGE_READ, 0, NULL, 0); |
392 | mdelay(500); | 392 | mdelay(500); |
393 | sfc_exec(NANDCMD_READ_CACHE_SLOW(2), 0, buffer, 16|SFC_READ); | 393 | sfc_exec(NANDCMD_READ_CACHE_SLOW, 0, buffer, 16|SFC_READ); |
394 | 394 | ||
395 | fdprintf(log_fd, "sfc params0 = %02x %02x %02x %02x\n", | 395 | fdprintf(log_fd, "sfc params0 = %02x %02x %02x %02x\n", |
396 | buffer[ 0], buffer[ 1], buffer[ 2], buffer[ 3]); | 396 | buffer[ 0], buffer[ 1], buffer[ 2], buffer[ 3]); |