public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Andrew Davis <afd@ti.com>
To: Neha Malcom Francis <n-francis@ti.com>,
	Simon Glass <sjg@chromium.org>, Tom Rini <trini@konsulko.com>,
	Vignesh Raghavendra <vigneshr@ti.com>, Nishanth Menon <nm@ti.com>
Cc: <u-boot@lists.denx.de>, Andrew Davis <afd@ti.com>
Subject: [PATCH 3/3] arm: mach-k3: Move sysfw-loader into R5 directory
Date: Tue, 14 Nov 2023 09:59:50 -0600	[thread overview]
Message-ID: <20231114155950.296644-3-afd@ti.com> (raw)
In-Reply-To: <20231114155950.296644-1-afd@ti.com>

SYSFW is only ever loaded by the R5 core, move the code into that
directory. While here also move the related Kconfig symbols.

Signed-off-by: Andrew Davis <afd@ti.com>
---
 arch/arm/mach-k3/Kconfig                 | 51 ++----------------------
 arch/arm/mach-k3/Makefile                |  1 -
 arch/arm/mach-k3/r5/Kconfig              | 45 +++++++++++++++++++++
 arch/arm/mach-k3/r5/Makefile             |  4 ++
 arch/arm/mach-k3/{ => r5}/sysfw-loader.c |  2 +-
 5 files changed, 54 insertions(+), 49 deletions(-)
 create mode 100644 arch/arm/mach-k3/r5/Kconfig
 rename arch/arm/mach-k3/{ => r5}/sysfw-loader.c (99%)

diff --git a/arch/arm/mach-k3/Kconfig b/arch/arm/mach-k3/Kconfig
index 4d19cf3e353..ced7d3bcba6 100644
--- a/arch/arm/mach-k3/Kconfig
+++ b/arch/arm/mach-k3/Kconfig
@@ -109,53 +109,6 @@ config K3_EARLY_CONS_IDX
 	  Use this option to set the index of the serial device to be used
 	  for the early console during SPL execution.
 
-config K3_LOAD_SYSFW
-	bool
-	depends on CPU_V7R
-
-config K3_SYSFW_IMAGE_NAME
-	string "File name of SYSFW firmware and configuration blob"
-	depends on K3_LOAD_SYSFW
-	default	"sysfw.itb"
-	help
-	  Filename of the combined System Firmware and configuration image tree
-	  blob to be loaded when booting from a filesystem.
-
-config K3_SYSFW_IMAGE_MMCSD_RAW_MODE_SECT
-	hex "MMC sector to load SYSFW firmware and configuration blob from"
-	depends on K3_LOAD_SYSFW && SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR
-	default 0x3600
-	help
-	  Address on the MMC to load the combined System Firmware and
-	  configuration image tree blob from, when the MMC is being used
-	  in raw mode. Units: MMC sectors (1 sector = 512 bytes).
-
-config K3_SYSFW_IMAGE_MMCSD_RAW_MODE_PART
-	hex "MMC partition to load SYSFW firmware and configuration blob from"
-	depends on K3_LOAD_SYSFW && SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION
-	default 2
-	help
-	  Partition on the MMC to the combined System Firmware and configuration
-	  image tree blob from, when the MMC is being used in raw mode.
-
-config K3_SYSFW_IMAGE_SIZE_MAX
-	int "Amount of memory dynamically allocated for loading SYSFW blob"
-	depends on K3_LOAD_SYSFW
-	default	280000
-	help
-	  Amount of memory (in bytes) reserved through dynamic allocation at
-	  runtime for loading the combined System Firmware and configuration image
-	  tree blob. Keep it as tight as possible, as this directly affects the
-	  overall SPL memory footprint.
-
-config K3_SYSFW_IMAGE_SPI_OFFS
-	hex "SPI offset of SYSFW firmware and configuration blob"
-	depends on K3_LOAD_SYSFW
-	default	0x6C0000
-	help
-	  Offset of the combined System Firmware and configuration image tree
-	  blob to be loaded when booting from a SPI flash memory.
-
 config SYS_K3_SPL_ATF
 	bool "Start Cortex-A from SPL"
 	depends on CPU_V7R
@@ -187,6 +140,10 @@ config K3_X509_SWRV
 	help
 	  SWRV for X509 certificate used for boot images
 
+if CPU_V7R
+source "arch/arm/mach-k3/r5/Kconfig"
+endif
+
 source "board/ti/am65x/Kconfig"
 source "board/ti/am64x/Kconfig"
 source "board/ti/am62x/Kconfig"
diff --git a/arch/arm/mach-k3/Makefile b/arch/arm/mach-k3/Makefile
index 215c755c5dc..42161376469 100644
--- a/arch/arm/mach-k3/Makefile
+++ b/arch/arm/mach-k3/Makefile
@@ -20,6 +20,5 @@ obj-$(CONFIG_SOC_K3_J721S2) += j721s2_init.o
 obj-$(CONFIG_SOC_K3_AM642) += am642_init.o
 obj-$(CONFIG_SOC_K3_AM625) += am625_init.o
 obj-$(CONFIG_SOC_K3_AM62A7) += am62a7_init.o
