Merge branch '2021-11-12-Kconfig-migrations'
[platform/kernel/u-boot.git] / include / configs / mx7ulp_evk.h
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * Copyright (C) 2016 Freescale Semiconductor, Inc.
4  *
5  * Configuration settings for the Freescale i.MX7ULP EVK board.
6  */
7
8 #ifndef __MX7ULP_EVK_CONFIG_H
9 #define __MX7ULP_EVK_CONFIG_H
10
11 #include <linux/sizes.h>
12 #include <asm/arch/imx-regs.h>
13
14 #define CONFIG_BOARD_POSTCLK_INIT
15 #define CONFIG_SYS_BOOTM_LEN            0x1000000
16
17 #define CONFIG_MMCROOT                  "/dev/mmcblk0p2"  /* USDHC1 */
18 #define CONFIG_SYS_MMC_IMG_LOAD_PART    1
19
20 /* Using ULP WDOG for reset */
21 #define WDOG_BASE_ADDR                  WDG1_RBASE
22
23 #define CONFIG_SYS_HZ_CLOCK             1000000 /* Fixed at 1Mhz from TSTMR */
24
25 /* UART */
26 #define LPUART_BASE                     LPUART4_RBASE
27
28 /* Miscellaneous configurable options */
29 #define CONFIG_SYS_CBSIZE               512
30
31 #define CONFIG_SYS_MAXARGS              256
32
33 /* Physical Memory Map */
34
35 #define PHYS_SDRAM                      0x60000000
36 #define PHYS_SDRAM_SIZE                 SZ_1G
37 #define CONFIG_SYS_SDRAM_BASE           PHYS_SDRAM
38
39 #define CONFIG_EXTRA_ENV_SETTINGS \
40         "script=boot.scr\0" \
41         "image=zImage\0" \
42         "console=ttyLP0\0" \
43         "fdt_high=0xffffffff\0" \
44         "initrd_high=0xffffffff\0" \
45         "fdt_file=imx7ulp-evk.dtb\0" \
46         "fdt_addr=0x63000000\0" \
47         "boot_fdt=try\0" \
48         "earlycon=lpuart32,0x402D0010\0" \
49         "ip_dyn=yes\0" \
50         "mmcdev="__stringify(CONFIG_SYS_MMC_ENV_DEV)"\0" \
51         "mmcpart=" __stringify(CONFIG_SYS_MMC_IMG_LOAD_PART) "\0" \
52         "mmcroot=" CONFIG_MMCROOT " rootwait rw\0" \
53         "mmcautodetect=yes\0" \
54         "mmcargs=setenv bootargs console=${console},${baudrate} " \
55                 "root=${mmcroot}\0" \
56         "loadbootscript=" \
57                 "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
58         "bootscript=echo Running bootscript from mmc ...; " \
59                 "source\0" \
60         "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
61         "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
62         "mmcboot=echo Booting from mmc ...; " \
63                 "run mmcargs; " \
64                 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
65                         "if run loadfdt; then " \
66                                 "bootz ${loadaddr} - ${fdt_addr}; " \
67                         "else " \
68                                 "if test ${boot_fdt} = try; then " \
69                                         "bootz; " \
70                                 "else " \
71                                         "echo WARN: Cannot load the DT; " \
72                                 "fi; " \
73                         "fi; " \
74                 "else " \
75                         "bootz; " \
76                 "fi;\0" \
77         "netargs=setenv bootargs console=${console},${baudrate} " \
78                 "root=/dev/nfs " \
79                 "ip=:::::eth0:dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
80         "netboot=echo Booting from net ...; " \
81                 "run netargs; " \
82                 "if test ${ip_dyn} = yes; then " \
83                         "setenv get_cmd dhcp; " \
84                 "else " \
85                         "setenv get_cmd tftp; " \
86                 "fi; " \
87                 "usb start; "\
88                 "${get_cmd} ${image}; " \
89                 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
90                         "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
91                                 "bootz ${loadaddr} - ${fdt_addr}; " \
92                         "else " \
93                                 "if test ${boot_fdt} = try; then " \
94                                         "bootz; " \
95                                 "else " \
96                                         "echo WARN: Cannot load the DT; " \
97                                 "fi; " \
98                         "fi; " \
99                 "else " \
100                         "bootz; " \
101                 "fi;\0" \
102
103 #define CONFIG_BOOTCOMMAND \
104            "mmc dev ${mmcdev}; if mmc rescan; then " \
105                    "if run loadbootscript; then " \
106                            "run bootscript; " \
107                    "else " \
108                            "if run loadimage; then " \
109                                    "run mmcboot; " \
110                            "fi; " \
111                    "fi; " \
112            "fi"
113
114 #define CONFIG_SYS_INIT_RAM_ADDR        IRAM_BASE_ADDR
115 #define CONFIG_SYS_INIT_RAM_SIZE        SZ_256K
116
117 #define CONFIG_SYS_INIT_SP_OFFSET \
118         (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
119 #define CONFIG_SYS_INIT_SP_ADDR \
120         (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
121
122 #endif  /* __CONFIG_H */