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