2018-05-06 21:58:06 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0+ */
|
2014-09-07 15:59:29 +00:00
|
|
|
/*
|
|
|
|
* Config file for Compulab CM-FX6 board
|
|
|
|
*
|
|
|
|
* Copyright (C) 2014, Compulab Ltd - http://compulab.co.il/
|
|
|
|
*
|
|
|
|
* Author: Nikita Kiryanov <nikita@compulab.co.il>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __CONFIG_CM_FX6_H
|
|
|
|
#define __CONFIG_CM_FX6_H
|
|
|
|
|
|
|
|
#include "mx6_common.h"
|
|
|
|
|
|
|
|
/* Machine config */
|
|
|
|
#define CONFIG_SYS_LITTLE_ENDIAN
|
|
|
|
#define CONFIG_MACH_TYPE 4273
|
|
|
|
|
|
|
|
/* MMC */
|
|
|
|
#define CONFIG_SYS_FSL_USDHC_NUM 3
|
|
|
|
#define CONFIG_SYS_FSL_ESDHC_ADDR USDHC2_BASE_ADDR
|
|
|
|
|
|
|
|
/* RAM */
|
|
|
|
#define PHYS_SDRAM_1 MMDC0_ARB_BASE_ADDR
|
|
|
|
#define PHYS_SDRAM_2 MMDC1_ARB_BASE_ADDR
|
|
|
|
#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1
|
|
|
|
#define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
|
|
|
|
#define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
|
|
|
|
#define CONFIG_SYS_INIT_SP_OFFSET \
|
|
|
|
(CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
|
|
|
|
#define CONFIG_SYS_INIT_SP_ADDR \
|
|
|
|
(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
|
|
|
|
|
|
|
|
/* Serial console */
|
|
|
|
#define CONFIG_MXC_UART
|
|
|
|
#define CONFIG_MXC_UART_BASE UART4_BASE
|
|
|
|
#define CONFIG_SYS_BAUDRATE_TABLE {9600, 19200, 38400, 57600, 115200}
|
|
|
|
|
|
|
|
/* Environment */
|
|
|
|
|
2017-12-09 15:37:42 +00:00
|
|
|
#ifndef CONFIG_SPL_BUILD
|
2014-09-07 15:59:29 +00:00
|
|
|
#define CONFIG_EXTRA_ENV_SETTINGS \
|
2017-12-09 15:37:41 +00:00
|
|
|
"fdt_high=0xffffffff\0" \
|
|
|
|
"initrd_high=0xffffffff\0" \
|
|
|
|
"fdt_addr_r=0x18000000\0" \
|
|
|
|
"ramdisk_addr_r=0x13000000\0" \
|
|
|
|
"kernel_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \
|
|
|
|
"pxefile_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \
|
|
|
|
"scriptaddr=" __stringify(CONFIG_LOADADDR) "\0" \
|
2018-01-09 21:01:36 +00:00
|
|
|
"fdtfile=undefined\0" \
|
2015-01-14 08:42:48 +00:00
|
|
|
"stdin=serial,usbkbd\0" \
|
2015-01-14 08:42:46 +00:00
|
|
|
"stdout=serial,vga\0" \
|
|
|
|
"stderr=serial,vga\0" \
|
|
|
|
"panel=HDMI\0" \
|
2014-09-07 15:59:29 +00:00
|
|
|
"autoload=no\0" \
|
2016-07-12 21:37:34 +00:00
|
|
|
"uImage=uImage-cm-fx6\0" \
|
|
|
|
"zImage=zImage-cm-fx6\0" \
|
2015-01-14 08:42:41 +00:00
|
|
|
"kernel=uImage-cm-fx6\0" \
|
|
|
|
"dtb=cm-fx6.dtb\0" \
|
2014-09-07 15:59:29 +00:00
|
|
|
"console=ttymxc3,115200\0" \
|
|
|
|
"ethprime=FEC0\0" \
|
|
|
|
"video_hdmi=mxcfb0:dev=hdmi,1920x1080M-32@50,if=RGB32\0" \
|
|
|
|
"video_dvi=mxcfb0:dev=dvi,1280x800M-32@50,if=RGB32\0" \
|
2017-12-09 15:37:41 +00:00
|
|
|
"doboot=bootm ${kernel_addr_r}\0" \
|
2015-01-14 08:42:41 +00:00
|
|
|
"doloadfdt=false\0" \
|
2017-10-22 21:55:07 +00:00
|
|
|
"mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
|
|
|
|
"mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
|
2016-07-12 21:37:34 +00:00
|
|
|
"setboottypez=setenv kernel ${zImage};" \
|
2017-12-09 15:37:41 +00:00
|
|
|
"setenv doboot bootz ${kernel_addr_r} - ${fdt_addr_r};" \
|
2015-01-14 08:42:41 +00:00
|
|
|
"setenv doloadfdt true;\0" \
|
2016-07-12 21:37:34 +00:00
|
|
|
"setboottypem=setenv kernel ${uImage};" \
|
2017-12-09 15:37:41 +00:00
|
|
|
"setenv doboot bootm ${kernel_addr_r};" \
|
2015-01-14 08:42:41 +00:00
|
|
|
"setenv doloadfdt false;\0"\
|
2014-09-07 15:59:29 +00:00
|
|
|
"mmcroot=/dev/mmcblk0p2 rw rootwait\0" \
|
2014-08-20 12:09:06 +00:00
|
|
|
"sataroot=/dev/sda2 rw rootwait\0" \
|
2014-08-20 12:09:01 +00:00
|
|
|
"nandroot=/dev/mtdblock4 rw\0" \
|
|
|
|
"nandrootfstype=ubifs\0" \
|
2015-01-14 08:42:41 +00:00
|
|
|
"mmcargs=setenv bootargs console=${console} root=${mmcroot} " \
|
2016-07-12 21:37:34 +00:00
|
|
|
"${video} ${extrabootargs}\0" \
|
2015-01-14 08:42:41 +00:00
|
|
|
"sataargs=setenv bootargs console=${console} root=${sataroot} " \
|
2016-07-12 21:37:34 +00:00
|
|
|
"${video} ${extrabootargs}\0" \
|
2014-08-20 12:09:01 +00:00
|
|
|
"nandargs=setenv bootargs console=${console} " \
|
|
|
|
"root=${nandroot} " \
|
|
|
|
"rootfstype=${nandrootfstype} " \
|
2016-07-12 21:37:34 +00:00
|
|
|
"${video} ${extrabootargs}\0" \
|
2015-01-14 08:42:41 +00:00
|
|
|
"nandboot=if run nandloadkernel; then " \
|
2014-08-20 12:09:01 +00:00
|
|
|
"run nandloadfdt;" \
|
2015-01-14 08:42:41 +00:00
|
|
|
"run setboottypem;" \
|
|
|
|
"run storagebootcmd;" \
|
|
|
|
"run setboottypez;" \
|
|
|
|
"run storagebootcmd;" \
|
|
|
|
"fi;\0" \
|
|
|
|
"run_eboot=echo Starting EBOOT ...; "\
|
|
|
|
"mmc dev 2 && " \
|
|
|
|
"mmc rescan && mmc read 10042000 a 400 && go 10042000\0" \
|
2017-12-09 15:37:41 +00:00
|
|
|
"loadkernel=load ${storagetype} ${storagedev} ${kernel_addr_r} ${kernel};\0"\
|
|
|
|
"loadfdt=load ${storagetype} ${storagedev} ${fdt_addr_r} ${dtb};\0" \
|
|
|
|
"nandloadkernel=nand read ${kernel_addr_r} 0 780000;\0" \
|
|
|
|
"nandloadfdt=nand read ${fdt_addr_r} 780000 80000;\0" \
|
2015-01-14 08:42:41 +00:00
|
|
|
"setupmmcboot=setenv storagetype mmc; setenv storagedev 2;\0" \
|
|
|
|
"setupsataboot=setenv storagetype sata; setenv storagedev 0;\0" \
|
|
|
|
"setupnandboot=setenv storagetype nand;\0" \
|
|
|
|
"storagebootcmd=echo Booting from ${storagetype} ...;" \
|
|
|
|
"run ${storagetype}args; run doboot;\0" \
|
|
|
|
"trybootk=if run loadkernel; then " \
|
|
|
|
"if ${doloadfdt}; then " \
|
|
|
|
"run loadfdt;" \
|
2014-08-20 12:09:01 +00:00
|
|
|
"fi;" \
|
2015-01-14 08:42:41 +00:00
|
|
|
"run storagebootcmd;" \
|
|
|
|
"fi;\0" \
|
ARM: imx: cm_fx6: env: don't run boot scripts twice
Boot scripts located in the root directory of the first partition of
USB, mmc, and SATA drives are executed twice: first by the distro boot
command and then by the legacy boot command. This may have weird side
effects if those scripts only change or extend the environment
(including parts of the boot command itself).
Removing the script execution from the legacy boot command has its own
caveats. For instance, the distro boot command may execute the boot.scr
on the mmc drive, then the boot.scr on the SATA drive, before the
legacy boot command actually boots from the mmc drive. However, the
current behavior would only execute the boot.scr once more before the
actual boot, but it does not prevent the script located on the SATA
drive from being executed, and thus, both scripts from being mixed up.
Considering that the legacy boot command is only in place to boot old
(standard) installations, let's go with the resolution having less
custom code and remove the script execution from the legacy boot
command.
Signed-off-by: Christopher Spinrath <christopher.spinrath@rwth-aachen.de>
Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
2017-12-09 15:37:43 +00:00
|
|
|
"trybootsmz=" \
|
2015-01-14 08:42:41 +00:00
|
|
|
"run setboottypem;" \
|
|
|
|
"run trybootk;" \
|
|
|
|
"run setboottypez;" \
|
2017-12-09 15:37:42 +00:00
|
|
|
"run trybootk;\0" \
|
|
|
|
"legacy_bootcmd=" \
|
|
|
|
"run setupmmcboot;" \
|
|
|
|
"mmc dev ${storagedev};" \
|
|
|
|
"if mmc rescan; then " \
|
|
|
|
"run trybootsmz;" \
|
2015-01-14 08:42:41 +00:00
|
|
|
"fi;" \
|
2017-12-09 15:37:42 +00:00
|
|
|
"run setupsataboot;" \
|
|
|
|
"if sata init; then " \
|
|
|
|
"run trybootsmz;" \
|
|
|
|
"fi;" \
|
|
|
|
"run setupnandboot;" \
|
|
|
|
"run nandboot;\0" \
|
2018-01-09 21:01:36 +00:00
|
|
|
"findfdt="\
|
|
|
|
"if test $board_name = Utilite && test $board_rev = MX6Q ; then " \
|
|
|
|
"setenv fdtfile imx6q-utilite-pro.dtb; fi; " \
|
|
|
|
"if test $fdtfile = undefined; then " \
|
|
|
|
"echo WARNING: Could not determine dtb to use; fi; \0" \
|
2017-12-09 15:37:42 +00:00
|
|
|
BOOTENV
|
2014-09-07 15:59:29 +00:00
|
|
|
|
2017-12-09 15:37:42 +00:00
|
|
|
#define BOOT_TARGET_DEVICES(func) \
|
|
|
|
func(USB, usb, 0) \
|
|
|
|
func(MMC, mmc, 2) \
|
|
|
|
func(SATA, sata, 0)
|
|
|
|
|
|
|
|
#include <config_distro_bootcmd.h>
|
|
|
|
#else
|
|
|
|
#define CONFIG_EXTRA_ENV_SETTINGS
|
|
|
|
#endif
|
2014-09-07 15:59:29 +00:00
|
|
|
|
2014-08-20 12:09:01 +00:00
|
|
|
/* NAND */
|
|
|
|
#ifndef CONFIG_SPL_BUILD
|
|
|
|
#define CONFIG_SYS_NAND_BASE 0x40000000
|
|
|
|
#define CONFIG_SYS_NAND_MAX_CHIPS 1
|
|
|
|
#define CONFIG_SYS_MAX_NAND_DEVICE 1
|
|
|
|
#define CONFIG_SYS_NAND_ONFI_DETECTION
|
|
|
|
/* APBH DMA is required for NAND support */
|
|
|
|
#endif
|
|
|
|
|
2019-11-27 10:47:48 +00:00
|
|
|
/* SPI Flash Configs */
|
|
|
|
#if defined(CONFIG_SPL_BUILD)
|
|
|
|
#undef CONFIG_DM_SPI
|
|
|
|
#undef CONFIG_DM_SPI_FLASH
|
|
|
|
#undef CONFIG_SPI_FLASH_MTD
|
|
|
|
#endif
|
|
|
|
|
2014-08-20 12:09:02 +00:00
|
|
|
/* Ethernet */
|
|
|
|
#define CONFIG_FEC_MXC
|
|
|
|
#define CONFIG_FEC_MXC_PHYADDR 0
|
|
|
|
#define CONFIG_FEC_XCV_TYPE RGMII
|
|
|
|
#define IMX_FEC_BASE ENET_BASE_ADDR
|
|
|
|
#define CONFIG_ETHPRIME "FEC0"
|
|
|
|
#define CONFIG_ARP_TIMEOUT 200UL
|
|
|
|
#define CONFIG_NET_RETRY_COUNT 5
|
|
|
|
|
2014-08-20 12:09:03 +00:00
|
|
|
/* USB */
|
|
|
|
#define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
|
|
|
|
#define CONFIG_MXC_USB_FLAGS 0
|
|
|
|
#define CONFIG_USB_MAX_CONTROLLER_COUNT 2
|
|
|
|
#define CONFIG_EHCI_HCD_INIT_AFTER_RESET /* For OTG port */
|
|
|
|
|
2014-08-20 12:09:04 +00:00
|
|
|
/* I2C */
|
|
|
|
#define CONFIG_SYS_I2C
|
|
|
|
#define CONFIG_SYS_I2C_MXC
|
2015-09-21 20:43:38 +00:00
|
|
|
#define CONFIG_SYS_I2C_MXC_I2C1 /* enable I2C bus 1 */
|
|
|
|
#define CONFIG_SYS_I2C_MXC_I2C2 /* enable I2C bus 2 */
|
2015-03-20 17:20:40 +00:00
|
|
|
#define CONFIG_SYS_I2C_MXC_I2C3 /* enable I2C bus 3 */
|
2014-08-20 12:09:04 +00:00
|
|
|
#define CONFIG_SYS_I2C_SPEED 100000
|
|
|
|
#define CONFIG_SYS_MXC_I2C3_SPEED 400000
|
|
|
|
|
|
|
|
#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50
|
|
|
|
#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
|
|
|
|
#define CONFIG_SYS_I2C_EEPROM_BUS 2
|
|
|
|
|
2014-08-20 12:09:06 +00:00
|
|
|
/* SATA */
|
|
|
|
#define CONFIG_SYS_SATA_MAX_DEVICE 1
|
|
|
|
#define CONFIG_LBA48
|
|
|
|
#define CONFIG_DWC_AHSATA_PORT_ID 0
|
|
|
|
#define CONFIG_DWC_AHSATA_BASE_ADDR SATA_ARB_BASE_ADDR
|
|
|
|
|
2014-09-07 15:59:29 +00:00
|
|
|
/* Boot */
|
|
|
|
#define CONFIG_SYS_BOOTMAPSZ (8 << 20)
|
2014-08-20 12:09:05 +00:00
|
|
|
#define CONFIG_SERIAL_TAG
|
2014-09-07 15:59:29 +00:00
|
|
|
|
|
|
|
/* misc */
|
2015-01-14 08:42:45 +00:00
|
|
|
#define CONFIG_SYS_MALLOC_LEN (10 * 1024 * 1024)
|
2014-09-07 15:59:29 +00:00
|
|
|
|
|
|
|
/* SPL */
|
|
|
|
#include "imx6_spl.h"
|
|
|
|
|
2015-01-14 08:42:46 +00:00
|
|
|
/* Display */
|
|
|
|
#define CONFIG_IMX_HDMI
|
|
|
|
|
2015-01-14 08:42:53 +00:00
|
|
|
#define CONFIG_SPLASH_SCREEN
|
2015-01-14 08:42:54 +00:00
|
|
|
#define CONFIG_SPLASH_SOURCE
|
2015-01-14 08:42:53 +00:00
|
|
|
#define CONFIG_VIDEO_BMP_RLE8
|
|
|
|
|
2015-01-14 08:42:47 +00:00
|
|
|
#define CONFIG_VIDEO_LOGO
|
|
|
|
#define CONFIG_VIDEO_BMP_LOGO
|
|
|
|
|
2016-04-16 14:55:05 +00:00
|
|
|
/* EEPROM */
|
|
|
|
#define CONFIG_ENV_EEPROM_IS_ON_I2C
|
|
|
|
#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
|
|
|
|
#define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 4
|
|
|
|
#define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 5
|
|
|
|
#define CONFIG_SYS_EEPROM_SIZE 256
|
|
|
|
|
2014-09-07 15:59:29 +00:00
|
|
|
#endif /* __CONFIG_CM_FX6_H */
|