public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Andrew F. Davis <afd@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 4/6] arm: mach-omap2: am33xx: Add FDT fixup suport for AM33xx/AM43xx boards
Date: Fri, 16 Jun 2017 14:26:59 -0500	[thread overview]
Message-ID: <20170616192701.7709-5-afd@ti.com> (raw)
In-Reply-To: <20170616192701.7709-1-afd@ti.com>

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>
---
 arch/arm/mach-omap2/am33xx/Makefile |  1 +
 arch/arm/mach-omap2/am33xx/fdt.c    | 43 +++++++++++++++++++++++++++++++++++++
 2 files changed, 44 insertions(+)
 create mode 100644 arch/arm/mach-omap2/am33xx/fdt.c

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);
+}
-- 
2.13.0

  parent reply	other threads:[~2017-06-16 19:26 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-16 19:26 [U-Boot] [PATCH 0/6] AM43xx OP-TEE support Andrew F. Davis
2017-06-16 19:26 ` [U-Boot] [PATCH 1/6] arm: mach-omap2: Move omap5/sec-fxns.c into sec-common.c Andrew F. Davis
2017-06-17  7:31   ` Lokesh Vutla
2017-06-19 12:17   ` Tom Rini
2017-06-16 19:26 ` [U-Boot] [PATCH 2/6] arm: mach-omap2: Factor out common FDT fixup suport Andrew F. Davis
2017-06-17  7:31   ` Lokesh Vutla
2017-06-19 12:17   ` Tom Rini
2017-06-16 19:26 ` [U-Boot] [PATCH 3/6] arm: mach-omap2: fdt-common: Add OP-TEE node when firmware node is defined Andrew F. Davis
2017-06-17  7:32   ` Lokesh Vutla
2017-06-16 19:26 ` Andrew F. Davis [this message]
2017-06-17  7:32   ` [U-Boot] [PATCH 4/6] arm: mach-omap2: am33xx: Add FDT fixup suport for AM33xx/AM43xx boards Lokesh Vutla
2017-06-19 12:17   ` Tom Rini
2017-06-16 19:27 ` [U-Boot] [PATCH 5/6] board: ti: am43xx: Add TEE loading and firewall setup Andrew F. Davis
2017-06-17  7:35   ` Lokesh Vutla
2017-07-10 19:45     ` Andrew F. Davis
2017-06-16 19:27 ` [U-Boot] [PATCH 6/6] board: ti: am43xx: Add FDT fixup for HS devices Andrew F. Davis
2017-06-17  7:33   ` Lokesh Vutla
2017-06-19 12:17   ` Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170616192701.7709-5-afd@ti.com \
    --to=afd@ti.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox