[PATCH 0/4] Fix OSPI boot for J722S

This series fixes OSPI boot for J722S. It contains fixes for DMSC communication, R5 regmap for ospi and dma specific overrides for ospi.
Test log: https://gist.github.com/PrasanthBabuMantena/ad469dd09ab7263f85f87dadda46c86d
Vaishnav Achath (4): mailbox: k3-sec-proxy: Add DM to DMSC communication thread for J722S arm: dts: k3-j722s-r5-evm: Fix DM2TIFS secproxy thread ID arm: mach-k3: j722_spl: Add FAST XSPI boot mode arm: dts: k3-j722s*: Add overrides specific to OSPI
arch/arm/dts/k3-j722s-evm-u-boot.dtsi | 4 ++++ arch/arm/dts/k3-j722s-r5-evm.dts | 17 +++++++++++++++-- arch/arm/mach-k3/include/mach/j722s_spl.h | 1 + arch/arm/mach-k3/j722s/j722s_init.c | 2 ++ drivers/mailbox/k3-sec-proxy.c | 2 +- 5 files changed, 23 insertions(+), 3 deletions(-)

From: Vaishnav Achath vaishnav.a@ti.com
J722S R5 SPL uses sec-proxy threads 28 and 29 for communication with TIFS. Mark these as valid threads in the driver.
Signed-off-by: Vaishnav Achath vaishnav.a@ti.com Signed-off-by: Prasanth Babu Mantena p-mantena@ti.com --- drivers/mailbox/k3-sec-proxy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mailbox/k3-sec-proxy.c b/drivers/mailbox/k3-sec-proxy.c index 5eafe46fd4d..6f5ad37919f 100644 --- a/drivers/mailbox/k3-sec-proxy.c +++ b/drivers/mailbox/k3-sec-proxy.c @@ -408,7 +408,7 @@ static int k3_sec_proxy_remove(struct udevice *dev) return 0; }
-static const u32 am6x_valid_threads[] = { 0, 1, 4, 5, 6, 7, 8, 9, 11, 12, 13, 20, 21, 22, 23 }; +static const u32 am6x_valid_threads[] = { 0, 1, 4, 5, 6, 7, 8, 9, 11, 12, 13, 20, 21, 22, 23, 28, 29 };
static const struct k3_sec_proxy_desc am654_desc = { .thread_count = 90,

On 12/10/2024 7:27 PM, Prasanth Babu Mantena wrote:
From: Vaishnav Achath vaishnav.a@ti.com
J722S R5 SPL uses sec-proxy threads 28 and 29 for communication with TIFS. Mark these as valid threads in the driver.
Please mention doc link also,
Also is this only for R5 SPL
Signed-off-by: Vaishnav Achath vaishnav.a@ti.com Signed-off-by: Prasanth Babu Mantena p-mantena@ti.com
drivers/mailbox/k3-sec-proxy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mailbox/k3-sec-proxy.c b/drivers/mailbox/k3-sec-proxy.c index 5eafe46fd4d..6f5ad37919f 100644 --- a/drivers/mailbox/k3-sec-proxy.c +++ b/drivers/mailbox/k3-sec-proxy.c @@ -408,7 +408,7 @@ static int k3_sec_proxy_remove(struct udevice *dev) return 0; }
-static const u32 am6x_valid_threads[] = { 0, 1, 4, 5, 6, 7, 8, 9, 11, 12, 13, 20, 21, 22, 23 }; +static const u32 am6x_valid_threads[] = { 0, 1, 4, 5, 6, 7, 8, 9, 11, 12, 13, 20, 21, 22, 23, 28, 29 };
static const struct k3_sec_proxy_desc am654_desc = { .thread_count = 90,

On 21:01, Kumar, Udit wrote: Hi Udit,
On 12/10/2024 7:27 PM, Prasanth Babu Mantena wrote:
From: Vaishnav Achath vaishnav.a@ti.com
J722S R5 SPL uses sec-proxy threads 28 and 29 for communication with TIFS. Mark these as valid threads in the driver.
Please mention doc link also,
Also is this only for R5 SPL
Yes this is only for R5, as DM is not active on dmsc, in R5 stage, use dm_tifs whose sec-proxy threads are specified in documentation. https://software-dl.ti.com/tisci/esd/latest/5_soc_doc/j722s/sec_proxy.html Will add this doc link in v2.
Thanks, Prasanth
Signed-off-by: Vaishnav Achath vaishnav.a@ti.com Signed-off-by: Prasanth Babu Mantena p-mantena@ti.com
drivers/mailbox/k3-sec-proxy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mailbox/k3-sec-proxy.c b/drivers/mailbox/k3-sec-proxy.c index 5eafe46fd4d..6f5ad37919f 100644 --- a/drivers/mailbox/k3-sec-proxy.c +++ b/drivers/mailbox/k3-sec-proxy.c @@ -408,7 +408,7 @@ static int k3_sec_proxy_remove(struct udevice *dev) return 0; } -static const u32 am6x_valid_threads[] = { 0, 1, 4, 5, 6, 7, 8, 9, 11, 12, 13, 20, 21, 22, 23 }; +static const u32 am6x_valid_threads[] = { 0, 1, 4, 5, 6, 7, 8, 9, 11, 12, 13, 20, 21, 22, 23, 28, 29 }; static const struct k3_sec_proxy_desc am654_desc = { .thread_count = 90,

From: Vaishnav Achath vaishnav.a@ti.com
Fix the DM2TIFS secureproxy thread ID as per the latest TISCI documentation for J722S. https://software-dl.ti.com/tisci/esd/latest/5_soc_doc/j722s/sec_proxy.html
Signed-off-by: Vaishnav Achath vaishnav.a@ti.com Signed-off-by: Prasanth Babu Mantena p-mantena@ti.com --- arch/arm/dts/k3-j722s-r5-evm.dts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/dts/k3-j722s-r5-evm.dts b/arch/arm/dts/k3-j722s-r5-evm.dts index 5e5c2e3111e..1bec997c93c 100644 --- a/arch/arm/dts/k3-j722s-r5-evm.dts +++ b/arch/arm/dts/k3-j722s-r5-evm.dts @@ -41,8 +41,8 @@ ti,host-id = <36>; ti,secure-host; mbox-names = "rx", "tx"; - mboxes= <&secure_proxy_main 22>, - <&secure_proxy_main 23>; + mboxes= <&secure_proxy_main 28>, + <&secure_proxy_main 29>; bootph-all; }; };

