Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Marcel Ziswiler | d2b64bd | 2017-04-01 15:43:16 -0700 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (c) 2017 Toradex, Inc. |
| 4 | * |
| 5 | * Configuration settings for the Toradex Apalis TK1 modules. |
Marcel Ziswiler | d2b64bd | 2017-04-01 15:43:16 -0700 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | #ifndef __CONFIG_H |
| 9 | #define __CONFIG_H |
| 10 | |
| 11 | #include <linux/sizes.h> |
| 12 | |
Marcel Ziswiler | d2b64bd | 2017-04-01 15:43:16 -0700 | [diff] [blame] | 13 | #include "tegra124-common.h" |
| 14 | |
| 15 | #define CONFIG_ARCH_MISC_INIT |
| 16 | |
Marcel Ziswiler | d2b64bd | 2017-04-01 15:43:16 -0700 | [diff] [blame] | 17 | /* Board-specific serial config */ |
| 18 | #define CONFIG_TEGRA_ENABLE_UARTA |
| 19 | #define CONFIG_SYS_NS16550_COM1 NV_PA_APB_UARTA_BASE |
| 20 | |
Marcel Ziswiler | d2b64bd | 2017-04-01 15:43:16 -0700 | [diff] [blame] | 21 | /* 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] | 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 | |
Marcel Ziswiler | d2b64bd | 2017-04-01 15:43:16 -0700 | [diff] [blame] | 27 | /* PCI host support */ |
| 28 | #undef CONFIG_PCI_SCAN_SHOW |
Marcel Ziswiler | d2b64bd | 2017-04-01 15:43:16 -0700 | [diff] [blame] | 29 | |
| 30 | /* PCI networking support */ |
| 31 | #define CONFIG_E1000_NO_NVM |
| 32 | |
| 33 | /* General networking support */ |
Marcel Ziswiler | d2b64bd | 2017-04-01 15:43:16 -0700 | [diff] [blame] | 34 | #define CONFIG_TFTP_TSIZE |
| 35 | |
Marcel Ziswiler | d2b64bd | 2017-04-01 15:43:16 -0700 | [diff] [blame] | 36 | #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 Ziswiler | d2b64bd | 2017-04-01 15:43:16 -0700 | [diff] [blame] | 42 | #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 Opaniuk | 6bf487b | 2019-05-29 13:00:43 +0300 | [diff] [blame] | 49 | "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 Ziswiler | d2b64bd | 2017-04-01 15:43:16 -0700 | [diff] [blame] | 56 | "${boot_file} && run fdt_fixup && " \ |
| 57 | "bootm ${kernel_addr_r} - ${dtbparam}\0" \ |
Igor Opaniuk | 6bf487b | 2019-05-29 13:00:43 +0300 | [diff] [blame] | 58 | "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 Ziswiler | d2b64bd | 2017-04-01 15:43:16 -0700 | [diff] [blame] | 65 | |
| 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 Opaniuk | 6bf487b | 2019-05-29 13:00:43 +0300 | [diff] [blame] | 77 | "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 Ziswiler | d2b64bd | 2017-04-01 15:43:16 -0700 | [diff] [blame] | 81 | "${vidargs}; echo Booting from SD card in 8bit slot...; " \ |
Igor Opaniuk | 6bf487b | 2019-05-29 13:00:43 +0300 | [diff] [blame] | 82 | "run sddtbload; load mmc ${sddev}:${sdbootpart} " \ |
| 83 | "${kernel_addr_r} ${boot_file} && run fdt_fixup && " \ |
Marcel Ziswiler | d2b64bd | 2017-04-01 15:43:16 -0700 | [diff] [blame] | 84 | "bootm ${kernel_addr_r} - ${dtbparam}\0" \ |
Igor Opaniuk | 6bf487b | 2019-05-29 13:00:43 +0300 | [diff] [blame] | 85 | "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 Ziswiler | d2b64bd | 2017-04-01 15:43:16 -0700 | [diff] [blame] | 92 | |
| 93 | #define USB_BOOTCMD \ |
Igor Opaniuk | 6bf487b | 2019-05-29 13:00:43 +0300 | [diff] [blame] | 94 | "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 Ziswiler | d2b64bd | 2017-04-01 15:43:16 -0700 | [diff] [blame] | 98 | "${usbargs} ${vidargs}; echo Booting from USB stick...; " \ |
Igor Opaniuk | 6bf487b | 2019-05-29 13:00:43 +0300 | [diff] [blame] | 99 | "run usbdtbload; load usb ${usbdev}:${usbbootpart} " \ |
| 100 | "${kernel_addr_r} ${boot_file} && run fdt_fixup && " \ |
Marcel Ziswiler | d2b64bd | 2017-04-01 15:43:16 -0700 | [diff] [blame] | 101 | "bootm ${kernel_addr_r} - ${dtbparam}\0" \ |
Igor Opaniuk | 6bf487b | 2019-05-29 13:00:43 +0300 | [diff] [blame] | 102 | "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 Ziswiler | d2b64bd | 2017-04-01 15:43:16 -0700 | [diff] [blame] | 109 | |
| 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 Opaniuk | 5649c6f | 2019-08-01 11:06:34 +0300 | [diff] [blame^] | 114 | "usb_port_owner_info=2 lane_owner_info=6 emc_max_dvfs=0 " \ |
| 115 | "user_debug=30\0" \ |
Marcel Ziswiler | d2b64bd | 2017-04-01 15:43:16 -0700 | [diff] [blame] | 116 | "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 Opaniuk | 6bf487b | 2019-05-29 13:00:43 +0300 | [diff] [blame] | 122 | USB_BOOTCMD \ |
Marcel Ziswiler | d2b64bd | 2017-04-01 15:43:16 -0700 | [diff] [blame] | 123 | "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 Ziswiler | d2b64bd | 2017-04-01 15:43:16 -0700 | [diff] [blame] | 150 | /* Increase maximum number of arguments */ |
| 151 | #undef CONFIG_SYS_MAXARGS |
| 152 | #define CONFIG_SYS_MAXARGS 32 |
| 153 | |
| 154 | #define CONFIG_CMD_TIME |
| 155 | |
Marcel Ziswiler | d2b64bd | 2017-04-01 15:43:16 -0700 | [diff] [blame] | 156 | #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 */ |