]>
Commit | Line | Data |
---|---|---|
83d290c5 | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
f38f5f4b MZ |
2 | /* |
3 | * Copyright (c) 2017 Toradex, Inc. | |
4 | * | |
5 | * Configuration settings for the Toradex Apalis TK1 modules. | |
f38f5f4b MZ |
6 | */ |
7 | ||
8 | #ifndef __CONFIG_H | |
9 | #define __CONFIG_H | |
10 | ||
11 | #include <linux/sizes.h> | |
12 | ||
f38f5f4b MZ |
13 | #include "tegra124-common.h" |
14 | ||
15 | #define CONFIG_ARCH_MISC_INIT | |
16 | ||
f38f5f4b MZ |
17 | /* Board-specific serial config */ |
18 | #define CONFIG_TEGRA_ENABLE_UARTA | |
19 | #define CONFIG_SYS_NS16550_COM1 NV_PA_APB_UARTA_BASE | |
20 | ||
f38f5f4b | 21 | /* Environment in eMMC, before config block at the end of 1st "boot sector" */ |
f38f5f4b MZ |
22 | #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 | ||
f38f5f4b MZ |
27 | /* PCI host support */ |
28 | #undef CONFIG_PCI_SCAN_SHOW | |
f38f5f4b MZ |
29 | |
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 | ||
f38f5f4b MZ |
38 | #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 | ||
f38f5f4b MZ |
44 | #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 \ | |
51 | "emmcargs=ip=off root=/dev/mmcblk0p2 rw rootfstype=ext3 rootwait\0" \ | |
52 | "emmcboot=run setup; setenv bootargs ${defargs} ${emmcargs} " \ | |
53 | "${setupargs} ${vidargs}; echo Booting from internal eMMC " \ | |
54 | "chip...; run emmcdtbload; load mmc 0:1 ${kernel_addr_r} " \ | |
55 | "${boot_file} && run fdt_fixup && " \ | |
56 | "bootm ${kernel_addr_r} - ${dtbparam}\0" \ | |
57 | "emmcdtbload=setenv dtbparam; load mmc 0:1 ${fdt_addr_r} " \ | |
58 | "${soc}-apalis-${fdt_board}.dtb && " \ | |
59 | "setenv dtbparam ${fdt_addr_r}\0" | |
60 | ||
61 | #define NFS_BOOTCMD \ | |
62 | "nfsargs=ip=:::::eth0:on root=/dev/nfs rw\0" \ | |
63 | "nfsboot=pci enum; run setup; setenv bootargs ${defargs} ${nfsargs} " \ | |
64 | "${setupargs} ${vidargs}; echo Booting via DHCP/TFTP/NFS...; " \ | |
65 | "run nfsdtbload; dhcp ${kernel_addr_r} " \ | |
66 | "&& run fdt_fixup && bootm ${kernel_addr_r} - ${dtbparam}\0" \ | |
67 | "nfsdtbload=setenv dtbparam; tftp ${fdt_addr_r} " \ | |
68 | "${soc}-apalis-${fdt_board}.dtb " \ | |
69 | "&& setenv dtbparam ${fdt_addr_r}\0" | |
70 | ||
71 | #define SD_BOOTCMD \ | |
1c1238f1 | 72 | "sdargs=ip=off root=/dev/mmcblk1p2 rw rootfstype=ext4 rootwait\0" \ |
f38f5f4b MZ |
73 | "sdboot=run setup; setenv bootargs ${defargs} ${sdargs} ${setupargs} " \ |
74 | "${vidargs}; echo Booting from SD card in 8bit slot...; " \ | |
75 | "run sddtbload; load mmc 1:1 ${kernel_addr_r} " \ | |
76 | "${boot_file} && run fdt_fixup && " \ | |
77 | "bootm ${kernel_addr_r} - ${dtbparam}\0" \ | |
78 | "sddtbload=setenv dtbparam; load mmc 1:1 ${fdt_addr_r} " \ | |
79 | "${soc}-apalis-${fdt_board}.dtb " \ | |
80 | "&& setenv dtbparam ${fdt_addr_r}\0" | |
81 | ||
82 | #define USB_BOOTCMD \ | |
1c1238f1 | 83 | "usbargs=ip=off root=/dev/sda2 rw rootfstype=ext4 rootwait\0" \ |
f38f5f4b MZ |
84 | "usbboot=run setup; setenv bootargs ${defargs} ${setupargs} " \ |
85 | "${usbargs} ${vidargs}; echo Booting from USB stick...; " \ | |
86 | "usb start && run usbdtbload; load usb 0:1 ${kernel_addr_r} " \ | |
87 | "${boot_file} && run fdt_fixup && " \ | |
88 | "bootm ${kernel_addr_r} - ${dtbparam}\0" \ | |
89 | "usbdtbload=setenv dtbparam; load usb 0:1 ${fdt_addr_r} " \ | |
90 | "${soc}-apalis-${fdt_board}.dtb " \ | |
91 | "&& setenv dtbparam ${fdt_addr_r}\0" | |
92 | ||
93 | #define BOARD_EXTRA_ENV_SETTINGS \ | |
94 | "boot_file=uImage\0" \ | |
95 | "console=ttyS0\0" \ | |
96 | "defargs=lp0_vec=2064@0xf46ff000 core_edp_mv=1150 core_edp_ma=4000 " \ | |
97 | "usb_port_owner_info=2 lane_owner_info=6 emc_max_dvfs=0\0" \ | |
98 | "dfu_alt_info=" DFU_ALT_EMMC_INFO "\0" \ | |
99 | EMMC_BOOTCMD \ | |
100 | "fdt_board=eval\0" \ | |
101 | "fdt_fixup=;\0" \ | |
102 | NFS_BOOTCMD \ | |
103 | SD_BOOTCMD \ | |
104 | "setethupdate=if env exists ethaddr; then; else setenv ethaddr " \ | |
105 | "00:14:2d:00:00:00; fi; pci enum && tftpboot ${loadaddr} " \ | |
106 | "flash_eth.img && source ${loadaddr}\0" \ | |
107 | "setsdupdate=setenv interface mmc; setenv drive 1; mmc rescan; " \ | |
108 | "load ${interface} ${drive}:1 ${loadaddr} flash_blk.img " \ | |
109 | "|| setenv drive 2; mmc rescan; load ${interface} ${drive}:1 " \ | |
110 | "${loadaddr} flash_blk.img && " \ | |
111 | "source ${loadaddr}\0" \ | |
112 | "setup=setenv setupargs igb_mac=${ethaddr} " \ | |
113 | "consoleblank=0 no_console_suspend=1 console=tty1 " \ | |
114 | "console=${console},${baudrate}n8 debug_uartport=lsport,0 " \ | |
115 | "${memargs}\0" \ | |
116 | "setupdate=run setsdupdate || run setusbupdate || run setethupdate\0" \ | |
117 | "setusbupdate=usb start && setenv interface usb; setenv drive 0; " \ | |
118 | "load ${interface} ${drive}:1 ${loadaddr} flash_blk.img && " \ | |
119 | "source ${loadaddr}\0" \ | |
120 | USB_BOOTCMD \ | |
121 | "vidargs=video=tegrafb0:640x480-16@60 fbcon=map:1\0" | |
122 | ||
123 | /* Increase console I/O buffer size */ | |
124 | #undef CONFIG_SYS_CBSIZE | |
125 | #define CONFIG_SYS_CBSIZE 1024 | |
126 | ||
127 | /* Increase arguments buffer size */ | |
128 | #undef CONFIG_SYS_BARGSIZE | |
129 | #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE | |
130 | ||
f38f5f4b MZ |
131 | /* Increase maximum number of arguments */ |
132 | #undef CONFIG_SYS_MAXARGS | |
133 | #define CONFIG_SYS_MAXARGS 32 | |
134 | ||
135 | #define CONFIG_CMD_TIME | |
136 | ||
f38f5f4b MZ |
137 | #define CONFIG_SYS_BOOT_RAMDISK_HIGH |
138 | ||
139 | #include "tegra-common-usb-gadget.h" | |
140 | #include "tegra-common-post.h" | |
141 | ||
142 | /* Reserve top 1M for secure RAM */ | |
143 | #define CONFIG_ARMV7_SECURE_BASE 0xfff00000 | |
144 | #define CONFIG_ARMV7_SECURE_RESERVE_SIZE 0x00100000 | |
145 | ||
146 | #endif /* __CONFIG_H */ |