[PATCH V7 02/17] SPEAr13xx: Add PCIe host controller base driver support.
Arnd Bergmann
arnd at arndb.de
Sun Apr 17 16:19:01 EDT 2011
On Wednesday 13 April 2011, pratyush wrote:
> > Other vendors are likely to have the same IP, but none of the code here
> > is written to be common. In light of recent discussions this would be a
> > good candidate to avoid future duplication.
> >
> > It doesn't appear that pcie.c contains much SPEAr specific code. The few
> > defines and structs that are could be passed in. Some comments below.
> >
>
> Yes, this driver is for an PCIe host which uses Synopsys IP. But
> SPEAr specific wrapper has been used heavily in the code.
> Synopsis provides some signal which can be interfaced to registers
> for CPU access. This interface can be different for different vendor.
> All the application registers are SPEAr specific representation
> and may not be same for other vendor.
> So all accesses for app_reg in the code may not be similar in other
> implementation.
>
> ...
But they could also be the same in another implementation, right?
I would suggest in general to make the code as generic as easily possible
and put it into an appropriate location for sharing, but not spending
too much effort on making it more generic than needed.
The next port that needs a variant of the code can then modify the
driver accordingly to add the necessary differences and ways to
detect them.
Arnd
More information about the linux-arm-kernel
mailing list