#include <ram.h>
#include <asm/global_data.h>
#include <asm/system.h>
+#include <mach/stm32mp.h>
DECLARE_GLOBAL_DATA_PTR;
+int optee_get_reserved_memory(u32 *start, u32 *size)
+{
+ fdt_addr_t fdt_mem_size;
+ fdt_addr_t fdt_start;
+ ofnode node;
+
+ node = ofnode_path("/reserved-memory/optee");
+ if (!ofnode_valid(node))
+ return -ENOENT;
+
+ fdt_start = ofnode_get_addr_size(node, "reg", &fdt_mem_size);
+ *start = fdt_start;
+ *size = fdt_mem_size;
+ return (fdt_start < 0) ? fdt_start : 0;
+}
+
int dram_init(void)
{
struct ram_info ram;
--- /dev/null
+/* SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause */
+/*
+ * Copyright (C) 2024, STMicroelectronics - All Rights Reserved
+ */
+
+#ifndef __MACH_STM32MP_H_
+#define __MACH_STM32MP_H_
+
+int optee_get_reserved_memory(u32 *start, u32 *size);
+
+#endif
#include <asm/io.h>
#include <asm/arch/sys_proto.h>
#include <mach/tzc.h>
+#include <mach/stm32mp.h>
#include <linux/libfdt.h>
u32 spl_boot_device(void)
return ram.size;
}
-static int optee_get_reserved_memory(uint32_t *start, uint32_t *size)
-{
- fdt_addr_t fdt_mem_size;
- fdt_addr_t fdt_start;
- ofnode node;
-
- node = ofnode_path("/reserved-memory/optee");
- if (!ofnode_valid(node))
- return -ENOENT;
-
- fdt_start = ofnode_get_addr_size(node, "reg", &fdt_mem_size);
- *start = fdt_start;
- *size = fdt_mem_size;
- return (fdt_start < 0) ? fdt_start : 0;
-}
-
#define CFG_SHMEM_SIZE 0x200000
#define STM32_TZC_NSID_ALL 0xffff
#define STM32_TZC_FILTER_ALL 3