Get machine type in user-space

Per Strandh per.strandh at gmail.com
Thu Jun 20 15:19:44 EDT 2013


On 20 June 2013 21:05, Russell King - ARM Linux <linux at arm.linux.org.uk> wrote:
> On Thu, Jun 20, 2013 at 08:15:17PM +0200, Per Strandh wrote:
>> If the kernel supports more than one "machine type", the the one that
>> are specified by the bootloader will be choosen.
>> If the kernel only supports one "machine type" that will *always* be choosen.
>>
>> Question:
>> Is it possible from user-space to find out the "machine type" that was
>> passed from the bootloader?
>> I know that in /proc/cpuinfo it is possible to see that "name" of the
>> choosen "machine type", but not if it was the correct one.
>
> That "name" always reflects what was decided upon when the kernel
> interprets that machine type ID.  It isn't the actual ID but name
> of the platform string, which is itself tied to the type ID.

Yes - When the kernel contained a match of the "machine type" the name
(Hardware:) in /proc/cpuinfo can be used.

But my problem/question is...
If a kernel that did NOT support the "machine type" that the
bootloader reported has been used, the kernel will still load by
choosing one of the ones it does support.
(we have multiple boards with different "machine types" that are very
similar - so a faulty kernel is very likely to work)
In this case the /proc/cpuinfo reflects the selected "machine type"
and not the one reported by the bootloader.

Regards
/Per/



More information about the linux-arm mailing list