Marek Vasut | 189e35b | 2013-01-12 07:11:11 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2013 Marek Vasut <marex@denx.de> |
| 3 | * |
Wolfgang Denk | d79de1d | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 4 | * SPDX-License-Identifier: GPL-2.0+ |
Marek Vasut | 189e35b | 2013-01-12 07:11:11 +0000 | [diff] [blame] | 5 | */ |
| 6 | #ifndef __MX23_OLINUXINO_CONFIG_H__ |
| 7 | #define __MX23_OLINUXINO_CONFIG_H__ |
| 8 | |
Otavio Salvador | fcc7689 | 2013-02-23 02:43:09 +0000 | [diff] [blame] | 9 | #include <asm/arch/iomux-mx23.h> |
| 10 | |
Marek Vasut | 189e35b | 2013-01-12 07:11:11 +0000 | [diff] [blame] | 11 | /* |
| 12 | * SoC configurations |
| 13 | */ |
Otavio Salvador | 9ffb9dc | 2013-03-24 16:17:33 +0000 | [diff] [blame] | 14 | #define CONFIG_MX23 /* i.MX23 SoC */ |
| 15 | #define CONFIG_MXS_GPIO /* GPIO control */ |
| 16 | #define CONFIG_SYS_HZ 1000 /* Ticks per second */ |
Marek Vasut | 189e35b | 2013-01-12 07:11:11 +0000 | [diff] [blame] | 17 | |
Otavio Salvador | 9ffb9dc | 2013-03-24 16:17:33 +0000 | [diff] [blame] | 18 | #define CONFIG_MACH_TYPE 4105 |
Marek Vasut | 189e35b | 2013-01-12 07:11:11 +0000 | [diff] [blame] | 19 | |
| 20 | #include <asm/arch/regs-base.h> |
| 21 | |
Otavio Salvador | 9ffb9dc | 2013-03-24 16:17:33 +0000 | [diff] [blame] | 22 | #define CONFIG_SYS_NO_FLASH |
| 23 | #define CONFIG_BOARD_EARLY_INIT_F |
| 24 | #define CONFIG_ARCH_MISC_INIT |
Marek Vasut | 189e35b | 2013-01-12 07:11:11 +0000 | [diff] [blame] | 25 | |
| 26 | /* |
| 27 | * SPL |
| 28 | */ |
Otavio Salvador | 9ffb9dc | 2013-03-24 16:17:33 +0000 | [diff] [blame] | 29 | #define CONFIG_SPL |
| 30 | #define CONFIG_SPL_NO_CPU_SUPPORT_CODE |
| 31 | #define CONFIG_SPL_START_S_PATH "arch/arm/cpu/arm926ejs/mxs" |
| 32 | #define CONFIG_SPL_LDSCRIPT "arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds" |
| 33 | #define CONFIG_SPL_LIBCOMMON_SUPPORT |
| 34 | #define CONFIG_SPL_LIBGENERIC_SUPPORT |
| 35 | #define CONFIG_SPL_GPIO_SUPPORT |
Marek Vasut | 189e35b | 2013-01-12 07:11:11 +0000 | [diff] [blame] | 36 | |
| 37 | /* |
| 38 | * U-Boot Commands |
| 39 | */ |
| 40 | #include <config_cmd_default.h> |
Otavio Salvador | 9ffb9dc | 2013-03-24 16:17:33 +0000 | [diff] [blame] | 41 | #define CONFIG_DISPLAY_CPUINFO |
| 42 | #define CONFIG_DOS_PARTITION |
Marek Vasut | 189e35b | 2013-01-12 07:11:11 +0000 | [diff] [blame] | 43 | |
Otavio Salvador | 9ffb9dc | 2013-03-24 16:17:33 +0000 | [diff] [blame] | 44 | #define CONFIG_CMD_CACHE |
| 45 | #define CONFIG_CMD_DHCP |
| 46 | #define CONFIG_CMD_EXT2 |
| 47 | #define CONFIG_CMD_FAT |
| 48 | #define CONFIG_CMD_GPIO |
| 49 | #define CONFIG_CMD_LED |
| 50 | #define CONFIG_CMD_MMC |
| 51 | #define CONFIG_CMD_NET |
| 52 | #define CONFIG_CMD_USB |
Marek Vasut | 189e35b | 2013-01-12 07:11:11 +0000 | [diff] [blame] | 53 | |
| 54 | /* |
| 55 | * Memory configurations |
| 56 | */ |
Otavio Salvador | 9ffb9dc | 2013-03-24 16:17:33 +0000 | [diff] [blame] | 57 | #define CONFIG_NR_DRAM_BANKS 1 /* 1 bank of DRAM */ |
| 58 | #define PHYS_SDRAM_1 0x40000000 /* Base address */ |
| 59 | #define PHYS_SDRAM_1_SIZE 0x08000000 /* Max 128 MB RAM */ |
| 60 | #define CONFIG_SYS_MALLOC_LEN 0x00400000 /* 4 MB for malloc */ |
| 61 | #define CONFIG_SYS_GBL_DATA_SIZE 128 /* Initial data */ |
| 62 | #define CONFIG_SYS_MEMTEST_START 0x40000000 /* Memtest start adr */ |
| 63 | #define CONFIG_SYS_MEMTEST_END 0x40400000 /* 4 MB RAM test */ |
| 64 | #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1 |
Marek Vasut | 189e35b | 2013-01-12 07:11:11 +0000 | [diff] [blame] | 65 | /* Point initial SP in SRAM so SPL can use it too. */ |
| 66 | |
| 67 | #define CONFIG_SYS_INIT_RAM_ADDR 0x00000000 |
| 68 | #define CONFIG_SYS_INIT_RAM_SIZE (128 * 1024) |
| 69 | |
| 70 | #define CONFIG_SYS_INIT_SP_OFFSET \ |
| 71 | (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE) |
| 72 | #define CONFIG_SYS_INIT_SP_ADDR \ |
| 73 | (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET) |
| 74 | /* |
| 75 | * We need to sacrifice first 4 bytes of RAM here to avoid triggering some |
| 76 | * strange BUG in ROM corrupting first 4 bytes of RAM when loading U-Boot |
| 77 | * binary. In case there was more of this mess, 0x100 bytes are skipped. |
| 78 | */ |
Otavio Salvador | 9ffb9dc | 2013-03-24 16:17:33 +0000 | [diff] [blame] | 79 | #define CONFIG_SYS_TEXT_BASE 0x40000100 |
Marek Vasut | 189e35b | 2013-01-12 07:11:11 +0000 | [diff] [blame] | 80 | |
| 81 | /* |
| 82 | * U-Boot general configurations |
| 83 | */ |
Otavio Salvador | 9ffb9dc | 2013-03-24 16:17:33 +0000 | [diff] [blame] | 84 | #define CONFIG_SYS_LONGHELP |
| 85 | #define CONFIG_SYS_PROMPT "=> " |
| 86 | #define CONFIG_SYS_CBSIZE 1024 /* Console I/O buffer size */ |
| 87 | #define CONFIG_SYS_PBSIZE \ |
Marek Vasut | 189e35b | 2013-01-12 07:11:11 +0000 | [diff] [blame] | 88 | (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16) |
| 89 | /* Print buffer size */ |
Otavio Salvador | 9ffb9dc | 2013-03-24 16:17:33 +0000 | [diff] [blame] | 90 | #define CONFIG_SYS_MAXARGS 32 /* Max number of command args */ |
| 91 | #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE |
Marek Vasut | 189e35b | 2013-01-12 07:11:11 +0000 | [diff] [blame] | 92 | /* Boot argument buffer size */ |
Otavio Salvador | 9ffb9dc | 2013-03-24 16:17:33 +0000 | [diff] [blame] | 93 | #define CONFIG_VERSION_VARIABLE /* U-BOOT version */ |
| 94 | #define CONFIG_AUTO_COMPLETE /* Command auto complete */ |
| 95 | #define CONFIG_CMDLINE_EDITING /* Command history etc */ |
| 96 | #define CONFIG_SYS_HUSH_PARSER |
Marek Vasut | 189e35b | 2013-01-12 07:11:11 +0000 | [diff] [blame] | 97 | |
| 98 | /* |
| 99 | * Serial Driver |
| 100 | */ |
Otavio Salvador | 9ffb9dc | 2013-03-24 16:17:33 +0000 | [diff] [blame] | 101 | #define CONFIG_PL011_SERIAL |
| 102 | #define CONFIG_PL011_CLOCK 24000000 |
| 103 | #define CONFIG_PL01x_PORTS { (void *)MXS_UARTDBG_BASE } |
| 104 | #define CONFIG_CONS_INDEX 0 |
| 105 | #define CONFIG_BAUDRATE 115200 /* Default baud rate */ |
Marek Vasut | 189e35b | 2013-01-12 07:11:11 +0000 | [diff] [blame] | 106 | |
| 107 | /* |
Otavio Salvador | fcc7689 | 2013-02-23 02:43:09 +0000 | [diff] [blame] | 108 | * Status LED |
| 109 | */ |
Otavio Salvador | 9ffb9dc | 2013-03-24 16:17:33 +0000 | [diff] [blame] | 110 | #define CONFIG_STATUS_LED |
| 111 | #define CONFIG_GPIO_LED |
| 112 | #define CONFIG_BOARD_SPECIFIC_LED |
| 113 | #define STATUS_LED_BOOT 0 |
| 114 | #define STATUS_LED_BIT MX23_PAD_SSP1_DETECT__GPIO_2_1 |
| 115 | #define STATUS_LED_STATE STATUS_LED_ON |
| 116 | #define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 2) |
Otavio Salvador | fcc7689 | 2013-02-23 02:43:09 +0000 | [diff] [blame] | 117 | |
| 118 | /* |
Marek Vasut | 73f2b03 | 2013-01-22 15:01:05 +0000 | [diff] [blame] | 119 | * MMC Driver |
| 120 | */ |
Otavio Salvador | 9ffb9dc | 2013-03-24 16:17:33 +0000 | [diff] [blame] | 121 | #ifdef CONFIG_CMD_MMC |
Marek Vasut | 73f2b03 | 2013-01-22 15:01:05 +0000 | [diff] [blame] | 122 | #define CONFIG_MMC |
| 123 | #define CONFIG_BOUNCE_BUFFER |
| 124 | #define CONFIG_GENERIC_MMC |
| 125 | #define CONFIG_MXS_MMC |
| 126 | #endif |
| 127 | |
| 128 | /* |
Marek Vasut | 189e35b | 2013-01-12 07:11:11 +0000 | [diff] [blame] | 129 | * APBH DMA |
| 130 | */ |
| 131 | #define CONFIG_APBH_DMA |
| 132 | |
Otavio Salvador | 801fa15 | 2013-03-02 05:17:29 +0000 | [diff] [blame] | 133 | /* USB */ |
Otavio Salvador | 9ffb9dc | 2013-03-24 16:17:33 +0000 | [diff] [blame] | 134 | #ifdef CONFIG_CMD_USB |
| 135 | #define CONFIG_USB_EHCI |
| 136 | #define CONFIG_USB_EHCI_MXS |
| 137 | #define CONFIG_EHCI_MXS_PORT0 |
| 138 | #define CONFIG_USB_MAX_CONTROLLER_COUNT 1 |
| 139 | #define CONFIG_EHCI_IS_TDI |
| 140 | #define CONFIG_USB_STORAGE |
Otavio Salvador | 801fa15 | 2013-03-02 05:17:29 +0000 | [diff] [blame] | 141 | #endif |
| 142 | |
Otavio Salvador | 6439671 | 2013-03-02 05:17:30 +0000 | [diff] [blame] | 143 | /* Ethernet */ |
Otavio Salvador | 9ffb9dc | 2013-03-24 16:17:33 +0000 | [diff] [blame] | 144 | #ifdef CONFIG_CMD_NET |
| 145 | #define CONFIG_USB_HOST_ETHER |
| 146 | #define CONFIG_USB_ETHER_SMSC95XX |
Otavio Salvador | 6439671 | 2013-03-02 05:17:30 +0000 | [diff] [blame] | 147 | #endif |
| 148 | |
Marek Vasut | 189e35b | 2013-01-12 07:11:11 +0000 | [diff] [blame] | 149 | /* |
Marek Vasut | 189e35b | 2013-01-12 07:11:11 +0000 | [diff] [blame] | 150 | * Boot Linux |
| 151 | */ |
Otavio Salvador | 9ffb9dc | 2013-03-24 16:17:33 +0000 | [diff] [blame] | 152 | #define CONFIG_CMDLINE_TAG |
| 153 | #define CONFIG_SETUP_MEMORY_TAGS |
| 154 | #define CONFIG_BOOTDELAY 3 |
| 155 | #define CONFIG_BOOTFILE "uImage" |
| 156 | #define CONFIG_LOADADDR 0x42000000 |
| 157 | #define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR |
| 158 | #define CONFIG_OF_LIBFDT |
Marek Vasut | 189e35b | 2013-01-12 07:11:11 +0000 | [diff] [blame] | 159 | |
Otavio Salvador | a4d9b3e | 2013-01-23 10:30:33 +0000 | [diff] [blame] | 160 | /* |
| 161 | * Environment |
| 162 | */ |
Otavio Salvador | 9ffb9dc | 2013-03-24 16:17:33 +0000 | [diff] [blame] | 163 | #define CONFIG_ENV_IS_IN_MMC |
| 164 | #define CONFIG_ENV_OVERWRITE |
| 165 | #ifdef CONFIG_ENV_IS_IN_MMC |
| 166 | #define CONFIG_ENV_OFFSET (256 * 1024) |
| 167 | #define CONFIG_ENV_SIZE (16 * 1024) |
| 168 | #define CONFIG_SYS_MMC_ENV_DEV 0 |
Otavio Salvador | a4d9b3e | 2013-01-23 10:30:33 +0000 | [diff] [blame] | 169 | #endif |
| 170 | |
| 171 | /* |
| 172 | * Extra Environments |
| 173 | */ |
| 174 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
| 175 | "update_sd_firmware_filename=u-boot.sd\0" \ |
| 176 | "update_sd_firmware=" /* Update the SD firmware partition */ \ |
| 177 | "if mmc rescan ; then " \ |
| 178 | "if tftp ${update_sd_firmware_filename} ; then " \ |
| 179 | "setexpr fw_sz ${filesize} / 0x200 ; " /* SD block size */ \ |
| 180 | "setexpr fw_sz ${fw_sz} + 1 ; " \ |
| 181 | "mmc write ${loadaddr} 0x800 ${fw_sz} ; " \ |
| 182 | "fi ; " \ |
| 183 | "fi\0" \ |
| 184 | "script=boot.scr\0" \ |
| 185 | "uimage=uImage\0" \ |
| 186 | "console=ttyAMA0\0" \ |
| 187 | "fdt_file=imx23-olinuxino.dtb\0" \ |
| 188 | "fdt_addr=0x41000000\0" \ |
| 189 | "boot_fdt=try\0" \ |
Otavio Salvador | 6439671 | 2013-03-02 05:17:30 +0000 | [diff] [blame] | 190 | "ip_dyn=yes\0" \ |
Otavio Salvador | a4d9b3e | 2013-01-23 10:30:33 +0000 | [diff] [blame] | 191 | "mmcdev=0\0" \ |
| 192 | "mmcpart=2\0" \ |
| 193 | "mmcroot=/dev/mmcblk0p3 rw rootwait\0" \ |
| 194 | "mmcargs=setenv bootargs console=${console},${baudrate} " \ |
| 195 | "root=${mmcroot}\0" \ |
| 196 | "loadbootscript=" \ |
| 197 | "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \ |
| 198 | "bootscript=echo Running bootscript from mmc ...; " \ |
| 199 | "source\0" \ |
| 200 | "loaduimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${uimage}\0" \ |
| 201 | "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \ |
| 202 | "mmcboot=echo Booting from mmc ...; " \ |
| 203 | "run mmcargs; " \ |
| 204 | "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \ |
| 205 | "if run loadfdt; then " \ |
| 206 | "bootm ${loadaddr} - ${fdt_addr}; " \ |
| 207 | "else " \ |
| 208 | "if test ${boot_fdt} = try; then " \ |
| 209 | "bootm; " \ |
| 210 | "else " \ |
| 211 | "echo WARN: Cannot load the DT; " \ |
| 212 | "fi; " \ |
| 213 | "fi; " \ |
| 214 | "else " \ |
| 215 | "bootm; " \ |
Otavio Salvador | 6439671 | 2013-03-02 05:17:30 +0000 | [diff] [blame] | 216 | "fi;\0" \ |
Alexandre Pereira da Silva | 5410936 | 2013-03-25 18:23:45 +0000 | [diff] [blame] | 217 | "netargs=setenv bootargs console=${console},${baudrate} " \ |
Otavio Salvador | 6439671 | 2013-03-02 05:17:30 +0000 | [diff] [blame] | 218 | "root=/dev/nfs " \ |
| 219 | "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \ |
| 220 | "netboot=echo Booting from net ...; " \ |
| 221 | "usb start; " \ |
| 222 | "run netargs; " \ |
| 223 | "if test ${ip_dyn} = yes; then " \ |
| 224 | "setenv get_cmd dhcp; " \ |
| 225 | "else " \ |
| 226 | "setenv get_cmd tftp; " \ |
| 227 | "fi; " \ |
| 228 | "${get_cmd} ${uimage}; " \ |
| 229 | "if test ${boot_fdt} = yes; then " \ |
| 230 | "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \ |
| 231 | "bootm ${loadaddr} - ${fdt_addr}; " \ |
| 232 | "else " \ |
| 233 | "if test ${boot_fdt} = try; then " \ |
| 234 | "bootm; " \ |
| 235 | "else " \ |
| 236 | "echo WARN: Cannot load the DT; " \ |
| 237 | "fi;" \ |
| 238 | "fi; " \ |
| 239 | "else " \ |
| 240 | "bootm; " \ |
Otavio Salvador | a4d9b3e | 2013-01-23 10:30:33 +0000 | [diff] [blame] | 241 | "fi;\0" |
| 242 | |
| 243 | #define CONFIG_BOOTCOMMAND \ |
| 244 | "mmc dev ${mmcdev}; if mmc rescan; then " \ |
| 245 | "if run loadbootscript; then " \ |
| 246 | "run bootscript; " \ |
| 247 | "else " \ |
| 248 | "if run loaduimage; then " \ |
| 249 | "run mmcboot; " \ |
Otavio Salvador | 6439671 | 2013-03-02 05:17:30 +0000 | [diff] [blame] | 250 | "else run netboot; " \ |
Otavio Salvador | a4d9b3e | 2013-01-23 10:30:33 +0000 | [diff] [blame] | 251 | "fi; " \ |
| 252 | "fi; " \ |
Otavio Salvador | 6439671 | 2013-03-02 05:17:30 +0000 | [diff] [blame] | 253 | "else run netboot; fi" |
Otavio Salvador | a4d9b3e | 2013-01-23 10:30:33 +0000 | [diff] [blame] | 254 | |
Marek Vasut | 189e35b | 2013-01-12 07:11:11 +0000 | [diff] [blame] | 255 | #endif /* __MX23_OLINUXINO_CONFIG_H__ */ |