其实这个和dtsi代码差不都,只是根据不同的板子会在增加删减一些东西
/dts-v1/;
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/pinctrl/rockchip.h>
#include "tab07-rk66-qls-cnt-core.dtsi"
#include "tab07-rk66-qls-cnt.dtsi"
#include "tab07-rk66-qls-cnt-android.dtsi"
#include "dt-bindings/display/media-bus-format.h"
/ {
/*对根节点的模块的说明,板级这些*/
model = "Rockchip RK3566 VT-TAB07-RK66-QLS-CNT Board";
/*就是两个字符串集,用于匹配对应的驱动的和设备,只不过换成了根节点*/
compatible = "rockchip,tab07-rk66-qls-cnt", "rockchip,rk3566";
/*新的子节点*/
mini_ctl {
/*mini_ctl子节点的用于匹配驱动和设备的名字*/
compatible = "Pine,mini_control";
/*对应的gpio*/
gpios = <&gpio3 RK_PB1 GPIO_ACTIVE_HIGH>,
<&gpio3 RK_PC4 GPIO_ACTIVE_LOW>,
<&gpio3 RK_PB5 GPIO_ACTIVE_HIGH>,
<&gpio0 RK_PD0 GPIO_ACTIVE_LOW>,
<&gpio0 RK_PD1 GPIO_ACTIVE_HIGH>,
<&gpio2 RK_PA7 GPIO_ACTIVE_HIGH>;
<&gpio3 RK_PB4 GPIO_ACTIVE_HIGH>;
};
zwave_ctl {
compatible = "Pine,qls_cnt_zwave";
/*配置gpio的状态,拉高或者拉低*/
gpios = <&gpio3 RK_PB6 GPIO_ACTIVE_HIGH>;
pinctrl-names = "default";
/*pinctrl子系统配置gpio的模式,类似上拉下拉浮空这种*/
pinctrl-0 = <&gpio3_b6>;
};
/*类似。。*/
lte_eg9x_ctl {
compatible = "Pine,qls_cnt_lte_eg9x";
lte-dtr = <&gpio3 RK_PA7 GPIO_ACTIVE_HIGH>;
lte-vbus = <&gpio3 RK_PA4 GPIO_ACTIVE_HIGH>;
lte-pwren = <&gpio3 RK_PA6 GPIO_ACTIVE_HIGH>;
lte-pwrkey = <&gpio3 RK_PA5 GPIO_ACTIVE_HIGH>;
lte-reset = <&gpio4 RK_PC4 GPIO_ACTIVE_LOW>;
lte-ri = <&gpio3 RK_PB0 GPIO_ACTIVE_LOW>;
pinctrl-names = "default";
pinctrl-0 = <&gpio3_a7 &gpio3_a4 &gpio3_a6 &gpio3_a5 &gpio3_b0 &gpio4_c4>;
};
wd_tpl5010 {
compatible = "wd-tpl5010";
pinctrl-names = "default";
pinctrl-0 = <&gpio4_b6>;
tpl-wake = <&gpio0 RK_PA5 GPIO_ACTIVE_LOW>;
tpl-done = <&gpio3 RK_PC5 GPIO_ACTIVE_HIGH>;
};
misc_control {
compatible="rk68-qls-cnt,misc";
pinctrl-names = "default";
pinctrl-0 = <&gpio4_c6 &gpio4_d1 &gpio1_d7 &gpio1_d6 &gpio3_b7 &gpio3_a1 &gpio4_a6 &gpio0_c5 &gpio3_c1 &gpio1_d5>;
tamper1-switch = <&gpio4 RK_PC6 GPIO_ACTIVE_HIGH>;
tamper2-switch = <&gpio4 RK_PD1 GPIO_ACTIVE_HIGH>;
green-led = <&gpio1 RK_PD7 GPIO_ACTIVE_HIGH>;
red-led = <&gpio1 RK_PD6 GPIO_ACTIVE_HIGH>;
buzzer-en = <&gpio3 RK_PA1 GPIO_ACTIVE_HIGH>;
camera-pwren = <&gpio4 RK_PA6 GPIO_ACTIVE_HIGH>;
pwrg-pwren = <&gpio3 RK_PB7 GPIO_ACTIVE_HIGH>;
pwrg-int = <&gpio0 RK_PC5 GPIO_ACTIVE_HIGH>;
pwrg-rst = <&gpio3 RK_PC1 GPIO_ACTIVE_HIGH>;
eeprom-wp = <&gpio1 RK_PD5 GPIO_ACTIVE_HIGH>;
};
vcc_camera: vcc-camera-regulator {
compatible = "regulator-fixed";
pinctrl-names = "default";
pinctrl-0 = <&camera_pwr>;
regulator-name = "vcc_camera";
enable-active-high;
regulator-always-on;
regulator-boot-on;
};
/*这种代码可以在相关的手册上查看说明,应该有对应的panel的说明,因为这些参数是厂商已经设定好的*/
panel {
compatible = "simple-panel";
backlight = <&backlight>;
reset-gpios = <&gpio0 RK_PC2 GPIO_ACTIVE_HIGH>;
power-gpios = <&gpio0 RK_PC7 GPIO_ACTIVE_HIGH>;
enable-delay-ms = <120>; /*old delay 20*/
prepare-delay-ms = <120>; /*old delay 20*/
unprepare-delay-ms = <120>; /*old delay 20*/
disable-delay-ms = <120>; /*old delay 20*/
bus-format = <MEDIA_BUS_FMT_RBG888_1X24>;
width-mm = <217>;
height-mm = <136>;
/*找手册查看*/
display-timings {
native-mode = <&timing0>;
timing0: timing0 {
clock-frequency = <60000000>;
hactive = <1024>;
vactive = <600>;
hback-porch = <90>;
hfront-porch = <160>;
vback-porch = <13>;
vfront-porch = <12>;
hsync-len = <70>;
vsync-len = <10>;
hsync-active = <0>;
vsync-active = <0>;
de-active = <0>;
pixelclk-active = <0>;
};
};
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
dual-lvds-even-pixels;
panel_in_lvds: endpoint {
remote-endpoint = <&lvds_out_panel>;
};
};
};
};
};
&i2c0 {
status = "okay";
/*这里说明eeprom是挂载在i2c0这个总线上的一个节点,节点地址是 0x50 */
eeprom@50 {
//compatible = "24c01";
compatible = "24c64";
reg = <0x50>;
// pagesize = <1>;
pagesize = <32>;
};
};
&i2c1 {
status = "okay";
/*节点挂载在i2c1总线上,地址是0x40*/
gslX680_tp@40 {
compatible = "gsl3670";
reg = <0x40>;
touch-gpio = <&gpio0 RK_PB5 IRQ_TYPE_LEVEL_LOW>;
reset-gpio = <&gpio0 RK_PB6 GPIO_ACTIVE_LOW>;
screen_max_x = <800>;
screen_max_y = <480>;
};
gt9xx: gt9xx@5d {
compatible = "goodix,gt9xx";
reg = <0x5d>;
goodix,irq-gpio = <&gpio0 RK_PB5 IRQ_TYPE_LEVEL_LOW>;
goodix,rst-gpio = <&gpio0 RK_PB6 GPIO_ACTIVE_LOW>;
goodix,cfg-group0 = [
00 00 04 58 02 05 3D 00 01 08
28 0F 50 32 03 05 00 00 00 00
00 00 04 17 19 1C 14 87 28 0A
2B 29 31 0D 00 00 00 DB 03 1D
00 01 00 00 00 03 00 00 00 00
00 1E 64 94 C5 02 07 19 00 04
8F 22 00 7C 2B 00 6E 37 00 65
46 00 60 59 00 60 00 00 00 00
00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00
00 00 02 04 06 08 0A 0C 0E 10
12 14 FF FF FF FF 00 00 00 00
00 00 00 00 00 00 00 00 00 00
00 00 26 24 22 21 20 1F 1E 1D
0C 0A 08 06 04 02 00 FF FF FF
FF FF FF FF FF FF FF FF 00 00
00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 96 01 ];
goodix,cfg-group2 = [
48 D0 02 00 05 05 75 01 01 0F 24
0F 64 3C 03 05 00 00 00 02 00 00
00 16 19 1C 14 8C 0E 0E 24 00 31
0D 00 00 00 83 33 1D 00 41 00 00
3C 0A 14 08 0A 00 2B 1C 3C 94 D5
03 08 00 00 04 93 1E 00 82 23 00
74 29 00 69 2F 00 5F 37 00 5F 20
40 60 00 F0 40 30 55 50 27 00 00
00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 14 19 00 00
50 50 02 04 06 08 0A 0C 0E 10 12
14 16 18 1A 1C 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 1D
1E 1F 20 21 22 24 26 28 29 2A 1C
18 16 14 13 12 10 0F 0C 0A 08 06
04 02 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 3C 01];
};
};
&i2c2 {
status = "okay";
pinctrl-0 = <&i2c2m1_xfer>;
};
&i2c4 {
status = "disabled";
gc2145: gc2145@3c {
status = "disabled";
compatible = "galaxycore,gc2145";
reg = <0x3c>;
clocks = <&cru CLK_CIF_OUT>;
clock-names = "xvclk";
power-domains = <&power RK3568_PD_VI>;
pinctrl-names = "default";
pinctrl-0 = <&cif_clk &cif_dvp_clk &cif_dvp_bus16>;
pwdn-gpios = <&gpio4 RK_PA6 GPIO_ACTIVE_HIGH>;
rockchip,camera-module-index = <0>;
rockchip,camera-module-facing = "back";
rockchip,camera-module-name = "CameraKing";
rockchip,camera-module-lens-name = "Largan";
port {
gc2145_out: endpoint {
remote-endpoint = <&dvp_in_bcam>;
};
};
};
};
&video_phy0 {
status = "okay";
};
&lvds {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&gpio0_c0 &gpio0_c2 &gpio0_c7>;
ports {
port@1 {
reg = <1>;
lvds_out_panel: endpoint {
remote-endpoint = <&panel_in_lvds>;
};
};
};
};
&lvds_in_vp1 {
status = "okay";
};
&lvds_in_vp2 {
status = "disabled";
};
&route_lvds {
status = "okay";
connect = <&vp1_out_lvds>;
};
&pinctrl {
cam {
camera_pwr: camera-pwr {
rockchip,pins =
/* camera power en */
<4 RK_PA6 RK_FUNC_GPIO &pcfg_pull_none>;
*/
zwave {
gpio3_b6: gpio3-b6 {
rockchip,pins = <3 RK_PB6 RK_FUNC_GPIO &pcfg_pull_down>;
lte {
gpio3_a7: gpio3-a7 {
rockchip,pins = <3 RK_PA7 RK_FUNC_GPIO &pcfg_pull_none>;
};
gpio3_a4: gpio3-a4 {
rockchip,pins = <3 RK_PA4 RK_FUNC_GPIO &pcfg_pull_none>;
};
gpio3_a6: gpio3-a6 {
rockchip,pins = <3 RK_PA6 RK_FUNC_GPIO &pcfg_pull_none>;
};
gpio3_a5: gpio3-a5 {
rockchip,pins = <3 RK_PA5 RK_FUNC_GPIO &pcfg_pull_none>;
};
gpio3_b0: gpio3-b0 {
rockchip,pins = <3 RK_PB0 RK_FUNC_GPIO &pcfg_pull_none>;
};
gpio4_c4: gpio4-c4 {
rockchip,pins = <4 RK_PC4 RK_FUNC_GPIO &pcfg_pull_none>;
};
};
eeprom {
gpio1_d5: gpio1-d5 {
rockchip,pins = <1 RK_PD5 RK_FUNC_GPIO &pcfg_pull_up>;
};
};
wd {
gpio4_b6: gpio0-d6 {
rockchip,pins = <4 RK_PB6 RK_FUNC_GPIO &pcfg_pull_up>;
};
};
tamp-switch {
gpio4_c6: gpio4-c6 {
rockchip,pins = <4 RK_PC6 RK_FUNC_GPIO &pcfg_pull_up>;
};
gpio4_d1: gpio4-d1 {
rockchip,pins = <4 RK_PD1 RK_FUNC_GPIO &pcfg_pull_up>;
};
};
led {
gpio1_d7: gpio1-d7 {
rockchip,pins = <1 RK_PD7 RK_FUNC_GPIO &pcfg_pull_up>;
};
gpio1_d6: gpio1-d6 {
rockchip,pins = <1 RK_PD6 RK_FUNC_GPIO &pcfg_pull_up>;
};
};
pwrg {
gpio3_b7: gpio3-b7 {
rockchip,pins = <3 RK_PB7 RK_FUNC_GPIO &pcfg_pull_up>;
};
gpio0_c5: gpio0-c5 {
rockchip,pins = <0 RK_PC5 RK_FUNC_GPIO &pcfg_pull_up>;
};
gpio3_c1: gpio3-c1 {
rockchip,pins = <3 RK_PC1 RK_FUNC_GPIO &pcfg_pull_up>;
};
};
buzzer {
gpio3_b5: gpio3-b5 {
rockchip,pins = <3 RK_PB5 RK_FUNC_GPIO &pcfg_pull_up>;
};
gpio3_a1: gpio3-a1 {
rockchip,pins = <3 RK_PA1 RK_FUNC_GPIO &pcfg_pull_up>;
};
};
cam {
gpio4_a6: gpio4-a6 {
rockchip,pins = <4 RK_PA6 RK_FUNC_GPIO &pcfg_pull_up>;
};
};
lcd {
gpio0_c0: gpio0-c0 {
rockchip,pins = <0 RK_PC0 RK_FUNC_GPIO &pcfg_pull_up>;
};
gpio0_c2: gpio0-c2 {
rockchip,pins = <0 RK_PC2 RK_FUNC_GPIO &pcfg_pull_up>;
};
gpio0_c7: gpio0-c7 {
rockchip,pins = <0 RK_PC7 RK_FUNC_GPIO &pcfg_pull_up>;
};
};
sdio-pwrseq {
wifi_enable_h: wifi-enable-h {
rockchip,pins = <2 RK_PB1 RK_FUNC_GPIO &pcfg_pull_none>;
};
};
wireless-wlan {
wifi_host_wake_irq: wifi-host-wake-irq {
rockchip,pins = <0 RK_PC4 RK_FUNC_GPIO &pcfg_pull_down>;
};
};
wireless-bluetooth {
uart1_gpios: uart1-gpios {
rockchip,pins = <2 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>;
};
};
};
&rkcif {
status = "okay";
};
&rkcif_dvp {
status = "disabled";
port {
/* Parallel bus endpoint */
dvp_in_bcam: endpoint {
remote-endpoint = <&gc2145_out>;
bus-width = <8>;
vsync-active = <0>;
hsync-active = <1>;
};
};
};
&rkcif_mmu {
status = "okay";
};
&rkisp {
status = "okay";
};
&rkisp_mmu {
status = "okay";
};
&sdmmc1 {
max-frequency = <150000000>;
supports-sdio;
bus-width = <4>;
disable-wp;
cap-sd-highspeed;
cap-sdio-irq;
keep-power-in-suspend;
mmc-pwrseq = <&sdio_pwrseq>;
non-removable;
pinctrl-names = "default";
pinctrl-0 = <&sdmmc1_bus4 &sdmmc1_cmd &sdmmc1_clk>;
sd-uhs-sdr104;
status = "okay";
};
&uart1 {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&uart1m0_xfer &uart1m0_ctsn>;
};
&wireless_wlan {
pinctrl-names = "default";
pinctrl-0 = <&wifi_host_wake_irq>;
WIFI,host_wake_irq = <&gpio0 RK_PC4 GPIO_ACTIVE_HIGH>;
};