]> git.ipfire.org Git - people/ms/u-boot.git/blob - include/configs/mx23_olinuxino.h
d05b9227d77c09b731da245775eae9f1a026cd6e
[people/ms/u-boot.git] / include / configs / mx23_olinuxino.h
1 /*
2 * Copyright (C) 2013 Marek Vasut <marex@denx.de>
3 *
4 * SPDX-License-Identifier: GPL-2.0+
5 */
6 #ifndef __CONFIGS_MX23_OLINUXINO_H__
7 #define __CONFIGS_MX23_OLINUXINO_H__
8
9 /* System configurations */
10 #define CONFIG_MX23 /* i.MX23 SoC */
11 #define CONFIG_MACH_TYPE 4105
12
13 /* U-Boot Commands */
14 #define CONFIG_SYS_NO_FLASH
15 #define CONFIG_DOS_PARTITION
16
17 /* Memory configuration */
18 #define CONFIG_NR_DRAM_BANKS 1 /* 1 bank of DRAM */
19 #define PHYS_SDRAM_1 0x40000000 /* Base address */
20 #define PHYS_SDRAM_1_SIZE 0x08000000 /* Max 128 MB RAM */
21 #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1
22
23 /* Environment */
24 #define CONFIG_ENV_IS_IN_MMC
25 #define CONFIG_ENV_OVERWRITE
26
27 /* Environment is in MMC */
28 #if defined(CONFIG_CMD_MMC) && defined(CONFIG_ENV_IS_IN_MMC)
29 #define CONFIG_ENV_OFFSET (256 * 1024)
30 #define CONFIG_ENV_SIZE (16 * 1024)
31 #define CONFIG_SYS_MMC_ENV_DEV 0
32 #endif
33
34 /* Status LED */
35
36 /* USB */
37 #ifdef CONFIG_CMD_USB
38 #define CONFIG_EHCI_MXS_PORT0
39 #define CONFIG_USB_MAX_CONTROLLER_COUNT 1
40 #endif
41
42 /* Ethernet */
43 #ifdef CONFIG_CMD_NET
44 #define CONFIG_USB_HOST_ETHER
45 #define CONFIG_USB_ETHER_SMSC95XX
46 #endif
47
48 /* Booting Linux */
49 #define CONFIG_BOOTFILE "uImage"
50 #define CONFIG_LOADADDR 0x42000000
51 #define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
52
53 /* Extra Environment */
54 #define CONFIG_EXTRA_ENV_SETTINGS \
55 "update_sd_firmware_filename=u-boot.sd\0" \
56 "update_sd_firmware=" /* Update the SD firmware partition */ \
57 "if mmc rescan ; then " \
58 "if tftp ${update_sd_firmware_filename} ; then " \
59 "setexpr fw_sz ${filesize} / 0x200 ; " /* SD block size */ \
60 "setexpr fw_sz ${fw_sz} + 1 ; " \
61 "mmc write ${loadaddr} 0x800 ${fw_sz} ; " \
62 "fi ; " \
63 "fi\0" \
64 "script=boot.scr\0" \
65 "uimage=uImage\0" \
66 "console=ttyAMA0\0" \
67 "fdt_file=imx23-olinuxino.dtb\0" \
68 "fdt_addr=0x41000000\0" \
69 "boot_fdt=try\0" \
70 "ip_dyn=yes\0" \
71 "mmcdev=0\0" \
72 "mmcpart=2\0" \
73 "mmcroot=/dev/mmcblk0p3 rw rootwait\0" \
74 "mmcargs=setenv bootargs console=${console},${baudrate} " \
75 "root=${mmcroot}\0" \
76 "loadbootscript=" \
77 "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
78 "bootscript=echo Running bootscript from mmc ...; " \
79 "source\0" \
80 "loaduimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${uimage}\0" \
81 "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
82 "mmcboot=echo Booting from mmc ...; " \
83 "run mmcargs; " \
84 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
85 "if run loadfdt; then " \
86 "bootm ${loadaddr} - ${fdt_addr}; " \
87 "else " \
88 "if test ${boot_fdt} = try; then " \
89 "bootm; " \
90 "else " \
91 "echo WARN: Cannot load the DT; " \
92 "fi; " \
93 "fi; " \
94 "else " \
95 "bootm; " \
96 "fi;\0" \
97 "netargs=setenv bootargs console=${console},${baudrate} " \
98 "root=/dev/nfs " \
99 "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
100 "netboot=echo Booting from net ...; " \
101 "usb start; " \
102 "run netargs; " \
103 "if test ${ip_dyn} = yes; then " \
104 "setenv get_cmd dhcp; " \
105 "else " \
106 "setenv get_cmd tftp; " \
107 "fi; " \
108 "${get_cmd} ${uimage}; " \
109 "if test ${boot_fdt} = yes; then " \
110 "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
111 "bootm ${loadaddr} - ${fdt_addr}; " \
112 "else " \
113 "if test ${boot_fdt} = try; then " \
114 "bootm; " \
115 "else " \
116 "echo WARN: Cannot load the DT; " \
117 "fi;" \
118 "fi; " \
119 "else " \
120 "bootm; " \
121 "fi;\0"
122
123 #define CONFIG_BOOTCOMMAND \
124 "mmc dev ${mmcdev}; if mmc rescan; then " \
125 "if run loadbootscript; then " \
126 "run bootscript; " \
127 "else " \
128 "if run loaduimage; then " \
129 "run mmcboot; " \
130 "else run netboot; " \
131 "fi; " \
132 "fi; " \
133 "else run netboot; fi"
134
135 /* The rest of the configuration is shared */
136 #include <configs/mxs.h>
137
138 #endif /* __CONFIGS_MX23_OLINUXINO_H__ */