source: trunk/target/linux/omap35xx/patches-2.6.36/004-nand_subpage_align.patch @ 26274

Last change on this file since 26274 was 26274, checked in by hcg, 6 years ago

[omap35xx] Add patch to correct sub-page alignment

File size: 698 bytes
  • drivers/mtd/nand/omap2.c

    diff -urN linux-2.6.38.old/drivers/mtd/nand/omap2.c linux-2.6.38/drivers/mtd/nand/omap2.c
    old new  
    245245        int ret = 0; 
    246246        u32 *p = (u32 *)buf; 
    247247 
     248        /* u32 align the buffer and read */ 
     249        /* NB: This assumes the buf ptr can be aligned *down* which is a valid. 
     250        * Assumption when dealing with ecc buffers etc. 
     251        */ 
     252        u32 addr = (u32)p; 
     253 
     254        int diff = addr & 3; 
     255        addr -= diff; 
     256        len += diff; 
     257        len = (len + 3) & ~3; 
     258        p = (u32 *)addr; 
     259 
    248260        /* take care of subpage reads */ 
    249261        if (len % 4) { 
    250262                if (info->nand.options & NAND_BUSWIDTH_16) 
Note: See TracBrowser for help on using the repository browser.