96boards: add support to 96boards (https://www.96boards.org/)
This patch adds support to 96boards. 96boards is an open platform specification. This spec strandardizes the pins on the external connectors like Low speed and High speed. Given these pins are standard across multiple boards, I think adding a generic 96boards made sense to me. The idea behind adding this generic board file is to make mraa work on most of the 96boards with minimal changes to board support in libmraa. This patch adds support to the LS expansion connector which has got 12 gpio pins + 2 i2c + 1 spi and 2 uarts. For now I have added Dragaon board DB401c support as part of this patch and is tested. More info about board @ https://www.96boards.org/products/ce/dragonboard410c/ Long term plan is to get all this configuration from the /sys and populate the board specifics dynamically, which is bit easy with 96boards specs in-place. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
committed by
Brendan Le Foll
parent
47ec54c333
commit
c0dfb71237
@@ -30,6 +30,8 @@
|
||||
#include "arm/raspberry_pi.h"
|
||||
#include "arm/beaglebone.h"
|
||||
#include "arm/banana.h"
|
||||
#include "arm/96boards.h"
|
||||
|
||||
|
||||
mraa_platform_t
|
||||
mraa_arm_platform()
|
||||
@@ -38,6 +40,7 @@ mraa_arm_platform()
|
||||
size_t len = 100;
|
||||
char* line = malloc(len);
|
||||
FILE* fh = fopen("/proc/cpuinfo", "r");
|
||||
|
||||
if (fh != NULL) {
|
||||
while (getline(&line, &len, fh) != -1) {
|
||||
if (strncmp(line, "Hardware", 8) == 0) {
|
||||
@@ -63,11 +66,18 @@ mraa_arm_platform()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
fclose(fh);
|
||||
}
|
||||
free(line);
|
||||
|
||||
/* Get compatible string from Device tree for boards that dont have enough info in /proc/cpuinfo */
|
||||
if (platform_type == MRAA_UNKNOWN_PLATFORM) {
|
||||
if (mraa_file_contains("/sys/firmware/devicetree/base/compatible", "qcom,apq8016-sbc"))
|
||||
platform_type = MRAA_96BOARDS;
|
||||
}
|
||||
|
||||
switch (platform_type) {
|
||||
case MRAA_RASPBERRY_PI:
|
||||
plat = mraa_raspberry_pi();
|
||||
@@ -78,6 +88,9 @@ mraa_arm_platform()
|
||||
case MRAA_BANANA:
|
||||
plat = mraa_banana();
|
||||
break;
|
||||
case MRAA_96BOARDS:
|
||||
plat = mraa_96boards();
|
||||
break;
|
||||
default:
|
||||
plat = NULL;
|
||||
syslog(LOG_ERR, "Unknown Platform, currently not supported by MRAA");
|
||||
|
||||
Reference in New Issue
Block a user