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