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