Make itest command enabled by default
[oweals/u-boot_mod.git] / u-boot / include / configs / db12x.h
1 /*\r
2  * This file contains the configuration parameters for the DB12x (AR9344) board.\r
3  */\r
4 \r
5 #ifndef __CONFIG_H\r
6 #define __CONFIG_H\r
7 \r
8 #include <configs/ar7240.h>\r
9 #include <config.h>\r
10 \r
11 /*\r
12  * FLASH and environment organization\r
13  */\r
14 #define CFG_MAX_FLASH_BANKS                     1\r
15 #define CFG_MAX_FLASH_SECT                      4096    // 4 KB sectors in 16 MB flash\r
16 /*\r
17  * We boot from this flash\r
18  */\r
19 #define CFG_FLASH_BASE                                  0x9F000000\r
20 #ifdef COMPRESSED_UBOOT\r
21         #define BOOTSTRAP_TEXT_BASE                     CFG_FLASH_BASE\r
22         #define BOOTSTRAP_CFG_MONITOR_BASE      BOOTSTRAP_TEXT_BASE\r
23 #endif\r
24 \r
25 /*\r
26  * The following #defines are needed to get flash environment right\r
27  */\r
28 #define CFG_MONITOR_BASE        TEXT_BASE\r
29 #define CFG_MONITOR_LEN         (192 << 10)\r
30 \r
31 /*\r
32  * Default bootargs\r
33  */\r
34 #undef CONFIG_BOOTARGS\r
35 #if defined(CONFIG_FOR_TPLINK_WDR3600_WDR43X0_V1) || defined (CONFIG_FOR_TPLINK_WDR3500_V1)\r
36 #define CONFIG_BOOTARGS "console=ttyS0,115200 root=31:02 rootfstype=squashfs init=/sbin/init mtdparts=ath-nor0:256k(u-boot),64k(u-boot-env),6336k(rootfs),1408k(uImage),64k(mib0),64k(ART)"\r
37 #else\r
38 #define CONFIG_BOOTARGS "console=ttyS0,115200 root=31:02 rootfstype=squashfs init=/sbin/init mtdparts=ath-nor0:128k(u-boot),1024k(kernel),2816k(rootfs),64k(config),64k(art)"\r
39 #endif\r
40 \r
41 /*\r
42  * Other env default values\r
43  */\r
44 #undef CONFIG_BOOTFILE\r
45 #define CONFIG_BOOTFILE         "firmware.bin"\r
46 \r
47 #undef CONFIG_LOADADDR\r
48 #define CONFIG_LOADADDR         0x80800000\r
49 \r
50 #define CFG_LOAD_ADDR           0x9F020000\r
51 #define CONFIG_BOOTCOMMAND "bootm 0x9F020000"\r
52 \r
53 \r
54 #define CONFIG_IPADDR           192.168.1.1\r
55 #define CONFIG_SERVERIP         192.168.1.2\r
56 \r
57 #undef CFG_PLL_FREQ\r
58 #undef CFG_HZ\r
59 \r
60 // CPU-RAM-AHB frequency setting\r
61 #if !defined(CONFIG_AP123)\r
62 #define CFG_PLL_FREQ                            CFG_PLL_560_480_240\r
63 #define CFG_HZ_FALLBACK                         (560000000LU/2)\r
64 #else\r
65 #define CFG_PLL_FREQ                            CFG_PLL_533_400_200\r
66 #define CFG_HZ_FALLBACK                         (535000000LU/2)\r
67 #endif\r
68 \r
69 #define CFG_HZ                                          bd->bi_cfg_hz\r
70 #define AR7240_SPI_CONTROL                      0x43\r
71 #define AR7240_SPI_CONTROL_DEFAULT      AR7240_SPI_CONTROL\r
72 /*\r
73  * MIPS32 24K Processor Core Family Software User's Manual\r
74  *\r
75  * 6.2.9 Count Register (CP0 Register 9, Select 0)\r
76  * The Count register acts as a timer, incrementing at a constant\r
77  * rate, whether or not an instruction is executed, retired, or\r
78  * any forward progress is made through the pipeline.  The counter\r
79  * increments every other clock, if the DC bit in the Cause register\r
80  * is 0.\r
81  *\r
82  * Since the count is incremented every other tick, divide by 2\r
83  * XXX derive this from CFG_PLL_FREQ\r
84  */\r
85 \r
86 /*\r
87  * Cache lock for stack\r
88  */\r
89 #define CFG_INIT_SP_OFFSET              0x1000\r
90 \r
91 /*\r
92  * Address and size of Primary Environment Sector\r
93  */\r
94 #undef  CFG_ENV_IS_IN_FLASH\r
95 #define CFG_ENV_IS_NOWHERE      1\r
96 \r
97 #define CFG_ENV_ADDR            0x9F040000\r
98 #define CFG_ENV_SIZE            0x10000\r
99 \r
100 /*\r
101  * Available commands\r
102  */\r
103 #define CONFIG_COMMANDS (CFG_CMD_MEMORY | \\r
104                                                  CFG_CMD_DHCP   | \\r
105                                                  CFG_CMD_PING   | \\r
106                                                  CFG_CMD_FLASH  | \\r
107                                                  CFG_CMD_NET    | \\r
108                                                  CFG_CMD_RUN    | \\r
109                                                  CFG_CMD_DATE   | \\r
110                                                  CFG_CMD_SNTP   | \\r
111                                                  CFG_CMD_ECHO   | \\r
112                                                  CFG_CMD_BOOTD  | \\r
113                                                  CFG_CMD_ITEST)\r
114 \r
115 // Enable NetConsole and custom NetConsole port\r
116 #define CONFIG_NETCONSOLE\r
117 #define CONFIG_NETCONSOLE_PORT  6666\r
118 \r
119 /* DDR settings for WASP */\r
120 #define CFG_DDR_REFRESH_VAL     0x4270\r
121 #define CFG_DDR_CONFIG_VAL      0xc7bc8cd0\r
122 #define CFG_DDR_MODE_VAL_INIT   0x133\r
123 #define CFG_DDR_EXT_MODE_VAL    0x0\r
124 #define CFG_DDR_MODE_VAL        0x33\r
125 #define CFG_DDR_TRTW_VAL        0x1f\r
126 #define CFG_DDR_TWTR_VAL        0x1e\r
127 #define CFG_DDR_CONFIG2_VAL     0x9dd0e6a8\r
128 \r
129 #define CFG_DDR2_RD_DATA_THIS_CYCLE_VAL_32      0xff\r
130 #define CFG_DDR2_RD_DATA_THIS_CYCLE_VAL_16      0xffff\r
131 \r
132 #if DDR2_32BIT_SUPPORT\r
133         #define CFG_DDR2_RD_DATA_THIS_CYCLE_VAL         CFG_DDR2_RD_DATA_THIS_CYCLE_VAL_32\r
134 #else\r
135         #define CFG_DDR2_RD_DATA_THIS_CYCLE_VAL         CFG_DDR2_RD_DATA_THIS_CYCLE_VAL_16\r
136 #endif\r
137 \r
138 #define CFG_DDR1_RD_DATA_THIS_CYCLE_VAL         0xffff\r
139 #define CFG_SDRAM_RD_DATA_THIS_CYCLE_VAL        0xffffffff\r
140 \r
141 /* DDR2 Init values */\r
142 #define CFG_DDR2_EXT_MODE_VAL    0x402\r
143 \r
144 #define CONFIG_NET_MULTI\r
145 \r
146 #ifdef CFG_ATHRS27_PHY\r
147         /* use eth1(LAN) as the net interface */\r
148         #define CONFIG_AG7240_SPEPHY\r
149 #endif\r
150 \r
151 #define CONFIG_PCI 1\r
152 \r
153 /*\r
154  * Web Failsafe configuration\r
155  */\r
156 #define WEBFAILSAFE_UPLOAD_RAM_ADDRESS                          CONFIG_LOADADDR\r
157 #define WEBFAILSAFE_UPLOAD_UBOOT_ADDRESS                        CFG_FLASH_BASE\r
158 \r
159 // Firmware partition offset\r
160 #define WEBFAILSAFE_UPLOAD_KERNEL_ADDRESS                       WEBFAILSAFE_UPLOAD_UBOOT_ADDRESS + 0x20000\r
161 \r
162 // U-Boot partition size\r
163 #define WEBFAILSAFE_UPLOAD_UBOOT_SIZE_IN_BYTES          (64 * 1024)\r
164 \r
165 // ART partition size\r
166 #define WEBFAILSAFE_UPLOAD_ART_SIZE_IN_BYTES            (64 * 1024)\r
167 \r
168 // max. firmware size <= (FLASH_SIZE -  WEBFAILSAFE_UPLOAD_LIMITED_AREA_IN_BYTES)\r
169 // TP-Link: 64k(U-Boot),64k(MAC/model/WPS pin block),64k(ART)\r
170 #define WEBFAILSAFE_UPLOAD_LIMITED_AREA_IN_BYTES        (192 * 1024)\r
171 \r
172 // progress state info\r
173 #define WEBFAILSAFE_PROGRESS_START                              0\r
174 #define WEBFAILSAFE_PROGRESS_TIMEOUT                    1\r
175 #define WEBFAILSAFE_PROGRESS_UPLOAD_READY               2\r
176 #define WEBFAILSAFE_PROGRESS_UPGRADE_READY              3\r
177 #define WEBFAILSAFE_PROGRESS_UPGRADE_FAILED             4\r
178 \r
179 // update type\r
180 #define WEBFAILSAFE_UPGRADE_TYPE_FIRMWARE               0\r
181 #define WEBFAILSAFE_UPGRADE_TYPE_UBOOT                  1\r
182 #define WEBFAILSAFE_UPGRADE_TYPE_ART                    2\r
183 \r
184 /*-----------------------------------------------------------------------*/\r
185 \r
186 /* For Merlin, both PCI, PCI-E interfaces are valid */\r
187 #define AR7240_ART_PCICFG_OFFSET        12\r
188 \r
189 #define WLANCAL                                         0x9fff1000\r
190 #define CFG_MII0_RMII                           1\r
191 #define CFG_BOOTM_LEN                           (16 << 20) /* 16 MB */\r
192 \r
193 #undef DEBUG\r
194 #define milisecdelay(_x)                        udelay((_x) * 1000)\r
195 \r
196 /* MAC address, model and PIN number offsets in FLASH */\r
197 #define OFFSET_MAC_DATA_BLOCK                   0x010000\r
198 #define OFFSET_MAC_DATA_BLOCK_LENGTH    0x010000\r
199 #define OFFSET_MAC_ADDRESS                              0x00FC00\r
200 #define OFFSET_ROUTER_MODEL                             0x00FD00\r
201 #define OFFSET_PIN_NUMBER                               0x00FE00\r
202 \r
203 #include <cmd_confdefs.h>\r
204 \r
205 #endif  /* __CONFIG_H */\r