blob: 490ca64b1007efe2001876204d036799733e1e3f [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/* Environment in eMMC, before config block at the end of 1st "boot sector" */
Marcel Ziswilerf38f5f42017-04-01 15:43:16 -070022#define CONFIG_ENV_OFFSET (-CONFIG_ENV_SIZE + \
23 CONFIG_TDX_CFG_BLOCK_OFFSET)
24#define CONFIG_SYS_MMC_ENV_DEV 0
25#define CONFIG_SYS_MMC_ENV_PART 1
26
Marcel Ziswilerf38f5f42017-04-01 15:43:16 -070027/* PCI host support */
28#undef CONFIG_PCI_SCAN_SHOW
Marcel Ziswilerf38f5f42017-04-01 15:43:16 -070029
30/* PCI networking support */
31#define CONFIG_E1000_NO_NVM
32
33/* General networking support */
34#define CONFIG_IP_DEFRAG
35#define CONFIG_TFTP_BLOCKSIZE 16352
36#define CONFIG_TFTP_TSIZE
37
Marcel Ziswilerf38f5f42017-04-01 15:43:16 -070038#undef CONFIG_IPADDR
39#define CONFIG_IPADDR 192.168.10.2
40#define CONFIG_NETMASK 255.255.255.0
41#undef CONFIG_SERVERIP
42#define CONFIG_SERVERIP 192.168.10.1
43
Marcel Ziswilerf38f5f42017-04-01 15:43:16 -070044#define DFU_ALT_EMMC_INFO "apalis-tk1.img raw 0x0 0x500 mmcpart 1; " \
45 "boot part 0 1 mmcpart 0; " \
46 "rootfs part 0 2 mmcpart 0; " \
47 "uImage fat 0 1 mmcpart 0; " \
48 "tegra124-apalis-eval.dtb fat 0 1 mmcpart 0"
49
50#define EMMC_BOOTCMD \
Igor Opaniuka2cd5242019-05-29 13:00:43 +030051 "set_emmcargs=setenv emmcargs ip=off root=PARTUUID=${uuid} " \
52 "ro rootfstype=ext4 rootwait\0" \
53 "emmcboot=run setup; run emmcfinduuid; run set_emmcargs; " \
54 "setenv bootargs ${defargs} ${emmcargs} " \
55 "${setupargs} ${vidargs}; echo Booting from internal eMMC; " \
56 "run emmcdtbload; " \
57 "load mmc ${emmcdev}:${emmcbootpart} ${kernel_addr_r} " \
Marcel Ziswilerf38f5f42017-04-01 15:43:16 -070058 "${boot_file} && run fdt_fixup && " \
59 "bootm ${kernel_addr_r} - ${dtbparam}\0" \
Igor Opaniuka2cd5242019-05-29 13:00:43 +030060 "emmcbootpart=1\0" \
61 "emmcdev=0\0" \
62 "emmcdtbload=setenv dtbparam; load mmc ${emmcdev}:${emmcbootpart} " \
63 "${fdt_addr_r} ${soc}-apalis-${fdt_board}.dtb && " \
64 "setenv dtbparam ${fdt_addr_r}\0" \
65 "emmcfinduuid=part uuid mmc ${mmcdev}:${emmcrootpart} uuid\0" \
66 "emmcrootpart=2\0"
Marcel Ziswilerf38f5f42017-04-01 15:43:16 -070067
68#define NFS_BOOTCMD \
69 "nfsargs=ip=:::::eth0:on root=/dev/nfs rw\0" \
70 "nfsboot=pci enum; run setup; setenv bootargs ${defargs} ${nfsargs} " \
71 "${setupargs} ${vidargs}; echo Booting via DHCP/TFTP/NFS...; " \
72 "run nfsdtbload; dhcp ${kernel_addr_r} " \
73 "&& run fdt_fixup && bootm ${kernel_addr_r} - ${dtbparam}\0" \
74 "nfsdtbload=setenv dtbparam; tftp ${fdt_addr_r} " \
75 "${soc}-apalis-${fdt_board}.dtb " \
76 "&& setenv dtbparam ${fdt_addr_r}\0"
77
78#define SD_BOOTCMD \
Igor Opaniuka2cd5242019-05-29 13:00:43 +030079 "set_sdargs=setenv sdargs ip=off root=PARTUUID=${uuid} ro " \
80 "rootfstype=ext4 rootwait\0" \
81 "sdboot=run setup; run sdfinduuid; run set_sdargs; " \
82 "setenv bootargs ${defargs} ${sdargs} ${setupargs} " \
Marcel Ziswilerf38f5f42017-04-01 15:43:16 -070083 "${vidargs}; echo Booting from SD card in 8bit slot...; " \
Igor Opaniuka2cd5242019-05-29 13:00:43 +030084 "run sddtbload; load mmc ${sddev}:${sdbootpart} " \
85 "${kernel_addr_r} ${boot_file} && run fdt_fixup && " \
Marcel Ziswilerf38f5f42017-04-01 15:43:16 -070086 "bootm ${kernel_addr_r} - ${dtbparam}\0" \
Igor Opaniuka2cd5242019-05-29 13:00:43 +030087 "sdbootpart=1\0" \
88 "sddev=1\0" \
89 "sddtbload=setenv dtbparam; load mmc ${sddev}:${sdbootpart} " \
90 "${fdt_addr_r} ${soc}-apalis-${fdt_board}.dtb " \
91 "&& setenv dtbparam ${fdt_addr_r}\0" \
92 "sdfinduuid=part uuid mmc ${sddev}:${sdrootpart} uuid\0" \
93 "sdrootpart=2\0"
Marcel Ziswilerf38f5f42017-04-01 15:43:16 -070094
95#define USB_BOOTCMD \
Igor Opaniuka2cd5242019-05-29 13:00:43 +030096 "set_usbargs=setenv usbargs ip=off root=PARTUUID=${uuid} ro " \
97 "rootfstype=ext4 rootwait\0" \
98 "usbboot=run setup; usb start; run usbfinduuid; run set_usbargs; " \
99 "setenv bootargs ${defargs} ${setupargs} " \
Marcel Ziswilerf38f5f42017-04-01 15:43:16 -0700100 "${usbargs} ${vidargs}; echo Booting from USB stick...; " \
Igor Opaniuka2cd5242019-05-29 13:00:43 +0300101 "run usbdtbload; load usb ${usbdev}:${usbbootpart} " \
102 "${kernel_addr_r} ${boot_file} && run fdt_fixup && " \
Marcel Ziswilerf38f5f42017-04-01 15:43:16 -0700103 "bootm ${kernel_addr_r} - ${dtbparam}\0" \
Igor Opaniuka2cd5242019-05-29 13:00:43 +0300104 "usbbootpart=1\0" \
105 "usbdev=0\0" \
106 "usbdtbload=setenv dtbparam; load usb ${usbdev}:${usbbootpart} " \
107 "${fdt_addr_r} ${soc}-apalis-${fdt_board}.dtb " \
108 "&& setenv dtbparam ${fdt_addr_r}\0" \
109 "usbfinduuid=part uuid usb ${usbdev}:${usbrootpart} uuid\0" \
110 "usbrootpart=2\0"
Marcel Ziswilerf38f5f42017-04-01 15:43:16 -0700111
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 \
Igor Opaniuka2cd5242019-05-29 13:00:43 +0300123 USB_BOOTCMD \
Marcel Ziswilerf38f5f42017-04-01 15:43:16 -0700124 "setethupdate=if env exists ethaddr; then; else setenv ethaddr " \
125 "00:14:2d:00:00:00; fi; pci enum && tftpboot ${loadaddr} " \
126 "flash_eth.img && source ${loadaddr}\0" \
127 "setsdupdate=setenv interface mmc; setenv drive 1; mmc rescan; " \
128 "load ${interface} ${drive}:1 ${loadaddr} flash_blk.img " \
129 "|| setenv drive 2; mmc rescan; load ${interface} ${drive}:1 " \
130 "${loadaddr} flash_blk.img && " \
131 "source ${loadaddr}\0" \
132 "setup=setenv setupargs igb_mac=${ethaddr} " \
133 "consoleblank=0 no_console_suspend=1 console=tty1 " \
134 "console=${console},${baudrate}n8 debug_uartport=lsport,0 " \
135 "${memargs}\0" \
136 "setupdate=run setsdupdate || run setusbupdate || run setethupdate\0" \
137 "setusbupdate=usb start && setenv interface usb; setenv drive 0; " \
138 "load ${interface} ${drive}:1 ${loadaddr} flash_blk.img && " \
139 "source ${loadaddr}\0" \
140 USB_BOOTCMD \
141 "vidargs=video=tegrafb0:640x480-16@60 fbcon=map:1\0"
142
143/* Increase console I/O buffer size */
144#undef CONFIG_SYS_CBSIZE
145#define CONFIG_SYS_CBSIZE 1024
146
147/* Increase arguments buffer size */
148#undef CONFIG_SYS_BARGSIZE
149#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
150
Marcel Ziswilerf38f5f42017-04-01 15:43:16 -0700151/* Increase maximum number of arguments */
152#undef CONFIG_SYS_MAXARGS
153#define CONFIG_SYS_MAXARGS 32
154
155#define CONFIG_CMD_TIME
156
Marcel Ziswilerf38f5f42017-04-01 15:43:16 -0700157#define CONFIG_SYS_BOOT_RAMDISK_HIGH
158
159#include "tegra-common-usb-gadget.h"
160#include "tegra-common-post.h"
161
162/* Reserve top 1M for secure RAM */
163#define CONFIG_ARMV7_SECURE_BASE 0xfff00000
164#define CONFIG_ARMV7_SECURE_RESERVE_SIZE 0x00100000
165
166#endif /* __CONFIG_H */