View difference between Paste ID: 9c4C8nuq and NdAfuxSD
SHOW: | | - or go back to the newest paste.
1-
sudo apt install gcc-arm-linux-gnueabi  # если не установлен ранее
1+
diff --git a/arch/arm/boot/dts/suniv-f1c100s-licheepi-nano.dts b/arch/arm/boot/dts/suniv-f1c100s-licheepi-nano.dts
2-
git clone https://github.com/Lichee-Pi/u-boot.git -b nano-v2018.01
2+
index ca644541a..890a57717 100644
3-
cd u-boot/
3+
--- a/arch/arm/boot/dts/suniv-f1c100s-licheepi-nano.dts
4-
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- licheepi_nano_spiflash_defconfig
4+
+++ b/arch/arm/boot/dts/suniv-f1c100s-licheepi-nano.dts
5-
make ARCH=arm menuconfig                # не обязательно, я там ничего не правил
5+
@@ -20,7 +20,7 @@
6-
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- -j8
6+
 	};
7-
# после успешной сборки записать на карту
7+
 
8-
sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdb bs=1024 seek=8
8+
 	panel: panel {
9
-		compatible = "lg,lb070wv8", "simple-panel";
10
+		compatible = "qiaodian,qd43003c0-40", "simple-panel";
11
 		#address-cells = <1>;
12
 		#size-cells = <0>;
13
 		enable-gpios = <&pio 4 6 GPIO_ACTIVE_HIGH>;
14
@@ -79,3 +79,17 @@
15
 	pinctrl-0 = <&uart0_pe_pins>;
16
 	status = "okay";
17
 };
18
+
19
+&otg_sram {
20
+	status = "okay";
21
+};
22
+
23
+&usb_otg {
24
+	dr_mode = "otg";
25
+	status = "okay";
26
+};
27
+
28
+&usbphy {
29
+	usb0_id_det-gpio = <&pio 4 2 GPIO_ACTIVE_HIGH>; /* PE2 */
30
+	status = "okay";
31
+};
32
diff --git a/arch/arm/boot/dts/suniv-f1c100s.dtsi b/arch/arm/boot/dts/suniv-f1c100s.dtsi
33
index 26d8e5577..437bdf7d9 100644
34
--- a/arch/arm/boot/dts/suniv-f1c100s.dtsi
35
+++ b/arch/arm/boot/dts/suniv-f1c100s.dtsi
36
@@ -221,6 +221,31 @@
37
 			resets = <&ccu RST_BUS_UART2>;
38
 			status = "disabled";
39
 		};
