Merge https://gitlab.denx.de/u-boot/custodians/u-boot-spi into next
[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_SYS_MMC_ENV_DEV          0       /* USDHC1 */
18 #define CONFIG_SYS_MMC_ENV_PART         0       /* user area */
19 #define CONFIG_MMCROOT                  "/dev/mmcblk0p2"  /* USDHC1 */
20 #define CONFIG_SYS_MMC_IMG_LOAD_PART    1
21
22 /* Using ULP WDOG for reset */
23 #define WDOG_BASE_ADDR                  WDG1_RBASE
24
25 #define CONFIG_SYS_HZ_CLOCK             1000000 /* Fixed at 1Mhz from TSTMR */
26
27 #define CONFIG_INITRD_TAG
28 #define CONFIG_CMDLINE_TAG
29 #define CONFIG_SETUP_MEMORY_TAGS
30 /*#define CONFIG_REVISION_TAG*/
31
32 /* Size of malloc() pool */
33 #define CONFIG_SYS_MALLOC_LEN           (8 * SZ_1M)
34
35 #define CONFIG_BOARD_EARLY_INIT_F
36
37 /* UART */
38 #define LPUART_BASE                     LPUART4_RBASE
39
40 /* allow to overwrite serial and ethaddr */
41 #define CONFIG_ENV_OVERWRITE
42 #define CONFIG_BAUDRATE                 115200
43
44 #define CONFIG_SYS_CACHELINE_SIZE      64
45
46 /* Miscellaneous configurable options */
47 #define CONFIG_SYS_PROMPT               "=> "
48 #define CONFIG_SYS_CBSIZE               512
49
50 #define CONFIG_SYS_MAXARGS              256
51
52 /* Physical Memory Map */
53
54 #define PHYS_SDRAM                      0x60000000
55 #define PHYS_SDRAM_SIZE                 SZ_1G
56 #define CONFIG_SYS_SDRAM_BASE           PHYS_SDRAM
57
58 #define CONFIG_LOADADDR             0x60800000
59
60 #define CONFIG_EXTRA_ENV_SETTINGS \
61         "script=boot.scr\0" \
62         "image=zImage\0" \
63         "console=ttyLP0\0" \
64         "fdt_high=0xffffffff\0" \
65         "initrd_high=0xffffffff\0" \
66         "fdt_file=imx7ulp-evk.dtb\0" \
67         "fdt_addr=0x63000000\0" \
68         "boot_fdt=try\0" \
69         "earlycon=lpuart32,0x402D0010\0" \
70         "ip_dyn=yes\0" \
71         "mmcdev="__stringify(CONFIG_SYS_MMC_ENV_DEV)"\0" \
72         "mmcpart=" __stringify(CONFIG_SYS_MMC_IMG_LOAD_PART) "\0" \
73         "mmcroot=" CONFIG_MMCROOT " rootwait rw\0" \
74         "mmcautodetect=yes\0" \
75         "mmcargs=setenv bootargs console=${console},${baudrate} " \
76                 "root=${mmcroot}\0" \
77         "loadbootscript=" \
78                 "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
79         "bootscript=echo Running bootscript from mmc ...; " \
80                 "source\0" \
81         "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
82         "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
83         "mmcboot=echo Booting from mmc ...; " \
84                 "run mmcargs; " \
85                 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
86                         "if run loadfdt; then " \
87                                 "bootz ${loadaddr} - ${fdt_addr}; " \
88                         "else " \
89                                 "if test ${boot_fdt} = try; then " \
90                                         "bootz; " \
91                                 "else " \
92                                         "echo WARN: Cannot load the DT; " \
93                                 "fi; " \
94                         "fi; " \
95                 "else " \
96                         "bootz; " \
97                 "fi;\0" \
98         "netargs=setenv bootargs console=${console},${baudrate} " \
99                 "root=/dev/nfs " \
100                 "ip=:::::eth0:dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
101         "netboot=echo Booting from net ...; " \
102                 "run netargs; " \
103                 "if test ${ip_dyn} = yes; then " \
104                         "setenv get_cmd dhcp; " \
105                 "else " \
106                         "setenv get_cmd tftp; " \
107                 "fi; " \
108                 "usb start; "\
109                 "${get_cmd} ${image}; " \
110                 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
111                         "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
112                                 "bootz ${loadaddr} - ${fdt_addr}; " \
113                         "else " \
114                                 "if test ${boot_fdt} = try; then " \
115                                         "bootz; " \
116                                 "else " \
117                                         "echo WARN: Cannot load the DT; " \
118                                 "fi; " \
119                         "fi; " \
120                 "else " \
121                         "bootz; " \
122                 "fi;\0" \
123
124 #define CONFIG_BOOTCOMMAND \
125            "mmc dev ${mmcdev}; if mmc rescan; then " \
126                    "if run loadbootscript; then " \
127                            "run bootscript; " \
128                    "else " \
129                            "if run loadimage; then " \
130                                    "run mmcboot; " \
131                            "fi; " \
132                    "fi; " \
133            "fi"
134
135 #define CONFIG_SYS_HZ                   1000
136 #define CONFIG_SYS_LOAD_ADDR            CONFIG_LOADADDR
137
138 #define CONFIG_SYS_INIT_RAM_ADDR        IRAM_BASE_ADDR
139 #define CONFIG_SYS_INIT_RAM_SIZE        SZ_256K
140
141 #define CONFIG_SYS_INIT_SP_OFFSET \
142         (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
143 #define CONFIG_SYS_INIT_SP_ADDR \
144         (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
145
146 #endif  /* __CONFIG_H */