Private
Public Access
2
0

96boards: add support to HiKey 96board

This patch adds support to HiKey board which complies with 96boards spec.
More info about board @https://www.96boards.org/products/ce/hikey/

Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
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:
Jorge Ramirez-Ortiz
2015-12-12 12:16:45 +00:00
committed by Brendan Le Foll
parent c0dfb71237
commit 36fabe3245
3 changed files with 18 additions and 1 deletions

View File

@@ -39,6 +39,7 @@ extern "C" {
#define MRAA_96BOARDS_LS_UART_COUNT 2
#define DB410C_PINCOUNT 122
#define HIKEY_PINCOUNT 512
mraa_board_t* mraa_96boards();

View File

@@ -36,6 +36,7 @@
#define DT_BASE "/sys/firmware/devicetree/base"
#define PLATFORM_NAME_DB410C "DB410C"
#define PLATFORM_NAME_HIKEY "HIKEY"
int db410c_ls_gpio_pins[MRAA_96BOARDS_LS_GPIO_COUNT] = {
36, 12, 13, 69, 115, 4, 24, 25, 35, 34, 28, 33,
@@ -43,6 +44,12 @@ int db410c_ls_gpio_pins[MRAA_96BOARDS_LS_GPIO_COUNT] = {
const char* db410c_serialdev[MRAA_96BOARDS_LS_UART_COUNT] = { "/dev/ttyMSM0", "/dev/ttyMSM1"};
int hikey_ls_gpio_pins[MRAA_96BOARDS_LS_GPIO_COUNT] = {
488, 489, 490, 491, 492, 415, 463, 495, 426, 433, 427, 434,
};
const char* hikey_serialdev[MRAA_96BOARDS_LS_UART_COUNT] = { "/dev/ttyAMA2", "/dev/ttyAMA3"};
mraa_board_t* mraa_96boards()
{
int i, pin;
@@ -66,7 +73,13 @@ mraa_board_t* mraa_96boards()
ls_gpio_pins = db410c_ls_gpio_pins;
b->uart_dev[0].device_path = db410c_serialdev[0];
b->uart_dev[1].device_path = db410c_serialdev[1];
}
} else if (mraa_file_contains(DT_BASE "/model", "HiKey Development Board")) {
b->platform_name = PLATFORM_NAME_HIKEY;
b->phy_pin_count = HIKEY_PINCOUNT;
ls_gpio_pins = hikey_ls_gpio_pins;
b->uart_dev[0].device_path = hikey_serialdev[0];
b->uart_dev[1].device_path = hikey_serialdev[1];
}
}
//UART

View File

@@ -53,6 +53,9 @@ mraa_arm_platform()
if (strstr(line, "Generic AM33XX")) {
platform_type = MRAA_BEAGLEBONE;
}
if (strstr(line, "HiKey Development Board")) {
platform_type = MRAA_96BOARDS;
}
if (strstr(line, "sun7i")) {
if (mraa_file_contains("/sys/firmware/devicetree/base/model", "Banana Pro")) {
platform_type = MRAA_BANANA;