xref: /openbmc/u-boot/include/configs/apalis-tk1.h (revision d9b23e26)
1 /*
2  * Copyright (c) 2017 Toradex, Inc.
3  *
4  * Configuration settings for the Toradex Apalis TK1 modules.
5  *
6  * SPDX-License-Identifier:	GPL-2.0+
7  */
8 
9 #ifndef __CONFIG_H
10 #define __CONFIG_H
11 
12 #include <linux/sizes.h>
13 
14 #include "tegra124-common.h"
15 
16 #define CONFIG_ARCH_MISC_INIT
17 
18 /* High-level configuration options */
19 #define CONFIG_DISPLAY_BOARDINFO_LATE	/* Calls show_board_info() */
20 
21 /* Board-specific serial config */
22 #define CONFIG_TEGRA_ENABLE_UARTA
23 #define CONFIG_SYS_NS16550_COM1		NV_PA_APB_UARTA_BASE
24 
25 /* I2C */
26 #define CONFIG_SYS_I2C_TEGRA
27 
28 /* SD/MMC support */
29 #define CONFIG_SUPPORT_EMMC_BOOT	/* eMMC specific */
30 
31 /* Environment in eMMC, before config block at the end of 1st "boot sector" */
32 #define CONFIG_ENV_OFFSET		(-CONFIG_ENV_SIZE + \
33 					 CONFIG_TDX_CFG_BLOCK_OFFSET)
34 #define CONFIG_SYS_MMC_ENV_DEV		0
35 #define CONFIG_SYS_MMC_ENV_PART		1
36 
37 /* USB host support */
38 #define CONFIG_USB_EHCI_TEGRA
39 
40 /* PCI host support */
41 #undef CONFIG_PCI_SCAN_SHOW
42 
43 /* PCI networking support */
44 #define CONFIG_E1000_NO_NVM
45 
46 /* General networking support */
47 #define CONFIG_IP_DEFRAG
48 #define CONFIG_TFTP_BLOCKSIZE		16352
49 #define CONFIG_TFTP_TSIZE
50 
51 #undef CONFIG_IPADDR
52 #define CONFIG_IPADDR		192.168.10.2
53 #define CONFIG_NETMASK		255.255.255.0
54 #undef CONFIG_SERVERIP
55 #define CONFIG_SERVERIP		192.168.10.1
56 
57 #define CONFIG_BOOTCOMMAND \
58 	"run emmcboot; setenv fdtfile ${soc}-apalis-${fdt_board}.dtb && " \
59 		"run distro_bootcmd"
60 
61 #define DFU_ALT_EMMC_INFO	"apalis-tk1.img raw 0x0 0x500 mmcpart 1; " \
62 				"boot part 0 1 mmcpart 0; " \
63 				"rootfs part 0 2 mmcpart 0; " \
64 				"uImage fat 0 1 mmcpart 0; " \
65 				"tegra124-apalis-eval.dtb fat 0 1 mmcpart 0"
66 
67 #define EMMC_BOOTCMD \
68 	"emmcargs=ip=off root=/dev/mmcblk0p2 rw rootfstype=ext3 rootwait\0" \
69 	"emmcboot=run setup; setenv bootargs ${defargs} ${emmcargs} " \
70 		"${setupargs} ${vidargs}; echo Booting from internal eMMC " \
71 		"chip...; run emmcdtbload; load mmc 0:1 ${kernel_addr_r} " \
72 		"${boot_file} && run fdt_fixup && " \
73 		"bootm ${kernel_addr_r} - ${dtbparam}\0" \
74 	"emmcdtbload=setenv dtbparam; load mmc 0:1 ${fdt_addr_r} " \
75 		"${soc}-apalis-${fdt_board}.dtb && " \
76 		"setenv dtbparam ${fdt_addr_r}\0"
77 
78 #define NFS_BOOTCMD \
79 	"nfsargs=ip=:::::eth0:on root=/dev/nfs rw\0" \
80 	"nfsboot=pci enum; run setup; setenv bootargs ${defargs} ${nfsargs} " \
81 		"${setupargs} ${vidargs}; echo Booting via DHCP/TFTP/NFS...; " \
82 		"run nfsdtbload; dhcp ${kernel_addr_r} " \
83 		"&& run fdt_fixup && bootm ${kernel_addr_r} - ${dtbparam}\0" \
84 	"nfsdtbload=setenv dtbparam; tftp ${fdt_addr_r} " \
85 		"${soc}-apalis-${fdt_board}.dtb " \
86 		"&& setenv dtbparam ${fdt_addr_r}\0"
87 
88 #define SD_BOOTCMD \
89 	"sdargs=ip=off root=/dev/mmcblk1p2 rw rootfstype=ext3 rootwait\0" \
90 	"sdboot=run setup; setenv bootargs ${defargs} ${sdargs} ${setupargs} " \
91 		"${vidargs}; echo Booting from SD card in 8bit slot...; " \
92 		"run sddtbload; load mmc 1:1 ${kernel_addr_r} " \
93 		"${boot_file} && run fdt_fixup && " \
94 		"bootm ${kernel_addr_r} - ${dtbparam}\0" \
95 	"sddtbload=setenv dtbparam; load mmc 1:1 ${fdt_addr_r} " \
96 		"${soc}-apalis-${fdt_board}.dtb " \
97 		"&& setenv dtbparam ${fdt_addr_r}\0"
98 
99 #define USB_BOOTCMD \
100 	"usbargs=ip=off root=/dev/sda2 rw rootfstype=ext3 rootwait\0" \
101 	"usbboot=run setup; setenv bootargs ${defargs} ${setupargs} " \
102 		"${usbargs} ${vidargs}; echo Booting from USB stick...; " \
103 		"usb start && run usbdtbload; load usb 0:1 ${kernel_addr_r} " \
104 		"${boot_file} && run fdt_fixup && " \
105 		"bootm ${kernel_addr_r} - ${dtbparam}\0" \
106 	"usbdtbload=setenv dtbparam; load usb 0:1 ${fdt_addr_r} " \
107 		"${soc}-apalis-${fdt_board}.dtb " \
108 		"&& setenv dtbparam ${fdt_addr_r}\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 	"setethupdate=if env exists ethaddr; then; else setenv ethaddr " \
122 		"00:14:2d:00:00:00; fi; pci enum && tftpboot ${loadaddr} " \
123 		"flash_eth.img && source ${loadaddr}\0" \
124 	"setsdupdate=setenv interface mmc; setenv drive 1; mmc rescan; " \
125 		"load ${interface} ${drive}:1 ${loadaddr} flash_blk.img " \
126 		"|| setenv drive 2; mmc rescan; load ${interface} ${drive}:1 " \
127 		"${loadaddr} flash_blk.img && " \
128 		"source ${loadaddr}\0" \
129 	"setup=setenv setupargs igb_mac=${ethaddr} " \
130 		"consoleblank=0 no_console_suspend=1 console=tty1 " \
131 		"console=${console},${baudrate}n8 debug_uartport=lsport,0 " \
132 		"${memargs}\0" \
133 	"setupdate=run setsdupdate || run setusbupdate || run setethupdate\0" \
134 	"setusbupdate=usb start && setenv interface usb; setenv drive 0; " \
135 		"load ${interface} ${drive}:1 ${loadaddr} flash_blk.img && " \
136 		"source ${loadaddr}\0" \
137 	USB_BOOTCMD \
138 	"vidargs=video=tegrafb0:640x480-16@60 fbcon=map:1\0"
139 
140 /* Increase console I/O buffer size */
141 #undef CONFIG_SYS_CBSIZE
142 #define CONFIG_SYS_CBSIZE		1024
143 
144 /* Increase arguments buffer size */
145 #undef CONFIG_SYS_BARGSIZE
146 #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
147 
148 /* Increase maximum number of arguments */
149 #undef CONFIG_SYS_MAXARGS
150 #define CONFIG_SYS_MAXARGS		32
151 
152 #define CONFIG_CMD_TIME
153 
154 #define CONFIG_SUPPORT_RAW_INITRD
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 */
165