All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andreas Dannenberg <dannenberg@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 07/13] armV7R: K3: am654: Load SYSFW binary and config from boot media
Date: Tue, 7 May 2019 12:25:36 -0500	[thread overview]
Message-ID: <20190507172542.31359-8-dannenberg@ti.com> (raw)
In-Reply-To: <20190507172542.31359-1-dannenberg@ti.com>

Use the System Firmware (SYSFW) loader framework to load and start
the SYSFW as part of the AM654 early initialization sequence. While
at it also initialize the WKUP_UART0 pinmux as it is used by SYSFW
to print diagnostic messages.

Signed-off-by: Andreas Dannenberg <dannenberg@ti.com>
---
 arch/arm/mach-k3/am6_init.c | 27 ++++++++++++++++++++++++++-
 board/ti/am65x/Kconfig      |  1 +
 2 files changed, 27 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-k3/am6_init.c b/arch/arm/mach-k3/am6_init.c
index dfa6d60adf..08f2eb9438 100644
--- a/arch/arm/mach-k3/am6_init.c
+++ b/arch/arm/mach-k3/am6_init.c
@@ -10,8 +10,11 @@
 #include <asm/io.h>
 #include <spl.h>
 #include <asm/arch/hardware.h>
+#include <asm/arch/sysfw-loader.h>
 #include "common.h"
 #include <dm.h>
+#include <dm/uclass-internal.h>
+#include <dm/pinctrl.h>
 
 #ifdef CONFIG_SPL_BUILD
 static void mmr_unlock(u32 base, u32 partition)
@@ -63,7 +66,7 @@ static void store_boot_index_from_rom(void)
 
 void board_init_f(ulong dummy)
 {
-#if defined(CONFIG_K3_AM654_DDRSS)
+#if defined(CONFIG_K3_LOAD_SYSFW) || defined(CONFIG_K3_AM654_DDRSS)
 	struct udevice *dev;
 	int ret;
 #endif
@@ -90,8 +93,30 @@ void board_init_f(ulong dummy)
 	/* Init DM early in-order to invoke system controller */
 	spl_early_init();
 
+#ifdef CONFIG_K3_LOAD_SYSFW
+	/*
+	 * Process pinctrl for the serial0 a.k.a. WKUP_UART0 module and continue
+	 * regardless of the result of pinctrl. Do this without probing the
+	 * device, but instead by searching the device that would request the
+	 * given sequence number if probed. The UART will be used by the system
+	 * firmware (SYSFW) image for various purposes and SYSFW depends on us
+	 * to initialize its pin settings.
+	 */
+	ret = uclass_find_device_by_seq(UCLASS_SERIAL, 0, true, &dev);
+	if (!ret)
+		pinctrl_select_state(dev, "default");
+
+	/*
+	 * Load, start up, and configure system controller firmware. Provide
+	 * the U-Boot console init function to the SYSFW post-PM configuration
+	 * callback hook, effectively switching on (or over) the console
+	 * output.
+	 */
+	k3_sysfw_loader(preloader_console_init);
+#else
 	/* Prepare console output */
 	preloader_console_init();
+#endif
 
 #ifdef CONFIG_K3_AM654_DDRSS
 	ret = uclass_get_device(UCLASS_RAM, 0, &dev);
diff --git a/board/ti/am65x/Kconfig b/board/ti/am65x/Kconfig
index 98172c28f5..60bb834aca 100644
--- a/board/ti/am65x/Kconfig
+++ b/board/ti/am65x/Kconfig
@@ -18,6 +18,7 @@ config TARGET_AM654_R5_EVM
 	select CPU_V7R
 	select SYS_THUMB_BUILD
 	select SOC_K3_AM6
+	select K3_LOAD_SYSFW
 	select K3_AM654_DDRSS
 	imply SYS_K3_SPL_ATF
 
-- 
2.17.1

  parent reply	other threads:[~2019-05-07 17:25 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-07 17:25 [U-Boot] [PATCH 00/13] System Firmware Loader for TI K3 family SoCs Andreas Dannenberg
2019-05-07 17:25 ` [U-Boot] [PATCH 01/13] mmc: k3_arasan: Allow driver to probe without PDs specified Andreas Dannenberg
2019-05-15 15:17   ` Tom Rini
2019-05-07 17:25 ` [U-Boot] [PATCH 02/13] spl: Allow skipping clearing BSS during relocation Andreas Dannenberg
2019-05-15 15:17   ` Tom Rini
2019-05-07 17:25 ` [U-Boot] [PATCH 03/13] spl: Make image loader infrastructure more universal Andreas Dannenberg
2019-05-15 15:17   ` Tom Rini
2019-05-07 17:25 ` [U-Boot] [PATCH 04/13] arm: K3: Introduce System Firmware loader framework Andreas Dannenberg
2019-05-07 18:16   ` Simon Goldschmidt
2019-05-07 19:17     ` Andreas Dannenberg
2019-05-07 19:21       ` Simon Goldschmidt
2019-05-15 15:17   ` Tom Rini
2019-05-15 21:39     ` Andreas Dannenberg
2019-05-15 21:50       ` Tom Rini
2019-05-16 15:47         ` Andreas Dannenberg
2019-05-16 19:14           ` Andreas Dannenberg
2019-05-17 11:20             ` Tom Rini
2019-05-07 17:25 ` [U-Boot] [PATCH 05/13] armV7R: K3: am654: Allow using SPL BSS pre-relocation Andreas Dannenberg
2019-05-07 17:25 ` [U-Boot] [PATCH 06/13] armv7R: K3: am654: Use full malloc implementation in SPL Andreas Dannenberg
2019-05-07 17:25 ` Andreas Dannenberg [this message]
2019-05-07 17:25 ` [U-Boot] [PATCH 08/13] armv7R: dts: k3: am654: Update mmc nodes for loading sysfw Andreas Dannenberg
2019-05-07 17:25 ` [U-Boot] [PATCH 09/13] configs: am65x_evm_r5: All sysfw to be loaded via MMC Andreas Dannenberg
2019-05-07 17:25 ` [U-Boot] [PATCH 10/13] configs: am65x_hs_evm_r5: " Andreas Dannenberg
2019-05-18 16:08   ` Simon Glass
2019-05-07 17:25 ` [U-Boot] [PATCH 11/13] configs: am65x_evm: Add Support for eMMC boot Andreas Dannenberg
2019-05-07 17:25 ` [U-Boot] [PATCH 12/13] configs: am65x_hs_evm: " Andreas Dannenberg
2019-05-07 17:25 ` [U-Boot] [PATCH 13/13] am65x: README: Add eMMC layout and flash instructions Andreas Dannenberg
2019-05-07 20:00 ` [U-Boot] [PATCH 00/13] System Firmware Loader for TI K3 family SoCs Simon Goldschmidt
2019-05-08  4:31   ` Chee, Tien Fong
2019-05-08 18:43     ` dannenberg at ti.com
2019-05-13 13:37       ` Chee, Tien Fong
2019-05-15 21:24         ` dannenberg at ti.com
2019-05-08 18:04   ` Andreas Dannenberg
2019-05-08 18:57     ` Simon Goldschmidt
2019-05-15 15:16 ` Tom Rini
2019-05-15 20:31   ` Andreas Dannenberg
2019-05-16 20:32   ` Andreas Dannenberg

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=20190507172542.31359-8-dannenberg@ti.com \
    --to=dannenberg@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.