global: Convert CONFIG_LOADADDR to CONFIG_SYS_LOADADDR
[platform/kernel/u-boot.git] / include / configs / apalis_imx6.h
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * Copyright 2013-2019 Toradex, Inc.
4  *
5  * Configuration settings for the Toradex Apalis iMX6
6  */
7
8 #ifndef __CONFIG_H
9 #define __CONFIG_H
10
11 #include <linux/stringify.h>
12
13 #include "mx6_common.h"
14
15 #undef CONFIG_DISPLAY_BOARDINFO
16
17 #define CONFIG_MACH_TYPE                4886
18
19 #include <asm/arch/imx-regs.h>
20 #include <asm/mach-imx/gpio.h>
21
22 #ifdef CONFIG_SPL
23 #include "imx6_spl.h"
24 #endif
25
26 #define CONFIG_CMDLINE_TAG
27 #define CONFIG_SETUP_MEMORY_TAGS
28 #define CONFIG_INITRD_TAG
29 #define CONFIG_REVISION_TAG
30 #define CONFIG_SERIAL_TAG
31
32 /* Size of malloc() pool */
33 #define CONFIG_SYS_MALLOC_LEN           (32 * 1024 * 1024)
34
35 #define CONFIG_MXC_UART_BASE            UART1_BASE
36
37 /* MMC Configs */
38 #define CONFIG_SYS_FSL_ESDHC_ADDR       0
39 #define CONFIG_SYS_FSL_USDHC_NUM        3
40
41 /*
42  * SATA Configs
43  */
44 #ifdef CONFIG_CMD_SATA
45 #define CONFIG_LBA48
46 #endif
47
48 /* Network */
49 #define PHY_ANEG_TIMEOUT                15000 /* PHY needs longer aneg time */
50
51 /* USB Configs */
52 /* Host */
53 #define CONFIG_USB_MAX_CONTROLLER_COUNT         2
54 #define CONFIG_EHCI_HCD_INIT_AFTER_RESET        /* For OTG port */
55 #define CONFIG_MXC_USB_PORTSC           (PORT_PTS_UTMI | PORT_PTS_PTW)
56 #define CONFIG_MXC_USB_FLAGS            0
57 /* Client */
58 #define CONFIG_USBD_HS
59
60 /* Framebuffer and LCD */
61 #define CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE
62 #define CONFIG_VIDEO_LOGO
63 #define CONFIG_VIDEO_BMP_LOGO
64 #define CONFIG_IMX_HDMI
65 #define CONFIG_IMX_VIDEO_SKIP
66
67 /* Command definition */
68
69 #undef CONFIG_IPADDR
70 #define CONFIG_IPADDR                   192.168.10.2
71 #define CONFIG_NETMASK                  255.255.255.0
72 #undef CONFIG_SERVERIP
73 #define CONFIG_SERVERIP                 192.168.10.1
74 #define CONFIG_SYS_LOAD_ADDR                    0x12000000
75
76 #ifndef CONFIG_SPL_BUILD
77 #define BOOT_TARGET_DEVICES(func) \
78         func(MMC, mmc, 1) \
79         func(MMC, mmc, 2) \
80         func(MMC, mmc, 0) \
81         func(USB, usb, 0) \
82         func(DHCP, dhcp, na)
83 #include <config_distro_bootcmd.h>
84 #undef BOOTENV_RUN_NET_USB_START
85 #define BOOTENV_RUN_NET_USB_START ""
86 #else /* CONFIG_SPL_BUILD */
87 #define BOOTENV
88 #endif /* CONFIG_SPL_BUILD */
89
90 #define UBOOT_UPDATE \
91         "uboot_hwpart=1\0" \
92         "uboot_blk=8a\0" \
93         "uboot_spl_blk=2\0" \
94         "set_blkcnt=setexpr blkcnt ${filesize} + 0x1ff && " \
95                 "setexpr blkcnt ${blkcnt} / 0x200\0" \
96         "update_uboot=run set_blkcnt && mmc dev 0 ${uboot_hwpart} && " \
97                 "mmc write ${loadaddr} ${uboot_blk} ${blkcnt}\0" \
98         "update_spl=run set_blkcnt && mmc dev 0 ${uboot_hwpart} && " \
99                 "mmc write ${loadaddr} ${uboot_spl_blk} ${blkcnt}\0"
100
101 #define MEM_LAYOUT_ENV_SETTINGS \
102         "bootm_size=0x20000000\0" \
103         "fdt_addr_r=0x12100000\0" \
104         "kernel_addr_r=0x11000000\0" \
105         "pxefile_addr_r=0x17100000\0" \
106         "ramdisk_addr_r=0x12200000\0" \
107         "scriptaddr=0x17000000\0"
108
109 #define NFS_BOOTCMD \
110         "nfsargs=ip=:::::eth0:on root=/dev/nfs ro\0" \
111         "nfsboot=run setup; " \
112                 "setenv bootargs ${defargs} ${nfsargs} ${setupargs} " \
113                 "${vidargs}; echo Booting via DHCP/TFTP/NFS...; " \
114                 "run nfsdtbload; dhcp ${kernel_addr_r} " \
115                 "&& run fdt_fixup && bootz ${kernel_addr_r} ${dtbparam}\0" \
116         "nfsdtbload=setenv dtbparam; tftp ${fdt_addr_r} ${fdt_file} " \
117                 "&& setenv dtbparam \" - ${fdt_addr_r}\" && true\0"
118
119 #ifndef CONFIG_TDX_APALIS_IMX6_V1_0
120 #define FDT_FILE "imx6q-apalis-eval.dtb"
121 #define FDT_FILE_V1_0 "imx6q-apalis_v1_0-eval.dtb"
122 #else
123 #define FDT_FILE "imx6q-apalis_v1_0-eval.dtb"
124 #endif
125 #define CONFIG_EXTRA_ENV_SETTINGS \
126         BOOTENV \
127         "bootcmd=run distro_bootcmd ; " \
128                 "usb start ; " \
129                 "setenv stdout serial,vidconsole; " \
130                 "setenv stdin serial,usbkbd\0" \
131         "boot_file=zImage\0" \
132         "console=ttymxc0\0" \
133         "defargs=enable_wait_mode=off vmalloc=400M\0" \
134         "fdt_file=" FDT_FILE "\0" \
135         "fdtfile=" FDT_FILE "\0" \
136         "fdt_fixup=;\0" \
137         MEM_LAYOUT_ENV_SETTINGS \
138         NFS_BOOTCMD \
139         UBOOT_UPDATE \
140         "setethupdate=if env exists ethaddr; then; else setenv ethaddr " \
141                 "00:14:2d:00:00:00; fi; tftpboot ${loadaddr} " \
142                 "flash_eth.img && source ${loadaddr}\0" \
143         "setsdupdate=setenv interface mmc; setenv drive 1; mmc rescan; " \
144                 "load ${interface} ${drive}:1 ${loadaddr} flash_blk.img " \
145                 "|| setenv drive 2; mmc rescan; load ${interface} ${drive}:1" \
146                 " ${loadaddr} flash_blk.img && " \
147                 "source ${loadaddr}\0" \
148         "setup=setenv setupargs fec_mac=${ethaddr} " \
149                 "consoleblank=0 no_console_suspend=1 console=tty1 " \
150                 "console=${console},${baudrate}n8\0 " \
151         "setupdate=run setsdupdate || run setusbupdate || run setethupdate\0" \
152         "setusbupdate=usb start && setenv interface usb; setenv drive 0; " \
153                 "load ${interface} ${drive}:1 ${loadaddr} flash_blk.img && " \
154                 "source ${loadaddr}\0" \
155         "splashpos=m,m\0" \
156         "splashimage=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
157         "vidargs=mxc_hdmi.only_cea=1 fbmem=32M\0"
158
159 /* Miscellaneous configurable options */
160 #undef CONFIG_SYS_CBSIZE
161 #define CONFIG_SYS_CBSIZE               1024
162 #undef CONFIG_SYS_MAXARGS
163 #define CONFIG_SYS_MAXARGS              48
164
165 /* Physical Memory Map */
166 #define PHYS_SDRAM                      MMDC0_ARB_BASE_ADDR
167
168 #define CONFIG_SYS_SDRAM_BASE           PHYS_SDRAM
169 #define CONFIG_SYS_INIT_RAM_ADDR        IRAM_BASE_ADDR
170 #define CONFIG_SYS_INIT_RAM_SIZE        IRAM_SIZE
171
172 #define CONFIG_SYS_INIT_SP_OFFSET \
173         (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
174 #define CONFIG_SYS_INIT_SP_ADDR \
175         (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
176
177 #endif  /* __CONFIG_H */