-
Notifications
You must be signed in to change notification settings - Fork 0
platform: add radxa rock 5b+ support #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
0aad4eb
93b2ffd
7a54757
a36ae8d
3dba9bd
8dcb885
c15089e
7a8ead0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| Radxa ROCK 5 Model B {#_Radxa} | ||
| ==================== | ||
| Radxa ROCK 5B & 5B+ {#_Radxa} | ||
| =========================== | ||
|
|
||
| Radxa ROCK 5 Model B is a Rockchip RK3588 based SBC(Single Board Computer) by Radxa. It can run Android or Linux. Radxa ROCK 5 Model B features a four core ARM processor, 64bit dual channel 5500Mb/s LPDDR5, HDMI up to 8K60fps, MIPI DSI, MIPI CSI, 3.5mm combo audio jack, Wi-Fi 6, Bluetooth 5.0, USB, GbE LAN, and 40-pin color expansion header. Radxa ROCK 5 Model B is powered by the USB Type-C port, and supports 5V input only. The recommended power adapter is 5V/3A without SSD, or 5V/5A with SSD. | ||
| Radxa ROCK 5B & 5B+ are Rockchip RK3588 based SBCs (Single Board Computer) made by Radxa. It can run Android or Linux. Radxa ROCK 5B & 5B+ feature a eight core ARM processor, 64bit dual channel 5500Mb/s LPDDR5, HDMI up to 8K60fps, MIPI DSI, MIPI CSI, 3.5mm combo audio jack, USB, ethernet, and 40-pin GPIO header. Radxa ROCK 5B & 5B+ are powered by the USB Type-C port, with 5B+ having 2 power input ports. The recommended power adapter is 5V/3A without SSD, or 5V/5A with SSD. | ||
|
|
||
| Interface notes | ||
| --------------- | ||
|
|
@@ -12,7 +12,7 @@ Interface notes | |
| Pin Mapping | ||
| ----------- | ||
|
|
||
| Radxa ROCK 5 Model B has a 40-pin expansion header. Each pin is distinguished by the color. | ||
| Radxa ROCK 5B & 5B+ has a 40-pin expansion header. Pins are color coded. | ||
|
|
||
| | Function5| Function4| Function3| Function2| Function1| PIN | PIN | Function1| Function2| Function3| Function4| | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 5B+下面不是至少两个引脚都和5B不同么? |
||
| |-----------|-------------|-------------|-------------|-----------|:------|------:|----------|-------------|------------|------------| | ||
|
|
@@ -44,4 +44,4 @@ You can find additional product support in the following channels: | |
|
|
||
| - [Product Info](https://docs.radxa.com/en/rock5/rock5b) | ||
| - [Forums](https://forum.radxa.com/c/rock5) | ||
| - [Github](https://github.com/radxa) | ||
| - [Github](https://github.com/radxa) | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这改了啥? |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -48,9 +48,17 @@ mraa_radxa_rock_5b() | |
| b->no_bus_mux = 1; | ||
| b->phy_pin_count = MRAA_RADXA_ROCK_5B_PIN_COUNT + 1; | ||
|
|
||
| if (mraa_file_contains("/proc/device-tree/model", PLATFORM_NAME_RADXA_ROCK_5B)) { | ||
| b->platform_name = PLATFORM_NAME_RADXA_ROCK_5B; | ||
| } else if (mraa_file_contains("/proc/device-tree/model", PLATFORM_NAME_RADXA_ROCK_5B_PLUS)) { | ||
| b->platform_name = PLATFORM_NAME_RADXA_ROCK_5B_PLUS; | ||
| } else { | ||
| syslog(LOG_ERR, "An unknown product detected. Fail early..."); | ||
| return NULL; | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. free呢?真就同样的问题同样犯? |
||
| } | ||
|
|
||
| // UART | ||
| b->uart_dev_count = MRAA_RADXA_ROCK_5B_UART_COUNT; | ||
| b->platform_name = PLATFORM_NAME_RADXA_ROCK_5B; | ||
| b->def_uart_dev = 0; | ||
| b->uart_dev[0].index = 2; | ||
| b->uart_dev[1].index = 3; | ||
|
|
@@ -60,7 +68,7 @@ mraa_radxa_rock_5b() | |
| b->uart_dev[1].device_path = (char*) radxa_rock_5b_serialdev[1]; | ||
| b->uart_dev[2].device_path = (char*) radxa_rock_5b_serialdev[2]; | ||
| b->uart_dev[3].device_path = (char*) radxa_rock_5b_serialdev[3]; | ||
|
|
||
| // I2C | ||
| b->i2c_bus_count = MRAA_RADXA_ROCK_5B_I2C_COUNT; | ||
| b->def_i2c_bus = 0; | ||
|
|
@@ -108,12 +116,6 @@ mraa_radxa_rock_5b() | |
| b->pins[28].pwm.parent_id = 6; // PWM6_M2 | ||
| b->pins[28].pwm.mux_total = 0; | ||
| b->pins[28].pwm.pinmap = 0; | ||
| b->pins[29].pwm.parent_id = 15; // PWM15_M3 | ||
| b->pins[29].pwm.mux_total = 0; | ||
| b->pins[29].pwm.pinmap = 0; | ||
| b->pins[31].pwm.parent_id = 13; // PWM13_M2 | ||
| b->pins[31].pwm.mux_total = 0; | ||
| b->pins[31].pwm.pinmap = 0; | ||
| b->pins[32].pwm.parent_id = 14; // PWM14_M0 | ||
| b->pins[32].pwm.mux_total = 0; | ||
| b->pins[32].pwm.pinmap = 0; | ||
|
|
@@ -130,6 +132,22 @@ mraa_radxa_rock_5b() | |
| b->pins[38].pwm.mux_total = 0; | ||
| b->pins[38].pwm.pinmap = 0; | ||
|
|
||
| if (mraa_file_contains("/proc/device-tree/model", PLATFORM_NAME_RADXA_ROCK_5B)) { | ||
| b->pins[29].pwm.parent_id = 15; // PWM15_M3 | ||
| b->pins[29].pwm.mux_total = 0; | ||
| b->pins[29].pwm.pinmap = 0; | ||
| b->pins[31].pwm.parent_id = 13; // PWM13_M2 | ||
| b->pins[31].pwm.mux_total = 0; | ||
| b->pins[31].pwm.pinmap = 0; | ||
| } else if (mraa_file_contains("/proc/device-tree/model", PLATFORM_NAME_RADXA_ROCK_5B_PLUS)) { | ||
| b->pins[29].pwm.parent_id = 1; // PWM1_M2 | ||
| b->pins[29].pwm.mux_total = 0; | ||
| b->pins[29].pwm.pinmap = 0; | ||
| b->pins[31].pwm.parent_id = 0; // PWM0_M2 | ||
| b->pins[31].pwm.mux_total = 0; | ||
| b->pins[31].pwm.pinmap = 0; | ||
| } | ||
|
|
||
| b->aio_count = MRAA_RADXA_ROCK_5B_AIO_COUNT; | ||
| b->adc_raw = 10; | ||
| b->adc_supported = 10; | ||
|
|
@@ -152,7 +170,7 @@ mraa_radxa_rock_5b() | |
| mraa_radxa_rock_5b_pininfo(b, 12, 3, 13, (mraa_pincapabilities_t){1,1,1,0,0,0,0,1}, "GPIO3_B5"); | ||
| mraa_radxa_rock_5b_pininfo(b, 13, 3, 15, (mraa_pincapabilities_t){1,1,0,0,1,1,0,0}, "GPIO3_B7"); | ||
| mraa_radxa_rock_5b_pininfo(b, 14, -1, -1, (mraa_pincapabilities_t){1,0,0,0,0,0,0,0}, "GND"); | ||
| mraa_radxa_rock_5b_pininfo(b, 15, 3, 16, (mraa_pincapabilities_t){1,0,0,0,1,1,0,1}, "GPIO3_C0"); | ||
| mraa_radxa_rock_5b_pininfo(b, 15, 3, 16, (mraa_pincapabilities_t){1,1,0,0,1,1,0,1}, "GPIO3_C0"); | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 为啥改 |
||
| mraa_radxa_rock_5b_pininfo(b, 16, 3, 4, (mraa_pincapabilities_t){1,1,0,0,1,0,0,0}, "GPIO3_A4"); | ||
| mraa_radxa_rock_5b_pininfo(b, 17, -1, -1, (mraa_pincapabilities_t){1,0,0,0,0,0,0,0}, "3V3"); | ||
| mraa_radxa_rock_5b_pininfo(b, 18, 4, 20, (mraa_pincapabilities_t){1,1,1,0,1,0,0,0}, "GPIO4_C4"); | ||
|
|
@@ -166,18 +184,25 @@ mraa_radxa_rock_5b() | |
| mraa_radxa_rock_5b_pininfo(b, 26, 1, 13, (mraa_pincapabilities_t){1,1,0,0,1,0,0,1}, "GPIO1_B5"); | ||
| mraa_radxa_rock_5b_pininfo(b, 27, 4, 22, (mraa_pincapabilities_t){1,1,1,0,1,1,0,0}, "GPIO4_C6"); | ||
| mraa_radxa_rock_5b_pininfo(b, 28, 4, 21, (mraa_pincapabilities_t){1,1,1,0,1,1,0,0}, "GPIO4_C5"); | ||
| mraa_radxa_rock_5b_pininfo(b, 29, 1, 31, (mraa_pincapabilities_t){1,1,1,0,0,0,0,0}, "GPIO1_D7"); | ||
| mraa_radxa_rock_5b_pininfo(b, 30, -1, -1, (mraa_pincapabilities_t){1,0,0,0,0,0,0,0}, "GND"); | ||
| mraa_radxa_rock_5b_pininfo(b, 31, 1, 15, (mraa_pincapabilities_t){1,1,1,0,0,0,0,0}, "GPIO1_B7"); | ||
| mraa_radxa_rock_5b_pininfo(b, 32, 3, 18, (mraa_pincapabilities_t){1,1,1,0,1,1,0,1}, "GPIO3_C2"); | ||
| mraa_radxa_rock_5b_pininfo(b, 33, 3, 7, (mraa_pincapabilities_t){1,1,1,0,0,0,0,0}, "GPIO3_A7"); | ||
| mraa_radxa_rock_5b_pininfo(b, 34, -1, -1, (mraa_pincapabilities_t){1,0,0,0,0,0,0,0}, "GND"); | ||
| mraa_radxa_rock_5b_pininfo(b, 35, 3, 14, (mraa_pincapabilities_t){1,1,1,0,0,0,0,1}, "GPIO3_B6"); | ||
| mraa_radxa_rock_5b_pininfo(b, 36, 3, 9, (mraa_pincapabilities_t){1,1,1,0,0,0,0,1}, "GPIO3_B1"); | ||
| mraa_radxa_rock_5b_pininfo(b, 37, -1, -1, (mraa_pincapabilities_t){1,0,0,0,0,0,1,0}, "NC"); | ||
| mraa_radxa_rock_5b_pininfo(b, 36, 3, 9, (mraa_pincapabilities_t){1,1,1,0,0,0,0,1}, "GPIO3_B1"); | ||
| mraa_radxa_rock_5b_pininfo(b, 38, 3, 10, (mraa_pincapabilities_t){1,1,1,0,0,0,0,1}, "GPIO3_B2"); | ||
| mraa_radxa_rock_5b_pininfo(b, 39, -1, -1, (mraa_pincapabilities_t){1,0,0,0,0,0,0,0}, "GND"); | ||
| mraa_radxa_rock_5b_pininfo(b, 40, 3, 11, (mraa_pincapabilities_t){1,1,0,0,0,0,0,0}, "GPIO3_B3"); | ||
|
|
||
| if(b->platform_name == PLATFORM_NAME_RADXA_ROCK_5B) { | ||
| mraa_radxa_rock_5b_pininfo(b, 29, 1, 31, (mraa_pincapabilities_t){1,1,1,0,0,0,0,0}, "GPIO1_D7"); | ||
| mraa_radxa_rock_5b_pininfo(b, 31, 1, 15, (mraa_pincapabilities_t){1,1,1,0,0,0,0,0}, "GPIO1_B7"); | ||
| mraa_radxa_rock_5b_pininfo(b, 37, -1, -1, (mraa_pincapabilities_t){1,0,0,0,0,0,1,0}, "NC"); | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 5B PIN_37 这里 NC 是因为硬件要么没接出来要么是没贴电阻。
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 上面的pinout和我们文档有更新么?我还是第一次知道这个 |
||
| } else if(b->platform_name == PLATFORM_NAME_RADXA_ROCK_5B_PLUS) { | ||
| mraa_radxa_rock_5b_pininfo(b, 29, 1, 3, (mraa_pincapabilities_t){1,1,1,0,0,1,0,0}, "GPIO1_A3"); | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. PIN_29 PWM1-M2, 板级打开了 PWM1-M0 这里关闭 PWM?
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 是风扇共用的pwm控制器么?所以现在是开还是关 |
||
| mraa_radxa_rock_5b_pininfo(b, 31, 1, 2, (mraa_pincapabilities_t){1,1,1,0,0,1,0,0}, "GPIO1_A2"); | ||
| mraa_radxa_rock_5b_pininfo(b, 37, 0, 0, (mraa_pincapabilities_t){1,1,0,0,0,0,1,0}, "GPIO0_A0"); | ||
| } | ||
|
|
||
| return b; | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1052,7 +1052,7 @@ mraa_file_contains(const char* filename, const char* content) | |
| return 0; | ||
| } | ||
| while ((getline(&line, &len, fh) != -1) && (found == 0)) { | ||
| if (strstr(line, content)) { | ||
| if (strncmp(line, content, strlen(line)) == 0) { | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这两个函数干的事情完全不一样啊,怎么能改的? |
||
| found = 1; | ||
| break; | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同一个文件你就这里改链接标题吧