04527412a0527bfe817a6021349a0d20df511ad4
[15.05/openwrt.git] / target / linux / bcm53xx / patches-3.18 / 064-ARM-BCM5301X-add-NAND-flash-chip-description.patch
1 From 9faa5960eef3204cae6637b530f5e23e53b5a9ef Mon Sep 17 00:00:00 2001
2 From: Hauke Mehrtens <hauke@hauke-m.de>
3 Date: Fri, 29 May 2015 23:39:47 +0200
4 Subject: [PATCH] ARM: BCM5301X: add NAND flash chip description
5
6 This adds the NAND flash chip description for a standard chip found
7 connected to this SoC. This makes use of generic Broadcom NAND driver
8 with the iProc interface.
9
10 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
11 Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
12 ---
13  arch/arm/boot/dts/bcm4708-asus-rt-ac56u.dts        |  1 +
14  arch/arm/boot/dts/bcm4708-asus-rt-ac68u.dts        |  1 +
15  arch/arm/boot/dts/bcm4708-buffalo-wzr-1750dhp.dts  |  1 +
16  arch/arm/boot/dts/bcm4708-luxul-xwc-1000.dts       |  9 +++-----
17  arch/arm/boot/dts/bcm4708-netgear-r6250.dts        |  1 +
18  arch/arm/boot/dts/bcm4708-netgear-r6300-v2.dts     |  1 +
19  arch/arm/boot/dts/bcm4708-smartrg-sr400ac.dts      |  1 +
20  arch/arm/boot/dts/bcm47081-asus-rt-n18u.dts        |  1 +
21  arch/arm/boot/dts/bcm47081-buffalo-wzr-600dhp2.dts |  1 +
22  arch/arm/boot/dts/bcm47081-buffalo-wzr-900dhp.dts  |  1 +
23  arch/arm/boot/dts/bcm4709-buffalo-wxr-1900dhp.dts  |  1 +
24  arch/arm/boot/dts/bcm4709-netgear-r8000.dts        |  1 +
25  arch/arm/boot/dts/bcm5301x-nand-cs0-bch8.dtsi      | 24 ++++++++++++++++++++++
26  arch/arm/boot/dts/bcm5301x.dtsi                    | 12 +++++++++++
27  14 files changed, 50 insertions(+), 6 deletions(-)
28  create mode 100644 arch/arm/boot/dts/bcm5301x-nand-cs0-bch8.dtsi
29
30 diff --git a/arch/arm/boot/dts/bcm4708-asus-rt-ac56u.dts b/arch/arm/boot/dts/bcm4708-asus-rt-ac56u.dts
31 index 71cff8d..112a5a8 100644
32 --- a/arch/arm/boot/dts/bcm4708-asus-rt-ac56u.dts
33 +++ b/arch/arm/boot/dts/bcm4708-asus-rt-ac56u.dts
34 @@ -10,6 +10,7 @@
35  /dts-v1/;
36  
37  #include "bcm4708.dtsi"
38 +#include "bcm5301x-nand-cs0-bch8.dtsi"
39  
40  / {
41         compatible = "asus,rt-ac56u", "brcm,bcm4708";
42 diff --git a/arch/arm/boot/dts/bcm4708-asus-rt-ac68u.dts b/arch/arm/boot/dts/bcm4708-asus-rt-ac68u.dts
43 index 8b62836..3600f56 100644
44 --- a/arch/arm/boot/dts/bcm4708-asus-rt-ac68u.dts
45 +++ b/arch/arm/boot/dts/bcm4708-asus-rt-ac68u.dts
46 @@ -10,6 +10,7 @@
47  /dts-v1/;
48  
49  #include "bcm4708.dtsi"
50 +#include "bcm5301x-nand-cs0-bch8.dtsi"
51  
52  / {
53         compatible = "asus,rt-ac68u", "brcm,bcm4708";
54 diff --git a/arch/arm/boot/dts/bcm4708-buffalo-wzr-1750dhp.dts b/arch/arm/boot/dts/bcm4708-buffalo-wzr-1750dhp.dts
55 index 78e95c0..24f0ab5 100644
56 --- a/arch/arm/boot/dts/bcm4708-buffalo-wzr-1750dhp.dts
57 +++ b/arch/arm/boot/dts/bcm4708-buffalo-wzr-1750dhp.dts
58 @@ -10,6 +10,7 @@
59  /dts-v1/;
60  
61  #include "bcm4708.dtsi"
62 +#include "bcm5301x-nand-cs0-bch8.dtsi"
63  
64  / {
65         compatible = "buffalo,wzr-1750dhp", "brcm,bcm4708";
66 diff --git a/arch/arm/boot/dts/bcm4708-luxul-xwc-1000.dts b/arch/arm/boot/dts/bcm4708-luxul-xwc-1000.dts
67 index 946c728..f039393 100644
68 --- a/arch/arm/boot/dts/bcm4708-luxul-xwc-1000.dts
69 +++ b/arch/arm/boot/dts/bcm4708-luxul-xwc-1000.dts
70 @@ -10,6 +10,7 @@
71  /dts-v1/;
72  
73  #include "bcm4708.dtsi"
74 +#include "bcm5301x-nand-cs0-bch8.dtsi"
75  
76  / {
77         compatible = "luxul,xwc-1000", "brcm,bcm4708";
78 @@ -23,12 +24,8 @@
79                 reg = <0x00000000 0x08000000>;
80         };
81  
82 -       axi@18000000 {
83 -               nand@28000 {
84 -                       reg = <0x00028000 0x1000>;
85 -                       #address-cells = <1>;
86 -                       #size-cells = <1>;
87 -
88 +       nand: nand@18028000 {
89 +               nandcs@0 {
90                         partition@0 {
91                                 label = "ubi";
92                                 reg = <0x00000000 0x08000000>;
93 diff --git a/arch/arm/boot/dts/bcm4708-netgear-r6250.dts b/arch/arm/boot/dts/bcm4708-netgear-r6250.dts
94 index 2ed9e57..326ce8f 100644
95 --- a/arch/arm/boot/dts/bcm4708-netgear-r6250.dts
96 +++ b/arch/arm/boot/dts/bcm4708-netgear-r6250.dts
97 @@ -10,6 +10,7 @@
98  /dts-v1/;
99  
100  #include "bcm4708.dtsi"
101 +#include "bcm5301x-nand-cs0-bch8.dtsi"
102  
103  / {
104         compatible = "netgear,r6250v1", "brcm,bcm4708";
105 diff --git a/arch/arm/boot/dts/bcm4708-netgear-r6300-v2.dts b/arch/arm/boot/dts/bcm4708-netgear-r6300-v2.dts
106 index 3991042..3a94606 100644
107 --- a/arch/arm/boot/dts/bcm4708-netgear-r6300-v2.dts
108 +++ b/arch/arm/boot/dts/bcm4708-netgear-r6300-v2.dts
109 @@ -10,6 +10,7 @@
110  /dts-v1/;
111  
112  #include "bcm4708.dtsi"
113 +#include "bcm5301x-nand-cs0-bch8.dtsi"
114  
115  / {
116         compatible = "netgear,r6300v2", "brcm,bcm4708";
117 diff --git a/arch/arm/boot/dts/bcm4708-smartrg-sr400ac.dts b/arch/arm/boot/dts/bcm4708-smartrg-sr400ac.dts
118 index 66dfb53..d6a033b 100644
119 --- a/arch/arm/boot/dts/bcm4708-smartrg-sr400ac.dts
120 +++ b/arch/arm/boot/dts/bcm4708-smartrg-sr400ac.dts
121 @@ -10,6 +10,7 @@
122  /dts-v1/;
123  
124  #include "bcm4708.dtsi"
125 +#include "bcm5301x-nand-cs0-bch8.dtsi"
126  
127  / {
128         compatible = "smartrg,sr400ac", "brcm,bcm4708";
129 diff --git a/arch/arm/boot/dts/bcm47081-asus-rt-n18u.dts b/arch/arm/boot/dts/bcm47081-asus-rt-n18u.dts
130 index 0ee85ea..71b98cf 100644
131 --- a/arch/arm/boot/dts/bcm47081-asus-rt-n18u.dts
132 +++ b/arch/arm/boot/dts/bcm47081-asus-rt-n18u.dts
133 @@ -10,6 +10,7 @@
134  /dts-v1/;
135  
136  #include "bcm47081.dtsi"
137 +#include "bcm5301x-nand-cs0-bch8.dtsi"
138  
139  / {
140         compatible = "asus,rt-n18u", "brcm,bcm47081", "brcm,bcm4708";
141 diff --git a/arch/arm/boot/dts/bcm47081-buffalo-wzr-600dhp2.dts b/arch/arm/boot/dts/bcm47081-buffalo-wzr-600dhp2.dts
142 index db9131e..bb0cb0b 100644
143 --- a/arch/arm/boot/dts/bcm47081-buffalo-wzr-600dhp2.dts
144 +++ b/arch/arm/boot/dts/bcm47081-buffalo-wzr-600dhp2.dts
145 @@ -10,6 +10,7 @@
146  /dts-v1/;
147  
148  #include "bcm47081.dtsi"
149 +#include "bcm5301x-nand-cs0-bch8.dtsi"
150  
151  / {
152         compatible = "buffalo,wzr-600dhp2", "brcm,bcm47081", "brcm,bcm4708";
153 diff --git a/arch/arm/boot/dts/bcm47081-buffalo-wzr-900dhp.dts b/arch/arm/boot/dts/bcm47081-buffalo-wzr-900dhp.dts
154 index 7d6868a..184fd92 100644
155 --- a/arch/arm/boot/dts/bcm47081-buffalo-wzr-900dhp.dts
156 +++ b/arch/arm/boot/dts/bcm47081-buffalo-wzr-900dhp.dts
157 @@ -10,6 +10,7 @@
158  /dts-v1/;
159  
160  #include "bcm47081.dtsi"
161 +#include "bcm5301x-nand-cs0-bch8.dtsi"
162  
163  / {
164         compatible = "buffalo,wzr-900dhp", "brcm,bcm47081", "brcm,bcm4708";
165 diff --git a/arch/arm/boot/dts/bcm4709-buffalo-wxr-1900dhp.dts b/arch/arm/boot/dts/bcm4709-buffalo-wxr-1900dhp.dts
166 index 548e93b..2a92e8d 100644
167 --- a/arch/arm/boot/dts/bcm4709-buffalo-wxr-1900dhp.dts
168 +++ b/arch/arm/boot/dts/bcm4709-buffalo-wxr-1900dhp.dts
169 @@ -10,6 +10,7 @@
170  /dts-v1/;
171  
172  #include "bcm4708.dtsi"
173 +#include "bcm5301x-nand-cs0-bch8.dtsi"
174  
175  / {
176         compatible = "buffalo,wxr-1900dhp", "brcm,bcm4709", "brcm,bcm4708";
177 diff --git a/arch/arm/boot/dts/bcm4709-netgear-r8000.dts b/arch/arm/boot/dts/bcm4709-netgear-r8000.dts
178 index ea26dd3..446c586 100644
179 --- a/arch/arm/boot/dts/bcm4709-netgear-r8000.dts
180 +++ b/arch/arm/boot/dts/bcm4709-netgear-r8000.dts
181 @@ -10,6 +10,7 @@
182  /dts-v1/;
183  
184  #include "bcm4708.dtsi"
185 +#include "bcm5301x-nand-cs0-bch8.dtsi"
186  
187  / {
188         compatible = "netgear,r8000", "brcm,bcm4709", "brcm,bcm4708";
189 diff --git a/arch/arm/boot/dts/bcm5301x-nand-cs0-bch8.dtsi b/arch/arm/boot/dts/bcm5301x-nand-cs0-bch8.dtsi
190 new file mode 100644
191 index 0000000..d10781e
192 --- /dev/null
193 +++ b/arch/arm/boot/dts/bcm5301x-nand-cs0-bch8.dtsi
194 @@ -0,0 +1,24 @@
195 +/*
196 + * Broadcom BCM470X / BCM5301X Nand chip defaults.
197 + *
198 + * This should be included if the NAND controller is on chip select 0
199 + * and uses 8 bit ECC.
200 + *
201 + * Copyright (C) 2015 Hauke Mehrtens <hauke@hauke-m.de>
202 + *
203 + * Licensed under the GNU/GPL. See COPYING for details.
204 + */
205 +
206 +/ {
207 +       nand@18028000 {
208 +               nandcs@0 {
209 +                       compatible = "brcm,nandcs";
210 +                       reg = <0>;
211 +                       #address-cells = <1>;
212 +                       #size-cells = <1>;
213 +
214 +                       nand-ecc-strength = <8>;
215 +                       nand-ecc-step-size = <512>;
216 +               };
217 +       };
218 +};
219 diff --git a/arch/arm/boot/dts/bcm5301x.dtsi b/arch/arm/boot/dts/bcm5301x.dtsi
220 index 78aec62..a97f631 100644
221 --- a/arch/arm/boot/dts/bcm5301x.dtsi
222 +++ b/arch/arm/boot/dts/bcm5301x.dtsi
223 @@ -143,4 +143,16 @@
224                         #gpio-cells = <2>;
225                 };
226         };
227 +
228 +       nand: nand@18028000 {
229 +               compatible = "brcm,nand-iproc", "brcm,brcmnand-v6.1", "brcm,brcmnand";
230 +               reg = <0x18028000 0x600>, <0x1811a408 0x600>, <0x18028f00 0x20>;
231 +               reg-names = "nand", "iproc-idm", "iproc-ext";
232 +               interrupts = <GIC_SPI 68 IRQ_TYPE_LEVEL_HIGH>;
233 +
234 +               #address-cells = <1>;
235 +               #size-cells = <0>;
236 +
237 +               brcm,nand-has-wp;
238 +       };
239  };
240 -- 
241 1.8.4.5
242