1*cf94a342SYe Li /* 2*cf94a342SYe Li * Copyright 2014 Freescale Semiconductor, Inc. 3*cf94a342SYe Li * 4*cf94a342SYe Li * Configuration settings for the Freescale i.MX6SX Sabreauto board. 5*cf94a342SYe Li * 6*cf94a342SYe Li * SPDX-License-Identifier: GPL-2.0+ 7*cf94a342SYe Li */ 8*cf94a342SYe Li 9*cf94a342SYe Li #ifndef __CONFIG_H 10*cf94a342SYe Li #define __CONFIG_H 11*cf94a342SYe Li 12*cf94a342SYe Li #include "mx6_common.h" 13*cf94a342SYe Li 14*cf94a342SYe Li /* Size of malloc() pool */ 15*cf94a342SYe Li #define CONFIG_SYS_MALLOC_LEN (3 * SZ_1M) 16*cf94a342SYe Li 17*cf94a342SYe Li #define CONFIG_MXC_UART 18*cf94a342SYe Li #define CONFIG_MXC_UART_BASE UART1_BASE 19*cf94a342SYe Li 20*cf94a342SYe Li #define CONFIG_EXTRA_ENV_SETTINGS \ 21*cf94a342SYe Li "script=boot.scr\0" \ 22*cf94a342SYe Li "image=zImage\0" \ 23*cf94a342SYe Li "console=ttymxc0\0" \ 24*cf94a342SYe Li "fdt_high=0xffffffff\0" \ 25*cf94a342SYe Li "initrd_high=0xffffffff\0" \ 26*cf94a342SYe Li "fdt_file=imx6sx-sabreauto.dtb\0" \ 27*cf94a342SYe Li "fdt_addr=0x88000000\0" \ 28*cf94a342SYe Li "boot_fdt=try\0" \ 29*cf94a342SYe Li "ip_dyn=yes\0" \ 30*cf94a342SYe Li "mmcdev=0\0" \ 31*cf94a342SYe Li "mmcpart=1\0" \ 32*cf94a342SYe Li "mmcroot=/dev/mmcblk0p2 rootwait rw\0" \ 33*cf94a342SYe Li "mmcargs=setenv bootargs console=${console},${baudrate} " \ 34*cf94a342SYe Li "root=${mmcroot}\0" \ 35*cf94a342SYe Li "loadbootscript=" \ 36*cf94a342SYe Li "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \ 37*cf94a342SYe Li "bootscript=echo Running bootscript from mmc ...; " \ 38*cf94a342SYe Li "source\0" \ 39*cf94a342SYe Li "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \ 40*cf94a342SYe Li "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \ 41*cf94a342SYe Li "mmcboot=echo Booting from mmc ...; " \ 42*cf94a342SYe Li "run mmcargs; " \ 43*cf94a342SYe Li "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \ 44*cf94a342SYe Li "if run loadfdt; then " \ 45*cf94a342SYe Li "bootz ${loadaddr} - ${fdt_addr}; " \ 46*cf94a342SYe Li "else " \ 47*cf94a342SYe Li "if test ${boot_fdt} = try; then " \ 48*cf94a342SYe Li "bootz; " \ 49*cf94a342SYe Li "else " \ 50*cf94a342SYe Li "echo WARN: Cannot load the DT; " \ 51*cf94a342SYe Li "fi; " \ 52*cf94a342SYe Li "fi; " \ 53*cf94a342SYe Li "else " \ 54*cf94a342SYe Li "bootz; " \ 55*cf94a342SYe Li "fi;\0" \ 56*cf94a342SYe Li "netargs=setenv bootargs console=${console},${baudrate} " \ 57*cf94a342SYe Li "root=/dev/nfs " \ 58*cf94a342SYe Li "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \ 59*cf94a342SYe Li "netboot=echo Booting from net ...; " \ 60*cf94a342SYe Li "run netargs; " \ 61*cf94a342SYe Li "if test ${ip_dyn} = yes; then " \ 62*cf94a342SYe Li "setenv get_cmd dhcp; " \ 63*cf94a342SYe Li "else " \ 64*cf94a342SYe Li "setenv get_cmd tftp; " \ 65*cf94a342SYe Li "fi; " \ 66*cf94a342SYe Li "${get_cmd} ${image}; " \ 67*cf94a342SYe Li "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \ 68*cf94a342SYe Li "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \ 69*cf94a342SYe Li "bootz ${loadaddr} - ${fdt_addr}; " \ 70*cf94a342SYe Li "else " \ 71*cf94a342SYe Li "if test ${boot_fdt} = try; then " \ 72*cf94a342SYe Li "bootz; " \ 73*cf94a342SYe Li "else " \ 74*cf94a342SYe Li "echo WARN: Cannot load the DT; " \ 75*cf94a342SYe Li "fi; " \ 76*cf94a342SYe Li "fi; " \ 77*cf94a342SYe Li "else " \ 78*cf94a342SYe Li "bootz; " \ 79*cf94a342SYe Li "fi;\0" 80*cf94a342SYe Li 81*cf94a342SYe Li #define CONFIG_BOOTCOMMAND \ 82*cf94a342SYe Li "mmc dev ${mmcdev};" \ 83*cf94a342SYe Li "mmc dev ${mmcdev}; if mmc rescan; then " \ 84*cf94a342SYe Li "if run loadbootscript; then " \ 85*cf94a342SYe Li "run bootscript; " \ 86*cf94a342SYe Li "else " \ 87*cf94a342SYe Li "if run loadimage; then " \ 88*cf94a342SYe Li "run mmcboot; " \ 89*cf94a342SYe Li "else run netboot; " \ 90*cf94a342SYe Li "fi; " \ 91*cf94a342SYe Li "fi; " \ 92*cf94a342SYe Li "else run netboot; fi" 93*cf94a342SYe Li 94*cf94a342SYe Li /* Miscellaneous configurable options */ 95*cf94a342SYe Li #define CONFIG_SYS_MEMTEST_START 0x80000000 96*cf94a342SYe Li #define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_MEMTEST_START + 0x10000) 97*cf94a342SYe Li 98*cf94a342SYe Li /* Physical Memory Map */ 99*cf94a342SYe Li #define CONFIG_NR_DRAM_BANKS 1 100*cf94a342SYe Li #define PHYS_SDRAM MMDC0_ARB_BASE_ADDR 101*cf94a342SYe Li 102*cf94a342SYe Li #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM 103*cf94a342SYe Li #define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR 104*cf94a342SYe Li #define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE 105*cf94a342SYe Li 106*cf94a342SYe Li #define CONFIG_SYS_INIT_SP_OFFSET \ 107*cf94a342SYe Li (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE) 108*cf94a342SYe Li #define CONFIG_SYS_INIT_SP_ADDR \ 109*cf94a342SYe Li (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET) 110*cf94a342SYe Li 111*cf94a342SYe Li /* MMC Configuration */ 112*cf94a342SYe Li #define CONFIG_SYS_FSL_ESDHC_ADDR USDHC3_BASE_ADDR 113*cf94a342SYe Li 114*cf94a342SYe Li /* I2C Configs */ 115*cf94a342SYe Li #define CONFIG_SYS_I2C_MXC 116*cf94a342SYe Li #define CONFIG_SYS_I2C_MXC_I2C1 /* enable I2C bus 1 */ 117*cf94a342SYe Li #define CONFIG_SYS_I2C_MXC_I2C2 /* enable I2C bus 2 */ 118*cf94a342SYe Li #define CONFIG_SYS_I2C_MXC_I2C3 /* enable I2C bus 3 */ 119*cf94a342SYe Li #define CONFIG_SYS_I2C_SPEED 100000 120*cf94a342SYe Li 121*cf94a342SYe Li /* NAND stuff */ 122*cf94a342SYe Li #define CONFIG_SYS_MAX_NAND_DEVICE 1 123*cf94a342SYe Li #define CONFIG_SYS_NAND_BASE 0x40000000 124*cf94a342SYe Li #define CONFIG_SYS_NAND_5_ADDR_CYCLE 125*cf94a342SYe Li #define CONFIG_SYS_NAND_ONFI_DETECTION 126*cf94a342SYe Li 127*cf94a342SYe Li /* DMA stuff, needed for GPMI/MXS NAND support */ 128*cf94a342SYe Li 129*cf94a342SYe Li /* Network */ 130*cf94a342SYe Li 131*cf94a342SYe Li #define CONFIG_FEC_MXC 132*cf94a342SYe Li #define CONFIG_MII 133*cf94a342SYe Li 134*cf94a342SYe Li #define IMX_FEC_BASE ENET2_BASE_ADDR 135*cf94a342SYe Li #define CONFIG_FEC_MXC_PHYADDR 0x0 136*cf94a342SYe Li 137*cf94a342SYe Li #define CONFIG_FEC_XCV_TYPE RGMII 138*cf94a342SYe Li #define CONFIG_ETHPRIME "FEC" 139*cf94a342SYe Li 140*cf94a342SYe Li #define CONFIG_PHY_ATHEROS 141*cf94a342SYe Li 142*cf94a342SYe Li #ifdef CONFIG_CMD_USB 143*cf94a342SYe Li #define CONFIG_EHCI_HCD_INIT_AFTER_RESET 144*cf94a342SYe Li #define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW) 145*cf94a342SYe Li #define CONFIG_MXC_USB_FLAGS 0 146*cf94a342SYe Li #define CONFIG_USB_MAX_CONTROLLER_COUNT 2 147*cf94a342SYe Li #endif 148*cf94a342SYe Li 149*cf94a342SYe Li #define CONFIG_IMX_THERMAL 150*cf94a342SYe Li 151*cf94a342SYe Li #ifdef CONFIG_FSL_QSPI 152*cf94a342SYe Li #define CONFIG_SYS_FSL_QSPI_AHB 153*cf94a342SYe Li #define CONFIG_SF_DEFAULT_BUS 0 154*cf94a342SYe Li #define CONFIG_SF_DEFAULT_CS 0 155*cf94a342SYe Li #define CONFIG_SF_DEFAULT_SPEED 40000000 156*cf94a342SYe Li #define CONFIG_SF_DEFAULT_MODE SPI_MODE_0 157*cf94a342SYe Li #define FSL_QSPI_FLASH_SIZE SZ_32M 158*cf94a342SYe Li #define FSL_QSPI_FLASH_NUM 2 159*cf94a342SYe Li #endif 160*cf94a342SYe Li 161*cf94a342SYe Li #define CONFIG_ENV_OFFSET (8 * SZ_64K) 162*cf94a342SYe Li #define CONFIG_ENV_SIZE SZ_8K 163*cf94a342SYe Li 164*cf94a342SYe Li #define CONFIG_SYS_FSL_USDHC_NUM 2 165*cf94a342SYe Li #if defined(CONFIG_ENV_IS_IN_MMC) 166*cf94a342SYe Li #define CONFIG_SYS_MMC_ENV_DEV 0 /*USDHC3*/ 167*cf94a342SYe Li #endif 168*cf94a342SYe Li 169*cf94a342SYe Li #endif /* __CONFIG_H */ 170