]>
Commit | Line | Data |
---|---|---|
1 | /* 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 | #define CONFIG_ETHPRIME "FEC" | |
16 | ||
17 | #undef CONFIG_SYS_AUTOLOAD | |
18 | #undef CONFIG_EXTRA_ENV_SETTINGS | |
19 | #undef CONFIG_BOOTCOMMAND | |
20 | ||
21 | /* | |
22 | * Use: | |
23 | * boot-mode=mix | |
24 | * boot-mode=sd | |
25 | * boot-mode=net | |
26 | */ | |
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 | ||
75 | #define CONFIG_SYS_HZ 1000 | |
76 | ||
77 | /* Physical Memory Map */ | |
78 | #define PHYS_SDRAM MMDC0_ARB_BASE_ADDR | |
79 | ||
80 | #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM | |
81 | #define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR | |
82 | #define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE | |
83 | ||
84 | #define CONFIG_SYS_INIT_SP_OFFSET \ | |
85 | (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE) | |
86 | #define CONFIG_SYS_INIT_SP_ADDR \ | |
87 | (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET) | |
88 | ||
89 | /* MMC Config*/ | |
90 | #define CONFIG_SYS_FSL_ESDHC_ADDR USDHC1_BASE_ADDR | |
91 | #define CONFIG_SYS_FSL_USDHC_NUM 2 | |
92 | ||
93 | #define CONFIG_SYS_MMC_ENV_DEV 0 /* USDHC1 */ | |
94 | #define CONFIG_SYS_MMC_ENV_PART 0 /* user area */ | |
95 | #define CONFIG_SYS_MMC_IMG_LOAD_PART 1 | |
96 | #define CONFIG_MMCROOT "/dev/mmcblk0p2" /* USDHC1 */ | |
97 | ||
98 | /* USB Configs */ | |
99 | #define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW) | |
100 | ||
101 | #define CONFIG_USBD_HS | |
102 | ||
103 | /* SPL */ | |
104 | #include "imx7_spl.h" | |
105 | ||
106 | #endif /* __CONFIG_H */ |