Skip to contentSkip to conversation

Hyperflash Boot fixes for J7200/J721E

PATCH In review Anurag Dutta 2 participants 10 messages Nov 29, 2024 – Dec 15, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover Hyperflash Boot fixes for J7200/J721E

Hi All,
In u-boot, hbmc is broken and has been removed from j7200 configs. This series re-enables the hbmc driver and introduces a series of hyperflash boot fixes. At present, in u-boot, the parent device (fss) gets registered as a syscon device. This is done because the MMIO mux driver in u-boot did not support the mux functionality when the parent device is not a syscon. In this series, we make relevant changes in the hbmc driver as well as dts' so that we can use the reg-mux driver for selecting the appropriate state of the mux.

Test logs:

1) j721e-idk-gw hyperflash boot test: https://gist.github.com/anuragdutta731/50aae6fec707a3ffad6d985de6757fe4
2) j7200-evm hyperflash boot test: https://gist.github.com/anuragdutta731/c3a4d60f8bfd9c425d6c44b36eb7322b

Anurag Dutta (3):
mux: Makefile: Add config for mux drivers
mtd: HBMC-AM654: Changed syscon API to mux APIs
mtd: Kconfig: Change HBMC driver's dependency to MULTIPLEXER and
MUX_MMIO

Aswath Govindraju (1):
include: configs: j721e_evm: Increase memory offset for tiboot3.bin in
HyperFlash

Vaishnav Achath (4):
arm: dts: k3-j7200-r5-common: Add HBMC overrides for R5 SPL
arm: dts: k3-j721e-r5-common: Add HBMC overrides for R5 SPL
configs: j721e_evm_*_defconfig: Add configs for Hyperflash boot
configs: j7200_evm_*_defconfig: Add configs for Hyperflash boot

 arch/arm/dts/k3-j7200-r5-common-proc-board.dts |  7 +++++++
 arch/arm/dts/k3-j721e-r5-common-proc-board.dts |  7 +++++++
 configs/j7200_evm_a72_defconfig                |  4 +++-
 configs/j7200_evm_r5_defconfig                 |  4 ++++
 configs/j721e_evm_a72_defconfig                |  4 +++-
 configs/j721e_evm_r5_defconfig                 |  4 ++++
 drivers/Makefile                               |  1 +
 drivers/mtd/Kconfig                            |  2 +-
 drivers/mtd/hbmc-am654.c                       | 10 +++++++---
 include/configs/j721e_evm.h                    |  9 ++++++---
 10 files changed, 43 insertions(+), 9 deletions(-)
Signature · 1 line
2.34.1
#1 lore raw

PATCH 1/8 mux: Makefile: Add config for mux drivers

Add config required to build mmio-mux driver and dependencies.

---
 drivers/Makefile | 1 +
 1 file changed, 1 insertion(+)
drivers/Makefile +1 -0
index 9440af1b09..0e1f58c515 100644
@@ -21,6 +21,7 @@ obj-$(CONFIG_$(PHASE_)INPUT) += input/
 obj-$(CONFIG_$(PHASE_)LED) += led/
 obj-$(CONFIG_$(PHASE_)MMC) += mmc/
 obj-y += mtd/
+obj-$(CONFIG_MULTIPLEXER) += mux/
 obj-$(CONFIG_$(PHASE_)ETH) += net/
 obj-$(CONFIG_$(PHASE_)PCH) += pch/
 obj-$(CONFIG_$(PHASE_)PCI) += pci/
Signature · 1 line
2.34.1
#2 lore raw

PATCH 2/8 mtd: HBMC-AM654: Changed syscon API to mux APIs

In reply to Anurag Dutta

The syscon APIs were used for selecting the state of the mux device because the mmio-mux driver in u-boot did not support the mux functionality when the parent device is not a syscon. Change to mux APIs which utilizes the reg-mux driver to select the state of the multiplexer.

---
 drivers/mtd/hbmc-am654.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
drivers/mtd/hbmc-am654.c +7 -3
index 599beda30d..98988a8e24 100644
@@ -5,8 +5,8 @@
 
 #include <asm/io.h>
 #include <dm.h>
+#include <mux.h>
 #include <regmap.h>
-#include <syscon.h>
 #include <dm/device_compat.h>
 
 #define FSS_SYSC_REG	0x4
