Dave Gerlach | 3dc33f1 | 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 | 832aed6 | 2021-06-04 22:00:38 +0530 | [diff] [blame] | 15 | #include <asm/arch/am64_hardware.h> |
Aswath Govindraju | f96108b | 2021-06-04 22:00:40 +0530 | [diff] [blame] | 16 | #include <environment/ti/k3_dfu.h> |
Dave Gerlach | 3dc33f1 | 2021-04-23 11:27:42 -0500 | [diff] [blame] | 17 | |
| 18 | /* DDR Configuration */ |
| 19 | #define CONFIG_SYS_SDRAM_BASE1 0x880000000 |
| 20 | |
Dave Gerlach | 3dc33f1 | 2021-04-23 11:27:42 -0500 | [diff] [blame] | 21 | #define PARTS_DEFAULT \ |
| 22 | /* Linux partitions */ \ |
| 23 | "name=rootfs,start=0,size=-,uuid=${uuid_gpt_rootfs}\0" |
| 24 | |
| 25 | /* U-Boot general configuration */ |
| 26 | #define EXTRA_ENV_AM642_BOARD_SETTINGS \ |
Dave Gerlach | 3dc33f1 | 2021-04-23 11:27:42 -0500 | [diff] [blame] | 27 | "findfdt=" \ |
Lokesh Vutla | b658735 | 2021-05-06 16:44:55 +0530 | [diff] [blame] | 28 | "if test $board_name = am64x_gpevm; then " \ |
| 29 | "setenv fdtfile k3-am642-evm.dtb; fi; " \ |
| 30 | "if test $board_name = am64x_skevm; then " \ |
| 31 | "setenv fdtfile k3-am642-sk.dtb; fi;" \ |
| 32 | "if test $fdtfile = undefined; then " \ |
| 33 | "echo WARNING: Could not determine device tree to use; fi; \0" \ |
Dave Gerlach | 3dc33f1 | 2021-04-23 11:27:42 -0500 | [diff] [blame] | 34 | "name_kern=Image\0" \ |
| 35 | "console=ttyS2,115200n8\0" \ |
| 36 | "args_all=setenv optargs earlycon=ns16550a,mmio32,0x02800000 " \ |
| 37 | "${mtdparts}\0" \ |
| 38 | "run_kern=booti ${loadaddr} ${rd_spec} ${fdtaddr}\0" |
| 39 | |
| 40 | /* U-Boot MMC-specific configuration */ |
| 41 | #define EXTRA_ENV_AM642_BOARD_SETTINGS_MMC \ |
| 42 | "boot=mmc\0" \ |
| 43 | "mmcdev=1\0" \ |
| 44 | "bootpart=1:2\0" \ |
| 45 | "bootdir=/boot\0" \ |
| 46 | "rd_spec=-\0" \ |
| 47 | "init_mmc=run args_all args_mmc\0" \ |
Lokesh Vutla | b658735 | 2021-05-06 16:44:55 +0530 | [diff] [blame] | 48 | "get_fdt_mmc=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \ |
Dave Gerlach | 3dc33f1 | 2021-04-23 11:27:42 -0500 | [diff] [blame] | 49 | "get_overlay_mmc=" \ |
| 50 | "fdt address ${fdtaddr};" \ |
| 51 | "fdt resize 0x100000;" \ |
| 52 | "for overlay in $name_overlays;" \ |
| 53 | "do;" \ |
| 54 | "load mmc ${bootpart} ${dtboaddr} ${bootdir}/${overlay} && " \ |
| 55 | "fdt apply ${dtboaddr};" \ |
| 56 | "done;\0" \ |
| 57 | "get_kern_mmc=load mmc ${bootpart} ${loadaddr} " \ |
| 58 | "${bootdir}/${name_kern}\0" \ |
| 59 | "get_fit_mmc=load mmc ${bootpart} ${addr_fit} " \ |
| 60 | "${bootdir}/${name_fit}\0" \ |
| 61 | "partitions=" PARTS_DEFAULT |
| 62 | |
Aswath Govindraju | c92c771 | 2021-08-04 18:42:46 +0530 | [diff] [blame] | 63 | #define EXTRA_ENV_AM642_BOARD_SETTING_USBMSC \ |
| 64 | "args_usb=run finduuid;setenv bootargs console=${console} " \ |
| 65 | "${optargs} " \ |
| 66 | "root=PARTUUID=${uuid} rw " \ |
| 67 | "rootfstype=${mmcrootfstype}\0" \ |
| 68 | "init_usb=run args_all args_usb\0" \ |
| 69 | "get_fdt_usb=load usb ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \ |
| 70 | "get_overlay_usb=" \ |
| 71 | "fdt address ${fdtaddr};" \ |
| 72 | "fdt resize 0x100000;" \ |
| 73 | "for overlay in $name_overlays;" \ |
| 74 | "do;" \ |
| 75 | "load usb ${bootpart} ${dtboaddr} ${bootdir}/${overlay} && " \ |
| 76 | "fdt apply ${dtboaddr};" \ |
| 77 | "done;\0" \ |
| 78 | "get_kern_usb=load usb ${bootpart} ${loadaddr} " \ |
| 79 | "${bootdir}/${name_kern}\0" \ |
| 80 | "get_fit_usb=load usb ${bootpart} ${addr_fit} " \ |
| 81 | "${bootdir}/${name_fit}\0" \ |
| 82 | "usbboot=setenv boot usb;" \ |
| 83 | "setenv bootpart 0:2;" \ |
| 84 | "usb start;" \ |
| 85 | "run findfdt;" \ |
| 86 | "run init_usb;" \ |
| 87 | "run get_kern_usb;" \ |
| 88 | "run get_fdt_usb;" \ |
| 89 | "run run_kern\0" |
| 90 | |
Aswath Govindraju | f96108b | 2021-06-04 22:00:40 +0530 | [diff] [blame] | 91 | #define EXTRA_ENV_DFUARGS \ |
| 92 | DFU_ALT_INFO_MMC \ |
| 93 | DFU_ALT_INFO_EMMC \ |
| 94 | DFU_ALT_INFO_RAM \ |
| 95 | DFU_ALT_INFO_OSPI |
| 96 | |
Dave Gerlach | 3dc33f1 | 2021-04-23 11:27:42 -0500 | [diff] [blame] | 97 | /* Incorporate settings into the U-Boot environment */ |
| 98 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
| 99 | DEFAULT_LINUX_BOOT_ENV \ |
| 100 | DEFAULT_MMC_TI_ARGS \ |
| 101 | EXTRA_ENV_AM642_BOARD_SETTINGS \ |
Aswath Govindraju | f96108b | 2021-06-04 22:00:40 +0530 | [diff] [blame] | 102 | EXTRA_ENV_AM642_BOARD_SETTINGS_MMC \ |
Aswath Govindraju | c92c771 | 2021-08-04 18:42:46 +0530 | [diff] [blame] | 103 | EXTRA_ENV_DFUARGS \ |
| 104 | EXTRA_ENV_AM642_BOARD_SETTING_USBMSC |
Dave Gerlach | 3dc33f1 | 2021-04-23 11:27:42 -0500 | [diff] [blame] | 105 | |
| 106 | /* Now for the remaining common defines */ |
| 107 | #include <configs/ti_armv7_common.h> |
| 108 | |
Aswath Govindraju | f96108b | 2021-06-04 22:00:40 +0530 | [diff] [blame] | 109 | #define CONFIG_SYS_USB_FAT_BOOT_PARTITION 1 |
| 110 | |
Dave Gerlach | 3dc33f1 | 2021-04-23 11:27:42 -0500 | [diff] [blame] | 111 | #endif /* __CONFIG_AM642_EVM_H */ |