-
Notifications
You must be signed in to change notification settings - Fork 1
/
f7d4401-r36241.patch
322 lines (301 loc) · 10.8 KB
/
f7d4401-r36241.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
Index: target/linux/brcm47xx/image/lzma-loader/src/decompress.c
===================================================================
--- target/linux/brcm47xx/image/lzma-loader/src/decompress.c (revisión: 36240)
+++ target/linux/brcm47xx/image/lzma-loader/src/decompress.c (copia de trabajo)
@@ -78,6 +78,7 @@
}
#define TRX_MAGIC 0x30524448 /* "HDR0" */
+#define TRX_MAGIC_F7D4401 0x00018517 /* "HDR0" */
struct trx_header {
unsigned int magic; /* "HDR0" */
@@ -139,6 +140,7 @@
/* look for trx header, 32-bit data access */
for (data = ((unsigned char *) KSEG1ADDR(BCM4710_FLASH));
((struct trx_header *)data)->magic != TRX_MAGIC &&
+ ((struct trx_header *)data)->magic != TRX_MAGIC_F7D4401 &&
((struct trx_header *)data)->magic != EDIMAX_PS_HEADER_MAGIC;
data += 65536);
Index: target/linux/brcm47xx/image/Makefile
===================================================================
--- target/linux/brcm47xx/image/Makefile (revisión: 36240)
+++ target/linux/brcm47xx/image/Makefile (copia de trabajo)
@@ -121,6 +121,7 @@
define Image/Build/Initramfs
$(STAGING_DIR_HOST)/bin/trx -o $(BIN_DIR)/$(IMG_PREFIX)-initramfs.trx -f $(KDIR)/loader.gz -f $(KDIR)/vmlinux.lzma
+ $(STAGING_DIR_HOST)/bin/trx -t belkin -o $(BIN_DIR)/$(IMG_PREFIX)-F7D4401-initramfs.trx -f $(KDIR)/loader.gz -f $(KDIR)/vmlinux.lzma
endef
define Image/Build/Chk
@@ -131,6 +132,9 @@
$(STAGING_DIR_HOST)/bin/trx -o $(BIN_DIR)/$(IMG_PREFIX)-$(1).trx \
-f $(KDIR)/loader.gz -f $(KDIR)/vmlinux.lzma \
$(call trxalign/$(1),$(1))
+ $(STAGING_DIR_HOST)/bin/trx -t belkin -o $(BIN_DIR)/$(IMG_PREFIX)-F7D4401-$(1).trx \
+ -f $(KDIR)/loader.gz -f $(KDIR)/vmlinux.lzma \
+ $(call trxalign/$(1),$(1))
$(call Image/Build/$(1),$(1))
$(call Image/Build/Motorola,$(1),wr850g,1,$(1))
$(call Image/Build/USR,$(1),usr5461,$(1))
Index: target/linux/brcm47xx/profiles/226-Broadcom-bgmac-brcmsmac.mk
===================================================================
--- target/linux/brcm47xx/profiles/226-Broadcom-bgmac-brcmsmac.mk (revisión: 0)
+++ target/linux/brcm47xx/profiles/226-Broadcom-bgmac-brcmsmac.mk (revisión: 0)
@@ -0,0 +1,18 @@
+#
+# Copyright (C) 2006-2013 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Profile/Broadcom-bgmac-brcmsmac
+ NAME:=Broadcom SoC, bgmac Ethernet, brcmsmac (F7D4401)
+ PACKAGES:=kmod-brcmsmac wpad-mini kmod-bgmac -kmod-brcm-wl -wlc -nas
+endef
+
+define Profile/Broadcom-bgmac-none/Description
+ Package set compatible with hardware newer Broadcom BCM47xx or BCM535x
+ SoC with dual 4716 and 43224 Wifi cards and bgmac Ethernet driver.
+endef
+$(eval $(call Profile,Broadcom-bgmac-brcmsmac))
+
Index: target/linux/brcm47xx/base-files/etc/init.d/netconfig
===================================================================
--- target/linux/brcm47xx/base-files/etc/init.d/netconfig (revisión: 36240)
+++ target/linux/brcm47xx/base-files/etc/init.d/netconfig (copia de trabajo)
@@ -152,6 +152,10 @@
c["vlan1ports"] = "0 1 2 3 5t"
c["vlan2ports"] = "4 5t"
}
+ if (model == "Belkin F7D4401") {
+ c["vlan0ports"] = "0 1 2 3 8*"
+ c["vlan1ports"] = "4 8"
+ }
if ((nvram["boardtype"] == "0x042f") || (nvram["boardtype"] == "0x0472")) {
if (nvram["boardnum"] == "45") {
# WL-500gP
@@ -248,7 +252,7 @@
p("ifname", "lan_ifname")
p("macaddr", "lan_macaddr")
print " option proto static"
- print " option ipaddr 192.168.1.1"
+ print " option ipaddr 192.168.2.1"
print " option netmask 255.255.255.0"
print ""
print ""
Index: target/linux/brcm47xx/patches-3.6/260-MIPS-BCM47XX-add-board-detection.patch
===================================================================
--- target/linux/brcm47xx/patches-3.6/260-MIPS-BCM47XX-add-board-detection.patch (revisión: 36244)
+++ target/linux/brcm47xx/patches-3.6/260-MIPS-BCM47XX-add-board-detection.patch (copia de trabajo)
@@ -8,7 +8,7 @@
obj-$(CONFIG_BCM47XX_SSB) += wgt634u.o
--- /dev/null
+++ b/arch/mips/bcm47xx/board.c
-@@ -0,0 +1,222 @@
+@@ -0,0 +1,223 @@
+#include <linux/export.h>
+#include <linux/string.h>
+#include <bcm47xx_board.h>
@@ -46,6 +46,7 @@
+ {{BCM47XX_BOARD_ASUS_WL520GC, "Asus WL520GC"}, "WL520GC-",},
+ {{BCM47XX_BOARD_ASUS_WL520GU, "Asus WL520GU"}, "WL520GU-",},
+ {{BCM47XX_BOARD_BELKIN_F7D4301, "Belkin F7D4301"}, "F7D4301",},
++ {{BCM47XX_BOARD_BELKIN_F7D4401, "Belkin F7D4401"}, "F7D4401",},
+ { {0}, 0},
+};
+
@@ -233,7 +234,7 @@
+EXPORT_SYMBOL(bcm47xx_board_get_name);
--- /dev/null
+++ b/arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h
-@@ -0,0 +1,90 @@
+@@ -0,0 +1,91 @@
+#ifndef __BCM47XX_BOARD_H
+#define __BCM47XX_BOARD_H
+
@@ -258,6 +259,7 @@
+ BCM47XX_BOARD_ASUS_WL700GE,
+
+ BCM47XX_BOARD_BELKIN_F7D4301,
++ BCM47XX_BOARD_BELKIN_F7D4401,
+
+ BCM47XX_BOARD_BUFFALO_WBR2_G54,
+ BCM47XX_BOARD_BUFFALO_WHR2_A54G54,
@@ -324,3 +326,4 @@
+extern const char *bcm47xx_board_get_name(void);
+
+#endif /* __BCM47XX_BOARD_H */
+
Index: target/linux/brcm47xx/patches-3.6/050-mtd-add-bcm47xx-part-parser.patch
===================================================================
--- target/linux/brcm47xx/patches-3.6/050-mtd-add-bcm47xx-part-parser.patch (revisión: 36244)
+++ target/linux/brcm47xx/patches-3.6/050-mtd-add-bcm47xx-part-parser.patch (copia de trabajo)
@@ -26,7 +26,7 @@
obj-$(CONFIG_MTD_CHAR) += mtdchar.o
--- /dev/null
+++ b/drivers/mtd/bcm47xxpart.c
-@@ -0,0 +1,504 @@
+@@ -0,0 +1,519 @@
+/*
+ * Copyright (C) 2006 Felix Fietkau <nbd@openwrt.org>
+ * Copyright (C) 2005 Waldemar Brodkorb <wbx@openwrt.org>
@@ -88,6 +88,7 @@
+#define TRX_NO_HEADER 1 /* Do not write TRX header */
+#define TRX_GZ_FILES 0x2 /* Contains up to TRX_MAX_OFFSET individual gzip files */
+#define TRX_MAX_OFFSET 3
++#define TRX_MAGIC_F7D4401 0x00018517 /* F7D4401 */
+
+struct trx_header {
+ u32 magic; /* "HDR0" */
@@ -145,6 +146,10 @@
+ /* found a TRX header */
+ if (le32_to_cpu(trx->magic) == TRX_MAGIC)
+ goto found;
++ if (le32_to_cpu(trx->magic) == TRX_MAGIC_F7D4401) {
++ pr_notice("Found Belkin_F7D4401 header:cfe\n");
++ goto found;
++ }
+ }
+
+ pr_notice("%s: Couldn't find bootloader size\n", mtd->name);
@@ -307,6 +312,16 @@
+
+ goto found;
+ }
++ if (le32_to_cpu(trx.magic) == TRX_MAGIC_F7D4401) {
++ part->offset = le32_to_cpu(trx.offsets[2]) ? :
++ le32_to_cpu(trx.offsets[1]);
++ part->size = le32_to_cpu(trx.len);
++
++ part->size -= part->offset;
++ part->offset += off;
++ pr_notice("Found Belkin_F7D4401 header:root\n");
++ goto found;
++ }
+ }
+
+ pr_warn("%s: Couldn't find root filesystem\n",
@@ -531,3 +546,4 @@
+
+MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("Parsing code for flash partitions on bcm47xx SoCs");
+
Index: package/broadcom-diag/src/diag.c
===================================================================
--- package/broadcom-diag/src/diag.c (revisión: 36240)
+++ package/broadcom-diag/src/diag.c (copia de trabajo)
@@ -117,6 +117,7 @@
/* Belkin */
BELKIN_UNKNOWN,
BELKIN_F7D4301,
+ BELKIN_F7D4401,
/* Netgear */
WGT634U,
@@ -879,6 +880,21 @@
{ .name = "led1", .gpio = 1 << 15, .polarity = REVERSE },
},
},
+ [BELKIN_F7D4401] = {
+ .name = "Belkin PlayMax F7D4401",
+ .buttons = {
+ { .name = "reset", .gpio = 1 << 6 },
+ { .name = "wps", .gpio = 1 << 8 },
+ },
+ .leds = {
+ { .name = "power", .gpio = 1 << 10, .polarity = REVERSE },
+ { .name = "diag", .gpio = 1 << 11, .polarity = REVERSE },
+ { .name = "wlan", .gpio = 1 << 12, .polarity = REVERSE },
+ { .name = "wlan_red", .gpio = 1 << 13, .polarity = REVERSE },
+ { .name = "led_usb0", .gpio = 1 << 14, .polarity = REVERSE },
+ { .name = "led_usb1", .gpio = 1 << 15, .polarity = REVERSE },
+ },
+ },
/* Netgear */
[WGT634U] = {
.name = "Netgear WGT634U",
@@ -1080,6 +1096,7 @@
/* no easy model number, attempt to guess */
boardnum = getvar("boardnum");
boardtype = getvar("boardtype");
+ printk("manoj: boardnum= %s : boardtype : %s\n", boardnum, boardtype);
if (!strcmp(boardnum, "20070615")) { /* Linksys WRT600N v1/V1.1 */
if (!strcmp(boardtype, "0x478") && !strcmp(getvar("cardbus"), "0") && !strcmp(getvar("switch_type"),"BCM5395"))
@@ -1308,6 +1325,8 @@
return &platforms[WR850GV2V3];
case BCM47XX_BOARD_NETGEAR_WNDR3400V1:
return &platforms[WNDR3400V1];
+ case BCM47XX_BOARD_BELKIN_F7D4401:
+ return &platforms[BELKIN_F7D4401];
case BCM47XX_BOARD_UNKNOWN:
case BCM47XX_BOARD_NON:
printk(MODULE_NAME ": unknown board found, try legacy detect\n");
@@ -1473,6 +1492,7 @@
return;
for(; l->name; l++) {
+ printk(MODULE_NAME ": led:%s\n",l->name);
if (l->gpio & gpiomask)
continue;
Index: package/base-files/files/etc/preinit
===================================================================
--- package/base-files/files/etc/preinit (revisión: 36240)
+++ package/base-files/files/etc/preinit (copia de trabajo)
@@ -7,13 +7,13 @@
export PATH=/bin:/sbin:/usr/bin:/usr/sbin
pi_ifname=
-pi_ip=192.168.1.1
-pi_broadcast=192.168.1.255
+pi_ip=192.168.2.1
+pi_broadcast=192.168.2.255
pi_netmask=255.255.255.0
fs_failsafe_ifname=
-fs_failsafe_ip=192.168.1.1
-fs_failsafe_broadcast=192.168.1.255
+fs_failsafe_ip=192.168.2.1
+fs_failsafe_broadcast=192.168.2.255
fs_failsafe_netmask=255.255.255.0
fs_failsafe_wait_timeout=2
Index: tools/firmware-utils/src/trx.c
===================================================================
--- tools/firmware-utils/src/trx.c (revisión: 36240)
+++ tools/firmware-utils/src/trx.c (copia de trabajo)
@@ -66,6 +66,7 @@
/**********************************************************************/
/* from trxhdr.h */
+#define TRX_MAGIC_F7D4401 0x00018517
#define TRX_MAGIC 0x30524448 /* "HDR0" */
#define TRX_MAX_LEN 0x720000
#define TRX_NO_HEADER 1 /* Do not write TRX header */
@@ -105,6 +106,7 @@
struct trx_header *p;
char trx_version = 1;
unsigned char binheader[32];
+ unsigned long trx_magic_c=TRX_MAGIC;
fprintf(stderr, "mjn3's trx replacement - v0.81.1\n");
@@ -115,13 +117,13 @@
p = (struct trx_header *) buf;
- p->magic = STORE32_LE(TRX_MAGIC);
+ //p->magic = STORE32_LE(TRX_MAGIC);
cur_len = sizeof(struct trx_header) - 4; /* assume v1 header */
in = NULL;
i = 0;
- while ((c = getopt(argc, argv, "-:2o:m:a:x:b:f:A:F:")) != -1) {
+ while ((c = getopt(argc, argv, "-:2o:m:a:x:b:f:A:F:t:")) != -1) {
switch (c) {
case '2':
/* take care that nothing was written to buf so far */
@@ -164,6 +166,9 @@
append = 0;
break;
+ case 't':
+ trx_magic_c = TRX_MAGIC_F7D4401;
+ break;
case 'o':
ofn = optarg;
if (ofn && !(out = fopen(ofn, "w"))) {
@@ -247,6 +252,8 @@
usage();
}
}
+ fprintf(stderr, "INFO: trxMagic=0x%8x\n",trx_magic_c);
+ p->magic = STORE32_LE(trx_magic_c);
p->flag_version = STORE32_LE((trx_version << 16));
if (!in) {