From: Geert U. <ge...@li...> - 2000-08-09 21:01:06
|
On Wed, 9 Aug 2000 hei...@at... wrote: > In the MMIO 53c770 driver readw, readl, writew, writel are used when both > the driver and SCSI chip are in big endian mode. I was just looking in > asm-ppc > and in io.h it has #define readw(addr) in_le16((volatile unsigned short > *)addr)) > and #define readl(addr) in_le32((volatile unsigned *)addr)). Why is the > "le"? > Shouldn't this be "be". The writel is also defined as out_le32(). Ideally, readl() and friends are meant for _PCI_ memory space only, and PCI is per definition little endian. However, the MMIO 53c770 driver currently works on SPARC only. At least on SPARC64, you can specify the endiannes of a page in the MMU page tables. So on SPARC64, the page tables will be set up such that readl() will be little endian on PCI memory space and big endian on SBUS memory space. Nice for driver writers, readl() is always correct :-) I suggest you add #elif defined(CONFIG_APUS) #define readl_l2b(a,b) in_be32(b,a) ... to sym53c8xx_defs.h (or use le32 if the wiring on the board turns out to be different), for clarity. > Is APUS big endian or little endian. Is M68K Linux big endian or little > endian? > Am I so confused about this? Can someone explain it to me? I always think > big endian == m68k, sparc; little endian == intel, alpha. > Is the Amiga different? What is Power Macintosh Linux? m68k is big endian PPC can be both (PPC had to run NT, sigh), but Linux/PPC is big endian MIPS can be both: little endian on e.g. DECstation, big endian on SGI > BTW I tried writing 0xee00ff11 to a 32 bit register on the '770 chip and got > 0xff11 back. And it's a register that allows reading back the same value? OK, so you know at least how to access the least significant short. Now you have to find out where the upper part went to, or where it has to go to. Is there any read register for which you can guess what you should read? Some chip id or revision number register? Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@li... In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds |