tizen 2.4 release
[profile/mobile/platform/kernel/u-boot-tm1.git] / include / configs / sc9620fpga.h
1 /*\r
2  * (C) Copyright 2009 DENX Software Engineering\r
3  * Author: John Rigby <jrigby@gmail.com>\r
4  *\r
5  * This program is free software; you can redistribute it and/or\r
6  * modify it under the terms of the GNU General Public License as\r
7  * published by the Free Software Foundation; either version 2 of\r
8  * the License, or (at your option) any later version.\r
9  *\r
10  * This program is distributed in the hope that it will be useful,\r
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
13  * GNU General Public License for more details.\r
14  *\r
15  * You should have received a copy of the GNU General Public License\r
16  * along with this program; if not, write to the Free Software\r
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,\r
18  * MA 02111-1307 USA\r
19  */\r
20 \r
21 #ifndef __CONFIG_H\r
22 #define __CONFIG_H\r
23 //only used in fdl2 .in uart download, the debug infors  from  serial will break the download process.\r
24 #define CONFIG_FDL2_PRINT        0\r
25 #define BOOT_NATIVE_LINUX        1\r
26 #define BOOT_NATIVE_LINUX_MODEM  1\r
27 #define CALIBRATION_FLAG         0x897FFC00\r
28 #define CALIBRATION_FLAG_WCDMA   0x93FFEC00\r
29 #define CONFIG_SILENT_CONSOLE\r
30 #define CONFIG_GPIOLIB 1\r
31 //#define NAND_DEBUG  \r
32 //#define DEBUG\r
33 #define U_BOOT_SPRD_VER 1\r
34 /*#define SPRD_EVM_TAG_ON 1*/\r
35 #ifdef SPRD_EVM_TAG_ON\r
36 #define SPRD_EVM_ADDR_START 0x00026000\r
37 #define SPRD_EVM_TAG(_x) (*(((unsigned long *)SPRD_EVM_ADDR_START)+_x) = *(volatile unsigned long *)0x87003004)\r
38 #endif\r
39 #define CONFIG_L2_OFF                   1\r
40 \r
41 #define BOOT_DEBUG 1\r
42 \r
43 #define CONFIG_YAFFS2 1\r
44 \r
45 #define BOOT_PART "boot"\r
46 //#define BOOT_PART "kernel"\r
47 #define RECOVERY_PART "recovery"\r
48 /*\r
49  * SPREADTRUM BIGPHONE board - SoC Configuration\r
50  */\r
51 #define CONFIG_SP8830\r
52 #define CONFIG_SC8830\r
53 #define CONFIG_SC9620OPENPHONE\r
54 #define CONFIG_SP8830WCN\r
55 \r
56 \r
57 #define CONFIG_SUPPORT_TD\r
58 #define TDDSP_ADR       0x88020000\r
59 #define TDFIXNV_ADR     0x89060000\r
60 #define TDRUNTIMENV_ADR 0x890a0000\r
61 #define TDMODEM_ADR     0x88300000\r
62 #define CONFIG_SUPPORT_WIFI\r
63 #define WCNMODEM_ADR      0x94060000\r
64 #define WCNFIXNV_ADR      0x94000000\r
65 #define WCNRUNTIMENV_ADR  0x94020000\r
66 \r
67 #define CHIP_ENDIAN_LITTLE\r
68 #define _LITTLE_ENDIAN 1\r
69 \r
70 #define CONFIG_RAM512M\r
71 \r
72 #define CONFIG_EMMC_BOOT\r
73 \r
74 #ifdef  CONFIG_EMMC_BOOT\r
75 #define EMMC_SECTOR_SIZE 512\r
76 #define CONFIG_MMC\r
77 \r
78 #define CONFIG_FS_EXT4\r
79 #define CONFIG_EXT4_WRITE\r
80 #define CONFIG_CMD_EXT4\r
81 #define CONFIG_CMD_EXT4_WRITE\r
82 \r
83 //#define CONFIG_TIGER_MMC\r
84 #define CONFIG_UEFI_PARTITION\r
85 #define CONFIG_EFI_PARTITION\r
86 #define CONFIG_EXT4_SPARSE_DOWNLOAD\r
87 //#define CONFIG_EMMC_SPL\r
88 #define CONFIG_SYS_EMMC_U_BOOT_SECTOR_NUM ((CONFIG_SYS_NAND_U_BOOT_SIZE+EMMC_SECTOR_SIZE-1)/EMMC_SECTOR_SIZE)\r
89 \r
90 #endif\r
91 \r
92 /*\r
93  * MMC definition\r
94  */\r
95 #define CONFIG_CMD_MMC\r
96 #ifdef  CONFIG_CMD_MMC\r
97 #define CONFIG_CMD_FAT                  1\r
98 #define CONFIG_FAT_WRITE                1\r
99 #define CONFIG_MMC                      1\r
100 #define CONFIG_GENERIC_MMC              1\r
101 #define CONFIG_SDHCI                    1\r
102 #define CONFIG_SDHCI_CTRL_NO_HISPD     1 /* disable high speed control */\r
103 #define CONFIG_SYS_MMC_MAX_BLK_COUNT    0x1000\r
104 #define CONFIG_MMC_SDMA                 1\r
105 #define CONFIG_MV_SDHCI                 1\r
106 #define CONFIG_DOS_PARTITION            1\r
107 #define CONFIG_EFI_PARTITION            1\r
108 #define CONFIG_SYS_MMC_NUM              1\r
109 #define CONFIG_SYS_MMC_BASE             {0x20600000}\r
110 #define CONFIG_SYS_SD_BASE              0x20300000\r
111 #endif\r
112 \r
113 #define BB_DRAM_TYPE_256MB_32BIT\r
114 \r
115 #define CONFIG_SYS_HZ                   1000\r
116 #define CONFIG_SPRD_TIMER_CLK           1000 /*32768*/\r
117 \r
118 //#define CONFIG_SYS_HUSH_PARSER\r
119 \r
120 #ifdef CONFIG_SYS_HUSH_PARSER\r
121 #define CONFIG_SYS_PROMPT_HUSH_PS2 "> "\r
122 #endif\r
123 \r
124 #define FIXNV_SIZE              (2*128 * 1024)\r
125 #define TDMODEM_SIZE            (0xA00000)\r
126 #define TDDSP_SIZE              (0x3E0400) /* 3968K */\r
127 #define WCNMODEM_SIZE           (0xA00000)\r
128 #define VMJALUNA_SIZE           (0x64000) /* 400K */\r
129 #define RUNTIMENV_SIZE          (3*128 * 1024)\r
130 #define CONFIG_SPL_LOAD_LEN     (0x6000)\r
131 \r
132 \r
133 /*#define CMDLINE_NEED_CONV */\r
134 \r
135 #define WATCHDOG_LOAD_VALUE     0x4000\r
136 #define CONFIG_SYS_STACK_SIZE   0x400\r
137 //#define CONFIG_SYS_TEXT_BASZE  0x80f00000\r
138 \r
139 //#define       CONFIG_SYS_MONITOR_LEN          (256 << 10)     /* 256 kB for U-Boot */\r
140 \r
141 /* NAND BOOT is the only boot method */\r
142 #define CONFIG_NAND_U_BOOT\r
143 #define DYNAMIC_CRC_TABLE\r
144 /* Start copying real U-boot from the second page */\r
145 #define CONFIG_SYS_NAND_U_BOOT_OFFS     0x40000\r
146 #define CONFIG_SYS_NAND_U_BOOT_SIZE     0x8A000\r
147 #define RAM_TYPPE_IS_SDRAM      0\r
148 //#define FPGA_TRACE_DOWNLOAD //for download image from trace\r
149 \r
150 /* Load U-Boot to this address */\r
151 #define CONFIG_SYS_NAND_U_BOOT_DST      0x8f800000\r
152 #define CONFIG_SYS_NAND_U_BOOT_START    CONFIG_SYS_NAND_U_BOOT_DST\r
153 #define CONFIG_SYS_SDRAM_BASE 0x80000000\r
154 #define CONFIG_SYS_SDRAM_END (CONFIG_SYS_SDRAM_BASE + 256*1024*1024)\r
155 \r
156 #ifdef CONFIG_NAND_SPL\r
157 #define CONFIG_SYS_INIT_SP_ADDR         (CONFIG_SYS_SDRAM_END - 0x40000)\r
158 #else\r
159 \r
160 #define CONFIG_MMU_TABLE_ADDR (0x00020000)\r
161 #define CONFIG_SYS_INIT_SP_ADDR     \\r
162         (CONFIG_SYS_SDRAM_END - 0x10000 - GENERATED_GBL_DATA_SIZE)\r
163 \r
164 #define CONFIG_SKIP_LOWLEVEL_INIT\r
165 #endif\r
166 \r
167 #define CONFIG_HW_WATCHDOG\r
168 //#define CONFIG_AUTOBOOT //used for FPGA test, auto boot other image\r
169 //#define CONFIG_DISPLAY_CPUINFO\r
170 \r
171 #define CONFIG_CMDLINE_TAG              1       /* enable passing of ATAGs */\r
172 #define CONFIG_SETUP_MEMORY_TAGS        1\r
173 #define CONFIG_INITRD_TAG               1\r
174 \r
175 /*\r
176  * Memory Info\r
177  */\r
178 /* malloc() len */\r
179 #define CONFIG_SYS_MALLOC_LEN           (2 << 20)       /* 1 MiB */\r
180 /*\r
181  * Board has 2 32MB banks of DRAM but there is a bug when using\r
182  * both so only the first is configured\r
183  */\r
184 #define CONFIG_NR_DRAM_BANKS    1\r
185 \r
186 #define PHYS_SDRAM_1            0x80000000\r
187 #define PHYS_SDRAM_1_SIZE       0x10000000\r
188 #if (CONFIG_NR_DRAM_BANKS == 2)\r
189 #define PHYS_SDRAM_2            0x90000000\r
190 #define PHYS_SDRAM_2_SIZE       0x10000000\r
191 #endif\r
192 /* 8MB DRAM test */\r
193 #define CONFIG_SYS_MEMTEST_START        PHYS_SDRAM_1\r
194 #define CONFIG_SYS_MEMTEST_END          (PHYS_SDRAM_1+0x0800000)\r
195 #define CONFIG_STACKSIZE        (256 * 1024)    /* regular stack */\r
196 \r
197 /*\r
198  * Serial Info\r
199  */\r
200 #define CONFIG_SPRD_UART                1\r
201 #define CONFIG_SYS_SC8800X_UART1        1\r
202 #define CONFIG_CONS_INDEX       1       /* use UART0 for console */\r
203 #define CONFIG_BAUDRATE         115200  /* Default baud rate */\r
204 #define CONFIG_SYS_BAUDRATE_TABLE       { 9600, 19200, 38400, 57600, 115200 }\r
205 #define CONFIG_SPRD_SPI\r
206 #define CONFIG_SPRD_I2C\r
207 #define CONFIG_SC8830_I2C\r
208 /*\r
209  * Flash & Environment\r
210  */\r
211 /* No NOR flash present */\r
212 #define CONFIG_SYS_MONITOR_LEN ((CONFIG_SYS_NAND_U_BOOT_OFFS)+(CONFIG_SYS_NAND_U_BOOT_SIZE))\r
213 #define CONFIG_SYS_NO_FLASH     1\r
214 #define CONFIG_ENV_IS_NOWHERE\r
215 #define CONFIG_ENV_SIZE         (128 * 1024)    \r
216 /*\r
217 #define CONFIG_ENV_IS_IN_NAND\r
218 #define CONFIG_ENV_OFFSET       CONFIG_SYS_MONITOR_LEN\r
219 #define CONFIG_ENV_OFFSET_REDUND        (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)\r
220 */\r
221 \r
222 /* DDR */\r
223 #define DDR_CLK 500\r
224 //---these three macro below,only one can be open\r
225 //#define DDR_LPDDR1\r
226 #define DDR_LPDDR2\r
227 //#define DDR_DDR3\r
228 \r
229 //#define DDR_AUTO_DETECT\r
230 #define DDR_TYPE DRAM_LPDDR2_1CS_4G_X32\r
231 //#define DDR_TYPE DRAM_LPDDR2_1CS_8G_X32\r
232 //#define DDR_TYPE DRAM_LPDDR2_2CS_8G_X32\r
233 //#define DDR_TYPE DRAM_LPDDR2_2CS_16G_X32\r
234 //#define DDR_TYPE DRAM_DDR3_1CS_2G_X8_4P\r
235 //#define DDR_TYPE DRAM_DDR3_1CS_4G_X16_2P\r
236 \r
237 #define DDR3_DLL_ON TRUE\r
238 //#define DLL_BYPASS\r
239 #define DDR_APB_CLK 128\r
240 #define DDR_DFS_SUPPORT\r
241 #define DDR_DFS_VAL_BASE 0X1c00\r
242 \r
243 //#define DDR_SCAN_SUPPORT\r
244 #define MEM_IO_DS LPDDR2_DS_40R\r
245 \r
246 #define PUBL_LPDDR1_DS PUBL_LPDDR1_DS_48OHM\r
247 #define PUBL_LPDDR2_DS PUBL_LPDDR2_DS_40OHM\r
248 #define PUBL_DDR3_DS   PUBL_DDR3_DS_34OHM\r
249 \r
250 \r
251 \r
252 /* NAND */\r
253 #define CONFIG_NAND_SC8830\r
254 #define CONFIG_SPRD_NAND_REGS_BASE      (0x21100000)\r
255 #define CONFIG_SYS_MAX_NAND_DEVICE      1\r
256 #define CONFIG_SYS_NAND_BASE            (0x21100000)\r
257 //#define CONFIG_JFFS2_NAND\r
258 //#define CONFIG_SPRD_NAND_HWECC\r
259 #define CONFIG_SYS_NAND_HW_ECC\r
260 #define CONFIG_SYS_NAND_LARGEPAGE\r
261 //#define CONFIG_SYS_NAND_5_ADDR_CYCLE\r
262 \r
263 #define CONFIG_SYS_64BIT_VSPRINTF\r
264 \r
265 #define CONFIG_CMD_MTDPARTS\r
266 #define CONFIG_MTD_PARTITIONS\r
267 #define CONFIG_MTD_DEVICE\r
268 #define CONFIG_CMD_UBI\r
269 #define CONFIG_RBTREE\r
270 \r
271 /* U-Boot general configuration */\r
272 #define CONFIG_SYS_PROMPT       "=> "   /* Monitor Command Prompt */\r
273 #define CONFIG_SYS_CBSIZE       1024    /* Console I/O Buffer Size  */\r
274 /* Print buffer sz */\r
275 #define CONFIG_SYS_PBSIZE       (CONFIG_SYS_CBSIZE + \\r
276                 sizeof(CONFIG_SYS_PROMPT) + 16)\r
277 #define CONFIG_SYS_MAXARGS      32      /* max number of command args */\r
278 /* Boot Argument Buffer Size */\r
279 #define CONFIG_SYS_BARGSIZE     CONFIG_SYS_CBSIZE\r
280 #define CONFIG_CMDLINE_EDITING\r
281 #define CONFIG_SYS_LONGHELP\r
282 \r
283 /* support OS choose */\r
284 #undef CONFIG_BOOTM_NETBSD \r
285 #undef CONFIG_BOOTM_RTEMS\r
286 \r
287 /* U-Boot commands */\r
288 #include <config_cmd_default.h>\r
289 #define CONFIG_CMD_NAND\r
290 #undef CONFIG_CMD_FPGA\r
291 #undef CONFIG_CMD_LOADS\r
292 #undef CONFIG_CMD_NET\r
293 #undef CONFIG_CMD_NFS\r
294 #undef CONFIG_CMD_SETGETDCR\r
295 \r
296 #define CONFIG_ENV_OVERWRITE\r
297 \r
298 #ifdef SPRD_EVM_TAG_ON\r
299 #define CONFIG_BOOTDELAY        0\r
300 #else\r
301 #define CONFIG_BOOTDELAY        0\r
302 #define CONFIG_ZERO_BOOTDELAY_CHECK\r
303 #endif\r
304 \r
305 #define CONFIG_LOADADDR         (CONFIG_SYS_TEXT_BASE - CONFIG_SYS_MALLOC_LEN - 4*1024*1024)    /* loadaddr env var */\r
306 #define CONFIG_SYS_LOAD_ADDR    CONFIG_LOADADDR\r
307 \r
308 #define xstr(s) str(s)\r
309 #define str(s)  #s\r
310 \r
311 #define MTDIDS_DEFAULT "nand0=sprd-nand"\r
312 #define MTDPARTS_DEFAULT "mtdparts=sprd-nand:256k(spl),512k(2ndbl),256k(params),512k(vmjaluna),10m(modem),3840k(fixnv),3840k(backupfixnv),5120k(dsp),3840k(runtimenv),10m(boot),10m(recovery),250m(system),180m(userdata),20m(cache),256k(misc),1m(boot_logo),1m(fastboot_logo),3840k(productinfo),512k(kpanic)"\r
313 #define CONFIG_BOOTARGS "mem=512M loglevel=1 console=ttyS1,115200n8 init=/init " MTDPARTS_DEFAULT\r
314 \r
315 #define COPY_LINUX_KERNEL_SIZE  (0x600000)\r
316 #define LINUX_INITRD_NAME       "modem"\r
317 \r
318 #define CONFIG_BOOTCOMMAND "cboot normal"\r
319 #define CONFIG_EXTRA_ENV_SETTINGS                               ""      \r
320 \r
321 #ifdef CONFIG_CMD_NET\r
322 #define CONFIG_IPADDR 192.168.10.2\r
323 #define CONFIG_SERVERIP 192.168.10.5\r
324 #define CONFIG_NETMASK 255.255.255.0\r
325 #define CONFIG_USBNET_DEVADDR 26:03:ee:00:87:9f\r
326 #define CONFIG_USBNET_HOSTADDR 9a:04:c7:d6:30:d0\r
327 \r
328 \r
329 #define CONFIG_NET_MULTI\r
330 #define CONFIG_CMD_DNS\r
331 #define CONFIG_CMD_NFS\r
332 #define CONFIG_CMD_RARP\r
333 #define CONFIG_CMD_PING\r
334 /*#define CONFIG_CMD_SNTP */\r
335 #endif\r
336 \r
337 #define CONFIG_USB_CORE_IP_293A\r
338 #define CONFIG_USB_GADGET_SC8800G\r
339 #define CONFIG_USB_DWC\r
340 #define CONFIG_USB_GADGET_DUALSPEED\r
341 //#define CONFIG_USB_ETHER\r
342 #define CONFIG_CMD_FASTBOOT\r
343 #define SCRATCH_ADDR    (CONFIG_SYS_SDRAM_BASE + 0x100000)\r
344 #define FB_DOWNLOAD_BUF_SIZE (350*1024*1024)\r
345 \r
346 #define CONFIG_MODEM_CALIBERATE\r
347 \r
348 #define CONFIG_LCD\r
349 #ifdef  CONFIG_LCD\r
350 #define CONFIG_SPLASH_SCREEN\r
351 #define LCD_BPP LCD_COLOR16\r
352 //#define CONFIG_LCD_HVGA   1\r
353 //#define CONFIG_LCD_QVGA   1\r
354 #define CONFIG_LCD_QHD 1\r
355 //#define CONFIG_LCD_720P 1\r
356 //#define CONFIG_LCD_INFO\r
357 //#define LCD_TEST_PATTERN\r
358 //#define CONFIG_LCD_LOGO\r
359 //#define CONFIG_FB_LCD_S6D0139\r
360 #define CONFIG_FB_LCD_SSD2075_MIPI\r
361 #define CONFIG_FB_LCD_NT35516_MIPI\r
362 #define CONFIG_SYS_WHITE_ON_BLACK\r
363 #ifdef  LCD_TEST_PATTERN\r
364 #define CONSOLE_COLOR_RED 0xf800 \r
365 #define CONSOLE_COLOR_GREEN 0x07e0\r
366 #define CONSOLE_COLOR_YELLOW 0x07e0\r
367 #define CONSOLE_COLOR_BLUE 0x001f\r
368 #define CONSOLE_COLOR_MAGENTA 0x001f\r
369 #define CONSOLE_COLOR_CYAN 0x001f\r
370 #endif\r
371 #endif // CONFIG_LCD\r
372 \r
373 #define CONFIG_SPRD_SYSDUMP\r
374 #include <asm/sizes.h>\r
375 #define SPRD_SYSDUMP_MAGIC      ((PHYS_OFFSET_ADDR & (~(SZ_512M - 1))) + SZ_512M - SZ_1M)\r
376 \r
377 \r
378 #define CALIBRATE_ENUM_MS 3000\r
379 #define CALIBRATE_IO_MS 2000\r
380 \r
381 //#define LOW_BAT_ADC_LEVEL 782 /*phone battery adc value low than this value will not boot up*/\r
382 #define LOW_BAT_VOL            3500 /*phone battery voltage low than this value will not boot up*/\r
383 #define LOW_BAT_VOL_CHG        3300    //3.3V charger connect\r
384 \r
385 #define PWR_KEY_DETECT_CNT 12 /*this should match the count of boot_pwr_check() function */\r
386 #define ALARM_LEAD_SET_MS 0 /* time set for alarm boot in advancd */\r
387 \r
388 #define PHYS_OFFSET_ADDR                        0x80000000\r
389 #define TD_CP_OFFSET_ADDR                       0x8000000       /*128*/\r
390 #define TD_CP_SDRAM_SIZE                        0x1800000       /*24M*/\r
391 //#define WCDMA_CP_OFFSET_ADDR          0x10000000      /*256M*/\r
392 //#define WCDMA_CP_SDRAM_SIZE           0x4000000       /*64M*/\r
393 #define WCN_CP_OFFSET_ADDR              0x14000000      /*320M*/\r
394 #define WCN_CP_SDRAM_SIZE               0x1000000       /*16M*/\r
395 \r
396 #define SIPC_APCP_RESET_ADDR_SIZE       0xC00   /*3K*/\r
397 #define SIPC_APCP_RESET_SIZE    0x1000  /*4K*/\r
398 #define SIPC_TD_APCP_START_ADDR         (PHYS_OFFSET_ADDR + TD_CP_OFFSET_ADDR + TD_CP_SDRAM_SIZE - SIPC_APCP_RESET_SIZE)        /*0x897FF000*/\r
399 //#define SIPC_WCDMA_APCP_START_ADDR    (PHYS_OFFSET_ADDR + WCDMA_CP_OFFSET_ADDR + WCDMA_CP_SDRAM_SIZE - SIPC_APCP_RESET_SIZE) /*0x93FFF000*/\r
400 #define SIPC_WCN_APCP_START_ADDR                (PHYS_OFFSET_ADDR + WCN_CP_OFFSET_ADDR + WCN_CP_SDRAM_SIZE - SIPC_APCP_RESET_SIZE) /*0x94EFF000*/\r
401 \r
402 //#define CALIBRATION_FLAG           0x89700000\r
403 \r
404 #define CONFIG_CMD_SOUND 1\r
405 #define CONFIG_CMD_FOR_HTC 1\r
406 #define CONFIG_SOUND_CODEC_SPRD_V3 1\r
407 #define CONFIG_SOUND_DAI_VBC_R2P0 1\r
408 /* #define CONFIG_SPRD_AUDIO_DEBUG */\r
409 \r
410 #define CONFIG_RAMDUMP_NO_SPLIT 1 /* Don't split sysdump file */\r
411 #define USB_PHY_TUNE_VALUE 0x44077e33\r
412 \r
413 #endif /* __CONFIG_H */\r