// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (C) 2023 Texas Instruments Incorporated - https://www.ti.com/
 */

#define SPL_BOARD_DTB "spl/dts/ti/k3-j784s4-evm.dtb"
#define BOARD_DESCRIPTION "k3-j784s4-evm"
#define UBOOT_BOARD_DESCRIPTION "U-Boot for J784S4 board"

#include "k3-j784s4-binman.dtsi"

#if defined(CONFIG_CPU_V7R)

&binman {
	tiboot3-j784s4-hs {
		insert-template = <&tiboot3_j784s4_hs>;
		filename = "tiboot3-j784s4-hs-evm.bin";
	};

	tiboot3-j784s4-hs-fs {
		insert-template = <&tiboot3_j784s4_hs_fs>;
		filename = "tiboot3-j784s4-hs-fs-evm.bin";
	};

	tiboot3-j784s4-gp {
		insert-template = <&tiboot3_j784s4_gp>;
		filename = "tiboot3-j784s4-gp-evm.bin";
		symlink = "tiboot3.bin";
	};
};

&ti_fs_gp {
	filename = "ti-sysfw/ti-fs-firmware-j784s4-gp.bin";
};

&ti_fs_enc {
	filename = "ti-sysfw/ti-fs-firmware-j784s4-hs-enc.bin";
};

&sysfw_inner_cert {
	filename = "ti-sysfw/ti-fs-firmware-j784s4-hs-cert.bin";
};

&ti_fs_enc_fs {
	filename = "ti-sysfw/ti-fs-firmware-j784s4-hs-fs-enc.bin";
};

&sysfw_inner_cert_fs {
	filename = "ti-sysfw/ti-fs-firmware-j784s4-hs-fs-cert.bin";
};

#else // CONFIG_ARM64

&binman {
	tispl {
		insert-template = <&ti_spl>;

		fit {
			images {
				dm {
					ti-dm {
						filename = "ti-dm/j784s4/ipc_echo_testb_mcu1_0_release_strip.xer5f";
					};
				};
			};
		};
	};

	u-boot {
		insert-template = <&u_boot>;
	};

	tispl-unsigned {
		insert-template = <&ti_spl_unsigned>;

		fit {
			images {
				dm {
					ti-dm {
						filename = "ti-dm/j784s4/ipc_echo_testb_mcu1_0_release_strip.xer5f";
					};
				};
			};
		};
	};

	u-boot-unsigned {
		insert-template = <&u_boot_unsigned>;
	};
};

#endif

/ {
	memory@80000000 {
		bootph-all;
	};
};

&mcu_udmap {
	reg =   <0x0 0x285c0000 0x0 0x100>,
		<0x0 0x284c0000 0x0 0x4000>,
		<0x0 0x2a800000 0x0 0x40000>,
		<0x0 0x284a0000 0x0 0x4000>,
		<0x0 0x2aa00000 0x0 0x40000>,
		<0x0 0x28400000 0x0 0x2000>;
	reg-names = "gcfg", "rchan", "rchanrt", "tchan",
		    "tchanrt", "rflow";
	bootph-pre-ram;
};
