Messages in this thread | | | Subject | Re: [PATCH 3/4] Fix remaining big endian issue of hfcmulti | From | Benjamin Herrenschmidt <> | Date | Tue, 05 Aug 2008 23:04:26 +1000 |
| |
> Thanks for this hint, I didn't know that the repetive versions are > for byte streams and not for eg. transfer of multiple u32. > So it makes things lot easier the code should look like: > > int l = len >> 2; > > if (l) { > ioread32_rep(hc->pci_membase + A_FIFO_DATA0, data, l); > data += l << 2; > } > if (len & 2) { > ioread16_rep(hc->pci_membase + A_FIFO_DATA0, data, 1); > data += 2; > } > if (len & 1) > writeb(*data, hc->pci_membase + A_FIFO_DATA0);
Don't mix the io* variants with the PCI variants. Use iowrite8 for the last one and make sure you do a proper pci_iomap.
One cool thing with the new iomap stuff is that it also works for both PIO and MMIO, so you no longer need to differenciate writeX from outX as long as you use the right mapping stuff initially.
Ben.
| |