]> git.ipfire.org Git - people/ms/u-boot.git/blob - include/configs/pcm052.h
2cbd8feb71d2bb12850e094b7e6ad778180add17
[people/ms/u-boot.git] / include / configs / pcm052.h
1 /*
2 * Copyright 2013 Freescale Semiconductor, Inc.
3 *
4 * Configuration settings for the phytec PCM-052 SoM.
5 *
6 * SPDX-License-Identifier: GPL-2.0+
7 */
8
9 #ifndef __CONFIG_H
10 #define __CONFIG_H
11
12 #include <asm/arch/imx-regs.h>
13
14 #define CONFIG_VF610
15
16 #define CONFIG_SKIP_LOWLEVEL_INIT
17
18 /* Enable passing of ATAGs */
19 #define CONFIG_CMDLINE_TAG
20
21 /* Size of malloc() pool */
22 #define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 2 * 1024 * 1024)
23
24 /* Allow to overwrite serial and ethaddr */
25 #define CONFIG_ENV_OVERWRITE
26 #define CONFIG_BAUDRATE 115200
27
28 /* NAND support */
29 #define CONFIG_CMD_NAND
30 #define CONFIG_CMD_NAND_TRIMFFS
31 #define CONFIG_SYS_NAND_ONFI_DETECTION
32
33 #ifdef CONFIG_CMD_NAND
34 #define CONFIG_SYS_MAX_NAND_DEVICE 1
35 #define CONFIG_SYS_NAND_BASE NFC_BASE_ADDR
36
37 #define CONFIG_JFFS2_NAND
38
39 /* UBI */
40 #define CONFIG_CMD_UBIFS
41 #define CONFIG_RBTREE
42 #define CONFIG_LZO
43
44 /* Dynamic MTD partition support */
45 #define CONFIG_CMD_MTDPARTS
46 #define CONFIG_MTD_PARTITIONS
47 #define CONFIG_MTD_DEVICE
48
49 #ifndef MTDIDS_DEFAULT
50 #define MTDIDS_DEFAULT "nand0=NAND"
51 #endif
52
53 #ifndef MTDPARTS_DEFAULT
54 #define MTDPARTS_DEFAULT "mtdparts=NAND:640k(bootloader)"\
55 ",128k(env1)"\
56 ",128k(env2)"\
57 ",128k(dtb)"\
58 ",6144k(kernel)"\
59 ",-(root)"
60 #endif
61
62 #endif
63
64 #define CONFIG_FSL_ESDHC
65 #define CONFIG_SYS_FSL_ESDHC_ADDR 0
66 #define CONFIG_SYS_FSL_ESDHC_NUM 1
67
68 /*#define CONFIG_ESDHC_DETECT_USE_EXTERN_IRQ1*/
69
70 #define CONFIG_FEC_MXC
71 #define CONFIG_MII
72 #define IMX_FEC_BASE ENET_BASE_ADDR
73 #define CONFIG_FEC_XCV_TYPE RMII
74 #define CONFIG_FEC_MXC_PHYADDR 0
75 #define CONFIG_PHYLIB
76 #define CONFIG_PHY_MICREL
77
78 /* QSPI Configs*/
79
80 #ifdef CONFIG_FSL_QSPI
81 #define FSL_QSPI_FLASH_SIZE (1 << 24)
82 #define FSL_QSPI_FLASH_NUM 2
83 #define CONFIG_SYS_FSL_QSPI_LE
84 #endif
85
86 /* I2C Configs */
87 #define CONFIG_SYS_I2C
88 #define CONFIG_SYS_I2C_MXC_I2C3
89 #define CONFIG_SYS_I2C_MXC
90
91 /* RTC (actually an RV-4162 but M41T62-compatible) */
92 #define CONFIG_CMD_DATE
93 #define CONFIG_RTC_M41T62
94 #define CONFIG_SYS_I2C_RTC_ADDR 0x68
95 #define CONFIG_SYS_RTC_BUS_NUM 2
96
97 /* EEPROM (24FC256) */
98 #define CONFIG_CMD_EEPROM
99 #define CONFIG_SYS_I2C_EEPROM_ADDR 0x50
100 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2
101 #define CONFIG_SYS_I2C_EEPROM_BUS 2
102
103
104 #define CONFIG_LOADADDR 0x82000000
105
106 /* We boot from the gfxRAM area of the OCRAM. */
107 #define CONFIG_SYS_TEXT_BASE 0x3f408000
108 #define CONFIG_BOARD_SIZE_LIMIT 524288
109
110 /* if no target-specific extra environment settings were defined by the
111 target, define an empty one */
112 #ifndef PCM052_EXTRA_ENV_SETTINGS
113 #define PCM052_EXTRA_ENV_SETTINGS
114 #endif
115
116 /* if no target-specific boot command was defined by the target,
117 define an empty one */
118 #ifndef PCM052_BOOTCOMMAND
119 #define PCM052_BOOTCOMMAND
120 #endif
121
122 /* if no target-specific extra environment settings were defined by the
123 target, define an empty one */
124 #ifndef PCM052_NET_INIT
125 #define PCM052_NET_INIT
126 #endif
127
128 /* boot command, including the target-defined one if any */
129 #define CONFIG_BOOTCOMMAND PCM052_BOOTCOMMAND "run bootcmd_nand"
130
131 /* Extra env settings (including the target-defined ones if any) */
132 #define CONFIG_EXTRA_ENV_SETTINGS \
133 PCM052_EXTRA_ENV_SETTINGS \
134 "autoload=no\0" \
135 "fdt_high=0xffffffff\0" \
136 "initrd_high=0xffffffff\0" \
137 "blimg_file=u-boot.vyb\0" \
138 "blimg_addr=0x81000000\0" \
139 "kernel_file=zImage\0" \
140 "kernel_addr=0x82000000\0" \
141 "fdt_file=zImage.dtb\0" \
142 "fdt_addr=0x81000000\0" \
143 "ram_file=uRamdisk\0" \
144 "ram_addr=0x83000000\0" \
145 "filesys=rootfs.ubifs\0" \
146 "sys_addr=0x81000000\0" \
147 "tftploc=/path/to/tftp/directory/\0" \
148 "nfs_root=/path/to/nfs/root\0" \
149 "tftptimeout=1000\0" \
150 "tftptimeoutcountmax=1000000\0" \
151 "mtdparts=" MTDPARTS_DEFAULT "\0" \
152 "bootargs_base=setenv bootargs rw " \
153 " mem=" __stringify(CONFIG_PCM052_DDR_SIZE) "M " \
154 "console=ttyLP1,115200n8\0" \
155 "bootargs_sd=setenv bootargs ${bootargs} " \
156 "root=/dev/mmcblk0p2 rootwait\0" \
157 "bootargs_net=setenv bootargs ${bootargs} root=/dev/nfs ip=dhcp " \
158 "nfsroot=${serverip}:${nfs_root},v3,tcp\0" \
159 "bootargs_nand=setenv bootargs ${bootargs} " \
160 "ubi.mtd=5 rootfstype=ubifs root=ubi0:rootfs\0" \
161 "bootargs_ram=setenv bootargs ${bootargs} " \
162 "root=/dev/ram rw initrd=${ram_addr}\0" \
163 "bootargs_mtd=setenv bootargs ${bootargs} ${mtdparts}\0" \
164 "bootcmd_sd=run bootargs_base bootargs_sd bootargs_mtd; " \
165 "fatload mmc 0:1 ${kernel_addr} ${kernel_file}; " \
166 "fatload mmc 0:1 ${fdt_addr} ${fdt_file}; " \
167 "bootz ${kernel_addr} - ${fdt_addr}\0" \
168 "bootcmd_net=run bootargs_base bootargs_net bootargs_mtd; " \
169 "tftpboot ${kernel_addr} ${tftpdir}${kernel_file}; " \
170 "tftpboot ${fdt_addr} ${tftpdir}${fdt_file}; " \
171 "bootz ${kernel_addr} - ${fdt_addr}\0" \
172 "bootcmd_nand=run bootargs_base bootargs_nand bootargs_mtd; " \
173 "nand read ${fdt_addr} dtb; " \
174 "nand read ${kernel_addr} kernel; " \
175 "bootz ${kernel_addr} - ${fdt_addr}\0" \
176 "bootcmd_ram=run bootargs_base bootargs_ram bootargs_mtd; " \
177 "nand read ${fdt_addr} dtb; " \
178 "nand read ${kernel_addr} kernel; " \
179 "nand read ${ram_addr} root; " \
180 "bootz ${kernel_addr} ${ram_addr} ${fdt_addr}\0" \
181 "update_bootloader_from_tftp=" PCM052_NET_INIT \
182 "if tftp ${blimg_addr} "\
183 "${tftpdir}${blimg_file}; then " \
184 "mtdparts default; " \
185 "nand erase.part bootloader; " \
186 "nand write ${blimg_addr} bootloader ${filesize}; fi\0" \
187 "update_kernel_from_sd=if fatload mmc 0:2 ${kernel_addr} " \
188 "${kernel_file}; " \
189 "then mtdparts default; " \
190 "nand erase.part kernel; " \
191 "nand write ${kernel_addr} kernel ${filesize}; " \
192 "if fatload mmc 0:2 ${fdt_addr} ${fdt_file}; then " \
193 "nand erase.part dtb; " \
194 "nand write ${fdt_addr} dtb ${filesize}; fi\0" \
195 "update_kernel_from_tftp=" PCM052_NET_INIT \
196 "if tftp ${fdt_addr} ${tftpdir}${fdt_file}; " \
197 "then setenv fdtsize ${filesize}; " \
198 "if tftp ${kernel_addr} ${tftpdir}${kernel_file}; then " \
199 "mtdparts default; " \
200 "nand erase.part dtb; " \
201 "nand write ${fdt_addr} dtb ${fdtsize}; " \
202 "nand erase.part kernel; " \
203 "nand write ${kernel_addr} kernel ${filesize}; fi; fi\0" \
204 "update_rootfs_from_tftp=" PCM052_NET_INIT \
205 "if tftp ${sys_addr} ${tftpdir}${filesys}; " \
206 "then mtdparts default; " \
207 "nand erase.part root; " \
208 "ubi part root; " \
209 "ubi create rootfs; " \
210 "ubi write ${sys_addr} rootfs ${filesize}; fi\0" \
211 "update_ramdisk_from_tftp=" PCM052_NET_INIT \
212 "if tftp ${ram_addr} ${tftpdir}${ram_file}; " \
213 "then mtdparts default; " \
214 "nand erase.part root; " \
215 "nand write ${ram_addr} root ${filesize}; fi\0"
216
217 /* Miscellaneous configurable options */
218 #define CONFIG_SYS_LONGHELP /* undef to save memory */
219 #define CONFIG_AUTO_COMPLETE
220 #define CONFIG_CMDLINE_EDITING
221 #define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */
222 #define CONFIG_SYS_PBSIZE \
223 (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
224 #define CONFIG_SYS_MAXARGS 16 /* max number of command args */
225 #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
226
227 #define CONFIG_SYS_MEMTEST_START 0x80010000
228 #define CONFIG_SYS_MEMTEST_END 0x87C00000
229
230 #define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
231
232 /*
233 * Stack sizes
234 * The stack sizes are set up in start.S using the settings below
235 */
236 #define CONFIG_STACKSIZE (128 * 1024) /* regular stack */
237
238 /* Physical memory map */
239 #define CONFIG_NR_DRAM_BANKS 1
240 #define PHYS_SDRAM (0x80000000)
241 #define PHYS_SDRAM_SIZE (CONFIG_PCM052_DDR_SIZE * 1024 * 1024)
242
243 #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
244 #define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
245 #define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
246
247 #define CONFIG_SYS_INIT_SP_OFFSET \
248 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
249 #define CONFIG_SYS_INIT_SP_ADDR \
250 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
251
252 /* environment organization */
253 #ifdef CONFIG_ENV_IS_IN_MMC
254 #define CONFIG_ENV_SIZE (8 * 1024)
255
256 #define CONFIG_ENV_OFFSET (12 * 64 * 1024)
257 #define CONFIG_SYS_MMC_ENV_DEV 0
258 #endif
259
260 #ifdef CONFIG_ENV_IS_IN_NAND
261 #define CONFIG_ENV_SECT_SIZE (128 * 1024)
262 #define CONFIG_ENV_SIZE (8 * 1024)
263 #define CONFIG_ENV_OFFSET 0xA0000
264 #define CONFIG_ENV_SIZE_REDUND (8 * 1024)
265 #define CONFIG_ENV_OFFSET_REDUND 0xC0000
266 #endif
267
268 #endif