40
+		usb_otg: usb@1c13000 {
41
+			compatible = "allwinner,suniv-musb";
42
+			reg = <0x01c13000 0x0400>;
43
+			clocks = <&ccu CLK_BUS_OTG>;
44
+			resets = <&ccu RST_BUS_OTG>;
45
+			interrupts = <26>;
46
+			interrupt-names = "mc";
47
+			phys = <&usbphy 0>;
48
+			phy-names = "usb";
49
+			extcon = <&usbphy 0>;
50
+			allwinner,sram = <&otg_sram 1>;
51
+			status = "disabled";
52
+		};
53
+
54
+		usbphy: phy@1c13400 {
55
+			compatible = "allwinner,suniv-usb-phy";
56
+			reg = <0x01c13400 0x10>;
57
+			reg-names = "phy_ctrl";
58
+			clocks = <&ccu CLK_USB_PHY0>;
59
+			clock-names = "usb0_phy";
60
+			resets = <&ccu RST_USB_PHY0>;
61
+			reset-names = "usb0_reset";
62
+			#phy-cells = <1>;
63
+			status = "disabled";
64
+		};
65
 		fe0: display-frontend@1e00000 {
66
 			compatible = "allwinner,suniv-f1c100s-display-frontend";
67
 			reg = <0x01e00000 0x20000>;
68
diff --git a/drivers/phy/allwinner/phy-sun4i-usb.c b/drivers/phy/allwinner/phy-sun4i-usb.c
69
index 856927382..3cd9e946a 100644
70
--- a/drivers/phy/allwinner/phy-sun4i-usb.c
71
+++ b/drivers/phy/allwinner/phy-sun4i-usb.c
72
@@ -98,6 +98,7 @@
73
 #define POLL_TIME			msecs_to_jiffies(250)
74
 
75
 enum sun4i_usb_phy_type {
76
+	suniv_phy,
77
 	sun4i_a10_phy,
78
 	sun6i_a31_phy,
79
 	sun8i_a33_phy,
80
@@ -859,6 +860,14 @@ static int sun4i_usb_phy_probe(struct platform_device *pdev)
81
 	return 0;
82
 }
83
 
84
+static const struct sun4i_usb_phy_cfg suniv_cfg = {
85
+	.num_phys = 1,
86
+	.type = suniv_phy,
87
+	.disc_thresh = 3,
88
+	.phyctl_offset = REG_PHYCTL_A10,
89
+	.dedicated_clocks = true,
90
+};
91
+
92
 static const struct sun4i_usb_phy_cfg sun4i_a10_cfg = {
93
 	.num_phys = 3,
94
 	.type = sun4i_a10_phy,
95
@@ -973,6 +982,7 @@ static const struct sun4i_usb_phy_cfg sun50i_h6_cfg = {
96
 };
97
 
98
 static const struct of_device_id sun4i_usb_phy_of_match[] = {
99
+	{ .compatible = "allwinner,suniv-usb-phy", .data = &suniv_cfg },
100
 	{ .compatible = "allwinner,sun4i-a10-usb-phy", .data = &sun4i_a10_cfg },
101
 	{ .compatible = "allwinner,sun5i-a13-usb-phy", .data = &sun5i_a13_cfg },
102
 	{ .compatible = "allwinner,sun6i-a31-usb-phy", .data = &sun6i_a31_cfg },
103
diff --git a/drivers/usb/musb/sunxi.c b/drivers/usb/musb/sunxi.c
104
index 832a41f9e..83f3fa5b0 100644
105
--- a/drivers/usb/musb/sunxi.c
106
+++ b/drivers/usb/musb/sunxi.c
107
@@ -714,14 +714,17 @@ static int sunxi_musb_probe(struct platform_device *pdev)
108
 	INIT_WORK(&glue->work, sunxi_musb_work);
109
 	glue->host_nb.notifier_call = sunxi_musb_host_notifier;
110
 
111
-	if (of_device_is_compatible(np, "allwinner,sun4i-a10-musb"))
112
+	if (of_device_is_compatible(np, "allwinner,sun4i-a10-musb") ||
113
+	    of_device_is_compatible(np, "allwinner,suniv-musb")) {
114
 		set_bit(SUNXI_MUSB_FL_HAS_SRAM, &glue->flags);
115
+	}
116
 
117
 	if (of_device_is_compatible(np, "allwinner,sun6i-a31-musb"))
118
 		set_bit(SUNXI_MUSB_FL_HAS_RESET, &glue->flags);
119
 
120
 	if (of_device_is_compatible(np, "allwinner,sun8i-a33-musb") ||
121
-	    of_device_is_compatible(np, "allwinner,sun8i-h3-musb")) {
122
+	    of_device_is_compatible(np, "allwinner,sun8i-h3-musb") ||
123
+	    of_device_is_compatible(np, "allwinner,suniv-musb")) {
124
 		set_bit(SUNXI_MUSB_FL_HAS_RESET, &glue->flags);
125
 		set_bit(SUNXI_MUSB_FL_NO_CONFIGDATA, &glue->flags);
126
 	}
127
@@ -812,6 +815,7 @@ static int sunxi_musb_remove(struct platform_device *pdev)
128
 }
129
 
130
 static const struct of_device_id sunxi_musb_match[] = {
131
+	{ .compatible = "allwinner,suniv-musb", },
132
 	{ .compatible = "allwinner,sun4i-a10-musb", },
133
 	{ .compatible = "allwinner,sun6i-a31-musb", },
134
 	{ .compatible = "allwinner,sun8i-a33-musb", },