summaryrefslogtreecommitdiff
path: root/arch/arm/mach-omap2
diff options
context:
space:
mode:
authorAndrew F. Davis <afd@ti.com>2017-07-10 14:45:52 -0500
committerTom Rini <trini@konsulko.com>2017-07-22 22:22:44 -0400
commitddf013458dd2fa2f269fc03336d617a5c87987b9 (patch)
treee329414b64c1a66afd8ac081bdb5c2a5e8212d37 /arch/arm/mach-omap2
parent137ae0c4b1c4da281a9c4f533242ed547f916578 (diff)
arm: mach-omap2: am33xx: Add FDT fixup suport for AM33xx/AM43xx boards
Similar to what is done with OMAP5 class boards we need to perform fixups common to this SoC class, add support for this here and add HS fixups. Signed-off-by: Andrew F. Davis <afd@ti.com>
Diffstat (limited to 'arch/arm/mach-omap2')
-rw-r--r--arch/arm/mach-omap2/am33xx/Makefile1
-rw-r--r--arch/arm/mach-omap2/am33xx/fdt.c43
2 files changed, 44 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/am33xx/Makefile b/arch/arm/mach-omap2/am33xx/Makefile
index b2f8158e73..9d4f83cb75 100644
--- a/arch/arm/mach-omap2/am33xx/Makefile
+++ b/arch/arm/mach-omap2/am33xx/Makefile
@@ -23,6 +23,7 @@ obj-y += board.o
obj-y += mux.o
obj-y += prcm-regs.o
obj-y += hw_data.o
+obj-y += fdt.o
obj-$(CONFIG_CLOCK_SYNTHESIZER) += clk_synthesizer.o
diff --git a/arch/arm/mach-omap2/am33xx/fdt.c b/arch/arm/mach-omap2/am33xx/fdt.c
new file mode 100644
index 0000000000..02e8243800
--- /dev/null
+++ b/arch/arm/mach-omap2/am33xx/fdt.c
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2017 Texas Instruments, Inc.
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include <common.h>
+#include <libfdt.h>
+#include <fdt_support.h>
+#include <malloc.h>
+
+#include <asm/omap_common.h>
+#include <asm/arch-am33xx/sys_proto.h>
+
+#ifdef CONFIG_TI_SECURE_DEVICE
+
+static void ft_hs_fixups(void *fdt, bd_t *bd)
+{
+ /* 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
+static void ft_hs_fixups(void *fdt, bd_t *bd) { }
+#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.
+ */
+void ft_cpu_setup(void *fdt, bd_t *bd)
+{
+ ft_hs_fixups(fdt, bd);
+}