Skip to content
Permalink
Browse files

upxtreme: Add UP Xtreme support

UP Xtreme is based on the Intel(R) Core(TM) i3/i5/i7 Whiskey Lake SoCs.
The UP Xtreme presents one Raspberry Pi compatible HAT connector.

This implementaion supports i2c, spi, uart, adc and gpio through the
40pin HAT connector.

Gpio chardev capabilities have been disabled in this implementation. When
gpio chardev capabilities are enabled an input becomes unreadable after an
isr has been registered to the pin. See here for details:

#937

Tested on UP Xtreme, with UP Board Linux kernel 5.0.0
Features tested: gpio, gpio interrupts, i2c, spi, adc and uart.

Signed-off-by: Michael Campion <michael.campion@emutex.com>
  • Loading branch information
mlkcampion authored and tingleby committed Jun 4, 2019
1 parent 7904356 commit d95459904548f8c3db68e3e05754087d9aae6a31
Showing with 430 additions and 1 deletion.
  1. +1 −0 README.md
  2. +1 −0 api/mraa/types.h
  3. +1 −0 api/mraa/types.hpp
  4. +1 −0 docs/index.java.md
  5. +1 −0 docs/index.md
  6. +85 −0 docs/up_xtreme.md
  7. +44 −0 include/x86/up_xtreme.h
  8. +3 −0 src/CMakeLists.txt
  9. +1 −1 src/mraa.c
  10. +286 −0 src/x86/up_xtreme.c
  11. +6 −0 src/x86/x86.c
@@ -37,6 +37,7 @@ X86
* [Intel Joule](../master/docs/joule.md)
* [IEI Tank](../master/docs/iei-tank.md)
* [ADLINK IPi-SMARC X86](../master/docs/adlink_ipi_x86.md)
* [UP Xtreme](../master/docs/up_xtreme.md)

