Sébastien Szymanski | a7762e4 | 2017-03-07 14:33:25 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2017 Armadeus Systems |
| 3 | * |
| 4 | * Configuration settings for the OPOS6ULDev board |
| 5 | * |
| 6 | * SPDX-License-Identifier: GPL-2.0+ |
| 7 | */ |
| 8 | |
| 9 | #ifndef __OPOS6ULDEV_CONFIG_H |
| 10 | #define __OPOS6ULDEV_CONFIG_H |
| 11 | |
| 12 | #include "mx6_common.h" |
| 13 | |
| 14 | #ifdef CONFIG_SPL |
| 15 | #include "imx6_spl.h" |
| 16 | |
| 17 | #ifdef CONFIG_SPL_BUILD |
| 18 | #undef CONFIG_DM_GPIO |
| 19 | #undef CONFIG_DM_MMC |
| 20 | |
| 21 | #define CONFIG_MXC_UART_BASE UART1_BASE |
| 22 | #endif |
| 23 | #endif |
| 24 | |
| 25 | /* Size of malloc() pool */ |
| 26 | #define CONFIG_SYS_MALLOC_LEN (16 << 20) |
| 27 | |
| 28 | /* Miscellaneous configurable options */ |
| 29 | #define CONFIG_STANDALONE_LOAD_ADDR CONFIG_SYS_LOAD_ADDR |
| 30 | |
| 31 | /* Physical Memory Map */ |
| 32 | #define CONFIG_NR_DRAM_BANKS 1 |
| 33 | #define CONFIG_SYS_SDRAM_BASE MMDC0_ARB_BASE_ADDR |
| 34 | #define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR |
| 35 | #define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE |
| 36 | #define CONFIG_SYS_INIT_SP_OFFSET \ |
| 37 | (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE) |
| 38 | #define CONFIG_SYS_INIT_SP_ADDR \ |
| 39 | (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET) |
| 40 | |
| 41 | /* MMC */ |
| 42 | #define CONFIG_SYS_FSL_ESDHC_ADDR 0 |
| 43 | #define CONFIG_SUPPORT_EMMC_BOOT |
| 44 | |
| 45 | /* USB */ |
| 46 | #ifdef CONFIG_USB_EHCI_MX6 |
| 47 | #define CONFIG_EHCI_HCD_INIT_AFTER_RESET |
| 48 | #define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW) |
| 49 | #define CONFIG_MXC_USB_FLAGS 0 |
| 50 | #define CONFIG_USB_MAX_CONTROLLER_COUNT 2 |
| 51 | #define CONFIG_USB_FUNCTION_MASS_STORAGE |
| 52 | #endif |
| 53 | |
| 54 | /* Ethernet */ |
| 55 | #ifdef CONFIG_FEC_MXC |
| 56 | #define IMX_FEC_BASE ENET_BASE_ADDR |
| 57 | #define CONFIG_FEC_MXC_PHYADDR 0x1 |
| 58 | #define CONFIG_FEC_XCV_TYPE RMII |
| 59 | #define CONFIG_ETHPRIME "FEC" |
| 60 | #define CONFIG_MII |
| 61 | #endif |
| 62 | |
| 63 | /* LCD */ |
| 64 | #ifdef CONFIG_VIDEO |
| 65 | #define CONFIG_VIDEO_LOGO |
| 66 | #define CONFIG_SPLASH_SCREEN |
| 67 | #define CONFIG_SPLASH_SCREEN_ALIGN |
| 68 | #define CONFIG_SPLASH_SOURCE |
| 69 | #define CONFIG_VIDEO_BMP_RLE8 |
| 70 | #define CONFIG_VIDEO_BMP_LOGO |
Sébastien Szymanski | a7762e4 | 2017-03-07 14:33:25 +0100 | [diff] [blame] | 71 | #define CONFIG_BMP_16BPP |
| 72 | #define CONFIG_VIDEO_MXS |
| 73 | #define MXS_LCDIF_BASE MX6UL_LCDIF1_BASE_ADDR |
| 74 | #endif |
| 75 | |
| 76 | /* Environment is stored in the eMMC boot partition */ |
| 77 | #define CONFIG_ENV_IS_IN_MMC |
| 78 | #define CONFIG_SYS_MMC_ENV_DEV 0 |
| 79 | #define CONFIG_SYS_MMC_ENV_PART 1 |
| 80 | #define CONFIG_ENV_SIZE (10 * 1024) |
| 81 | #define CONFIG_ENV_OFFSET (1024 * 1024) /* 1 MB */ |
| 82 | #define CONFIG_ENV_OFFSET_REDUND (1536 * 1024) /* 512KB from CONFIG_ENV_OFFSET */ |
| 83 | |
| 84 | #define CONFIG_ENV_VERSION 100 |
| 85 | #define CONFIG_BOARD_NAME opos6ul |
| 86 | #define ACFG_CONSOLE_DEV ttymxc0 |
| 87 | #define CONFIG_SYS_AUTOLOAD "no" |
| 88 | #define CONFIG_ROOTPATH "/tftpboot/" __stringify(CONFIG_BOARD_NAME) "-root" |
| 89 | #define CONFIG_BOOTARGS "console=" __stringify(ACFG_CONSOLE_DEV) "," __stringify(CONFIG_BAUDRATE) |
| 90 | #define CONFIG_PREBOOT "run check_env" |
| 91 | #define CONFIG_BOOTCOMMAND "run emmcboot" |
| 92 | |
| 93 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
| 94 | "env_version=" __stringify(CONFIG_ENV_VERSION) "\0" \ |
| 95 | "consoledev=" __stringify(ACFG_CONSOLE_DEV) "\0" \ |
| 96 | "board_name=" __stringify(CONFIG_BOARD_NAME) "\0" \ |
| 97 | "fdt_addr=0x88000000\0" \ |
| 98 | "fdt_high=0xffffffff\0" \ |
| 99 | "fdt_name=" __stringify(CONFIG_BOARD_NAME) "dev\0" \ |
| 100 | "initrd_high=0xffffffff\0" \ |
| 101 | "ip_dyn=yes\0" \ |
| 102 | "stdin=serial\0" \ |
| 103 | "stdout=serial\0" \ |
| 104 | "stderr=serial\0" \ |
| 105 | "mmcdev=0\0" \ |
| 106 | "mmcpart=2\0" \ |
| 107 | "mmcroot=/dev/mmcblk0p2 ro\0" \ |
| 108 | "mmcrootfstype=ext4 rootwait\0" \ |
| 109 | "kernelimg=" __stringify(CONFIG_BOARD_NAME) "-linux.bin\0" \ |
| 110 | "videomode=video=ctfb:x:800,y:480,depth:18,pclk:33033,le:96,ri:96,up:20,lo:21,hs:64,vs:4,sync:0,vmode:0\0" \ |
| 111 | "check_env=if test -n ${flash_env_version}; " \ |
| 112 | "then env default env_version; " \ |
| 113 | "else env set flash_env_version ${env_version}; env save; " \ |
| 114 | "fi; " \ |
| 115 | "if itest ${flash_env_version} != ${env_version}; then " \ |
| 116 | "echo \"*** Warning - Environment version" \ |
| 117 | " change suggests: run flash_reset_env; reset\"; " \ |
| 118 | "env default flash_reset_env; " \ |
| 119 | "else exit; fi; \0" \ |
| 120 | "flash_reset_env=env default -f -a && saveenv && " \ |
| 121 | "echo Environment variables erased!\0" \ |
| 122 | "download_uboot_spl=tftpboot ${loadaddr} ${board_name}-u-boot.spl\0" \ |
| 123 | "flash_uboot_spl=" \ |
| 124 | "if mmc dev 0 1; then " \ |
| 125 | "setexpr sz ${filesize} / 0x200; " \ |
| 126 | "setexpr sz ${sz} + 1; " \ |
| 127 | "if mmc write ${loadaddr} 0x2 ${sz}; then " \ |
| 128 | "echo Flashing of U-boot SPL succeed; " \ |
| 129 | "else echo Flashing of U-boot SPL failed; " \ |
| 130 | "fi; " \ |
| 131 | "fi;\0" \ |
| 132 | "download_uboot_img=tftpboot ${loadaddr} ${board_name}-u-boot.img\0" \ |
| 133 | "flash_uboot_img=" \ |
| 134 | "if mmc dev 0 1; then " \ |
| 135 | "setexpr sz ${filesize} / 0x200; " \ |
| 136 | "setexpr sz ${sz} + 1; " \ |
| 137 | "if mmc write ${loadaddr} 0x8a ${sz}; then " \ |
| 138 | "echo Flashing of U-boot image succeed; " \ |
| 139 | "else echo Flashing of U-boot image failed; " \ |
| 140 | "fi; " \ |
| 141 | "fi;\0" \ |
| 142 | "update_uboot=run download_uboot_spl flash_uboot_spl " \ |
| 143 | "download_uboot_img flash_uboot_img\0" \ |
| 144 | "download_kernel=tftpboot ${loadaddr} ${kernelimg}\0" \ |
| 145 | "flash_kernel=" \ |
| 146 | "if ext4write mmc ${mmcdev}:${mmcpart} ${loadaddr} /boot/${kernelimg} ${filesize}; then " \ |
| 147 | "echo kernel update succeed; " \ |
| 148 | "else echo kernel update failed; " \ |
| 149 | "fi;\0" \ |
| 150 | "update_kernel=run download_kernel flash_kernel\0" \ |
| 151 | "download_dtb=tftpboot ${fdt_addr} imx6ul-${fdt_name}.dtb\0" \ |
| 152 | "flash_dtb=" \ |
| 153 | "if ext4write mmc ${mmcdev}:${mmcpart} ${fdt_addr} /boot/imx6ul-${fdt_name}.dtb ${filesize}; then " \ |
| 154 | "echo dtb update succeed; " \ |
| 155 | "else echo dtb update in failed; " \ |
| 156 | "fi;\0" \ |
| 157 | "update_dtb=run download_dtb flash_dtb\0" \ |
| 158 | "download_rootfs=tftpboot ${loadaddr} ${board_name}-rootfs.ext4\0" \ |
| 159 | "flash_rootfs=" \ |
| 160 | "if mmc dev 0 0; then " \ |
| 161 | "setexpr nbblocks ${filesize} / 0x200; " \ |
| 162 | "setexpr nbblocks ${nbblocks} + 1; " \ |
| 163 | "if mmc write ${loadaddr} 0x40800 ${nbblocks}; then " \ |
| 164 | "echo Flashing of rootfs image succeed; " \ |
| 165 | "else echo Flashing of rootfs image failed; " \ |
| 166 | "fi; " \ |
| 167 | "fi;\0" \ |
| 168 | "update_rootfs=run download_rootfs flash_rootfs\0" \ |
| 169 | "flash_failsafe=" \ |
| 170 | "if mmc dev 0 0; then " \ |
| 171 | "setexpr nbblocks ${filesize} / 0x200; " \ |
| 172 | "setexpr nbblocks ${nbblocks} + 1; " \ |
| 173 | "if mmc write ${loadaddr} 0x800 ${nbblocks}; then " \ |
| 174 | "echo Flashing of rootfs image in failsafe partition succeed; " \ |
| 175 | "else echo Flashing of rootfs image in failsafe partition failed; " \ |
| 176 | "fi; " \ |
| 177 | "fi;\0" \ |
| 178 | "update_failsafe=run download_rootfs flash_failsafe\0" \ |
| 179 | "download_userdata=tftpboot ${loadaddr} ${board_name}-user_data.ext4\0" \ |
| 180 | "flash_userdata=" \ |
| 181 | "if mmc dev 0 0; then " \ |
| 182 | "setexpr nbblocks ${filesize} / 0x200; " \ |
| 183 | "setexpr nbblocks ${nbblocks} + 1; " \ |
| 184 | "if mmc write ${loadaddr} 0 ${nbblocks}; then " \ |
| 185 | "echo Flashing of user_data image succeed; " \ |
| 186 | "else echo Flashing of user_data image failed; " \ |
| 187 | "fi; " \ |
| 188 | "fi;\0" \ |
| 189 | "update_userdata=run download_userdata flash_userdata; mmc rescan\0" \ |
| 190 | "erase_userdata=" \ |
| 191 | "if mmc dev 0 0; then " \ |
| 192 | "echo Erasing eMMC User Data partition, no way out...; " \ |
| 193 | "mw ${loadaddr} 0 0x200000; " \ |
| 194 | "mmc write ${loadaddr} 0 0x1000; " \ |
| 195 | "mmc write ${loadaddr} 0x800 0x1000; " \ |
| 196 | "mmc write ${loadaddr} 0x40800 0x1000; " \ |
| 197 | "mmc write ${loadaddr} 0x440800 0x1000; " \ |
| 198 | "fi;" \ |
| 199 | "mmc rescan\0" \ |
| 200 | "update_all=run update_rootfs update_uboot\0" \ |
| 201 | "initargs=setenv bootargs console=${consoledev},${baudrate} ${extrabootargs}\0" \ |
| 202 | "addipargs=setenv bootargs ${bootargs} ip=${ipaddr}:${serverip}:" \ |
| 203 | "${gatewayip}:${netmask}:${hostname}:eth0:off\0" \ |
| 204 | "addmmcargs=setenv bootargs ${bootargs} root=${mmcroot} " \ |
| 205 | "rootfstype=${mmcrootfstype}\0" \ |
| 206 | "emmcboot=run initargs; run addmmcargs; " \ |
| 207 | "load mmc ${mmcdev}:${mmcpart} ${loadaddr} /boot/${kernelimg} && " \ |
| 208 | "load mmc ${mmcdev}:${mmcpart} ${fdt_addr} /boot/imx6ul-${fdt_name}.dtb && " \ |
| 209 | "bootz ${loadaddr} - ${fdt_addr};\0" \ |
| 210 | "emmcsafeboot=setenv mmcpart 1; setenv mmcroot /dev/mmcblk0p1 ro; run emmcboot;\0" \ |
| 211 | "addnfsargs=setenv bootargs ${bootargs} root=/dev/nfs rw " \ |
| 212 | "nfsroot=${serverip}:${rootpath}\0" \ |
| 213 | "nfsboot=run initargs; run addnfsargs addipargs; " \ |
| 214 | "nfs ${loadaddr} ${serverip}:${rootpath}/boot/${kernelimg} && " \ |
| 215 | "nfs ${fdt_addr} ${serverip}:${rootpath}/boot/imx6ul-${fdt_name}.dtb && " \ |
| 216 | "bootz ${loadaddr} - ${fdt_addr};\0" |
| 217 | |
| 218 | #endif /* __OPOS6ULDEV_CONFIG_H */ |