1*83d290c5STom Rini /* SPDX-License-Identifier: GPL-2.0+ */ 2e32028a7SNikita Kiryanov /* 3e32028a7SNikita Kiryanov * Config file for Compulab CM-FX6 board 4e32028a7SNikita Kiryanov * 5e32028a7SNikita Kiryanov * Copyright (C) 2014, Compulab Ltd - http://compulab.co.il/ 6e32028a7SNikita Kiryanov * 7e32028a7SNikita Kiryanov * Author: Nikita Kiryanov <nikita@compulab.co.il> 8e32028a7SNikita Kiryanov */ 9e32028a7SNikita Kiryanov 10e32028a7SNikita Kiryanov #ifndef __CONFIG_CM_FX6_H 11e32028a7SNikita Kiryanov #define __CONFIG_CM_FX6_H 12e32028a7SNikita Kiryanov 13e32028a7SNikita Kiryanov #include "mx6_common.h" 14e32028a7SNikita Kiryanov 15e32028a7SNikita Kiryanov /* Machine config */ 16e32028a7SNikita Kiryanov #define CONFIG_SYS_LITTLE_ENDIAN 17e32028a7SNikita Kiryanov #define CONFIG_MACH_TYPE 4273 18e32028a7SNikita Kiryanov 19e32028a7SNikita Kiryanov /* MMC */ 20e32028a7SNikita Kiryanov #define CONFIG_SYS_FSL_USDHC_NUM 3 21e32028a7SNikita Kiryanov #define CONFIG_SYS_FSL_ESDHC_ADDR USDHC2_BASE_ADDR 22e32028a7SNikita Kiryanov 23e32028a7SNikita Kiryanov /* RAM */ 24e32028a7SNikita Kiryanov #define PHYS_SDRAM_1 MMDC0_ARB_BASE_ADDR 25e32028a7SNikita Kiryanov #define PHYS_SDRAM_2 MMDC1_ARB_BASE_ADDR 26e32028a7SNikita Kiryanov #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1 27e32028a7SNikita Kiryanov #define CONFIG_SYS_MEMTEST_START 0x10000000 28e32028a7SNikita Kiryanov #define CONFIG_SYS_MEMTEST_END 0x10010000 29e32028a7SNikita Kiryanov #define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR 30e32028a7SNikita Kiryanov #define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE 31e32028a7SNikita Kiryanov #define CONFIG_SYS_INIT_SP_OFFSET \ 32e32028a7SNikita Kiryanov (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE) 33e32028a7SNikita Kiryanov #define CONFIG_SYS_INIT_SP_ADDR \ 34e32028a7SNikita Kiryanov (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET) 35e32028a7SNikita Kiryanov 36e32028a7SNikita Kiryanov /* Serial console */ 37e32028a7SNikita Kiryanov #define CONFIG_MXC_UART 38e32028a7SNikita Kiryanov #define CONFIG_MXC_UART_BASE UART4_BASE 39e32028a7SNikita Kiryanov #define CONFIG_SYS_BAUDRATE_TABLE {9600, 19200, 38400, 57600, 115200} 40e32028a7SNikita Kiryanov 41e32028a7SNikita Kiryanov /* SPI flash */ 42e32028a7SNikita Kiryanov 4363a93093SChristopher Spinrath /* MTD support */ 4463a93093SChristopher Spinrath #ifndef CONFIG_SPL_BUILD 4563a93093SChristopher Spinrath #define CONFIG_SPI_FLASH_MTD 4663a93093SChristopher Spinrath #endif 4763a93093SChristopher Spinrath 48e32028a7SNikita Kiryanov /* Environment */ 49e32028a7SNikita Kiryanov #define CONFIG_ENV_SECT_SIZE (64 * 1024) 50e32028a7SNikita Kiryanov #define CONFIG_ENV_SIZE (8 * 1024) 51e32028a7SNikita Kiryanov #define CONFIG_ENV_OFFSET (768 * 1024) 52e32028a7SNikita Kiryanov 533ef5f671SChristopher Spinrath #ifndef CONFIG_SPL_BUILD 54e32028a7SNikita Kiryanov #define CONFIG_EXTRA_ENV_SETTINGS \ 556b79f71cSChristopher Spinrath "fdt_high=0xffffffff\0" \ 566b79f71cSChristopher Spinrath "initrd_high=0xffffffff\0" \ 576b79f71cSChristopher Spinrath "fdt_addr_r=0x18000000\0" \ 586b79f71cSChristopher Spinrath "ramdisk_addr_r=0x13000000\0" \ 596b79f71cSChristopher Spinrath "kernel_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \ 606b79f71cSChristopher Spinrath "pxefile_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \ 616b79f71cSChristopher Spinrath "scriptaddr=" __stringify(CONFIG_LOADADDR) "\0" \ 62edc57f1dSChristopher Spinrath "fdtfile=undefined\0" \ 631c2e5292SNikita Kiryanov "stdin=serial,usbkbd\0" \ 64deb94d61SNikita Kiryanov "stdout=serial,vga\0" \ 65deb94d61SNikita Kiryanov "stderr=serial,vga\0" \ 66deb94d61SNikita Kiryanov "panel=HDMI\0" \ 67e32028a7SNikita Kiryanov "autoload=no\0" \ 68f0f6724fSChristopher Spinrath "uImage=uImage-cm-fx6\0" \ 69f0f6724fSChristopher Spinrath "zImage=zImage-cm-fx6\0" \ 70508a6edeSNikita Kiryanov "kernel=uImage-cm-fx6\0" \ 71508a6edeSNikita Kiryanov "dtb=cm-fx6.dtb\0" \ 72e32028a7SNikita Kiryanov "console=ttymxc3,115200\0" \ 73e32028a7SNikita Kiryanov "ethprime=FEC0\0" \ 74e32028a7SNikita Kiryanov "video_hdmi=mxcfb0:dev=hdmi,1920x1080M-32@50,if=RGB32\0" \ 75e32028a7SNikita Kiryanov "video_dvi=mxcfb0:dev=dvi,1280x800M-32@50,if=RGB32\0" \ 766b79f71cSChristopher Spinrath "doboot=bootm ${kernel_addr_r}\0" \ 77508a6edeSNikita Kiryanov "doloadfdt=false\0" \ 7843ede0bcSTom Rini "mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \ 7943ede0bcSTom Rini "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \ 80f0f6724fSChristopher Spinrath "setboottypez=setenv kernel ${zImage};" \ 816b79f71cSChristopher Spinrath "setenv doboot bootz ${kernel_addr_r} - ${fdt_addr_r};" \ 82508a6edeSNikita Kiryanov "setenv doloadfdt true;\0" \ 83f0f6724fSChristopher Spinrath "setboottypem=setenv kernel ${uImage};" \ 846b79f71cSChristopher Spinrath "setenv doboot bootm ${kernel_addr_r};" \ 85508a6edeSNikita Kiryanov "setenv doloadfdt false;\0"\ 86e32028a7SNikita Kiryanov "mmcroot=/dev/mmcblk0p2 rw rootwait\0" \ 87206f38f7SNikita Kiryanov "sataroot=/dev/sda2 rw rootwait\0" \ 88a6b0652bSNikita Kiryanov "nandroot=/dev/mtdblock4 rw\0" \ 89a6b0652bSNikita Kiryanov "nandrootfstype=ubifs\0" \ 90508a6edeSNikita Kiryanov "mmcargs=setenv bootargs console=${console} root=${mmcroot} " \ 91f0f6724fSChristopher Spinrath "${video} ${extrabootargs}\0" \ 92508a6edeSNikita Kiryanov "sataargs=setenv bootargs console=${console} root=${sataroot} " \ 93f0f6724fSChristopher Spinrath "${video} ${extrabootargs}\0" \ 94a6b0652bSNikita Kiryanov "nandargs=setenv bootargs console=${console} " \ 95a6b0652bSNikita Kiryanov "root=${nandroot} " \ 96a6b0652bSNikita Kiryanov "rootfstype=${nandrootfstype} " \ 97f0f6724fSChristopher Spinrath "${video} ${extrabootargs}\0" \ 98508a6edeSNikita Kiryanov "nandboot=if run nandloadkernel; then " \ 99a6b0652bSNikita Kiryanov "run nandloadfdt;" \ 100508a6edeSNikita Kiryanov "run setboottypem;" \ 101508a6edeSNikita Kiryanov "run storagebootcmd;" \ 102508a6edeSNikita Kiryanov "run setboottypez;" \ 103508a6edeSNikita Kiryanov "run storagebootcmd;" \ 104508a6edeSNikita Kiryanov "fi;\0" \ 105508a6edeSNikita Kiryanov "run_eboot=echo Starting EBOOT ...; "\ 106508a6edeSNikita Kiryanov "mmc dev 2 && " \ 107508a6edeSNikita Kiryanov "mmc rescan && mmc read 10042000 a 400 && go 10042000\0" \ 1086b79f71cSChristopher Spinrath "loadkernel=load ${storagetype} ${storagedev} ${kernel_addr_r} ${kernel};\0"\ 1096b79f71cSChristopher Spinrath "loadfdt=load ${storagetype} ${storagedev} ${fdt_addr_r} ${dtb};\0" \ 1106b79f71cSChristopher Spinrath "nandloadkernel=nand read ${kernel_addr_r} 0 780000;\0" \ 1116b79f71cSChristopher Spinrath "nandloadfdt=nand read ${fdt_addr_r} 780000 80000;\0" \ 112508a6edeSNikita Kiryanov "setupmmcboot=setenv storagetype mmc; setenv storagedev 2;\0" \ 113508a6edeSNikita Kiryanov "setupsataboot=setenv storagetype sata; setenv storagedev 0;\0" \ 114508a6edeSNikita Kiryanov "setupnandboot=setenv storagetype nand;\0" \ 115508a6edeSNikita Kiryanov "storagebootcmd=echo Booting from ${storagetype} ...;" \ 116508a6edeSNikita Kiryanov "run ${storagetype}args; run doboot;\0" \ 117508a6edeSNikita Kiryanov "trybootk=if run loadkernel; then " \ 118508a6edeSNikita Kiryanov "if ${doloadfdt}; then " \ 119508a6edeSNikita Kiryanov "run loadfdt;" \ 120a6b0652bSNikita Kiryanov "fi;" \ 121508a6edeSNikita Kiryanov "run storagebootcmd;" \ 122508a6edeSNikita Kiryanov "fi;\0" \ 1235a6440caSChristopher Spinrath "trybootsmz=" \ 124508a6edeSNikita Kiryanov "run setboottypem;" \ 125508a6edeSNikita Kiryanov "run trybootk;" \ 126508a6edeSNikita Kiryanov "run setboottypez;" \ 1273ef5f671SChristopher Spinrath "run trybootk;\0" \ 1283ef5f671SChristopher Spinrath "legacy_bootcmd=" \ 129508a6edeSNikita Kiryanov "run setupmmcboot;" \ 130508a6edeSNikita Kiryanov "mmc dev ${storagedev};" \ 131508a6edeSNikita Kiryanov "if mmc rescan; then " \ 132508a6edeSNikita Kiryanov "run trybootsmz;" \ 133508a6edeSNikita Kiryanov "fi;" \ 134508a6edeSNikita Kiryanov "run setupsataboot;" \ 135508a6edeSNikita Kiryanov "if sata init; then " \ 136508a6edeSNikita Kiryanov "run trybootsmz;" \ 137508a6edeSNikita Kiryanov "fi;" \ 138508a6edeSNikita Kiryanov "run setupnandboot;" \ 1393ef5f671SChristopher Spinrath "run nandboot;\0" \ 140edc57f1dSChristopher Spinrath "findfdt="\ 141edc57f1dSChristopher Spinrath "if test $board_name = Utilite && test $board_rev = MX6Q ; then " \ 142edc57f1dSChristopher Spinrath "setenv fdtfile imx6q-utilite-pro.dtb; fi; " \ 143edc57f1dSChristopher Spinrath "if test $fdtfile = undefined; then " \ 144edc57f1dSChristopher Spinrath "echo WARNING: Could not determine dtb to use; fi; \0" \ 1453ef5f671SChristopher Spinrath BOOTENV 146e32028a7SNikita Kiryanov 14763a93093SChristopher Spinrath #define CONFIG_PREBOOT "usb start;sf probe" 1481c2e5292SNikita Kiryanov 1493ef5f671SChristopher Spinrath #define BOOT_TARGET_DEVICES(func) \ 1503ef5f671SChristopher Spinrath func(USB, usb, 0) \ 1513ef5f671SChristopher Spinrath func(MMC, mmc, 2) \ 1523ef5f671SChristopher Spinrath func(SATA, sata, 0) 1533ef5f671SChristopher Spinrath 1543ef5f671SChristopher Spinrath #include <config_distro_bootcmd.h> 1553ef5f671SChristopher Spinrath #else 1563ef5f671SChristopher Spinrath #define CONFIG_EXTRA_ENV_SETTINGS 1573ef5f671SChristopher Spinrath #endif 1583ef5f671SChristopher Spinrath 159a6b0652bSNikita Kiryanov /* NAND */ 160a6b0652bSNikita Kiryanov #ifndef CONFIG_SPL_BUILD 161a6b0652bSNikita Kiryanov #define CONFIG_SYS_NAND_BASE 0x40000000 162a6b0652bSNikita Kiryanov #define CONFIG_SYS_NAND_MAX_CHIPS 1 163a6b0652bSNikita Kiryanov #define CONFIG_SYS_MAX_NAND_DEVICE 1 164a6b0652bSNikita Kiryanov #define CONFIG_SYS_NAND_ONFI_DETECTION 165a6b0652bSNikita Kiryanov /* APBH DMA is required for NAND support */ 166a6b0652bSNikita Kiryanov #endif 167a6b0652bSNikita Kiryanov 16802b1343eSNikita Kiryanov /* Ethernet */ 16902b1343eSNikita Kiryanov #define CONFIG_FEC_MXC 17002b1343eSNikita Kiryanov #define CONFIG_FEC_MXC_PHYADDR 0 17102b1343eSNikita Kiryanov #define CONFIG_FEC_XCV_TYPE RGMII 17202b1343eSNikita Kiryanov #define IMX_FEC_BASE ENET_BASE_ADDR 17302b1343eSNikita Kiryanov #define CONFIG_PHY_ATHEROS 17402b1343eSNikita Kiryanov #define CONFIG_ETHPRIME "FEC0" 17502b1343eSNikita Kiryanov #define CONFIG_ARP_TIMEOUT 200UL 17602b1343eSNikita Kiryanov #define CONFIG_NET_RETRY_COUNT 5 17702b1343eSNikita Kiryanov 1780f3effb9SNikita Kiryanov /* USB */ 1790f3effb9SNikita Kiryanov #define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW) 1800f3effb9SNikita Kiryanov #define CONFIG_MXC_USB_FLAGS 0 1810f3effb9SNikita Kiryanov #define CONFIG_USB_MAX_CONTROLLER_COUNT 2 1820f3effb9SNikita Kiryanov #define CONFIG_EHCI_HCD_INIT_AFTER_RESET /* For OTG port */ 1830f3effb9SNikita Kiryanov 184f42b2f60SNikita Kiryanov /* I2C */ 185f42b2f60SNikita Kiryanov #define CONFIG_SYS_I2C 186f42b2f60SNikita Kiryanov #define CONFIG_SYS_I2C_MXC 18703544c66SAlbert ARIBAUD \\(3ADEV\\) #define CONFIG_SYS_I2C_MXC_I2C1 /* enable I2C bus 1 */ 18803544c66SAlbert ARIBAUD \\(3ADEV\\) #define CONFIG_SYS_I2C_MXC_I2C2 /* enable I2C bus 2 */ 189f8cb101eSYork Sun #define CONFIG_SYS_I2C_MXC_I2C3 /* enable I2C bus 3 */ 190f42b2f60SNikita Kiryanov #define CONFIG_SYS_I2C_SPEED 100000 191f42b2f60SNikita Kiryanov #define CONFIG_SYS_MXC_I2C3_SPEED 400000 192f42b2f60SNikita Kiryanov 193f42b2f60SNikita Kiryanov #define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 194f42b2f60SNikita Kiryanov #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 195f42b2f60SNikita Kiryanov #define CONFIG_SYS_I2C_EEPROM_BUS 2 196f42b2f60SNikita Kiryanov 197206f38f7SNikita Kiryanov /* SATA */ 198206f38f7SNikita Kiryanov #define CONFIG_SYS_SATA_MAX_DEVICE 1 199206f38f7SNikita Kiryanov #define CONFIG_LBA48 200206f38f7SNikita Kiryanov #define CONFIG_DWC_AHSATA_PORT_ID 0 201206f38f7SNikita Kiryanov #define CONFIG_DWC_AHSATA_BASE_ADDR SATA_ARB_BASE_ADDR 202206f38f7SNikita Kiryanov 203e32028a7SNikita Kiryanov /* Boot */ 204e32028a7SNikita Kiryanov #define CONFIG_SYS_BOOTMAPSZ (8 << 20) 205f66113c0SNikita Kiryanov #define CONFIG_SERIAL_TAG 206e32028a7SNikita Kiryanov 207e32028a7SNikita Kiryanov /* misc */ 2089fbdcf01SNikita Kiryanov #define CONFIG_SYS_MALLOC_LEN (10 * 1024 * 1024) 209e32028a7SNikita Kiryanov 210e32028a7SNikita Kiryanov /* SPL */ 211e32028a7SNikita Kiryanov #include "imx6_spl.h" 212e32028a7SNikita Kiryanov #define CONFIG_SYS_SPI_U_BOOT_OFFS (64 * 1024) 213e32028a7SNikita Kiryanov 214deb94d61SNikita Kiryanov /* Display */ 215deb94d61SNikita Kiryanov #define CONFIG_VIDEO_IPUV3 216deb94d61SNikita Kiryanov #define CONFIG_IMX_HDMI 217deb94d61SNikita Kiryanov 2183a236a35SNikita Kiryanov #define CONFIG_SPLASH_SCREEN 219f82eb2faSNikita Kiryanov #define CONFIG_SPLASH_SOURCE 2203a236a35SNikita Kiryanov #define CONFIG_VIDEO_BMP_RLE8 2213a236a35SNikita Kiryanov 2228015dde8SNikita Kiryanov #define CONFIG_VIDEO_LOGO 2238015dde8SNikita Kiryanov #define CONFIG_VIDEO_BMP_LOGO 2248015dde8SNikita Kiryanov 22512616531SNikita Kiryanov /* EEPROM */ 22612616531SNikita Kiryanov #define CONFIG_ENV_EEPROM_IS_ON_I2C 22712616531SNikita Kiryanov #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 22812616531SNikita Kiryanov #define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 4 22912616531SNikita Kiryanov #define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 5 23012616531SNikita Kiryanov #define CONFIG_SYS_EEPROM_SIZE 256 23112616531SNikita Kiryanov 232e32028a7SNikita Kiryanov #endif /* __CONFIG_CM_FX6_H */ 233