@@ -52,9 +52,13 @@ static int am654_hyperbus_calibrate(struct udevice *dev)
 
 static int am654_select_hbmc(struct udevice *dev)
 {
-	struct regmap *regmap = syscon_get_regmap(dev_get_parent(dev));
+	struct mux_control *mux_ctl;
+	int ret;
 
-	return regmap_update_bits(regmap, FSS_SYSC_REG, 0x2, 0x2);
+	ret = mux_get_by_index(dev, 0, &mux_ctl);
+	if (!ret)
+		ret = mux_control_select(mux_ctl, 1);
+	return ret;
 }
 
 static int am654_hbmc_bind(struct udevice *dev)
Signature · 1 line
2.34.1
#3 lore raw

PATCH 3/8 arm: dts: k3-j7200-r5-common: Add HBMC overrides for R5 SPL

In reply to Anurag Dutta

From: Vaishnav Achath <[email protected]>

Add 32-bit address overrides for Hyper Bus Memory Controller for Hyperflash to be functional in R5 SPL.

---
 arch/arm/dts/k3-j7200-r5-common-proc-board.dts | 7 +++++++
 1 file changed, 7 insertions(+)
arch/arm/dts/k3-j7200-r5-common-proc-board.dts +7 -0
index f096b10279..aeb5040a17 100644
@@ -96,6 +96,13 @@
 	         <0x0 0x50000000 0x0 0x50000000 0x0 0x08000000>;
 };
 
+&hbmc {
+	reg = <0x0 0x47040000 0x0 0x100>,
+		<0x0 0x50000000 0x0 0x8000000>;
+	ranges = <0x0 0x0 0x0 0x50000000 0x4000000>,
+		<0x1 0x0 0x0 0x54000000 0x800000>;
+};
+
 &mcu_ringacc {
     ti,sci = <&dm_tifs>;
 };
Signature · 1 line
2.34.1
#4 lore raw

PATCH 4/8 arm: dts: k3-j721e-r5-common: Add HBMC overrides for R5 SPL

In reply to Anurag Dutta

From: Vaishnav Achath <[email protected]>

Add 32-bit address overrides for Hyper Bus Memory Controller for Hyperflash to be functional in R5 SPL.

---
 arch/arm/dts/k3-j721e-r5-common-proc-board.dts | 7 +++++++
 1 file changed, 7 insertions(+)
arch/arm/dts/k3-j721e-r5-common-proc-board.dts +7 -0
index ce55ea6bae..c775432505 100644
@@ -51,6 +51,13 @@
 	bootph-pre-ram;
 };
 
