I'm porting recent Linux kernel to older existing hardware like the i.MX28 EVK kit from Freescale, and Karo TX28 board. I want to use a part of the NAND FLASH in the file system ("userfs partition" in the NAND).
First step is using ubiattach /dev/ubi_ctrl -m 6. This operation attempts to find a volume table, and reads the NAND chip, a number of gpmi_read_page operations. This leads to a DMA timout in start_dma_without_bch_irq (gpmi-nand.c). The weird thing is, the first number of read_page operations succeed. Then a time-out hits.
First impression was a timing issue. Changing the NAND timing did not change the observed behavior. Lots of debugging, mainly focused on the values in the registers of the GPMI, GPIO and interrupt collector did not reveal anything.
I managed to get some measurement connections on the control lines of the NAND chip in the i.MX28 EVK board. Using a Saleae (imitation) logic analyzer I can see a number of correct transactions (in the range of 20, 40, something). Then a read is set up, the NAND signals ready correct, the GPMI is asked to read data and the GPMI does clock the data out of the NAND, but fails to set the chip enable line (low active). Looks like the GPMI is no more working correct internally. Now the ISR for signaling the end of the read operation is not entered (I used the second chip enable line to signal that, debug output tells same story). Hence the timeout. Looks like the GPMI is "confused" internally.
I did check that the pin multiplexer for the chip enable line is still correct after the timeout. Judging on debug output the same happen on the Karo TX 28 (no measurement on the pins, I was not able to connect).
I have seen old mailings related to issues with i.MX23 and resetting the GPMI twice (U-boot and Linux kernel), causing the GPMI to hang up. PLaying around with that fix did not change. The issue is observed on Linux kernel 5.0.8 and 4.20.7. As far as I can judge, the NAND works correct when used from U-Boot. I tried the same timing setting as U-Boot uses, no luck.
Note also that on the Karo board a Samsung NAND is used, on the i.MX28 EVK a part from Spansion. So it seems not related to the particular NAND chip. Also note that the same is observed when the NAND partition is attached from the Linux boot command line in U-boot.
Question is what to do to find root cause, and possible fix.