Dave Gerlach | 33b7258 | 2021-04-23 11:27:42 -0500 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
| 2 | /* |
| 3 | * Configuration header file for K3 AM642 SoC family |
| 4 | * |
| 5 | * Copyright (C) 2020-2021 Texas Instruments Incorporated - https://www.ti.com/ |
| 6 | * Keerthy <j-keerthy@ti.com> |
| 7 | */ |
| 8 | |
| 9 | #ifndef __CONFIG_AM642_EVM_H |
| 10 | #define __CONFIG_AM642_EVM_H |
| 11 | |
| 12 | #include <linux/sizes.h> |
| 13 | #include <config_distro_bootcmd.h> |
| 14 | #include <environment/ti/mmc.h> |
Aswath Govindraju | 26f32c3 | 2021-06-04 22:00:38 +0530 | [diff] [blame] | 15 | #include <asm/arch/am64_hardware.h> |
Aswath Govindraju | ce7ad57 | 2021-06-04 22:00:40 +0530 | [diff] [blame] | 16 | #include <environment/ti/k3_dfu.h> |
Dave Gerlach | 33b7258 | 2021-04-23 11:27:42 -0500 | [diff] [blame] | 17 | |
| 18 | /* DDR Configuration */ |
| 19 | #define CONFIG_SYS_SDRAM_BASE1 0x880000000 |
| 20 | |
Lokesh Vutla | aad1614 | 2021-05-06 16:44:53 +0530 | [diff] [blame] | 21 | #if defined(CONFIG_TARGET_AM642_A53_EVM) |
Lokesh Vutla | aad1614 | 2021-05-06 16:44:53 +0530 | [diff] [blame] | 22 | #else |
Dave Gerlach | 33b7258 | 2021-04-23 11:27:42 -0500 | [diff] [blame] | 23 | /* |
Dave Gerlach | 33b7258 | 2021-04-23 11:27:42 -0500 | [diff] [blame] | 24 | * Link BSS to be within SPL in a dedicated region located near the top of |
| 25 | * the MCU SRAM, this way making it available also before relocation. Note |
| 26 | * that we are not using the actual top of the MCU SRAM as there is a memory |
| 27 | * location filled in by the boot ROM that we want to read out without any |
| 28 | * interference from the C context. |
| 29 | */ |
Aswath Govindraju | 26f32c3 | 2021-06-04 22:00:38 +0530 | [diff] [blame] | 30 | #define CONFIG_SPL_BSS_START_ADDR (TI_SRAM_SCRATCH_BOARD_EEPROM_START -\ |
Dave Gerlach | 33b7258 | 2021-04-23 11:27:42 -0500 | [diff] [blame] | 31 | CONFIG_SPL_BSS_MAX_SIZE) |
Lokesh Vutla | aad1614 | 2021-05-06 16:44:53 +0530 | [diff] [blame] | 32 | /* Set the stack right below the SPL BSS section */ |
Dave Gerlach | 33b7258 | 2021-04-23 11:27:42 -0500 | [diff] [blame] | 33 | /* Configure R5 SPL post-relocation malloc pool in DDR */ |
| 34 | #define CONFIG_SYS_SPL_MALLOC_START 0x84000000 |
| 35 | #define CONFIG_SYS_SPL_MALLOC_SIZE SZ_16M |
Lokesh Vutla | aad1614 | 2021-05-06 16:44:53 +0530 | [diff] [blame] | 36 | #endif |
Dave Gerlach | 33b7258 | 2021-04-23 11:27:42 -0500 | [diff] [blame] | 37 | |
| 38 | #define PARTS_DEFAULT \ |
| 39 | /* Linux partitions */ \ |
| 40 | "name=rootfs,start=0,size=-,uuid=${uuid_gpt_rootfs}\0" |
| 41 | |
| 42 | /* U-Boot general configuration */ |
| 43 | #define EXTRA_ENV_AM642_BOARD_SETTINGS \ |
Dave Gerlach | 33b7258 | 2021-04-23 11:27:42 -0500 | [diff] [blame] | 44 | "findfdt=" \ |
Lokesh Vutla | 5af71f2 | 2021-05-06 16:44:55 +0530 | [diff] [blame] | 45 | "if test $board_name = am64x_gpevm; then " \ |
| 46 | "setenv fdtfile k3-am642-evm.dtb; fi; " \ |
| 47 | "if test $board_name = am64x_skevm; then " \ |
| 48 | "setenv fdtfile k3-am642-sk.dtb; fi;" \ |
| 49 | "if test $fdtfile = undefined; then " \ |
| 50 | "echo WARNING: Could not determine device tree to use; fi; \0" \ |
Dave Gerlach | 33b7258 | 2021-04-23 11:27:42 -0500 | [diff] [blame] | 51 | "name_kern=Image\0" \ |
| 52 | "console=ttyS2,115200n8\0" \ |
| 53 | "args_all=setenv optargs earlycon=ns16550a,mmio32,0x02800000 " \ |
| 54 | "${mtdparts}\0" \ |
| 55 | "run_kern=booti ${loadaddr} ${rd_spec} ${fdtaddr}\0" |
| 56 | |
| 57 | /* U-Boot MMC-specific configuration */ |
| 58 | #define EXTRA_ENV_AM642_BOARD_SETTINGS_MMC \ |
| 59 | "boot=mmc\0" \ |
| 60 | "mmcdev=1\0" \ |
| 61 | "bootpart=1:2\0" \ |
| 62 | "bootdir=/boot\0" \ |
| 63 | "rd_spec=-\0" \ |
| 64 | "init_mmc=run args_all args_mmc\0" \ |
Lokesh Vutla | 5af71f2 | 2021-05-06 16:44:55 +0530 | [diff] [blame] | 65 | "get_fdt_mmc=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \ |
Dave Gerlach | 33b7258 | 2021-04-23 11:27:42 -0500 | [diff] [blame] | 66 | "get_overlay_mmc=" \ |
| 67 | "fdt address ${fdtaddr};" \ |
| 68 | "fdt resize 0x100000;" \ |
| 69 | "for overlay in $name_overlays;" \ |
| 70 | "do;" \ |
| 71 | "load mmc ${bootpart} ${dtboaddr} ${bootdir}/${overlay} && " \ |
| 72 | "fdt apply ${dtboaddr};" \ |
| 73 | "done;\0" \ |
| 74 | "get_kern_mmc=load mmc ${bootpart} ${loadaddr} " \ |
| 75 | "${bootdir}/${name_kern}\0" \ |
| 76 | "get_fit_mmc=load mmc ${bootpart} ${addr_fit} " \ |
| 77 | "${bootdir}/${name_fit}\0" \ |
| 78 | "partitions=" PARTS_DEFAULT |
| 79 | |
Aswath Govindraju | 3c01557 | 2021-08-04 18:42:46 +0530 | [diff] [blame] | 80 | #define EXTRA_ENV_AM642_BOARD_SETTING_USBMSC \ |
| 81 | "args_usb=run finduuid;setenv bootargs console=${console} " \ |
| 82 | "${optargs} " \ |
| 83 | "root=PARTUUID=${uuid} rw " \ |
| 84 | "rootfstype=${mmcrootfstype}\0" \ |
| 85 | "init_usb=run args_all args_usb\0" \ |
| 86 | "get_fdt_usb=load usb ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \ |
| 87 | "get_overlay_usb=" \ |
| 88 | "fdt address ${fdtaddr};" \ |
| 89 | "fdt resize 0x100000;" \ |
| 90 | "for overlay in $name_overlays;" \ |
| 91 | "do;" \ |
| 92 | "load usb ${bootpart} ${dtboaddr} ${bootdir}/${overlay} && " \ |
| 93 | "fdt apply ${dtboaddr};" \ |
| 94 | "done;\0" \ |
| 95 | "get_kern_usb=load usb ${bootpart} ${loadaddr} " \ |
| 96 | "${bootdir}/${name_kern}\0" \ |
| 97 | "get_fit_usb=load usb ${bootpart} ${addr_fit} " \ |
| 98 | "${bootdir}/${name_fit}\0" \ |
| 99 | "usbboot=setenv boot usb;" \ |
| 100 | "setenv bootpart 0:2;" \ |
| 101 | "usb start;" \ |
| 102 | "run findfdt;" \ |
| 103 | "run init_usb;" \ |
| 104 | "run get_kern_usb;" \ |
| 105 | "run get_fdt_usb;" \ |
| 106 | "run run_kern\0" |
| 107 | |
Aswath Govindraju | ce7ad57 | 2021-06-04 22:00:40 +0530 | [diff] [blame] | 108 | #define EXTRA_ENV_DFUARGS \ |
| 109 | DFU_ALT_INFO_MMC \ |
| 110 | DFU_ALT_INFO_EMMC \ |
| 111 | DFU_ALT_INFO_RAM \ |
| 112 | DFU_ALT_INFO_OSPI |
| 113 | |
Dave Gerlach | 33b7258 | 2021-04-23 11:27:42 -0500 | [diff] [blame] | 114 | /* Incorporate settings into the U-Boot environment */ |
| 115 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
| 116 | DEFAULT_LINUX_BOOT_ENV \ |
| 117 | DEFAULT_MMC_TI_ARGS \ |
| 118 | EXTRA_ENV_AM642_BOARD_SETTINGS \ |
Aswath Govindraju | ce7ad57 | 2021-06-04 22:00:40 +0530 | [diff] [blame] | 119 | EXTRA_ENV_AM642_BOARD_SETTINGS_MMC \ |
Aswath Govindraju | 3c01557 | 2021-08-04 18:42:46 +0530 | [diff] [blame] | 120 | EXTRA_ENV_DFUARGS \ |
| 121 | EXTRA_ENV_AM642_BOARD_SETTING_USBMSC |
Dave Gerlach | 33b7258 | 2021-04-23 11:27:42 -0500 | [diff] [blame] | 122 | |
| 123 | /* Now for the remaining common defines */ |
| 124 | #include <configs/ti_armv7_common.h> |
| 125 | |
Aswath Govindraju | ce7ad57 | 2021-06-04 22:00:40 +0530 | [diff] [blame] | 126 | #define CONFIG_SYS_USB_FAT_BOOT_PARTITION 1 |
| 127 | |
Dave Gerlach | 33b7258 | 2021-04-23 11:27:42 -0500 | [diff] [blame] | 128 | #endif /* __CONFIG_AM642_EVM_H */ |