Merge tag 'efi-2019-07-rc5-3' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi
[platform/kernel/u-boot.git] / include / configs / apalis-tk1.h
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * Copyright (c) 2017 Toradex, Inc.
4  *
5  * Configuration settings for the Toradex Apalis TK1 modules.
6  */
7
8 #ifndef __CONFIG_H
9 #define __CONFIG_H
10
11 #include <linux/sizes.h>
12
13 #include "tegra124-common.h"
14
15 #define CONFIG_ARCH_MISC_INIT
16
17 /* Board-specific serial config */
18 #define CONFIG_TEGRA_ENABLE_UARTA
19 #define CONFIG_SYS_NS16550_COM1         NV_PA_APB_UARTA_BASE
20
21 /* Environment in eMMC, before config block at the end of 1st "boot sector" */
22 #define CONFIG_ENV_OFFSET               (-CONFIG_ENV_SIZE + \
23                                          CONFIG_TDX_CFG_BLOCK_OFFSET)
24 #define CONFIG_SYS_MMC_ENV_DEV          0
25 #define CONFIG_SYS_MMC_ENV_PART         1
26
27 /* PCI host support */
28 #undef CONFIG_PCI_SCAN_SHOW
29
30 /* PCI networking support */
31 #define CONFIG_E1000_NO_NVM
32
33 /* General networking support */
34 #define CONFIG_TFTP_TSIZE
35
36 #undef CONFIG_IPADDR
37 #define CONFIG_IPADDR           192.168.10.2
38 #define CONFIG_NETMASK          255.255.255.0
39 #undef CONFIG_SERVERIP
40 #define CONFIG_SERVERIP         192.168.10.1
41
42 #define DFU_ALT_EMMC_INFO       "apalis-tk1.img raw 0x0 0x500 mmcpart 1; " \
43                                 "boot part 0 1 mmcpart 0; " \
44                                 "rootfs part 0 2 mmcpart 0; " \
45                                 "uImage fat 0 1 mmcpart 0; " \
46                                 "tegra124-apalis-eval.dtb fat 0 1 mmcpart 0"
47
48 #define EMMC_BOOTCMD \
49         "set_emmcargs=setenv emmcargs ip=off root=PARTUUID=${uuid} " \
50                 "ro rootfstype=ext4 rootwait\0" \
51         "emmcboot=run setup; run emmcfinduuid; run set_emmcargs; " \
52                 "setenv bootargs ${defargs} ${emmcargs} " \
53                 "${setupargs} ${vidargs}; echo Booting from internal eMMC; " \
54                 "run emmcdtbload; " \
55                 "load mmc ${emmcdev}:${emmcbootpart} ${kernel_addr_r} " \
56                 "${boot_file} && run fdt_fixup && " \
57                 "bootm ${kernel_addr_r} - ${dtbparam}\0" \
58         "emmcbootpart=1\0" \
59         "emmcdev=0\0" \
60         "emmcdtbload=setenv dtbparam; load mmc ${emmcdev}:${emmcbootpart} " \
61                 "${fdt_addr_r} ${soc}-apalis-${fdt_board}.dtb && " \
62                 "setenv dtbparam ${fdt_addr_r}\0" \
63         "emmcfinduuid=part uuid mmc ${mmcdev}:${emmcrootpart} uuid\0" \
64         "emmcrootpart=2\0"
65
66 #define NFS_BOOTCMD \
67         "nfsargs=ip=:::::eth0:on root=/dev/nfs rw\0" \
68         "nfsboot=pci enum; run setup; setenv bootargs ${defargs} ${nfsargs} " \
69                 "${setupargs} ${vidargs}; echo Booting via DHCP/TFTP/NFS...; " \
70                 "run nfsdtbload; dhcp ${kernel_addr_r} " \
71                 "&& run fdt_fixup && bootm ${kernel_addr_r} - ${dtbparam}\0" \
72         "nfsdtbload=setenv dtbparam; tftp ${fdt_addr_r} " \
73                 "${soc}-apalis-${fdt_board}.dtb " \
74                 "&& setenv dtbparam ${fdt_addr_r}\0"
75
76 #define SD_BOOTCMD \
77         "set_sdargs=setenv sdargs ip=off root=PARTUUID=${uuid} ro " \
78         "rootfstype=ext4 rootwait\0" \
79         "sdboot=run setup; run sdfinduuid; run set_sdargs; " \
80                 "setenv bootargs ${defargs} ${sdargs} ${setupargs} " \
81                 "${vidargs}; echo Booting from SD card in 8bit slot...; " \
82                 "run sddtbload; load mmc ${sddev}:${sdbootpart} " \
83                 "${kernel_addr_r} ${boot_file} && run fdt_fixup && " \
84                 "bootm ${kernel_addr_r} - ${dtbparam}\0" \
85         "sdbootpart=1\0" \
86         "sddev=1\0" \
87         "sddtbload=setenv dtbparam; load mmc ${sddev}:${sdbootpart} " \
88                 "${fdt_addr_r} ${soc}-apalis-${fdt_board}.dtb " \
89                 "&& setenv dtbparam ${fdt_addr_r}\0" \
90         "sdfinduuid=part uuid mmc ${sddev}:${sdrootpart} uuid\0" \
91         "sdrootpart=2\0"
92
93 #define USB_BOOTCMD \
94         "set_usbargs=setenv usbargs ip=off root=PARTUUID=${uuid} ro " \
95                 "rootfstype=ext4 rootwait\0" \
96         "usbboot=run setup; usb start; run usbfinduuid; run set_usbargs; " \
97                 "setenv bootargs ${defargs} ${setupargs} " \
98                 "${usbargs} ${vidargs}; echo Booting from USB stick...; " \
99                 "run usbdtbload; load usb ${usbdev}:${usbbootpart} " \
100                 "${kernel_addr_r} ${boot_file} && run fdt_fixup && " \
101                 "bootm ${kernel_addr_r} - ${dtbparam}\0" \
102         "usbbootpart=1\0" \
103         "usbdev=0\0" \
104         "usbdtbload=setenv dtbparam; load usb ${usbdev}:${usbbootpart} " \
105                 "${fdt_addr_r} ${soc}-apalis-${fdt_board}.dtb " \
106                 "&& setenv dtbparam ${fdt_addr_r}\0" \
107         "usbfinduuid=part uuid usb ${usbdev}:${usbrootpart} uuid\0" \
108         "usbrootpart=2\0"
109
110 #define BOARD_EXTRA_ENV_SETTINGS \
111         "boot_file=uImage\0" \
112         "console=ttyS0\0" \
113         "defargs=lp0_vec=2064@0xf46ff000 core_edp_mv=1150 core_edp_ma=4000 " \
114                 "usb_port_owner_info=2 lane_owner_info=6 emc_max_dvfs=0\0" \
115         "dfu_alt_info=" DFU_ALT_EMMC_INFO "\0" \
116         EMMC_BOOTCMD \
117         "fdt_board=eval\0" \
118         "fdt_fixup=;\0" \
119         NFS_BOOTCMD \
120         SD_BOOTCMD \
121         USB_BOOTCMD \
122         "setethupdate=if env exists ethaddr; then; else setenv ethaddr " \
123                 "00:14:2d:00:00:00; fi; pci enum && tftpboot ${loadaddr} " \
124                 "flash_eth.img && source ${loadaddr}\0" \
125         "setsdupdate=setenv interface mmc; setenv drive 1; mmc rescan; " \
126                 "load ${interface} ${drive}:1 ${loadaddr} flash_blk.img " \
127                 "|| setenv drive 2; mmc rescan; load ${interface} ${drive}:1 " \
128                 "${loadaddr} flash_blk.img && " \
129                 "source ${loadaddr}\0" \
130         "setup=setenv setupargs igb_mac=${ethaddr} " \
131                 "consoleblank=0 no_console_suspend=1 console=tty1 " \
132                 "console=${console},${baudrate}n8 debug_uartport=lsport,0 " \
133                 "${memargs}\0" \
134         "setupdate=run setsdupdate || run setusbupdate || run setethupdate\0" \
135         "setusbupdate=usb start && setenv interface usb; setenv drive 0; " \
136                 "load ${interface} ${drive}:1 ${loadaddr} flash_blk.img && " \
137                 "source ${loadaddr}\0" \
138         USB_BOOTCMD \
139         "vidargs=video=tegrafb0:640x480-16@60 fbcon=map:1\0"
140
141 /* Increase console I/O buffer size */
142 #undef CONFIG_SYS_CBSIZE
143 #define CONFIG_SYS_CBSIZE               1024
144
145 /* Increase arguments buffer size */
146 #undef CONFIG_SYS_BARGSIZE
147 #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
148
149 /* Increase maximum number of arguments */
150 #undef CONFIG_SYS_MAXARGS
151 #define CONFIG_SYS_MAXARGS              32
152
153 #define CONFIG_CMD_TIME
154
155 #define CONFIG_SYS_BOOT_RAMDISK_HIGH
156
157 #include "tegra-common-usb-gadget.h"
158 #include "tegra-common-post.h"
159
160 /* Reserve top 1M for secure RAM */
161 #define CONFIG_ARMV7_SECURE_BASE                0xfff00000
162 #define CONFIG_ARMV7_SECURE_RESERVE_SIZE        0x00100000
163
164 #endif /* __CONFIG_H */