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