UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Visitor r_vivek
Visitor
2,943 Views
Registered: ‎04-16-2013

Nand and SDIO issue

Hi,

 

I am working on custom zynq board, I am facing an issue when I am working with Nand Flash(Micron MT29F16G08ABABAWP) and Wi-fi(Blue giga) connected to SDIO controller. Both are working perfectly fine independently, but when I do a nand boot I get an error which prints

"mmc0: Timeout waiting for hardware interrupt", for sometime and later on it prints

"mmc0: new high speed SDIO card at address 0001".

Post the above message when I try to insert my wi-fi module then it prints the following messages

mmc0: Timeout waiting for hardware interrupt.
unifi0: retryable SDIO error reading F0 0x5
mmc0: Timeout waiting for hardware interrupt.
unifi0: retryable SDIO error reading F0 0x5
unifi0: Failed to read from UniFi (addr 0x5) after 3 tries
unifi0: SDIO error reading SDIO_INT_PENDING
unifi0: unifi_bh: state=2 T, clock=1000kHz, interrupt=0 host=1, power_save=enabled
mmc0: Timeout waiting for hardware interrupt.
unifi0: retryable SDIO error writing 11 to F0 0xF0

As our Nand Flash is 2GB and has a OOB of 224, I made necessary changes to the code
driver/mtd/nand/nand_base.c and the changes are
 
static struct nand_ecclayout nand_oob_224 = {
    .eccbytes = 104,
    .eccpos = {  2,   3,   4,   5,   6,   7,   8,
        9,  10,  11,  12,  13,  14,
        18,  19,  20,  21,  22,  23,  24,
        25,  26,  27,  28,  29,  30,
        34,  35,  36,  37,  38,  39,  40,
        41,  42,  43,  44,  45,  46,
        50,  51,  52,  53,  54,  55,  56,
        57,  58,  59,  60,  61,  62,
        66,  67,  68,  69,  70,  71,  72,
        73,  74,  75,  76,  77,  78,
        82,  83,  84,  85,  86,  87,  88,
        89,  90,  91,  92,  93,  94,
        98,  99, 100, 101, 102, 103, 104,
        105, 106, 107, 108, 109, 110,
        114, 115, 116, 117, 118, 119, 120,
        121, 122, 123, 124, 125, 126
    },
    .oobfree = {
        {.offset = 15, .length = 3},
        {.offset = 31, .length = 3},
        {.offset = 47, .length = 3},
        {.offset = 63, .length = 3},
        {.offset = 79, .length = 3},
        {.offset = 95, .length = 3},
        {.offset = 111, .length = 3},
        {.offset = 127, .length = 97}
    }
};

and the following line in the function nand_scan_tail
case 224:
         chip->ecc.layout = &nand_oob_224;
         break;

 

Can anyone help me with this.

Regards,

Vivek

0 Kudos
1 Reply
Visitor r_vivek
Visitor
2,879 Views
Registered: ‎04-16-2013

Re: Nand and SDIO issue

We have to fake out the card detect since it is also NAND CS, for this I have made changes to the sdhci_zynq_probe of

sdhci-of-xilinxps.c and the change is

 

u8 reg;

reg = sdhci_readb(host, SDHCI_HOST_CONTROL);
reg |= 0xC0;
sdhci_writeb(host, reg, SDHCI_HOST_CONTROL);

Vivek

0 Kudos