Detecting XO-1.5 in kernel boot

Daniel Drake dsd at laptop.org
Tue Sep 21 12:15:31 EDT 2010


I'm working on XO-1.5 support upstream and would appreciate comments
on the following:



The very core "am I an XO?" check that runs during boot is this:

http://lxr.free-electrons.com/source/arch/x86/kernel/olpc.c#L212

It runs ioremap() on 0xffffffc0 and expects to read the OFW signature "CL1   Q"

If we pass the check, we then go on to call into OFW to read the board
revision, etc.

We're talking upstream kernel here, so this would normally run on
every kernel (i.e. all the distro kernels) that compile with OLPC
support. According to comments in the file, the check is dangerous, so
we cut down where it is run, bailing out early:

	/* The ioremap check is dangerous; limit what we run it on */
	if (!is_geode() || cs5535_has_vsa2())
		return 0;


This needs an update for XO-1.5, where we want this code to run, but
we aren't a geode or cs5535.
How should we update the check?

One idea: check the DMI info, look for the OLPC XO-1.5
manufacturer/product codes.

Others?

Thanks,
Daniel



More information about the Devel mailing list