Fabio Estevam | 5c824dd | 2013-09-26 22:59:25 -0300 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2013 Freescale Semiconductor, Inc. |
| 3 | * |
| 4 | * Configuration settings for Udoo board. |
| 5 | * |
| 6 | * SPDX-License-Identifier: GPL-2.0+ |
| 7 | */ |
| 8 | |
| 9 | #ifndef __CONFIG_H |
| 10 | #define __CONFIG_H |
| 11 | |
| 12 | #include <asm/arch/imx-regs.h> |
| 13 | #include <asm/imx-common/gpio.h> |
| 14 | #include <asm/sizes.h> |
| 15 | |
| 16 | #define CONFIG_MX6 |
| 17 | #define CONFIG_DISPLAY_CPUINFO |
| 18 | #define CONFIG_DISPLAY_BOARDINFO |
| 19 | |
| 20 | #define MACH_TYPE_UDOO 4800 |
| 21 | #define CONFIG_MACH_TYPE MACH_TYPE_UDOO |
| 22 | |
| 23 | #define CONFIG_CMDLINE_TAG |
| 24 | #define CONFIG_SETUP_MEMORY_TAGS |
| 25 | #define CONFIG_INITRD_TAG |
| 26 | #define CONFIG_REVISION_TAG |
| 27 | |
| 28 | /* Size of malloc() pool */ |
| 29 | #define CONFIG_SYS_MALLOC_LEN (2 * SZ_1M) |
| 30 | |
| 31 | #define CONFIG_BOARD_EARLY_INIT_F |
| 32 | #define CONFIG_MXC_GPIO |
| 33 | |
| 34 | #define CONFIG_MXC_UART |
| 35 | #define CONFIG_MXC_UART_BASE UART2_BASE |
| 36 | |
Giuseppe Pagano | cbadb0b | 2013-11-15 17:42:51 +0100 | [diff] [blame^] | 37 | /* Network support */ |
| 38 | |
| 39 | #define CONFIG_CMD_PING |
| 40 | #define CONFIG_CMD_DHCP |
| 41 | #define CONFIG_CMD_MII |
| 42 | #define CONFIG_CMD_NET |
| 43 | #define CONFIG_FEC_MXC |
| 44 | #define CONFIG_MII |
| 45 | #define IMX_FEC_BASE ENET_BASE_ADDR |
| 46 | #define CONFIG_FEC_XCV_TYPE RGMII |
| 47 | #define CONFIG_ETHPRIME "FEC" |
| 48 | #define CONFIG_FEC_MXC_PHYADDR 6 |
| 49 | #define CONFIG_PHYLIB |
| 50 | #define CONFIG_PHY_MICREL |
| 51 | #define CONFIG_PHY_MICREL_KSZ9031 |
| 52 | |
Fabio Estevam | 5c824dd | 2013-09-26 22:59:25 -0300 | [diff] [blame] | 53 | /* allow to overwrite serial and ethaddr */ |
| 54 | #define CONFIG_ENV_OVERWRITE |
| 55 | #define CONFIG_CONS_INDEX 1 |
| 56 | #define CONFIG_BAUDRATE 115200 |
| 57 | |
| 58 | /* Command definition */ |
| 59 | #include <config_cmd_default.h> |
| 60 | |
| 61 | #undef CONFIG_CMD_IMLS |
| 62 | |
| 63 | #define CONFIG_CMD_BMODE |
| 64 | #define CONFIG_CMD_SETEXPR |
| 65 | |
| 66 | #define CONFIG_BOOTDELAY 3 |
| 67 | |
| 68 | #define CONFIG_SYS_MEMTEST_START 0x10000000 |
| 69 | #define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_MEMTEST_START + 500 * SZ_1M) |
| 70 | #define CONFIG_LOADADDR 0x12000000 |
| 71 | #define CONFIG_SYS_TEXT_BASE 0x17800000 |
| 72 | |
| 73 | /* MMC Configuration */ |
| 74 | #define CONFIG_FSL_ESDHC |
| 75 | #define CONFIG_FSL_USDHC |
| 76 | #define CONFIG_SYS_FSL_ESDHC_ADDR 0 |
| 77 | |
| 78 | #define CONFIG_MMC |
| 79 | #define CONFIG_CMD_MMC |
| 80 | #define CONFIG_GENERIC_MMC |
| 81 | #define CONFIG_BOUNCE_BUFFER |
| 82 | #define CONFIG_CMD_EXT2 |
| 83 | #define CONFIG_CMD_FAT |
| 84 | #define CONFIG_DOS_PARTITION |
| 85 | |
| 86 | #define CONFIG_DEFAULT_FDT_FILE "imx6q-udoo.dtb" |
| 87 | |
| 88 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
| 89 | "script=boot.scr\0" \ |
| 90 | "uimage=uImage\0" \ |
| 91 | "console=ttymxc1\0" \ |
| 92 | "splashpos=m,m\0" \ |
| 93 | "fdt_high=0xffffffff\0" \ |
| 94 | "initrd_high=0xffffffff\0" \ |
| 95 | "fdt_file=" CONFIG_DEFAULT_FDT_FILE "\0" \ |
| 96 | "fdt_addr=0x11000000\0" \ |
| 97 | "boot_fdt=try\0" \ |
| 98 | "ip_dyn=yes\0" \ |
| 99 | "mmcdev=0\0" \ |
| 100 | "mmcpart=1\0" \ |
| 101 | "mmcroot=/dev/mmcblk0p2 rootwait rw\0" \ |
| 102 | "update_sd_firmware_filename=u-boot.imx\0" \ |
| 103 | "update_sd_firmware=" \ |
| 104 | "if test ${ip_dyn} = yes; then " \ |
| 105 | "setenv get_cmd dhcp; " \ |
| 106 | "else " \ |
| 107 | "setenv get_cmd tftp; " \ |
| 108 | "fi; " \ |
| 109 | "if mmc dev ${mmcdev}; then " \ |
| 110 | "if ${get_cmd} ${update_sd_firmware_filename}; then " \ |
| 111 | "setexpr fw_sz ${filesize} / 0x200; " \ |
| 112 | "setexpr fw_sz ${fw_sz} + 1; " \ |
| 113 | "mmc write ${loadaddr} 0x2 ${fw_sz}; " \ |
| 114 | "fi; " \ |
| 115 | "fi\0" \ |
| 116 | "mmcargs=setenv bootargs console=${console},${baudrate} " \ |
| 117 | "root=${mmcroot}\0" \ |
| 118 | "loadbootscript=" \ |
| 119 | "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \ |
| 120 | "bootscript=echo Running bootscript from mmc ...; " \ |
| 121 | "source\0" \ |
| 122 | "loaduimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${uimage}\0" \ |
| 123 | "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \ |
| 124 | "mmcboot=echo Booting from mmc ...; " \ |
| 125 | "run mmcargs; " \ |
| 126 | "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \ |
| 127 | "if run loadfdt; then " \ |
| 128 | "bootm ${loadaddr} - ${fdt_addr}; " \ |
| 129 | "else " \ |
| 130 | "if test ${boot_fdt} = try; then " \ |
| 131 | "bootm; " \ |
| 132 | "else " \ |
| 133 | "echo WARN: Cannot load the DT; " \ |
| 134 | "fi; " \ |
| 135 | "fi; " \ |
| 136 | "else " \ |
| 137 | "bootm; " \ |
| 138 | "fi;\0" \ |
| 139 | "netargs=setenv bootargs console=${console},${baudrate} " \ |
| 140 | "root=/dev/nfs " \ |
| 141 | "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \ |
| 142 | "netboot=echo Booting from net ...; " \ |
| 143 | "run netargs; " \ |
| 144 | "if test ${ip_dyn} = yes; then " \ |
| 145 | "setenv get_cmd dhcp; " \ |
| 146 | "else " \ |
| 147 | "setenv get_cmd tftp; " \ |
| 148 | "fi; " \ |
| 149 | "${get_cmd} ${uimage}; " \ |
| 150 | "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \ |
| 151 | "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \ |
| 152 | "bootm ${loadaddr} - ${fdt_addr}; " \ |
| 153 | "else " \ |
| 154 | "if test ${boot_fdt} = try; then " \ |
| 155 | "bootm; " \ |
| 156 | "else " \ |
| 157 | "echo WARN: Cannot load the DT; " \ |
| 158 | "fi; " \ |
| 159 | "fi; " \ |
| 160 | "else " \ |
| 161 | "bootm; " \ |
| 162 | "fi;\0" |
| 163 | |
| 164 | #define CONFIG_BOOTCOMMAND \ |
| 165 | "mmc dev ${mmcdev}; if mmc rescan; then " \ |
| 166 | "if run loadbootscript; then " \ |
| 167 | "run bootscript; " \ |
| 168 | "else " \ |
| 169 | "if run loaduimage; then " \ |
| 170 | "run mmcboot; " \ |
| 171 | "else run netboot; " \ |
| 172 | "fi; " \ |
| 173 | "fi; " \ |
| 174 | "else run netboot; fi" |
| 175 | |
| 176 | /* Miscellaneous configurable options */ |
| 177 | #define CONFIG_SYS_LONGHELP |
| 178 | #define CONFIG_SYS_HUSH_PARSER |
| 179 | #define CONFIG_SYS_PROMPT "=> " |
| 180 | #define CONFIG_AUTO_COMPLETE |
| 181 | #define CONFIG_SYS_CBSIZE 256 |
| 182 | |
| 183 | /* Print Buffer Size */ |
| 184 | #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16) |
| 185 | #define CONFIG_SYS_MAXARGS 16 |
| 186 | #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE |
| 187 | |
| 188 | #define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR |
| 189 | #define CONFIG_SYS_HZ 1000 |
| 190 | |
| 191 | #define CONFIG_CMDLINE_EDITING |
| 192 | |
| 193 | /* Physical Memory Map */ |
| 194 | #define CONFIG_NR_DRAM_BANKS 1 |
| 195 | #define PHYS_SDRAM MMDC0_ARB_BASE_ADDR |
| 196 | |
| 197 | #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM |
| 198 | #define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR |
| 199 | #define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE |
| 200 | |
| 201 | #define CONFIG_SYS_INIT_SP_OFFSET \ |
| 202 | (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE) |
| 203 | #define CONFIG_SYS_INIT_SP_ADDR \ |
| 204 | (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET) |
| 205 | |
| 206 | /* FLASH and environment organization */ |
| 207 | #define CONFIG_SYS_NO_FLASH |
| 208 | |
| 209 | #define CONFIG_ENV_SIZE (8 * 1024) |
| 210 | |
| 211 | #define CONFIG_ENV_IS_IN_MMC |
| 212 | #define CONFIG_ENV_OFFSET (6 * 64 * 1024) |
| 213 | #define CONFIG_SYS_MMC_ENV_DEV 0 |
| 214 | |
| 215 | #define CONFIG_OF_LIBFDT |
| 216 | #define CONFIG_CMD_BOOTZ |
| 217 | |
| 218 | #ifndef CONFIG_SYS_DCACHE_OFF |
| 219 | #define CONFIG_CMD_CACHE |
| 220 | #endif |
| 221 | |
| 222 | #endif /* __CONFIG_H * */ |