Re: [RFC] new bus architecture (+ byte-endianess)

Jakub Jelinek (jj@sunsite.ms.mff.cuni.cz)
Mon, 7 Jun 1999 18:03:06 +0200


> > (2) will you offer some bus_to_bus address translation functions, for
> > example for supporting DMA from one (PCI) bus to another on PowerPC
> > (PowerPC uses translating bridge)?
>
> Any translation will be probably done via physical addresses, i.e.
> you translate address on the first bus to a physical address and then
> the physical address to address on the second bus.

This won't probably work with IOMMU. E.g. on sparc64 once we kill GFP_DMA
limiting to first 4GB physical. That's why buses using IOMMU will need some
kind of acquire_dma/acquire_dma_sg/release_dma/release_dma_sg, so that IOMMU
page tables can be dynamically filled up. And if you want to go between two
different cards, then you'll have to use some special function which will
fill two IO page tables if necessary (e.g. SBUS and PCI one). I don't know
if SBUS<->SBUS DMA actually works, there are some bits for it but have never
tried, but PCI<->other PCI should definitely work.

>
> I'd like to hear the opinion of PPC people, because in case we can get
> automatic conversion LE->BE at no extra cost, DaveM's argument about
> readl_be() being just extra complexity with no benefits is perfectly
> correct.

But you need to take care of the bus endianity in case a system has more
buses with different endians. E.g. say you have SBUS and PCI, SBUS is big
endian and PCI little endian.
So you either stick them into bus_ops (I'd recommend that), plus have some
possibly inlineable functions for each different bus e.g. for cases where a
driver is single bus only and will always be (many are).
So you'd have
read_32(bus_t bus, ptr) which would do bus->bus_ops->read_32(ptr) and then
pci_read_32(ptr) which would be the pci version of the same. All these would
work in its bus native order. Plus if desired to have the LE/BE variants of
these (I'd like them but DaveM apparently does not).

Cheers,
Jakub
___________________________________________________________________
Jakub Jelinek | jj@sunsite.mff.cuni.cz | http://sunsite.mff.cuni.cz
Administrator of SunSITE Czech Republic, MFF, Charles University
___________________________________________________________________
UltraLinux | http://ultra.linux.cz/ | http://ultra.penguin.cz/
Linux version 2.3.4 on a sparc64 machine (1343.49 BogoMips)
___________________________________________________________________

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/