96boards: add support to HiKey 96board
authorJorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
Sat, 12 Dec 2015 12:16:45 +0000 (12:16 +0000)
committerBrendan Le Foll <brendan.le.foll@intel.com>
Mon, 14 Dec 2015 11:01:38 +0000 (11:01 +0000)
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>
include/arm/96boards.h
src/arm/96boards.c
src/arm/arm.c

index 6c0dae5..863c6cd 100644 (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();
 
index 9844042..16fe0eb 100644 (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
index 4ed4a9b..a3363c0 100644 (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;