[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[microblaze-uclinux] readl(), writel() endianess change
Hi,
this change (swap byte in readl,writel) broke my drivers and I spent a day
to dig into the issue.
After the kernel CVS update my drivers suddenly stop to work!
/*
* Defines for accessing PCI memory. PCI is inherently little-endian,
* so on Microblaze we byte swap. For a discussion on this, see
* http://lkml.org/lkml/2004/11/18/390
*/
#define readb(addr) \
({ unsigned char __v = (*(volatile unsigned char *) (addr)); __v; })
#define readw(addr) \
({ unsigned short __v = le16_to_cpu(*(volatile unsigned short *)
(addr)); __v; })
#define readl(addr) \
({ unsigned long __v = le32_to_cpu(*(volatile unsigned long *)
(addr)); __v; })
#define writeb(b, addr) \
(void)((*(volatile unsigned char *) (addr)) = (b))
#define writew(b, addr) \
(void)((*(volatile unsigned short *) (addr)) = cpu_to_le16(b))
#define writel(b, addr) \
(void)((*(volatile unsigned int *) (addr)) = cpu_to_le32(b))
I guess the best way to do I/O in Microblaze drivers is with in_be32()
and out_be32(), can you confirm it?
PS Post a warning message on the list next time, please!!
Cheers,
Claudio Lanconelli
___________________________
microblaze-uclinux mailing list
microblaze-uclinux@xxxxxxxxxxxxxx
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/