s3c2410 mmc errata?

Ben Dooks ben at trinity.fluff.org
Thu Jun 7 10:52:11 CEST 2007

On Thu, Jun 07, 2007 at 10:01:16AM +0200, Harald Welte wrote:
> On Wed, Jun 06, 2007 at 08:07:33PM +0200, Pierre Ossman wrote:
> > Harald Welte wrote:
> > > I'll double check this with my specs for later processors.  Runtime
> > > check is definitely preferred, since one kernel has to support multiple
> > > different processors...
> > >   
> > 
> > You're more experienced with embedded stuff than I am; how do you
> > conveniently determine the current CPU?
> unfortunately there currently is no API for that.  But the way s3cmci
> solves this problem is by exporting three platform devices, one
> s3c2412-sdi, one s3c2410-sdi and one s3c2440-sdi.

I always liked this as a soluition as it makes it clear in sysfs which
version of the device is being used. However, it is a pain when having
to declare 3 or 4 different driver blocks.

dbrownell suggested passing the type in the platform data, but that
makes an annoying dependency on (a) having platform data and (b) having
to set this data per-machine, where it is currently being set by the
cpu initialisation code.
> struct s3cmci_host has a 'is2440' member that you can use to check.
> There are other examples in the code where 2440 specifics have been put
> into 'if (host->is2440)' blocks.
> unfortunately 'if (!host->is2440)' will not cut it, since it would 
> basically mean 2410 + 2412.
> I would therefore argue that the 'is2440' is replaced with something
> like 'cpu_type' which can then be defined to constants like
> S3C2410/S3C2440/S3C2443/S3C2412

The current s3c nand driver uses TYPE_<cpuname> and each probe entry
of the driver sets the appopriate type before calling the common probe.
> Ben: I still believe that it would be helpful, if not even better, if
> the s3c platform code exported something like a cheap inline function to
> determine the specific S3C variant.  This could solve this 'once and for
> all' in all the drivers in a unique way, rather than every driver having
> to reinvent the wheel.

I've put an idea out on linux-arm-kernel list, and see what happens.


Q:      What's a light-year?
A:      One-third less calories than a regular year.

More information about the openmoko-kernel mailing list