summaryrefslogtreecommitdiff
path: root/arch/arm/mach-k3
diff options
context:
space:
mode:
authorDave Gerlach <d-gerlach@ti.com>2021-04-23 19:27:36 +0300
committerLokesh Vutla <lokeshvutla@ti.com>2021-05-12 13:57:57 +0300
commitd2edabfa8de56460bfe1641f019d793c6d685a14 (patch)
tree8554642a75a1b132845648ce981403fcea4f3224 /arch/arm/mach-k3
parent6d52c9dd9022314f494c087fbd7dc68836896523 (diff)
downloadu-boot-d2edabfa8de56460bfe1641f019d793c6d685a14.tar.xz
arm: mach-k3: am642: Load SYSFW binary and config from boot media
Use the System Firmware (SYSFW) loader framework to load and start the SYSFW as part of the AM642 early initialization sequence. Also make use of existing logic to detect if ROM has already loaded sysfw and avoided attempting to reload and instead just prepare to use already running firmware. While at it also initialize the MAIN_UART1 pinmux as it is used by SYSFW to print diagnostic messages. Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
Diffstat (limited to 'arch/arm/mach-k3')
-rw-r--r--arch/arm/mach-k3/am642_init.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/arch/arm/mach-k3/am642_init.c b/arch/arm/mach-k3/am642_init.c
index 08f0b736a1..b2c3774854 100644
--- a/arch/arm/mach-k3/am642_init.c
+++ b/arch/arm/mach-k3/am642_init.c
@@ -11,7 +11,14 @@
#include <spl.h>
#include <asm/io.h>
#include <asm/arch/hardware.h>
+#include <asm/arch/sysfw-loader.h>
+#include <asm/arch/sys_proto.h>
#include "common.h"
+#include <asm/arch/sys_proto.h>
+#include <linux/soc/ti/ti_sci_protocol.h>
+#include <dm.h>
+#include <dm/uclass-internal.h>
+#include <dm/pinctrl.h>
#if defined(CONFIG_SPL_BUILD)
@@ -46,6 +53,11 @@ static void store_boot_info_from_rom(void)
void board_init_f(ulong dummy)
{
+#if defined(CONFIG_K3_LOAD_SYSFW)
+ struct udevice *dev;
+ int ret;
+#endif
+
#if defined(CONFIG_CPU_V7R)
setup_k3_mpu_regions();
#endif
@@ -62,6 +74,31 @@ void board_init_f(ulong dummy)
spl_early_init();
preloader_console_init();
+
+#if defined(CONFIG_K3_LOAD_SYSFW)
+ /*
+ * Process pinctrl for serial3 a.k.a. MAIN UART1 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, 3, &dev);
+ if (!ret)
+ pinctrl_select_state(dev, "default");
+
+ /*
+ * Load, start up, and configure system controller firmware.
+ * This will determine whether or not ROM has already loaded
+ * system firmware and if so, will only perform needed config
+ * and not attempt to load firmware again.
+ */
+ k3_sysfw_loader(is_rom_loaded_sysfw(&bootdata), NULL, NULL);
+#endif
+
+ /* Output System Firmware version info */
+ k3_sysfw_print_ver();
}
u32 spl_boot_mode(const u32 boot_device)