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