U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 00/10] arm: k3: j784s4: Add PCIe boot support
@ 2025-12-01 11:00 Hrushikesh Salunke
  2025-12-01 11:00 ` [PATCH v4 01/10] arm: mach-k3: j784s4: Update SoC autogen data to enable PCIe boot Hrushikesh Salunke
                   ` (9 more replies)
  0 siblings, 10 replies; 14+ messages in thread
From: Hrushikesh Salunke @ 2025-12-01 11:00 UTC (permalink / raw)
  To: trini, a-nandan, m-chawdhry, c-vankar, u-kumar1, j-keerthy,
	marek.vasut+renesas, n-francis, jm, anshuld, s-vadapalli,
	ahalaney, semen.protsenko, mkorpershoek
  Cc: u-boot, h-salunke, danishanwar

This series adds PCIe endpoint boot support for the TI J784S4 SoC.

PCIe boot allows the device to boot as a PCIe endpoint, where the
bootloader images are loaded by a PCIe host through Device Firmware
Upgrade (DFU) over PCIe.

The J784S4 SoC uses PCIe1 instance with SERDES0 for endpoint boot.
To enable this functionality, the SERDES and PCIe peripherals must be
configured early in the R5 SPL stage before the bootloader images can
be transferred from the host.

This series:
1. Adds the required clock and device data for SERDES0 and PCIe1
2. Enables Cadence Torrent PHY driver at SPL stage
3. Enables J721E WIZ SERDES wrapper driver at SPL stage
4. Enables PCIe boot configs for J784S4 R5 and A72 stage
5. Disables PCIe boot configs for AM69-SK and J742S2-EVM
6. Adds comprehensive PCIe boot documentation

This feature has been tested on J784S4 EVM. Following are the logs
corresponding to this feature.

https://gist.github.com/hrushikesh221/13f2bcad10373f2fb87bc76dd0b906e5

Program used to copy bootloaders from PCIe Root-Complex to Endpoint:

https://gist.github.com/hrushikesh221/94e6042dbd717c74b74a5c9fc8ec5b6c

This series is based on commit:
65a13153107 (origin/next) Merge tag 'u-boot-imx-next-20251129' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx into next

v3: https://lore.kernel.org/all/20251112064725.1049199-1-h-salunke@ti.com/

Changes in v4:
- Disabled PCIe boot configs for AM69-SK and J742S2-EVM variants
  that share the J784S4 SoC but don't support PCIe boot
- Added comprehensive documentation for PCIe boot including hardware setup,
  configuration details, and step-by-step boot procedure
- Rebased on current next

Hrushikesh Salunke (10):
  arm: mach-k3: j784s4: Update SoC autogen data to enable PCIe boot
  phy: cadence: Add config to enable Cadence Torrent PHY at SPL stage
  phy: ti: Add config to enable J721E WIZ SERDES wrapper at SPL stage
  configs: j784s4_evm_r5_defconfig: Enable configs for PCIe boot
  configs: j784s4_evm_a72_defconfig: Enable configs for PCIe boot
  configs: am69_sk_r5_defconfig: Disable PCIe boot configs
  configs: am69_sk_a72_defconfig: Disable PCIe boot configs
  configs: j742s2_evm_r5_defconfig: Disable PCIe boot configs
  configs: j742s2_evm_a72_defconfig: Disable PCIe boot configs
  docs: board: ti: j784s4_evm: Add PCIe boot documentation

 arch/arm/mach-k3/r5/j784s4/clk-data.c | 184 +++++++++++++++++-
 arch/arm/mach-k3/r5/j784s4/dev-data.c |  43 +++--
 configs/am69_sk_a72_defconfig         |   4 +
 configs/am69_sk_r5_defconfig          |   9 +
 configs/j742s2_evm_a72_defconfig      |   5 +
 configs/j742s2_evm_r5_defconfig       |   9 +
 configs/j784s4_evm_a72_defconfig      |   7 +
 configs/j784s4_evm_r5_defconfig       |  13 ++
 doc/board/ti/j784s4_evm.rst           | 267 ++++++++++++++++++++++++++
 drivers/phy/cadence/Kconfig           |   7 +
 drivers/phy/ti/Kconfig                |  10 +
 11 files changed, 531 insertions(+), 27 deletions(-)

--
2.34.1


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH v4 01/10] arm: mach-k3: j784s4: Update SoC autogen data to enable PCIe boot
  2025-12-01 11:00 [PATCH v4 00/10] arm: k3: j784s4: Add PCIe boot support Hrushikesh Salunke
@ 2025-12-01 11:00 ` Hrushikesh Salunke
  2025-12-01 11:00 ` [PATCH v4 02/10] phy: cadence: Add config to enable Cadence Torrent PHY at SPL stage Hrushikesh Salunke
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: Hrushikesh Salunke @ 2025-12-01 11:00 UTC (permalink / raw)
  To: trini, a-nandan, m-chawdhry, c-vankar, u-kumar1, j-keerthy,
	marek.vasut+renesas, n-francis, jm, anshuld, s-vadapalli,
	ahalaney, semen.protsenko, mkorpershoek
  Cc: u-boot, h-salunke, danishanwar

To enable PCIe boot on J784S4 SoC SERDES0 and PCIE1 should be enabled
and configured at r5 stage. Add the required clk-data and dev-data
for SERDES0 and PCIE1.

Signed-off-by: Hrushikesh Salunke <h-salunke@ti.com>
---
 arch/arm/mach-k3/r5/j784s4/clk-data.c | 184 ++++++++++++++++++++++++--
 arch/arm/mach-k3/r5/j784s4/dev-data.c |  43 +++---
 2 files changed, 200 insertions(+), 27 deletions(-)

diff --git a/arch/arm/mach-k3/r5/j784s4/clk-data.c b/arch/arm/mach-k3/r5/j784s4/clk-data.c
index 24780eb6562..ce111377e41 100644
--- a/arch/arm/mach-k3/r5/j784s4/clk-data.c
+++ b/arch/arm/mach-k3/r5/j784s4/clk-data.c
@@ -5,7 +5,7 @@
  * This file is auto generated. Please do not hand edit and report any issues
  * to Bryan Brattlof <bb@ti.com>.
  *
- * Copyright (C) 2020-2024 Texas Instruments Incorporated - https://www.ti.com/
+ * Copyright (C) 2020-2025 Texas Instruments Incorporated - https://www.ti.com/
  */
 
 #include <linux/clk-provider.h>
