blob: d6b226c425170e6a23121744f5372f346722287c [file] [log] [blame]
Marcel Ziswilerf38f5f42017-04-01 15:43:16 -07001/*
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
Marcel Ziswilerf38f5f42017-04-01 15:43:16 -070014#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" */
Marcel Ziswilerf38f5f42017-04-01 15:43:16 -070032#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 */
Marcel Ziswilerf38f5f42017-04-01 15:43:16 -070038#define CONFIG_USB_EHCI_TEGRA
39
40/* PCI host support */
41#undef CONFIG_PCI_SCAN_SHOW
42#define CONFIG_CMD_PCI
43
44/* PCI networking support */
45#define CONFIG_E1000_NO_NVM
46
47/* General networking support */
48#define CONFIG_IP_DEFRAG
49#define CONFIG_TFTP_BLOCKSIZE 16352
50#define CONFIG_TFTP_TSIZE
51
Marcel Ziswilerf38f5f42017-04-01 15:43:16 -070052#undef CONFIG_IPADDR
53#define CONFIG_IPADDR 192.168.10.2
54#define CONFIG_NETMASK 255.255.255.0
55#undef CONFIG_SERVERIP
56#define CONFIG_SERVERIP 192.168.10.1
57
58#define CONFIG_BOOTCOMMAND \
59 "run emmcboot; setenv fdtfile ${soc}-apalis-${fdt_board}.dtb && " \
60 "run distro_bootcmd"
61
62#define DFU_ALT_EMMC_INFO "apalis-tk1.img raw 0x0 0x500 mmcpart 1; " \
63 "boot part 0 1 mmcpart 0; " \
64 "rootfs part 0 2 mmcpart 0; " \
65 "uImage fat 0 1 mmcpart 0; " \
66 "tegra124-apalis-eval.dtb fat 0 1 mmcpart 0"
67
68#define EMMC_BOOTCMD \
69 "emmcargs=ip=off root=/dev/mmcblk0p2 rw rootfstype=ext3 rootwait\0" \
70 "emmcboot=run setup; setenv bootargs ${defargs} ${emmcargs} " \
71 "${setupargs} ${vidargs}; echo Booting from internal eMMC " \
72 "chip...; run emmcdtbload; load mmc 0:1 ${kernel_addr_r} " \
73 "${boot_file} && run fdt_fixup && " \
74 "bootm ${kernel_addr_r} - ${dtbparam}\0" \
75 "emmcdtbload=setenv dtbparam; load mmc 0:1 ${fdt_addr_r} " \
76 "${soc}-apalis-${fdt_board}.dtb && " \
77 "setenv dtbparam ${fdt_addr_r}\0"
78
79#define NFS_BOOTCMD \
80 "nfsargs=ip=:::::eth0:on root=/dev/nfs rw\0" \
81 "nfsboot=pci enum; run setup; setenv bootargs ${defargs} ${nfsargs} " \
82 "${setupargs} ${vidargs}; echo Booting via DHCP/TFTP/NFS...; " \
83 "run nfsdtbload; dhcp ${kernel_addr_r} " \
84 "&& run fdt_fixup && bootm ${kernel_addr_r} - ${dtbparam}\0" \
85 "nfsdtbload=setenv dtbparam; tftp ${fdt_addr_r} " \
86 "${soc}-apalis-${fdt_board}.dtb " \
87 "&& setenv dtbparam ${fdt_addr_r}\0"
88
89#define SD_BOOTCMD \
90 "sdargs=ip=off root=/dev/mmcblk1p2 rw rootfstype=ext3 rootwait\0" \
91 "sdboot=run setup; setenv bootargs ${defargs} ${sdargs} ${setupargs} " \
92 "${vidargs}; echo Booting from SD card in 8bit slot...; " \
93 "run sddtbload; load mmc 1:1 ${kernel_addr_r} " \
94 "${boot_file} && run fdt_fixup && " \
95 "bootm ${kernel_addr_r} - ${dtbparam}\0" \
96 "sddtbload=setenv dtbparam; load mmc 1:1 ${fdt_addr_r} " \
97 "${soc}-apalis-${fdt_board}.dtb " \
98 "&& setenv dtbparam ${fdt_addr_r}\0"
99
100#define USB_BOOTCMD \
101 "usbargs=ip=off root=/dev/sda2 rw rootfstype=ext3 rootwait\0" \
102 "usbboot=run setup; setenv bootargs ${defargs} ${setupargs} " \
103 "${usbargs} ${vidargs}; echo Booting from USB stick...; " \
104 "usb start && run usbdtbload; load usb 0:1 ${kernel_addr_r} " \
105 "${boot_file} && run fdt_fixup && " \
106 "bootm ${kernel_addr_r} - ${dtbparam}\0" \
107 "usbdtbload=setenv dtbparam; load usb 0:1 ${fdt_addr_r} " \
108 "${soc}-apalis-${fdt_board}.dtb " \
109 "&& setenv dtbparam ${fdt_addr_r}\0"
110
111#define BOARD_EXTRA_ENV_SETTINGS \
112 "boot_file=uImage\0" \
113 "console=ttyS0\0" \
114 "defargs=lp0_vec=2064@0xf46ff000 core_edp_mv=1150 core_edp_ma=4000 " \
115 "usb_port_owner_info=2 lane_owner_info=6 emc_max_dvfs=0\0" \
116 "dfu_alt_info=" DFU_ALT_EMMC_INFO "\0" \
117 EMMC_BOOTCMD \
118 "fdt_board=eval\0" \
119 "fdt_fixup=;\0" \
120 NFS_BOOTCMD \
121 SD_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 print buffer size */
150#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
151
152/* Increase maximum number of arguments */
153#undef CONFIG_SYS_MAXARGS
154#define CONFIG_SYS_MAXARGS 32
155
156#define CONFIG_CMD_TIME
157
158#define CONFIG_SUPPORT_RAW_INITRD
159#define CONFIG_SYS_BOOT_RAMDISK_HIGH
160
161#include "tegra-common-usb-gadget.h"
162#include "tegra-common-post.h"
163
164/* Reserve top 1M for secure RAM */
165#define CONFIG_ARMV7_SECURE_BASE 0xfff00000
166#define CONFIG_ARMV7_SECURE_RESERVE_SIZE 0x00100000
167
168#endif /* __CONFIG_H */