[PATCH] [MTD] CM-x270 NAND flash support
Raphael Assenat
raph at 8d.com
Fri Jul 21 15:33:32 EDT 2006
Mike Rapoport wrote:
> +
> +/* This macro needed to ensure in-order operation of GPIO and local
> + * bus. Without both asm command and dummy uncached read there're
> + * states when NAND access is broken. I've looked for such macro(s) in
> + * include/asm-arm but found nothing approptiate.
> + * dmac_clean_range is close, but is makes cache invalidation
> + * unnecessary here and it cannot be used in module
> + */
> +#define DRAIN_WB() \
> + do { \
> + unsigned char dummy; \
> + asm volatile ("mcr p15, 0, r0, c7, c10, 4":::"r0"); \
> + dummy=*((unsigned char*)UNCACHED_ADDR); \
> + } while(0)
I think you should add the volatile keyword to the typecast:
dummy=*((volatile unsigned char*)UNCACHED_ADDR);
In the cm-x255 nand flash driver, I had problems without it (read errors, ecc errors,
etc). Maybe the compiler is optimising this read away thinking it does nothing useful?
Regards,
Raphael Assenat
More information about the linux-mtd
mailing list