All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lokesh Vutla <lokeshvutla@ti.com>
To: u-boot@lists.denx.de
Subject: [PATCH 10/18] arm: mach-k3: j7200: Add support for storing extended boot info from ROM
Date: Thu, 23 Jul 2020 14:17:10 +0530	[thread overview]
Message-ID: <20200723084718.19430-11-lokeshvutla@ti.com> (raw)
In-Reply-To: <20200723084718.19430-1-lokeshvutla@ti.com>

Starting J7200 SoC, ROM supports for loading sysfw directly from boot
image. ROM passes this information on number of images that are loaded
to bootloader at  certain location. Add support for storing this
information before it gets corrupted.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
---
 arch/arm/mach-k3/include/mach/hardware.h       | 7 +++++++
 arch/arm/mach-k3/include/mach/j721e_hardware.h | 3 +++
 arch/arm/mach-k3/j721e_init.c                  | 7 +++++--
 3 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-k3/include/mach/hardware.h b/arch/arm/mach-k3/include/mach/hardware.h
index 0ad761418b..02b3df0e1b 100644
--- a/arch/arm/mach-k3/include/mach/hardware.h
+++ b/arch/arm/mach-k3/include/mach/hardware.h
@@ -21,4 +21,11 @@
 #define JTAG_ID_PARTNO_SHIFT	12
 #define JTAG_ID_PARTNO_MASK	(0xffff << 12)
 
+#define K3_ROM_BOOT_HEADER_MAGIC	"EXTBOOT"
+
+struct rom_extended_boot_data {
+	char header[8];
+	u32 num_components;
+};
+
 #endif /* _ASM_ARCH_HARDWARE_H_ */
diff --git a/arch/arm/mach-k3/include/mach/j721e_hardware.h b/arch/arm/mach-k3/include/mach/j721e_hardware.h
index 19873d6e28..b98f0a82f1 100644
--- a/arch/arm/mach-k3/include/mach/j721e_hardware.h
+++ b/arch/arm/mach-k3/include/mach/j721e_hardware.h
@@ -51,6 +51,9 @@
 #define CTRLMMR_LOCK_KICK1				0x0100c
 #define CTRLMMR_LOCK_KICK1_UNLOCK_VAL			0xd172bc5a
 
+/* ROM HANDOFF Structure location */
+#define ROM_ENTENDED_BOOT_DATA_INFO			0x41cffb00
+
 /* MCU SCRATCHPAD usage */
 #define TI_SRAM_SCRATCH_BOARD_EEPROM_START	CONFIG_SYS_K3_MCU_SCRATCHPAD_BASE
 
diff --git a/arch/arm/mach-k3/j721e_init.c b/arch/arm/mach-k3/j721e_init.c
index 63a31c18ce..6246de3a26 100644
--- a/arch/arm/mach-k3/j721e_init.c
+++ b/arch/arm/mach-k3/j721e_init.c
@@ -126,10 +126,13 @@ void k3_mmc_restart_clock(void)
  * it to the .data section.
  */
 u32 bootindex __attribute__((section(".data")));
+static struct rom_extended_boot_data bootdata __section(.data);
 
-static void store_boot_index_from_rom(void)
+static void store_boot_info_from_rom(void)
 {
 	bootindex = *(u32 *)(CONFIG_SYS_K3_BOOT_PARAM_TABLE_INDEX);
+	memcpy(&bootdata, (uintptr_t *)ROM_ENTENDED_BOOT_DATA_INFO,
+	       sizeof(struct rom_extended_boot_data));
 }
 
 void board_init_f(ulong dummy)
@@ -142,7 +145,7 @@ void board_init_f(ulong dummy)
 	 * Cannot delay this further as there is a chance that
 	 * K3_BOOT_PARAM_TABLE_INDEX can be over written by SPL MALLOC section.
 	 */
-	store_boot_index_from_rom();
+	store_boot_info_from_rom();
 
 	/* Make all control module registers accessible */
 	ctrl_mmr_unlock();
-- 
2.27.0

  parent reply	other threads:[~2020-07-23  8:47 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-23  8:47 [PATCH 00/18] arm: mach-k3: Initial support for Texas Instrument's J7200 Platform Lokesh Vutla
2020-07-23  8:47 ` [PATCH 01/18] board: ti: board_detect: Add stub functions for EEPROM detection apis Lokesh Vutla
2020-07-23 17:41   ` Suman Anna
2020-07-23  8:47 ` [PATCH 02/18] board: ti: j721e: Probe eeprom only when CONFIG_TI_I2C_BOARD_DETECT is defined Lokesh Vutla
2020-07-23 17:47   ` Suman Anna
2020-07-23  8:47 ` [PATCH 03/18] board: ti: j721e: Update fdt fixup logic for interconnect nodes Lokesh Vutla
2020-07-23  8:47 ` [PATCH 04/18] arm: mach-k3: Fix platform hang when SPL_MULTI_DTB_FIT is not enabled Lokesh Vutla
2020-07-23  8:47 ` [PATCH 05/18] arm: mach-k3: Move mmr_unlock to a common location Lokesh Vutla
2020-07-23  8:47 ` [PATCH 06/18] arm: mach-k3: sysfw-loader: Add support for rom loading sysfw image Lokesh Vutla
2020-07-23  8:47 ` [PATCH 07/18] arm: mach-k3: j721e: Add detection for j721e Lokesh Vutla
2020-07-24 12:25   ` Grygorii Strashko
2020-07-24 13:10     ` Lokesh Vutla
2020-07-23  8:47 ` [PATCH 08/18] arm: mach-k3: j721e: Fix unlocking control module registers Lokesh Vutla
2020-07-23  8:47 ` [PATCH 09/18] arm: mach-k3: j7200: Add support for SOC detection Lokesh Vutla
2020-07-23  8:47 ` Lokesh Vutla [this message]
2020-07-23  8:47 ` [PATCH 11/18] arm: mach-k3: j7200: Detect if ROM has already loaded sysfw Lokesh Vutla
2020-07-23  8:47 ` [PATCH 12/18] board: ti: j7200: Add board detection support for j7200 Lokesh Vutla
2020-07-23  8:47 ` [PATCH 13/18] ram: k3-j721e: Relax version checks for memory controller Lokesh Vutla
2020-07-23  8:47 ` [PATCH 14/18] mmc: am654_sdhci: Add support for J7200 devices Lokesh Vutla
2020-07-23  9:45   ` Faiz Abbas
2020-07-23  8:47 ` [PATCH 15/18] arm: dts: k3-j7200: Add dts support Lokesh Vutla
2020-07-23  9:50   ` Faiz Abbas
2020-07-24 10:13     ` Lokesh Vutla
2020-07-23  8:47 ` [PATCH 16/18] arm: dts: k3-j7200: Add lpddr4 1600MTs configuration Lokesh Vutla
2020-07-23  8:47 ` [PATCH 17/18] configs: j7200_evm_r5: Add initial support Lokesh Vutla
2020-07-23  8:47 ` [PATCH 18/18] configs: j7200_evm_a72: Add Initial support Lokesh Vutla

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=20200723084718.19430-11-lokeshvutla@ti.com \
    --to=lokeshvutla@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.