Hi Tudor, On Mon, Mar 20, 2023 at 6:04 PM Tudor Ambarus <tudor.ambarus@xxxxxxxxxx> wrote: > Vignesh used to review CFI code, maybe he can intervene. I've never > worked with CFI, but I can try to help. I'll need more debug data though. > > On 3/20/23 16:43, Geert Uytterhoeven wrote: > > Add a device node for the Spansion S29GL512N NOR FLASH on the Marzen > > development board. > > > > Signed-off-by: Geert Uytterhoeven <geert+renesas@xxxxxxxxx> > > --- > > Although the S29GL512N is a CFI FLASH, using "cfi-flash" instead of > > "mtd-rom" does not work: > > 1. Probing fails with "physmap-flash 0.flash: map_probe failed", > > I would first try to understand why the probe fails. With debug code added, I saw that cfi_probe_chip() fails because cfi_qry_mode_on() returns zero. Printing actual vs. expected values in map_word_equal() showed that nothing was read (all 0xff, IIRC). Forcing big-endian (CONFIG_MTD_CFI_BE_BYTE_SWAP=y) didn't help, and caused an unaligned access crash. > > 2. The kernel crashes later in a spectacular way, cfr. the logs below. > > > > U-Boot flinfo says: > > > > Bank # 1: CFI conformant flash (16 x 16) Size: 64 MB in 512 Sectors > > AMD Standard command set, Manufacturer ID: 0x01, Device ID: 0x227E > > Erase timeout: 4096 ms, write timeout: 1 ms > > Buffer write timeout: 3 ms, buffer size: 64 bytes > > Sector Start Addresses: > > 00000000 RO 00020000 00040000 RO 00060000 RO 00080000 > > 000A0000 000C0000 000E0000 00100000 00120000 > > 00140000 00160000 00180000 001A0000 001C0000 > > ... > > 03FC0000 03FE0000 > > > > Bank # 2: missing or unknown FLASH type > > Do you use "cfi-flash" compatible in u-boot and it works just fine? If > yes, I would try to understand what are the differences between the > probe paths from u-boot and linux. I know it doesn't help much, but we > should start from somewhere if we don't have any other feedback. It's a bit more complicated... This is a rather old board, and I only have the originally installed U-Boot 2011.03, and no U-Boot sources. U-Boot can write to the FLASH, as "saveenv" works (env at 0x40000). Thanks for your help! Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds