|
79 | 79 | #define CONFIG_RED_LED AT91_PIN_PC12 /* this is the power led */
|
80 | 80 | #define CONFIG_GREEN_LED AT91_PIN_PC13 /* this is the user led */
|
81 | 81 | #define CONFIG_YELLOW_LED AT91_PIN_PC14
|
82 |
| -#define CONFIG_BLUE_LED AT91_PIN_PC15 /* Unused */ |
| 82 | +#define CONFIG_BLUE_LED AT91_PIN_PC15 /* Unused */ |
83 | 83 |
|
84 | 84 | /* SPI */
|
85 | 85 | #define CONFIG_ATMEL_SPI
|
|
102 | 102 | "rootfs part 0 6\0"
|
103 | 103 |
|
104 | 104 | #define DFU_ALT_INFO_NOR \
|
105 |
| - "dfu_alt_info_nor=" \ |
| 105 | + "dfu_alt_info_nor=" \ |
106 | 106 | "uboot raw 0xA000 0x56000;" \
|
107 | 107 | "dtb raw 0x70000 0x10000" \
|
108 | 108 | "\0"
|
|
166 | 166 | #define CONFIG_EXT4_WRITE
|
167 | 167 |
|
168 | 168 | /* u-boot env in sd/mmc card */
|
169 |
| -#define CONFIG_ENV_IS_IN_EXT4 1 |
170 |
| -#define EXT4_ENV_INTERFACE "mmc" |
| 169 | +#define CONFIG_ENV_IS_IN_EXT4 1 |
| 170 | +#define EXT4_ENV_INTERFACE "mmc" |
171 | 171 | #define EXT4_ENV_DEVICE_AND_PART "0:1"
|
172 |
| -#define EXT4_ENV_FILE "/system/etc/uboot.env" |
173 |
| -#define CONFIG_ENV_SIZE 1 * 1024 //Assume sector size of 1024 |
| 172 | +#define EXT4_ENV_FILE "/system/etc/uboot.env" |
| 173 | +#define CONFIG_ENV_SIZE 1 * 1024 //Assume sector size of 1024 |
174 | 174 | #endif
|
175 | 175 |
|
176 | 176 | /* USB */
|
|
190 | 190 | #ifdef CONFIG_SYS_USE_NORFLASH
|
191 | 191 | #define SMALL_SECT_SIZE 0x1000
|
192 | 192 | #define LARGE_SECT_SIZE 0x10000
|
193 |
| -/* (bootstrap + u-boot + dtb (+ altOS) in flash) + (env + linux in mmc) */ |
194 |
| -/* Copy .dtb file (NORFLASH @ 0x70000, size = 0x10000) and kernel (SD card, partition 5) into SDRAM, then boot them */ |
195 |
| -#define CONFIG_BOOTCOMMAND "cp.b 0x10070000 0x21800000 0x10000; " \ |
196 |
| - "fatload mmc 0:5 0x2187FF58 kernel; " \ |
197 |
| - "bootm 0x2187FF58 - 0x21800000" |
| 193 | + |
| 194 | +#ifdef CONFIG_SD_SWITCH |
| 195 | +#define CONFIG_BOOTCOMMAND \ |
| 196 | + "if mmc rescan; then " \ |
| 197 | + "run mmc_boot; " \ |
| 198 | + "else " \ |
| 199 | + "mmc slot 0; " \ |
| 200 | + "if mmc rescan; then " \ |
| 201 | + "run mmc_boot; " \ |
| 202 | + "else " \ |
| 203 | + "mmc slot 1; " \ |
| 204 | + "if mmc rescan; then " \ |
| 205 | + "run mmc_boot; " \ |
| 206 | + "else " \ |
| 207 | + "echo ERROR: Failed to boot. Unable to communicate with SD card; " \ |
| 208 | + "fi; " \ |
| 209 | + "fi; " \ |
| 210 | + "fi;" |
| 211 | +#else |
| 212 | +#define CONFIG_BOOTCOMMAND \ |
| 213 | + "if mmc rescan; then " \ |
| 214 | + "run mmc_boot; " \ |
| 215 | + "else " \ |
| 216 | + "echo ERROR: Failed to boot. Unable to communicate with SD card; " \ |
| 217 | + "fi;" |
| 218 | +#endif |
| 219 | + |
198 | 220 | /* Define the initial console connection and rootfs location */
|
199 | 221 | #define CONFIG_BOOTARGS \
|
200 | 222 | "console=ttyS0,115200 " \
|
201 | 223 | "root=/dev/mmcblk0p6 rootwait"
|
202 | 224 |
|
| 225 | +/* (bootstrap + u-boot + dtb (+ altOS) in flash) + (env + linux in mmc) */ |
| 226 | +/* Copy .dtb file (NORFLASH @ 0x70000, size = 0x10000) and kernel (SD card, partition 5) into SDRAM, then boot them */ |
| 227 | +#define MMC_BOOT \ |
| 228 | + "mmc_boot=cp.b 0x10070000 0x21800000 0x10000; " \ |
| 229 | + "fatload mmc 0:5 0x2187FF58 kernel; " \ |
| 230 | + "bootm 0x2187FF58 - 0x21800000\0" |
| 231 | + |
203 | 232 | #define CONFIG_EXTRA_ENV_SETTINGS \
|
| 233 | + MMC_BOOT \ |
204 | 234 | KUBOS_UPDATE_ARGS
|
205 | 235 |
|
206 | 236 | #define CONFIG_SYS_FLASH_CFI 1
|
|
0 commit comments