Private
Public Access
2
0

rpi: use /proc/device-tree/compatible

While some distributions have a modified /proc/cpuinfo including
the board revision for raspberry pi, most distributions don't
have this.

In order to guess the raspberry pi version in such cases, use
the /proc/device-tree/compatible content as a fallback solution.
The values expected from this file have been taken from
upstream kernel documentation:

Documentation/devicetree/bindings/arm/bcm/brcm,bcm2835.txt

Signed-off-by: Cédric Bosdonnat <cbosdonnat@suse.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
Cédric Bosdonnat
2017-02-22 09:55:11 +01:00
committed by Brendan Le Foll
parent b453f6633b
commit b20fe9163a
2 changed files with 51 additions and 0 deletions

View File

@@ -87,6 +87,8 @@ mraa_arm_platform()
platform_type = MRAA_96BOARDS;
else if (mraa_file_contains("/proc/device-tree/model", "s900"))
platform_type = MRAA_96BOARDS;
else if (mraa_file_contains("/proc/device-tree/compatible", "raspberrypi,"))
platform_type = MRAA_RASPBERRY_PI;
}
switch (platform_type) {