Private
Public Access
2
0

rockpi4: add model c support

Signed-off-by: akgnah <1024@setq.me>
This commit is contained in:
akgnah
2020-07-13 18:28:02 +08:00
committed by Propanu
parent da36b7ae84
commit 710106d99f
4 changed files with 26 additions and 30 deletions

View File

@@ -62,7 +62,7 @@ typedef enum {
MRAA_MTK_LINKIT = 17, /**< Mediatek MT7688 based Linkit boards */
MRAA_MTK_OMEGA2 = 18, /**< MT7688 based Onion Omega2 board */
MRAA_IEI_TANK = 19, /**< IEI Tank System*/
MRAA_ROCKPI4 = 20, /**< Radxa ROCK PI 4 Models A/B */
MRAA_ROCKPI4 = 20, /**< Radxa ROCK PI 4 Models A/B/C */
MRAA_ADLINK_IPI = 21, /**< Adlink Industrial PI */
MRAA_ADLINK_LEC_AL = 22, /**< Adlink LEC-AL*/
MRAA_ADLINK_LEC_AL_AI = 23, /**< Adlink LEC-AL*/

View File

@@ -3,7 +3,7 @@ Rock Pi 4 A/B Single Board Computer {#_rockpi}
ROCK Pi 4 is a Rockchip RK3399 based SBC(Single Board Computer) by Radxa. It can run android or some Linux distributions. ROCK Pi 4 features a six core ARM processor, 64bit dual channel 3200Mb/s LPDDR4, up to 4K@60 HDMI, MIPI DSI, MIPI CSI, 3.5mm jack with mic, 802.11 ac WIFI, Bluetooth 5.0, USB Port, GbE LAN, 40-pin color expansion header, RTC. Also, ROCK Pi 4 supports USB PD and QC powering.
ROCK Pi 4 comes in two models, Model A and Model B, each model has 1GB, 2GB or 4GB ram options. for detailed difference of Model A and Model B, please check Specifications.
ROCK Pi 4 comes in three models, Model A and Model B has 1GB, 2GB or 4GB ram options, Model C has 4GB ram only. For detailed difference of three models, please check Specifications.
Board Support
-------------
@@ -52,7 +52,6 @@ PROCK Pi 4 has a 40-pin expansion header. Each pin is distinguished by color.
| | GPIO4_D6 | 37 | 38 | I2S1_SDI | |
| | GND | 39 | 40 | I2S1_SDO | |
Resources
---------

View File

@@ -91,8 +91,7 @@ mraa_arm_platform()
else if (mraa_file_contains("/proc/device-tree/model", "Avnet Ultra96 Rev1"))
platform_type = MRAA_96BOARDS;
else if (mraa_file_contains("/proc/device-tree/model", "ROCK Pi 4") ||
mraa_file_contains("/proc/device-tree/model", "ROCK PI 4A") ||
mraa_file_contains("/proc/device-tree/model", "ROCK PI 4B")
mraa_file_contains("/proc/device-tree/model", "ROCK PI 4")
)
platform_type = MRAA_ROCKPI4;
else if (mraa_file_contains("/proc/device-tree/compatible", "raspberrypi,"))

View File

@@ -17,12 +17,11 @@
#define DT_BASE "/proc/device-tree"
/*
* "Radxa ROCK Pi 4" is the model name on stock 5.x kernels
* "ROCK PI 4A", "ROCK PI 4B" is used on Radxa 4.4 kernel
* "ROCK PI 4A", "ROCK PI 4B" and "ROCK PI 4C" is used on Radxa 4.4 kernel
* so we search for the string below by ignoring case
*/
#define PLATFORM_NAME_ROCK_PI_4 "ROCK Pi 4"
#define PLATFORM_NAME_ROCK_PI_4A "ROCK PI 4A"
#define PLATFORM_NAME_ROCK_PI_4B "ROCK PI 4B"
#define PLATFORM_NAME_ROCK_PI4 "ROCK Pi 4"
#define PLATFORM_NAME_ROCK_PI4_2 "ROCK PI 4"
#define MAX_SIZE 64
const char* rockpi4_serialdev[MRAA_ROCKPI4_UART_COUNT] = { "/dev/ttyS2", "/dev/ttyS4" };
@@ -71,11 +70,10 @@ mraa_rockpi4()
if (mraa_file_exist(DT_BASE "/model")) {
// We are on a modern kernel, great!!!!
if (mraa_file_contains(DT_BASE "/model", PLATFORM_NAME_ROCK_PI_4) ||
mraa_file_contains(DT_BASE "/model", PLATFORM_NAME_ROCK_PI_4A) ||
mraa_file_contains(DT_BASE "/model", PLATFORM_NAME_ROCK_PI_4B)
if (mraa_file_contains(DT_BASE "/model", PLATFORM_NAME_ROCK_PI4) ||
mraa_file_contains(DT_BASE "/model", PLATFORM_NAME_ROCK_PI4_2)
) {
b->platform_name = PLATFORM_NAME_ROCK_PI_4;
b->platform_name = PLATFORM_NAME_ROCK_PI4;
b->uart_dev[0].device_path = (char*) rockpi4_serialdev[0];
b->uart_dev[1].device_path = (char*) rockpi4_serialdev[1];
}
@@ -88,7 +86,7 @@ mraa_rockpi4()
b->uart_dev[1].index = 4;
// I2C
if (strncmp(b->platform_name, PLATFORM_NAME_ROCK_PI_4, MAX_SIZE) == 0) {
if (strncmp(b->platform_name, PLATFORM_NAME_ROCK_PI4, MAX_SIZE) == 0) {
b->i2c_bus_count = MRAA_ROCKPI4_I2C_COUNT;
b->def_i2c_bus = 0;
b->i2c_bus[0].bus_id = 7;