2 * Copyright (C) 2016 Piotr Dymacz <piotr@dymacz.pl>
4 * This file contains the configuration parameters
5 * for Qualcomm Atheros QCA953x based devices
7 * Reference designs: AP143
9 * SPDX-License-Identifier: GPL-2.0
16 #include <configs/qca9k_common.h>
17 #include <soc/soc_common.h>
24 #if defined(CONFIG_FOR_ALFA_NETWORK_R36A)
26 #define CONFIG_QCA_GPIO_MASK_LED_ACT_L GPIO4 | GPIO12 | GPIO14 |\
28 #define CONFIG_QCA_GPIO_MASK_IN GPIO17
29 #define CONFIG_QCA_GPIO_MASK_OUT_INIT_H GPIO3
30 #define CONFIG_QCA_GPIO_MASK_OUT_INIT_L GPIO0 | GPIO1
32 #elif defined(CONFIG_FOR_COMFAST_CF_E314N)
34 #define CONFIG_QCA_GPIO_MASK_LED_ACT_H GPIO4 | GPIO11 | GPIO14 |\
36 #define CONFIG_QCA_GPIO_MASK_LED_ACT_L GPIO0 | GPIO2 | GPIO3
38 #elif defined(CONFIG_FOR_COMFAST_CF_E320N_V2)
40 #define CONFIG_QCA_GPIO_MASK_LED_ACT_H GPIO0 | GPIO2 | GPIO3
41 #define CONFIG_QCA_GPIO_MASK_IN GPIO11 | GPIO12 | GPIO14 |\
44 #elif defined(CONFIG_FOR_COMFAST_CF_E520N) ||\
45 defined(CONFIG_FOR_COMFAST_CF_E530N)
47 #define CONFIG_QCA_GPIO_MASK_LED_ACT_L GPIO11
49 #elif defined(CONFIG_FOR_GAINSTRONG_OOLITE_V5_2_DEV)
51 #define CONFIG_QCA_GPIO_MASK_LED_ACT_H GPIO13
53 #elif defined(CONFIG_FOR_GLINET_GL_AR300M_LITE)
55 #define CONFIG_QCA_GPIO_MASK_LED_ACT_L GPIO13 | GPIO14
56 #define CONFIG_QCA_GPIO_MASK_IN GPIO0 | GPIO1 | GPIO16 | GPIO17
57 #define CONFIG_QCA_GPIO_MASK_OUT_INIT_L GPIO12
59 #elif defined(CONFIG_FOR_GLINET_GL_AR750)
61 #define CONFIG_QCA_GPIO_MASK_LED_ACT_L GPIO13 | GPIO14
62 #define CONFIG_QCA_GPIO_MASK_IN GPIO0 | GPIO16 | GPIO17
63 #define CONFIG_QCA_GPIO_MASK_OUT_INIT_H GPIO2
64 #define CONFIG_QCA_GPIO_MASK_OUT_INIT_L GPIO12
66 #elif defined(CONFIG_FOR_P2W_CPE505N)
68 #define CONFIG_QCA_GPIO_MASK_LED_ACT_L GPIO4 | GPIO11 | GPIO12 |\
71 #elif defined(CONFIG_FOR_P2W_R602N)
73 #define CONFIG_QCA_GPIO_MASK_LED_ACT_L GPIO4 | GPIO11 | GPIO12 |\
74 GPIO14 | GPIO15 | GPIO16
76 #elif defined(CONFIG_FOR_TPLINK_MR22U_V1)
78 #define CONFIG_QCA_GPIO_MASK_LED_ACT_L GPIO13
79 #define CONFIG_QCA_GPIO_MASK_IN GPIO14 | GPIO16
80 #define CONFIG_QCA_GPIO_MASK_OUT_INIT_H GPIO11
82 #elif defined(CONFIG_FOR_TPLINK_MR3420_V3)
84 #define CONFIG_QCA_GPIO_MASK_LED_ACT_L GPIO1 | GPIO3 | GPIO4 |\
85 GPIO11 | GPIO13 | GPIO14 |\
87 #define CONFIG_QCA_GPIO_MASK_IN GPIO17
89 #elif defined(CONFIG_FOR_TPLINK_MR6400_V1V2)
91 #define CONFIG_QCA_GPIO_MASK_LED_ACT_H GPIO0 | GPIO1 | GPIO3 |\
93 #define CONFIG_QCA_GPIO_MASK_IN GPIO14
94 #define CONFIG_QCA_GPIO_MASK_OUT_INIT_H GPIO4 | GPIO13
96 #elif defined(CONFIG_FOR_TPLINK_WA850RE_V2)
98 #define CONFIG_QCA_GPIO_MASK_LED_ACT_L GPIO0 | GPIO1 | GPIO2 |\
99 GPIO3 | GPIO4 | GPIO12 |\
101 #define CONFIG_QCA_GPIO_MASK_IN GPIO16
102 #define CONFIG_QCA_GPIO_MASK_OUT_INIT_H GPIO15
104 #elif defined(CONFIG_FOR_TPLINK_WR802N_V1) ||\
105 defined(CONFIG_FOR_TPLINK_WR820N_V1_CN)
107 #define CONFIG_QCA_GPIO_MASK_LED_ACT_L GPIO13
109 #elif defined(CONFIG_FOR_TPLINK_WR810N_V1) ||\
110 defined(CONFIG_FOR_TPLINK_WR810N_V2)
112 #define CONFIG_QCA_GPIO_MASK_LED_ACT_L GPIO13
113 #define CONFIG_QCA_GPIO_MASK_IN GPIO0 | GPIO1
115 #if defined(CONFIG_FOR_TPLINK_WR810N_V1)
116 #define CONFIG_QCA_GPIO_MASK_OUT_INIT_H GPIO11
119 #elif defined(CONFIG_FOR_TPLINK_WR841N_V10) ||\
120 defined(CONFIG_FOR_TPLINK_WR841N_V9)
122 #define CONFIG_QCA_GPIO_MASK_LED_ACT_L GPIO3 | GPIO4 | GPIO11 |\
123 GPIO13 | GPIO14 | GPIO15 |\
125 #define CONFIG_QCA_GPIO_MASK_IN GPIO17
127 #elif defined(CONFIG_FOR_TPLINK_WR841N_V11)
129 #define CONFIG_QCA_GPIO_MASK_LED_ACT_L GPIO1 | GPIO2 | GPIO3 |\
130 GPIO4 | GPIO11 | GPIO13 |\
131 GPIO14 | GPIO15 | GPIO16
132 #define CONFIG_QCA_GPIO_MASK_IN GPIO17
134 #elif defined(CONFIG_FOR_TPLINK_WR842N_V3)
136 #define CONFIG_QCA_GPIO_MASK_LED_ACT_L GPIO2 | GPIO3 | GPIO4 |\
137 GPIO11 | GPIO12 | GPIO13 |\
138 GPIO14 | GPIO15 | GPIO16 |\
140 #define CONFIG_QCA_GPIO_MASK_IN GPIO0
142 #elif defined(CONFIG_FOR_TPLINK_WR902AC_V1)
144 #define CONFIG_QCA_GPIO_MASK_LED_ACT_H GPIO4 | GPIO15
145 #define CONFIG_QCA_GPIO_MASK_LED_ACT_L GPIO0 | GPIO11 | GPIO12
146 #define CONFIG_QCA_GPIO_MASK_IN GPIO2 | GPIO14 | GPIO17
147 #define CONFIG_QCA_GPIO_MASK_OUT_INIT_H GPIO1 | GPIO13
149 #elif defined(CONFIG_FOR_WALLYS_DR531)
151 #define CONFIG_QCA_GPIO_MASK_LED_ACT_L GPIO11 | GPIO12 | GPIO13 |\
152 GPIO14 | GPIO15 | GPIO16
154 #elif defined(CONFIG_FOR_WHQX_E600G_V2)
156 #define CONFIG_QCA_GPIO_MASK_LED_ACT_L GPIO4 | GPIO13 | GPIO15 | GPIO16
158 #elif defined(CONFIG_FOR_WHQX_E600GAC_V2)
160 #define CONFIG_QCA_GPIO_MASK_LED_ACT_L GPIO4 | GPIO11 | GPIO12 |\
161 GPIO13 | GPIO14 | GPIO15 |\
163 #define CONFIG_QCA_GPIO_MASK_IN GPIO1
165 #elif defined(CONFIG_FOR_YUNCORE_AP90Q)
167 #define CONFIG_QCA_GPIO_MASK_LED_ACT_L GPIO4 | GPIO12 | GPIO16
169 #elif defined(CONFIG_FOR_YUNCORE_CPE830)
171 #define CONFIG_QCA_GPIO_MASK_LED_ACT_L GPIO0 | GPIO1 | GPIO2 |\
172 GPIO3 | GPIO4 | GPIO12 |\
175 #elif defined(CONFIG_FOR_YUNCORE_T830)
177 #define CONFIG_QCA_GPIO_MASK_LED_ACT_L GPIO4 | GPIO11 | GPIO12 |\
178 GPIO13 | GPIO14 | GPIO15 |\
181 #elif defined(CONFIG_FOR_ZBTLINK_ZBT_WE1526)
183 #define CONFIG_QCA_GPIO_MASK_LED_ACT_L GPIO4 | GPIO11 | GPIO12 |\
184 GPIO13 | GPIO14 | GPIO15 |\
194 #if defined(CONFIG_FOR_ALFA_NETWORK_R36A)
196 #define CONFIG_BOOTARGS "console=ttyS0,115200 root=31:03 "\
197 "rootfstype=jffs2,squashfs init=/sbin/init "\
198 "mtdparts=ath-nor0:448k(u-boot),64k(art),1280k(kernel),14528k(rootfs),64k(config)"
200 #elif defined(CONFIG_FOR_COMFAST_CF_E314N) ||\
201 defined(CONFIG_FOR_COMFAST_CF_E320N_V2)
203 #define CONFIG_BOOTARGS "console=ttyS0,115200 root=31:03 "\
204 "rootfstype=jffs2 init=/sbin/init "\
205 "mtdparts=ath-nor0:64k(u-boot),64k(art),1536k(uImage),14656k(rootfs),64k(mib0)"
207 #elif defined(CONFIG_FOR_COMFAST_CF_E520N) ||\
208 defined(CONFIG_FOR_COMFAST_CF_E530N)
210 #define CONFIG_BOOTARGS "console=ttyS0,115200 root=31:03 "\
211 "rootfstype=jffs2 init=/sbin/init "\
212 "mtdparts=ath-nor0:64k(u-boot),64k(art),1536k(uImage),6464k(rootfs),64k(mib0)"
214 #elif defined(CONFIG_FOR_GAINSTRONG_OOLITE_V5_2) ||\
215 defined(CONFIG_FOR_GAINSTRONG_OOLITE_V5_2_DEV)
217 #define CONFIG_BOOTARGS "console=ttyS0,115200 root=31:01 "\
218 "rootfstype=squashfs init=/sbin/init "\
219 "mtdparts=ath-nor0:128k(u-boot),16192k@0x20000(firmware),64k@0xff0000(art)"
221 #elif defined(CONFIG_FOR_GLINET_GL_AR300M_LITE)
223 #define CONFIG_BOOTARGS "console=ttyS0,115200 root=31:02 "\
224 "rootfstype=squashfs init=/sbin/init "\
225 "mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),16000k(firmware),64k(art)ro"
227 #elif defined(CONFIG_FOR_GLINET_GL_AR750)
229 #define CONFIG_BOOTARGS "console=ttyS0,115200 root=31:03 "\
230 "rootfstype=squashfs init=/sbin/init "\
231 "mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),64k(art)ro,16000k(firmware)"
233 #elif defined(CONFIG_FOR_P2W_CPE505N) ||\
234 defined(CONFIG_FOR_P2W_R602N) ||\
235 defined(CONFIG_FOR_YUNCORE_AP90Q) ||\
236 defined(CONFIG_FOR_YUNCORE_CPE830) ||\
237 defined(CONFIG_FOR_ZBTLINK_ZBT_WE1526)
239 #define CONFIG_BOOTARGS "console=ttyS0,115200 root=31:02 "\
240 "rootfstype=squashfs init=/sbin/init "\
241 "mtdparts=spi0.0:256k(u-boot),64k(u-boot-env),14528k(rootfs),1472k(kernel),64k(art),16000k(firmware)"
243 #elif defined(CONFIG_FOR_TPLINK_MR22U_V1) ||\
244 defined(CONFIG_FOR_TPLINK_MR6400_V1V2) ||\
245 defined(CONFIG_FOR_TPLINK_WR810N_V1) ||\
246 defined(CONFIG_FOR_TPLINK_WR810N_V2)
248 #define CONFIG_BOOTARGS "console=ttyS0,115200 root=31:02 "\
249 "rootfstype=squashfs init=/sbin/init "\
250 "mtdparts=ath-nor0:128k(u-boot),1024k(kernel),6912k(rootfs),64k(config),64k(art)"
252 #elif defined(CONFIG_FOR_TPLINK_MR3420_V3) ||\
253 defined(CONFIG_FOR_TPLINK_WA850RE_V2) ||\
254 defined(CONFIG_FOR_TPLINK_WR802N_V1) ||\
255 defined(CONFIG_FOR_TPLINK_WR841N_V10) ||\
256 defined(CONFIG_FOR_TPLINK_WR841N_V11) ||\
257 defined(CONFIG_FOR_TPLINK_WR841N_V9)
259 #define CONFIG_BOOTARGS "console=ttyS0,115200 root=31:02 "\
260 "rootfstype=squashfs init=/sbin/init "\
261 "mtdparts=ath-nor0:128k(u-boot),1024k(kernel),2816k(rootfs),64k(config),64k(art)"
263 #elif defined(CONFIG_FOR_TPLINK_WR820N_V1_CN)
265 #define CONFIG_BOOTARGS "console=ttyS0,115200 root=31:02 "\
266 "rootfstype=squashfs init=/sbin/init "\
267 "mtdparts=ath-nor0:32k(u-boot1),32k(u-boot2),3008k(rootfs),896k(uImage),64k(mib0),64k(art)"
269 #elif defined(CONFIG_FOR_TPLINK_WR842N_V3) ||\
270 defined(CONFIG_FOR_TPLINK_WR902AC_V1)
272 #define CONFIG_BOOTARGS "console=ttyS0,115200 root=31:02 "\
273 "rootfstype=jffs2 init=/sbin/init "\
274 "mtdparts=ath-nor0:32k(u-boot1),32k(u-boot2),3008k(rootfs),896k(uImage),64k(mib0),64k(ART)"
276 #elif defined(CONFIG_FOR_WALLYS_DR531)
278 #define CONFIG_BOOTARGS "console=ttyS0,115200 root=31:02 "\
279 "rootfstype=jffs2 init=/sbin/init "\
280 "mtdparts=ath-nor0:256k(u-boot),64k(u-boot-env),6336k(rootfs),1408k(uImage),64k(mib0),64k(ART)"
282 #elif defined(CONFIG_FOR_WHQX_E600G_V2) ||\
283 defined(CONFIG_FOR_WHQX_E600GAC_V2) ||\
284 defined(CONFIG_FOR_YUNCORE_T830)
286 #define CONFIG_BOOTARGS "console=ttyS0,115200 root=31:02 "\
287 "rootfstype=jffs2 init=/sbin/init "\
288 "mtdparts=ath-nor0:256k(u-boot),64k(u-boot-env),14528k(rootfs),1408k(uImage),64k(mib0),64k(ART)"
293 * =============================
294 * Load address and boot command
295 * =============================
297 #if defined(CONFIG_FOR_ALFA_NETWORK_R36A)
299 #define CFG_LOAD_ADDR 0x9F080000
301 #elif defined(CONFIG_FOR_COMFAST_CF_E314N) ||\
302 defined(CONFIG_FOR_COMFAST_CF_E320N_V2) ||\
303 defined(CONFIG_FOR_COMFAST_CF_E520N) ||\
304 defined(CONFIG_FOR_COMFAST_CF_E530N) ||\
305 defined(CONFIG_FOR_GAINSTRONG_OOLITE_V5_2) ||\
306 defined(CONFIG_FOR_GAINSTRONG_OOLITE_V5_2_DEV) ||\
307 defined(CONFIG_FOR_TPLINK_MR22U_V1) ||\
308 defined(CONFIG_FOR_TPLINK_MR3420_V3) ||\
309 defined(CONFIG_FOR_TPLINK_MR6400_V1V2) ||\
310 defined(CONFIG_FOR_TPLINK_WA850RE_V2) ||\
311 defined(CONFIG_FOR_TPLINK_WR802N_V1) ||\
312 defined(CONFIG_FOR_TPLINK_WR810N_V1) ||\
313 defined(CONFIG_FOR_TPLINK_WR810N_V2) ||\
314 defined(CONFIG_FOR_TPLINK_WR820N_V1_CN) ||\
315 defined(CONFIG_FOR_TPLINK_WR841N_V10) ||\
316 defined(CONFIG_FOR_TPLINK_WR841N_V11) ||\
317 defined(CONFIG_FOR_TPLINK_WR841N_V9) ||\
318 defined(CONFIG_FOR_TPLINK_WR842N_V3) ||\
319 defined(CONFIG_FOR_TPLINK_WR902AC_V1)
321 #define CFG_LOAD_ADDR 0x9F020000
323 #elif defined(CONFIG_FOR_GLINET_GL_AR300M_LITE) ||\
324 defined(CONFIG_FOR_P2W_CPE505N) ||\
325 defined(CONFIG_FOR_P2W_R602N) ||\
326 defined(CONFIG_FOR_WALLYS_DR531) ||\
327 defined(CONFIG_FOR_YUNCORE_AP90Q) ||\
328 defined(CONFIG_FOR_YUNCORE_CPE830) ||\
329 defined(CONFIG_FOR_YUNCORE_T830) ||\
330 defined(CONFIG_FOR_ZBTLINK_ZBT_WE1526)
332 #define CFG_LOAD_ADDR 0x9F050000
334 #elif defined(CONFIG_FOR_GLINET_GL_AR750) ||\
335 defined(CONFIG_FOR_WHQX_E600G_V2) ||\
336 defined(CONFIG_FOR_WHQX_E600GAC_V2)
338 #define CFG_LOAD_ADDR 0x9F070000
342 #if defined(CONFIG_FOR_P2W_CPE505N) ||\
343 defined(CONFIG_FOR_P2W_R602N) ||\
344 defined(CONFIG_FOR_YUNCORE_AP90Q) ||\
345 defined(CONFIG_FOR_YUNCORE_CPE830) ||\
346 defined(CONFIG_FOR_YUNCORE_T830) ||\
347 defined(CONFIG_FOR_ZBTLINK_ZBT_WE1526)
349 #define CONFIG_BOOTCOMMAND "bootm 0x9F050000 || bootm 0x9FE80000"
353 #define CONFIG_BOOTCOMMAND "bootm " MK_STR(CFG_LOAD_ADDR)
358 * =========================
359 * Environment configuration
360 * =========================
362 #if defined(CONFIG_FOR_ALFA_NETWORK_R36A)
364 #define CFG_ENV_ADDR 0x9F060000
365 #define CFG_ENV_SIZE 0x10000
367 #elif defined(CONFIG_FOR_COMFAST_CF_E314N) ||\
368 defined(CONFIG_FOR_COMFAST_CF_E320N_V2) ||\
369 defined(CONFIG_FOR_COMFAST_CF_E520N) ||\
370 defined(CONFIG_FOR_COMFAST_CF_E530N)
372 #define CFG_ENV_ADDR 0x9F018000
373 #define CFG_ENV_SIZE 0x7C00
374 #define CFG_ENV_SECT_SIZE 0x10000
376 #elif defined(CONFIG_FOR_GAINSTRONG_OOLITE_V5_2) ||\
377 defined(CONFIG_FOR_GAINSTRONG_OOLITE_V5_2_DEV) ||\
378 defined(CONFIG_FOR_TPLINK_MR22U_V1) ||\
379 defined(CONFIG_FOR_TPLINK_MR3420_V3) ||\
380 defined(CONFIG_FOR_TPLINK_MR6400_V1V2) ||\
381 defined(CONFIG_FOR_TPLINK_WA850RE_V2) ||\
382 defined(CONFIG_FOR_TPLINK_WR802N_V1) ||\
383 defined(CONFIG_FOR_TPLINK_WR810N_V1) ||\
384 defined(CONFIG_FOR_TPLINK_WR810N_V2) ||\
385 defined(CONFIG_FOR_TPLINK_WR820N_V1_CN) ||\
386 defined(CONFIG_FOR_TPLINK_WR841N_V10) ||\
387 defined(CONFIG_FOR_TPLINK_WR841N_V11) ||\
388 defined(CONFIG_FOR_TPLINK_WR841N_V9) ||\
389 defined(CONFIG_FOR_TPLINK_WR842N_V3) ||\
390 defined(CONFIG_FOR_TPLINK_WR902AC_V1)
392 #define CFG_ENV_ADDR 0x9F01EC00
393 #define CFG_ENV_SIZE 0x1000
394 #define CFG_ENV_SECT_SIZE 0x10000
396 #elif defined(CONFIG_FOR_GLINET_GL_AR300M_LITE) ||\
397 defined(CONFIG_FOR_GLINET_GL_AR750) ||\
398 defined(CONFIG_FOR_WHQX_E600G_V2) ||\
399 defined(CONFIG_FOR_WHQX_E600GAC_V2)
401 #define CFG_ENV_ADDR 0x9F040000
402 #define CFG_ENV_SIZE 0x10000
403 #define CFG_ENV_SECT_SIZE 0x10000
405 #elif defined(CONFIG_FOR_P2W_CPE505N) ||\
406 defined(CONFIG_FOR_P2W_R602N) ||\
407 defined(CONFIG_FOR_YUNCORE_AP90Q) ||\
408 defined(CONFIG_FOR_YUNCORE_CPE830) ||\
409 defined(CONFIG_FOR_YUNCORE_T830) ||\
410 defined(CONFIG_FOR_ZBTLINK_ZBT_WE1526)
412 #define CFG_ENV_ADDR 0x9F040000
413 #define CFG_ENV_SIZE 0xFC00
414 #define CFG_ENV_SECT_SIZE 0x10000
416 #elif defined(CONFIG_FOR_WALLYS_DR531)
418 #define CFG_ENV_ADDR 0x9F030000
419 #define CFG_ENV_SIZE 0xF800
420 #define CFG_ENV_SECT_SIZE 0x10000
425 * ===========================
426 * List of available baudrates
427 * ===========================
429 #define CFG_BAUDRATE_TABLE \
430 { 600, 1200, 2400, 4800, 9600, 14400, \
431 19200, 28800, 38400, 56000, 57600, 115200 }
434 * ==================================================
435 * MAC address/es, model and WPS pin offsets in FLASH
436 * ==================================================
438 #if defined(CONFIG_FOR_ALFA_NETWORK_R36A)
440 #define OFFSET_MAC_DATA_BLOCK 0x70000
441 #define OFFSET_MAC_DATA_BLOCK_LENGTH 0x10000
442 #define OFFSET_MAC_ADDRESS 0x00000
444 #elif defined(CONFIG_FOR_COMFAST_CF_E314N) ||\
445 defined(CONFIG_FOR_COMFAST_CF_E320N_V2) ||\
446 defined(CONFIG_FOR_COMFAST_CF_E520N) ||\
447 defined(CONFIG_FOR_COMFAST_CF_E530N)
449 #define OFFSET_MAC_DATA_BLOCK 0x10000
450 #define OFFSET_MAC_DATA_BLOCK_LENGTH 0x10000
451 #define OFFSET_MAC_ADDRESS 0x00000
453 #elif defined(CONFIG_FOR_GAINSTRONG_OOLITE_V5_2) ||\
454 defined(CONFIG_FOR_GAINSTRONG_OOLITE_V5_2_DEV) ||\
455 defined(CONFIG_FOR_GLINET_GL_AR300M_LITE) ||\
456 defined(CONFIG_FOR_P2W_CPE505N) ||\
457 defined(CONFIG_FOR_P2W_R602N) ||\
458 defined(CONFIG_FOR_YUNCORE_AP90Q) ||\
459 defined(CONFIG_FOR_YUNCORE_CPE830) ||\
460 defined(CONFIG_FOR_YUNCORE_T830) ||\
461 defined(CONFIG_FOR_ZBTLINK_ZBT_WE1526)
463 #define OFFSET_MAC_DATA_BLOCK 0xFF0000
464 #define OFFSET_MAC_DATA_BLOCK_LENGTH 0x010000
465 #define OFFSET_MAC_ADDRESS 0x000000
467 #elif defined(CONFIG_FOR_GLINET_GL_AR750)
469 #define OFFSET_MAC_DATA_BLOCK 0x50000
470 #define OFFSET_MAC_DATA_BLOCK_LENGTH 0x10000
471 #define OFFSET_MAC_ADDRESS 0x00000
473 #elif defined(CONFIG_FOR_TPLINK_MR22U_V1) ||\
474 defined(CONFIG_FOR_TPLINK_MR3420_V3) ||\
475 defined(CONFIG_FOR_TPLINK_MR6400_V1V2) ||\
476 defined(CONFIG_FOR_TPLINK_WR802N_V1) ||\
477 defined(CONFIG_FOR_TPLINK_WR810N_V1) ||\
478 defined(CONFIG_FOR_TPLINK_WR810N_V2) ||\
479 defined(CONFIG_FOR_TPLINK_WR820N_V1_CN) ||\
480 defined(CONFIG_FOR_TPLINK_WR841N_V10) ||\
481 defined(CONFIG_FOR_TPLINK_WR841N_V11) ||\
482 defined(CONFIG_FOR_TPLINK_WR841N_V9) ||\
483 defined(CONFIG_FOR_TPLINK_WR842N_V3)
485 #define OFFSET_MAC_DATA_BLOCK 0x010000
486 #define OFFSET_MAC_DATA_BLOCK_LENGTH 0x010000
487 #define OFFSET_MAC_ADDRESS 0x00FC00
488 #define OFFSET_ROUTER_MODEL 0x00FD00
489 #define OFFSET_PIN_NUMBER 0x00FE00
491 #elif defined(CONFIG_FOR_TPLINK_WA850RE_V2)
493 #define OFFSET_MAC_DATA_BLOCK 0x3c0000
494 #define OFFSET_MAC_DATA_BLOCK_LENGTH 0x010000
495 #define OFFSET_MAC_ADDRESS 0x000008
497 #elif defined(CONFIG_FOR_TPLINK_WR902AC_V1)
499 #define OFFSET_MAC_DATA_BLOCK 0x750000
500 #define OFFSET_MAC_DATA_BLOCK_LENGTH 0x010000
501 #define OFFSET_MAC_ADDRESS 0x000008
503 #elif defined(CONFIG_FOR_WALLYS_DR531)
505 #define OFFSET_MAC_DATA_BLOCK 0x030000
506 #define OFFSET_MAC_DATA_BLOCK_LENGTH 0x010000
507 #define OFFSET_MAC_ADDRESS 0x00F810
509 #elif defined(CONFIG_FOR_WHQX_E600G_V2) ||\
510 defined(CONFIG_FOR_WHQX_E600GAC_V2)
512 #define OFFSET_MAC_DATA_BLOCK 0x50000
513 #define OFFSET_MAC_DATA_BLOCK_LENGTH 0x10000
514 #define OFFSET_MAC_ADDRESS 0x00400
519 * =========================
520 * Custom changes per device
521 * =========================
525 * Comfast CF-E520N and E320Nv2 are limited to 64 KB only,
526 * disable some commands
528 #if defined(CONFIG_FOR_COMFAST_CF_E314N) ||\
529 defined(CONFIG_FOR_COMFAST_CF_E320N_V2) ||\
530 defined(CONFIG_FOR_COMFAST_CF_E520N) ||\
531 defined(CONFIG_FOR_COMFAST_CF_E530N)
533 #undef CONFIG_CMD_DHCP
534 #undef CONFIG_CMD_LOADB
535 #undef CONFIG_CMD_SNTP
536 #undef CONFIG_UPG_SCRIPTS_UBOOT
541 * ===========================
542 * HTTP recovery configuration
543 * ===========================
545 #define WEBFAILSAFE_UPLOAD_KERNEL_ADDRESS CFG_LOAD_ADDR
547 #if defined(CONFIG_FOR_ALFA_NETWORK_R36A)
549 #define WEBFAILSAFE_UPLOAD_ART_ADDRESS (CFG_FLASH_BASE + 0x70000)
551 #elif defined(CONFIG_FOR_COMFAST_CF_E314N) ||\
552 defined(CONFIG_FOR_COMFAST_CF_E320N_V2) ||\
553 defined(CONFIG_FOR_COMFAST_CF_E520N) ||\
554 defined(CONFIG_FOR_COMFAST_CF_E530N)
556 #define WEBFAILSAFE_UPLOAD_ART_ADDRESS (CFG_FLASH_BASE + 0x10000)
558 #elif defined(CONFIG_FOR_GLINET_GL_AR750)
560 #define WEBFAILSAFE_UPLOAD_ART_ADDRESS (CFG_FLASH_BASE + 0x50000)
562 #elif defined(CONFIG_FOR_WHQX_E600G_V2) ||\
563 defined(CONFIG_FOR_WHQX_E600GAC_V2)
565 #define WEBFAILSAFE_UPLOAD_ART_ADDRESS (CFG_FLASH_BASE + 0x60000)
569 /* Firmware size limit */
570 #if defined(CONFIG_FOR_ALFA_NETWORK_R36A)
572 #define WEBFAILSAFE_UPLOAD_LIMITED_AREA_IN_BYTES (512 * 1024)
574 #elif defined(CONFIG_FOR_COMFAST_CF_E314N) ||\
575 defined(CONFIG_FOR_COMFAST_CF_E320N_V2) ||\
576 defined(CONFIG_FOR_COMFAST_CF_E520N) ||\
577 defined(CONFIG_FOR_COMFAST_CF_E530N) ||\
578 defined(CONFIG_FOR_GAINSTRONG_OOLITE_V5_2) ||\
579 defined(CONFIG_FOR_GAINSTRONG_OOLITE_V5_2_DEV) ||\
580 defined(CONFIG_FOR_TPLINK_MR22U_V1) ||\
581 defined(CONFIG_FOR_TPLINK_MR3420_V3) ||\
582 defined(CONFIG_FOR_TPLINK_MR6400_V1V2) ||\
583 defined(CONFIG_FOR_TPLINK_WR802N_V1) ||\
584 defined(CONFIG_FOR_TPLINK_WR810N_V1) ||\
585 defined(CONFIG_FOR_TPLINK_WR810N_V2) ||\
586 defined(CONFIG_FOR_TPLINK_WR820N_V1_CN) ||\
587 defined(CONFIG_FOR_TPLINK_WR841N_V10) ||\
588 defined(CONFIG_FOR_TPLINK_WR841N_V11) ||\
589 defined(CONFIG_FOR_TPLINK_WR841N_V9) ||\
590 defined(CONFIG_FOR_TPLINK_WR842N_V3)
592 #define WEBFAILSAFE_UPLOAD_LIMITED_AREA_IN_BYTES (192 * 1024)
594 #elif defined(CONFIG_FOR_GLINET_GL_AR300M_LITE) ||\
595 defined(CONFIG_FOR_GLINET_GL_AR750) ||\
596 defined(CONFIG_FOR_P2W_CPE505N) ||\
597 defined(CONFIG_FOR_P2W_R602N) ||\
598 defined(CONFIG_FOR_WALLYS_DR531) ||\
599 defined(CONFIG_FOR_YUNCORE_AP90Q) ||\
600 defined(CONFIG_FOR_YUNCORE_CPE830) ||\
601 defined(CONFIG_FOR_YUNCORE_T830) ||\
602 defined(CONFIG_FOR_ZBTLINK_ZBT_WE1526)
604 #define WEBFAILSAFE_UPLOAD_LIMITED_AREA_IN_BYTES (384 * 1024)
606 #elif defined(CONFIG_FOR_TPLINK_WA850RE_V2) ||\
607 defined(CONFIG_FOR_WHQX_E600G_V2) ||\
608 defined(CONFIG_FOR_WHQX_E600GAC_V2)
610 #define WEBFAILSAFE_UPLOAD_LIMITED_AREA_IN_BYTES (448 * 1024)
612 #elif defined(CONFIG_FOR_TPLINK_WR902AC_V1)
614 #define WEBFAILSAFE_UPLOAD_LIMITED_AREA_IN_BYTES (832 * 1024)
619 * ========================
620 * PLL/Clocks configuration
621 * ========================
623 #if defined(CONFIG_FOR_TPLINK_MR22U_V1) ||\
624 defined(CONFIG_FOR_TPLINK_WA850RE_V2) ||\
625 defined(CONFIG_FOR_TPLINK_WR802N_V1) ||\
626 defined(CONFIG_FOR_TPLINK_WR820N_V1_CN) ||\
627 defined(CONFIG_FOR_TPLINK_WR841N_V9)
629 #define CONFIG_QCA_PLL QCA_PLL_PRESET_550_400_200
633 #define CONFIG_QCA_PLL QCA_PLL_PRESET_650_400_200
638 #if defined(CONFIG_FOR_ALFA_NETWORK_R36A)
640 #define CONFIG_QCA_PLL_IN_FLASH_BLOCK_OFFSET 0x70000
641 #define CONFIG_QCA_PLL_IN_FLASH_BLOCK_SIZE 0x10000
643 #elif defined(CONFIG_FOR_GAINSTRONG_OOLITE_V5_2) ||\
644 defined(CONFIG_FOR_GAINSTRONG_OOLITE_V5_2_DEV) ||\
645 defined(CONFIG_FOR_COMFAST_CF_E314N) ||\
646 defined(CONFIG_FOR_COMFAST_CF_E320N_V2) ||\
647 defined(CONFIG_FOR_COMFAST_CF_E520N) ||\
648 defined(CONFIG_FOR_COMFAST_CF_E530N) ||\
649 defined(CONFIG_FOR_TPLINK_MR22U_V1) ||\
650 defined(CONFIG_FOR_TPLINK_MR3420_V3) ||\
651 defined(CONFIG_FOR_TPLINK_MR6400_V1V2) ||\
652 defined(CONFIG_FOR_TPLINK_WA850RE_V2) ||\
653 defined(CONFIG_FOR_TPLINK_WR802N_V1) ||\
654 defined(CONFIG_FOR_TPLINK_WR810N_V1) ||\
655 defined(CONFIG_FOR_TPLINK_WR810N_V2) ||\
656 defined(CONFIG_FOR_TPLINK_WR820N_V1_CN) ||\
657 defined(CONFIG_FOR_TPLINK_WR841N_V10) ||\
658 defined(CONFIG_FOR_TPLINK_WR841N_V11) ||\
659 defined(CONFIG_FOR_TPLINK_WR841N_V9) ||\
660 defined(CONFIG_FOR_TPLINK_WR842N_V3) ||\
661 defined(CONFIG_FOR_TPLINK_WR902AC_V1)
663 #define CONFIG_QCA_PLL_IN_FLASH_BLOCK_OFFSET 0x10000
664 #define CONFIG_QCA_PLL_IN_FLASH_BLOCK_SIZE 0x10000
666 #elif defined(CONFIG_FOR_GLINET_GL_AR300M_LITE)
668 #define CONFIG_QCA_PLL_IN_FLASH_BLOCK_OFFSET 0xFF0000
669 #define CONFIG_QCA_PLL_IN_FLASH_BLOCK_SIZE 0x010000
671 #elif defined(CONFIG_FOR_GLINET_GL_AR750) ||\
672 defined(CONFIG_FOR_WHQX_E600G_V2) ||\
673 defined(CONFIG_FOR_WHQX_E600GAC_V2)
675 #define CONFIG_QCA_PLL_IN_FLASH_BLOCK_OFFSET 0x50000
676 #define CONFIG_QCA_PLL_IN_FLASH_BLOCK_SIZE 0x10000
678 #elif defined(CONFIG_FOR_P2W_CPE505N) ||\
679 defined(CONFIG_FOR_P2W_R602N) ||\
680 defined(CONFIG_FOR_YUNCORE_AP90Q) ||\
681 defined(CONFIG_FOR_YUNCORE_CPE830) ||\
682 defined(CONFIG_FOR_YUNCORE_T830) ||\
683 defined(CONFIG_FOR_ZBTLINK_ZBT_WE1526)
685 #define CONFIG_QCA_PLL_IN_FLASH_BLOCK_OFFSET 0x40000
686 #define CONFIG_QCA_PLL_IN_FLASH_BLOCK_SIZE 0x10000
688 #elif defined(CONFIG_FOR_WALLYS_DR531)
690 #define CONFIG_QCA_PLL_IN_FLASH_BLOCK_OFFSET 0x30000
691 #define CONFIG_QCA_PLL_IN_FLASH_BLOCK_SIZE 0x10000
696 * ==================================
697 * For upgrade scripts in environment
698 * ==================================
700 #if !defined(CONFIG_FOR_ALFA_NETWORK_R36A) &&\
701 !defined(CONFIG_FOR_COMFAST_CF_E314N) &&\
702 !defined(CONFIG_FOR_COMFAST_CF_E320N_V2) &&\
703 !defined(CONFIG_FOR_COMFAST_CF_E520N) &&\
704 !defined(CONFIG_FOR_COMFAST_CF_E530N) &&\
705 !defined(CONFIG_FOR_GLINET_GL_AR300M_LITE) &&\
706 !defined(CONFIG_FOR_GLINET_GL_AR750) &&\
707 !defined(CONFIG_FOR_P2W_CPE505N) &&\
708 !defined(CONFIG_FOR_P2W_R602N) &&\
709 !defined(CONFIG_FOR_WALLYS_DR531) &&\
710 !defined(CONFIG_FOR_WHQX_E600G_V2) &&\
711 !defined(CONFIG_FOR_WHQX_E600GAC_V2) &&\
712 !defined(CONFIG_FOR_YUNCORE_AP90Q) &&\
713 !defined(CONFIG_FOR_YUNCORE_CPE830) &&\
714 !defined(CONFIG_FOR_YUNCORE_T830) &&\
715 !defined(CONFIG_FOR_ZBTLINK_ZBT_WE1526)
717 #define CONFIG_UPG_UBOOT_SIZE_BACKUP_HEX 0x20000
721 #if defined(CONFIG_FOR_P2W_CPE505N) ||\
722 defined(CONFIG_FOR_P2W_R602N) ||\
723 defined(CONFIG_FOR_YUNCORE_AP90Q) ||\
724 defined(CONFIG_FOR_YUNCORE_CPE830) ||\
725 defined(CONFIG_FOR_YUNCORE_T830) ||\
726 defined(CONFIG_FOR_ZBTLINK_ZBT_WE1526)
728 #define CONFIG_UPG_SCRIPTS_FW_ADDR_HEX 0x9F050000
733 * ===================
734 * Other configuration
735 * ===================
738 /* Cache lock for stack */
739 #define CONFIG_INIT_SRAM_SP_OFFSET 0xbd001800
741 #endif /* _AP143_H */