blob: 01f8732929225502ef14393cac21cf331222ef6f [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#define CONFIG_ETHPRIME "FEC"
16
17#undef CONFIG_SYS_AUTOLOAD
18#undef CONFIG_EXTRA_ENV_SETTINGS
19#undef CONFIG_BOOTCOMMAND
20
21/*
22 * Use:
Wolfgang Denk62fb2b42021-09-27 17:42:39 +020023 * boot-mode=mix
24 * boot-mode=sd
25 * boot-mode=net
Ilko Ilieve2480f12021-04-16 15:48:13 +020026 */
27#define MY_CONFIG_BOOT_MODE "boot-mode=sd\0"
28
29#define CONFIG_EXTRA_ENV_SETTINGS \
30 MY_CONFIG_BOOT_MODE \
31 "image=zImage\0" \
32 "console=ttymxc0\0" \
33 "fdt_file=imx7-cm.dtb\0" \
34 "fdt_addr=0x83000000\0" \
35 "mmcdev="__stringify(CONFIG_SYS_MMC_ENV_DEV)"\0" \
36 "mmcpart=" __stringify(CONFIG_SYS_MMC_IMG_LOAD_PART) "\0" \
37 "mmcroot=" CONFIG_MMCROOT " rootwait rw\0" \
38 "mmcargs=setenv bootargs console=${console},${baudrate} " \
39 "root=${mmcroot}\0" \
40 "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
41 "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
42 \
43 "bootsd=" \
44 "echo Booting from SD card ...; " \
45 "run mmcargs; " \
46 "mmc dev ${mmcdev};" \
47 "run loadimage; " \
48 "run loadfdt; " \
49 "bootz ${loadaddr} - ${fdt_addr}; " \
50 "\0" \
51 \
52 "bootmix=" \
53 "echo Boot Kernel and FDT from TFTP, RootFs from SD card ...; " \
54 "run mmcargs; " \
55 "mmc dev ${mmcdev};" \
56 "tftp ${fdt_addr} ${fdt_file}; " \
57 "tftp ${image}; " \
58 "bootz ${loadaddr} - ${fdt_addr}; " \
59 "\0" \
60 \
61 "netargs=setenv bootargs console=${console},${baudrate} " \
62 "root=/dev/nfs " \
63 "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp" \
64 "\0" \
65 "bootnet=" \
66 "echo Booting from net ...; " \
67 "run netargs; " \
68 "tftp ${image}; " \
69 "tftp ${fdt_addr} ${fdt_file}; " \
70 "bootz ${loadaddr} - ${fdt_addr}; " \
71 "\0"
72
73#define CONFIG_BOOTCOMMAND "run boot${boot-mode}"
74
Ilko Ilieve2480f12021-04-16 15:48:13 +020075/* Physical Memory Map */
76#define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
77
78#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
79#define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
80#define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
81
82#define CONFIG_SYS_INIT_SP_OFFSET \
83 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
84#define CONFIG_SYS_INIT_SP_ADDR \
85 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
86
87/* MMC Config*/
88#define CONFIG_SYS_FSL_ESDHC_ADDR USDHC1_BASE_ADDR
89#define CONFIG_SYS_FSL_USDHC_NUM 2
90
Ilko Ilieve2480f12021-04-16 15:48:13 +020091#define CONFIG_SYS_MMC_IMG_LOAD_PART 1
92#define CONFIG_MMCROOT "/dev/mmcblk0p2" /* USDHC1 */
93
94/* USB Configs */
95#define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
96
97#define CONFIG_USBD_HS
98
99/* SPL */
100#include "imx7_spl.h"
101
102#endif /* __CONFIG_H */