Commit e0df5353fb93a90449a9f8db2b4a45fe32e3f9e0
Committed by
Stefano Babic
1 parent
4c6b235059
Exists in
master
and in
54 other branches
mx53loco: Add support to dynamically choose between fdt use or not
The CONFIG_SYS_CBSIZE has been change to 512 to avoid runtime errors as: ,---[ Runtime error ] | Hit any key to stop autoboot: 0 | MX53LOCO U-Boot > pri netboot | netboot=echo Booting from net ...; run netargs; if test ... | prefetch abort | pc : [<20747368>] lr : [<20747365>] | sp : af566e20 ip : 00000000 fp : 00000000 | r10: 00000002 r9 : af6dfc28 r8 : af566f58 | r7 : af6dfc10 r6 : 00000001 r5 : 00000002 r4 : 74206669 | r3 : 00000000 r2 : 00000060 r1 : 00000020 r0 : 0000018e | Flags: nZCv IRQs off FIQs off Mode SVC_32 | Resetting CPU ... | | resetting ... `--- Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Showing 1 changed file with 40 additions and 4 deletions Side-by-side Diff
include/configs/mx53loco.h
... | ... | @@ -119,24 +119,60 @@ |
119 | 119 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
120 | 120 | "script=boot.scr\0" \ |
121 | 121 | "uimage=uImage\0" \ |
122 | + "fdt_file=imx53-qsb.dtb\0" \ | |
123 | + "fdt_addr=0x71000000\0" \ | |
124 | + "boot_fdt=try\0" \ | |
125 | + "ip_dyn=yes\0" \ | |
122 | 126 | "mmcdev=0\0" \ |
123 | 127 | "mmcpart=2\0" \ |
124 | 128 | "mmcroot=/dev/mmcblk0p3 rw rootwait\0" \ |
125 | - "mmcargs=setenv bootargs console=ttymxc0,${baudrate} root=${mmcroot} " \ | |
129 | + "mmcargs=setenv bootargs console=ttymxc0,${baudrate} root=${mmcroot}\0" \ | |
126 | 130 | "loadbootscript=" \ |
127 | 131 | "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \ |
128 | 132 | "bootscript=echo Running bootscript from mmc ...; " \ |
129 | 133 | "source\0" \ |
130 | 134 | "loaduimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${uimage}\0" \ |
135 | + "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \ | |
131 | 136 | "mmcboot=echo Booting from mmc ...; " \ |
132 | 137 | "run mmcargs; " \ |
133 | - "bootm\0" \ | |
138 | + "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \ | |
139 | + "if run loadfdt; then " \ | |
140 | + "bootm ${loadaddr} - ${fdt_addr}; " \ | |
141 | + "else " \ | |
142 | + "if test ${boot_fdt} = try; then " \ | |
143 | + "bootm; " \ | |
144 | + "else " \ | |
145 | + "echo WARN: Cannot load the DT; " \ | |
146 | + "fi; " \ | |
147 | + "fi; " \ | |
148 | + "else " \ | |
149 | + "bootm; " \ | |
150 | + "fi;\0" \ | |
134 | 151 | "netargs=setenv bootargs console=ttymxc0,${baudrate} " \ |
135 | 152 | "root=/dev/nfs " \ |
136 | 153 | "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \ |
137 | 154 | "netboot=echo Booting from net ...; " \ |
138 | 155 | "run netargs; " \ |
139 | - "dhcp ${uimage}; bootm\0" \ | |
156 | + "if test ${ip_dyn} = yes; then " \ | |
157 | + "setenv get_cmd dhcp; " \ | |
158 | + "else " \ | |
159 | + "setenv get_cmd tftp; " \ | |
160 | + "fi; " \ | |
161 | + "${get_cmd} ${uimage}; " \ | |
162 | + "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \ | |
163 | + "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \ | |
164 | + "bootm ${loadaddr} - ${fdt_addr}; " \ | |
165 | + "else " \ | |
166 | + "if test ${boot_fdt} = try; then " \ | |
167 | + "bootm; " \ | |
168 | + "else " \ | |
169 | + "echo ERROR: Cannot load the DT; " \ | |
170 | + "exit; " \ | |
171 | + "fi; " \ | |
172 | + "fi; " \ | |
173 | + "else " \ | |
174 | + "bootm; " \ | |
175 | + "fi;\0" | |
140 | 176 | |
141 | 177 | #define CONFIG_BOOTCOMMAND \ |
142 | 178 | "mmc dev ${mmcdev}; if mmc rescan; then " \ |
... | ... | @@ -157,7 +193,7 @@ |
157 | 193 | #define CONFIG_SYS_HUSH_PARSER /* use "hush" command parser */ |
158 | 194 | #define CONFIG_SYS_PROMPT "MX53LOCO U-Boot > " |
159 | 195 | #define CONFIG_AUTO_COMPLETE |
160 | -#define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */ | |
196 | +#define CONFIG_SYS_CBSIZE 512 /* Console I/O Buffer Size */ | |
161 | 197 | |
162 | 198 | /* Print Buffer Size */ |
163 | 199 | #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16) |