Permalink
Browse files

Add support for MIPS-based boards Omega2 and Linkit Smart 7688

Signed-off-by: Serge Vakulenko <vak@besm6.org>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
  • Loading branch information...
sergev authored and arfoll committed Oct 4, 2017
1 parent 668776f commit 6770be911ba18b25ff284eeac80390e4111f602f
View
@@ -166,12 +166,14 @@ if (DETECTED_ARCH STREQUAL "i586" OR DETECTED_ARCH STREQUAL "x86_64"
set (X86PLAT ON)
elseif (DETECTED_ARCH MATCHES "arm.*")
set (ARMPLAT ON)
elseif (DETECTED_ARCH MATCHES "mips")
set (MIPSPLAT ON)
elseif (DETECTED_ARCH STREQUAL "MOCK")
set (MOCKPLAT ON)
elseif (DETECTED_ARCH STREQUAL "PERIPHERALMAN")
set (PERIPHERALMAN ON)
else ()
message (FATAL_ERROR "Only x86, arm, PERIPHERALMAN and mock platforms currently supported")
message (FATAL_ERROR "Only x86, arm, mips, PERIPHERALMAN and mock platforms currently supported")
endif()
if (BUILDSWIGPYTHON OR BUILDTESTS)
View
@@ -41,6 +41,11 @@ ARM
* [phyBOARD-Wega](../master/docs/phyboard-wega.md)
* [96Boards](../master/docs/96boards.md)
MIPS
---
* [Linkit Smart 7688](../master/docs/linkit_7688.md)
* [Onion Omega2](../master/docs/omega2.md)
FPGA
----
* [DE10-Nano](../master/docs/de_nano_soc.md)
View
@@ -57,6 +57,8 @@ typedef enum {
MRAA_PHYBOARD_WEGA = 14, /**< The phyBOARD-Wega */
MRAA_DE_NANO_SOC = 15, /**< Terasic DE-Nano-SoC Board */
MRAA_UP2 = 16, /**< The UP^2 Board */
MRAA_MTK_LINKIT = 17, /**< Mediatek MT7688 based Linkit boards */
MRAA_MTK_OMEGA2 = 18, /**< MT7688 based Onion Omega2 board */
// USB platform extenders start at 256
MRAA_FTDI_FT4222 = 256, /**< FTDI FT4222 USB to i2c bridge */
@@ -45,6 +45,8 @@ set(archdetect_c_code "
#error cmake_ARCH x86_64
#elif defined(__ia64) || defined(__ia64__) || defined(_M_IA64)
#error cmake_ARCH ia64
#elif defined(__mips) || defined(__mips__) || defined(_M_MRX000)
#error cmake_ARCH mips
#elif defined(__ppc__) || defined(__ppc) || defined(__powerpc__) \\
|| defined(_ARCH_COM) || defined(_ARCH_PWR) || defined(_ARCH_PPC) \\
|| defined(_M_MPPC) || defined(_M_PPC)
View
@@ -56,6 +56,8 @@ Specific platform information for supported platforms is documented here:
- @ref firmata
- @ref grovepi
- @ref mock
- @ref linkit_7688
- @ref omega2
## DEBUGGING
View
@@ -0,0 +1,65 @@
Linkit Smart 7688 {#linkit}
=================
The Linkit Smart 7688 is based on the MediaTek MT7688 system on a chip, which
includes a MIPS 24KEc 580 MHz processor and 128 megabytes of RAM.
Features:
* 20 GPIO pins
* 4 PWM pins
* 3 UART ports
* 1 SPI master port
* 1 SPI slave port (not supported by libmraa)
* 1 I2C port
* 1 I2S port (not supported by libmraa)
![Pinout](http://www.cnx-software.com/wp-content/uploads/2015/12/Link_Smart_7688_Pinout.png)
Revision Support
----------------
* Linkit Smart 7688
* Linkit Smart 7688 Duo
Pin Mapping
-----------
| MRAA Number | Physical Pin | Function |
|-------------|--------------|------------------------|
| --- | P0 | (Reset) |
| 1 | P1 | GPIO43 (Eth LED) |
| --- | P2 | (Eth RD+) |
| --- | P3 | (Eth RD-) |
| --- | P4 | (Eth TD+) |
| --- | P5 | (Eth TD-) |
| --- | P6 | (USB D+) |
| --- | P7 | (USB D-) |
| 8 | P8 | GPIO20, UART TX2, PWM2 |
| 9 | P9 | GPIO21, UART RX2, PWM3 |
| --- | GND | GND |
| --- | 3V3 | 3V3 |
| --- | VCC | VCC |
| --- | 5V | 5V |
| 10 | P10 | GPIO2, (I2S WS) |
| 11 | P11 | GPIO3, (I2S CLK) |
| 12 | P12 | GPIO0, (I2S SDI) |
| 13 | P13 | GPIO1, (I2S SDO) |
| 14 | P14 | GPIO37 (REF_CLK) |
| 15 | P15 | GPIO44 (WiFi LED) |
| 16 | P16 | GPIO46, UART RX1 |
| 17 | P17 | GPIO45, UART TX1 |
| 18 | P18 | GPIO13, UART RX0 |
| 19 | P19 | GPIO12, UART TX0 |
| 20 | P20 | GPIO5, I2C SDA |
| 21 | P21 | GPIO4, I2C SCL |
| 22 | P22 | SPI MOSI |
| 23 | P23 | SPI MISO |
| 24 | P24 | SPI SCK |
| 25 | P25 | GPIO6, SPI CS |
| 26 | P26 | GPIO18, PWM0 |
| 27 | P27 | GPIO19, PWM1 |
| 28 | P28 | GPIO17, (SPIS MOSI) |
| 29 | P29 | GPIO16, (SPIS MISO) |
| 30 | P30 | GPIO15, (SPIS SCK) |
| 31 | P31 | GPIO14, (SPIS CS) |
View
@@ -0,0 +1,67 @@
Onion Omega2 {#omega2}
============
The Omega2 board is based on the MediaTek MT7688 system on a chip, which
includes a MIPS 24KEc 580 MHz processor and 128 megabytes of RAM.
Features:
* 15 GPIO pins
* 2 PWM pins
* 2 UART ports
* 1 SPI master port
* 1 I2C port
* 1 I2S port (not supported by libmraa)
![Pinout](https://raw.githubusercontent.com/OnionIoT/Onion-Docs/master/Omega2/Documentation/Hardware-Overview/img/Omega-2-Pinout-Diagram.png)
Revision Support
----------------
* Omega2
* Omega2+
Pin Mapping
-----------
Left side:
| MRAA Number | Function |
|-------------|------------------------|
| --- | GND |
| 1 | GPIO11 |
| 2 | GPIO3, (I2S CLK) |
| 3 | GPIO2, (I2S WS) |
| 4 | GPIO17 |
| 5 | GPIO16 |
| 6 | GPIO15 |
| 7 | GPIO46, UART RX1 |
| 8 | GPIO45, UART TX1 |
| 9 | SPI MISO |
| 10 | SPI MOSI |
| 11 | SPI SCK |
| 12 | GPIO6, SPI CS |
| 13 | GPIO1, (I2S SDO) |
| 14 | GPIO0, (I2S SDI) |
| --- | (Reset) |
Right side:
| MRAA Number | Function |
|-------------|------------------------|
| --- | GND |
| --- | VIN 3V3 |
| --- | (USB D+) |
| --- | (USB D-) |
| 20 | GPIO13, UART RX0 |
| 21 | GPIO12, UART TX0 |
| 22 | FW RST |
| --- | VOUT 3V3 |
| --- | (Eth TX-) |
| --- | (Eth TX+) |
| --- | (Eth RX-) |
| --- | (Eth RX+) |
| 28 | GPIO18, PWM0 |
| 29 | GPIO19, PWM1 |
| 30 | GPIO4, I2C SCL |
| 31 | GPIO5, I2C SDA |
View
@@ -0,0 +1,40 @@
/*
* Author: Serge Vakulenko <vak@besm6.org>
* Copyright (c) 2017 Serge Vakulenko.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
#include "mraa_internal.h"
mraa_board_t *
mraa_mtk_linkit();
mraa_board_t *
mraa_mtk_omega2();
#ifdef __cplusplus
}
#endif
View
@@ -65,6 +65,13 @@ mraa_platform_t mraa_x86_platform();
*/
mraa_platform_t mraa_arm_platform();
/**
* runtime detect running mips platforms
*
* @return mraa_platform_t of the init'ed platform
*/
mraa_platform_t mraa_mips_platform();
/**
* setup a mock platform
*
View
@@ -97,6 +97,11 @@ set (mraa_LIB_ARM_SRCS_NOAUTO
${PROJECT_SOURCE_DIR}/src/arm/de_nano_soc.c
)
set (mraa_LIB_MIPS_SRCS_NOAUTO
${PROJECT_SOURCE_DIR}/src/mips/mips.c
${PROJECT_SOURCE_DIR}/src/mips/mediatek.c
)
set (mraa_LIB_MOCK_SRCS_NOAUTO
${PROJECT_SOURCE_DIR}/src/mock/mock.c
${PROJECT_SOURCE_DIR}/src/mock/mock_board.c
@@ -134,6 +139,11 @@ if (ARMPLAT)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DARMPLAT=1")
endif()
if (MIPSPLAT)
add_subdirectory(mips)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMIPSPLAT=1")
endif()
if (MOCKPLAT)
add_subdirectory(mock)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMOCKPLAT=1")
View
@@ -0,0 +1,3 @@
message (INFO " - Adding MIPS platforms")
set (mraa_LIB_PLAT_SRCS_NOAUTO ${mraa_LIB_SRCS_NOAUTO}
${mraa_LIB_MIPS_SRCS_NOAUTO} PARENT_SCOPE)
Oops, something went wrong.

0 comments on commit 6770be9

Please sign in to comment.