Skip to content

Commit 3a1a5be

Browse files
lsj123lsjlsjRadxaYuntian
authored andcommitted
overlay: allwinner: add cubie a7a/a7z 40pin support
Signed-off-by: SongJun Li <[email protected]>
1 parent d981f81 commit 3a1a5be

File tree

8 files changed

+410
-0
lines changed

8 files changed

+410
-0
lines changed

arch/arm64/boot/dts/allwinner/overlays/Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ dtb-$(CONFIG_ARCH_SUN55IW3) += \
66
sun55iw3p1-uart3.dtbo \
77
sun55iw3p1-usbc0-peripheral.dtbo \
88
sun55iw3p1-usbc0-host.dtbo \
9+
sun60iw2p1-i2s0-2ch.dtbo \
10+
sun60iw2p1-i2s4-2ch.dtbo \
11+
sun60iw2p1-pwm1-2.dtbo \
12+
sun60iw2p1-spi1-spidev.dtbo \
13+
sun60iw2p1-spi3-spidev.dtbo \
14+
sun60iw2p1-twi7.dtbo \
15+
sun60iw2p1-uart4.dtbo \
916
cubie-a5e-enable-usb3.dtbo \
1017
cubie-a5e-radxa-camera-8m-219.dtbo \
1118
cubie-a5e-radxa-display-8hd.dtbo \
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
/dts-v1/;
2+
/plugin/;
3+
4+
/{
5+
metadata {
6+
title = "Enable I2S0";
7+
compatible = "radxa,cubie-a7z";
8+
category = "misc";
9+
exclusive = "i2s0_plat", "i2s0_mach", "PB4", "PB5", "PB6", "PB8", "PB7";
10+
description = "Enable I2S0 2-channel dummy sound card.
11+
This overlay is only for demonstration purpose.
12+
It does not support any specific hardware device.";
13+
};
14+
};
15+
16+
&pio {
17+
/* i2s0 pins */
18+
i2s0_pins_a: i2s0@0 {
19+
pins = "PB4";
20+
function = "i2s0_mclk";
21+
allwinner,drive = <1>;
22+
bias-disable;
23+
};
24+
25+
i2s0_pins_b: i2s0@1 {
26+
pins = "PB5";
27+
function = "i2s0_bclk";
28+
allwinner,drive = <1>;
29+
bias-disable;
30+
};
31+
32+
i2s0_pins_c: i2s0@2 {
33+
pins = "PB6";
34+
function = "i2s0_lrck";
35+
allwinner,drive = <1>;
36+
bias-disable;
37+
};
38+
39+
i2s0_pins_d: i2s0@3 {
40+
pins = "PB8";
41+
function = "i2s0_din0";
42+
allwinner,drive = <1>;
43+
bias-pull-down;
44+
};
45+
46+
i2s0_pins_e: i2s0@4 {
47+
pins = "PB7";
48+
function = "i2s0_dout0";
49+
allwinner,drive = <1>;
50+
bias-pull-down;
51+
};
52+
53+
i2s0_pins_f: i2s0@5 {
54+
pins = "PB4", "PB5", "PB6", "PB8", "PB7";
55+
function = "io_disabled";
56+
allwinner,drive = <1>;
57+
bias-disable;
58+
};
59+
};
60+
61+
&i2s0_plat {
62+
tdm-num = <0>;
63+
tx-pin = <0>;
64+
rx-pin = <0>;
65+
66+
tx-hub-en;
67+
rx-sync-en;
68+
69+
pinctrl-used;
70+
pinctrl-names = "default","sleep";
71+
pinctrl-0 = <&i2s0_pins_a &i2s0_pins_b &i2s0_pins_c &i2s0_pins_d &i2s0_pins_e>;
72+
pinctrl-1 = <&i2s0_pins_f>;
73+
74+
status = "okay";
75+
};
76+
77+
&i2s0_mach {
78+
soundcard-mach,format = "i2s";
79+
soundcard-mach,frame-master = <&i2s0_cpu>;
80+
soundcard-mach,bitclock-master = <&i2s0_cpu>;
81+
/* soundcard-mach,frame-inversion; */
82+
/* soundcard-mach,bitclock-inversion; */
83+
soundcard-mach,slot-num = <2>;
84+
soundcard-mach,slot-width = <32>;
85+
status = "okay";
86+
i2s0_cpu: soundcard-mach,cpu {
87+
sound-dai = <&i2s0_plat>;
88+
soundcard-mach,pll-fs = <1>;
89+
soundcard-mach,mclk-fs = <0>;
90+
};
91+
i2s0_codec: soundcard-mach,codec {
92+
};
93+
};
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
/dts-v1/;
2+
/plugin/;
3+
4+
/{
5+
metadata {
6+
title = "Enable I2S4";
7+
compatible = "radxa,cubie-a7a";
8+
category = "misc";
9+
exclusive = "i2s4_plat", "i2s4_mach", "PK1", "PK0", "PK2", "PK3", "PK4";
10+
description = "Enable I2S4 2-channel dummy sound card.
11+
This overlay is only for demonstration purpose.
12+
It does not support any specific hardware device.";
13+
};
14+
};
15+
16+
&pio {
17+
/* i2s4 pins */
18+
i2s4_pins_a: i2s4@0 {
19+
pins = "PK1";
20+
function = "i2s4_mclk";
21+
allwinner,drive = <1>;
22+
bias-disable;
23+
};
24+
25+
i2s4_pins_b: i2s4@1 {
26+
pins = "PK0";
27+
function = "i2s4_bclk";
28+
allwinner,drive = <1>;
29+
bias-disable;
30+
};
31+
32+
i2s4_pins_c: i2s4@2 {
33+
pins = "PK2";
34+
function = "i2s4_lrck";
35+
allwinner,drive = <1>;
36+
bias-disable;
37+
};
38+
39+
i2s4_pins_d: i2s4@3 {
40+
pins = "PK3";
41+
function = "i2s4_din0";
42+
allwinner,drive = <1>;
43+
bias-pull-down;
44+
};
45+
46+
i2s4_pins_e: i2s4@4 {
47+
pins = "PK4";
48+
function = "i2s4_dout0";
49+
allwinner,drive = <1>;
50+
bias-pull-down;
51+
};
52+
53+
i2s4_pins_f: i2s4@5 {
54+
pins = "PK1", "PK0", "PK2", "PK3", "PK4";
55+
function = "io_disabled";
56+
allwinner,drive = <1>;
57+
bias-disable;
58+
};
59+
};
60+
61+
&i2s4_plat {
62+
tdm-num = <4>;
63+
tx-pin = <0>;
64+
rx-pin = <0>;
65+
66+
tx-hub-en;
67+
rx-sync-en;
68+
69+
pinctrl-used;
70+
pinctrl-names = "default","sleep";
71+
pinctrl-0 = <&i2s4_pins_a &i2s4_pins_b &i2s4_pins_c &i2s4_pins_d &i2s4_pins_e>;
72+
pinctrl-1 = <&i2s4_pins_f>;
73+
74+
status = "okay";
75+
};
76+
77+
&i2s4_mach {
78+
soundcard-mach,format = "i2s";
79+
soundcard-mach,frame-master = <&i2s4_cpu>;
80+
soundcard-mach,bitclock-master = <&i2s4_cpu>;
81+
/* soundcard-mach,frame-inversion; */
82+
/* soundcard-mach,bitclock-inversion; */
83+
soundcard-mach,slot-num = <2>;
84+
soundcard-mach,slot-width = <32>;
85+
status = "okay";
86+
i2s4_cpu: soundcard-mach,cpu {
87+
sound-dai = <&i2s4_plat>;
88+
soundcard-mach,pll-fs = <1>;
89+
soundcard-mach,mclk-fs = <0>;
90+
};
91+
i2s4_codec: soundcard-mach,codec {
92+
};
93+
};
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/dts-v1/;
2+
/plugin/;
3+
4+
/ {
5+
metadata {
6+
title = "Enable PWM1-2";
7+
compatible = "radxa,cubie-a7a", "radxa,cubie-a7z";
8+
category = "misc";
9+
exclusive = "PD12";
10+
description = "Enable PWM1-2.
11+
On Radxa Cubie A7A this is pin 19.
12+
On Radxa Cubie A7Z this is pin 19.
13+
";
14+
};
15+
};
16+
17+
&pio {
18+
pwm1_2_pins_active: pwm1@0 {
19+
pins = "PD12";
20+
function = "pwm1_2";
21+
drive-strength = <10>;
22+
};
23+
24+
pwm1_2_pins_sleep: pwm1@1 {
25+
pins = "PD12";
26+
function = "gpio_in";
27+
bias-pull-down;
28+
};
29+
};
30+
31+
&pwm1_2 {
32+
pinctrl-names = "active", "sleep";
33+
pinctrl-0 = <&pwm1_2_pins_active>;
34+
pinctrl-1 = <&pwm1_2_pins_sleep>;
35+
status = "okay";
36+
};
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/dts-v1/;
2+
/plugin/;
3+
#include <dt-bindings/spi/sunxi-spi.h>
4+
5+
/{
6+
metadata {
7+
title = "Enable spidev on SPI1";
8+
compatible = "radxa,cubie-a7z";
9+
category = "misc";
10+
exclusive = "spi1", "PD11", "PD12", "PD13", "PD10";
11+
description = "Enable spidev on SPI1 on pin 23, 19, 21 & 24.";
12+
};
13+
};
14+
15+
&pio {
16+
spi1_pins_default: spi1@0 {
17+
pins = "PD11", "PD12", "PD13";
18+
function = "spi1";
19+
drive-strength = <10>;
20+
};
21+
22+
spi1_pins_cs: spi1@1 {
23+
pins = "PD10";
24+
function = "spi1";
25+
drive-strength = <10>;
26+
bias-pull-up; /* cs, hold, wp should be pulled up */
27+
};
28+
29+
spi1_pins_sleep: spi1@2 {
30+
pins = "PD11", "PD12", "PD13", "PD10";
31+
function = "gpio_in";
32+
drive-strength = <10>;
33+
};
34+
};
35+
36+
&spi1 {
37+
clock-frequency = <50000000>;
38+
pinctrl-0 = <&spi1_pins_default &spi1_pins_cs>;
39+
pinctrl-1 = <&spi1_pins_sleep>;
40+
pinctrl-names = "default", "sleep";
41+
sunxi,spi-bus-mode = <SUNXI_SPI_BUS_MASTER>;
42+
sunxi,spi-cs-mode = <SUNXI_SPI_CS_AUTO>;
43+
status = "okay";
44+
45+
spidev0 {
46+
compatible = "rohm,dh2228fv";
47+
reg = <0x0>;
48+
spi-max-frequency = <100000000>;
49+
spi-rx-bus-width = <1>;
50+
spi-tx-bus-width = <1>;
51+
status = "okay";
52+
};
53+
};
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/dts-v1/;
2+
/plugin/;
3+
#include <dt-bindings/spi/sunxi-spi.h>
4+
5+
/{
6+
metadata {
7+
title = "Enable spidev on SPI3";
8+
compatible = "radxa,cubie-a7a";
9+
category = "misc";
10+
exclusive = "spi3", "PK5", "PK6", "PK7", "PK8";
11+
description = "Enable spidev on SPI3 on pin 29, 31, 33 & 37.";
12+
};
13+
};
14+
15+
&pio {
16+
spi3_pins_default: spi3@0 {
17+
pins = "PK5", "PK6", "PK7";
18+
function = "spi3";
19+
drive-strength = <10>;
20+
};
21+
22+
spi3_pins_cs: spi3@1 {
23+
pins = "PK8";
24+
function = "spi3";
25+
drive-strength = <10>;
26+
bias-pull-up; /* cs, hold, wp should be pulled up */
27+
};
28+
29+
spi3_pins_sleep: spi3@2 {
30+
pins = "PK5", "PK6", "PK7", "PK8";
31+
function = "gpio_in";
32+
drive-strength = <10>;
33+
};
34+
};
35+
36+
&spi3 {
37+
clock-frequency = <50000000>;
38+
pinctrl-0 = <&spi3_pins_default &spi3_pins_cs>;
39+
pinctrl-1 = <&spi3_pins_sleep>;
40+
pinctrl-names = "default", "sleep";
41+
sunxi,spi-bus-mode = <SUNXI_SPI_BUS_MASTER>;
42+
sunxi,spi-cs-mode = <SUNXI_SPI_CS_AUTO>;
43+
status = "okay";
44+
45+
spidev0 {
46+
compatible = "rohm,dh2228fv";
47+
reg = <0x0>;
48+
spi-max-frequency = <100000000>;
49+
spi-rx-bus-width = <1>;
50+
spi-tx-bus-width = <1>;
51+
status = "okay";
52+
};
53+
};
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/dts-v1/;
2+
/plugin/;
3+
4+
/ {
5+
metadata {
6+
title = "Enable TWI7";
7+
compatible = "radxa,cubie-a7a", "radxa,cubie-a7z";
8+
category = "misc";
9+
exclusive = "twi7", "PJ22", "PJ23";
10+
description = "Enable TWI7.
11+
On Radxa Cubie A7A this is SDA pin 3 & SCL pin 5.
12+
On Radxa Cubie A7Z this is SDA pin 3 & SCL pin 5.
13+
";
14+
};
15+
};
16+
17+
&pio {
18+
twi7_pins_default: twi7@0 {
19+
pins = "PJ22", "PJ23";
20+
function = "twi7";
21+
drive-strength = <10>;
22+
bias-pull-up;
23+
};
24+
25+
twi7_pins_sleep: twi7@1 {
26+
pins = "PJ22", "PJ23";
27+
function = "gpio_in";
28+
};
29+
};
30+
31+
&twi7 {
32+
clock-frequency = <400000>;
33+
pinctrl-0 = <&twi7_pins_default>;
34+
pinctrl-1 = <&twi7_pins_sleep>;
35+
pinctrl-names = "default", "sleep";
36+
/* For stability and backwards compatibility, we recommend setting ‘twi_drv_used’ to 1 */
37+
twi_drv_used = <1>;
38+
status = "okay";
39+
};

0 commit comments

Comments
 (0)