forked from pepe2k/u-boot_mod
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ap121.h
596 lines (425 loc) · 17.9 KB
/
ap121.h
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
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
/*
* Copyright (C) 2016 Piotr Dymacz <[email protected]>
*
* This file contains the configuration parameters
* for Qualcomm Atheros AR933x based devices
*
* Reference designs: AP121
*
* SPDX-License-Identifier: GPL-2.0
*/
#ifndef _AP121_H
#define _AP121_H
#include <config.h>
#include <configs/qca9k_common.h>
#include <soc/soc_common.h>
/*
* ==================
* GPIO configuration
* ==================
*/
#if defined(CONFIG_FOR_8DEVICES_CARAMBOLA2)
#define CONFIG_QCA_GPIO_MASK_LED_ACT_H GPIO13 | GPIO14
#define CONFIG_QCA_GPIO_MASK_LED_ACT_L GPIO0
#elif defined(CONFIG_FOR_ALFA_NETWORK_AP121F)
#define CONFIG_QCA_GPIO_MASK_LED_ACT_H GPIO0
#define CONFIG_QCA_GPIO_MASK_LED_ACT_L GPIO17
#define CONFIG_QCA_GPIO_MASK_IN GPIO21
#define CONFIG_QCA_GPIO_MASK_OUT_INIT_H GPIO26
#define CONFIG_QCA_GPIO_MASK_OUT_INIT_L GPIO27
#elif defined(CONFIG_FOR_ALFA_NETWORK_HORNET_UB)
#define CONFIG_QCA_GPIO_MASK_LED_ACT_H GPIO0 | GPIO1 | GPIO13
#define CONFIG_QCA_GPIO_MASK_LED_ACT_L GPIO17 | GPIO27
#define CONFIG_QCA_GPIO_MASK_IN GPIO11
#define CONFIG_QCA_GPIO_MASK_OUT_INIT_H GPIO26 | GPIO28
#elif defined(CONFIG_FOR_ALFA_NETWORK_TUBE2H)
#define CONFIG_QCA_GPIO_MASK_LED_ACT_H GPIO0 | GPIO1 | GPIO13
#define CONFIG_QCA_GPIO_MASK_LED_ACT_L GPIO17 | GPIO27
#define CONFIG_QCA_GPIO_MASK_OUT_INIT_H GPIO28
#define CONFIG_QCA_GPIO_MASK_OUT_INIT_L GPIO18 | GPIO22
#elif defined(CONFIG_FOR_CREATCOMM_D3321)
#define CONFIG_QCA_GPIO_MASK_LED_ACT_H GPIO0 | GPIO13 | GPIO14 |\
GPIO15 | GPIO16
#define CONFIG_QCA_GPIO_MASK_LED_ACT_L GPIO17 | GPIO27
#elif defined(CONFIG_FOR_DLINK_DIR505_A1)
#define CONFIG_QCA_GPIO_MASK_LED_ACT_L GPIO26 | GPIO27
#elif defined(CONFIG_FOR_DRAGINO_MS14) ||\
defined(CONFIG_FOR_VILLAGE_TELCO_MP2)
#define CONFIG_QCA_GPIO_MASK_LED_ACT_H GPIO0 | GPIO28
#define CONFIG_QCA_GPIO_MASK_LED_ACT_L GPIO13 | GPIO17
#elif defined(CONFIG_FOR_GAINSTRONG_OOLITE_V1_DEV)
#define CONFIG_QCA_GPIO_MASK_LED_ACT_L GPIO13 | GPIO15 | GPIO17 |\
GPIO27
#elif defined(CONFIG_FOR_GLINET_6416)
#define CONFIG_QCA_GPIO_MASK_LED_ACT_H GPIO0 | GPIO13
#elif defined(CONFIG_FOR_GLINET_GL_AR150)
#define CONFIG_QCA_GPIO_MASK_LED_ACT_H GPIO0 | GPIO13 | GPIO15
#define CONFIG_QCA_GPIO_MASK_IN GPIO1 | GPIO7 | GPIO8 |\
GPIO14 | GPIO16 | GPIO17
#define CONFIG_QCA_GPIO_MASK_OUT_INIT_H GPIO6
#elif defined(CONFIG_FOR_GLINET_GL_USB150)
#define CONFIG_QCA_GPIO_MASK_LED_ACT_H GPIO0
#define CONFIG_QCA_GPIO_MASK_OUT_INIT_H GPIO13
#define CONFIG_QCA_GPIO_MASK_OUT_INIT_L GPIO7
#elif defined(CONFIG_FOR_HAK5_LAN_TURTLE)
#define CONFIG_QCA_GPIO_MASK_LED_ACT_L GPIO13
#elif defined(CONFIG_FOR_HAK5_PACKET_SQUIRREL)
#define CONFIG_QCA_GPIO_MASK_LED_ACT_L GPIO19 | GPIO22 | GPIO23
#define CONFIG_QCA_GPIO_MASK_IN GPIO18 | GPIO20 | GPIO21 |\
GPIO24
#elif defined(CONFIG_FOR_HAK5_WIFI_PINEAPPLE_NANO)
#define CONFIG_QCA_GPIO_MASK_LED_ACT_L GPIO18
#define CONFIG_QCA_GPIO_MASK_IN GPIO19 | GPIO20
#define CONFIG_QCA_GPIO_MASK_OUT_INIT_L GPIO23
#elif defined(CONFIG_FOR_TPLINK_MR10U_V1)
#define CONFIG_QCA_GPIO_MASK_LED_ACT_L GPIO27
#define CONFIG_QCA_GPIO_MASK_OUT_INIT_H GPIO18
#elif defined(CONFIG_FOR_TPLINK_MR13U_V1)
#define CONFIG_QCA_GPIO_MASK_LED_ACT_H GPIO27
#define CONFIG_QCA_GPIO_MASK_IN GPIO6 | GPIO7
#define CONFIG_QCA_GPIO_MASK_OUT_INIT_H GPIO18
#elif defined(CONFIG_FOR_TPLINK_MR3020_V1)
#define CONFIG_QCA_GPIO_MASK_LED_ACT_H GPIO0
#define CONFIG_QCA_GPIO_MASK_LED_ACT_L GPIO17 | GPIO26 | GPIO27
#define CONFIG_QCA_GPIO_MASK_IN GPIO18 | GPIO20
#define CONFIG_QCA_GPIO_MASK_OUT_INIT_H GPIO8
#elif defined(CONFIG_FOR_TPLINK_MR3040_V1V2)
#define CONFIG_QCA_GPIO_MASK_LED_ACT_L GPIO17 | GPIO26 | GPIO27
#define CONFIG_QCA_GPIO_MASK_OUT_INIT_H GPIO18
#elif defined(CONFIG_FOR_TPLINK_MR3220_V2)
#define CONFIG_QCA_GPIO_MASK_LED_ACT_H GPIO0 | GPIO1 | GPIO13 |\
GPIO14 | GPIO15 | GPIO16 |\
GPIO26
#define CONFIG_QCA_GPIO_MASK_LED_ACT_L GPIO17 | GPIO27
#define CONFIG_QCA_GPIO_MASK_OUT_INIT_H GPIO8
#elif defined(CONFIG_FOR_TPLINK_WR703N_V1) ||\
defined(CONFIG_FOR_TPLINK_WR710N_V1)
#define CONFIG_QCA_GPIO_MASK_LED_ACT_L GPIO27
#define CONFIG_QCA_GPIO_MASK_OUT_INIT_H GPIO8
#elif defined(CONFIG_FOR_TPLINK_WR720N_V3)
#define CONFIG_QCA_GPIO_MASK_LED_ACT_L GPIO27
#define CONFIG_QCA_GPIO_MASK_IN GPIO18 | GPIO20
#define CONFIG_QCA_GPIO_MASK_OUT_INIT_H GPIO8
#elif defined(CONFIG_FOR_TPLINK_WR740N_V4)
#define CONFIG_QCA_GPIO_MASK_LED_ACT_H GPIO0 | GPIO1 | GPIO13 |\
GPIO14 | GPIO15 | GPIO16
#define CONFIG_QCA_GPIO_MASK_LED_ACT_L GPIO17 | GPIO27
#define CONFIG_QCA_GPIO_MASK_IN GPIO26
#elif defined(CONFIG_FOR_UNWIRED_DEVICES_UNWIRED_ONE)
#define CONFIG_QCA_GPIO_MASK_LED_ACT_L GPIO27
#endif
/*
* ================
* Default bootargs
* ================
*/
#if defined(CONFIG_FOR_8DEVICES_CARAMBOLA2)
#define CONFIG_BOOTARGS "console=ttyS0,115200 root=31:02 "\
"rootfstype=squashfs init=/sbin/init "\
"mtdparts=ar7240-nor0:256k(u-boot),64k(u-boot-env),16000k(firmware),64k(art)"
#elif defined(CONFIG_FOR_ALFA_NETWORK_AP121F)
#define CONFIG_BOOTARGS "board=AP121F console=ttyATH0,115200 "\
"rootfstype=squashfs,jffs2 noinitrd "\
"mtdparts=spi0.0:192k(u-boot)ro,64k(u-boot-env),64k(art)ro,-(firmware)"
#elif defined(CONFIG_FOR_ALFA_NETWORK_HORNET_UB) ||\
defined(CONFIG_FOR_ALFA_NETWORK_TUBE2H)
#define CONFIG_BOOTARGS "console=ttyS0,115200 root=31:02 "\
"rootfstype=squashfs init=/sbin/init "\
"mtdparts=ar7240-nor0:256k(u-boot),64k(u-boot-env),6144k(rootfs),1600k(uImage),64k(NVRAM),64k(ART)"
#elif defined(CONFIG_FOR_CREATCOMM_D3321)
#define CONFIG_BOOTARGS "console=ttyS0,115200 root=31:03 "\
"rootfstype=squashfs init=/sbin/init "\
"mtdparts=ar7240-nor0:256k(u-boot),64k(u-boot-env),1216k(uImage),5952k(rootfs),256k(config),384k(customer),64k(ART) mem=32M"
#elif defined(CONFIG_FOR_DLINK_DIR505_A1)
#define CONFIG_BOOTARGS "console=ttyS0,115200 root=31:06 "\
"rootfstype=squashfs init=/sbin/init "\
"mtdparts=ar7240-nor0:64k(u-boot),64k(art),64k(mac),64k(nvram),256k(language),1024k(uImage),6656k(rootfs)"
#elif defined(CONFIG_FOR_DRAGINO_MS14) ||\
defined(CONFIG_FOR_VILLAGE_TELCO_MP2)
#define CONFIG_BOOTARGS "console=ttyS0,115200 root=31:02 "\
"rootfstype=squashfs init=/sbin/init "\
"mtdparts=ar7240-nor0:192k(u-boot),64k(u-boot-env),16064k(firmware),64k(art)"
#elif defined(CONFIG_FOR_GAINSTRONG_OOLITE_V1_DEV)
#define CONFIG_BOOTARGS "console=ttyS0,115200 root=31:02 "\
"rootfstype=squashfs init=/sbin/init "\
"mtdparts=ar7240-nor0:128k(u-boot),1024k(kernel),2816k(rootfs),64k(config),64k(art)"
#elif defined(CONFIG_FOR_GLINET_6416) ||\
defined(CONFIG_FOR_HAK5_LAN_TURTLE) ||\
defined(CONFIG_FOR_HAK5_PACKET_SQUIRREL) ||\
defined(CONFIG_FOR_HAK5_WIFI_PINEAPPLE_NANO) ||\
defined(CONFIG_FOR_TPLINK_MR10U_V1) ||\
defined(CONFIG_FOR_TPLINK_MR13U_V1) ||\
defined(CONFIG_FOR_TPLINK_MR3020_V1) ||\
defined(CONFIG_FOR_TPLINK_MR3040_V1V2) ||\
defined(CONFIG_FOR_TPLINK_MR3220_V2) ||\
defined(CONFIG_FOR_TPLINK_WR703N_V1) ||\
defined(CONFIG_FOR_TPLINK_WR720N_V3) ||\
defined(CONFIG_FOR_TPLINK_WR740N_V4)
#define CONFIG_BOOTARGS "console=ttyS0,115200 root=31:02 "\
"rootfstype=squashfs init=/sbin/init "\
"mtdparts=ar7240-nor0:128k(u-boot),1024k(kernel),2816k(rootfs),64k(config),64k(art)"
#elif defined(CONFIG_FOR_GLINET_GL_AR150) ||\
defined(CONFIG_FOR_GLINET_GL_USB150)
#define CONFIG_BOOTARGS "console=ttyATH0,115200 board=domino root=31:03 "\
"rootfstype=squashfs,jffs2 noinitrd "\
"mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1280k(kernel),14656k(rootfs),64k(nvram),64k(art)ro,15936k@0x50000(firmware)"
#elif defined(CONFIG_FOR_TPLINK_WR710N_V1)
#define CONFIG_BOOTARGS "console=ttyS0,115200 root=31:02 "\
"rootfstype=squashfs init=/sbin/init "\
"mtdparts=ar7240-nor0:128k(u-boot),1024k(kernel),6912k(rootfs),64k(config),64k(art)"
#elif defined(CONFIG_FOR_UNWIRED_DEVICES_UNWIRED_ONE)
#define CONFIG_BOOTARGS "console=ttyS0,115200 root=31:02 "\
"rootfstype=squashfs init=/sbin/init "\
"mtdparts=ar7240-nor0:128k(u-boot),64k(u-boot-env),16128k(firmware),64k(art)"
#endif
/*
* =============================
* Load address and boot command
* =============================
*/
#if defined(CONFIG_FOR_8DEVICES_CARAMBOLA2) ||\
defined(CONFIG_FOR_ALFA_NETWORK_AP121F) ||\
defined(CONFIG_FOR_ALFA_NETWORK_HORNET_UB) ||\
defined(CONFIG_FOR_ALFA_NETWORK_TUBE2H) ||\
defined(CONFIG_FOR_CREATCOMM_D3321) ||\
defined(CONFIG_FOR_GLINET_GL_AR150) ||\
defined(CONFIG_FOR_GLINET_GL_USB150)
#define CFG_LOAD_ADDR 0x9F050000
#elif defined(CONFIG_FOR_DLINK_DIR505_A1)
#define CFG_LOAD_ADDR 0x9F080000
#elif defined(CONFIG_FOR_DRAGINO_MS14) ||\
defined(CONFIG_FOR_VILLAGE_TELCO_MP2)
#define CFG_LOAD_ADDR 0x9F040000
#elif defined(CONFIG_FOR_UNWIRED_DEVICES_UNWIRED_ONE)
#define CFG_LOAD_ADDR 0x9F030000
#else
#define CFG_LOAD_ADDR 0x9F020000
#endif
#if defined(CONFIG_FOR_ALFA_NETWORK_HORNET_UB) ||\
defined(CONFIG_FOR_ALFA_NETWORK_TUBE2H)
#define CONFIG_BOOTCOMMAND "bootm 0x9F050000 || bootm 0x9F650000 || bootm 0x9FE50000"
#else
#define CONFIG_BOOTCOMMAND "bootm " MK_STR(CFG_LOAD_ADDR)
#endif
/*
* =========================
* Environment configuration
* =========================
*/
#if defined(CONFIG_FOR_8DEVICES_CARAMBOLA2) ||\
defined(CONFIG_FOR_ALFA_NETWORK_HORNET_UB) ||\
defined(CONFIG_FOR_ALFA_NETWORK_TUBE2H) ||\
defined(CONFIG_FOR_CREATCOMM_D3321) ||\
defined(CONFIG_FOR_GLINET_GL_AR150) ||\
defined(CONFIG_FOR_GLINET_GL_USB150)
#define CFG_ENV_ADDR 0x9F040000
#define CFG_ENV_SIZE 0x8000
#define CFG_ENV_SECT_SIZE 0x10000
#elif defined(CONFIG_FOR_ALFA_NETWORK_AP121F)
#define CFG_ENV_ADDR 0x9F030000
#define CFG_ENV_SIZE 0x10000
#elif defined(CONFIG_FOR_DLINK_DIR505_A1)
#define CFG_ENV_ADDR 0x9F028000
#define CFG_ENV_SIZE 0x7C00
#define CFG_ENV_SECT_SIZE 0x10000
#elif defined(CONFIG_FOR_DRAGINO_MS14) ||\
defined(CONFIG_FOR_VILLAGE_TELCO_MP2)
#define CFG_ENV_ADDR 0x9F030000
#define CFG_ENV_SIZE 0x8000
#define CFG_ENV_SECT_SIZE 0x10000
#elif defined(CONFIG_FOR_UNWIRED_DEVICES_UNWIRED_ONE)
#define CFG_ENV_ADDR 0x9F020000
#define CFG_ENV_SIZE 0x8000
#define CFG_ENV_SECT_SIZE 0x10000
#else
#define CFG_ENV_ADDR 0x9F01EC00
#define CFG_ENV_SIZE 0x1000
#define CFG_ENV_SECT_SIZE 0x10000
#endif
/*
* ===========================
* List of available baudrates
* ===========================
*/
#define CFG_BAUDRATE_TABLE \
{ 600, 1200, 2400, 4800, 9600, 14400, \
19200, 28800, 38400, 56000, 57600, 115200, \
128000, 153600, 230400, 250000, 256000, 460800, \
576000, 921600, 1000000, 1152000, 1500000, 2000000 }
/*
* ==================================================
* MAC address/es, model and WPS pin offsets in FLASH
* ==================================================
*/
#if defined(CONFIG_FOR_8DEVICES_CARAMBOLA2) ||\
defined(CONFIG_FOR_ALFA_NETWORK_HORNET_UB) ||\
defined(CONFIG_FOR_ALFA_NETWORK_TUBE2H) ||\
defined(CONFIG_FOR_CREATCOMM_D3321) ||\
defined(CONFIG_FOR_DRAGINO_MS14) ||\
defined(CONFIG_FOR_VILLAGE_TELCO_MP2)
#define OFFSET_MAC_DATA_BLOCK 0xFF0000
#define OFFSET_MAC_DATA_BLOCK_LENGTH 0x010000
#define OFFSET_MAC_ADDRESS 0x000000
#define OFFSET_MAC_ADDRESS2 0x000006
#elif defined(CONFIG_FOR_ALFA_NETWORK_AP121F)
#define OFFSET_MAC_DATA_BLOCK 0x40000
#define OFFSET_MAC_DATA_BLOCK_LENGTH 0x10000
#define OFFSET_MAC_ADDRESS 0x00000
#elif defined(CONFIG_FOR_DLINK_DIR505_A1)
/*
* DIR-505 has two MAC addresses inside dedicated MAC partition
* They are stored in plain text...
* TODO: read/write MAC stored as plain text
* #define OFFSET_MAC_DATA_BLOCK 0x02000
* #define OFFSET_MAC_DATA_BLOCK_LENGTH 0x010000
* #define OFFSET_MAC_ADDRESS 0x000004
* #define OFFSET_MAC_ADDRESS2 0x000016
*/
#elif defined(CONFIG_FOR_GAINSTRONG_OOLITE_V1_DEV)
#define OFFSET_MAC_DATA_BLOCK 0x010000
#define OFFSET_MAC_DATA_BLOCK_LENGTH 0x010000
#define OFFSET_MAC_ADDRESS 0x00FC00
#elif defined(CONFIG_FOR_GLINET_GL_AR150) ||\
defined(CONFIG_FOR_GLINET_GL_USB150) ||\
defined(CONFIG_FOR_UNWIRED_DEVICES_UNWIRED_ONE)
#define OFFSET_MAC_DATA_BLOCK 0xFF0000
#define OFFSET_MAC_DATA_BLOCK_LENGTH 0x010000
#define OFFSET_MAC_ADDRESS 0x000000
#elif defined(CONFIG_FOR_HAK5_WIFI_PINEAPPLE_NANO)
#define OFFSET_MAC_DATA_BLOCK 0xFF0000
#define OFFSET_MAC_DATA_BLOCK_LENGTH 0x010000
#define OFFSET_MAC_ADDRESS 0x000006
#else
#define OFFSET_MAC_DATA_BLOCK 0x010000
#define OFFSET_MAC_DATA_BLOCK_LENGTH 0x010000
#define OFFSET_MAC_ADDRESS 0x00FC00
#endif
#if !defined(CONFIG_FOR_8DEVICES_CARAMBOLA2) &&\
!defined(CONFIG_FOR_ALFA_NETWORK_AP121F) &&\
!defined(CONFIG_FOR_ALFA_NETWORK_HORNET_UB) &&\
!defined(CONFIG_FOR_ALFA_NETWORK_TUBE2H) &&\
!defined(CONFIG_FOR_CREATCOMM_D3321) &&\
!defined(CONFIG_FOR_DLINK_DIR505_A1) &&\
!defined(CONFIG_FOR_DRAGINO_MS14) &&\
!defined(CONFIG_FOR_GAINSTRONG_OOLITE_V1_DEV) &&\
!defined(CONFIG_FOR_GLINET_6416) &&\
!defined(CONFIG_FOR_GLINET_GL_AR150) &&\
!defined(CONFIG_FOR_GLINET_GL_USB150) &&\
!defined(CONFIG_FOR_HAK5_LAN_TURTLE) &&\
!defined(CONFIG_FOR_HAK5_PACKET_SQUIRREL) &&\
!defined(CONFIG_FOR_HAK5_WIFI_PINEAPPLE_NANO) &&\
!defined(CONFIG_FOR_UNWIRED_DEVICES_UNWIRED_ONE) &&\
!defined(CONFIG_FOR_VILLAGE_TELCO_MP2)
#define OFFSET_ROUTER_MODEL 0xFD00
#endif
#if defined(CONFIG_FOR_TPLINK_MR3020_V1) ||\
defined(CONFIG_FOR_TPLINK_MR3220_V2) ||\
defined(CONFIG_FOR_TPLINK_WR710N_V1) ||\
defined(CONFIG_FOR_TPLINK_WR740N_V4)
#define OFFSET_PIN_NUMBER 0xFE00
#endif
/*
* =========================
* Custom changes per device
* =========================
*/
/* Dragino MS14 uses different IP addresses */
#if defined(CONFIG_FOR_DRAGINO_MS14)
#undef CONFIG_IPADDR
#define CONFIG_IPADDR 192.168.255.1
#undef CONFIG_SERVERIP
#define CONFIG_SERVERIP 192.168.255.2
#endif
/* Dragino MS14 and Unwired One boards use different prompts */
#if defined(CONFIG_FOR_UNWIRED_DEVICES_UNWIRED_ONE)
#undef CFG_PROMPT
#define CFG_PROMPT "BSB> "
#elif defined(CONFIG_FOR_DRAGINO_MS14) ||\
defined(CONFIG_FOR_VILLAGE_TELCO_MP2)
#undef CFG_PROMPT
#define CFG_PROMPT "dr_boot> "
#endif
/* D-Link DIR-505 is limited to 64 KB only and doesn't use env */
#if defined(CONFIG_FOR_DLINK_DIR505_A1)
#undef CONFIG_CMD_DHCP
#undef CONFIG_CMD_LOADB
#endif
/*
* ===========================
* HTTP recovery configuration
* ===========================
*/
#define WEBFAILSAFE_UPLOAD_KERNEL_ADDRESS CFG_LOAD_ADDR
#if defined(CONFIG_FOR_ALFA_NETWORK_AP121F)
#define WEBFAILSAFE_UPLOAD_ART_ADDRESS (CFG_FLASH_BASE + 0x40000)
#elif defined(CONFIG_FOR_DLINK_DIR505_A1)
#define WEBFAILSAFE_UPLOAD_ART_ADDRESS (CFG_FLASH_BASE + 0x10000)
#endif
/* Firmware size limit */
#if defined(CONFIG_FOR_8DEVICES_CARAMBOLA2) ||\
defined(CONFIG_FOR_GLINET_GL_AR150) ||\
defined(CONFIG_FOR_GLINET_GL_USB150)
#define WEBFAILSAFE_UPLOAD_LIMITED_AREA_IN_BYTES (384 * 1024)
#elif defined(CONFIG_FOR_ALFA_NETWORK_AP121F) ||\
defined(CONFIG_FOR_DRAGINO_MS14) ||\
defined(CONFIG_FOR_VILLAGE_TELCO_MP2)
#define WEBFAILSAFE_UPLOAD_LIMITED_AREA_IN_BYTES (320 * 1024)
#elif defined(CONFIG_FOR_ALFA_NETWORK_HORNET_UB) ||\
defined(CONFIG_FOR_ALFA_NETWORK_TUBE2H)
#define WEBFAILSAFE_UPLOAD_LIMITED_AREA_IN_BYTES (448 * 1024)
#elif defined(CONFIG_FOR_CREATCOMM_D3321)
#define WEBFAILSAFE_UPLOAD_LIMITED_AREA_IN_BYTES (1856 * 1024)
#elif defined(CONFIG_FOR_DLINK_DIR505_A1)
#define WEBFAILSAFE_UPLOAD_LIMITED_AREA_IN_BYTES (512 * 1024)
#elif defined(CONFIG_FOR_UNWIRED_DEVICES_UNWIRED_ONE)
#define WEBFAILSAFE_UPLOAD_LIMITED_AREA_IN_BYTES (256 * 1024)
#else
#define WEBFAILSAFE_UPLOAD_LIMITED_AREA_IN_BYTES (192 * 1024)
#endif
/*
* ========================
* PLL/Clocks configuration
* ========================
*/
#define CONFIG_QCA_PLL QCA_PLL_PRESET_400_400_200
#if defined(CONFIG_FOR_8DEVICES_CARAMBOLA2) ||\
defined(CONFIG_FOR_ALFA_NETWORK_AP121F) ||\
defined(CONFIG_FOR_ALFA_NETWORK_HORNET_UB) ||\
defined(CONFIG_FOR_ALFA_NETWORK_TUBE2H) ||\
defined(CONFIG_FOR_CREATCOMM_D3321) ||\
defined(CONFIG_FOR_GLINET_GL_AR150) ||\
defined(CONFIG_FOR_GLINET_GL_USB150)
#define CONFIG_QCA_PLL_IN_FLASH_BLOCK_OFFSET 0x40000
#define CONFIG_QCA_PLL_IN_FLASH_BLOCK_SIZE 0x10000
#elif defined(CONFIG_FOR_DLINK_DIR505_A1) ||\
defined(CONFIG_FOR_UNWIRED_DEVICES_UNWIRED_ONE)
#define CONFIG_QCA_PLL_IN_FLASH_BLOCK_OFFSET 0x20000
#define CONFIG_QCA_PLL_IN_FLASH_BLOCK_SIZE 0x10000
#elif defined(CONFIG_FOR_DRAGINO_MS14) ||\
defined(CONFIG_FOR_VILLAGE_TELCO_MP2)
#define CONFIG_QCA_PLL_IN_FLASH_BLOCK_OFFSET 0x30000
#define CONFIG_QCA_PLL_IN_FLASH_BLOCK_SIZE 0x10000
#else
#define CONFIG_QCA_PLL_IN_FLASH_BLOCK_OFFSET 0x10000
#define CONFIG_QCA_PLL_IN_FLASH_BLOCK_SIZE 0x10000
#endif
/*
* ==================================
* For upgrade scripts in environment
* ==================================
*/
#if !defined(CONFIG_FOR_8DEVICES_CARAMBOLA2) &&\
!defined(CONFIG_FOR_ALFA_NETWORK_AP121F) &&\
!defined(CONFIG_FOR_ALFA_NETWORK_HORNET_UB) &&\
!defined(CONFIG_FOR_ALFA_NETWORK_TUBE2H) &&\
!defined(CONFIG_FOR_CREATCOMM_D3321) &&\
!defined(CONFIG_FOR_DLINK_DIR505_A1) &&\
!defined(CONFIG_FOR_DRAGINO_MS14) &&\
!defined(CONFIG_FOR_GLINET_GL_AR150) &&\
!defined(CONFIG_FOR_GLINET_GL_USB150) &&\
!defined(CONFIG_FOR_HAK5_WIFI_PINEAPPLE_NANO) &&\
!defined(CONFIG_FOR_UNWIRED_DEVICES_UNWIRED_ONE) &&\
!defined(CONFIG_FOR_VILLAGE_TELCO_MP2)
#define CONFIG_UPG_SCRIPTS_UBOOT_SIZE_BCKP_HEX 0x20000
#endif
#endif /* _AP121_H */