Commit 9d1303b38b0e18392cc3e14943173a3574283306

Authored by Andreas Dannenberg
Committed by Tom Rini
1 parent 9c0ff866b3

armv7R: K3: j721e: 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 J721E early initialization sequence. While
at it also initialize the MCU_UART0 pinmux as it is used by SYSFW
to print diagnostic messages.

Signed-off-by: Andreas Dannenberg <dannenberg@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>

Showing 1 changed file with 30 additions and 0 deletions Side-by-side Diff

arch/arm/mach-k3/j721e_init.c
... ... @@ -11,9 +11,13 @@
11 11 #include <asm/io.h>
12 12 #include <asm/armv7_mpu.h>
13 13 #include <asm/arch/hardware.h>
  14 +#include <asm/arch/sysfw-loader.h>
14 15 #include "common.h"
15 16 #include <asm/arch/sys_proto.h>
16 17 #include <linux/soc/ti/ti_sci_protocol.h>
  18 +#include <dm.h>
  19 +#include <dm/uclass-internal.h>
  20 +#include <dm/pinctrl.h>
17 21  
18 22 #ifdef CONFIG_SPL_BUILD
19 23 static void mmr_unlock(u32 base, u32 partition)
... ... @@ -69,6 +73,10 @@
69 73  
70 74 void board_init_f(ulong dummy)
71 75 {
  76 +#if defined(CONFIG_K3_LOAD_SYSFW)
  77 + struct udevice *dev;
  78 + int ret;
  79 +#endif
72 80 /*
73 81 * Cannot delay this further as there is a chance that
74 82 * K3_BOOT_PARAM_TABLE_INDEX can be over written by SPL MALLOC section.
75 83  
... ... @@ -85,8 +93,30 @@
85 93 /* Init DM early */
86 94 spl_early_init();
87 95  
  96 +#ifdef CONFIG_K3_LOAD_SYSFW
  97 + /*
  98 + * Process pinctrl for the serial0 a.k.a. MCU_UART0 module and continue
  99 + * regardless of the result of pinctrl. Do this without probing the
  100 + * device, but instead by searching the device that would request the
  101 + * given sequence number if probed. The UART will be used by the system
  102 + * firmware (SYSFW) image for various purposes and SYSFW depends on us
  103 + * to initialize its pin settings.
  104 + */
  105 + ret = uclass_find_device_by_seq(UCLASS_SERIAL, 0, true, &dev);
  106 + if (!ret)
  107 + pinctrl_select_state(dev, "default");
  108 +
  109 + /*
  110 + * Load, start up, and configure system controller firmware. Provide
  111 + * the U-Boot console init function to the SYSFW post-PM configuration
  112 + * callback hook, effectively switching on (or over) the console
  113 + * output.
  114 + */
  115 + k3_sysfw_loader(preloader_console_init);
  116 +#else
88 117 /* Prepare console output */
89 118 preloader_console_init();
  119 +#endif
90 120 }
91 121  
92 122 u32 spl_boot_mode(const u32 boot_device)