blob: 78f73fc915ed20f147923e12acb3539a7a94ba30 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Ilya Ledvich38a53c62017-09-24 09:00:25 +03002/*
3 * Copyright (C) 2015 CompuLab, Ltd.
4 *
5 * Configuration settings for the CompuLab CL-SOM-iMX7 System-on-Module.
Ilya Ledvich38a53c62017-09-24 09:00:25 +03006 */
7
8#ifndef __CL_SOM_IMX7_CONFIG_H
9#define __CL_SOM_IMX7_CONFIG_H
10
11#include "mx7_common.h"
12
Ilya Ledvich38a53c62017-09-24 09:00:25 +030013#define CONFIG_MXC_UART_BASE UART1_IPS_BASE_ADDR
14
15/* Size of malloc() pool */
16#define CONFIG_SYS_MALLOC_LEN (32 * SZ_1M)
17
18#define CONFIG_BOARD_LATE_INIT
19
Ilya Ledvich38a53c62017-09-24 09:00:25 +030020/* Network */
21#define CONFIG_FEC_MXC
Ilya Ledvich38a53c62017-09-24 09:00:25 +030022#define CONFIG_FEC_XCV_TYPE RGMII
23#define CONFIG_ETHPRIME "FEC"
24#define CONFIG_FEC_MXC_PHYADDR 0
25
Ilya Ledvich38a53c62017-09-24 09:00:25 +030026/* ENET1 */
27#define IMX_FEC_BASE ENET_IPS_BASE_ADDR
28
29/* PMIC */
30#define CONFIG_POWER
31#define CONFIG_POWER_I2C
32#define CONFIG_POWER_PFUZE3000
33#define CONFIG_POWER_PFUZE3000_I2C_ADDR 0x08
34
Ilya Ledvich38a53c62017-09-24 09:00:25 +030035/* I2C configs */
36#define CONFIG_SYS_I2C
37#define CONFIG_SYS_I2C_MXC
38#define CONFIG_SYS_I2C_MXC_I2C2 /* Enable I2C bus 2 */
39#define CONFIG_SYS_I2C_SPEED 100000
40#define SYS_I2C_BUS_SOM 0
41
42#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50
43#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
44#define CONFIG_SYS_I2C_EEPROM_BUS SYS_I2C_BUS_SOM
45
46#define CONFIG_PCA953X
Ilya Ledvich38a53c62017-09-24 09:00:25 +030047#define CONFIG_SYS_I2C_PCA953X_ADDR 0x20
48#define CONFIG_SYS_I2C_PCA953X_WIDTH { {0x20, 16} }
49
50#undef CONFIG_SYS_AUTOLOAD
51#undef CONFIG_EXTRA_ENV_SETTINGS
52#undef CONFIG_BOOTCOMMAND
Ilya Ledvich38a53c62017-09-24 09:00:25 +030053
Ilya Ledvich38a53c62017-09-24 09:00:25 +030054#define CONFIG_SYS_AUTOLOAD "no"
55
56#define CONFIG_EXTRA_ENV_SETTINGS \
57 "autoload=off\0" \
58 "script=boot.scr\0" \
59 "loadscript=load ${storagetype} ${storagedev} ${loadaddr} ${script};\0" \
60 "loadkernel=load ${storagetype} ${storagedev} ${loadaddr} ${kernel};\0" \
61 "loadfdt=load ${storagetype} ${storagedev} ${fdtaddr} ${fdtfile};\0" \
62 "bootscript=echo Running bootscript from ${storagetype} ...; source ${loadaddr};\0" \
63 "storagebootcmd=echo Booting from ${storagetype} ...; run ${storagetype}args; run doboot;\0" \
64 "kernel=zImage\0" \
65 "console=ttymxc0\0" \
66 "fdt_high=0xffffffff\0" \
67 "initrd_high=0xffffffff\0" \
68 "fdtfile=imx7d-sbc-imx7.dtb\0" \
69 "fdtaddr=0x83000000\0" \
70 "mmcdev_def="__stringify(CONFIG_SYS_MMC_DEV)"\0" \
71 "usbdev_def="__stringify(CONFIG_SYS_USB_DEV)"\0" \
72 "mmcpart=" __stringify(CONFIG_SYS_MMC_IMG_LOAD_PART) "\0" \
73 "usbpart=" __stringify(CONFIG_SYS_USB_IMG_LOAD_PART) "\0" \
74 "doboot=bootz ${loadaddr} - ${fdtaddr}\0" \
75 "mmc_config=mmc dev ${mmcdev}; mmc rescan\0" \
76 "mmcargs=setenv bootargs console=${console},${baudrate} " \
77 "root=/dev/mmcblk${mmcblk}p2 rootwait rw\0" \
78 "mmcbootscript=" \
79 "if run mmc_config; then " \
80 "setenv storagetype mmc;" \
81 "setenv storagedev ${mmcdev}:${mmcpart};" \
82 "if run loadscript; then " \
83 "run bootscript; " \
84 "fi; " \
85 "fi;\0" \
86 "mmcboot=" \
87 "if run mmc_config; then " \
88 "setenv storagetype mmc;" \
89 "setenv storagedev ${mmcdev}:${mmcpart};" \
90 "if run loadkernel; then " \
91 "if run loadfdt; then " \
92 "run storagebootcmd;" \
93 "fi; " \
94 "fi; " \
95 "fi;\0" \
96 "sdbootscript=setenv mmcdev ${mmcdev_def}; setenv mmcblk 0; " \
97 "run mmcbootscript\0" \
98 "usbbootscript=setenv usbdev ${usbdev_def}; " \
99 "setenv storagetype usb;" \
100 "setenv storagedev ${usbdev}:${usbpart};" \
101 "if run loadscript; then " \
102 "run bootscript; " \
103 "fi; " \
104 "sdboot=setenv mmcdev ${mmcdev_def}; setenv mmcblk 0; run mmcboot\0" \
105 "emmcbootscript=setenv mmcdev 1; setenv mmcblk 2; run mmcbootscript\0" \
106 "emmcboot=setenv mmcdev 1; setenv mmcblk 2; run mmcboot\0" \
107
108#define CONFIG_BOOTCOMMAND \
109 "echo SD boot attempt ...; run sdbootscript; run sdboot; " \
110 "echo eMMC boot attempt ...; run emmcbootscript; run emmcboot; " \
111 "echo USB boot attempt ...; run usbbootscript; "
112
Ilya Ledvich38a53c62017-09-24 09:00:25 +0300113#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
114#define CONFIG_SYS_HZ 1000
115
116/* Physical Memory Map */
Ilya Ledvich38a53c62017-09-24 09:00:25 +0300117#define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
118
119#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
120#define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
121#define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
122
123#define CONFIG_SYS_INIT_SP_OFFSET \
124 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
125#define CONFIG_SYS_INIT_SP_ADDR \
126 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
127
128/* SPI Flash support */
Ilya Ledvich38a53c62017-09-24 09:00:25 +0300129
130/* FLASH and environment organization */
Ilya Ledvich38a53c62017-09-24 09:00:25 +0300131
132/* MMC Config*/
Ilya Ledvich38a53c62017-09-24 09:00:25 +0300133#ifdef CONFIG_FSL_USDHC
134#define CONFIG_SYS_FSL_ESDHC_ADDR USDHC1_BASE_ADDR
135
136#define CONFIG_SYS_FSL_USDHC_NUM 2
137#define CONFIG_MMCROOT "/dev/mmcblk0p2" /* USDHC1 */
Ilya Ledvich38a53c62017-09-24 09:00:25 +0300138#endif
139
140/* USB Configs */
141#define CONFIG_EHCI_HCD_INIT_AFTER_RESET
142#define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
143#define CONFIG_MXC_USB_FLAGS 0
144#define CONFIG_USB_MAX_CONTROLLER_COUNT 2
145
146/* Uncomment to enable iMX thermal driver support */
147/*#define CONFIG_IMX_THERMAL*/
148
149/* SPL */
150#include "imx7_spl.h"
Ilya Ledvich38a53c62017-09-24 09:00:25 +0300151
152#endif /* __CONFIG_H */