Merge branch 'master' of git://www.denx.de/git/u-boot-cfi-flash
[kernel/u-boot.git] / include / configs / mx23evk.h
1 /*
2  * Freescale i.MX23 EVK board config
3  *
4  * Copyright (C) 2013 Otavio Salvador <otavio@ossystems.com.br>
5  * on behalf of O.S. Systems Software LTDA.
6  *
7  * SPDX-License-Identifier:     GPL-2.0+
8  */
9 #ifndef __MX23EVK_CONFIG_H__
10 #define __MX23EVK_CONFIG_H__
11
12 /* SoC configurations */
13 #define CONFIG_MX23                             /* i.MX23 SoC */
14
15 #include <asm/arch/regs-base.h>
16
17 #define CONFIG_MXS_GPIO                 /* GPIO control */
18 #define CONFIG_SYS_HZ           1000            /* Ticks per second */
19
20 #define CONFIG_MACH_TYPE        MACH_TYPE_MX23EVK
21
22 #define CONFIG_SYS_NO_FLASH
23 #define CONFIG_BOARD_EARLY_INIT_F
24 #define CONFIG_ARCH_MISC_INIT
25
26 /* SPL */
27 #define CONFIG_SPL
28 #define CONFIG_SPL_NO_CPU_SUPPORT_CODE
29 #define CONFIG_SPL_START_S_PATH "arch/arm/cpu/arm926ejs/mxs"
30 #define CONFIG_SPL_LDSCRIPT     "arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds"
31 #define CONFIG_SPL_LIBCOMMON_SUPPORT
32 #define CONFIG_SPL_LIBGENERIC_SUPPORT
33 #define CONFIG_SPL_GPIO_SUPPORT
34
35 /* U-Boot Commands */
36 #include <config_cmd_default.h>
37 #undef CONFIG_CMD_NET
38 #undef CONFIG_CMD_NFS
39
40 #define CONFIG_DISPLAY_CPUINFO
41 #define CONFIG_DOS_PARTITION
42
43 #define CONFIG_CMD_CACHE
44 #define CONFIG_CMD_EXT2
45 #define CONFIG_CMD_FAT
46 #define CONFIG_CMD_GPIO
47 #define CONFIG_CMD_MMC
48 #define CONFIG_CMD_USB
49 #define CONFIG_CMD_BOOTZ
50 #define CONFIG_VIDEO
51
52 /* Memory configurations */
53 #define CONFIG_NR_DRAM_BANKS            1               /* 1 bank of DRAM */
54 #define PHYS_SDRAM_1                    0x40000000      /* Base address */
55 #define PHYS_SDRAM_1_SIZE               0x08000000      /* Max 128 MB RAM */
56 #define CONFIG_STACKSIZE                (128 * 1024)    /* 128 KB stack */
57 #define CONFIG_SYS_MALLOC_LEN           0x00400000      /* 4 MB for malloc */
58 #define CONFIG_SYS_MEMTEST_START        0x40000000      /* Memtest start adr */
59 #define CONFIG_SYS_MEMTEST_END          0x40400000      /* 4 MB RAM test */
60 #define CONFIG_SYS_SDRAM_BASE           PHYS_SDRAM_1
61 /* Point initial SP in SRAM so SPL can use it too. */
62
63 #define CONFIG_SYS_INIT_RAM_ADDR        0x00000000
64 #define CONFIG_SYS_INIT_RAM_SIZE        (128 * 1024)
65
66 #define CONFIG_SYS_INIT_SP_OFFSET \
67         (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
68 #define CONFIG_SYS_INIT_SP_ADDR \
69         (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
70
71 /*
72  * We need to sacrifice first 4 bytes of RAM here to avoid triggering some
73  * strange BUG in ROM corrupting first 4 bytes of RAM when loading U-Boot
74  * binary. In case there was more of this mess, 0x100 bytes are skipped.
75  */
76 #define CONFIG_SYS_TEXT_BASE    0x40000100
77
78 #define CONFIG_ENV_OVERWRITE
79
80 /* U-Boot general configurations */
81 #define CONFIG_SYS_LONGHELP
82 #define CONFIG_SYS_PROMPT       "=> "
83 #define CONFIG_SYS_CBSIZE       256             /* Console I/O buffer size */
84 #define CONFIG_SYS_PBSIZE       \
85         (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
86                                                 /* Print buffer size */
87 #define CONFIG_SYS_MAXARGS      32              /* Max number of command args */
88 #define CONFIG_SYS_BARGSIZE     CONFIG_SYS_CBSIZE
89                                                 /* Boot argument buffer size */
90 #define CONFIG_VERSION_VARIABLE /* U-BOOT version */
91 #define CONFIG_AUTO_COMPLETE            /* Command auto complete */
92 #define CONFIG_CMDLINE_EDITING          /* Command history etc */
93 #define CONFIG_SYS_HUSH_PARSER
94 #define CONFIG_SYS_PROMPT_HUSH_PS2      "> "
95
96 /* Serial Driver */
97 #define CONFIG_PL011_SERIAL
98 #define CONFIG_PL011_CLOCK              24000000
99 #define CONFIG_PL01x_PORTS              { (void *)MXS_UARTDBG_BASE }
100 #define CONFIG_CONS_INDEX               0
101 #define CONFIG_BAUDRATE                 115200  /* Default baud rate */
102
103 /* DMA */
104 #define CONFIG_APBH_DMA
105
106 /* MMC Driver */
107 #ifdef  CONFIG_CMD_MMC
108 #define CONFIG_MMC
109 #define CONFIG_GENERIC_MMC
110 #define CONFIG_BOUNCE_BUFFER
111 #define CONFIG_MXS_MMC
112 #endif
113
114 /* USB */
115 #ifdef  CONFIG_CMD_USB
116 #define CONFIG_USB_EHCI
117 #define CONFIG_USB_EHCI_MXS
118 #define CONFIG_EHCI_MXS_PORT0
119 #define CONFIG_USB_MAX_CONTROLLER_COUNT 1
120 #define CONFIG_EHCI_IS_TDI
121 #define CONFIG_USB_STORAGE
122 #endif
123
124 /* Framebuffer support */
125 #ifdef CONFIG_VIDEO
126 #define CONFIG_CFB_CONSOLE
127 #define CONFIG_VIDEO_MXS
128 #define CONFIG_VIDEO_LOGO
129 #define CONFIG_VIDEO_SW_CURSOR
130 #define CONFIG_VGA_AS_SINGLE_DEVICE
131 #define CONFIG_SYS_CONSOLE_IS_IN_ENV
132 #define CONFIG_SPLASH_SCREEN
133 #define CONFIG_CMD_BMP
134 #define CONFIG_BMP_16BPP
135 #define CONFIG_VIDEO_BMP_RLE8
136 #define CONFIG_VIDEO_BMP_GZIP
137 #define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE  (512 << 10)
138 #endif
139
140 /* Boot Linux */
141 #define CONFIG_CMDLINE_TAG
142 #define CONFIG_SETUP_MEMORY_TAGS
143 #define CONFIG_BOOTDELAY        1
144 #define CONFIG_BOOTFILE "uImage"
145 #define CONFIG_LOADADDR 0x42000000
146 #define CONFIG_SYS_LOAD_ADDR    CONFIG_LOADADDR
147 #define CONFIG_OF_LIBFDT
148
149 /* Environment */
150 #define CONFIG_ENV_IS_IN_MMC
151 #ifdef CONFIG_ENV_IS_IN_MMC
152  #define CONFIG_ENV_OFFSET      (256 * 1024)
153  #define CONFIG_ENV_SIZE        (16 * 1024)
154  #define CONFIG_SYS_MMC_ENV_DEV 0
155 #endif
156
157 /* Extra Environments */
158 #define CONFIG_EXTRA_ENV_SETTINGS \
159         "update_sd_firmware_filename=u-boot.sd\0" \
160         "update_sd_firmware="           /* Update the SD firmware partition */ \
161                 "if mmc rescan ; then " \
162                 "if tftp ${update_sd_firmware_filename} ; then " \
163                 "setexpr fw_sz ${filesize} / 0x200 ; "  /* SD block size */ \
164                 "setexpr fw_sz ${fw_sz} + 1 ; " \
165                 "mmc write ${loadaddr} 0x800 ${fw_sz} ; " \
166                 "fi ; " \
167                 "fi\0" \
168         "script=boot.scr\0"     \
169         "uimage=uImage\0" \
170         "console=ttyAMA0\0" \
171         "fdt_file=imx23-evk.dtb\0" \
172         "fdt_addr=0x41000000\0" \
173         "boot_fdt=try\0" \
174         "mmcdev=0\0" \
175         "mmcpart=2\0" \
176         "mmcroot=/dev/mmcblk0p3 rw rootwait\0" \
177         "mmcargs=setenv bootargs console=${console},${baudrate} " \
178                 "root=${mmcroot}\0" \
179         "loadbootscript="  \
180                 "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
181         "bootscript=echo Running bootscript from mmc ...; "     \
182                 "source\0" \
183         "loaduimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${uimage}\0" \
184         "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
185         "mmcboot=echo Booting from mmc ...; " \
186                 "run mmcargs; " \
187                 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
188                         "if run loadfdt; then " \
189                                 "bootm ${loadaddr} - ${fdt_addr}; " \
190                         "else " \
191                                 "if test ${boot_fdt} = try; then " \
192                                         "bootm; " \
193                                 "else " \
194                                         "echo WARN: Cannot load the DT; " \
195                                 "fi; " \
196                         "fi; " \
197                 "else " \
198                         "bootm; " \
199                 "fi;\0"
200
201 #define CONFIG_BOOTCOMMAND \
202         "mmc dev ${mmcdev}; if mmc rescan; then " \
203                 "if run loadbootscript; then " \
204                         "run bootscript; " \
205                 "else " \
206                         "if run loaduimage; then " \
207                                 "run mmcboot; " \
208                         "else " \
209                                 "echo ERR: Fail to boot from MMC; " \
210                         "fi; " \
211                 "fi; " \
212         "else exit; fi"
213
214 #endif /* __MX23EVK_CONFIG_H__ */