On 12/10/2024 7:27 PM, Prasanth Babu Mantena wrote:
From: Vaishnav Achath vaishnav.a@ti.com
Fix the DM2TIFS secureproxy thread ID as per the latest TISCI documentation for J722S.
Please use Fixes tag
https://software-dl.ti.com/tisci/esd/latest/5_soc_doc/j722s/sec_proxy.html
Signed-off-by: Vaishnav Achath vaishnav.a@ti.com Signed-off-by: Prasanth Babu Mantena p-mantena@ti.com
arch/arm/dts/k3-j722s-r5-evm.dts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/dts/k3-j722s-r5-evm.dts b/arch/arm/dts/k3-j722s-r5-evm.dts index 5e5c2e3111e..1bec997c93c 100644 --- a/arch/arm/dts/k3-j722s-r5-evm.dts +++ b/arch/arm/dts/k3-j722s-r5-evm.dts @@ -41,8 +41,8 @@ ti,host-id = <36>; ti,secure-host; mbox-names = "rx", "tx";
mboxes= <&secure_proxy_main 22>,
<&secure_proxy_main 23>;
mboxes= <&secure_proxy_main 28>,
<&secure_proxy_main 29>;
With Fix tag added,
Reviewed-by: Udit Kumar u-kumar1@ti.com
bootph-all;
}; };

From: Vaishnav Achath vaishnav.a@ti.com
Fast XSPI boot mode is supported by J722S ROM, add that.
Signed-off-by: Vaishnav Achath vaishnav.a@ti.com Signed-off-by: Prasanth Babu Mantena p-mantena@ti.com --- arch/arm/mach-k3/include/mach/j722s_spl.h | 1 + arch/arm/mach-k3/j722s/j722s_init.c | 2 ++ 2 files changed, 3 insertions(+)
diff --git a/arch/arm/mach-k3/include/mach/j722s_spl.h b/arch/arm/mach-k3/include/mach/j722s_spl.h index eab8c511b7c..a91cc82448f 100644 --- a/arch/arm/mach-k3/include/mach/j722s_spl.h +++ b/arch/arm/mach-k3/include/mach/j722s_spl.h @@ -24,6 +24,7 @@ #define BOOT_DEVICE_DFU 0x0A #define BOOT_DEVICE_GPMC_NAND 0x0B #define BOOT_DEVICE_GPMC_NOR 0x0C +#define BOOT_DEVICE_FAST_XSPI 0x0D #define BOOT_DEVICE_XSPI 0x0E #define BOOT_DEVICE_NOBOOT 0x0F
diff --git a/arch/arm/mach-k3/j722s/j722s_init.c b/arch/arm/mach-k3/j722s/j722s_init.c index 01b00681f68..c4d99142e48 100644 --- a/arch/arm/mach-k3/j722s/j722s_init.c +++ b/arch/arm/mach-k3/j722s/j722s_init.c @@ -219,6 +219,8 @@ static u32 __get_primary_bootmedia(u32 devstat) fallthrough; case BOOT_DEVICE_XSPI: fallthrough; + case BOOT_DEVICE_FAST_XSPI: + fallthrough; case BOOT_DEVICE_SPI: return BOOT_DEVICE_SPI;

