blob: 2d9f8bb510b87c410d1ce82631c01a26e829bbb9 [file] [log] [blame]
Ilko Ilieve2480f12021-04-16 15:48:13 +02001/* SPDX-License-Identifier: GPL-2.0+ */
2/*
3 * Copyright (C) 2021 Ronetix GmbH
4 *
5 * Configuration settings for the Ronetix's iMX7-CM System-on-Module.
6 */
7
8#ifndef __IMX7_CM_CONFIG_H
9#define __IMX7_CM_CONFIG_H
10
11#include "mx7_common.h"
12
13#define CONFIG_MXC_UART_BASE UART1_IPS_BASE_ADDR
14
Ilko Ilieve2480f12021-04-16 15:48:13 +020015#undef CONFIG_SYS_AUTOLOAD
16#undef CONFIG_EXTRA_ENV_SETTINGS
Ilko Ilieve2480f12021-04-16 15:48:13 +020017
18/*
19 * Use:
Wolfgang Denk62fb2b42021-09-27 17:42:39 +020020 * boot-mode=mix
21 * boot-mode=sd
22 * boot-mode=net
Ilko Ilieve2480f12021-04-16 15:48:13 +020023 */
24#define MY_CONFIG_BOOT_MODE "boot-mode=sd\0"
25
26#define CONFIG_EXTRA_ENV_SETTINGS \
27 MY_CONFIG_BOOT_MODE \
28 "image=zImage\0" \
29 "console=ttymxc0\0" \
30 "fdt_file=imx7-cm.dtb\0" \
31 "fdt_addr=0x83000000\0" \
32 "mmcdev="__stringify(CONFIG_SYS_MMC_ENV_DEV)"\0" \
Tom Rinib113bca2021-12-11 14:55:52 -050033 "mmcpart=1\0" \
Peng Fanbb4bb582022-04-15 12:23:41 +080034 "mmcroot=/dev/mmcblk0p2 rootwait rw\0" \
Ilko Ilieve2480f12021-04-16 15:48:13 +020035 "mmcargs=setenv bootargs console=${console},${baudrate} " \
36 "root=${mmcroot}\0" \
37 "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
38 "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
39 \
40 "bootsd=" \
41 "echo Booting from SD card ...; " \
42 "run mmcargs; " \
43 "mmc dev ${mmcdev};" \
44 "run loadimage; " \
45 "run loadfdt; " \
46 "bootz ${loadaddr} - ${fdt_addr}; " \
47 "\0" \
48 \
49 "bootmix=" \
50 "echo Boot Kernel and FDT from TFTP, RootFs from SD card ...; " \
51 "run mmcargs; " \
52 "mmc dev ${mmcdev};" \
53 "tftp ${fdt_addr} ${fdt_file}; " \
54 "tftp ${image}; " \
55 "bootz ${loadaddr} - ${fdt_addr}; " \
56 "\0" \
57 \
58 "netargs=setenv bootargs console=${console},${baudrate} " \
59 "root=/dev/nfs " \
60 "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp" \
61 "\0" \
62 "bootnet=" \
63 "echo Booting from net ...; " \
64 "run netargs; " \
65 "tftp ${image}; " \
66 "tftp ${fdt_addr} ${fdt_file}; " \
67 "bootz ${loadaddr} - ${fdt_addr}; " \
68 "\0"
69
Ilko Ilieve2480f12021-04-16 15:48:13 +020070/* Physical Memory Map */
71#define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
72
73#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
74#define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
75#define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
76
77#define CONFIG_SYS_INIT_SP_OFFSET \
78 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
79#define CONFIG_SYS_INIT_SP_ADDR \
80 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
81
82/* MMC Config*/
83#define CONFIG_SYS_FSL_ESDHC_ADDR USDHC1_BASE_ADDR
84#define CONFIG_SYS_FSL_USDHC_NUM 2
85
Ilko Ilieve2480f12021-04-16 15:48:13 +020086
87/* USB Configs */
88#define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
89
90#define CONFIG_USBD_HS
91
92/* SPL */
93#include "imx7_spl.h"
94
95#endif /* __CONFIG_H */