1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Copyright (c) 2017 Toradex, Inc.
5 * Configuration settings for the Toradex Apalis TK1 modules.
11 #include <linux/sizes.h>
13 #include "tegra124-common.h"
15 #define CONFIG_ARCH_MISC_INIT
17 /* High-level configuration options */
19 /* Board-specific serial config */
20 #define CONFIG_TEGRA_ENABLE_UARTA
21 #define CONFIG_SYS_NS16550_COM1 NV_PA_APB_UARTA_BASE
24 #define CONFIG_SYS_I2C_TEGRA
27 #define CONFIG_SUPPORT_EMMC_BOOT /* eMMC specific */
29 /* Environment in eMMC, before config block at the end of 1st "boot sector" */
30 #define CONFIG_ENV_OFFSET (-CONFIG_ENV_SIZE + \
31 CONFIG_TDX_CFG_BLOCK_OFFSET)
32 #define CONFIG_SYS_MMC_ENV_DEV 0
33 #define CONFIG_SYS_MMC_ENV_PART 1
35 /* USB host support */
36 #define CONFIG_USB_EHCI_TEGRA
38 /* PCI host support */
39 #undef CONFIG_PCI_SCAN_SHOW
41 /* PCI networking support */
42 #define CONFIG_E1000_NO_NVM
44 /* General networking support */
45 #define CONFIG_IP_DEFRAG
46 #define CONFIG_TFTP_BLOCKSIZE 16352
47 #define CONFIG_TFTP_TSIZE
50 #define CONFIG_IPADDR 192.168.10.2
51 #define CONFIG_NETMASK 255.255.255.0
52 #undef CONFIG_SERVERIP
53 #define CONFIG_SERVERIP 192.168.10.1
55 #define DFU_ALT_EMMC_INFO "apalis-tk1.img raw 0x0 0x500 mmcpart 1; " \
56 "boot part 0 1 mmcpart 0; " \
57 "rootfs part 0 2 mmcpart 0; " \
58 "uImage fat 0 1 mmcpart 0; " \
59 "tegra124-apalis-eval.dtb fat 0 1 mmcpart 0"
61 #define EMMC_BOOTCMD \
62 "emmcargs=ip=off root=/dev/mmcblk0p2 rw rootfstype=ext3 rootwait\0" \
63 "emmcboot=run setup; setenv bootargs ${defargs} ${emmcargs} " \
64 "${setupargs} ${vidargs}; echo Booting from internal eMMC " \
65 "chip...; run emmcdtbload; load mmc 0:1 ${kernel_addr_r} " \
66 "${boot_file} && run fdt_fixup && " \
67 "bootm ${kernel_addr_r} - ${dtbparam}\0" \
68 "emmcdtbload=setenv dtbparam; load mmc 0:1 ${fdt_addr_r} " \
69 "${soc}-apalis-${fdt_board}.dtb && " \
70 "setenv dtbparam ${fdt_addr_r}\0"
73 "nfsargs=ip=:::::eth0:on root=/dev/nfs rw\0" \
74 "nfsboot=pci enum; run setup; setenv bootargs ${defargs} ${nfsargs} " \
75 "${setupargs} ${vidargs}; echo Booting via DHCP/TFTP/NFS...; " \
76 "run nfsdtbload; dhcp ${kernel_addr_r} " \
77 "&& run fdt_fixup && bootm ${kernel_addr_r} - ${dtbparam}\0" \
78 "nfsdtbload=setenv dtbparam; tftp ${fdt_addr_r} " \
79 "${soc}-apalis-${fdt_board}.dtb " \
80 "&& setenv dtbparam ${fdt_addr_r}\0"
83 "sdargs=ip=off root=/dev/mmcblk1p2 rw rootfstype=ext4 rootwait\0" \
84 "sdboot=run setup; setenv bootargs ${defargs} ${sdargs} ${setupargs} " \
85 "${vidargs}; echo Booting from SD card in 8bit slot...; " \
86 "run sddtbload; load mmc 1:1 ${kernel_addr_r} " \
87 "${boot_file} && run fdt_fixup && " \
88 "bootm ${kernel_addr_r} - ${dtbparam}\0" \
89 "sddtbload=setenv dtbparam; load mmc 1:1 ${fdt_addr_r} " \
90 "${soc}-apalis-${fdt_board}.dtb " \
91 "&& setenv dtbparam ${fdt_addr_r}\0"
94 "usbargs=ip=off root=/dev/sda2 rw rootfstype=ext4 rootwait\0" \
95 "usbboot=run setup; setenv bootargs ${defargs} ${setupargs} " \
96 "${usbargs} ${vidargs}; echo Booting from USB stick...; " \
97 "usb start && run usbdtbload; load usb 0:1 ${kernel_addr_r} " \
98 "${boot_file} && run fdt_fixup && " \
99 "bootm ${kernel_addr_r} - ${dtbparam}\0" \
100 "usbdtbload=setenv dtbparam; load usb 0:1 ${fdt_addr_r} " \
101 "${soc}-apalis-${fdt_board}.dtb " \
102 "&& setenv dtbparam ${fdt_addr_r}\0"
104 #define BOARD_EXTRA_ENV_SETTINGS \
105 "boot_file=uImage\0" \
107 "defargs=lp0_vec=2064@0xf46ff000 core_edp_mv=1150 core_edp_ma=4000 " \
108 "usb_port_owner_info=2 lane_owner_info=6 emc_max_dvfs=0\0" \
109 "dfu_alt_info=" DFU_ALT_EMMC_INFO "\0" \
115 "setethupdate=if env exists ethaddr; then; else setenv ethaddr " \
116 "00:14:2d:00:00:00; fi; pci enum && tftpboot ${loadaddr} " \
117 "flash_eth.img && source ${loadaddr}\0" \
118 "setsdupdate=setenv interface mmc; setenv drive 1; mmc rescan; " \
119 "load ${interface} ${drive}:1 ${loadaddr} flash_blk.img " \
120 "|| setenv drive 2; mmc rescan; load ${interface} ${drive}:1 " \
121 "${loadaddr} flash_blk.img && " \
122 "source ${loadaddr}\0" \
123 "setup=setenv setupargs igb_mac=${ethaddr} " \
124 "consoleblank=0 no_console_suspend=1 console=tty1 " \
125 "console=${console},${baudrate}n8 debug_uartport=lsport,0 " \
127 "setupdate=run setsdupdate || run setusbupdate || run setethupdate\0" \
128 "setusbupdate=usb start && setenv interface usb; setenv drive 0; " \
129 "load ${interface} ${drive}:1 ${loadaddr} flash_blk.img && " \
130 "source ${loadaddr}\0" \
132 "vidargs=video=tegrafb0:640x480-16@60 fbcon=map:1\0"
134 /* Increase console I/O buffer size */
135 #undef CONFIG_SYS_CBSIZE
136 #define CONFIG_SYS_CBSIZE 1024
138 /* Increase arguments buffer size */
139 #undef CONFIG_SYS_BARGSIZE
140 #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
142 /* Increase maximum number of arguments */
143 #undef CONFIG_SYS_MAXARGS
144 #define CONFIG_SYS_MAXARGS 32
146 #define CONFIG_CMD_TIME
148 #define CONFIG_SYS_BOOT_RAMDISK_HIGH
150 #include "tegra-common-usb-gadget.h"
151 #include "tegra-common-post.h"
153 /* Reserve top 1M for secure RAM */
154 #define CONFIG_ARMV7_SECURE_BASE 0xfff00000
155 #define CONFIG_ARMV7_SECURE_RESERVE_SIZE 0x00100000
157 #endif /* __CONFIG_H */