Otavio Salvador | 50e6090 | 2013-01-23 10:30:34 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Freescale i.MX23 EVK board config |
| 3 | * |
| 4 | * Copyright (C) 2013 Otavio Salvador <otavio@ossystems.com.br> |
| 5 | * on behalf of O.S. Systems Software LTDA. |
| 6 | * |
| 7 | * This program is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License as published by |
| 9 | * the Free Software Foundation; either version 2 of the License, or |
| 10 | * (at your option) any later version. |
| 11 | * |
| 12 | * This program is distributed in the hope that it will be useful, |
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | * GNU General Public License for more details. |
| 16 | * |
| 17 | * You should have received a copy of the GNU General Public License |
| 18 | * along with this program; if not, write to the Free Software |
| 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 20 | * |
| 21 | */ |
| 22 | #ifndef __MX23EVK_CONFIG_H__ |
| 23 | #define __MX23EVK_CONFIG_H__ |
| 24 | |
| 25 | /* SoC configurations */ |
| 26 | #define CONFIG_MX23 /* i.MX23 SoC */ |
| 27 | |
| 28 | #include <asm/arch/regs-base.h> |
| 29 | |
| 30 | #define CONFIG_MXS_GPIO /* GPIO control */ |
| 31 | #define CONFIG_SYS_HZ 1000 /* Ticks per second */ |
| 32 | |
| 33 | #define CONFIG_MACH_TYPE MACH_TYPE_MX23EVK |
| 34 | |
| 35 | #define CONFIG_SYS_NO_FLASH |
Otavio Salvador | 50e6090 | 2013-01-23 10:30:34 +0000 | [diff] [blame] | 36 | #define CONFIG_BOARD_EARLY_INIT_F |
| 37 | #define CONFIG_ARCH_MISC_INIT |
| 38 | |
| 39 | /* SPL */ |
| 40 | #define CONFIG_SPL |
| 41 | #define CONFIG_SPL_NO_CPU_SUPPORT_CODE |
| 42 | #define CONFIG_SPL_START_S_PATH "arch/arm/cpu/arm926ejs/mxs" |
| 43 | #define CONFIG_SPL_LDSCRIPT "arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds" |
| 44 | #define CONFIG_SPL_LIBCOMMON_SUPPORT |
| 45 | #define CONFIG_SPL_LIBGENERIC_SUPPORT |
| 46 | #define CONFIG_SPL_GPIO_SUPPORT |
| 47 | |
| 48 | /* U-Boot Commands */ |
| 49 | #include <config_cmd_default.h> |
| 50 | #undef CONFIG_CMD_NET |
| 51 | #undef CONFIG_CMD_NFS |
| 52 | |
| 53 | #define CONFIG_DISPLAY_CPUINFO |
| 54 | #define CONFIG_DOS_PARTITION |
| 55 | |
| 56 | #define CONFIG_CMD_CACHE |
| 57 | #define CONFIG_CMD_EXT2 |
| 58 | #define CONFIG_CMD_FAT |
| 59 | #define CONFIG_CMD_GPIO |
| 60 | #define CONFIG_CMD_MMC |
Otavio Salvador | 6c5223a | 2013-03-02 05:17:28 +0000 | [diff] [blame] | 61 | #define CONFIG_CMD_USB |
Otavio Salvador | 50e6090 | 2013-01-23 10:30:34 +0000 | [diff] [blame] | 62 | #define CONFIG_CMD_BOOTZ |
| 63 | |
| 64 | /* Memory configurations */ |
| 65 | #define CONFIG_NR_DRAM_BANKS 1 /* 1 bank of DRAM */ |
| 66 | #define PHYS_SDRAM_1 0x40000000 /* Base address */ |
| 67 | #define PHYS_SDRAM_1_SIZE 0x08000000 /* Max 128 MB RAM */ |
| 68 | #define CONFIG_STACKSIZE (128 * 1024) /* 128 KB stack */ |
| 69 | #define CONFIG_SYS_MALLOC_LEN 0x00400000 /* 4 MB for malloc */ |
| 70 | #define CONFIG_SYS_MEMTEST_START 0x40000000 /* Memtest start adr */ |
| 71 | #define CONFIG_SYS_MEMTEST_END 0x40400000 /* 4 MB RAM test */ |
| 72 | #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1 |
| 73 | /* Point initial SP in SRAM so SPL can use it too. */ |
| 74 | |
| 75 | #define CONFIG_SYS_INIT_RAM_ADDR 0x00000000 |
| 76 | #define CONFIG_SYS_INIT_RAM_SIZE (128 * 1024) |
| 77 | |
| 78 | #define CONFIG_SYS_INIT_SP_OFFSET \ |
| 79 | (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE) |
| 80 | #define CONFIG_SYS_INIT_SP_ADDR \ |
| 81 | (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET) |
| 82 | |
| 83 | /* |
| 84 | * We need to sacrifice first 4 bytes of RAM here to avoid triggering some |
| 85 | * strange BUG in ROM corrupting first 4 bytes of RAM when loading U-Boot |
| 86 | * binary. In case there was more of this mess, 0x100 bytes are skipped. |
| 87 | */ |
| 88 | #define CONFIG_SYS_TEXT_BASE 0x40000100 |
| 89 | |
| 90 | #define CONFIG_ENV_OVERWRITE |
| 91 | |
| 92 | /* U-Boot general configurations */ |
| 93 | #define CONFIG_SYS_LONGHELP |
| 94 | #define CONFIG_SYS_PROMPT "=> " |
| 95 | #define CONFIG_SYS_CBSIZE 256 /* Console I/O buffer size */ |
| 96 | #define CONFIG_SYS_PBSIZE \ |
| 97 | (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16) |
| 98 | /* Print buffer size */ |
| 99 | #define CONFIG_SYS_MAXARGS 32 /* Max number of command args */ |
| 100 | #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE |
| 101 | /* Boot argument buffer size */ |
| 102 | #define CONFIG_VERSION_VARIABLE /* U-BOOT version */ |
| 103 | #define CONFIG_AUTO_COMPLETE /* Command auto complete */ |
| 104 | #define CONFIG_CMDLINE_EDITING /* Command history etc */ |
| 105 | #define CONFIG_SYS_HUSH_PARSER |
| 106 | #define CONFIG_SYS_PROMPT_HUSH_PS2 "> " |
| 107 | |
| 108 | /* Serial Driver */ |
| 109 | #define CONFIG_PL011_SERIAL |
| 110 | #define CONFIG_PL011_CLOCK 24000000 |
| 111 | #define CONFIG_PL01x_PORTS { (void *)MXS_UARTDBG_BASE } |
| 112 | #define CONFIG_CONS_INDEX 0 |
| 113 | #define CONFIG_BAUDRATE 115200 /* Default baud rate */ |
Otavio Salvador | 50e6090 | 2013-01-23 10:30:34 +0000 | [diff] [blame] | 114 | |
| 115 | /* DMA */ |
| 116 | #define CONFIG_APBH_DMA |
| 117 | |
| 118 | /* MMC Driver */ |
| 119 | #ifdef CONFIG_CMD_MMC |
| 120 | #define CONFIG_MMC |
| 121 | #define CONFIG_GENERIC_MMC |
| 122 | #define CONFIG_BOUNCE_BUFFER |
| 123 | #define CONFIG_MXS_MMC |
| 124 | #endif |
| 125 | |
Otavio Salvador | 6c5223a | 2013-03-02 05:17:28 +0000 | [diff] [blame] | 126 | /* USB */ |
| 127 | #ifdef CONFIG_CMD_USB |
| 128 | #define CONFIG_USB_EHCI |
| 129 | #define CONFIG_USB_EHCI_MXS |
| 130 | #define CONFIG_EHCI_MXS_PORT0 |
| 131 | #define CONFIG_USB_MAX_CONTROLLER_COUNT 1 |
| 132 | #define CONFIG_EHCI_IS_TDI |
| 133 | #define CONFIG_USB_STORAGE |
| 134 | #endif |
| 135 | |
Otavio Salvador | 50e6090 | 2013-01-23 10:30:34 +0000 | [diff] [blame] | 136 | /* Boot Linux */ |
| 137 | #define CONFIG_CMDLINE_TAG |
| 138 | #define CONFIG_SETUP_MEMORY_TAGS |
| 139 | #define CONFIG_BOOTDELAY 1 |
| 140 | #define CONFIG_BOOTFILE "uImage" |
| 141 | #define CONFIG_LOADADDR 0x42000000 |
| 142 | #define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR |
| 143 | #define CONFIG_OF_LIBFDT |
| 144 | |
| 145 | /* Environment */ |
| 146 | #define CONFIG_ENV_IS_IN_MMC |
| 147 | #ifdef CONFIG_ENV_IS_IN_MMC |
| 148 | #define CONFIG_ENV_OFFSET (256 * 1024) |
| 149 | #define CONFIG_ENV_SIZE (16 * 1024) |
| 150 | #define CONFIG_SYS_MMC_ENV_DEV 0 |
| 151 | #endif |
| 152 | |
| 153 | /* Extra Environments */ |
| 154 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
| 155 | "update_sd_firmware_filename=u-boot.sd\0" \ |
| 156 | "update_sd_firmware=" /* Update the SD firmware partition */ \ |
| 157 | "if mmc rescan ; then " \ |
| 158 | "if tftp ${update_sd_firmware_filename} ; then " \ |
| 159 | "setexpr fw_sz ${filesize} / 0x200 ; " /* SD block size */ \ |
| 160 | "setexpr fw_sz ${fw_sz} + 1 ; " \ |
| 161 | "mmc write ${loadaddr} 0x800 ${fw_sz} ; " \ |
| 162 | "fi ; " \ |
| 163 | "fi\0" \ |
| 164 | "script=boot.scr\0" \ |
| 165 | "uimage=uImage\0" \ |
| 166 | "console=ttyAMA0\0" \ |
| 167 | "fdt_file=imx23-evk.dtb\0" \ |
| 168 | "fdt_addr=0x41000000\0" \ |
| 169 | "boot_fdt=try\0" \ |
| 170 | "mmcdev=0\0" \ |
| 171 | "mmcpart=2\0" \ |
| 172 | "mmcroot=/dev/mmcblk0p3 rw rootwait\0" \ |
| 173 | "mmcargs=setenv bootargs console=${console},${baudrate} " \ |
| 174 | "root=${mmcroot}\0" \ |
| 175 | "loadbootscript=" \ |
| 176 | "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \ |
| 177 | "bootscript=echo Running bootscript from mmc ...; " \ |
| 178 | "source\0" \ |
| 179 | "loaduimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${uimage}\0" \ |
| 180 | "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \ |
| 181 | "mmcboot=echo Booting from mmc ...; " \ |
| 182 | "run mmcargs; " \ |
| 183 | "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \ |
| 184 | "if run loadfdt; then " \ |
| 185 | "bootm ${loadaddr} - ${fdt_addr}; " \ |
| 186 | "else " \ |
| 187 | "if test ${boot_fdt} = try; then " \ |
| 188 | "bootm; " \ |
| 189 | "else " \ |
| 190 | "echo WARN: Cannot load the DT; " \ |
| 191 | "fi; " \ |
| 192 | "fi; " \ |
| 193 | "else " \ |
| 194 | "bootm; " \ |
| 195 | "fi;\0" |
| 196 | |
| 197 | #define CONFIG_BOOTCOMMAND \ |
| 198 | "mmc dev ${mmcdev}; if mmc rescan; then " \ |
| 199 | "if run loadbootscript; then " \ |
| 200 | "run bootscript; " \ |
| 201 | "else " \ |
| 202 | "if run loaduimage; then " \ |
| 203 | "run mmcboot; " \ |
| 204 | "else " \ |
| 205 | "echo ERR: Fail to boot from MMC; " \ |
| 206 | "fi; " \ |
| 207 | "fi; " \ |
| 208 | "else exit; fi" |
| 209 | |
| 210 | #endif /* __MX23EVK_CONFIG_H__ */ |