Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Sébastien Szymanski | a7762e4 | 2017-03-07 14:33:25 +0100 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (C) 2017 Armadeus Systems |
| 4 | * |
| 5 | * Configuration settings for the OPOS6ULDev board |
Sébastien Szymanski | a7762e4 | 2017-03-07 14:33:25 +0100 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | #ifndef __OPOS6ULDEV_CONFIG_H |
| 9 | #define __OPOS6ULDEV_CONFIG_H |
| 10 | |
| 11 | #include "mx6_common.h" |
| 12 | |
| 13 | #ifdef CONFIG_SPL |
| 14 | #include "imx6_spl.h" |
| 15 | |
| 16 | #ifdef CONFIG_SPL_BUILD |
Sébastien Szymanski | 1f29ce5 | 2018-04-17 17:29:31 +0200 | [diff] [blame] | 17 | #undef CONFIG_DM_REGULATOR |
Sébastien Szymanski | a7762e4 | 2017-03-07 14:33:25 +0100 | [diff] [blame] | 18 | #endif |
| 19 | #endif |
| 20 | |
Sébastien Szymanski | a7762e4 | 2017-03-07 14:33:25 +0100 | [diff] [blame] | 21 | /* Miscellaneous configurable options */ |
| 22 | #define CONFIG_STANDALONE_LOAD_ADDR CONFIG_SYS_LOAD_ADDR |
| 23 | |
| 24 | /* Physical Memory Map */ |
Sébastien Szymanski | a7762e4 | 2017-03-07 14:33:25 +0100 | [diff] [blame] | 25 | #define CONFIG_SYS_SDRAM_BASE MMDC0_ARB_BASE_ADDR |
| 26 | #define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR |
| 27 | #define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE |
| 28 | #define CONFIG_SYS_INIT_SP_OFFSET \ |
| 29 | (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE) |
| 30 | #define CONFIG_SYS_INIT_SP_ADDR \ |
| 31 | (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET) |
| 32 | |
Sébastien Szymanski | a7762e4 | 2017-03-07 14:33:25 +0100 | [diff] [blame] | 33 | /* USB */ |
| 34 | #ifdef CONFIG_USB_EHCI_MX6 |
| 35 | #define CONFIG_EHCI_HCD_INIT_AFTER_RESET |
| 36 | #define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW) |
| 37 | #define CONFIG_MXC_USB_FLAGS 0 |
| 38 | #define CONFIG_USB_MAX_CONTROLLER_COUNT 2 |
Sébastien Szymanski | a7762e4 | 2017-03-07 14:33:25 +0100 | [diff] [blame] | 39 | #endif |
| 40 | |
Sébastien Szymanski | a7762e4 | 2017-03-07 14:33:25 +0100 | [diff] [blame] | 41 | /* LCD */ |
Sébastien Szymanski | 1f29ce5 | 2018-04-17 17:29:31 +0200 | [diff] [blame] | 42 | #ifndef CONFIG_SPL_BUILD |
Sébastien Szymanski | d5c9613 | 2019-10-21 15:33:03 +0200 | [diff] [blame] | 43 | #ifdef CONFIG_DM_VIDEO |
Sébastien Szymanski | a7762e4 | 2017-03-07 14:33:25 +0100 | [diff] [blame] | 44 | #define CONFIG_VIDEO_LOGO |
Sébastien Szymanski | a7762e4 | 2017-03-07 14:33:25 +0100 | [diff] [blame] | 45 | #define CONFIG_VIDEO_BMP_LOGO |
Sébastien Szymanski | a7762e4 | 2017-03-07 14:33:25 +0100 | [diff] [blame] | 46 | #define MXS_LCDIF_BASE MX6UL_LCDIF1_BASE_ADDR |
| 47 | #endif |
Sébastien Szymanski | 1f29ce5 | 2018-04-17 17:29:31 +0200 | [diff] [blame] | 48 | #endif |
Sébastien Szymanski | a7762e4 | 2017-03-07 14:33:25 +0100 | [diff] [blame] | 49 | |
| 50 | /* Environment is stored in the eMMC boot partition */ |
Sébastien Szymanski | a7762e4 | 2017-03-07 14:33:25 +0100 | [diff] [blame] | 51 | |
| 52 | #define CONFIG_ENV_VERSION 100 |
| 53 | #define CONFIG_BOARD_NAME opos6ul |
| 54 | #define ACFG_CONSOLE_DEV ttymxc0 |
| 55 | #define CONFIG_SYS_AUTOLOAD "no" |
| 56 | #define CONFIG_ROOTPATH "/tftpboot/" __stringify(CONFIG_BOARD_NAME) "-root" |
Sébastien Szymanski | a7762e4 | 2017-03-07 14:33:25 +0100 | [diff] [blame] | 57 | #define CONFIG_BOOTCOMMAND "run emmcboot" |
| 58 | |
| 59 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
| 60 | "env_version=" __stringify(CONFIG_ENV_VERSION) "\0" \ |
| 61 | "consoledev=" __stringify(ACFG_CONSOLE_DEV) "\0" \ |
| 62 | "board_name=" __stringify(CONFIG_BOARD_NAME) "\0" \ |
| 63 | "fdt_addr=0x88000000\0" \ |
| 64 | "fdt_high=0xffffffff\0" \ |
| 65 | "fdt_name=" __stringify(CONFIG_BOARD_NAME) "dev\0" \ |
| 66 | "initrd_high=0xffffffff\0" \ |
| 67 | "ip_dyn=yes\0" \ |
| 68 | "stdin=serial\0" \ |
| 69 | "stdout=serial\0" \ |
| 70 | "stderr=serial\0" \ |
| 71 | "mmcdev=0\0" \ |
| 72 | "mmcpart=2\0" \ |
| 73 | "mmcroot=/dev/mmcblk0p2 ro\0" \ |
| 74 | "mmcrootfstype=ext4 rootwait\0" \ |
| 75 | "kernelimg=" __stringify(CONFIG_BOARD_NAME) "-linux.bin\0" \ |
Sébastien Szymanski | d5c9613 | 2019-10-21 15:33:03 +0200 | [diff] [blame] | 76 | "splashpos=0,0\0" \ |
Wolfgang Denk | 62fb2b4 | 2021-09-27 17:42:39 +0200 | [diff] [blame] | 77 | "splashimage=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \ |
Sébastien Szymanski | a7762e4 | 2017-03-07 14:33:25 +0100 | [diff] [blame] | 78 | "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" \ |
| 79 | "check_env=if test -n ${flash_env_version}; " \ |
| 80 | "then env default env_version; " \ |
| 81 | "else env set flash_env_version ${env_version}; env save; " \ |
| 82 | "fi; " \ |
| 83 | "if itest ${flash_env_version} != ${env_version}; then " \ |
| 84 | "echo \"*** Warning - Environment version" \ |
| 85 | " change suggests: run flash_reset_env; reset\"; " \ |
| 86 | "env default flash_reset_env; " \ |
| 87 | "else exit; fi; \0" \ |
| 88 | "flash_reset_env=env default -f -a && saveenv && " \ |
| 89 | "echo Environment variables erased!\0" \ |
| 90 | "download_uboot_spl=tftpboot ${loadaddr} ${board_name}-u-boot.spl\0" \ |
| 91 | "flash_uboot_spl=" \ |
| 92 | "if mmc dev 0 1; then " \ |
| 93 | "setexpr sz ${filesize} / 0x200; " \ |
| 94 | "setexpr sz ${sz} + 1; " \ |
| 95 | "if mmc write ${loadaddr} 0x2 ${sz}; then " \ |
| 96 | "echo Flashing of U-boot SPL succeed; " \ |
| 97 | "else echo Flashing of U-boot SPL failed; " \ |
| 98 | "fi; " \ |
| 99 | "fi;\0" \ |
| 100 | "download_uboot_img=tftpboot ${loadaddr} ${board_name}-u-boot.img\0" \ |
| 101 | "flash_uboot_img=" \ |
| 102 | "if mmc dev 0 1; then " \ |
| 103 | "setexpr sz ${filesize} / 0x200; " \ |
| 104 | "setexpr sz ${sz} + 1; " \ |
| 105 | "if mmc write ${loadaddr} 0x8a ${sz}; then " \ |
| 106 | "echo Flashing of U-boot image succeed; " \ |
| 107 | "else echo Flashing of U-boot image failed; " \ |
| 108 | "fi; " \ |
| 109 | "fi;\0" \ |
| 110 | "update_uboot=run download_uboot_spl flash_uboot_spl " \ |
| 111 | "download_uboot_img flash_uboot_img\0" \ |
| 112 | "download_kernel=tftpboot ${loadaddr} ${kernelimg}\0" \ |
| 113 | "flash_kernel=" \ |
| 114 | "if ext4write mmc ${mmcdev}:${mmcpart} ${loadaddr} /boot/${kernelimg} ${filesize}; then " \ |
| 115 | "echo kernel update succeed; " \ |
| 116 | "else echo kernel update failed; " \ |
| 117 | "fi;\0" \ |
| 118 | "update_kernel=run download_kernel flash_kernel\0" \ |
| 119 | "download_dtb=tftpboot ${fdt_addr} imx6ul-${fdt_name}.dtb\0" \ |
| 120 | "flash_dtb=" \ |
| 121 | "if ext4write mmc ${mmcdev}:${mmcpart} ${fdt_addr} /boot/imx6ul-${fdt_name}.dtb ${filesize}; then " \ |
| 122 | "echo dtb update succeed; " \ |
| 123 | "else echo dtb update in failed; " \ |
| 124 | "fi;\0" \ |
| 125 | "update_dtb=run download_dtb flash_dtb\0" \ |
| 126 | "download_rootfs=tftpboot ${loadaddr} ${board_name}-rootfs.ext4\0" \ |
| 127 | "flash_rootfs=" \ |
| 128 | "if mmc dev 0 0; then " \ |
| 129 | "setexpr nbblocks ${filesize} / 0x200; " \ |
| 130 | "setexpr nbblocks ${nbblocks} + 1; " \ |
| 131 | "if mmc write ${loadaddr} 0x40800 ${nbblocks}; then " \ |
| 132 | "echo Flashing of rootfs image succeed; " \ |
| 133 | "else echo Flashing of rootfs image failed; " \ |
| 134 | "fi; " \ |
| 135 | "fi;\0" \ |
| 136 | "update_rootfs=run download_rootfs flash_rootfs\0" \ |
| 137 | "flash_failsafe=" \ |
| 138 | "if mmc dev 0 0; then " \ |
| 139 | "setexpr nbblocks ${filesize} / 0x200; " \ |
| 140 | "setexpr nbblocks ${nbblocks} + 1; " \ |
| 141 | "if mmc write ${loadaddr} 0x800 ${nbblocks}; then " \ |
| 142 | "echo Flashing of rootfs image in failsafe partition succeed; " \ |
| 143 | "else echo Flashing of rootfs image in failsafe partition failed; " \ |
| 144 | "fi; " \ |
| 145 | "fi;\0" \ |
| 146 | "update_failsafe=run download_rootfs flash_failsafe\0" \ |
| 147 | "download_userdata=tftpboot ${loadaddr} ${board_name}-user_data.ext4\0" \ |
| 148 | "flash_userdata=" \ |
| 149 | "if mmc dev 0 0; then " \ |
| 150 | "setexpr nbblocks ${filesize} / 0x200; " \ |
| 151 | "setexpr nbblocks ${nbblocks} + 1; " \ |
| 152 | "if mmc write ${loadaddr} 0 ${nbblocks}; then " \ |
| 153 | "echo Flashing of user_data image succeed; " \ |
| 154 | "else echo Flashing of user_data image failed; " \ |
| 155 | "fi; " \ |
| 156 | "fi;\0" \ |
| 157 | "update_userdata=run download_userdata flash_userdata; mmc rescan\0" \ |
| 158 | "erase_userdata=" \ |
| 159 | "if mmc dev 0 0; then " \ |
| 160 | "echo Erasing eMMC User Data partition, no way out...; " \ |
| 161 | "mw ${loadaddr} 0 0x200000; " \ |
| 162 | "mmc write ${loadaddr} 0 0x1000; " \ |
| 163 | "mmc write ${loadaddr} 0x800 0x1000; " \ |
| 164 | "mmc write ${loadaddr} 0x40800 0x1000; " \ |
| 165 | "mmc write ${loadaddr} 0x440800 0x1000; " \ |
| 166 | "fi;" \ |
| 167 | "mmc rescan\0" \ |
| 168 | "update_all=run update_rootfs update_uboot\0" \ |
| 169 | "initargs=setenv bootargs console=${consoledev},${baudrate} ${extrabootargs}\0" \ |
| 170 | "addipargs=setenv bootargs ${bootargs} ip=${ipaddr}:${serverip}:" \ |
| 171 | "${gatewayip}:${netmask}:${hostname}:eth0:off\0" \ |
| 172 | "addmmcargs=setenv bootargs ${bootargs} root=${mmcroot} " \ |
| 173 | "rootfstype=${mmcrootfstype}\0" \ |
| 174 | "emmcboot=run initargs; run addmmcargs; " \ |
| 175 | "load mmc ${mmcdev}:${mmcpart} ${loadaddr} /boot/${kernelimg} && " \ |
| 176 | "load mmc ${mmcdev}:${mmcpart} ${fdt_addr} /boot/imx6ul-${fdt_name}.dtb && " \ |
| 177 | "bootz ${loadaddr} - ${fdt_addr};\0" \ |
| 178 | "emmcsafeboot=setenv mmcpart 1; setenv mmcroot /dev/mmcblk0p1 ro; run emmcboot;\0" \ |
| 179 | "addnfsargs=setenv bootargs ${bootargs} root=/dev/nfs rw " \ |
| 180 | "nfsroot=${serverip}:${rootpath}\0" \ |
| 181 | "nfsboot=run initargs; run addnfsargs addipargs; " \ |
| 182 | "nfs ${loadaddr} ${serverip}:${rootpath}/boot/${kernelimg} && " \ |
| 183 | "nfs ${fdt_addr} ${serverip}:${rootpath}/boot/imx6ul-${fdt_name}.dtb && " \ |
| 184 | "bootz ${loadaddr} - ${fdt_addr};\0" |
| 185 | |
| 186 | #endif /* __OPOS6ULDEV_CONFIG_H */ |