kernel: bump 4.19 to 4.19.88
[openwrt/openwrt.git] / target / linux / gemini / patches-4.19 / 0008-ARM-dts-Enable-Gemini-flash-access.patch
1 From 928681e6b46cb70317f7721aae8435ea89fcfd80 Mon Sep 17 00:00:00 2001
2 From: Linus Walleij <linus.walleij@linaro.org>
3 Date: Thu, 11 Oct 2018 20:06:23 +0200
4 Subject: [PATCH] ARM: dts: Enable Gemini flash access
5
6 Some Gemini platforms have a parallel NOR flash which conflicts
7 with use cases reusing some of the flash lines (such as CE1)
8 for GPIO.
9
10 Fix this on the D-Link DIR-685 and Itian SQ201 by creating
11 "enabled" and "disabled" states for the flash pin control
12 handle, and rely on the flash handling code to switch this
13 in and out when accessed so these lines can be used
14 for GPIO when flash is not accessed, and enable flash
15 access.
16
17 Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
18 ---
19 arch/arm/boot/dts/gemini-dlink-dir-685.dts | 33 +++++++++++++++-------
20 arch/arm/boot/dts/gemini-sq201.dts | 31 +++++++++++---------
21 2 files changed, 40 insertions(+), 24 deletions(-)
22
23 --- a/arch/arm/boot/dts/gemini-dlink-dir-685.dts
24 +++ b/arch/arm/boot/dts/gemini-dlink-dir-685.dts
25 @@ -64,7 +64,6 @@
26 gpio-sck = <&gpio1 5 GPIO_ACTIVE_HIGH>;
27 gpio-miso = <&gpio1 8 GPIO_ACTIVE_HIGH>;
28 gpio-mosi = <&gpio1 7 GPIO_ACTIVE_HIGH>;
29 - /* Collides with pflash CE1, not so cool */
30 cs-gpios = <&gpio0 20 GPIO_ACTIVE_LOW>;
31 num-chipselects = <1>;
32
33 @@ -253,15 +252,18 @@
34 soc {
35 flash@30000000 {
36 /*
37 - * Flash access is by default disabled, because it
38 - * collides with the Chip Enable signal for the display
39 - * panel, that reuse the parallel flash Chip Select 1
40 - * (CS1). Enabling flash makes graphics stop working.
41 - *
42 - * We might be able to hack around this by letting
43 - * GPIO poke around in the flash controller registers.
44 + * Flash access collides with the Chip Enable signal for
45 + * the display panel, that reuse the parallel flash Chip
46 + * Select 1 (CS1). We switch the pin control state so we
47 + * enable these pins for flash access only when we need
48 + * then, and when disabled they can be used for GPIO which
49 + * is what the display panel needs.
50 */
51 - /* status = "okay"; */
52 + status = "okay";
53 + pinctrl-names = "enabled", "disabled";
54 + pinctrl-0 = <&pflash_default_pins>;
55 + pinctrl-1 = <&pflash_disabled_pins>;
56 +
57 /* 32MB of flash */
58 reg = <0x30000000 0x02000000>;
59
60 @@ -327,7 +329,6 @@
61 "gpio0cgrp",
62 "gpio0egrp",
63 "gpio0fgrp",
64 - "gpio0ggrp",
65 "gpio0hgrp";
66 };
67 };
68 @@ -342,6 +343,18 @@
69 groups = "gpio1bgrp";
70 };
71 };
72 + /*
73 + * These GPIO groups will be mapped in over some
74 + * of the flash pins when the flash is not in
75 + * active use.
76 + */
77 + pflash_disabled_pins: pinctrl-pflash-disabled {
78 + mux {
79 + function = "gpio0";
80 + groups = "gpio0ggrp", "gpio0igrp", "gpio0jgrp",
81 + "gpio0kgrp";
82 + };
83 + };
84 pinctrl-gmii {
85 mux {
86 function = "gmii";
87 --- a/arch/arm/boot/dts/gemini-sq201.dts
88 +++ b/arch/arm/boot/dts/gemini-sq201.dts
89 @@ -41,14 +41,12 @@
90 compatible = "gpio-leds";
91 led-green-info {
92 label = "sq201:green:info";
93 - /* Conflict with parallel flash */
94 gpios = <&gpio0 20 GPIO_ACTIVE_HIGH>;
95 default-state = "on";
96 linux,default-trigger = "heartbeat";
97 };
98 led-green-usb {
99 label = "sq201:green:usb";
100 - /* Conflict with parallel and NAND flash */
101 gpios = <&gpio0 31 GPIO_ACTIVE_HIGH>;
102 default-state = "off";
103 linux,default-trigger = "usb-host";
104 @@ -126,15 +124,10 @@
105
106 soc {
107 flash@30000000 {
108 - /*
109 - * Flash access can be enabled, with the side effect
110 - * of disabling access to GPIO LED on GPIO0[20] which
111 - * reuse one of the parallel flash chip select lines.
112 - * Also the default firmware on the machine has the
113 - * problem that since it uses the flash, the two LEDS
114 - * on the right become numb.
115 - */
116 - /* status = "okay"; */
117 + status = "okay";
118 + pinctrl-names = "enabled", "disabled";
119 + pinctrl-0 = <&pflash_default_pins>;
120 + pinctrl-1 = <&pflash_disabled_pins>;
121 /* 16MB of flash */
122 reg = <0x30000000 0x01000000>;
123
124 @@ -157,9 +150,7 @@
125 mux {
126 function = "gpio0";
127 groups = "gpio0fgrp",
128 - "gpio0ggrp",
129 - "gpio0hgrp",
130 - "gpio0kgrp";
131 + "gpio0hgrp";
132 };
133 };
134 /*
135 @@ -172,6 +163,18 @@
136 groups = "gpio1dgrp";
137 };
138 };
139 + /*
140 + * These GPIO groups will be mapped in over some
141 + * of the flash pins when the flash is not in
142 + * active use.
143 + */
144 + pflash_disabled_pins: pinctrl-pflash-disabled {
145 + mux {
146 + function = "gpio0";
147 + groups = "gpio0ggrp", "gpio0igrp", "gpio0jgrp",
148 + "gpio0kgrp";
149 + };
150 + };
151 pinctrl-gmii {
152 mux {
153 function = "gmii";