@@ -64,13 +64,13 @@ static const char * const cpsw2g_cpts_rclk_sel_out0_parents[] = {
 	"board_0_cpts0_rft_clk_out",
 	"board_0_mcu_ext_refclk0_out",
 	"board_0_ext_refclk1_out",
+	"wiz16b8m4ct3_main_0_ip2_ln0_txmclk",
+	"wiz16b8m4ct3_main_0_ip2_ln1_txmclk",
+	"wiz16b8m4ct3_main_0_ip2_ln2_txmclk",
+	"wiz16b8m4ct3_main_0_ip2_ln3_txmclk",
 	NULL,
 	NULL,
-	NULL,
-	NULL,
-	NULL,
-	NULL,
-	NULL,
+	"wiz16b8m4ct3_main_0_ip1_ln2_txmclk",
 	NULL,
 	"hsdiv4_16fft_mcu_2_hsdivout1_clk",
 	"k3_pll_ctrl_wrap_wkup_0_chip_div1_clk_clk",
@@ -166,6 +166,31 @@ static const char * const emmcsd1_lb_clksel_out0_parents[] = {
 	"board_0_mmc1_clk_out",
 };
 
+static const char * const usb0_serdes_refclk_mux_out0_parents[] = {
+	"wiz16b8m4ct3_main_0_ip3_ln3_refclk",
+	NULL,
+};
+
+static const char * const usb0_serdes_rxclk_mux_out0_parents[] = {
+	"wiz16b8m4ct3_main_0_ip3_ln3_rxclk",
+	NULL,
+};
+
+static const char * const usb0_serdes_rxfclk_mux_out0_parents[] = {
+	"wiz16b8m4ct3_main_0_ip3_ln3_rxfclk",
+	NULL,
+};
+
+static const char * const usb0_serdes_txfclk_mux_out0_parents[] = {
+	"wiz16b8m4ct3_main_0_ip3_ln3_txfclk",
+	NULL,
+};
+
+static const char * const usb0_serdes_txmclk_mux_out0_parents[] = {
+	"wiz16b8m4ct3_main_0_ip3_ln3_txmclk",
+	NULL,
+};
+
 static const char * const k3_pll_ctrl_wrap_main_0_sysclkout_clk_parents[] = {
 	"main_pll_hfosc_sel_out0",
 	"hsdiv4_16fft_main_0_hsdivout0_clk",
@@ -197,18 +222,44 @@ static const char * const gtc_clk_mux_out0_parents[] = {
 	"board_0_cpts0_rft_clk_out",
 	"board_0_mcu_ext_refclk0_out",
 	"board_0_ext_refclk1_out",
+	"wiz16b8m4ct3_main_0_ip2_ln0_txmclk",
+	"wiz16b8m4ct3_main_0_ip2_ln1_txmclk",
+	"wiz16b8m4ct3_main_0_ip2_ln2_txmclk",
+	"wiz16b8m4ct3_main_0_ip2_ln3_txmclk",
 	NULL,
 	NULL,
+	"wiz16b8m4ct3_main_0_ip1_ln2_txmclk",
 	NULL,
+	"hsdiv4_16fft_mcu_2_hsdivout1_clk",
+	"k3_pll_ctrl_wrap_main_0_chip_div1_clk_clk",
+};
+
+static const char * const pcien_cpts_rclk_mux_out1_parents[] = {
+	"hsdiv4_16fft_main_3_hsdivout1_clk",
+	"postdiv3_16fft_main_0_hsdivout6_clk",
+	"board_0_mcu_cpts0_rft_clk_out",
+	"board_0_cpts0_rft_clk_out",
+	"board_0_mcu_ext_refclk0_out",
+	"board_0_ext_refclk1_out",
+	"wiz16b8m4ct3_main_0_ip2_ln0_txmclk",
+	"wiz16b8m4ct3_main_0_ip2_ln1_txmclk",
+	"wiz16b8m4ct3_main_0_ip2_ln2_txmclk",
+	"wiz16b8m4ct3_main_0_ip2_ln3_txmclk",
 	NULL,
 	NULL,
-	NULL,
-	NULL,
+	"wiz16b8m4ct3_main_0_ip1_ln2_txmclk",
 	NULL,
 	"hsdiv4_16fft_mcu_2_hsdivout1_clk",
 	"k3_pll_ctrl_wrap_main_0_chip_div1_clk_clk",
 };
 
+static const char * const serdes0_core_refclk_out0_parents[] = {
+	"gluelogic_hfosc0_clkout",
+	"board_0_hfosc1_clk_out",
+	"hsdiv4_16fft_main_3_hsdivout4_clk",
+	"hsdiv4_16fft_main_2_hsdivout4_clk",
+};
+
 static const struct clk_data clk_list[] = {
 	CLK_FIXED_RATE("osc_27_mhz", 27000000, 0),
 	CLK_FIXED_RATE("osc_26_mhz", 26000000, 0),
@@ -270,11 +321,17 @@ static const struct clk_data clk_list[] = {
 	CLK_FIXED_RATE("board_0_mcu_ext_refclk0_out", 0, 0),
 	CLK_FIXED_RATE("board_0_mmc1_clklb_out", 0, 0),
 	CLK_FIXED_RATE("board_0_mmc1_clk_out", 0, 0),
+	CLK_FIXED_RATE("board_0_serdes0_refclk_n_out", 0, 0),
+	CLK_FIXED_RATE("board_0_serdes0_refclk_p_out", 0, 0),
 	CLK_FIXED_RATE("board_0_tck_out", 0, 0),
 	CLK_FIXED_RATE("board_0_vout0_extpclkin_out", 0, 0),
 	CLK_FIXED_RATE("emmcsd4ss_main_0_emmcsdss_io_clk_o", 0, 0),
 	CLK_DIV("hsdiv4_16fft_mcu_2_hsdivout0_clk", "pllfracf2_ssmod_16fft_mcu_2_foutvcop_clk", 0x40d02080, 0, 7, 0, 0),
 	CLK_DIV("hsdiv4_16fft_mcu_2_hsdivout1_clk", "pllfracf2_ssmod_16fft_mcu_2_foutvcop_clk", 0x40d02084, 0, 7, 0, 0),
+	CLK_FIXED_RATE("pcie_g3x4_128_main_1_pcie_lane0_txclk", 0, 0),
+	CLK_FIXED_RATE("pcie_g3x4_128_main_1_pcie_lane1_txclk", 0, 0),
+	CLK_FIXED_RATE("pcie_g3x4_128_main_1_pcie_lane2_txclk", 0, 0),
+	CLK_FIXED_RATE("pcie_g3x4_128_main_1_pcie_lane3_txclk", 0, 0),
 	CLK_PLL_DEFFREQ("pllfracf2_ssmod_16fft_main_0_foutvcop_clk", "main_pll_hfosc_sel_out0", 0x680000, 0, 2000000000),
 	CLK_DIV("pllfracf2_ssmod_16fft_main_0_foutpostdiv_clk_subdiv", "pllfracf2_ssmod_16fft_main_0_foutvcop_clk", 0x680038, 16, 3, 0, CLK_DIVIDER_ONE_BASED),
 	CLK_DIV("pllfracf2_ssmod_16fft_main_0_foutpostdiv_clk", "pllfracf2_ssmod_16fft_main_0_foutpostdiv_clk_subdiv", 0x680038, 24, 3, 0, CLK_DIVIDER_ONE_BASED),
@@ -294,8 +351,42 @@ static const struct clk_data clk_list[] = {
 	CLK_DIV("postdiv3_16fft_main_0_hsdivout8_clk", "pllfracf2_ssmod_16fft_main_0_foutpostdiv_clk", 0x6800a0, 0, 7, 0, 0),
 	CLK_DIV("postdiv3_16fft_main_1_hsdivout5_clk", "pllfracf2_ssmod_16fft_main_1_foutpostdiv_clk", 0x681094, 0, 7, 0, 0),
 	CLK_DIV("postdiv3_16fft_main_1_hsdivout7_clk", "pllfracf2_ssmod_16fft_main_1_foutpostdiv_clk", 0x68109c, 0, 7, 0, 0),
+	CLK_FIXED_RATE("usb3p0ss_16ffc_main_0_pipe_txclk", 0, 0),
+	CLK_FIXED_RATE("wiz16b8m4ct3_main_0_cmn_refclk_m", 0, 0),
+	CLK_FIXED_RATE("wiz16b8m4ct3_main_0_cmn_refclk_p", 0, 0),
+	CLK_FIXED_RATE("wiz16b8m4ct3_main_0_ip1_ln2_txmclk", 0, 0),
+	CLK_FIXED_RATE("wiz16b8m4ct3_main_0_ip2_ln0_refclk", 0, 0),
+	CLK_FIXED_RATE("wiz16b8m4ct3_main_0_ip2_ln0_rxclk", 0, 0),
+	CLK_FIXED_RATE("wiz16b8m4ct3_main_0_ip2_ln0_rxfclk", 0, 0),
+	CLK_FIXED_RATE("wiz16b8m4ct3_main_0_ip2_ln0_txfclk", 0, 0),
+	CLK_FIXED_RATE("wiz16b8m4ct3_main_0_ip2_ln0_txmclk", 0, 0),
+	CLK_FIXED_RATE("wiz16b8m4ct3_main_0_ip2_ln1_refclk", 0, 0),
+	CLK_FIXED_RATE("wiz16b8m4ct3_main_0_ip2_ln1_rxclk", 0, 0),
+	CLK_FIXED_RATE("wiz16b8m4ct3_main_0_ip2_ln1_rxfclk", 0, 0),
+	CLK_FIXED_RATE("wiz16b8m4ct3_main_0_ip2_ln1_txfclk", 0, 0),
+	CLK_FIXED_RATE("wiz16b8m4ct3_main_0_ip2_ln1_txmclk", 0, 0),
+	CLK_FIXED_RATE("wiz16b8m4ct3_main_0_ip2_ln2_refclk", 0, 0),
+	CLK_FIXED_RATE("wiz16b8m4ct3_main_0_ip2_ln2_rxclk", 0, 0),
+	CLK_FIXED_RATE("wiz16b8m4ct3_main_0_ip2_ln2_rxfclk", 0, 0),
+	CLK_FIXED_RATE("wiz16b8m4ct3_main_0_ip2_ln2_txfclk", 0, 0),
+	CLK_FIXED_RATE("wiz16b8m4ct3_main_0_ip2_ln2_txmclk", 0, 0),
+	CLK_FIXED_RATE("wiz16b8m4ct3_main_0_ip2_ln3_refclk", 0, 0),
+	CLK_FIXED_RATE("wiz16b8m4ct3_main_0_ip2_ln3_rxclk", 0, 0),
+	CLK_FIXED_RATE("wiz16b8m4ct3_main_0_ip2_ln3_rxfclk", 0, 0),
+	CLK_FIXED_RATE("wiz16b8m4ct3_main_0_ip2_ln3_txfclk", 0, 0),
+	CLK_FIXED_RATE("wiz16b8m4ct3_main_0_ip2_ln3_txmclk", 0, 0),
+	CLK_FIXED_RATE("wiz16b8m4ct3_main_0_ip3_ln3_refclk", 0, 0),
+	CLK_FIXED_RATE("wiz16b8m4ct3_main_0_ip3_ln3_rxclk", 0, 0),
+	CLK_FIXED_RATE("wiz16b8m4ct3_main_0_ip3_ln3_rxfclk", 0, 0),
+	CLK_FIXED_RATE("wiz16b8m4ct3_main_0_ip3_ln3_txfclk", 0, 0),
+	CLK_FIXED_RATE("wiz16b8m4ct3_main_0_ip3_ln3_txmclk", 0, 0),
 	CLK_MUX("emmcsd1_lb_clksel_out0", emmcsd1_lb_clksel_out0_parents, 2, 0x1080b4, 16, 1, 0),
 	CLK_MUX("mcu_clkout_mux_out0", mcu_clkout_mux_out0_parents, 2, 0x40f08010, 0, 1, 0),
+	CLK_MUX("usb0_serdes_refclk_mux_out0", usb0_serdes_refclk_mux_out0_parents, 2, 0x104000, 27, 1, 0),
+	CLK_MUX("usb0_serdes_rxclk_mux_out0", usb0_serdes_rxclk_mux_out0_parents, 2, 0x104000, 27, 1, 0),
+	CLK_MUX("usb0_serdes_rxfclk_mux_out0", usb0_serdes_rxfclk_mux_out0_parents, 2, 0x104000, 27, 1, 0),
+	CLK_MUX("usb0_serdes_txfclk_mux_out0", usb0_serdes_txfclk_mux_out0_parents, 2, 0x104000, 27, 1, 0),
+	CLK_MUX("usb0_serdes_txmclk_mux_out0", usb0_serdes_txmclk_mux_out0_parents, 2, 0x104000, 27, 1, 0),
 	CLK_DIV("hsdiv0_16fft_main_12_hsdivout0_clk", "pllfracf2_ssmod_16fft_main_12_foutvcop_clk", 0x68c080, 0, 7, 0, 0),
 	CLK_DIV("hsdiv0_16fft_main_26_hsdivout0_clk", "pllfracf2_ssmod_16fft_main_26_foutvcop_clk", 0x69a080, 0, 7, 0, 0),
 	CLK_DIV("hsdiv0_16fft_main_27_hsdivout0_clk", "pllfracf2_ssmod_16fft_main_27_foutvcop_clk", 0x69b080, 0, 7, 0, 0),
@@ -310,14 +401,18 @@ static const struct clk_data clk_list[] = {
 	CLK_DIV_DEFFREQ("hsdiv4_16fft_main_1_hsdivout0_clk", "pllfracf2_ssmod_16fft_main_1_foutvcop_clk", 0x681080, 0, 7, 0, 0, 192000000),
 	CLK_DIV("hsdiv4_16fft_main_1_hsdivout2_clk", "pllfracf2_ssmod_16fft_main_1_foutvcop_clk", 0x681088, 0, 7, 0, 0),
 	CLK_DIV("hsdiv4_16fft_main_2_hsdivout2_clk", "pllfracf2_ssmod_16fft_main_2_foutvcop_clk", 0x682088, 0, 7, 0, 0),
+	CLK_DIV("hsdiv4_16fft_main_2_hsdivout4_clk", "pllfracf2_ssmod_16fft_main_2_foutvcop_clk", 0x682090, 0, 7, 0, 0),
 	CLK_DIV("hsdiv4_16fft_main_3_hsdivout1_clk", "pllfracf2_ssmod_16fft_main_3_foutvcop_clk", 0x683084, 0, 7, 0, 0),
 	CLK_DIV("hsdiv4_16fft_main_3_hsdivout2_clk", "pllfracf2_ssmod_16fft_main_3_foutvcop_clk", 0x683088, 0, 7, 0, 0),
+	CLK_DIV("hsdiv4_16fft_main_3_hsdivout4_clk", "pllfracf2_ssmod_16fft_main_3_foutvcop_clk", 0x683090, 0, 7, 0, 0),
 	CLK_MUX_PLLCTRL("k3_pll_ctrl_wrap_main_0_sysclkout_clk", k3_pll_ctrl_wrap_main_0_sysclkout_clk_parents, 2, 0x410000, 0),
 	CLK_DIV("k3_pll_ctrl_wrap_main_0_chip_div1_clk_clk", "k3_pll_ctrl_wrap_main_0_sysclkout_clk", 0x410118, 0, 5, 0, 0),
 	CLK_MUX("dpi0_ext_clksel_out0", dpi0_ext_clksel_out0_parents, 2, 0x108300, 0, 1, 0),
 	CLK_MUX("emmcsd_refclk_sel_out0", emmcsd_refclk_sel_out0_parents, 4, 0x1080b0, 0, 2, 0),
 	CLK_MUX("emmcsd_refclk_sel_out1", emmcsd_refclk_sel_out1_parents, 4, 0x1080b4, 0, 2, 0),
 	CLK_MUX("gtc_clk_mux_out0", gtc_clk_mux_out0_parents, 16, 0x108030, 0, 4, 0),
+	CLK_MUX("pcien_cpts_rclk_mux_out1", pcien_cpts_rclk_mux_out1_parents, 16, 0x108084, 0, 4, 0),
+	CLK_MUX("serdes0_core_refclk_out0", serdes0_core_refclk_out0_parents, 4, 0x108400, 0, 2, 0),
 	CLK_DIV_DEFFREQ("usart_programmable_clock_divider_out0", "hsdiv4_16fft_main_1_hsdivout0_clk", 0x1081c0, 0, 2, 0, 0, 48000000),
 	CLK_DIV("usart_programmable_clock_divider_out5", "hsdiv4_16fft_main_1_hsdivout0_clk", 0x1081d4, 0, 2, 0, 0),
 	CLK_DIV("usart_programmable_clock_divider_out8", "hsdiv4_16fft_main_1_hsdivout0_clk", 0x1081e0, 0, 2, 0, 0),
@@ -338,6 +433,11 @@ static const struct dev_clk soc_dev_clk_data[] = {
 	DEV_CLK(61, 4, "board_0_cpts0_rft_clk_out"),
 	DEV_CLK(61, 5, "board_0_mcu_ext_refclk0_out"),
 	DEV_CLK(61, 6, "board_0_ext_refclk1_out"),
+	DEV_CLK(61, 7, "wiz16b8m4ct3_main_0_ip2_ln0_txmclk"),
+	DEV_CLK(61, 8, "wiz16b8m4ct3_main_0_ip2_ln1_txmclk"),
+	DEV_CLK(61, 9, "wiz16b8m4ct3_main_0_ip2_ln2_txmclk"),
+	DEV_CLK(61, 10, "wiz16b8m4ct3_main_0_ip2_ln3_txmclk"),
+	DEV_CLK(61, 13, "wiz16b8m4ct3_main_0_ip1_ln2_txmclk"),
 	DEV_CLK(61, 15, "hsdiv4_16fft_mcu_2_hsdivout1_clk"),
 	DEV_CLK(61, 16, "k3_pll_ctrl_wrap_main_0_chip_div1_clk_clk"),
 	DEV_CLK(61, 17, "k3_pll_ctrl_wrap_main_0_chip_div1_clk_clk"),
@@ -349,6 +449,11 @@ static const struct dev_clk soc_dev_clk_data[] = {
 	DEV_CLK(63, 7, "board_0_cpts0_rft_clk_out"),
 	DEV_CLK(63, 8, "board_0_mcu_ext_refclk0_out"),
 	DEV_CLK(63, 9, "board_0_ext_refclk1_out"),
+	DEV_CLK(63, 10, "wiz16b8m4ct3_main_0_ip2_ln0_txmclk"),
+	DEV_CLK(63, 11, "wiz16b8m4ct3_main_0_ip2_ln1_txmclk"),
+	DEV_CLK(63, 12, "wiz16b8m4ct3_main_0_ip2_ln2_txmclk"),
+	DEV_CLK(63, 13, "wiz16b8m4ct3_main_0_ip2_ln3_txmclk"),
+	DEV_CLK(63, 16, "wiz16b8m4ct3_main_0_ip1_ln2_txmclk"),
 	DEV_CLK(63, 18, "hsdiv4_16fft_mcu_2_hsdivout1_clk"),
 	DEV_CLK(63, 19, "k3_pll_ctrl_wrap_wkup_0_chip_div1_clk_clk"),
 	DEV_CLK(63, 20, "hsdiv4_16fft_mcu_2_hsdivout0_clk"),
@@ -404,6 +509,8 @@ static const struct dev_clk soc_dev_clk_data[] = {
 	DEV_CLK(157, 239, "k3_pll_ctrl_wrap_wkup_0_chip_div1_clk_clk"),
 	DEV_CLK(157, 243, "emmcsd4ss_main_0_emmcsdss_io_clk_o"),
 	DEV_CLK(157, 245, "emmcsd4ss_main_0_emmcsdss_io_clk_o"),
+	DEV_CLK(157, 324, "wiz16b8m4ct3_main_0_cmn_refclk_m"),
+	DEV_CLK(157, 326, "wiz16b8m4ct3_main_0_cmn_refclk_p"),
 	DEV_CLK(157, 354, "k3_pll_ctrl_wrap_main_0_chip_div1_clk_clk"),
 	DEV_CLK(157, 359, "dpi0_ext_clksel_out0"),
 	DEV_CLK(157, 360, "mshsi2c_wkup_0_porscl"),
@@ -461,6 +568,42 @@ static const struct dev_clk soc_dev_clk_data[] = {
 	DEV_CLK(279, 2, "wkup_i2c_mcupll_bypass_out0"),
 	DEV_CLK(279, 3, "hsdiv4_16fft_mcu_1_hsdivout3_clk"),
 	DEV_CLK(279, 4, "gluelogic_hfosc0_clkout"),
+	DEV_CLK(333, 0, "k3_pll_ctrl_wrap_main_0_chip_div1_clk_clk"),
+	DEV_CLK(333, 2, "pcien_cpts_rclk_mux_out1"),
+	DEV_CLK(333, 3, "hsdiv4_16fft_main_3_hsdivout1_clk"),
+	DEV_CLK(333, 4, "postdiv3_16fft_main_0_hsdivout6_clk"),
+	DEV_CLK(333, 5, "board_0_mcu_cpts0_rft_clk_out"),
+	DEV_CLK(333, 6, "board_0_cpts0_rft_clk_out"),
+	DEV_CLK(333, 7, "board_0_mcu_ext_refclk0_out"),
+	DEV_CLK(333, 8, "board_0_ext_refclk1_out"),
+	DEV_CLK(333, 9, "wiz16b8m4ct3_main_0_ip2_ln0_txmclk"),
+	DEV_CLK(333, 10, "wiz16b8m4ct3_main_0_ip2_ln1_txmclk"),
+	DEV_CLK(333, 11, "wiz16b8m4ct3_main_0_ip2_ln2_txmclk"),
+	DEV_CLK(333, 12, "wiz16b8m4ct3_main_0_ip2_ln3_txmclk"),
+	DEV_CLK(333, 15, "wiz16b8m4ct3_main_0_ip1_ln2_txmclk"),
+	DEV_CLK(333, 17, "hsdiv4_16fft_mcu_2_hsdivout1_clk"),
+	DEV_CLK(333, 18, "k3_pll_ctrl_wrap_main_0_chip_div1_clk_clk"),
+	DEV_CLK(333, 19, "wiz16b8m4ct3_main_0_ip2_ln0_refclk"),
+	DEV_CLK(333, 20, "wiz16b8m4ct3_main_0_ip2_ln0_rxclk"),
+	DEV_CLK(333, 21, "wiz16b8m4ct3_main_0_ip2_ln0_rxfclk"),
+	DEV_CLK(333, 23, "wiz16b8m4ct3_main_0_ip2_ln0_txfclk"),
+	DEV_CLK(333, 24, "wiz16b8m4ct3_main_0_ip2_ln0_txmclk"),
+	DEV_CLK(333, 25, "wiz16b8m4ct3_main_0_ip2_ln1_refclk"),
+	DEV_CLK(333, 26, "wiz16b8m4ct3_main_0_ip2_ln1_rxclk"),
+	DEV_CLK(333, 27, "wiz16b8m4ct3_main_0_ip2_ln1_rxfclk"),
+	DEV_CLK(333, 29, "wiz16b8m4ct3_main_0_ip2_ln1_txfclk"),
+	DEV_CLK(333, 30, "wiz16b8m4ct3_main_0_ip2_ln1_txmclk"),
+	DEV_CLK(333, 31, "wiz16b8m4ct3_main_0_ip2_ln2_refclk"),
+	DEV_CLK(333, 32, "wiz16b8m4ct3_main_0_ip2_ln2_rxclk"),
+	DEV_CLK(333, 33, "wiz16b8m4ct3_main_0_ip2_ln2_rxfclk"),
+	DEV_CLK(333, 35, "wiz16b8m4ct3_main_0_ip2_ln2_txfclk"),
+	DEV_CLK(333, 36, "wiz16b8m4ct3_main_0_ip2_ln2_txmclk"),
+	DEV_CLK(333, 37, "wiz16b8m4ct3_main_0_ip2_ln3_refclk"),
+	DEV_CLK(333, 38, "wiz16b8m4ct3_main_0_ip2_ln3_rxclk"),
+	DEV_CLK(333, 39, "wiz16b8m4ct3_main_0_ip2_ln3_rxfclk"),
+	DEV_CLK(333, 41, "wiz16b8m4ct3_main_0_ip2_ln3_txfclk"),
+	DEV_CLK(333, 42, "wiz16b8m4ct3_main_0_ip2_ln3_txmclk"),
+	DEV_CLK(333, 43, "j7am_wakeup_16ff_wkup_0_wkup_rcosc_12p5m_clk"),
 	DEV_CLK(392, 0, "usart_programmable_clock_divider_out5"),
 	DEV_CLK(392, 3, "k3_pll_ctrl_wrap_main_0_chip_div1_clk_clk"),
 	DEV_CLK(395, 0, "usart_programmable_clock_divider_out8"),
@@ -473,11 +616,36 @@ static const struct dev_clk soc_dev_clk_data[] = {
 	DEV_CLK(398, 1, "k3_pll_ctrl_wrap_main_0_chip_div1_clk_clk"),
 	DEV_CLK(398, 2, "postdiv3_16fft_main_1_hsdivout7_clk"),
 	DEV_CLK(398, 3, "k3_pll_ctrl_wrap_main_0_chip_div1_clk_clk"),
+	DEV_CLK(398, 4, "usb0_serdes_refclk_mux_out0"),
+	DEV_CLK(398, 5, "wiz16b8m4ct3_main_0_ip3_ln3_refclk"),
+	DEV_CLK(398, 7, "usb0_serdes_rxclk_mux_out0"),
+	DEV_CLK(398, 8, "wiz16b8m4ct3_main_0_ip3_ln3_rxclk"),
+	DEV_CLK(398, 10, "usb0_serdes_rxfclk_mux_out0"),
+	DEV_CLK(398, 11, "wiz16b8m4ct3_main_0_ip3_ln3_rxfclk"),
+	DEV_CLK(398, 14, "usb0_serdes_txfclk_mux_out0"),
+	DEV_CLK(398, 15, "wiz16b8m4ct3_main_0_ip3_ln3_txfclk"),
+	DEV_CLK(398, 17, "usb0_serdes_txmclk_mux_out0"),
+	DEV_CLK(398, 18, "wiz16b8m4ct3_main_0_ip3_ln3_txmclk"),
 	DEV_CLK(398, 20, "k3_pll_ctrl_wrap_main_0_chip_div1_clk_clk"),
 	DEV_CLK(398, 21, "usb0_refclk_sel_out0"),
 	DEV_CLK(398, 22, "gluelogic_hfosc0_clkout"),
 	DEV_CLK(398, 23, "board_0_hfosc1_clk_out"),
 	DEV_CLK(398, 28, "board_0_tck_out"),
+	DEV_CLK(404, 2, "k3_pll_ctrl_wrap_main_0_chip_div1_clk_clk"),
+	DEV_CLK(404, 3, "board_0_serdes0_refclk_n_out"),
+	DEV_CLK(404, 4, "board_0_serdes0_refclk_p_out"),
+	DEV_CLK(404, 5, "hsdiv4_16fft_main_3_hsdivout4_clk"),
+	DEV_CLK(404, 6, "serdes0_core_refclk_out0"),
+	DEV_CLK(404, 7, "gluelogic_hfosc0_clkout"),
+	DEV_CLK(404, 8, "board_0_hfosc1_clk_out"),
+	DEV_CLK(404, 9, "hsdiv4_16fft_main_3_hsdivout4_clk"),
+	DEV_CLK(404, 10, "hsdiv4_16fft_main_2_hsdivout4_clk"),
+	DEV_CLK(404, 39, "pcie_g3x4_128_main_1_pcie_lane0_txclk"),
+	DEV_CLK(404, 45, "pcie_g3x4_128_main_1_pcie_lane1_txclk"),
+	DEV_CLK(404, 51, "pcie_g3x4_128_main_1_pcie_lane2_txclk"),
+	DEV_CLK(404, 57, "pcie_g3x4_128_main_1_pcie_lane3_txclk"),
+	DEV_CLK(404, 81, "usb3p0ss_16ffc_main_0_pipe_txclk"),
+	DEV_CLK(404, 129, "board_0_tck_out"),
 };
 
 const struct ti_k3_clk_platdata j784s4_clk_platdata = {
diff --git a/arch/arm/mach-k3/r5/j784s4/dev-data.c b/arch/arm/mach-k3/r5/j784s4/dev-data.c
index 19901821225..19ac1986b20 100644
--- a/arch/arm/mach-k3/r5/j784s4/dev-data.c
+++ b/arch/arm/mach-k3/r5/j784s4/dev-data.c
@@ -21,10 +21,11 @@ static struct ti_pd soc_pd_list[] = {
 	[1] = PSC_PD(3, &soc_psc_list[1], NULL),
 	[2] = PSC_PD(0, &soc_psc_list[2], NULL),
 	[3] = PSC_PD(1, &soc_psc_list[2], &soc_pd_list[2]),
-	[4] = PSC_PD(14, &soc_psc_list[2], NULL),
-	[5] = PSC_PD(15, &soc_psc_list[2], &soc_pd_list[4]),
-	[6] = PSC_PD(16, &soc_psc_list[2], &soc_pd_list[4]),
-	[7] = PSC_PD(38, &soc_psc_list[2], NULL),
+	[4] = PSC_PD(5, &soc_psc_list[2], NULL),
+	[5] = PSC_PD(14, &soc_psc_list[2], NULL),
+	[6] = PSC_PD(15, &soc_psc_list[2], &soc_pd_list[5]),
+	[7] = PSC_PD(16, &soc_psc_list[2], &soc_pd_list[5]),
+	[8] = PSC_PD(38, &soc_psc_list[2], NULL),
 };
 
 static struct ti_lpsc soc_lpsc_list[] = {
@@ -44,13 +45,15 @@ static struct ti_lpsc soc_lpsc_list[] = {
 	[13] = PSC_LPSC(20, &soc_psc_list[2], &soc_pd_list[2], &soc_lpsc_list[5]),
 	[14] = PSC_LPSC(23, &soc_psc_list[2], &soc_pd_list[2], &soc_lpsc_list[5]),
 	[15] = PSC_LPSC(25, &soc_psc_list[2], &soc_pd_list[2], &soc_lpsc_list[5]),
-	[16] = PSC_LPSC(43, &soc_psc_list[2], &soc_pd_list[3], NULL),
-	[17] = PSC_LPSC(45, &soc_psc_list[2], &soc_pd_list[3], NULL),
-	[18] = PSC_LPSC(78, &soc_psc_list[2], &soc_pd_list[4], NULL),
-	[19] = PSC_LPSC(80, &soc_psc_list[2], &soc_pd_list[5], &soc_lpsc_list[18]),
-	[20] = PSC_LPSC(81, &soc_psc_list[2], &soc_pd_list[6], &soc_lpsc_list[18]),
-	[21] = PSC_LPSC(120, &soc_psc_list[2], &soc_pd_list[7], &soc_lpsc_list[22]),
-	[22] = PSC_LPSC(121, &soc_psc_list[2], &soc_pd_list[7], NULL),
+	[16] = PSC_LPSC(29, &soc_psc_list[2], &soc_pd_list[2], &soc_lpsc_list[5]),
+	[17] = PSC_LPSC(43, &soc_psc_list[2], &soc_pd_list[3], NULL),
+	[18] = PSC_LPSC(45, &soc_psc_list[2], &soc_pd_list[3], NULL),
+	[19] = PSC_LPSC(64, &soc_psc_list[2], &soc_pd_list[4], NULL),
+	[20] = PSC_LPSC(78, &soc_psc_list[2], &soc_pd_list[5], NULL),
+	[21] = PSC_LPSC(80, &soc_psc_list[2], &soc_pd_list[6], &soc_lpsc_list[20]),
+	[22] = PSC_LPSC(81, &soc_psc_list[2], &soc_pd_list[7], &soc_lpsc_list[20]),
+	[23] = PSC_LPSC(120, &soc_psc_list[2], &soc_pd_list[8], &soc_lpsc_list[24]),
+	[24] = PSC_LPSC(121, &soc_psc_list[2], &soc_pd_list[8], NULL),
 };
 
 static struct ti_dev soc_dev_list[] = {
@@ -78,14 +81,16 @@ static struct ti_dev soc_dev_list[] = {
 	PSC_DEV(398, &soc_lpsc_list[13]),
 	PSC_DEV(141, &soc_lpsc_list[14]),
 	PSC_DEV(140, &soc_lpsc_list[15]),
-	PSC_DEV(146, &soc_lpsc_list[16]),
-	PSC_DEV(392, &soc_lpsc_list[17]),
-	PSC_DEV(395, &soc_lpsc_list[17]),
-	PSC_DEV(198, &soc_lpsc_list[18]),
-	PSC_DEV(202, &soc_lpsc_list[19]),
-	PSC_DEV(203, &soc_lpsc_list[20]),
-	PSC_DEV(133, &soc_lpsc_list[21]),
-	PSC_DEV(193, &soc_lpsc_list[22]),
+	PSC_DEV(333, &soc_lpsc_list[16]),
+	PSC_DEV(146, &soc_lpsc_list[17]),
+	PSC_DEV(392, &soc_lpsc_list[18]),
+	PSC_DEV(395, &soc_lpsc_list[18]),
+	PSC_DEV(404, &soc_lpsc_list[19]),
+	PSC_DEV(198, &soc_lpsc_list[20]),
+	PSC_DEV(202, &soc_lpsc_list[21]),
+	PSC_DEV(203, &soc_lpsc_list[22]),
+	PSC_DEV(133, &soc_lpsc_list[23]),
+	PSC_DEV(193, &soc_lpsc_list[24]),
 };
 
 const struct ti_k3_pd_platdata j784s4_pd_platdata = {
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v4 02/10] phy: cadence: Add config to enable Cadence Torrent PHY at SPL stage
  2025-12-01 11:00 [PATCH v4 00/10] arm: k3: j784s4: Add PCIe boot support Hrushikesh Salunke
  2025-12-01 11:00 ` [PATCH v4 01/10] arm: mach-k3: j784s4: Update SoC autogen data to enable PCIe boot Hrushikesh Salunke
@ 2025-12-01 11:00 ` Hrushikesh Salunke
  2025-12-01 11:00 ` [PATCH v4 03/10] phy: ti: Add config to enable J721E WIZ SERDES wrapper " Hrushikesh Salunke
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: Hrushikesh Salunke @ 2025-12-01 11:00 UTC (permalink / raw)
  To: trini, a-nandan, m-chawdhry, c-vankar, u-kumar1, j-keerthy,
	marek.vasut+renesas, n-francis, jm, anshuld, s-vadapalli,
	ahalaney, semen.protsenko, mkorpershoek
  Cc: u-boot, h-salunke, danishanwar

Add SPL_PHY_CADENCE_TORRENT configuration option to enable the Cadence
Torrent PHY driver in SPL stage. This is required for PCIe boot support
where SERDES configuration must be done early in the boot sequence
before loading bootloader image over PCIe.

Signed-off-by: Hrushikesh Salunke <h-salunke@ti.com>
---
 drivers/phy/cadence/Kconfig | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/phy/cadence/Kconfig b/drivers/phy/cadence/Kconfig
index 549ddbf5046..8c0ab80fbbc 100644
--- a/drivers/phy/cadence/Kconfig
+++ b/drivers/phy/cadence/Kconfig
@@ -9,3 +9,10 @@ config PHY_CADENCE_TORRENT
 	depends on DM_RESET
 	help
 	  Enable this to support the Cadence Torrent PHY driver
+
+config SPL_PHY_CADENCE_TORRENT
+	bool "Cadence Torrent PHY Driver"
+	depends on SPL_DM_RESET
+	help
+	  Enable this to support the Cadence Torrent PHY driver at SPL
+	  stage.
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v4 03/10] phy: ti: Add config to enable J721E WIZ SERDES wrapper at SPL stage
  2025-12-01 11:00 [PATCH v4 00/10] arm: k3: j784s4: Add PCIe boot support Hrushikesh Salunke
  2025-12-01 11:00 ` [PATCH v4 01/10] arm: mach-k3: j784s4: Update SoC autogen data to enable PCIe boot Hrushikesh Salunke
  2025-12-01 11:00 ` [PATCH v4 02/10] phy: cadence: Add config to enable Cadence Torrent PHY at SPL stage Hrushikesh Salunke
@ 2025-12-01 11:00 ` Hrushikesh Salunke
  2025-12-01 11:00 ` [PATCH v4 04/10] configs: j784s4_evm_r5_defconfig: Enable configs for PCIe boot Hrushikesh Salunke
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: Hrushikesh Salunke @ 2025-12-01 11:00 UTC (permalink / raw)
  To: trini, a-nandan, m-chawdhry, c-vankar, u-kumar1, j-keerthy,
	marek.vasut+renesas, n-francis, jm, anshuld, s-vadapalli,
	ahalaney, semen.protsenko, mkorpershoek
  Cc: u-boot, h-salunke, danishanwar

Add SPL_PHY_J721E_WIZ configuration option to enable the WIZ SERDES
wrapper driver in SPL stage. This is required for PCIe boot support
where SERDES configuration must be done early in the boot sequence
before loading bootloader image over PCIe.

Signed-off-by: Hrushikesh Salunke <h-salunke@ti.com>
---
 drivers/phy/ti/Kconfig | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/phy/ti/Kconfig b/drivers/phy/ti/Kconfig
index 111085f235d..df750b26d66 100644
--- a/drivers/phy/ti/Kconfig
+++ b/drivers/phy/ti/Kconfig
@@ -7,3 +7,13 @@ config PHY_J721E_WIZ
 	  signals to the SERDES (Sierra/Torrent). This driver configures
 	  three clock selects (pll0, pll1, dig) and resets for each of the
 	  lanes.
+
+config SPL_PHY_J721E_WIZ
+	bool "TI J721E WIZ (SERDES Wrapper) support"
+	depends on ARCH_K3
+	help
+	  This option enables support for WIZ module present in TI's J721E
+	  SoC at SPL stage. WIZ is a serdes wrapper used to configure some
+	  of the input signals to the SERDES (Sierra/Torrent). This driver
+	  configures three clock selects (pll0, pll1, dig) and resets for
+	  each of the lanes.
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v4 04/10] configs: j784s4_evm_r5_defconfig: Enable configs for PCIe boot
  2025-12-01 11:00 [PATCH v4 00/10] arm: k3: j784s4: Add PCIe boot support Hrushikesh Salunke
                   ` (2 preceding siblings ...)
  2025-12-01 11:00 ` [PATCH v4 03/10] phy: ti: Add config to enable J721E WIZ SERDES wrapper " Hrushikesh Salunke
@ 2025-12-01 11:00 ` Hrushikesh Salunke
  2025-12-01 11:00 ` [PATCH v4 05/10] configs: j784s4_evm_a72_defconfig: " Hrushikesh Salunke
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: Hrushikesh Salunke @ 2025-12-01 11:00 UTC (permalink / raw)
  To: trini, a-nandan, m-chawdhry, c-vankar, u-kumar1, j-keerthy,
	marek.vasut+renesas, n-francis, jm, anshuld, s-vadapalli,
	ahalaney, semen.protsenko, mkorpershoek
  Cc: u-boot, h-salunke, danishanwar

J784S4 SoC has two instances of PCIe, namely PCIe0 and PCIe1. The
PCIe1 instance is used for PCIe endpoint boot. Enable the configs
required for PCIe boot on the J784S4 platform.

Additionally, enable configs for J721E WIZ SERDES wrapper, Cadence
Torrent PHY, and MMIO multiplexer. These are required to configure
the SERDES lanes at the R5 SPL stage for PCIe endpoint operation.

Signed-off-by: Hrushikesh Salunke <h-salunke@ti.com>
---
 configs/j784s4_evm_r5_defconfig | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/configs/j784s4_evm_r5_defconfig b/configs/j784s4_evm_r5_defconfig
index cc340a2fe76..a69a253ad12 100644
--- a/configs/j784s4_evm_r5_defconfig
+++ b/configs/j784s4_evm_r5_defconfig
@@ -52,9 +52,16 @@ CONFIG_SPL_FS_EXT4=y
 CONFIG_SPL_I2C=y
 CONFIG_SPL_DM_MAILBOX=y
 CONFIG_SPL_DM_SPI_FLASH=y
+CONFIG_SPL_PCI_ENDPOINT=y
 CONFIG_SPL_DM_RESET=y
 CONFIG_SPL_POWER_DOMAIN=y
 CONFIG_SPL_RAM_DEVICE=y
+CONFIG_SPL_PCI_DFU=y
+CONFIG_SPL_PCI_DFU_SPL_LOAD_FIT_ADDRESS=0x80800000
+CONFIG_SPL_PCI_DFU_BAR_SIZE=0x400000
+CONFIG_SPL_PCI_DFU_VENDOR_ID=0x104c
+CONFIG_SPL_PCI_DFU_DEVICE_ID=0xb012
+CONFIG_SPL_PCI_DFU_BOOT_PHASE="tiboot3.bin"
 # CONFIG_SPL_SPI_FLASH_TINY is not set
 CONFIG_SPL_SPI_FLASH_SFDP_SUPPORT=y
 CONFIG_SPL_SPI_LOAD=y
@@ -122,6 +129,12 @@ 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_SPL_MUX_MMIO=y
+CONFIG_PCIE_CDNS_TI_EP=y
+CONFIG_SPL_PHY=y
+CONFIG_SPL_PHY_CADENCE_TORRENT=y
+CONFIG_SPL_PHY_J721E_WIZ=y
 CONFIG_PINCTRL=y
 CONFIG_SPL_PINCTRL=y
 CONFIG_PINCTRL_SINGLE=y
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v4 05/10] configs: j784s4_evm_a72_defconfig: Enable configs for PCIe boot
  2025-12-01 11:00 [PATCH v4 00/10] arm: k3: j784s4: Add PCIe boot support Hrushikesh Salunke
                   ` (3 preceding siblings ...)
  2025-12-01 11:00 ` [PATCH v4 04/10] configs: j784s4_evm_r5_defconfig: Enable configs for PCIe boot Hrushikesh Salunke
@ 2025-12-01 11:00 ` Hrushikesh Salunke
  2025-12-01 11:00 ` [PATCH v4 06/10] configs: am69_sk_r5_defconfig: Disable PCIe boot configs Hrushikesh Salunke
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: Hrushikesh Salunke @ 2025-12-01 11:00 UTC (permalink / raw)
  To: trini, a-nandan, m-chawdhry, c-vankar, u-kumar1, j-keerthy,
	marek.vasut+renesas, n-francis, jm, anshuld, s-vadapalli,
	ahalaney, semen.protsenko, mkorpershoek
  Cc: u-boot, h-salunke, danishanwar

J784S4 SoC has two instances of PCIe, namely PCIe0 and PCIe1. The
PCIe1 instance is used for PCIe endpoint boot. Enable the configs
required for PCIe boot on the J784S4 platform.

Signed-off-by: Hrushikesh Salunke <h-salunke@ti.com>
---
 configs/j784s4_evm_a72_defconfig | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/configs/j784s4_evm_a72_defconfig b/configs/j784s4_evm_a72_defconfig
index fc7acbae694..face831797b 100644
--- a/configs/j784s4_evm_a72_defconfig
+++ b/configs/j784s4_evm_a72_defconfig
@@ -46,9 +46,16 @@ CONFIG_SPL_FS_LOAD_PAYLOAD_NAME="u-boot.img"
 CONFIG_SPL_I2C=y
 CONFIG_SPL_DM_MAILBOX=y
 CONFIG_SPL_DM_SPI_FLASH=y
+CONFIG_SPL_PCI_ENDPOINT=y
 CONFIG_SPL_DM_RESET=y
 CONFIG_SPL_POWER_DOMAIN=y
 CONFIG_SPL_RAM_DEVICE=y
+CONFIG_SPL_PCI_DFU=y
+CONFIG_SPL_PCI_DFU_SPL_LOAD_FIT_ADDRESS=0x81000000
+CONFIG_SPL_PCI_DFU_BAR_SIZE=0x400000
+CONFIG_SPL_PCI_DFU_VENDOR_ID=0x104c
+CONFIG_SPL_PCI_DFU_DEVICE_ID=0xb012
+CONFIG_SPL_PCI_DFU_BOOT_PHASE="tispl.bin"
 # CONFIG_SPL_SPI_FLASH_TINY is not set
 CONFIG_SPL_SPI_FLASH_SFDP_SUPPORT=y
 CONFIG_SPL_SPI_LOAD=y
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v4 06/10] configs: am69_sk_r5_defconfig: Disable PCIe boot configs
  2025-12-01 11:00 [PATCH v4 00/10] arm: k3: j784s4: Add PCIe boot support Hrushikesh Salunke
                   ` (4 preceding siblings ...)
  2025-12-01 11:00 ` [PATCH v4 05/10] configs: j784s4_evm_a72_defconfig: " Hrushikesh Salunke
@ 2025-12-01 11:00 ` Hrushikesh Salunke
  2025-12-01 16:29   ` Kumar, Udit
  2025-12-01 11:01 ` [PATCH v4 07/10] configs: am69_sk_a72_defconfig: " Hrushikesh Salunke
                   ` (3 subsequent siblings)
  9 siblings, 1 reply; 14+ messages in thread
From: Hrushikesh Salunke @ 2025-12-01 11:00 UTC (permalink / raw)
  To: trini, a-nandan, m-chawdhry, c-vankar, u-kumar1, j-keerthy,
	marek.vasut+renesas, n-francis, jm, anshuld, s-vadapalli,
	ahalaney, semen.protsenko, mkorpershoek
  Cc: u-boot, h-salunke, danishanwar

AM69 SK does not support PCIe boot. Disable PCI boot related
configurations that are not applicable.

Signed-off-by: Hrushikesh Salunke <h-salunke@ti.com>
---
 configs/am69_sk_r5_defconfig | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/configs/am69_sk_r5_defconfig b/configs/am69_sk_r5_defconfig
index 2186b9a0490..385fd999d30 100644
--- a/configs/am69_sk_r5_defconfig
+++ b/configs/am69_sk_r5_defconfig
@@ -5,6 +5,15 @@ CONFIG_ARCH_K3=y
 CONFIG_SOC_K3_J784S4=y
 CONFIG_TARGET_J784S4_R5_EVM=y
 
+CONFIG_MULTIPLEXER=n
+CONFIG_SPL_MUX_MMIO=n
+CONFIG_SPL_PCI_ENDPOINT=n
+CONFIG_SPL_PCI_DFU=n
+CONFIG_PCIE_CDNS_TI_EP=n
+CONFIG_SPL_PHY=n
+CONFIG_SPL_PHY_CADENCE_TORRENT=n
+CONFIG_SPL_PHY_J721E_WIZ=n
+
 CONFIG_DEFAULT_DEVICE_TREE="k3-am69-r5-sk"
 CONFIG_SPL_OF_LIST="k3-am69-r5-sk"
 CONFIG_OF_LIST="k3-am69-r5-sk"
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v4 07/10] configs: am69_sk_a72_defconfig: Disable PCIe boot configs
  2025-12-01 11:00 [PATCH v4 00/10] arm: k3: j784s4: Add PCIe boot support Hrushikesh Salunke
                   ` (5 preceding siblings ...)
  2025-12-01 11:00 ` [PATCH v4 06/10] configs: am69_sk_r5_defconfig: Disable PCIe boot configs Hrushikesh Salunke
@ 2025-12-01 11:01 ` Hrushikesh Salunke
  2025-12-01 11:01 ` [PATCH v4 08/10] configs: j742s2_evm_r5_defconfig: " Hrushikesh Salunke
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: Hrushikesh Salunke @ 2025-12-01 11:01 UTC (permalink / raw)
  To: trini, a-nandan, m-chawdhry, c-vankar, u-kumar1, j-keerthy,
	marek.vasut+renesas, n-francis, jm, anshuld, s-vadapalli,
	ahalaney, semen.protsenko, mkorpershoek
  Cc: u-boot, h-salunke, danishanwar

AM69 SK does not support PCIe boot. Disable PCI boot related
configurations that are not applicable.

Signed-off-by: Hrushikesh Salunke <h-salunke@ti.com>
---
 configs/am69_sk_a72_defconfig | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/configs/am69_sk_a72_defconfig b/configs/am69_sk_a72_defconfig
index bd8aaf7f201..831fd974bab 100644
--- a/configs/am69_sk_a72_defconfig
+++ b/configs/am69_sk_a72_defconfig
@@ -9,6 +9,10 @@ CONFIG_CMD_UFS=n
 CONFIG_UFS=n
 CONFIG_CADENCE_UFS=n
 CONFIG_TI_J721E_UFS=n
+CONFIG_PCI_ENDPOINT=n
+CONFIG_PCIE_CDNS_TI_EP=n
+CONFIG_SPL_PCI_ENDPOINT=n
+CONFIG_SPL_PCI_DFU=n
 
 CONFIG_DEFAULT_DEVICE_TREE="ti/k3-am69-sk"
 CONFIG_OF_LIST="ti/k3-am69-sk"
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v4 08/10] configs: j742s2_evm_r5_defconfig: Disable PCIe boot configs
  2025-12-01 11:00 [PATCH v4 00/10] arm: k3: j784s4: Add PCIe boot support Hrushikesh Salunke
                   ` (6 preceding siblings ...)
  2025-12-01 11:01 ` [PATCH v4 07/10] configs: am69_sk_a72_defconfig: " Hrushikesh Salunke
@ 2025-12-01 11:01 ` Hrushikesh Salunke
  2025-12-01 16:23   ` Kumar, Udit
  2025-12-01 11:01 ` [PATCH v4 09/10] configs: j742s2_evm_a72_defconfig: " Hrushikesh Salunke
  2025-12-01 11:01 ` [PATCH v4 10/10] docs: board: ti: j784s4_evm: Add PCIe boot documentation Hrushikesh Salunke
  9 siblings, 1 reply; 14+ messages in thread
From: Hrushikesh Salunke @ 2025-12-01 11:01 UTC (permalink / raw)
  To: trini, a-nandan, m-chawdhry, c-vankar, u-kumar1, j-keerthy,
	marek.vasut+renesas, n-francis, jm, anshuld, s-vadapalli,
	ahalaney, semen.protsenko, mkorpershoek
  Cc: u-boot, h-salunke, danishanwar

J742S2 EVM supports PCIe boot but it is not enabled yet. Disable PCI
boot related configurations that are not applicable.

Signed-off-by: Hrushikesh Salunke <h-salunke@ti.com>
---
 configs/j742s2_evm_r5_defconfig | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/configs/j742s2_evm_r5_defconfig b/configs/j742s2_evm_r5_defconfig
index 2be6318df76..fa0bafca689 100644
--- a/configs/j742s2_evm_r5_defconfig
+++ b/configs/j742s2_evm_r5_defconfig
@@ -5,5 +5,14 @@ CONFIG_ARCH_K3=y
 CONFIG_SOC_K3_J784S4=y
 CONFIG_TARGET_J742S2_R5_EVM=y
 
+CONFIG_SPL_PCI_ENDPOINT=n
+CONFIG_SPL_PCI_DFU=n
+CONFIG_MULTIPLEXER=n
+CONFIG_SPL_MUX_MMIO=n
+CONFIG_PCIE_CDNS_TI_EP=n
+CONFIG_SPL_PHY=n
+CONFIG_SPL_PHY_CADENCE_TORRENT=n
+CONFIG_SPL_PHY_J721E_WIZ=n
+
 CONFIG_DEFAULT_DEVICE_TREE="k3-j742s2-r5-evm"
 CONFIG_SPL_OF_LIST="k3-j742s2-r5-evm"
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v4 09/10] configs: j742s2_evm_a72_defconfig: Disable PCIe boot configs
  2025-12-01 11:00 [PATCH v4 00/10] arm: k3: j784s4: Add PCIe boot support Hrushikesh Salunke
                   ` (7 preceding siblings ...)
  2025-12-01 11:01 ` [PATCH v4 08/10] configs: j742s2_evm_r5_defconfig: " Hrushikesh Salunke
@ 2025-12-01 11:01 ` Hrushikesh Salunke
  2025-12-01 11:01 ` [PATCH v4 10/10] docs: board: ti: j784s4_evm: Add PCIe boot documentation Hrushikesh Salunke
  9 siblings, 0 replies; 14+ messages in thread
From: Hrushikesh Salunke @ 2025-12-01 11:01 UTC (permalink / raw)
  To: trini, a-nandan, m-chawdhry, c-vankar, u-kumar1, j-keerthy,
	marek.vasut+renesas, n-francis, jm, anshuld, s-vadapalli,
	ahalaney, semen.protsenko, mkorpershoek
  Cc: u-boot, h-salunke, danishanwar

J742S2 EVM supports PCIe boot but it is not enabled yet. Disable PCI
boot related configurations that are not applicable.

Signed-off-by: Hrushikesh Salunke <h-salunke@ti.com>
---
 configs/j742s2_evm_a72_defconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/configs/j742s2_evm_a72_defconfig b/configs/j742s2_evm_a72_defconfig
index e534ce4c2e3..3786fa5b542 100644
--- a/configs/j742s2_evm_a72_defconfig
+++ b/configs/j742s2_evm_a72_defconfig
@@ -5,5 +5,10 @@ CONFIG_ARCH_K3=y
 CONFIG_SOC_K3_J784S4=y
 CONFIG_TARGET_J742S2_A72_EVM=y
 
+CONFIG_PCI_ENDPOINT=n
+CONFIG_PCIE_CDNS_TI_EP=n
+CONFIG_SPL_PCI_ENDPOINT=n
+CONFIG_SPL_PCI_DFU=n
+
 CONFIG_DEFAULT_DEVICE_TREE="ti/k3-j742s2-evm"
 CONFIG_SPL_OF_LIST="ti/k3-j742s2-evm"
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v4 10/10] docs: board: ti: j784s4_evm: Add PCIe boot documentation
  2025-12-01 11:00 [PATCH v4 00/10] arm: k3: j784s4: Add PCIe boot support Hrushikesh Salunke
                   ` (8 preceding siblings ...)
  2025-12-01 11:01 ` [PATCH v4 09/10] configs: j742s2_evm_a72_defconfig: " Hrushikesh Salunke
@ 2025-12-01 11:01 ` Hrushikesh Salunke
  2025-12-01 16:47   ` Kumar, Udit
  9 siblings, 1 reply; 14+ messages in thread
From: Hrushikesh Salunke @ 2025-12-01 11:01 UTC (permalink / raw)
  To: trini, a-nandan, m-chawdhry, c-vankar, u-kumar1, j-keerthy,
	marek.vasut+renesas, n-francis, jm, anshuld, s-vadapalli,
	ahalaney, semen.protsenko, mkorpershoek
  Cc: u-boot, h-salunke, danishanwar

Add PCIe boot documentation for J784S4-EVM including boot mode switch
settings, hardware setup requirements, endpoint configuration details
and step-by-step boot procedure.

Signed-off-by: Hrushikesh Salunke <h-salunke@ti.com>
---
 doc/board/ti/j784s4_evm.rst | 267 ++++++++++++++++++++++++++++++++++++
 1 file changed, 267 insertions(+)

diff --git a/doc/board/ti/j784s4_evm.rst b/doc/board/ti/j784s4_evm.rst
index 22442874110..0c9dad122a7 100644
--- a/doc/board/ti/j784s4_evm.rst
+++ b/doc/board/ti/j784s4_evm.rst
@@ -280,6 +280,10 @@ http://www.ti.com/lit/zip/spruj52 under the `Boot Mode Pins` section.
      - 00000000
      - 01110000
 
+   * - PCIe
+     - 10001000
+     - 01010000
+
 For SW7 and SW11, the switch state in the "ON" position = 1.
 
 Boot Mode Pins for AM69-SK
@@ -311,6 +315,269 @@ section.
 
 For SW2, the switch state in the "ON" position = 1.
 
+PCIe Boot
+---------
+
+The J784S4 SoC supports booting over PCIe, allowing the device to function
+as a PCIe endpoint and receive boot loader images from a PCIe root complex.
+
+Hardware Setup
+^^^^^^^^^^^^^^
+
+To boot J784S4 via PCIe, the following hardware setup is required:
+
+1. Configure the boot mode switches on J784S4-EVM for PCIe boot:
+
+   .. code-block:: text
+
+      SW7:  01010000
+      SW11: 10001000
+
+2. Connect the J784S4-EVM (endpoint) to a PCIe root complex (e.g., x86 host)
+   using a PCIe cable. Both boards should be powered off before making the
+   connection.
+
+Endpoint Configuration
+^^^^^^^^^^^^^^^^^^^^^^
+
+The following configuration options are enabled by default in
+``j784s4_evm_r5_defconfig`` and ``j784s4_evm_a72_defconfig``:
+
+- ``CONFIG_SPL_PCI_DFU_BAR_SIZE``: Size of the PCIe BAR for DFU/boot image download
+- ``CONFIG_SPL_PCI_DFU_VENDOR_ID``: PCIe vendor ID advertised by the endpoint
+- ``CONFIG_SPL_PCI_DFU_DEVICE_ID``: PCIe device ID advertised by the endpoint
+- ``CONFIG_SPL_PCI_DFU_MAGIC_WORD``: Magic word written by root complex to signal image transfer completion
+- ``CONFIG_SPL_PCI_DFU_BOOT_PHASE``: Current boot phase indicator for root complex
+
+By default, PCIe root complex mode is enabled in the device tree. To enable
+endpoint mode, build the boot loaders with the device tree overlay
+``k3-j784s4-evm-pcie0-pcie1-ep.dtso``.
+
+PCIe Boot Procedure
+^^^^^^^^^^^^^^^^^^^
+
+The following steps describe how to boot J784S4 over PCIe:
+
+1. Compile the sample host program (provided below):
+
+   .. prompt:: bash
+
+      gcc -o pcie_boot_copy pcie_boot_copy.c
+
+2. Power on the J784S4-EVM (endpoint) after configuring boot mode switches.
+
+3. On the root complex, check PCIe enumeration:
+
+   .. prompt:: bash
+
+      lspci
+
+   The endpoint will appear as a RAM device or with multiple functions:
+
+   .. code-block:: text
+
+      0000:00:00.0 PCI bridge: Texas Instruments Device b012
+      0000:01:00.0 RAM memory: Texas Instruments Device b012
+      0000:01:00.1 Non-VGA unclassified device: Texas Instruments Device 0100
+      0000:01:00.2 Non-VGA unclassified device: Texas Instruments Device 0100
+
+4. Copy ``tiboot3.bin`` to the endpoint. Use ``lspci -vv`` to identify the BAR
+   address:
+
+   .. prompt:: bash
+
+      sudo ./pcie_boot_copy j784s4 0x4007100000 tiboot3.bin
+
+   The sample program automatically writes the image start address to
+   ``0x41CF3FE0`` and the magic word ``0xB17CEAD9`` to ``0x41CF3FE4``.
+
+5. After ``tiboot3.bin`` is processed, the PCIe link will go down briefly.
+   Remove the PCIe device and rescan the bus:
+
+   .. prompt:: bash
+
+      echo 1 > /sys/bus/pci/devices/0000\:01\:00.0/remove
+      echo 1 > /sys/bus/pci/devices/0000\:00\:00.0/rescan
+      lspci
+
+   The enumeration will change:
+
+   .. code-block:: text
+
+      0000:00:00.0 PCI bridge: Texas Instruments Device b012
+      0000:01:00.0 RAM memory: Texas Instruments Device b010 (rev dc)
+
+6. Copy ``tispl.bin`` to the new BAR address (use ``lspci -vv`` to find):
+
+   .. prompt:: bash
+
+      sudo ./pcie_boot_copy j784s4 0x4000400000 tispl.bin
+
+7. After ``tispl.bin`` is processed, the PCIe link will go down again. Remove
+   and rescan the PCIe device:
+
+   .. prompt:: bash
+
+      echo 1 > /sys/bus/pci/devices/0000\:01\:00.0/remove
+      echo 1 > /sys/bus/pci/devices/0000\:00\:00.0/rescan
+
+8. Copy ``u-boot.img``:
+
+   .. prompt:: bash
+
+      sudo ./pcie_boot_copy j784s4 0x4000400000 u-boot.img
+
+9. After ``u-boot.img`` is successfully loaded, the boot process is complete
+   and endpoint should boot till U-BOOT prompt.
+
+.. note::
+
+   During the boot process, "PCIe LINK DOWN" messages might appear in kernel
+   logs. This is expected as the endpoint resets and re-initializes the PCIe
+   link after processing each boot stage.
+
+Sample Host Program
+^^^^^^^^^^^^^^^^^^^
+
+The following C program can be used on the root complex to copy boot images
+to the J784S4 endpoint:
+
+.. code-block:: c
+
+   #include <stdio.h>
+   #include <stdlib.h>
+   #include <fcntl.h>
+   #include <sys/mman.h>
+   #include <unistd.h>
+   #include <string.h>
+
+   #define MAP_SIZE 0x10000000
+
+   int main(int argc, char *argv[])
+   {
+      char *bootfilename = NULL;
+      char *platform = NULL;
+      off_t bar1_address = 0;
+      int fd;
+      void *map_base;
+      int i = 0;
+      unsigned char *check;
+      int read_result;
+      long lSize;
+      int i;
+      FILE * fptr;
+      off_t load_addr, load_addr_offset, start_addr_offset;
+      unsigned int magic_word = 0;
+      int use_magic_word = 0;
+
+      if (argc != 4) {
+         printf("Usage: %s <platform> <bar_address> <binary_file>\n", argv[0]);
+         printf("  platform: am64x or j784s4\n");
+         return 0;
+      }
+
+      platform = argv[1];
+      bar1_address = strtoul(argv[2], NULL, 16);
+      bootfilename = argv[3];
+
+      printf("platform: %s\n", platform);
+      printf("bootfilename: %s\n", bootfilename);
+      printf("bar1_address: 0x%lx\n", bar1_address);
+
+      if(!strcmp(bootfilename,"tiboot3.bin"))
+      {
+         if(!strcmp(platform, "j784s4"))
+         {
+            load_addr = 0x41C00000;
+            load_addr_offset = 0x00;
+            start_addr_offset = 0xf3fe0;
+            magic_word = 0xB17CEAD9;
+            use_magic_word = 1;
+         }
+         else
+         {
+            printf("Unsupported platform: %s\n", platform);
+            return 0;
+         }
+      }
+      else
+      {
+         load_addr = 0x0;
+         load_addr_offset = 0x0;
+         start_addr_offset = MAP_SIZE - 0x4;
+      }
+
+      printf("load_addr: 0x%lx\n", load_addr);
+      printf("load_addr_offset: 0x%lx\n", load_addr_offset);
+      printf("start_addr_offset: 0x%lx\n", start_addr_offset);
+      if (use_magic_word)
+         printf("magic_word: 0x%x\n", magic_word);
+
+      printf("try to open /dev/mem.\n");
+      fd = open("/dev/mem", O_RDWR | O_SYNC);
+      if(fd == -1)
+      {
+         printf("failed to open /dev/mem.\n");
+         return -1;
+      }
+
+      map_base = mmap(0, MAP_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, fd, bar1_address);
+      if(map_base == (void *)-1)
+      {
+         printf("can't mmap.\n");
+         return -1;
+      }
+      printf("mmap done\n");
+
+      fptr = fopen(bootfilename, "rb");
+      if (fptr == NULL) {
+         printf("can't read bootfile.\n");
+         return -1;
+      }
+
+      fseek(fptr, 0, SEEK_END);
+      lSize = ftell(fptr);
+      rewind(fptr);
+
+      printf("bootfile size = 0x%lx\n", lSize);
+
+      check = (unsigned char *)malloc(sizeof(char) * lSize);
+      if(check == NULL)
+      {
+         printf("malloc failed\n");
+         return -1;
+      }
+
+      read_result = fread(check, 1, lSize, fptr);
+      if(read_result != lSize)
+      {
+         printf("fread failed\n");
+         return -1;
+      }
+
+      for(i = 0; i < lSize; i++)
+      {
+         *((char *)(map_base) + load_addr_offset + i) = check[i];
+      }
+      printf("Image copy done.\n");
+
+      sleep(1);
+
+      *(unsigned int *)(map_base + start_addr_offset) = (unsigned int)(load_addr_offset + load_addr);
+
+      // Write magic word for J784S4 at R5 stage
+      if(use_magic_word)
+      {
+         *(unsigned int *)(map_base + start_addr_offset + 4) = magic_word;
+         printf("Magic word written.\n");
+      }
+
+      return 0;
+   }
+
+This program copies the boot image to the PCIe endpoint's memory region and
+writes the necessary control words to signal image transfer completion.
+
 Debugging U-Boot
 ----------------
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH v4 08/10] configs: j742s2_evm_r5_defconfig: Disable PCIe boot configs
  2025-12-01 11:01 ` [PATCH v4 08/10] configs: j742s2_evm_r5_defconfig: " Hrushikesh Salunke
@ 2025-12-01 16:23   ` Kumar, Udit
  0 siblings, 0 replies; 14+ messages in thread
From: Kumar, Udit @ 2025-12-01 16:23 UTC (permalink / raw)
  To: Hrushikesh Salunke, trini, a-nandan, m-chawdhry, c-vankar,
	j-keerthy, marek.vasut+renesas, n-francis, jm, anshuld,
	s-vadapalli, ahalaney, semen.protsenko, mkorpershoek
  Cc: u-boot, danishanwar, u-kumar1


On 12/1/2025 4:31 PM, Hrushikesh Salunke wrote:
> J742S2 EVM supports PCIe boot but it is not enabled yet. Disable PCI
> boot related configurations that are not applicable.


Please specify reason in commit message , why PCIe boot can not be 
enable even SOC supports this.


> Signed-off-by: Hrushikesh Salunke <h-salunke@ti.com>
> ---
>   configs/j742s2_evm_r5_defconfig | 9 +++++++++
>   1 file changed, 9 insertions(+)
>
> diff --git a/configs/j742s2_evm_r5_defconfig b/configs/j742s2_evm_r5_defconfig
> index 2be6318df76..fa0bafca689 100644
> --- a/configs/j742s2_evm_r5_defconfig
> +++ b/configs/j742s2_evm_r5_defconfig
> @@ -5,5 +5,14 @@ CONFIG_ARCH_K3=y
>   CONFIG_SOC_K3_J784S4=y
>   CONFIG_TARGET_J742S2_R5_EVM=y
>   
> +CONFIG_SPL_PCI_ENDPOINT=n
> +CONFIG_SPL_PCI_DFU=n
> +CONFIG_MULTIPLEXER=n
> +CONFIG_SPL_MUX_MMIO=n
> +CONFIG_PCIE_CDNS_TI_EP=n
> +CONFIG_SPL_PHY=n
> +CONFIG_SPL_PHY_CADENCE_TORRENT=n
> +CONFIG_SPL_PHY_J721E_WIZ=n
> +
>   CONFIG_DEFAULT_DEVICE_TREE="k3-j742s2-r5-evm"
>   CONFIG_SPL_OF_LIST="k3-j742s2-r5-evm"

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v4 06/10] configs: am69_sk_r5_defconfig: Disable PCIe boot configs
  2025-12-01 11:00 ` [PATCH v4 06/10] configs: am69_sk_r5_defconfig: Disable PCIe boot configs Hrushikesh Salunke
@ 2025-12-01 16:29   ` Kumar, Udit
  0 siblings, 0 replies; 14+ messages in thread
From: Kumar, Udit @ 2025-12-01 16:29 UTC (permalink / raw)
  To: Hrushikesh Salunke, trini, a-nandan, m-chawdhry, c-vankar,
	j-keerthy, marek.vasut+renesas, n-francis, jm, anshuld,
	s-vadapalli, ahalaney, semen.protsenko, mkorpershoek
  Cc: u-boot, danishanwar


On 12/1/2025 4:30 PM, Hrushikesh Salunke wrote:
> AM69 SK does not support PCIe boot. Disable PCI boot related
> configurations that are not applicable.
>
> Signed-off-by: Hrushikesh Salunke <h-salunke@ti.com>
> ---
>   configs/am69_sk_r5_defconfig | 9 +++++++++
>   1 file changed, 9 insertions(+)
>
> diff --git a/configs/am69_sk_r5_defconfig b/configs/am69_sk_r5_defconfig
> index 2186b9a0490..385fd999d30 100644
> --- a/configs/am69_sk_r5_defconfig
> +++ b/configs/am69_sk_r5_defconfig
> @@ -5,6 +5,15 @@ CONFIG_ARCH_K3=y
>   CONFIG_SOC_K3_J784S4=y
>   CONFIG_TARGET_J784S4_R5_EVM=y
>   
> +CONFIG_MULTIPLEXER=n
> +CONFIG_SPL_MUX_MMIO=n
> +CONFIG_SPL_PCI_ENDPOINT=n
> +CONFIG_SPL_PCI_DFU=n
> +CONFIG_PCIE_CDNS_TI_EP=n
> +CONFIG_SPL_PHY=n
> +CONFIG_SPL_PHY_CADENCE_TORRENT=n
> +CONFIG_SPL_PHY_J721E_WIZ=n
> +

Please check, if this make sense , PHY_CADENCE_TORRENT and PHY_J721E_WIZ 
depends upon PHY in Kconfig.

In order to disable, just say CONFIG_SPL_PHY=n.

Same way PCIE_CDNS_TI_EP could depends upon PCI_ENDPOINT


>   CONFIG_DEFAULT_DEVICE_TREE="k3-am69-r5-sk"
>   CONFIG_SPL_OF_LIST="k3-am69-r5-sk"
>   CONFIG_OF_LIST="k3-am69-r5-sk"

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v4 10/10] docs: board: ti: j784s4_evm: Add PCIe boot documentation
  2025-12-01 11:01 ` [PATCH v4 10/10] docs: board: ti: j784s4_evm: Add PCIe boot documentation Hrushikesh Salunke
@ 2025-12-01 16:47   ` Kumar, Udit
  0 siblings, 0 replies; 14+ messages in thread
From: Kumar, Udit @ 2025-12-01 16:47 UTC (permalink / raw)
  To: Hrushikesh Salunke, trini, a-nandan, m-chawdhry, c-vankar,
	j-keerthy, marek.vasut+renesas, n-francis, jm, anshuld,
	s-vadapalli, ahalaney, semen.protsenko, mkorpershoek
  Cc: u-boot, danishanwar, u-kumar1


On 12/1/2025 4:31 PM, Hrushikesh Salunke wrote:
> Add PCIe boot documentation for J784S4-EVM including boot mode switch
> settings, hardware setup requirements, endpoint configuration details
> and step-by-step boot procedure.
>
> Signed-off-by: Hrushikesh Salunke <h-salunke@ti.com>
> ---
>   doc/board/ti/j784s4_evm.rst | 267 ++++++++++++++++++++++++++++++++++++
>   1 file changed, 267 insertions(+)
>
> diff --git a/doc/board/ti/j784s4_evm.rst b/doc/board/ti/j784s4_evm.rst
> index 22442874110..0c9dad122a7 100644
> --- a/doc/board/ti/j784s4_evm.rst
> +++ b/doc/board/ti/j784s4_evm.rst
> @@ -280,6 +280,10 @@ http://www.ti.com/lit/zip/spruj52 under the `Boot Mode Pins` section.
>        - 00000000
>        - 01110000
>   
> +   * - PCIe
> +     - 10001000
> +     - 01010000
> +
>   For SW7 and SW11, the switch state in the "ON" position = 1.
>   
>   Boot Mode Pins for AM69-SK
> @@ -311,6 +315,269 @@ section.
>   
>   For SW2, the switch state in the "ON" position = 1.
>   
> +PCIe Boot
> +---------
> +
> +The J784S4 SoC supports booting over PCIe, allowing the device to function
> +as a PCIe endpoint and receive boot loader images from a PCIe root complex.
> +
> +Hardware Setup
> +^^^^^^^^^^^^^^
> +
> +To boot J784S4 via PCIe, the following hardware setup is required:
> +
> +1. Configure the boot mode switches on J784S4-EVM for PCIe boot:
> +
> +   .. code-block:: text
> +
> +      SW7:  01010000
> +      SW11: 10001000
> +
> +2. Connect the J784S4-EVM (endpoint) to a PCIe root complex (e.g., x86 host)
> +   using a PCIe cable. Both boards should be powered off before making the
> +   connection.
> +
> +Endpoint Configuration
> +^^^^^^^^^^^^^^^^^^^^^^
> +
> +The following configuration options are enabled by default in
> +``j784s4_evm_r5_defconfig`` and ``j784s4_evm_a72_defconfig``:
> +
> +- ``CONFIG_SPL_PCI_DFU_BAR_SIZE``: Size of the PCIe BAR for DFU/boot image download
> +- ``CONFIG_SPL_PCI_DFU_VENDOR_ID``: PCIe vendor ID advertised by the endpoint
> +- ``CONFIG_SPL_PCI_DFU_DEVICE_ID``: PCIe device ID advertised by the endpoint
> +- ``CONFIG_SPL_PCI_DFU_MAGIC_WORD``: Magic word written by root complex to signal image transfer completion
> +- ``CONFIG_SPL_PCI_DFU_BOOT_PHASE``: Current boot phase indicator for root complex
> +
> +By default, PCIe root complex mode is enabled in the device tree. To enable
> +endpoint mode, build the boot loaders with the device tree overlay
> +``k3-j784s4-evm-pcie0-pcie1-ep.dtso``.

Do you think, you need bootph property in pcie_ep node ?


> +
> +PCIe Boot Procedure
> +^^^^^^^^^^^^^^^^^^^
> [..]+
> +The following steps describe how to boot J784S4 over PCIe:

> +
> [..]

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2025-12-01 16:47 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-01 11:00 [PATCH v4 00/10] arm: k3: j784s4: Add PCIe boot support Hrushikesh Salunke
2025-12-01 11:00 ` [PATCH v4 01/10] arm: mach-k3: j784s4: Update SoC autogen data to enable PCIe boot Hrushikesh Salunke
2025-12-01 11:00 ` [PATCH v4 02/10] phy: cadence: Add config to enable Cadence Torrent PHY at SPL stage Hrushikesh Salunke
2025-12-01 11:00 ` [PATCH v4 03/10] phy: ti: Add config to enable J721E WIZ SERDES wrapper " Hrushikesh Salunke
2025-12-01 11:00 ` [PATCH v4 04/10] configs: j784s4_evm_r5_defconfig: Enable configs for PCIe boot Hrushikesh Salunke
2025-12-01 11:00 ` [PATCH v4 05/10] configs: j784s4_evm_a72_defconfig: " Hrushikesh Salunke
2025-12-01 11:00 ` [PATCH v4 06/10] configs: am69_sk_r5_defconfig: Disable PCIe boot configs Hrushikesh Salunke
2025-12-01 16:29   ` Kumar, Udit
2025-12-01 11:01 ` [PATCH v4 07/10] configs: am69_sk_a72_defconfig: " Hrushikesh Salunke
2025-12-01 11:01 ` [PATCH v4 08/10] configs: j742s2_evm_r5_defconfig: " Hrushikesh Salunke
2025-12-01 16:23   ` Kumar, Udit
2025-12-01 11:01 ` [PATCH v4 09/10] configs: j742s2_evm_a72_defconfig: " Hrushikesh Salunke
2025-12-01 11:01 ` [PATCH v4 10/10] docs: board: ti: j784s4_evm: Add PCIe boot documentation Hrushikesh Salunke
2025-12-01 16:47   ` Kumar, Udit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox