Messages in this thread | | | Subject | Re: [PATCH] fix ppc ioremap prototype | From | Jes Sorensen <> | Date | 04 Sep 2003 12:36:45 -0400 |
| |
>>>>> "Deepak" == Deepak Saxena <dsaxena@mvista.com> writes:
Deepak> What happens if I have a device that can be either ISA or Deepak> connected directly to a local memory bus? The driver should be Deepak> able to ioremap(some resource) and then read/write the device Deepak> without having to have ugly #ifdefs to deal with different bus Deepak> types.
You can't do that reliably, some architectures requires different access for ISA vs PCI vs random-other busses. The driver needs to be aware what bus it's trying to go through.
Deepak> Example in point is the CS8900a device which is hooked Deepak> up directly to a FPGA on the local memory bus with the Deepak> bytelanes backwards. The ammount of hacking done in the Deepak> driver to get around that is ugly. It would be much nicer if Deepak> the driver still just did read*/write* and the platform level Deepak> code could deal with all the translation issues. This requires Deepak> a generic API for all I/O devices.
That might be nicer from the driver perspective but it will make readb/writeb a lot more complex and inefficient for no reason on some architectures.
The driver will have to know whether it's on a PCI, ISA or directly attached anyway when it's probing so it's perfectly reasonable to expect it to deal with that when it's accessing the registers as well.
Cheers, Jes - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |