[PATCH] CM-x2xx NAND flash support
Mike Rapoport
mike at compulab.co.il
Wed Jul 12 09:21:40 EDT 2006
Thomas Gleixner wrote:
>On Thu, 2006-07-06 at 14:48 +0200, Mike Rapoport wrote:
>
>
>>This patch provides MTD support for NAND flash devices on CM-x2xx modules.
>>
>>Signed-off-by: Mike Rapoport <mike at compulab.co.il>
>>
>>
I've tried to fix all the coding style errors.
>
>
>>+#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 bet xscale has this functionality somewhere as a macro / inline already
>
>
>
There's dma_clean_range but it's not exactly what I need, so I left this
macro (without the last semi column)
>>+ unsigned int nandaddr = (unsigned int)this->IO_ADDR_W;
>>
>>
>
>what the hell is this type cast for ?
>
> void __iomem *nandaddr =
>
>
>
>>+ unsigned int nandaddr = (unsigned int)this->IO_ADDR_W;
>>+
>>+ DRAIN_WB();
>>+
>>+ if ( ctrl & NAND_CTRL_CHANGE ) {
>>+ if ( ctrl & NAND_ALE ) /* ALE should be changed */
>>+ nandaddr |= (1 << 3);
>>+ else
>>+ nandaddr &= ~(1 << 3);
>>+ if ( ctrl & NAND_CLE ) /* CLE should be changed */
>>+ nandaddr |= (1 << 2);
>>+ else
>>+ nandaddr &= ~(1 << 2);
>>+ if ( ctrl & NAND_NCE ) /* CE should be changed */
>>+ nand_cs_on();
>>+ else
>>+ nand_cs_off();
>>+ }
>>+ this->IO_ADDR_W = (void*)nandaddr;
>>
>>
> dito
>
As I wrote earlier, void* cannot be operand of bitwise operations. I
have ALE and CLE connected to local bus address lines, that's why I'm
using bitwise operations for address. I'll appreciate any other way to
achieve the same functionality, but I've found none.
>Can you please combine both drivers into one and make it a platform
>device. There is no need to keep lots of duplicate functionality around.
>
>
Sorry for the inconvenience, but I've dropped x255 support, so I don't
it makes sense to make the driver platform device.
> tglx
>
>
>______________________________________________________
>Linux MTD discussion mailing list
>http://lists.infradead.org/mailman/listinfo/linux-mtd/
>
>
>
--
Sincerely yours,
Mike Rapoport
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cm_x2xx_mtd.patch
Type: text/x-diff
Size: 7782 bytes
Desc: not available
Url : http://lists.infradead.org/pipermail/linux-mtd/attachments/20060712/1d526a76/attachment.bin
More information about the linux-mtd
mailing list