blob: 1d296ba51a05edbd35f966b52c187340911f4d43 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Marcel Ziswilerf38f5f42017-04-01 15:43:16 -07002/*
3 * Copyright (c) 2017 Toradex, Inc.
4 *
5 * Configuration settings for the Toradex Apalis TK1 modules.
Marcel Ziswilerf38f5f42017-04-01 15:43:16 -07006 */
7
8#ifndef __CONFIG_H
9#define __CONFIG_H
10
11#include <linux/sizes.h>
12
Marcel Ziswilerf38f5f42017-04-01 15:43:16 -070013#include "tegra124-common.h"
14
15#define CONFIG_ARCH_MISC_INIT
16
Marcel Ziswilerf38f5f42017-04-01 15:43:16 -070017/* Board-specific serial config */
18#define CONFIG_TEGRA_ENABLE_UARTA
19#define CONFIG_SYS_NS16550_COM1 NV_PA_APB_UARTA_BASE
20
Marcel Ziswilerf38f5f42017-04-01 15:43:16 -070021/* SD/MMC support */
22#define CONFIG_SUPPORT_EMMC_BOOT /* eMMC specific */
23
24/* Environment in eMMC, before config block at the end of 1st "boot sector" */
Marcel Ziswilerf38f5f42017-04-01 15:43:16 -070025#define CONFIG_ENV_OFFSET (-CONFIG_ENV_SIZE + \
26 CONFIG_TDX_CFG_BLOCK_OFFSET)
27#define CONFIG_SYS_MMC_ENV_DEV 0
28#define CONFIG_SYS_MMC_ENV_PART 1
29
Marcel Ziswilerf38f5f42017-04-01 15:43:16 -070030/* PCI host support */
31#undef CONFIG_PCI_SCAN_SHOW
Marcel Ziswilerf38f5f42017-04-01 15:43:16 -070032
33/* PCI networking support */
34#define CONFIG_E1000_NO_NVM
35
36/* General networking support */
37#define CONFIG_IP_DEFRAG
38#define CONFIG_TFTP_BLOCKSIZE 16352
39#define CONFIG_TFTP_TSIZE
40
Marcel Ziswilerf38f5f42017-04-01 15:43:16 -070041#undef CONFIG_IPADDR
42#define CONFIG_IPADDR 192.168.10.2
43#define CONFIG_NETMASK 255.255.255.0
44#undef CONFIG_SERVERIP
45#define CONFIG_SERVERIP 192.168.10.1
46
Marcel Ziswilerf38f5f42017-04-01 15:43:16 -070047#define DFU_ALT_EMMC_INFO "apalis-tk1.img raw 0x0 0x500 mmcpart 1; " \
48 "boot part 0 1 mmcpart 0; " \
49 "rootfs part 0 2 mmcpart 0; " \
50 "uImage fat 0 1 mmcpart 0; " \
51 "tegra124-apalis-eval.dtb fat 0 1 mmcpart 0"
52
53#define EMMC_BOOTCMD \
54 "emmcargs=ip=off root=/dev/mmcblk0p2 rw rootfstype=ext3 rootwait\0" \
55 "emmcboot=run setup; setenv bootargs ${defargs} ${emmcargs} " \
56 "${setupargs} ${vidargs}; echo Booting from internal eMMC " \
57 "chip...; run emmcdtbload; load mmc 0:1 ${kernel_addr_r} " \
58 "${boot_file} && run fdt_fixup && " \
59 "bootm ${kernel_addr_r} - ${dtbparam}\0" \
60 "emmcdtbload=setenv dtbparam; load mmc 0:1 ${fdt_addr_r} " \
61 "${soc}-apalis-${fdt_board}.dtb && " \
62 "setenv dtbparam ${fdt_addr_r}\0"
63
64#define NFS_BOOTCMD \
65 "nfsargs=ip=:::::eth0:on root=/dev/nfs rw\0" \
66 "nfsboot=pci enum; run setup; setenv bootargs ${defargs} ${nfsargs} " \
67 "${setupargs} ${vidargs}; echo Booting via DHCP/TFTP/NFS...; " \
68 "run nfsdtbload; dhcp ${kernel_addr_r} " \
69 "&& run fdt_fixup && bootm ${kernel_addr_r} - ${dtbparam}\0" \
70 "nfsdtbload=setenv dtbparam; tftp ${fdt_addr_r} " \
71 "${soc}-apalis-${fdt_board}.dtb " \
72 "&& setenv dtbparam ${fdt_addr_r}\0"
73
74#define SD_BOOTCMD \
Sanchayan Maity1c1238f2018-05-08 17:34:06 +020075 "sdargs=ip=off root=/dev/mmcblk1p2 rw rootfstype=ext4 rootwait\0" \
Marcel Ziswilerf38f5f42017-04-01 15:43:16 -070076 "sdboot=run setup; setenv bootargs ${defargs} ${sdargs} ${setupargs} " \
77 "${vidargs}; echo Booting from SD card in 8bit slot...; " \
78 "run sddtbload; load mmc 1:1 ${kernel_addr_r} " \
79 "${boot_file} && run fdt_fixup && " \
80 "bootm ${kernel_addr_r} - ${dtbparam}\0" \
81 "sddtbload=setenv dtbparam; load mmc 1:1 ${fdt_addr_r} " \
82 "${soc}-apalis-${fdt_board}.dtb " \
83 "&& setenv dtbparam ${fdt_addr_r}\0"
84
85#define USB_BOOTCMD \
Sanchayan Maity1c1238f2018-05-08 17:34:06 +020086 "usbargs=ip=off root=/dev/sda2 rw rootfstype=ext4 rootwait\0" \
Marcel Ziswilerf38f5f42017-04-01 15:43:16 -070087 "usbboot=run setup; setenv bootargs ${defargs} ${setupargs} " \
88 "${usbargs} ${vidargs}; echo Booting from USB stick...; " \
89 "usb start && run usbdtbload; load usb 0:1 ${kernel_addr_r} " \
90 "${boot_file} && run fdt_fixup && " \
91 "bootm ${kernel_addr_r} - ${dtbparam}\0" \
92 "usbdtbload=setenv dtbparam; load usb 0:1 ${fdt_addr_r} " \
93 "${soc}-apalis-${fdt_board}.dtb " \
94 "&& setenv dtbparam ${fdt_addr_r}\0"
95
96#define BOARD_EXTRA_ENV_SETTINGS \
97 "boot_file=uImage\0" \
98 "console=ttyS0\0" \
99 "defargs=lp0_vec=2064@0xf46ff000 core_edp_mv=1150 core_edp_ma=4000 " \
100 "usb_port_owner_info=2 lane_owner_info=6 emc_max_dvfs=0\0" \
101 "dfu_alt_info=" DFU_ALT_EMMC_INFO "\0" \
102 EMMC_BOOTCMD \
103 "fdt_board=eval\0" \
104 "fdt_fixup=;\0" \
105 NFS_BOOTCMD \
106 SD_BOOTCMD \
107 "setethupdate=if env exists ethaddr; then; else setenv ethaddr " \
108 "00:14:2d:00:00:00; fi; pci enum && tftpboot ${loadaddr} " \
109 "flash_eth.img && source ${loadaddr}\0" \
110 "setsdupdate=setenv interface mmc; setenv drive 1; mmc rescan; " \
111 "load ${interface} ${drive}:1 ${loadaddr} flash_blk.img " \
112 "|| setenv drive 2; mmc rescan; load ${interface} ${drive}:1 " \
113 "${loadaddr} flash_blk.img && " \
114 "source ${loadaddr}\0" \
115 "setup=setenv setupargs igb_mac=${ethaddr} " \
116 "consoleblank=0 no_console_suspend=1 console=tty1 " \
117 "console=${console},${baudrate}n8 debug_uartport=lsport,0 " \
118 "${memargs}\0" \
119 "setupdate=run setsdupdate || run setusbupdate || run setethupdate\0" \
120 "setusbupdate=usb start && setenv interface usb; setenv drive 0; " \
121 "load ${interface} ${drive}:1 ${loadaddr} flash_blk.img && " \
122 "source ${loadaddr}\0" \
123 USB_BOOTCMD \
124 "vidargs=video=tegrafb0:640x480-16@60 fbcon=map:1\0"
125
126/* Increase console I/O buffer size */
127#undef CONFIG_SYS_CBSIZE
128#define CONFIG_SYS_CBSIZE 1024
129
130/* Increase arguments buffer size */
131#undef CONFIG_SYS_BARGSIZE
132#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
133
Marcel Ziswilerf38f5f42017-04-01 15:43:16 -0700134/* Increase maximum number of arguments */
135#undef CONFIG_SYS_MAXARGS
136#define CONFIG_SYS_MAXARGS 32
137
138#define CONFIG_CMD_TIME
139
Marcel Ziswilerf38f5f42017-04-01 15:43:16 -0700140#define CONFIG_SYS_BOOT_RAMDISK_HIGH
141
142#include "tegra-common-usb-gadget.h"
143#include "tegra-common-post.h"
144
145/* Reserve top 1M for secure RAM */
146#define CONFIG_ARMV7_SECURE_BASE 0xfff00000
147#define CONFIG_ARMV7_SECURE_RESERVE_SIZE 0x00100000
148
149#endif /* __CONFIG_H */