-
Notifications
You must be signed in to change notification settings - Fork 615
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
platform: Add RISC-V architecture with VisionFive
Add RISC-V architecture and StarFive JH71x0-based boards VisionFive and VisionFive 2. Signed-off-by: Daniel Bovensiepen <oss@bovi.li> Signed-off-by: Zhu Jia Xing <jiaxing.zhu@siemens.com>
- Loading branch information
Showing
12 changed files
with
659 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
VisionFive | ||
============ | ||
|
||
The VisionFive is based on the StarFive JH71x0 system on a chip family, which | ||
includes an U74 Dual-Core RISC-V processor and ships with 2/4/8 gigabytes of RAM. | ||
|
||
Revision Support | ||
---------------- | ||
|
||
VisionFive (JH7100) and VisionFive 2 (JH7110). | ||
|
||
Interface notes | ||
--------------- | ||
|
||
PWM is currently not supported. | ||
|
||
Pin Mapping | ||
----------- | ||
|
||
The pin mapping refers to the VisionFive model: | ||
|
||
| MRAA Number | Physical Pin | Function | | ||
|-------------|--------------|----------| | ||
| 1 | P1-01 | 3V3 VCC | | ||
| 2 | P1-02 | 5V VCC | | ||
| 3 | P1-03 | I2C SDA | | ||
| 4 | P1-04 | 5V VCC | | ||
| 5 | P1-05 | I2C SCL | | ||
| 6 | P1-06 | GND | | ||
| 7 | P1-07 | GPIO(46) | | ||
| 8 | P1-08 | UART TX | | ||
| 9 | P1-09 | GND | | ||
| 10 | P1-10 | UART RX | | ||
| 11 | P1-11 | GPIO(44) | | ||
| 12 | P1-12 | GPIO(45) | | ||
| 13 | P1-13 | GPIO(22) | | ||
| 14 | P1-14 | GND | | ||
| 15 | P1-15 | GPIO(20) | | ||
| 16 | P1-16 | GPIO(21) | | ||
| 17 | P1-17 | 3V3 VCC | | ||
| 18 | P1-18 | GPIO(19) | | ||
| 19 | P1-19 | SPI MOSI | | ||
| 20 | P1-20 | GND | | ||
| 21 | P1-21 | SPI MISO | | ||
| 22 | P1-22 | GPIO(17) | | ||
| 23 | P1-23 | SPI SCL | | ||
| 24 | P1-24 | SPI CS0 | | ||
| 25 | P1-25 | GND | | ||
| 26 | P1-26 | SPI CS1 | | ||
| 27 | P1-27 | GPIO(9) | | ||
| 28 | P1-28 | GPIO(10) | | ||
| 29 | P1-29 | GPIO(8) | | ||
| 30 | P1-30 | GND | | ||
| 31 | P1-31 | GPIO(6) | | ||
| 32 | P1-32 | PWM0 | | ||
| 33 | P1-33 | PWM1 | | ||
| 34 | P1-34 | GND | | ||
| 35 | P1-35 | GPIO(3) | | ||
| 36 | P1-36 | GPIO(4) | | ||
| 37 | P1-37 | GPIO(1) | | ||
| 38 | P1-38 | GPIO(2) | | ||
| 39 | P1-39 | GND | | ||
| 40 | P1-40 | GPIO(0) | | ||
|
||
The following pin mapping refers to the VisionFive 2 model: | ||
|
||
| MRAA Number | Physical Pin | Function | | ||
|-------------|--------------|----------| | ||
| 1 | P1-01 | 3V3 VCC | | ||
| 2 | P1-02 | 5V VCC | | ||
| 3 | P1-03 | I2C SDA | | ||
| 4 | P1-04 | 5V VCC | | ||
| 5 | P1-05 | I2C SCL | | ||
| 6 | P1-06 | GND | | ||
| 7 | P1-07 | GPIO(55) | | ||
| 8 | P1-08 | UART TX | | ||
| 9 | P1-09 | GND | | ||
| 10 | P1-10 | UART RX | | ||
| 11 | P1-11 | GPIO(42) | | ||
| 12 | P1-12 | GPIO(38) | | ||
| 13 | P1-13 | GPIO(43) | | ||
| 14 | P1-14 | GND | | ||
| 15 | P1-15 | GPIO(47) | | ||
| 16 | P1-16 | GPIO(54) | | ||
| 17 | P1-17 | 3V3 VCC | | ||
| 18 | P1-18 | GPIO(51) | | ||
| 19 | P1-19 | SPI MOSI | | ||
| 20 | P1-20 | GND | | ||
| 21 | P1-21 | SPI MISO | | ||
| 22 | P1-22 | GPIO(50) | | ||
| 23 | P1-23 | SPI SCL | | ||
| 24 | P1-24 | SPI CS0 | | ||
| 25 | P1-25 | GND | | ||
| 26 | P1-26 | GPIO(56) | | ||
| 27 | P1-27 | GPIO(45) | | ||
| 28 | P1-28 | GPIO(40) | | ||
| 29 | P1-29 | GPIO(37) | | ||
| 30 | P1-30 | GND | | ||
| 31 | P1-31 | GPIO(39) | | ||
| 32 | P1-32 | PWM0 | | ||
| 33 | P1-33 | PWM1 | | ||
| 34 | P1-34 | GND | | ||
| 35 | P1-35 | GPIO(63) | | ||
| 36 | P1-36 | GPIO(36) | | ||
| 37 | P1-37 | GPIO(60) | | ||
| 38 | P1-38 | GPIO(61) | | ||
| 39 | P1-39 | GND | | ||
| 40 | P1-40 | GPIO(44) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* Author: Daniel Bovensiepen <oss@bovi.li> | ||
* Author: Zhu Jia Xing <jiaxing.zhu@siemens.com> | ||
* Copyright (c) 2022 Siemens Ltd. China. | ||
* | ||
* SPDX-License-Identifier: MIT | ||
*/ | ||
|
||
#pragma once | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
#include "mraa_internal.h" | ||
|
||
#define MRAA_VISIONFIVE_PINCOUNT 41 | ||
|
||
mraa_board_t * | ||
mraa_visionfive(); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
message (INFO " - Adding RISC-V platforms") | ||
set (mraa_LIB_PLAT_SRCS_NOAUTO ${mraa_LIB_SRCS_NOAUTO} | ||
${mraa_LIB_RISCV_SRCS_NOAUTO} PARENT_SCOPE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Author: Daniel Bovensiepen <oss@bovi.li> | ||
* Author: Zhu Jia Xing <jiaxing.zhu@siemens.com> | ||
* Copyright (c) 2022 Siemens Ltd. China. | ||
* | ||
* SPDX-License-Identifier: MIT | ||
*/ | ||
|
||
#include <stdlib.h> | ||
#include <string.h> | ||
|
||
#include "riscv/visionfive.h" | ||
#include "mraa_internal.h" | ||
|
||
mraa_platform_t | ||
mraa_riscv_platform() | ||
{ | ||
mraa_platform_t platform_type = MRAA_UNKNOWN_PLATFORM; | ||
if (mraa_file_contains("/proc/device-tree/compatible", "visionfive")) { | ||
platform_type = MRAA_VISIONFIVE; | ||
} | ||
|
||
switch (platform_type) { | ||
case MRAA_VISIONFIVE: | ||
plat = mraa_visionfive(); | ||
break; | ||
|
||
default: | ||
plat = NULL; | ||
syslog(LOG_ERR, "Unknown Platform, currently not supported by MRAA"); | ||
} | ||
return platform_type; | ||
} |
Oops, something went wrong.