blob: fdc84297c6232231fa47db72953ffbb6fd7a609e [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
Ilya Ledvich38a53c62017-09-24 09:00:25 +030015/* Network */
Ilya Ledvich38a53c62017-09-24 09:00:25 +030016#define CONFIG_FEC_XCV_TYPE RGMII
17#define CONFIG_ETHPRIME "FEC"
18#define CONFIG_FEC_MXC_PHYADDR 0
19
Ilya Ledvich38a53c62017-09-24 09:00:25 +030020/* ENET1 */
21#define IMX_FEC_BASE ENET_IPS_BASE_ADDR
22
23/* PMIC */
Ilya Ledvich38a53c62017-09-24 09:00:25 +030024#define CONFIG_POWER_PFUZE3000
25#define CONFIG_POWER_PFUZE3000_I2C_ADDR 0x08
26
Ilya Ledvich38a53c62017-09-24 09:00:25 +030027#define CONFIG_PCA953X
Ilya Ledvich38a53c62017-09-24 09:00:25 +030028#define CONFIG_SYS_I2C_PCA953X_ADDR 0x20
29#define CONFIG_SYS_I2C_PCA953X_WIDTH { {0x20, 16} }
30
31#undef CONFIG_SYS_AUTOLOAD
32#undef CONFIG_EXTRA_ENV_SETTINGS
33#undef CONFIG_BOOTCOMMAND
Ilya Ledvich38a53c62017-09-24 09:00:25 +030034
Ilya Ledvich38a53c62017-09-24 09:00:25 +030035#define CONFIG_SYS_AUTOLOAD "no"
36
37#define CONFIG_EXTRA_ENV_SETTINGS \
38 "autoload=off\0" \
39 "script=boot.scr\0" \
40 "loadscript=load ${storagetype} ${storagedev} ${loadaddr} ${script};\0" \
41 "loadkernel=load ${storagetype} ${storagedev} ${loadaddr} ${kernel};\0" \
42 "loadfdt=load ${storagetype} ${storagedev} ${fdtaddr} ${fdtfile};\0" \
43 "bootscript=echo Running bootscript from ${storagetype} ...; source ${loadaddr};\0" \
44 "storagebootcmd=echo Booting from ${storagetype} ...; run ${storagetype}args; run doboot;\0" \
45 "kernel=zImage\0" \
46 "console=ttymxc0\0" \
47 "fdt_high=0xffffffff\0" \
48 "initrd_high=0xffffffff\0" \
49 "fdtfile=imx7d-sbc-imx7.dtb\0" \
50 "fdtaddr=0x83000000\0" \
51 "mmcdev_def="__stringify(CONFIG_SYS_MMC_DEV)"\0" \
52 "usbdev_def="__stringify(CONFIG_SYS_USB_DEV)"\0" \
53 "mmcpart=" __stringify(CONFIG_SYS_MMC_IMG_LOAD_PART) "\0" \
54 "usbpart=" __stringify(CONFIG_SYS_USB_IMG_LOAD_PART) "\0" \
55 "doboot=bootz ${loadaddr} - ${fdtaddr}\0" \
56 "mmc_config=mmc dev ${mmcdev}; mmc rescan\0" \
57 "mmcargs=setenv bootargs console=${console},${baudrate} " \
58 "root=/dev/mmcblk${mmcblk}p2 rootwait rw\0" \
59 "mmcbootscript=" \
60 "if run mmc_config; then " \
61 "setenv storagetype mmc;" \
62 "setenv storagedev ${mmcdev}:${mmcpart};" \
63 "if run loadscript; then " \
64 "run bootscript; " \
65 "fi; " \
66 "fi;\0" \
67 "mmcboot=" \
68 "if run mmc_config; then " \
69 "setenv storagetype mmc;" \
70 "setenv storagedev ${mmcdev}:${mmcpart};" \
71 "if run loadkernel; then " \
72 "if run loadfdt; then " \
73 "run storagebootcmd;" \
74 "fi; " \
75 "fi; " \
76 "fi;\0" \
77 "sdbootscript=setenv mmcdev ${mmcdev_def}; setenv mmcblk 0; " \
78 "run mmcbootscript\0" \
79 "usbbootscript=setenv usbdev ${usbdev_def}; " \
80 "setenv storagetype usb;" \
81 "setenv storagedev ${usbdev}:${usbpart};" \
82 "if run loadscript; then " \
83 "run bootscript; " \
84 "fi; " \
85 "sdboot=setenv mmcdev ${mmcdev_def}; setenv mmcblk 0; run mmcboot\0" \
86 "emmcbootscript=setenv mmcdev 1; setenv mmcblk 2; run mmcbootscript\0" \
87 "emmcboot=setenv mmcdev 1; setenv mmcblk 2; run mmcboot\0" \
88
89#define CONFIG_BOOTCOMMAND \
90 "echo SD boot attempt ...; run sdbootscript; run sdboot; " \
91 "echo eMMC boot attempt ...; run emmcbootscript; run emmcboot; " \
92 "echo USB boot attempt ...; run usbbootscript; "
93
Ilya Ledvich38a53c62017-09-24 09:00:25 +030094/* Physical Memory Map */
Ilya Ledvich38a53c62017-09-24 09:00:25 +030095#define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
96
97#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
98#define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
99#define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
100
101#define CONFIG_SYS_INIT_SP_OFFSET \
102 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
103#define CONFIG_SYS_INIT_SP_ADDR \
104 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
105
106/* SPI Flash support */
Ilya Ledvich38a53c62017-09-24 09:00:25 +0300107
108/* FLASH and environment organization */
Ilya Ledvich38a53c62017-09-24 09:00:25 +0300109
110/* MMC Config*/
Ilya Ledvich38a53c62017-09-24 09:00:25 +0300111#ifdef CONFIG_FSL_USDHC
112#define CONFIG_SYS_FSL_ESDHC_ADDR USDHC1_BASE_ADDR
113
114#define CONFIG_SYS_FSL_USDHC_NUM 2
115#define CONFIG_MMCROOT "/dev/mmcblk0p2" /* USDHC1 */
Ilya Ledvich38a53c62017-09-24 09:00:25 +0300116#endif
117
118/* USB Configs */
119#define CONFIG_EHCI_HCD_INIT_AFTER_RESET
120#define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
121#define CONFIG_MXC_USB_FLAGS 0
122#define CONFIG_USB_MAX_CONTROLLER_COUNT 2
123
Ilya Ledvich38a53c62017-09-24 09:00:25 +0300124/* SPL */
125#include "imx7_spl.h"
Ilya Ledvich38a53c62017-09-24 09:00:25 +0300126
127#endif /* __CONFIG_H */