GPIO NAND: Complete Support for 2k page size NAND
authorSandeep Paulraj <s-paulraj@ti.com>
Wed, 22 Jun 2011 12:10:41 +0000 (08:10 -0400)
committerSandeep Paulraj <s-paulraj@ti.com>
Thu, 30 Jun 2011 16:04:38 +0000 (12:04 -0400)
Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
src/hw/nands/gpio/nandgpio.c

index 9cd5cd06fb16fd67b443919ed87a1fe78b801617..cb2805f5fdad97f5d0527aae24cb3cf9459d708c 100644 (file)
@@ -280,21 +280,31 @@ Int32 nandHwGpioDriverReadBytes (Uint32 block, Uint32 page, Uint32 byte, Uint32
        {
                /* Read page data */
                cmd = hwDevInfo->readCommandPre;
        {
                /* Read page data */
                cmd = hwDevInfo->readCommandPre;
+               ptNandCmdSet(cmd); // First cycle send 0
+               addr = PACK_ADDR(0x0, page, block);
        }
        else
        {
                /* Read spare area data */
        }
        else
        {
                /* Read spare area data */
-               cmd = 0x50;
+               if (hwDevInfo->pageSizeBytes == 512) {
+                       cmd = 0x50;
+                       ptNandCmdSet(cmd);
+                       addr = PACK_ADDR(0x0, page, block);
+               } else if (hwDevInfo->pageSizeBytes == 2048) {
+                       cmd = 0x0;
+                       ptNandCmdSet(cmd);
+                       addr = PACK_ADDR(0x800, page, block);
+               }
        }
 
        }
 
-       ptNandCmdSet(cmd); // First cycle send 0
+//     ptNandCmdSet(cmd); // First cycle send 0
 
        /* 
         * Send address of the block + page to be read
         * Address cycles = 4, Block shift = 14,
         * Page Shift = 9, Bigblock = 0
         */
 
        /* 
         * Send address of the block + page to be read
         * Address cycles = 4, Block shift = 14,
         * Page Shift = 9, Bigblock = 0
         */
-       addr = PACK_ADDR(0x0, page, block);
+//     addr = PACK_ADDR(0x0, page, block);
        
        if (hwDevInfo->pageSizeBytes == 512) {
                ptNandAleSet((addr >>  0u) & 0xFF);   /* A0-A7  1st Cycle;  column addr */
        
        if (hwDevInfo->pageSizeBytes == 512) {
                ptNandAleSet((addr >>  0u) & 0xFF);   /* A0-A7  1st Cycle;  column addr */