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