1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Copyright (C) 2015 CompuLab, Ltd.
5 * Configuration settings for the CompuLab CL-SOM-iMX7 System-on-Module.
8 #ifndef __CL_SOM_IMX7_CONFIG_H
9 #define __CL_SOM_IMX7_CONFIG_H
11 #include "mx7_common.h"
13 #define CONFIG_MXC_UART_BASE UART1_IPS_BASE_ADDR
16 #define CONFIG_FEC_MXC
17 #define CONFIG_FEC_XCV_TYPE RGMII
18 #define CONFIG_ETHPRIME "FEC"
19 #define CONFIG_FEC_MXC_PHYADDR 0
22 #define IMX_FEC_BASE ENET_IPS_BASE_ADDR
25 #define CONFIG_POWER_LEGACY
26 #define CONFIG_POWER_I2C
27 #define CONFIG_POWER_PFUZE3000
28 #define CONFIG_POWER_PFUZE3000_I2C_ADDR 0x08
30 #define CONFIG_PCA953X
31 #define CONFIG_SYS_I2C_PCA953X_ADDR 0x20
32 #define CONFIG_SYS_I2C_PCA953X_WIDTH { {0x20, 16} }
34 #undef CONFIG_SYS_AUTOLOAD
35 #undef CONFIG_EXTRA_ENV_SETTINGS
36 #undef CONFIG_BOOTCOMMAND
38 #define CONFIG_SYS_AUTOLOAD "no"
40 #define CONFIG_EXTRA_ENV_SETTINGS \
43 "loadscript=load ${storagetype} ${storagedev} ${loadaddr} ${script};\0" \
44 "loadkernel=load ${storagetype} ${storagedev} ${loadaddr} ${kernel};\0" \
45 "loadfdt=load ${storagetype} ${storagedev} ${fdtaddr} ${fdtfile};\0" \
46 "bootscript=echo Running bootscript from ${storagetype} ...; source ${loadaddr};\0" \
47 "storagebootcmd=echo Booting from ${storagetype} ...; run ${storagetype}args; run doboot;\0" \
50 "fdt_high=0xffffffff\0" \
51 "initrd_high=0xffffffff\0" \
52 "fdtfile=imx7d-sbc-imx7.dtb\0" \
53 "fdtaddr=0x83000000\0" \
54 "mmcdev_def="__stringify(CONFIG_SYS_MMC_DEV)"\0" \
55 "usbdev_def="__stringify(CONFIG_SYS_USB_DEV)"\0" \
56 "mmcpart=" __stringify(CONFIG_SYS_MMC_IMG_LOAD_PART) "\0" \
57 "usbpart=" __stringify(CONFIG_SYS_USB_IMG_LOAD_PART) "\0" \
58 "doboot=bootz ${loadaddr} - ${fdtaddr}\0" \
59 "mmc_config=mmc dev ${mmcdev}; mmc rescan\0" \
60 "mmcargs=setenv bootargs console=${console},${baudrate} " \
61 "root=/dev/mmcblk${mmcblk}p2 rootwait rw\0" \
63 "if run mmc_config; then " \
64 "setenv storagetype mmc;" \
65 "setenv storagedev ${mmcdev}:${mmcpart};" \
66 "if run loadscript; then " \
71 "if run mmc_config; then " \
72 "setenv storagetype mmc;" \
73 "setenv storagedev ${mmcdev}:${mmcpart};" \
74 "if run loadkernel; then " \
75 "if run loadfdt; then " \
76 "run storagebootcmd;" \
80 "sdbootscript=setenv mmcdev ${mmcdev_def}; setenv mmcblk 0; " \
81 "run mmcbootscript\0" \
82 "usbbootscript=setenv usbdev ${usbdev_def}; " \
83 "setenv storagetype usb;" \
84 "setenv storagedev ${usbdev}:${usbpart};" \
85 "if run loadscript; then " \
88 "sdboot=setenv mmcdev ${mmcdev_def}; setenv mmcblk 0; run mmcboot\0" \
89 "emmcbootscript=setenv mmcdev 1; setenv mmcblk 2; run mmcbootscript\0" \
90 "emmcboot=setenv mmcdev 1; setenv mmcblk 2; run mmcboot\0" \
92 #define CONFIG_BOOTCOMMAND \
93 "echo SD boot attempt ...; run sdbootscript; run sdboot; " \
94 "echo eMMC boot attempt ...; run emmcbootscript; run emmcboot; " \
95 "echo USB boot attempt ...; run usbbootscript; "
97 #define CONFIG_SYS_HZ 1000
99 /* Physical Memory Map */
100 #define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
102 #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
103 #define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
104 #define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
106 #define CONFIG_SYS_INIT_SP_OFFSET \
107 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
108 #define CONFIG_SYS_INIT_SP_ADDR \
109 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
111 /* SPI Flash support */
113 /* FLASH and environment organization */
116 #ifdef CONFIG_FSL_USDHC
117 #define CONFIG_SYS_FSL_ESDHC_ADDR USDHC1_BASE_ADDR
119 #define CONFIG_SYS_FSL_USDHC_NUM 2
120 #define CONFIG_MMCROOT "/dev/mmcblk0p2" /* USDHC1 */
124 #define CONFIG_EHCI_HCD_INIT_AFTER_RESET
125 #define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
126 #define CONFIG_MXC_USB_FLAGS 0
127 #define CONFIG_USB_MAX_CONTROLLER_COUNT 2
130 #include "imx7_spl.h"
132 #endif /* __CONFIG_H */