ar71xx: fix splitting firmware partition for TL-WR902AC v1
[openwrt/openwrt.git] / target / linux / bcm53xx / patches-4.14 / 034-v4.20-0001-ARM-dts-BCM5301X-Specify-flash-partitions.patch
1 From b0465fdfdd7e7c1afe2fae1cb36b94e1ce89732e Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
3 Date: Sat, 28 Jul 2018 14:13:57 +0200
4 Subject: [PATCH] ARM: dts: BCM5301X: Specify flash partitions
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 Most devices use Broadcom standard partitions which allows them to be
10 described with the "brcm,bcm947xx-cfe-partitions". Exceptions are:
11 1) TP-LINK devices which use "os-image" partition with TRX containing
12 kernel only + separated rootfs partition.
13 2) Asus RT-AC87U with custom "asus" partition.
14
15 This commit also removes undocumented and unsupported linux,part-probe
16 binding which got accidentally upstreamed while describing SPI
17 controller.
18
19 Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
20 Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
21 ---
22 arch/arm/boot/dts/bcm47081-tplink-archer-c5-v2.dts | 28 +++++++++++++++++++
23 arch/arm/boot/dts/bcm4709-asus-rt-ac87u.dts | 31 ++++++++++++++++++++++
24 arch/arm/boot/dts/bcm4709-tplink-archer-c9-v1.dts | 28 +++++++++++++++++++
25 arch/arm/boot/dts/bcm5301x-nand-cs0.dtsi | 4 +++
26 arch/arm/boot/dts/bcm5301x.dtsi | 5 +++-
27 5 files changed, 95 insertions(+), 1 deletion(-)
28
29 --- a/arch/arm/boot/dts/bcm47081-tplink-archer-c5-v2.dts
30 +++ b/arch/arm/boot/dts/bcm47081-tplink-archer-c5-v2.dts
31 @@ -94,6 +94,34 @@
32
33 &spi_nor {
34 status = "okay";
35 +
36 + partitions {
37 + compatible = "fixed-partitions";
38 + #address-cells = <1>;
39 + #size-cells = <1>;
40 +
41 + boot@0 {
42 + label = "boot";
43 + reg = <0x000000 0x040000>;
44 + read-only;
45 + };
46 +
47 + os-image@100000 {
48 + label = "os-image";
49 + reg = <0x040000 0x200000>;
50 + compatible = "brcm,trx";
51 + };
52 +
53 + rootfs@240000 {
54 + label = "rootfs";
55 + reg = <0x240000 0xc00000>;
56 + };
57 +
58 + nvram@ff0000 {
59 + label = "nvram";
60 + reg = <0xff0000 0x010000>;
61 + };
62 + };
63 };
64
65 &usb2 {
66 --- a/arch/arm/boot/dts/bcm4709-asus-rt-ac87u.dts
67 +++ b/arch/arm/boot/dts/bcm4709-asus-rt-ac87u.dts
68 @@ -66,3 +66,34 @@
69 &usb3_phy {
70 status = "okay";
71 };
72 +
73 +&nandcs {
74 + partitions {
75 + compatible = "fixed-partitions";
76 + #address-cells = <1>;
77 + #size-cells = <1>;
78 +
79 + boot@0 {
80 + label = "boot";
81 + reg = <0x00000000 0x00080000>;
82 + read-only;
83 + };
84 +
85 + nvram@80000 {
86 + label = "nvram";
87 + reg = <0x00080000 0x00180000>;
88 + };
89 +
90 + firmware@200000 {
91 + label = "firmware";
92 + reg = <0x00200000 0x07cc0000>;
93 + compatible = "brcm,trx";
94 + };
95 +
96 + asus@7ec0000 {
97 + label = "asus";
98 + reg = <0x07ec0000 0x00140000>;
99 + read-only;
100 + };
101 + };
102 +};
103 --- a/arch/arm/boot/dts/bcm4709-tplink-archer-c9-v1.dts
104 +++ b/arch/arm/boot/dts/bcm4709-tplink-archer-c9-v1.dts
105 @@ -103,6 +103,34 @@
106
107 &spi_nor {
108 status = "okay";
109 +
110 + partitions {
111 + compatible = "fixed-partitions";
112 + #address-cells = <1>;
113 + #size-cells = <1>;
114 +
115 + boot@0 {
116 + label = "boot";
117 + reg = <0x000000 0x040000>;
118 + read-only;
119 + };
120 +
121 + os-image@100000 {
122 + label = "os-image";
123 + reg = <0x040000 0x200000>;
124 + compatible = "brcm,trx";
125 + };
126 +
127 + rootfs@240000 {
128 + label = "rootfs";
129 + reg = <0x240000 0xc00000>;
130 + };
131 +
132 + nvram@ff0000 {
133 + label = "nvram";
134 + reg = <0xff0000 0x010000>;
135 + };
136 + };
137 };
138
139 &usb3_phy {
140 --- a/arch/arm/boot/dts/bcm5301x-nand-cs0.dtsi
141 +++ b/arch/arm/boot/dts/bcm5301x-nand-cs0.dtsi
142 @@ -12,6 +12,10 @@
143 reg = <0>;
144 #address-cells = <1>;
145 #size-cells = <1>;
146 +
147 + partitions {
148 + compatible = "brcm,bcm947xx-cfe-partitions";
149 + };
150 };
151 };
152 };
153 --- a/arch/arm/boot/dts/bcm5301x.dtsi
154 +++ b/arch/arm/boot/dts/bcm5301x.dtsi
155 @@ -475,8 +475,11 @@
156 compatible = "jedec,spi-nor";
157 reg = <0>;
158 spi-max-frequency = <20000000>;
159 - linux,part-probe = "ofpart", "bcm47xxpart";
160 status = "disabled";
161 +
162 + partitions {
163 + compatible = "brcm,bcm947xx-cfe-partitions";
164 + };
165 };
166 };
167