2018-05-06 21:58:06 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0+
|
2017-07-10 19:45:52 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2017 Texas Instruments, Inc.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <common.h>
|
2019-12-28 17:45:07 +00:00
|
|
|
#include <hang.h>
|
2018-03-04 16:20:11 +00:00
|
|
|
#include <linux/libfdt.h>
|
2017-07-10 19:45:52 +00:00
|
|
|
#include <fdt_support.h>
|
|
|
|
#include <malloc.h>
|
|
|
|
|
|
|
|
#include <asm/omap_common.h>
|
|
|
|
#include <asm/arch-am33xx/sys_proto.h>
|
|
|
|
|
|
|
|
#ifdef CONFIG_TI_SECURE_DEVICE
|
|
|
|
|
2020-06-26 06:13:33 +00:00
|
|
|
static void ft_hs_fixups(void *fdt, struct bd_info *bd)
|
2017-07-10 19:45:52 +00:00
|
|
|
{
|
|
|
|
/* Check we are running on an HS/EMU device type */
|
|
|
|
if (GP_DEVICE != get_device_type()) {
|
|
|
|
if ((ft_hs_disable_rng(fdt, bd) == 0) &&
|
|
|
|
(ft_hs_fixup_dram(fdt, bd) == 0) &&
|
|
|
|
(ft_hs_add_tee(fdt, bd) == 0))
|
|
|
|
return;
|
|
|
|
} else {
|
|
|
|
printf("ERROR: Incorrect device type (GP) detected!");
|
|
|
|
}
|
|
|
|
/* Fixup failed or wrong device type */
|
|
|
|
hang();
|
|
|
|
}
|
|
|
|
#else
|
2020-06-26 06:13:33 +00:00
|
|
|
static void ft_hs_fixups(void *fdt, struct bd_info *bd) { }
|
2017-07-10 19:45:52 +00:00
|
|
|
#endif /* #ifdef CONFIG_TI_SECURE_DEVICE */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Place for general cpu/SoC FDT fixups. Board specific
|
|
|
|
* fixups should remain in the board files which is where
|
|
|
|
* this function should be called from.
|
|
|
|
*/
|
2020-06-26 06:13:33 +00:00
|
|
|
void ft_cpu_setup(void *fdt, struct bd_info *bd)
|
2017-07-10 19:45:52 +00:00
|
|
|
{
|
|
|
|
ft_hs_fixups(fdt, bd);
|
|
|
|
}
|