ARM
---
@@ -66,6 +66,7 @@ typedef enum {
MRAA_ADLINK_IPI = 21, /**< Adlink Industrial PI */
MRAA_ADLINK_LEC_AL = 22, /**< Adlink LEC-AL*/
MRAA_ADLINK_LEC_AL_AI = 23, /**< Adlink LEC-AL*/
MRAA_UPXTREME = 24, /**< The UPXTREME Board */
// USB platform extenders start at 256
MRAA_FTDI_FT4222 = 256, /**< FTDI FT4222 USB to i2c bridge */

@@ -60,6 +60,7 @@ typedef enum {
MTK_LINKIT = 17, /**< Mediatek MT7688 based Linkit boards */
MTK_OMEGA2 = 18, /**< MT7688 based Onion Omega2 board */
IEI_TANK = 19, /**< IEI Tank System*/
INTEL_UPXTREME = 21, /**< The UPXTREME Board */

FTDI_FT4222 = 256, /**< FTDI FT4222 USB to i2c bridge */

@@ -52,6 +52,7 @@ Specific platform information for supported platforms is documented here:
- @ref joule
- @ref ft4222
- @ref iei-tank
- @ref up-xtreme

## DEBUGGING

@@ -60,6 +60,7 @@ Specific platform information for supported platforms is documented here:
- @ref linkit_7688
- @ref omega2
- @ref iei-tank
- @ref upXtreme
## DEBUGGING
@@ -0,0 +1,85 @@
UP Xtreme Board {#up_xtreme}
================================
UP Xtreme is based on the Intel&reg; Core&trade; i3/i5/i7 Whiskey Lake SoCs.

For the full specification please refer to the main specification page here:

https://up-board.org/wp-content/uploads/up-xtreme/Datasheet-UP-xtreme.pdf

Interface notes
-----------------------
The UP Xtreme present one Raspberry Pi compatible HAT connector and a 100 pin exHAT connector. Currently this implementation only support the interfaces through the HAT connector.

**I2C**
- 2 channels
- Support: standard-mode (100kHz), fast-mode (400kHz), Fast-mode plus (1MHz), High-speed mode (3.4MHz)
- Bus frequency can be selected in BIOS settings
- The default i2c channel is the one connected to the pin 3,5 of the hat
- On some OSes the i2c-dev kernel module may need to be loaded manually to export the i2c device nodes

**SPI**
- Bus frequencies up to 10MHz are supported
- 2 chip-selects
- To enable SPI device nodes the ACPI tables need to be overwritten as explained [here](https://wiki.up-community.org/Pinout_UP2#SPI_Ports)

**UART**
- 1 high-speed UART is available
- Supporting baud rates up to 3686400 baud
- Hardware flow-control signals are available on pins 11/36 (RTS/CTS)

Please note that a kernel with UP board support is required to enable the I/O
interfaces above.

Refer to http://www.up-community.org for more information.

Pin Mapping
--------------------
The GPIO numbering in the following pin mapping is based on the Raspberry Pi
model 2 and B+ numbering scheme.

NOTE: the i2c device numbering depend on various factor and cannot be trusted:
the right way of determining i2c (and other devices) numbering is through PCI
physical device names. See the source code in src/x86/up_xtreme.c for details.

| MRAA no. | Function | Rpi GPIO | Sysfs GPIO | mraa device |
|----------|--------------|------------|------------|-----------------|
| 1 | 3V3 VCC | | | |
| 2 | 5V VCC | | | |
| 3 | I2C_SDA | 2 | 368 | I2C0 |
| 4 | 5V VCC | | | |
| 5 | I2C_SCL | 3 | 369 | I2C0 |
| 6 | GND | | | |
| 7 | GPIO(4) | 4 | 296 | |
| 8 | UART_TX | 14 | 469 | UART0 |
| 9 | GND | | | |
| 10 | UART_RX | 15 | 468 | UART0 |
| 11 | UART_RTS | 17 | 470 | UART0 |
| 12 | I2S_CLK | 18 | 360 | |
| 13 | GPIO(27) | 27 | 268 | |
| 14 | GND | | | |
| 15 | GPIO(22) | 22 | 270 | |
| 16 | GPIO(23) | 23 | 264 | |
| 17 | 3V3 VCC | | | |
| 18 | GPIO(24) | 24 | 265 | |
| 19 | SPI0_MOSI | 10 | 308 | SPI0 |
| 20 | GND | | | |
| 21 | SPI0_MISO | 9 | 307 | SPI0 |
| 22 | GPIO(25) | 25 | 266 | |
| 23 | SPI0_SCL | 11 | 306 | SPI0 |
| 24 | SPI0_CS0 | 8 | 305 | SPI0 |
| 25 | GND | | | |
| 26 | SPI0_CS1 | 7 | 311 | SPI0 |
| 27 | ID_SD | 0 | 366 | I2C1 |
| 28 | ID_SC | 1 | 367 | I2C1 |
| 29 | GPIO(5) | 5 | 317 | |
| 30 | GND | | | |
| 31 | GPIO(6) | 6 | 318 | |
| 32 | GPIO(12) | 12 | 298 | |
| 33 | GPIO(13) | 13 | 299 | |
| 34 | GND | | | |
| 35 | I2S_FRM | 19 | 261 | |
| 36 | UART_CTS | 16 | 471 | UART0 |
| 37 | GPIO(26) | 26 | 267 | |
| 38 | I2S_DIN | 20 | 363 | |
| 39 | GND | | | |
| 40 | I2S_DOUT | 21 | 362 | |
@@ -0,0 +1,44 @@
/*
* Author: Michael Campion <michael.campion@emutex.com>
* Based on work from: Dan O'Donovan <dan@emutex.com>
* Nicola Lunghi <nicola.lunghi@emutex.com>
* Copyright (c) 2019 Emutex Ltd.
* Copyright (c) 2014 Intel Corporation.
*
* 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"

// +1 as pins are "1 indexed"
#define MRAA_UPXTREME_PINCOUNT (40 + 1)

mraa_board_t*
mraa_upxtreme_board();

#ifdef __cplusplus
}
#endif
@@ -56,6 +56,7 @@ set (mraa_LIB_X86_SRCS_NOAUTO
${PROJECT_SOURCE_DIR}/src/x86/intel_joule_expansion.c
${PROJECT_SOURCE_DIR}/src/x86/iei_tank.c
${PROJECT_SOURCE_DIR}/src/x86/adlink-ipi.c
${PROJECT_SOURCE_DIR}/src/x86/up_xtreme.c
)

message (STATUS "INFO - Adding support for platform ${MRAAPLATFORMFORCE}")
@@ -87,6 +88,8 @@ if (NOT ${MRAAPLATFORMFORCE} STREQUAL "ALL")
set (mraa_LIB_X86_SRCS_NOAUTO ${PROJECT_SOURCE_DIR}/src/x86/x86.c ${PROJECT_SOURCE_DIR}/src/x86/intel_joule_expansion.c)
elseif( ${MRAAPLATFORMFORCE} STREQUAL "MRAA_IEI_TANK")
set (mraa_LIB_X86_SRCS_NOAUTO ${PROJECT_SOURCE_DIR}/src/x86/x86.c ${PROJECT_SOURCE_DIR}/src/x86/iei_tank.c)
elseif (${MRAAPLATFORMFORCE} STREQUAL "MRAA_UPXTREME")
set (mraa_LIB_X86_SRCS_NOAUTO ${PROJECT_SOURCE_DIR}/src/x86/x86.c ${PROJECT_SOURCE_DIR}/src/x86/up_xtreme.c)
else ()
message (FATAL_ERROR "Unknown x86 platform enabled!")
endif ()
@@ -286,7 +286,7 @@ mraa_deinit()
* which means this has to be handled differently per platform
*/
if ((plat->platform_type == MRAA_JSON_PLATFORM) || (plat->platform_type == MRAA_UP2) ||
(plat->platform_type == MRAA_IEI_TANK)) {
(plat->platform_type == MRAA_IEI_TANK) || (plat->platform_type == MRAA_UPXTREME)) {
for (i = 0; i < plat->uart_dev_count; i++) {
if (plat->uart_dev[i].device_path != NULL) {
free(plat->uart_dev[i].device_path);

0 comments on commit d954599

Please sign in to comment.
You can’t perform that action at this time.