Stefano Babic | 53b603c | 2012-02-22 00:24:40 +0000 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2012, Stefano Babic <sbabic@denx.de> |
| 3 | * |
| 4 | * Copyright (C) 2010 Freescale Semiconductor, Inc. |
| 5 | * |
| 6 | * Configuration settings for the MX53-EVK Freescale board. |
| 7 | * |
| 8 | * This program is free software; you can redistribute it and/or |
| 9 | * modify it under the terms of the GNU General Public License as |
| 10 | * published by the Free Software Foundation; either version 2 of |
| 11 | * the License, or (at your option) any later version. |
| 12 | * |
| 13 | * This program is distributed in the hope that it will be useful, |
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | * GNU General Public License for more details. |
| 17 | * |
| 18 | * You should have received a copy of the GNU General Public License |
| 19 | * along with this program; if not, write to the Free Software |
| 20 | * Foundation, Inc. |
| 21 | */ |
| 22 | |
| 23 | #ifndef __CONFIG_H |
| 24 | #define __CONFIG_H |
| 25 | |
| 26 | /* SOC type must be included before imx-regs.h */ |
| 27 | #define CONFIG_MX53 |
| 28 | #include <asm/arch/imx-regs.h> |
| 29 | #include <asm/arch/mx5x_pins.h> |
| 30 | |
| 31 | #define CONFIG_SYS_MX5_HCLK 24000000 |
| 32 | #define CONFIG_SYS_MX5_CLK32 32768 |
| 33 | |
| 34 | #define CONFIG_DISPLAY_CPUINFO |
| 35 | #define CONFIG_DISPLAY_BOARDINFO |
| 36 | |
| 37 | #define CONFIG_CMDLINE_TAG /* enable passing of ATAGs */ |
| 38 | #define CONFIG_SETUP_MEMORY_TAGS |
| 39 | #define CONFIG_INITRD_TAG |
| 40 | |
| 41 | #define CONFIG_OF_LIBFDT |
| 42 | |
| 43 | /* Size of malloc() pool */ |
| 44 | #define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 2 * 1024 * 1024) |
| 45 | |
| 46 | #define CONFIG_BOARD_EARLY_INIT_F |
| 47 | |
| 48 | /* Enable GPIOs */ |
| 49 | #define CONFIG_MXC_GPIO |
| 50 | |
| 51 | /* UART */ |
| 52 | #define CONFIG_MXC_UART |
| 53 | #define CONFIG_MXC_UART_BASE UART4_BASE_ADDR |
| 54 | |
| 55 | /* MMC */ |
| 56 | #define CONFIG_FSL_ESDHC |
| 57 | #define CONFIG_SYS_FSL_ESDHC_ADDR 0 |
| 58 | #define CONFIG_SYS_FSL_ESDHC_NUM 1 |
| 59 | |
| 60 | #define CONFIG_MMC |
| 61 | #define CONFIG_GENERIC_MMC |
| 62 | #define CONFIG_DOS_PARTITION |
| 63 | |
| 64 | /* Ethernet on FEC */ |
| 65 | #define CONFIG_NET_MULTI |
| 66 | #define CONFIG_MII |
| 67 | #define CONFIG_DISCOVER_PHY |
| 68 | |
| 69 | #define CONFIG_FEC_MXC |
| 70 | #define IMX_FEC_BASE FEC_BASE_ADDR |
| 71 | #define CONFIG_FEC_MXC_PHYADDR 0x01 |
| 72 | #define CONFIG_PHY_ADDR CONFIG_FEC_MXC_PHYADDR |
| 73 | #define CONFIG_RESET_PHY_R |
| 74 | #define CONFIG_FEC_MXC_NO_ANEG |
| 75 | #define CONFIG_PRIME "FEC0" |
| 76 | |
| 77 | /* SPI */ |
| 78 | #define CONFIG_HARD_SPI |
| 79 | #define CONFIG_MXC_SPI |
| 80 | #define CONFIG_DEFAULT_SPI_BUS 1 |
| 81 | #define CONFIG_DEFAULT_SPI_MODE SPI_MODE_0 |
| 82 | |
| 83 | /* SPI FLASH - not used for environment */ |
| 84 | #define CONFIG_SPI_FLASH |
| 85 | #define CONFIG_SPI_FLASH_STMICRO |
| 86 | #define CONFIG_SPI_FLASH_CS (IOMUX_TO_GPIO(MX53_PIN_CSI0_D11) \ |
| 87 | << 8) | 0 |
| 88 | #define CONFIG_SF_DEFAULT_MODE SPI_MODE_0 |
| 89 | #define CONFIG_SF_DEFAULT_SPEED 25000000 |
| 90 | |
| 91 | /* allow to overwrite serial and ethaddr */ |
| 92 | #define CONFIG_ENV_OVERWRITE |
| 93 | #define CONFIG_CONS_INDEX 1 |
| 94 | #define CONFIG_BAUDRATE 115200 |
Stefano Babic | 53b603c | 2012-02-22 00:24:40 +0000 | [diff] [blame] | 95 | |
| 96 | /* Command definition */ |
| 97 | #include <config_cmd_default.h> |
| 98 | #define CONFIG_CMD_PING |
| 99 | #define CONFIG_CMD_DHCP |
| 100 | #define CONFIG_CMD_MII |
| 101 | #define CONFIG_CMD_MMC |
| 102 | #define CONFIG_CMD_FAT |
| 103 | #define CONFIG_CMD_EXT2 |
| 104 | #define CONFIG_CMD_MTDPARTS |
| 105 | #define CONFIG_CMD_SPI |
| 106 | #define CONFIG_CMD_SF |
| 107 | #define CONFIG_CMD_GPIO |
| 108 | |
| 109 | #define CONFIG_BOOTDELAY 3 |
| 110 | |
| 111 | #define CONFIG_LOADADDR 0x70800000 /* loadaddr env var */ |
| 112 | #define CONFIG_SYS_TEXT_BASE 0xf0001400 /* uboot in nor flash */ |
| 113 | |
| 114 | #define CONFIG_ARP_TIMEOUT 200UL |
| 115 | |
| 116 | /* Miscellaneous configurable options */ |
| 117 | #define CONFIG_SYS_LONGHELP /* undef to save memory */ |
| 118 | #define CONFIG_SYS_HUSH_PARSER /* use "hush" command parser */ |
Stefano Babic | 53b603c | 2012-02-22 00:24:40 +0000 | [diff] [blame] | 119 | #define CONFIG_SYS_PROMPT "IMA3 MX53 U-Boot > " |
| 120 | #define CONFIG_AUTO_COMPLETE |
| 121 | #define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */ |
| 122 | |
| 123 | /* Print Buffer Size */ |
| 124 | #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16) |
| 125 | #define CONFIG_SYS_MAXARGS 16 /* max number of command args */ |
| 126 | #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE /* Boot Argument Buffer Size */ |
| 127 | |
| 128 | #define CONFIG_SYS_MEMTEST_START 0x70000000 |
| 129 | #define CONFIG_SYS_MEMTEST_END 0x10000 |
| 130 | |
| 131 | #define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR |
| 132 | |
| 133 | #define CONFIG_SYS_HZ 1000 |
| 134 | #define CONFIG_CMDLINE_EDITING |
| 135 | |
| 136 | /* Stack sizes */ |
| 137 | #define CONFIG_STACKSIZE (128 * 1024) /* regular stack */ |
| 138 | |
| 139 | /* Physical Memory Map */ |
| 140 | #define CONFIG_NR_DRAM_BANKS 1 |
| 141 | #define PHYS_SDRAM_1 CSD0_BASE_ADDR |
| 142 | #define PHYS_SDRAM_1_SIZE (1024 * 1024 * 1024) |
| 143 | |
| 144 | #define CONFIG_SYS_SDRAM_BASE (PHYS_SDRAM_1) |
| 145 | #define CONFIG_SYS_INIT_RAM_ADDR (IRAM_BASE_ADDR) |
| 146 | #define CONFIG_SYS_INIT_RAM_SIZE (IRAM_SIZE) |
| 147 | |
| 148 | #define CONFIG_SYS_INIT_SP_OFFSET \ |
| 149 | (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE) |
| 150 | #define CONFIG_SYS_INIT_SP_ADDR \ |
| 151 | (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET) |
| 152 | |
| 153 | #define CONFIG_MTD_DEVICE /* needed for mtdparts commands */ |
| 154 | #define MTDIDS_DEFAULT "nor0=f0000000.flash" |
| 155 | |
| 156 | /* FLASH and environment organization */ |
| 157 | |
| 158 | #define CONFIG_SYS_FLASH_BASE 0xF0000000 |
| 159 | #define CONFIG_SYS_FLASH_CFI /* Flash is CFI conformant */ |
| 160 | #define CONFIG_FLASH_CFI_DRIVER /* Use the common driver */ |
| 161 | #define CONFIG_FLASH_CFI_MTD /* with MTD support */ |
| 162 | #define CONFIG_SYS_FLASH_BANKS_LIST { CONFIG_SYS_FLASH_BASE } |
| 163 | #define CONFIG_SYS_MAX_FLASH_BANKS 1 |
| 164 | #define CONFIG_SYS_MAX_FLASH_SECT 1024 |
| 165 | |
| 166 | #define CONFIG_SYS_FLASH_EMPTY_INFO |
| 167 | #define CONFIG_SYS_FLASH_USE_BUFFER_WRITE |
| 168 | |
| 169 | #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_FLASH_BASE |
| 170 | #define CONFIG_SYS_MONITOR_LEN (512 * 1024) |
| 171 | |
| 172 | #define CONFIG_ENV_SIZE (8 * 1024) |
| 173 | #define CONFIG_ENV_IS_IN_FLASH |
| 174 | #define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_BASE + \ |
| 175 | CONFIG_SYS_MONITOR_LEN) |
| 176 | #define CONFIG_ENV_SECT_SIZE 0x20000 |
| 177 | #define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + \ |
| 178 | CONFIG_ENV_SECT_SIZE) |
| 179 | #define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE |
| 180 | |
| 181 | /* |
| 182 | * Default environment and default scripts |
| 183 | * to update uboot and load kernel |
| 184 | */ |
| 185 | |
| 186 | #define HOSTNAME ima3-mx53 |
| 187 | #define xstr(s) str(s) |
| 188 | #define str(s) #s |
| 189 | |
| 190 | #define CONFIG_HOSTNAME ima3-mx53 |
| 191 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
| 192 | "netdev=eth0\0" \ |
| 193 | "nfsargs=setenv bootargs root=/dev/nfs rw " \ |
| 194 | "nfsroot=${serverip}:${rootpath}\0" \ |
| 195 | "ramargs=setenv bootargs root=/dev/ram0 rw\0" \ |
| 196 | "addip_sta=setenv bootargs ${bootargs} " \ |
| 197 | "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}" \ |
| 198 | ":${hostname}:${netdev}:off panic=1\0" \ |
| 199 | "addip_dyn=setenv bootargs ${bootargs} ip=dhcp\0" \ |
| 200 | "addip=if test -n ${ipdyn};then run addip_dyn;" \ |
| 201 | "else run addip_sta;fi\0" \ |
| 202 | "addmtd=setenv bootargs ${bootargs} ${mtdparts}\0" \ |
| 203 | "addtty=setenv bootargs ${bootargs}" \ |
| 204 | " console=${console},${baudrate}\0" \ |
| 205 | "addmisc=setenv bootargs ${bootargs} ${misc}\0" \ |
| 206 | "console=ttymxc3\0" \ |
| 207 | "loadaddr=70800000\0" \ |
| 208 | "kernel_addr_r=70800000\0" \ |
| 209 | "ramdisk_addr_r=71000000\0" \ |
| 210 | "hostname=" xstr(CONFIG_HOSTNAME) "\0" \ |
| 211 | "bootfile=" xstr(CONFIG_HOSTNAME) "/uImage\0" \ |
| 212 | "ramdisk_file=" xstr(CONFIG_HOSTNAME) "/uRamdisk\0" \ |
| 213 | "mmcargs=setenv bootargs root=${mmcroot} " \ |
| 214 | "rootfstype=${mmcrootfstype}\0" \ |
| 215 | "mmcroot=/dev/mmcblk0p3 rw\0" \ |
| 216 | "mmcboot=echo Booting from mmc ...; " \ |
| 217 | "run mmcargs addip addtty addmtd addmisc mmcload;" \ |
| 218 | "bootm\0" \ |
| 219 | "mmcload=fatload mmc ${mmcdev}:${mmcpart} " \ |
| 220 | "${loadaddr} ${uimage}\0" \ |
| 221 | "mmcrootfstype=ext3 rootwait\0" \ |
| 222 | "flash_self=run ramargs addip addtty addmtd addmisc;" \ |
| 223 | "bootm ${kernel_addr} ${ramdisk_addr}\0" \ |
| 224 | "flash_nfs=run nfsargs addip addtty addmtd addmisc;" \ |
| 225 | "bootm ${kernel_addr}\0" \ |
| 226 | "net_nfs=tftp ${kernel_addr_r} ${bootfile}; " \ |
| 227 | "run nfsargs addip addtty addmtd addmisc;" \ |
| 228 | "bootm ${kernel_addr_r}\0" \ |
| 229 | "net_self_load=tftp ${ramdisk_addr_r} ${ramdisk_file};" \ |
| 230 | "tftp ${kernel_addr_r} ${bootfile}\0" \ |
| 231 | "net_self=if run net_self_load;then " \ |
| 232 | "run ramargs addip addtty addmtd addmisc;" \ |
| 233 | "bootm ${kernel_addr_r} ${ramdisk_addr_r};" \ |
| 234 | "else echo Images not loades;fi\0" \ |
| 235 | "satargs=setenv bootargs root=/dev/sda1\0" \ |
| 236 | "satafile=boot/uImage\0" \ |
| 237 | "ssdboot=echo Booting from ssd ...; " \ |
| 238 | "run satargs addip addtty addmtd addmisc;" \ |
| 239 | "sata init;ext2load sata 0:1 ${kernel_addr_r} " \ |
| 240 | "${satafile};bootm\0" \ |
| 241 | "u-boot=" xstr(CONFIG_HOSTNAME) "/u-boot.imx\0" \ |
| 242 | "uimage=uImage\0" \ |
| 243 | "load=tftp ${loadaddr} ${u-boot}\0" \ |
| 244 | "uboot_addr=0xf0001000\0" \ |
| 245 | "update=protect off 0xf0000000 +60000;" \ |
| 246 | "erase ${uboot_addr} +60000;" \ |
| 247 | "cp.b ${loadaddr} ${uboot_addr} ${filesize}\0" \ |
| 248 | "upd=if run load;then echo Updating u-boot;if run update;" \ |
| 249 | "then echo U-Boot updated;" \ |
| 250 | "else echo Error updating u-boot !;" \ |
| 251 | "echo Board without bootloader !!;" \ |
| 252 | "fi;" \ |
| 253 | "else echo U-Boot not downloaded..exiting;fi\0" \ |
| 254 | "bootcmd=run net_nfs\0" |
| 255 | |
| 256 | |
| 257 | #define CONFIG_CMD_SATA |
| 258 | #ifdef CONFIG_CMD_SATA |
| 259 | #define CONFIG_DWC_AHSATA |
| 260 | #define CONFIG_SYS_SATA_MAX_DEVICE 1 |
| 261 | #define CONFIG_DWC_AHSATA_PORT_ID 0 |
| 262 | #define CONFIG_DWC_AHSATA_BASE_ADDR SATA_BASE_ADDR |
| 263 | #define CONFIG_LBA48 |
| 264 | #define CONFIG_LIBATA |
| 265 | #endif |
| 266 | |
| 267 | #endif /* __CONFIG_H */ |