Private
Public Access
2
0

arm: 96boards: Add support for Hikey960

Add support for Hikey960 board from HiSilicon based on their Kirin960 SoC.

Peripherals supported:

1. GPIO
2. UART
3. I2C

For GPIO only Chardev interface has been added since this board only supports
>=4.15 kernel and using legacy sysfs interface is highly discouraged.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: malikabhi05 <abhishek.malik@intel.com>
This commit is contained in:
Manivannan Sadhasivam
2018-04-05 16:50:09 +05:30
committed by malikabhi05
parent 5faa2b93ca
commit 3fa1237255
3 changed files with 18 additions and 0 deletions

View File

@@ -11,6 +11,7 @@ Board Support
- [DragonBoard 410c](http://www.96boards.org/product/dragonboard410c/)
- [DragonBoard 820c](http://www.96boards.org/product/dragonboard820c/)
- [HiKey](http://www.96boards.org/product/hikey/)
- [HiKey960](http://www.96boards.org/product/hikey960/)
- [Bubblegum-96](http://www.96boards.org/product/bubblegum-96/)
Interface notes

View File

@@ -39,6 +39,7 @@
#define PLATFORM_NAME_DB410C "DB410C"
#define PLATFORM_NAME_DB820C "DB820C"
#define PLATFORM_NAME_HIKEY "HIKEY"
#define PLATFORM_NAME_HIKEY960 "HIKEY960"
#define PLATFORM_NAME_BBGUM "BBGUM"
#define MAX_SIZE 64
#define MMAP_PATH "/dev/mem"
@@ -77,6 +78,14 @@ int hikey_chardev_map[MRAA_96BOARDS_LS_GPIO_COUNT][2] = {
const char* hikey_serialdev[MRAA_96BOARDS_LS_UART_COUNT] = { "/dev/ttyAMA2", "/dev/ttyAMA3" };
// HIKEY960
int hikey960_chardev_map[MRAA_96BOARDS_LS_GPIO_COUNT][2] = {
{ 26, 0 }, { 26, 1 }, { 26, 2 }, { 26, 3 }, { 26, 4 }, { 22, 6 },
{ 2, 7 }, { 5, 0 }, { 6, 4 }, { 2, 3 }, { 9, 3 }, { 2, 5 },
};
const char* hikey960_serialdev[MRAA_96BOARDS_LS_UART_COUNT] = { "/dev/ttyAMA3", "/dev/ttyAMA6" };
int bbgum_ls_gpio_pins[MRAA_96BOARDS_LS_GPIO_COUNT] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 155, 154 };
const char* bbgum_serialdev[MRAA_96BOARDS_LS_UART_COUNT] = { "/dev/ttyS3", "/dev/ttyS5" };
@@ -249,6 +258,12 @@ mraa_96boards()
b->uart_dev[0].device_path = (char*) hikey_serialdev[0];
b->uart_dev[1].device_path = (char*) hikey_serialdev[1];
b->chardev_capable = 1;
} else if (mraa_file_contains(DT_BASE "/model", "HiKey960")) {
b->platform_name = PLATFORM_NAME_HIKEY960;
chardev_map = &hikey960_chardev_map;
b->uart_dev[0].device_path = (char*) hikey960_serialdev[0];
b->uart_dev[1].device_path = (char*) hikey960_serialdev[1];
b->chardev_capable = 1;
} else if (mraa_file_contains(DT_BASE "/model", "s900")) {
b->platform_name = PLATFORM_NAME_BBGUM;
ls_gpio_pins = bbgum_ls_gpio_pins;

View File

@@ -92,6 +92,8 @@ mraa_arm_platform()
else if (mraa_file_contains("/proc/device-tree/model",
"HiKey Development Board"))
platform_type = MRAA_96BOARDS;
else if (mraa_file_contains("/proc/device-tree/model", "HiKey960"))
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,"))