Fabio Estevam | 1d97a59 | 2015-04-20 14:48:57 -0300 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2015 Freescale Semiconductor, Inc. |
| 3 | * |
| 4 | * Configuration settings for the SolidRun mx6 based boards |
| 5 | * |
| 6 | * SPDX-License-Identifier: GPL-2.0+ |
| 7 | */ |
| 8 | #ifndef __MX6CUBOXI_CONFIG_H |
| 9 | #define __MX6CUBOXI_CONFIG_H |
| 10 | |
Fabio Estevam | 1d97a59 | 2015-04-20 14:48:57 -0300 | [diff] [blame] | 11 | #include "mx6_common.h" |
| 12 | |
Fabio Estevam | 1d97a59 | 2015-04-20 14:48:57 -0300 | [diff] [blame] | 13 | #define CONFIG_SPL_LIBCOMMON_SUPPORT |
| 14 | #define CONFIG_SPL_MMC_SUPPORT |
| 15 | #include "imx6_spl.h" |
| 16 | |
Fabio Estevam | 1d97a59 | 2015-04-20 14:48:57 -0300 | [diff] [blame] | 17 | #define CONFIG_IMX6_THERMAL |
Fabio Estevam | 1d97a59 | 2015-04-20 14:48:57 -0300 | [diff] [blame] | 18 | |
Fabio Estevam | 239fd31 | 2015-04-29 22:28:09 -0300 | [diff] [blame] | 19 | #define CONFIG_SYS_MALLOC_LEN (10 * SZ_1M) |
Fabio Estevam | 1d97a59 | 2015-04-20 14:48:57 -0300 | [diff] [blame] | 20 | #define CONFIG_BOARD_EARLY_INIT_F |
Fabio Estevam | 9887c1a | 2015-04-25 18:47:21 -0300 | [diff] [blame] | 21 | #define CONFIG_BOARD_LATE_INIT |
Fabio Estevam | 1d97a59 | 2015-04-20 14:48:57 -0300 | [diff] [blame] | 22 | #define CONFIG_MXC_UART |
| 23 | #define CONFIG_CMD_FUSE |
| 24 | #define CONFIG_MXC_OCOTP |
| 25 | |
| 26 | /* MMC Configs */ |
Fabio Estevam | 1d97a59 | 2015-04-20 14:48:57 -0300 | [diff] [blame] | 27 | #define CONFIG_SYS_FSL_ESDHC_ADDR USDHC2_BASE_ADDR |
Fabio Estevam | 1d97a59 | 2015-04-20 14:48:57 -0300 | [diff] [blame] | 28 | |
| 29 | /* Ethernet Configuration */ |
| 30 | #define CONFIG_FEC_MXC |
| 31 | #define CONFIG_CMD_PING |
| 32 | #define CONFIG_CMD_DHCP |
| 33 | #define CONFIG_CMD_MII |
Fabio Estevam | 1d97a59 | 2015-04-20 14:48:57 -0300 | [diff] [blame] | 34 | #define CONFIG_MII |
| 35 | #define IMX_FEC_BASE ENET_BASE_ADDR |
| 36 | #define CONFIG_FEC_XCV_TYPE RGMII |
| 37 | #define CONFIG_FEC_MXC_PHYADDR 0 |
| 38 | #define CONFIG_PHYLIB |
| 39 | #define CONFIG_PHY_ATHEROS |
| 40 | |
Fabio Estevam | 239fd31 | 2015-04-29 22:28:09 -0300 | [diff] [blame] | 41 | /* Framebuffer */ |
| 42 | #define CONFIG_VIDEO |
| 43 | #define CONFIG_VIDEO_IPUV3 |
| 44 | #define CONFIG_IPUV3_CLK 260000000 |
| 45 | #define CONFIG_CFB_CONSOLE |
| 46 | #define CONFIG_VGA_AS_SINGLE_DEVICE |
| 47 | #define CONFIG_SYS_CONSOLE_IS_IN_ENV |
| 48 | #define CONFIG_VIDEO_BMP_RLE8 |
| 49 | #define CONFIG_SPLASH_SCREEN |
| 50 | #define CONFIG_SPLASH_SCREEN_ALIGN |
| 51 | #define CONFIG_BMP_16BPP |
| 52 | #define CONFIG_VIDEO_LOGO |
| 53 | #define CONFIG_VIDEO_BMP_LOGO |
| 54 | #define CONFIG_IMX_HDMI |
Fabio Estevam | 0d404ce | 2015-05-04 14:09:23 -0300 | [diff] [blame] | 55 | #define CONFIG_CMD_HDMIDETECT |
Fabio Estevam | 239fd31 | 2015-04-29 22:28:09 -0300 | [diff] [blame] | 56 | #define CONFIG_IMX_VIDEO_SKIP |
Fabio Estevam | 1d51f6b | 2015-04-29 22:28:11 -0300 | [diff] [blame] | 57 | #define CONFIG_CONSOLE_MUX |
Fabio Estevam | 239fd31 | 2015-04-29 22:28:09 -0300 | [diff] [blame] | 58 | |
Fabio Estevam | 729bbb8 | 2015-04-29 22:28:10 -0300 | [diff] [blame] | 59 | /* USB */ |
| 60 | #define CONFIG_CMD_USB |
| 61 | #define CONFIG_USB_EHCI |
| 62 | #define CONFIG_USB_EHCI_MX6 |
| 63 | #define CONFIG_USB_STORAGE |
| 64 | #define CONFIG_EHCI_HCD_INIT_AFTER_RESET |
| 65 | #define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW) |
| 66 | #define CONFIG_MXC_USB_FLAGS 0 |
| 67 | #define CONFIG_USB_MAX_CONTROLLER_COUNT 2 |
Fabio Estevam | 1d51f6b | 2015-04-29 22:28:11 -0300 | [diff] [blame] | 68 | #define CONFIG_USB_KEYBOARD |
| 69 | #define CONFIG_SYS_USB_EVENT_POLL |
Fabio Estevam | 0d404ce | 2015-05-04 14:09:23 -0300 | [diff] [blame] | 70 | #define CONFIG_PREBOOT \ |
| 71 | "if hdmidet; then " \ |
| 72 | "usb start; " \ |
| 73 | "setenv stdin serial,usbkbd; "\ |
| 74 | "setenv stdout serial,vga; " \ |
| 75 | "setenv stderr serial,vga; " \ |
| 76 | "else " \ |
| 77 | "setenv stdin serial; " \ |
| 78 | "setenv stdout serial; " \ |
| 79 | "setenv stderr serial; " \ |
| 80 | "fi;" |
Fabio Estevam | 729bbb8 | 2015-04-29 22:28:10 -0300 | [diff] [blame] | 81 | |
Fabio Estevam | 1d97a59 | 2015-04-20 14:48:57 -0300 | [diff] [blame] | 82 | /* Command definition */ |
Fabio Estevam | 1d97a59 | 2015-04-20 14:48:57 -0300 | [diff] [blame] | 83 | |
Fabio Estevam | 1d97a59 | 2015-04-20 14:48:57 -0300 | [diff] [blame] | 84 | #define CONFIG_MXC_UART_BASE UART1_BASE |
| 85 | #define CONFIG_CONSOLE_DEV "ttymxc0" |
| 86 | #define CONFIG_MMCROOT "/dev/mmcblk0p2" |
Fabio Estevam | 1d97a59 | 2015-04-20 14:48:57 -0300 | [diff] [blame] | 87 | #define CONFIG_SYS_FSL_USDHC_NUM 1 |
| 88 | #define CONFIG_SYS_MMC_ENV_DEV 0 /* SDHC2 */ |
| 89 | |
Fabio Estevam | 9887c1a | 2015-04-25 18:47:21 -0300 | [diff] [blame] | 90 | #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG |
Fabio Estevam | 1d97a59 | 2015-04-20 14:48:57 -0300 | [diff] [blame] | 91 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
| 92 | "script=boot.scr\0" \ |
| 93 | "image=zImage\0" \ |
Fabio Estevam | 9887c1a | 2015-04-25 18:47:21 -0300 | [diff] [blame] | 94 | "fdtfile=undefined\0" \ |
Fabio Estevam | fa25217 | 2015-04-25 18:47:20 -0300 | [diff] [blame] | 95 | "fdt_addr_r=0x18000000\0" \ |
Fabio Estevam | 1d97a59 | 2015-04-20 14:48:57 -0300 | [diff] [blame] | 96 | "boot_fdt=try\0" \ |
| 97 | "ip_dyn=yes\0" \ |
| 98 | "console=" CONFIG_CONSOLE_DEV "\0" \ |
| 99 | "bootm_size=0x10000000\0" \ |
| 100 | "mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \ |
| 101 | "mmcpart=1\0" \ |
| 102 | "mmcroot=" CONFIG_MMCROOT " rootwait rw\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 | "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \ |
Fabio Estevam | fa25217 | 2015-04-25 18:47:20 -0300 | [diff] [blame] | 123 | "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr_r} ${fdtfile}\0" \ |
Fabio Estevam | 1d97a59 | 2015-04-20 14:48:57 -0300 | [diff] [blame] | 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 " \ |
Fabio Estevam | fa25217 | 2015-04-25 18:47:20 -0300 | [diff] [blame] | 128 | "bootz ${loadaddr} - ${fdt_addr_r}; " \ |
Fabio Estevam | 1d97a59 | 2015-04-20 14:48:57 -0300 | [diff] [blame] | 129 | "else " \ |
| 130 | "if test ${boot_fdt} = try; then " \ |
| 131 | "bootz; " \ |
| 132 | "else " \ |
| 133 | "echo WARN: Cannot load the DT; " \ |
| 134 | "fi; " \ |
| 135 | "fi; " \ |
| 136 | "else " \ |
| 137 | "bootz; " \ |
| 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} ${image}; " \ |
| 150 | "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \ |
Fabio Estevam | fa25217 | 2015-04-25 18:47:20 -0300 | [diff] [blame] | 151 | "if ${get_cmd} ${fdt_addr_r} ${fdtfile}; then " \ |
| 152 | "bootz ${loadaddr} - ${fdt_addr_r}; " \ |
Fabio Estevam | 1d97a59 | 2015-04-20 14:48:57 -0300 | [diff] [blame] | 153 | "else " \ |
| 154 | "if test ${boot_fdt} = try; then " \ |
| 155 | "bootz; " \ |
| 156 | "else " \ |
| 157 | "echo WARN: Cannot load the DT; " \ |
| 158 | "fi; " \ |
| 159 | "fi; " \ |
| 160 | "else " \ |
| 161 | "bootz; " \ |
Fabio Estevam | 9887c1a | 2015-04-25 18:47:21 -0300 | [diff] [blame] | 162 | "fi;\0" \ |
| 163 | "findfdt="\ |
| 164 | "if test $board_name = HUMMINGBOARD && test $board_rev = MX6Q ; then " \ |
| 165 | "setenv fdtfile imx6q-hummingboard.dtb; fi; " \ |
| 166 | "if test $board_name = HUMMINGBOARD && test $board_rev = MX6DL ; then " \ |
| 167 | "setenv fdtfile imx6dl-hummingboard.dtb; fi; " \ |
| 168 | "if test $board_name = CUBOXI && test $board_rev = MX6Q ; then " \ |
| 169 | "setenv fdtfile imx6q-cubox-i.dtb; fi; " \ |
| 170 | "if test $board_name = CUBOXI && test $board_rev = MX6DL ; then " \ |
| 171 | "setenv fdtfile imx6dl-cubox-i.dtb; fi; " \ |
| 172 | "if test $fdtfile = undefined; then " \ |
| 173 | "echo WARNING: Could not determine dtb to use; fi; \0" \ |
Fabio Estevam | 1d97a59 | 2015-04-20 14:48:57 -0300 | [diff] [blame] | 174 | |
| 175 | #define CONFIG_BOOTCOMMAND \ |
Fabio Estevam | 9887c1a | 2015-04-25 18:47:21 -0300 | [diff] [blame] | 176 | "run findfdt; " \ |
Fabio Estevam | 1d97a59 | 2015-04-20 14:48:57 -0300 | [diff] [blame] | 177 | "mmc dev ${mmcdev};" \ |
| 178 | "if mmc rescan; then " \ |
| 179 | "if run loadbootscript; then " \ |
| 180 | "run bootscript; " \ |
| 181 | "else " \ |
| 182 | "if run loadimage; then " \ |
| 183 | "run mmcboot; " \ |
| 184 | "else run netboot; " \ |
| 185 | "fi; " \ |
| 186 | "fi; " \ |
| 187 | "else run netboot; fi" |
| 188 | |
| 189 | /* Miscellaneous configurable options */ |
| 190 | #define CONFIG_SYS_LONGHELP |
| 191 | #define CONFIG_SYS_HUSH_PARSER |
| 192 | #define CONFIG_AUTO_COMPLETE |
Fabio Estevam | 1d97a59 | 2015-04-20 14:48:57 -0300 | [diff] [blame] | 193 | #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE |
| 194 | |
Fabio Estevam | 1d97a59 | 2015-04-20 14:48:57 -0300 | [diff] [blame] | 195 | #define CONFIG_CMDLINE_EDITING |
| 196 | |
| 197 | /* Physical Memory Map */ |
| 198 | #define CONFIG_NR_DRAM_BANKS 1 |
| 199 | #define CONFIG_SYS_SDRAM_BASE MMDC0_ARB_BASE_ADDR |
| 200 | #define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR |
| 201 | #define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE |
| 202 | |
| 203 | #define CONFIG_SYS_INIT_SP_OFFSET \ |
| 204 | (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE) |
| 205 | #define CONFIG_SYS_INIT_SP_ADDR \ |
| 206 | (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET) |
| 207 | |
| 208 | /* Environment organization */ |
| 209 | #define CONFIG_ENV_SIZE (8 * 1024) |
| 210 | #define CONFIG_ENV_IS_IN_MMC |
| 211 | #define CONFIG_ENV_OFFSET (8 * 64 * 1024) |
| 212 | |
Fabio Estevam | 1d97a59 | 2015-04-20 14:48:57 -0300 | [diff] [blame] | 213 | #endif /* __MX6CUBOXI_CONFIG_H */ |