Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Heiko Schocher | 7254d92 | 2015-05-18 13:32:31 +0200 | [diff] [blame] | 2 | /* |
| 3 | * (C) Copyright 2015 |
| 4 | * Heiko Schocher, DENX Software Engineering, hs@denx.de. |
| 5 | * |
| 6 | * Based on: |
| 7 | * Copyright (C) 2012 Freescale Semiconductor, Inc. |
| 8 | * |
| 9 | * Configuration settings for the Freescale i.MX6DL aristainetos2 board. |
Heiko Schocher | 7254d92 | 2015-05-18 13:32:31 +0200 | [diff] [blame] | 10 | */ |
| 11 | #ifndef __ARISTAINETOS2_CONFIG_H |
| 12 | #define __ARISTAINETOS2_CONFIG_H |
| 13 | |
Mario Six | 5bc0543 | 2018-03-28 14:38:20 +0200 | [diff] [blame] | 14 | #define CONFIG_HOSTNAME "aristainetos2" |
Heiko Schocher | 7254d92 | 2015-05-18 13:32:31 +0200 | [diff] [blame] | 15 | |
Heiko Schocher | 7254d92 | 2015-05-18 13:32:31 +0200 | [diff] [blame] | 16 | #define CONFIG_MXC_UART_BASE UART2_BASE |
Simon Glass | 12ca05a | 2016-10-17 20:12:39 -0600 | [diff] [blame] | 17 | #define CONSOLE_DEV "ttymxc1" |
Heiko Schocher | 7254d92 | 2015-05-18 13:32:31 +0200 | [diff] [blame] | 18 | |
| 19 | #define CONFIG_FEC_XCV_TYPE RGMII |
Heiko Schocher | 7254d92 | 2015-05-18 13:32:31 +0200 | [diff] [blame] | 20 | |
Heiko Schocher | 7254d92 | 2015-05-18 13:32:31 +0200 | [diff] [blame] | 21 | #define CONFIG_EXTRA_ENV_BOARD_SETTINGS \ |
| 22 | "board_type=aristainetos2_7@1\0" \ |
| 23 | "nor_bootdelay=-2\0" \ |
| 24 | "mtdids=nand0=gpmi-nand,nor0=spi3.1\0" \ |
| 25 | "mtdparts=mtdparts=spi3.1:832k(u-boot),64k(env),64k(env-red)," \ |
| 26 | "-(rescue-system);gpmi-nand:-(ubi)\0" \ |
| 27 | "addmisc=setenv bootargs ${bootargs} net.ifnames=0 consoleblank=0\0" \ |
| 28 | "ubiargs=setenv bootargs console=${console},${baudrate} " \ |
Heiko Schocher | 9627084 | 2015-08-24 11:36:40 +0200 | [diff] [blame] | 29 | "ubi.mtd=0,4096 root=ubi0:rootfs rootfstype=ubifs\0 " \ |
| 30 | "ubifs_load_fit=sf probe;ubi part ubi 4096;ubifsmount ubi:rootfs;" \ |
| 31 | "ubifsload ${fit_addr_r} /boot/system.itb; " \ |
| 32 | "imi ${fit_addr_r}\0 " |
Heiko Schocher | 7254d92 | 2015-05-18 13:32:31 +0200 | [diff] [blame] | 33 | |
Heiko Schocher | 7254d92 | 2015-05-18 13:32:31 +0200 | [diff] [blame] | 34 | /* Framebuffer */ |
Heiko Schocher | 621ff13 | 2019-12-01 11:23:19 +0100 | [diff] [blame^] | 35 | #define CONFIG_SYS_LDB_CLOCK 28341000 |
Heiko Schocher | 7254d92 | 2015-05-18 13:32:31 +0200 | [diff] [blame] | 36 | #define CONFIG_LG4573 |
Heiko Schocher | 7254d92 | 2015-05-18 13:32:31 +0200 | [diff] [blame] | 37 | |
Heiko Schocher | 0f1130b | 2019-12-01 11:23:11 +0100 | [diff] [blame] | 38 | #include "mx6_common.h" |
| 39 | |
| 40 | #define CONFIG_MACH_TYPE 4501 |
| 41 | #define CONFIG_MMCROOT "/dev/mmcblk0p1" |
| 42 | |
| 43 | /* MMC Configs */ |
Heiko Schocher | 8664c48 | 2019-12-01 11:23:14 +0100 | [diff] [blame] | 44 | #define CONFIG_SYS_FSL_ESDHC_ADDR USDHC1_BASE_ADDR |
Heiko Schocher | 0f1130b | 2019-12-01 11:23:11 +0100 | [diff] [blame] | 45 | |
| 46 | #define IMX_FEC_BASE ENET_BASE_ADDR |
| 47 | #define CONFIG_ETHPRIME "FEC" |
| 48 | #define CONFIG_FEC_MXC_PHYADDR 0 |
| 49 | |
| 50 | #define CONFIG_SYS_SPI_ST_ENABLE_WP_PIN |
| 51 | |
| 52 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
| 53 | "disable_giga=yes\0" \ |
| 54 | "script=u-boot.scr\0" \ |
| 55 | "fit_file=/boot/system.itb\0" \ |
| 56 | "loadaddr=0x12000000\0" \ |
| 57 | "fit_addr_r=0x14000000\0" \ |
| 58 | "uboot=/boot/u-boot.imx\0" \ |
| 59 | "uboot_sz=d0000\0" \ |
| 60 | "rescue_sys_addr=f0000\0" \ |
| 61 | "rescue_sys_length=f10000\0" \ |
| 62 | "panel=lb07wv8\0" \ |
| 63 | "splashpos=m,m\0" \ |
| 64 | "console=" CONSOLE_DEV "\0" \ |
| 65 | "fdt_high=0xffffffff\0" \ |
| 66 | "initrd_high=0xffffffff\0" \ |
| 67 | "addmtd=setenv bootargs ${bootargs} ${mtdparts}\0" \ |
| 68 | "set_fit_default=fdt addr ${fit_addr_r};fdt set /configurations " \ |
| 69 | "default ${board_type}\0" \ |
| 70 | "get_env=mw ${loadaddr} 0 0x20000;" \ |
| 71 | "mmc rescan;" \ |
| 72 | "ext2load mmc ${mmcdev}:${mmcpart} ${loadaddr} env.txt;" \ |
| 73 | "env import -t ${loadaddr}\0" \ |
| 74 | "default_env=mw ${loadaddr} 0 0x20000;" \ |
| 75 | "env export -t ${loadaddr} serial# ethaddr eth1addr " \ |
| 76 | "board_type panel;" \ |
| 77 | "env default -a;" \ |
| 78 | "env import -t ${loadaddr}\0" \ |
| 79 | "loadbootscript=" \ |
| 80 | "ext2load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \ |
| 81 | "bootscript=echo Running bootscript from mmc ...; " \ |
| 82 | "source\0" \ |
| 83 | "mmcpart=1\0" \ |
| 84 | "mmcdev=0\0" \ |
| 85 | "mmcroot=" CONFIG_MMCROOT " rootwait rw\0" \ |
| 86 | "mmcargs=setenv bootargs console=${console},${baudrate} " \ |
| 87 | "root=${mmcroot}\0" \ |
| 88 | "mmcboot=echo Booting from mmc ...; " \ |
| 89 | "run mmcargs addmtd addmisc set_fit_default;" \ |
| 90 | "bootm ${fit_addr_r}\0" \ |
| 91 | "mmc_load_fit=ext2load mmc ${mmcdev}:${mmcpart} ${fit_addr_r} " \ |
| 92 | "${fit_file}\0" \ |
| 93 | "mmc_load_uboot=ext2load mmc ${mmcdev}:${mmcpart} ${loadaddr} " \ |
| 94 | "${uboot}\0" \ |
| 95 | "mmc_upd_uboot=mw.b ${loadaddr} 0xff ${uboot_sz};" \ |
| 96 | "setexpr cmp_buf ${loadaddr} + ${uboot_sz};" \ |
| 97 | "setexpr uboot_maxsize ${uboot_sz} - 400;" \ |
| 98 | "mw.b ${cmp_buf} 0x00 ${uboot_sz};" \ |
| 99 | "run mmc_load_uboot;sf probe;sf erase 0 ${uboot_sz};" \ |
| 100 | "sf write ${loadaddr} 400 ${filesize};" \ |
| 101 | "sf read ${cmp_buf} 400 ${uboot_sz};" \ |
| 102 | "cmp.b ${loadaddr} ${cmp_buf} ${uboot_maxsize}\0" \ |
| 103 | "ubiboot=echo Booting from ubi ...; " \ |
| 104 | "run ubiargs addmtd addmisc set_fit_default;" \ |
| 105 | "bootm ${fit_addr_r}\0" \ |
| 106 | "rescueargs=setenv bootargs console=${console},${baudrate} " \ |
| 107 | "root=/dev/ram rw\0 " \ |
| 108 | "rescueboot=echo Booting rescue system from NOR ...; " \ |
| 109 | "run rescueargs addmtd addmisc set_fit_default;" \ |
| 110 | "bootm ${fit_addr_r}\0" \ |
| 111 | "rescue_load_fit=sf probe;sf read ${fit_addr_r} ${rescue_sys_addr} " \ |
| 112 | "${rescue_sys_length}; imi ${fit_addr_r}\0" \ |
| 113 | CONFIG_EXTRA_ENV_BOARD_SETTINGS |
| 114 | |
| 115 | #define CONFIG_BOOTCOMMAND \ |
| 116 | "mmc dev ${mmcdev};" \ |
| 117 | "if mmc rescan; then " \ |
| 118 | "if run loadbootscript; then " \ |
| 119 | "run bootscript; " \ |
| 120 | "else " \ |
| 121 | "if run mmc_load_fit; then " \ |
| 122 | "run mmcboot; " \ |
| 123 | "else " \ |
| 124 | "if run ubifs_load_fit; then " \ |
| 125 | "run ubiboot; " \ |
| 126 | "else " \ |
| 127 | "if run rescue_load_fit; then " \ |
| 128 | "run rescueboot; " \ |
| 129 | "else " \ |
| 130 | "echo RESCUE SYSTEM BOOT " \ |
| 131 | "FAILURE;" \ |
| 132 | "fi; " \ |
| 133 | "fi; " \ |
| 134 | "fi; " \ |
| 135 | "fi; " \ |
| 136 | "else " \ |
| 137 | "if run ubifs_load_fit; then " \ |
| 138 | "run ubiboot; " \ |
| 139 | "else " \ |
| 140 | "if run rescue_load_fit; then " \ |
| 141 | "run rescueboot; " \ |
| 142 | "else " \ |
| 143 | "echo RESCUE SYSTEM BOOT FAILURE;" \ |
| 144 | "fi; " \ |
| 145 | "fi; " \ |
| 146 | "fi" |
| 147 | |
| 148 | #define CONFIG_ARP_TIMEOUT 200UL |
| 149 | |
| 150 | #define CONFIG_SYS_MEMTEST_START PHYS_SDRAM |
| 151 | #define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_MEMTEST_START + 0x100000) |
| 152 | #define CONFIG_SYS_MEMTEST_SCRATCH 0x10800000 |
| 153 | |
| 154 | /* Physical Memory Map */ |
| 155 | #define PHYS_SDRAM MMDC0_ARB_BASE_ADDR |
| 156 | |
| 157 | #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM |
| 158 | #define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR |
| 159 | #define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE |
| 160 | |
| 161 | #define CONFIG_SYS_INIT_SP_OFFSET \ |
| 162 | (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE) |
| 163 | #define CONFIG_SYS_INIT_SP_ADDR \ |
| 164 | (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET) |
| 165 | |
| 166 | #define CONFIG_SYS_FSL_USDHC_NUM 2 |
| 167 | |
| 168 | /* I2C */ |
| 169 | #define CONFIG_SYS_I2C |
| 170 | #define CONFIG_SYS_I2C_SPEED 100000 |
| 171 | #define CONFIG_SYS_I2C_SLAVE 0x7f |
| 172 | #define CONFIG_SYS_I2C_NOPROBES { {0, 0x00} } |
| 173 | |
| 174 | /* NAND stuff */ |
| 175 | #define CONFIG_SYS_MAX_NAND_DEVICE 1 |
| 176 | #define CONFIG_SYS_NAND_BASE 0x40000000 |
| 177 | #define CONFIG_SYS_NAND_5_ADDR_CYCLE |
| 178 | #define CONFIG_SYS_NAND_ONFI_DETECTION |
| 179 | |
| 180 | /* DMA stuff, needed for GPMI/MXS NAND support */ |
| 181 | |
| 182 | /* RTC */ |
| 183 | #define CONFIG_SYS_I2C_RTC_ADDR 0x68 |
| 184 | #define CONFIG_SYS_RTC_BUS_NUM 2 |
| 185 | #define CONFIG_RTC_M41T11 |
| 186 | |
| 187 | /* USB Configs */ |
Heiko Schocher | 0f1130b | 2019-12-01 11:23:11 +0100 | [diff] [blame] | 188 | #define CONFIG_EHCI_HCD_INIT_AFTER_RESET /* For OTG port */ |
| 189 | #define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW) |
| 190 | #define CONFIG_MXC_USB_FLAGS 0 |
| 191 | |
| 192 | /* UBI support */ |
| 193 | |
| 194 | /* Framebuffer */ |
| 195 | /* check this console not needed, after test remove it */ |
Heiko Schocher | 0f1130b | 2019-12-01 11:23:11 +0100 | [diff] [blame] | 196 | #define CONFIG_SPLASH_SCREEN |
| 197 | #define CONFIG_SPLASH_SCREEN_ALIGN |
Heiko Schocher | 621ff13 | 2019-12-01 11:23:19 +0100 | [diff] [blame^] | 198 | #define CONFIG_IMX_VIDEO_SKIP |
Heiko Schocher | 0f1130b | 2019-12-01 11:23:11 +0100 | [diff] [blame] | 199 | #define CONFIG_VIDEO_LOGO |
| 200 | #define CONFIG_VIDEO_BMP_LOGO |
Heiko Schocher | 621ff13 | 2019-12-01 11:23:19 +0100 | [diff] [blame^] | 201 | #define CONFIG_BMP_16BPP |
| 202 | #define CONFIG_VIDEO_BMP_RLE8 |
Heiko Schocher | 0f1130b | 2019-12-01 11:23:11 +0100 | [diff] [blame] | 203 | |
| 204 | #define CONFIG_IMX6_PWM_PER_CLK 66000000 |
| 205 | |
Heiko Schocher | 7254d92 | 2015-05-18 13:32:31 +0200 | [diff] [blame] | 206 | #endif /* __ARISTAINETOS2_CONFIG_H */ |