+&hbmc {
+	reg = <0x0 0x47040000 0x0 0x100>,
+		<0x0 0x50000000 0x0 0x8000000>;
+	ranges = <0x0 0x0 0x0 0x50000000 0x4000000>,
+		 <0x1 0x0 0x0 0x54000000 0x800000>;
+};
+
 &ospi0 {
 	/* Address change for data region (32-bit) */
 	reg = <0x0 0x47040000 0x0 0x100>,
Signature · 1 line
2.34.1
#5 lore raw

PATCH 5/8 configs: j721e_evm_*_defconfig: Add configs for Hyperflash boot

In reply to Anurag Dutta

From: Vaishnav Achath <[email protected]>

Kernel commit 5b2671594b80 ("configs: j721e: Remove HBMC_AM654 config") removed the HBMC_AM654 config because hbmc was broken in u-boot. Hence, add the missing configs necessary to re-enable Hyperflash boot.

---
 configs/j721e_evm_a72_defconfig | 4 +++-
 configs/j721e_evm_r5_defconfig  | 4 ++++
 2 files changed, 7 insertions(+), 1 deletion(-)
configs/j721e_evm_a72_defconfig +3 -1
index bd55634924..d742ae6934 100644
@@ -140,11 +140,13 @@ CONFIG_MMC_SDHCI_AM654=y
 CONFIG_MTD=y
 CONFIG_DM_MTD=y
 CONFIG_MTD_NOR_FLASH=y
+CONFIG_SYS_FLASH_CFI_WIDTH_16BIT=y
 CONFIG_FLASH_SHOW_PROGRESS=0
 CONFIG_CFI_FLASH=y
 CONFIG_SYS_FLASH_USE_BUFFER_WRITE=y
 CONFIG_FLASH_CFI_MTD=y
 CONFIG_SYS_FLASH_CFI=y
+CONFIG_HBMC_AM654=y
 CONFIG_SYS_MAX_FLASH_BANKS_DETECT=y
 CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH_SFDP_SUPPORT=y
@@ -157,7 +159,7 @@ CONFIG_SPI_FLASH_MT35XU=y
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
 CONFIG_SPI_FLASH_MTD=y
 CONFIG_MULTIPLEXER=y
-CONFIG_MUX_MMIO=y
+CONFIG_SPL_MUX_MMIO=y
 CONFIG_PHY_TI_DP83867=y
 CONFIG_PHY_FIXED=y
 CONFIG_TI_AM65_CPSW_NUSS=y
configs/j721e_evm_r5_defconfig +4 -0
index 00546aea27..a593fed50a 100644
@@ -121,11 +121,13 @@ CONFIG_MMC_SDHCI_AM654=y
 CONFIG_MTD=y
 CONFIG_DM_MTD=y
 CONFIG_MTD_NOR_FLASH=y
+CONFIG_SYS_FLASH_CFI_WIDTH_16BIT=y
 CONFIG_FLASH_SHOW_PROGRESS=0
 CONFIG_CFI_FLASH=y
 CONFIG_SYS_FLASH_USE_BUFFER_WRITE=y
 CONFIG_FLASH_CFI_MTD=y
 CONFIG_SYS_FLASH_CFI=y
+CONFIG_HBMC_AM654=y
 CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH_SFDP_SUPPORT=y
 CONFIG_SPI_FLASH_SOFT_RESET=y
@@ -134,6 +136,8 @@ CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_SPI_FLASH_S28HX_T=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_SPI_FLASH_MT35XU=y
+CONFIG_MULTIPLEXER=y
+CONFIG_MUX_MMIO=y
 CONFIG_PINCTRL=y
 # CONFIG_PINCTRL_GENERIC is not set
 CONFIG_SPL_PINCTRL=y
Signature · 1 line
2.34.1
#6 lore raw

PATCH 6/8 include: configs: j721e_evm: Increase memory offset for tiboot3.bin in HyperFlash

In reply to Anurag Dutta

From: Aswath Govindraju <[email protected]>

The size of J7200 tiboot3.bin is 516KB but the memory reserved for it in HyperFlash was 512KB. This led to overlap of tiboot3.bin over tispl.bin region and break in HyperFlash boot mode.

Therefore, fix this by increasing the memory allocated for tiboot3.bin to 1MB for J7200.

Fixes cf1d6867f774 ("board: ti: j7200: Introduce support for j7200 build targets")
---
 include/configs/j721e_evm.h | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
include/configs/j721e_evm.h +6 -3
index bdf12ee8f7..8512062952 100644
@@ -15,11 +15,14 @@
 #define CFG_SYS_FLASH_BASE		0x000000000
 
 /* SPL Loader Configuration */
-#if defined(CONFIG_TARGET_J721E_A72_EVM) || defined(CONFIG_TARGET_J7200_A72_EVM)
+#if defined(CONFIG_TARGET_J721E_A72_EVM)
 #define CFG_SYS_UBOOT_BASE		0x50280000
-/* Image load address in RAM for DFU boot*/
-#else
+#elif defined(CONFIG_TARGET_J7200_A72_EVM)
+#define CFG_SYS_UBOOT_BASE		0x50300000
+#elif defined(CONFIG_TARGET_J721E_R5_EVM)
 #define CFG_SYS_UBOOT_BASE		0x50080000
+#else
+#define CFG_SYS_UBOOT_BASE		0x50100000
 #endif
 
 /**
Signature · 1 line
2.34.1
#7 lore raw

PATCH 7/8 configs: j7200_evm_*_defconfig: Add configs for Hyperflash boot

In reply to Anurag Dutta

From: Vaishnav Achath <[email protected]>

Kernel commit dbb124cf6888 ("configs: j7200: Remove HBMC_AM654 config") removed the HBMC_AM654 config because hbmc was broken in u-boot. Hence, add the missing configs necessary to re-enable Hyperflash boot.

---
 configs/j7200_evm_a72_defconfig | 4 +++-
 configs/j7200_evm_r5_defconfig  | 4 ++++
 configs/j721e_evm_r5_defconfig  | 2 +-
 3 files changed, 8 insertions(+), 2 deletions(-)
configs/j7200_evm_a72_defconfig +3 -1
index eb6203f2b4..d6b44967fe 100644
@@ -137,11 +137,13 @@ CONFIG_MMC_SDHCI_AM654=y
 CONFIG_MTD=y
 CONFIG_DM_MTD=y
 CONFIG_MTD_NOR_FLASH=y
+CONFIG_SYS_FLASH_CFI_WIDTH_16BIT=y
 CONFIG_FLASH_SHOW_PROGRESS=0
 CONFIG_CFI_FLASH=y
 CONFIG_SYS_FLASH_USE_BUFFER_WRITE=y
 CONFIG_FLASH_CFI_MTD=y
 CONFIG_SYS_FLASH_CFI=y
+CONFIG_HBMC_AM654=y
 CONFIG_SYS_MAX_FLASH_BANKS_DETECT=y
 CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH_SFDP_SUPPORT=y
@@ -152,7 +154,7 @@ CONFIG_SPI_FLASH_S28HX_T=y
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
 CONFIG_SPI_FLASH_MTD=y
 CONFIG_MULTIPLEXER=y
-CONFIG_MUX_MMIO=y
+CONFIG_SPL_MUX_MMIO=y
 CONFIG_PHY_TI_DP83869=y
 CONFIG_PHY_FIXED=y
 CONFIG_TI_AM65_CPSW_NUSS=y
configs/j7200_evm_r5_defconfig +4 -0
index f036a6fd46..57a8ffce05 100644
@@ -110,11 +110,13 @@ CONFIG_MMC_SDHCI_AM654=y
 CONFIG_MTD=y
 CONFIG_DM_MTD=y
 CONFIG_MTD_NOR_FLASH=y
+CONFIG_SYS_FLASH_CFI_WIDTH_16BIT=y
 CONFIG_FLASH_SHOW_PROGRESS=0
 CONFIG_CFI_FLASH=y
 CONFIG_SYS_FLASH_USE_BUFFER_WRITE=y
 CONFIG_FLASH_CFI_MTD=y
 CONFIG_SYS_FLASH_CFI=y
+CONFIG_HBMC_AM654=y
 CONFIG_SYS_MAX_FLASH_BANKS_DETECT=y
 CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH_SFDP_SUPPORT=y
@@ -122,6 +124,8 @@ CONFIG_SPI_FLASH_SOFT_RESET=y
 CONFIG_SPI_FLASH_SOFT_RESET_ON_BOOT=y
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_SPI_FLASH_S28HX_T=y
+CONFIG_MULTIPLEXER=y
+CONFIG_SPL_MUX_MMIO=y
 CONFIG_PINCTRL=y
 # CONFIG_PINCTRL_GENERIC is not set
 CONFIG_SPL_PINCTRL=y
configs/j721e_evm_r5_defconfig +1 -1
index a593fed50a..9d767d7cda 100644
@@ -137,7 +137,7 @@ CONFIG_SPI_FLASH_S28HX_T=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_SPI_FLASH_MT35XU=y
 CONFIG_MULTIPLEXER=y
-CONFIG_MUX_MMIO=y
+CONFIG_SPL_MUX_MMIO=y
 CONFIG_PINCTRL=y
 # CONFIG_PINCTRL_GENERIC is not set
 CONFIG_SPL_PINCTRL=y
Signature · 1 line
2.34.1
#8 lore raw

PATCH 8/8 mtd: Kconfig: Change HBMC driver's dependency to MULTIPLEXER and MUX_MMIO

In reply to Anurag Dutta

The HBMC_AM654 driver was dependent on SYSCON because syscon APIs were being used to select the multiplexer state. Change the dependency to MULTIPLEXER and MUX_MMIO because mux APIs are now being used to select mux state.

---
 drivers/mtd/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/Kconfig +1 -1
index 3764e2567c..678bbde89e 100644
@@ -202,7 +202,7 @@ config RENESAS_RPC_HF
 
 config HBMC_AM654
 	bool "HyperBus controller driver for AM65x SoC"
-	depends on SYSCON
+	depends on MULTIPLEXER && MUX_MMIO
 	help
 	 This is the driver for HyperBus controller on TI's AM65x and
 	 other SoCs
Signature · 1 line
2.34.1
#9 lore raw
In reply to Anurag Dutta
Quoted 10 lines · Anurag Dutta

In u-boot, hbmc is broken and has been removed from j7200 configs. This series re-enables the hbmc driver and introduces a series of hyperflash boot fixes. At present, in u-boot, the parent device (fss) gets registered as a syscon device. This is done because the MMIO mux driver in u-boot did not support the mux functionality when the parent device is not a syscon. In this series, we make relevant changes in the hbmc driver as well as dts' so that we can use the reg-mux driver for selecting the appropriate state of the mux.

[...]

Applied to u-boot/next, thanks!

Signature · 1 line
Tom