I need you guys to vote on the following problem.
In present the way we handle PCI and EBus base_address[] appears to
be broken. Gleb's PCIC code tries to put virtual addresses automagically
there. This approach works only by a chance and have some bad qualities:
* Mapping of PCI devices relies on "assigned-addresses" PROM property,
which is NOT guranteed to be present (consider it a broken PROM if you
wish). Therefore, if we skip devices without "assigned-addresses",
we present a mix and mess to drivers, where some devices are mapped
knd some are not, and there is no fucking way to tell which are which
[such is my current kludge]. Gleb's original solution was to panic whenever
you cannot remap a device, which is hardly better (consistent though :-).
* You can never hotplug things.
An alternative which I am poundering is to let all drivers to be littered
with the following:
hme_open():
hme->gregs = pdev->base_address[0] + HME_SOME_OFFSET;
#ifdef __sparc__
if ((hme->gregs_v = sparc_alloc_io(hme->gregs, .....)) == 0) {
return ENOMEM;
}
#endif
hme_close():
#ifdef __sparc__
sparc_free_io(hme->gregs_v);
#endif
This does not look too attractive either because I hate #ifdefs.
There is one more thing which is possible to do. We do know that
Sun is not going to produce any 32 bits systems with multiply PCI buses.
(for our purposes bridged PCI counts as a single bus).
Therefore we may use Linux-wide ioremap() in the following way:
arch/sparc/kernel/ioport.c:
ioremap(a, l) {
virt = sparc_alloc_io(a, ....); /* bus or phys_high == 0 here */
if (virt == 0) bummer();
return virt;
}
hme_open():
hme->gregs = ioremap(pdev->base_address[0] + HME_SOME_OFFSET, 0x100);
hme_close():
iounmap(hme->gregs);
Good thing about ioremap() is that it works on sparc64 too, as a nop.
This approach is told by Linus in Documentation/IO-mapping.txt.
I would just do it, except I do not like the ioremap as it is.
Why don't we have an ioremap() which takes PCI bus handle and
cacheability flags?
Send in your suggestions by July 9th please. Thank you!
--Pete
-
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of the message to [EMAIL PROTECTED]