From: Vaishnav Achath vaishnav.a@ti.com
OSPI Booot requires overrides specific to R5 and also to use DMA in R5 SPL stage the DM_TIFS needs to be enabled. Add the corresponding overrides for R5 SPL stage.
Signed-off-by: Vaishnav Achath vaishnav.a@ti.com Signed-off-by: Prasanth Babu Mantena p-mantena@ti.com --- arch/arm/dts/k3-j722s-evm-u-boot.dtsi | 4 ++++ arch/arm/dts/k3-j722s-r5-evm.dts | 13 +++++++++++++ 2 files changed, 17 insertions(+)
diff --git a/arch/arm/dts/k3-j722s-evm-u-boot.dtsi b/arch/arm/dts/k3-j722s-evm-u-boot.dtsi index 88c4a72db61..6ae76beea3e 100644 --- a/arch/arm/dts/k3-j722s-evm-u-boot.dtsi +++ b/arch/arm/dts/k3-j722s-evm-u-boot.dtsi @@ -16,3 +16,7 @@ &dmsc { bootph-pre-ram; }; + +&main_bcdma { + bootph-pre-ram; +}; diff --git a/arch/arm/dts/k3-j722s-r5-evm.dts b/arch/arm/dts/k3-j722s-r5-evm.dts index 1bec997c93c..d797e954f97 100644 --- a/arch/arm/dts/k3-j722s-r5-evm.dts +++ b/arch/arm/dts/k3-j722s-r5-evm.dts @@ -81,3 +81,16 @@ &wkup_uart0 { status = "okay"; }; + +&ospi0 { + reg = <0x00 0x0fc40000 0x00 0x100>, + <0x00 0x60000000 0x00 0x08000000>; +}; + +&main_bcdma { + ti,sci = <&dm_tifs>; +}; + +&main_pktdma { + ti,sci = <&dm_tifs>; +};

On 12/10/2024 7:27 PM, Prasanth Babu Mantena wrote:
From: Vaishnav Achath vaishnav.a@ti.com
OSPI Booot requires overrides specific to R5 and also
Booot to Boot please
to use DMA in R5 SPL stage the DM_TIFS needs to be enabled.
Sorry but, you are not enabling DM_TIFS, rather using it,
Please update commit message accordingly
Add the corresponding overrides for R5 SPL stage.
Signed-off-by: Vaishnav Achath vaishnav.a@ti.com Signed-off-by: Prasanth Babu Mantena p-mantena@ti.com
arch/arm/dts/k3-j722s-evm-u-boot.dtsi | 4 ++++ arch/arm/dts/k3-j722s-r5-evm.dts | 13 +++++++++++++ 2 files changed, 17 insertions(+)
diff --git a/arch/arm/dts/k3-j722s-evm-u-boot.dtsi b/arch/arm/dts/k3-j722s-evm-u-boot.dtsi index 88c4a72db61..6ae76beea3e 100644 --- a/arch/arm/dts/k3-j722s-evm-u-boot.dtsi +++ b/arch/arm/dts/k3-j722s-evm-u-boot.dtsi @@ -16,3 +16,7 @@ &dmsc { bootph-pre-ram; };
+&main_bcdma {
- bootph-pre-ram;
+}; diff --git a/arch/arm/dts/k3-j722s-r5-evm.dts b/arch/arm/dts/k3-j722s-r5-evm.dts index 1bec997c93c..d797e954f97 100644 --- a/arch/arm/dts/k3-j722s-r5-evm.dts +++ b/arch/arm/dts/k3-j722s-r5-evm.dts @@ -81,3 +81,16 @@ &wkup_uart0 { status = "okay"; };
+&ospi0 {
- reg = <0x00 0x0fc40000 0x00 0x100>,
<0x00 0x60000000 0x00 0x08000000>;
+};
+&main_bcdma {
- ti,sci = <&dm_tifs>;
+};
+&main_pktdma {
- ti,sci = <&dm_tifs>;
+};

On 12/10/2024 7:27 PM, Prasanth Babu Mantena wrote:
This series fixes OSPI boot for J722S. It contains fixes for DMSC communication, R5 regmap for ospi and dma specific overrides for ospi.
Subject of series, If you are fixing then one or more patch should have Fixes Tag
Test log: https://gist.github.com/PrasanthBabuMantena/ad469dd09ab7263f85f87dadda46c86d
Vaishnav Achath (4): mailbox: k3-sec-proxy: Add DM to DMSC communication thread for J722S arm: dts: k3-j722s-r5-evm: Fix DM2TIFS secproxy thread ID arm: mach-k3: j722_spl: Add FAST XSPI boot mode arm: dts: k3-j722s*: Add overrides specific to OSPI
arch/arm/dts/k3-j722s-evm-u-boot.dtsi | 4 ++++ arch/arm/dts/k3-j722s-r5-evm.dts | 17 +++++++++++++++-- arch/arm/mach-k3/include/mach/j722s_spl.h | 1 + arch/arm/mach-k3/j722s/j722s_init.c | 2 ++ drivers/mailbox/k3-sec-proxy.c | 2 +- 5 files changed, 23 insertions(+), 3 deletions(-)
participants (3)
-
Kumar, Udit
-
Prasanth Babu Mantena
-
Prasanth Mantena