-obj-$(CONFIG_K3_LOAD_SYSFW) += sysfw-loader.o
 endif
 obj-y += common.o security.o
diff --git a/arch/arm/mach-k3/r5/Kconfig b/arch/arm/mach-k3/r5/Kconfig
new file mode 100644
index 00000000000..ae79f8ff6cd
--- /dev/null
+++ b/arch/arm/mach-k3/r5/Kconfig
@@ -0,0 +1,45 @@
+config K3_LOAD_SYSFW
+	bool
+
+config K3_SYSFW_IMAGE_NAME
+	string "File name of SYSFW firmware and configuration blob"
+	depends on K3_LOAD_SYSFW
+	default	"sysfw.itb"
+	help
+	  Filename of the combined System Firmware and configuration image tree
+	  blob to be loaded when booting from a filesystem.
+
+config K3_SYSFW_IMAGE_MMCSD_RAW_MODE_SECT
+	hex "MMC sector to load SYSFW firmware and configuration blob from"
+	depends on K3_LOAD_SYSFW && SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR
+	default 0x3600
+	help
+	  Address on the MMC to load the combined System Firmware and
+	  configuration image tree blob from, when the MMC is being used
+	  in raw mode. Units: MMC sectors (1 sector = 512 bytes).
+
+config K3_SYSFW_IMAGE_MMCSD_RAW_MODE_PART
+	hex "MMC partition to load SYSFW firmware and configuration blob from"
+	depends on K3_LOAD_SYSFW && SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION
+	default 2
+	help
+	  Partition on the MMC to the combined System Firmware and configuration
+	  image tree blob from, when the MMC is being used in raw mode.
+
+config K3_SYSFW_IMAGE_SIZE_MAX
+	int "Amount of memory dynamically allocated for loading SYSFW blob"
+	depends on K3_LOAD_SYSFW
+	default	280000
+	help
+	  Amount of memory (in bytes) reserved through dynamic allocation at
+	  runtime for loading the combined System Firmware and configuration image
+	  tree blob. Keep it as tight as possible, as this directly affects the
+	  overall SPL memory footprint.
+
+config K3_SYSFW_IMAGE_SPI_OFFS
+	hex "SPI offset of SYSFW firmware and configuration blob"
+	depends on K3_LOAD_SYSFW
+	default	0x6C0000
+	help
+	  Offset of the combined System Firmware and configuration image tree
+	  blob to be loaded when booting from a SPI flash memory.
diff --git a/arch/arm/mach-k3/r5/Makefile b/arch/arm/mach-k3/r5/Makefile
index 8a6af73a44e..b99199d3374 100644
--- a/arch/arm/mach-k3/r5/Makefile
+++ b/arch/arm/mach-k3/r5/Makefile
@@ -11,3 +11,7 @@ obj-$(CONFIG_SOC_K3_AM62A7) += am62ax/
 
 obj-y += lowlevel_init.o
 obj-y += r5_mpu.o
+
+ifeq ($(CONFIG_SPL_BUILD),y)
+obj-$(CONFIG_K3_LOAD_SYSFW) += sysfw-loader.o
+endif
diff --git a/arch/arm/mach-k3/sysfw-loader.c b/arch/arm/mach-k3/r5/sysfw-loader.c
similarity index 99%
rename from arch/arm/mach-k3/sysfw-loader.c
rename to arch/arm/mach-k3/r5/sysfw-loader.c
index 73a17276e12..51e3b3cd1ca 100644
--- a/arch/arm/mach-k3/sysfw-loader.c
+++ b/arch/arm/mach-k3/r5/sysfw-loader.c
@@ -23,7 +23,7 @@
 #include <spi_flash.h>
 
 #include <asm/io.h>
-#include "common.h"
+#include "../common.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
-- 
2.39.2


  parent reply	other threads:[~2023-11-14 16:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-14 15:59 [PATCH 1/3] arm: mach-k3: Move R5 specific code into new r5/ directory Andrew Davis
2023-11-14 15:59 ` [PATCH 2/3] arm: mach-k3: Remove incorrect checks for SPL build Andrew Davis
2023-11-14 15:59 ` Andrew Davis [this message]
2023-11-15  6:01 ` [PATCH 1/3] arm: mach-k3: Move R5 specific code into new r5/ directory Neha Malcom Francis
2023-11-22 20:49 ` 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=20231114155950.296644-3-afd@ti.com \
    --to=afd@ti.com \
    --cc=n-francis@ti.com \
    --cc=nm@ti.com \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=vigneshr@ti.com \
    /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