blob: efc52841d1d9330c7eda81b5a1b9b0703884aed1 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Marcel Ziswilerd2b64bd2017-04-01 15:43:16 -07002/*
3 * Copyright (c) 2017 Toradex, Inc.
4 *
5 * Configuration settings for the Toradex Apalis TK1 modules.
Marcel Ziswilerd2b64bd2017-04-01 15:43:16 -07006 */
7
8#ifndef __CONFIG_H
9#define __CONFIG_H
10
11#include <linux/sizes.h>
12
Marcel Ziswilerd2b64bd2017-04-01 15:43:16 -070013#include "tegra124-common.h"
14
15#define CONFIG_ARCH_MISC_INIT
16
Marcel Ziswilerd2b64bd2017-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 Ziswilerd2b64bd2017-04-01 15:43:16 -070021/* Environment in eMMC, before config block at the end of 1st "boot sector" */
Marcel Ziswilerd2b64bd2017-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 Ziswilerd2b64bd2017-04-01 15:43:16 -070027/* PCI host support */
28#undef CONFIG_PCI_SCAN_SHOW
Marcel Ziswilerd2b64bd2017-04-01 15:43:16 -070029
30/* PCI networking support */
31#define CONFIG_E1000_NO_NVM
32
33/* General networking support */
Marcel Ziswilerd2b64bd2017-04-01 15:43:16 -070034#define CONFIG_TFTP_TSIZE
35
Marcel Ziswilerd2b64bd2017-04-01 15:43:16 -070036#undef CONFIG_IPADDR
37#define CONFIG_IPADDR 192.168.10.2
38#define CONFIG_NETMASK 255.255.255.0
39#undef CONFIG_SERVERIP
40#define CONFIG_SERVERIP 192.168.10.1
41
Marcel Ziswilerd2b64bd2017-04-01 15:43:16 -070042#define DFU_ALT_EMMC_INFO "apalis-tk1.img raw 0x0 0x500 mmcpart 1; " \
43 "boot part 0 1 mmcpart 0; " \
44 "rootfs part 0 2 mmcpart 0; " \
45 "uImage fat 0 1 mmcpart 0; " \
46 "tegra124-apalis-eval.dtb fat 0 1 mmcpart 0"
47
48#define EMMC_BOOTCMD \
Igor Opaniuk6bf487b2019-05-29 13:00:43 +030049 "set_emmcargs=setenv emmcargs ip=off root=PARTUUID=${uuid} " \
50 "ro rootfstype=ext4 rootwait\0" \
51 "emmcboot=run setup; run emmcfinduuid; run set_emmcargs; " \
52 "setenv bootargs ${defargs} ${emmcargs} " \
53 "${setupargs} ${vidargs}; echo Booting from internal eMMC; " \
54 "run emmcdtbload; " \
55 "load mmc ${emmcdev}:${emmcbootpart} ${kernel_addr_r} " \
Marcel Ziswilerd2b64bd2017-04-01 15:43:16 -070056 "${boot_file} && run fdt_fixup && " \
57 "bootm ${kernel_addr_r} - ${dtbparam}\0" \
Igor Opaniuk6bf487b2019-05-29 13:00:43 +030058 "emmcbootpart=1\0" \
59 "emmcdev=0\0" \
60 "emmcdtbload=setenv dtbparam; load mmc ${emmcdev}:${emmcbootpart} " \
61 "${fdt_addr_r} ${soc}-apalis-${fdt_board}.dtb && " \
62 "setenv dtbparam ${fdt_addr_r}\0" \
63 "emmcfinduuid=part uuid mmc ${mmcdev}:${emmcrootpart} uuid\0" \
64 "emmcrootpart=2\0"
Marcel Ziswilerd2b64bd2017-04-01 15:43:16 -070065
66#define NFS_BOOTCMD \
67 "nfsargs=ip=:::::eth0:on root=/dev/nfs rw\0" \
68 "nfsboot=pci enum; run setup; setenv bootargs ${defargs} ${nfsargs} " \
69 "${setupargs} ${vidargs}; echo Booting via DHCP/TFTP/NFS...; " \
70 "run nfsdtbload; dhcp ${kernel_addr_r} " \
71 "&& run fdt_fixup && bootm ${kernel_addr_r} - ${dtbparam}\0" \
72 "nfsdtbload=setenv dtbparam; tftp ${fdt_addr_r} " \
73 "${soc}-apalis-${fdt_board}.dtb " \
74 "&& setenv dtbparam ${fdt_addr_r}\0"
75
76#define SD_BOOTCMD \
Igor Opaniuk6bf487b2019-05-29 13:00:43 +030077 "set_sdargs=setenv sdargs ip=off root=PARTUUID=${uuid} ro " \
78 "rootfstype=ext4 rootwait\0" \
79 "sdboot=run setup; run sdfinduuid; run set_sdargs; " \
80 "setenv bootargs ${defargs} ${sdargs} ${setupargs} " \
Marcel Ziswilerd2b64bd2017-04-01 15:43:16 -070081 "${vidargs}; echo Booting from SD card in 8bit slot...; " \
Igor Opaniuk6bf487b2019-05-29 13:00:43 +030082 "run sddtbload; load mmc ${sddev}:${sdbootpart} " \
83 "${kernel_addr_r} ${boot_file} && run fdt_fixup && " \
Marcel Ziswilerd2b64bd2017-04-01 15:43:16 -070084 "bootm ${kernel_addr_r} - ${dtbparam}\0" \
Igor Opaniuk6bf487b2019-05-29 13:00:43 +030085 "sdbootpart=1\0" \
86 "sddev=1\0" \
87 "sddtbload=setenv dtbparam; load mmc ${sddev}:${sdbootpart} " \
88 "${fdt_addr_r} ${soc}-apalis-${fdt_board}.dtb " \
89 "&& setenv dtbparam ${fdt_addr_r}\0" \
90 "sdfinduuid=part uuid mmc ${sddev}:${sdrootpart} uuid\0" \
91 "sdrootpart=2\0"
Marcel Ziswilerd2b64bd2017-04-01 15:43:16 -070092
93#define USB_BOOTCMD \
Igor Opaniuk6bf487b2019-05-29 13:00:43 +030094 "set_usbargs=setenv usbargs ip=off root=PARTUUID=${uuid} ro " \
95 "rootfstype=ext4 rootwait\0" \
96 "usbboot=run setup; usb start; run usbfinduuid; run set_usbargs; " \
97 "setenv bootargs ${defargs} ${setupargs} " \
Marcel Ziswilerd2b64bd2017-04-01 15:43:16 -070098 "${usbargs} ${vidargs}; echo Booting from USB stick...; " \
Igor Opaniuk6bf487b2019-05-29 13:00:43 +030099 "run usbdtbload; load usb ${usbdev}:${usbbootpart} " \
100 "${kernel_addr_r} ${boot_file} && run fdt_fixup && " \
Marcel Ziswilerd2b64bd2017-04-01 15:43:16 -0700101 "bootm ${kernel_addr_r} - ${dtbparam}\0" \
Igor Opaniuk6bf487b2019-05-29 13:00:43 +0300102 "usbbootpart=1\0" \
103 "usbdev=0\0" \
104 "usbdtbload=setenv dtbparam; load usb ${usbdev}:${usbbootpart} " \
105 "${fdt_addr_r} ${soc}-apalis-${fdt_board}.dtb " \
106 "&& setenv dtbparam ${fdt_addr_r}\0" \
107 "usbfinduuid=part uuid usb ${usbdev}:${usbrootpart} uuid\0" \
108 "usbrootpart=2\0"
Marcel Ziswilerd2b64bd2017-04-01 15:43:16 -0700109
110#define BOARD_EXTRA_ENV_SETTINGS \
111 "boot_file=uImage\0" \
112 "console=ttyS0\0" \
113 "defargs=lp0_vec=2064@0xf46ff000 core_edp_mv=1150 core_edp_ma=4000 " \
Igor Opaniuk5649c6f2019-08-01 11:06:34 +0300114 "usb_port_owner_info=2 lane_owner_info=6 emc_max_dvfs=0 " \
115 "user_debug=30\0" \
Marcel Ziswilerd2b64bd2017-04-01 15:43:16 -0700116 "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 \
Igor Opaniuk6bf487b2019-05-29 13:00:43 +0300122 USB_BOOTCMD \
Marcel Ziswilerd2b64bd2017-04-01 15:43:16 -0700123 "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
Marcel Ziswilerd2b64bd2017-04-01 15:43:16 -0700150/* Increase maximum number of arguments */
151#undef CONFIG_SYS_MAXARGS
152#define CONFIG_SYS_MAXARGS 32
153
154#define CONFIG_CMD_TIME
155
Marcel Ziswilerd2b64bd2017-04-01 15:43:16 -0700156#define CONFIG_SYS_BOOT_RAMDISK_HIGH
157
158#include "tegra-common-usb-gadget.h"
159#include "tegra-common-post.h"
160
161/* Reserve top 1M for secure RAM */
162#define CONFIG_ARMV7_SECURE_BASE 0xfff00000
163#define CONFIG_ARMV7_SECURE_RESERVE_SIZE 0x00100000
164
165#endif /* __CONFIG_H */