[PATCH v2 0/2] remoteproc: k3-r5: Wait for core0 power-up before powering up core1

2024-04-24 Thread Beleswar Padhi
/all/20230906124756.3480579-1-a-nan...@ti.com/ Apurva Nandan (1): remoteproc: k3-r5: Wait for core0 power-up before powering up core1 Beleswar Padhi (1): remoteproc: k3-r5: Do not allow core1 to power up before core0 via sysfs drivers/remoteproc/ti_k3_r5_remoteproc.c | 51

[PATCH v2 1/2] remoteproc: k3-r5: Wait for core0 power-up before powering up core1

2024-04-24 Thread Beleswar Padhi
From: Apurva Nandan PSC controller has a limitation that it can only power-up the second core when the first core is in ON state. Power-state for core0 should be equal to or higher than core1, else the kernel is seen hanging during rproc loading. Make the powering up of cores sequential, by wait

[PATCH v2 2/2] remoteproc: k3-r5: Do not allow core1 to power up before core0 via sysfs

2024-04-24 Thread Beleswar Padhi
shutting down before core1 has been shut down from sysfs. Fixes: 6dedbd1d5443 ("remoteproc: k3-r5: Add a remoteproc driver for R5F subsystem") Signed-off-by: Beleswar Padhi --- drivers/remoteproc/ti_k3_r5_remoteproc.c | 23 +-- 1 file changed, 21 insertions(+), 2

[PATCH v3 0/2] remoteproc: k3-r5: Wait for core0 power-up before powering up core1

2024-04-30 Thread Beleswar Padhi
): remoteproc: k3-r5: Wait for core0 power-up before powering up core1 Beleswar Padhi (1): remoteproc: k3-r5: Do not allow core1 to power up before core0 via sysfs drivers/remoteproc/ti_k3_r5_remoteproc.c | 56 +++- 1 file changed, 54 insertions(+), 2 deletions

[PATCH v3 1/2] remoteproc: k3-r5: Wait for core0 power-up before powering up core1

2024-04-30 Thread Beleswar Padhi
: Add a remoteproc driver for R5F subsystem") Signed-off-by: Apurva Nandan [added comments and fixed code style] Signed-off-by: Beleswar Padhi --- drivers/remoteproc/ti_k3_r5_remoteproc.c | 33 1 file changed, 33 insertions(+) diff --git a/drivers/

[PATCH v3 2/2] remoteproc: k3-r5: Do not allow core1 to power up before core0 via sysfs

2024-04-30 Thread Beleswar Padhi
shutting down before core1 has been shut down from sysfs. Fixes: 6dedbd1d5443 ("remoteproc: k3-r5: Add a remoteproc driver for R5F subsystem") Signed-off-by: Beleswar Padhi --- drivers/remoteproc/ti_k3_r5_remoteproc.c | 23 +-- 1 file changed, 21 insertions(+), 2

[PATCH] remoteproc: k3-r5: Jump to error handling labels in start/stop errors

2024-05-06 Thread Beleswar Padhi
or handling label to return with required -EPERM error code during the core stop operation from sysfs. Fixes: 3c8a9066d584 ("remoteproc: k3-r5: Do not allow core1 to power up before core0 via sysfs") Signed-off-by: Beleswar Padhi --- As stated in the bug-report[0], Smatch comp

[PATCH 2/3] remoteproc: k3-r5: Acquire mailbox handle during probe

2024-05-30 Thread Beleswar Padhi
ff-by: Beleswar Padhi --- drivers/remoteproc/ti_k3_r5_remoteproc.c | 66 1 file changed, 21 insertions(+), 45 deletions(-) diff --git a/drivers/remoteproc/ti_k3_r5_remoteproc.c b/drivers/remoteproc/ti_k3_r5_remoteproc.c index 26362a509ae3..157e8fd57665 100644 --- a/dr

[PATCH 3/3] remoteproc: k3-dsp: Acquire mailbox handle during probe routine

2024-05-30 Thread Beleswar Padhi
ff-by: Beleswar Padhi --- drivers/remoteproc/ti_k3_dsp_remoteproc.c | 67 +++ 1 file changed, 21 insertions(+), 46 deletions(-) diff --git a/drivers/remoteproc/ti_k3_dsp_remoteproc.c b/drivers/remoteproc/ti_k3_dsp_remoteproc.c index 3555b535b168..88cda609a5eb 100644 --- a/dr

[PATCH 0/3] Defer TI's Remoteproc's Probe until Mailbox is Probed

2024-05-30 Thread Beleswar Padhi
paths. This makes our k3_rproc_attach() & k3_rproc_detach() functions NOP. Also, use the devm_rproc_alloc() helper to automatically free created rprocs incase of a probe defer. Beleswar Padhi (3): remoteproc: k3-r5: Use devm_rproc_alloc() helper remoteproc: k3-r5: Acquire mailbox handle dur

[PATCH 1/3] remoteproc: k3-r5: Use devm_rproc_alloc() helper

2024-05-30 Thread Beleswar Padhi
Use the device lifecycle managed allocation function. This helps prevent mistakes like freeing out of order in cleanup functions and forgetting to free on error paths. Signed-off-by: Beleswar Padhi --- drivers/remoteproc/ti_k3_r5_remoteproc.c | 6 ++ 1 file changed, 2 insertions(+), 4

[PATCH v2 0/3] Defer TI's Remoteproc's Probe until Mailbox is Probed

2024-06-03 Thread Beleswar Padhi
Andrew's comments in v1 regarding some cleanup (Using dev_err_probe, removing unused labels, adding matching mbox_free_channel call during device removal). Link to v1: https://lore.kernel.org/all/20240530090737.655054-1-b-pa...@ti.com/ Beleswar Padhi (3): remoteproc: k3-r5: Use devm_rproc_

[PATCH v2 1/3] remoteproc: k3-r5: Use devm_rproc_alloc() helper

2024-06-03 Thread Beleswar Padhi
Use the device lifecycle managed allocation function. This helps prevent mistakes like freeing out of order in cleanup functions and forgetting to free on error paths. Signed-off-by: Beleswar Padhi --- drivers/remoteproc/ti_k3_r5_remoteproc.c | 6 ++ 1 file changed, 2 insertions(+), 4

[PATCH v2 2/3] remoteproc: k3-r5: Acquire mailbox handle during probe

2024-06-03 Thread Beleswar Padhi
ff-by: Beleswar Padhi --- drivers/remoteproc/ti_k3_r5_remoteproc.c | 74 +--- 1 file changed, 26 insertions(+), 48 deletions(-) diff --git a/drivers/remoteproc/ti_k3_r5_remoteproc.c b/drivers/remoteproc/ti_k3_r5_remoteproc.c index 26362a509ae3c..7e02e3472ce25 100644 --- a/dr

[PATCH v2 3/3] remoteproc: k3-dsp: Acquire mailbox handle during probe routine

2024-06-03 Thread Beleswar Padhi
ff-by: Beleswar Padhi --- drivers/remoteproc/ti_k3_dsp_remoteproc.c | 76 --- 1 file changed, 26 insertions(+), 50 deletions(-) diff --git a/drivers/remoteproc/ti_k3_dsp_remoteproc.c b/drivers/remoteproc/ti_k3_dsp_remoteproc.c index 3555b535b1683..edaa5e91aebe9 100644 --- a/dr

[PATCH v3 0/3] Defer TI's Remoteproc's Probe until Mailbox is Probed

2024-08-06 Thread Beleswar Padhi
nup (Using dev_err_probe, removing unused labels, adding matching mbox_free_channel call during device removal). Link to v1: https://lore.kernel.org/all/20240530090737.655054-1-b-pa...@ti.com/ Beleswar Padhi (3): remoteproc: k3-r5: Use devm_rproc_alloc() helper remoteproc: k3-r5: Acquire mai

[PATCH v3 1/3] remoteproc: k3-r5: Use devm_rproc_alloc() helper

2024-08-06 Thread Beleswar Padhi
Use the device lifecycle managed allocation function. This helps prevent mistakes like freeing out of order in cleanup functions and forgetting to free on error paths. Signed-off-by: Beleswar Padhi --- drivers/remoteproc/ti_k3_r5_remoteproc.c | 6 ++ 1 file changed, 2 insertions(+), 4

[PATCH v3 2/3] remoteproc: k3-r5: Acquire mailbox handle during probe routine

2024-08-06 Thread Beleswar Padhi
Fixes: 1168af40b1ad ("remoteproc: k3-r5: Add support for IPC-only mode for all R5Fs") Signed-off-by: Beleswar Padhi --- drivers/remoteproc/ti_k3_r5_remoteproc.c | 78 +--- 1 file changed, 30 insertions(+), 48 deletions(-) diff --git a/drivers/remoteproc/ti_k3_r5_remotepr

[PATCH v3 3/3] remoteproc: k3-dsp: Acquire mailbox handle during probe routine

2024-08-06 Thread Beleswar Padhi
Fixes: b8431920391d ("remoteproc: k3-dsp: Add support for IPC-only mode for all K3 DSPs") Signed-off-by: Beleswar Padhi --- drivers/remoteproc/ti_k3_dsp_remoteproc.c | 80 +-- 1 file changed, 30 insertions(+), 50 deletions(-) diff --git a/drivers/remoteproc/ti_k3_dsp_remotepr

[PATCH v4 0/3] Defer TI's Remoteproc's Probe until Mailbox is Probed

2024-08-08 Thread Beleswar Padhi
s in v1 regarding some cleanup (Using dev_err_probe, removing unused labels, adding matching mbox_free_channel call during device removal). Link to v1: https://lore.kernel.org/all/20240530090737.655054-1-b-pa...@ti.com/ Beleswar Padhi (3): remoteproc: k3-r5: Use devm_rproc_alloc() helper remo

[PATCH v4 1/3] remoteproc: k3-r5: Use devm_rproc_alloc() helper

2024-08-08 Thread Beleswar Padhi
Use the device lifecycle managed allocation function. This helps prevent mistakes like freeing out of order in cleanup functions and forgetting to free on error paths. Signed-off-by: Beleswar Padhi --- drivers/remoteproc/ti_k3_r5_remoteproc.c | 16 +--- 1 file changed, 5 insertions

[PATCH v4 2/3] remoteproc: k3-r5: Acquire mailbox handle during probe routine

2024-08-08 Thread Beleswar Padhi
ff-by: Beleswar Padhi --- drivers/remoteproc/ti_k3_r5_remoteproc.c | 78 +--- 1 file changed, 30 insertions(+), 48 deletions(-) diff --git a/drivers/remoteproc/ti_k3_r5_remoteproc.c b/drivers/remoteproc/ti_k3_r5_remoteproc.c index 57067308b3c0..8a63a9360c0f 100644 --- a/dr

[PATCH v4 3/3] remoteproc: k3-dsp: Acquire mailbox handle during probe routine

2024-08-08 Thread Beleswar Padhi
ff-by: Beleswar Padhi Acked-by: Andrew Davis --- drivers/remoteproc/ti_k3_dsp_remoteproc.c | 80 +-- 1 file changed, 30 insertions(+), 50 deletions(-) diff --git a/drivers/remoteproc/ti_k3_dsp_remoteproc.c b/drivers/remoteproc/ti_k3_dsp_remoteproc.c index a22d41689a7d..9009367

[PATCH] remoteproc: k3-r5: Delay notification of wakeup event

2024-08-08 Thread Beleswar Padhi
oted rprocs ] Signed-off-by: Beleswar Padhi --- drivers/remoteproc/ti_k3_r5_remoteproc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/remoteproc/ti_k3_r5_remoteproc.c b/drivers/remoteproc/ti_k3_r5_remoteproc.c index 39a47540c590..f1710a61247f 100644 ---

[PATCH v2] remoteproc: k3-r5: Delay notification of wakeup event

2024-08-20 Thread Beleswar Padhi
oted rprocs ] Signed-off-by: Beleswar Padhi --- v2: Changelog: * Mathieu 1) Rebased changes on top of -next-20240820 tag. Link to v1: https://lore.kernel.org/all/20240809060132.308642-1-b-pa...@ti.com/ drivers/remoteproc/ti_k3_r5_remoteproc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deleti

[PATCH] remoteproc: k3-r5: Decouple firmware booting from probe routine

2024-09-06 Thread Beleswar Padhi
n firmware booting, while still maintaining the required power-synchronization between cores. Fixes: 61f6f68447ab ("remoteproc: k3-r5: Wait for core0 power-up before powering up core1") Signed-off-by: Beleswar Padhi --- Posted this as a Fix as this was breaking usecases where we wante

[PATCH 0/5] Use Device Lifecycle managed functions in TI R5 Remoteproc

2024-12-04 Thread Beleswar Padhi
. Tested that each patch in this series generates no new warnings/errors. [0]: https://lore.kernel.org/all/Zr4w8Vj0mVo5sBsJ@p14s/ Beleswar Padhi (5): remoteproc: k3-r5: Add devm action to release reserved memory remoteproc: k3-r5: Use devm_kcalloc() helper remoteproc: k3-r5: Add devm action to

[PATCH 1/5] remoteproc: k3-r5: Add devm action to release reserved memory

2024-12-04 Thread Beleswar Padhi
Use a device lifecycle managed action to release reserved memory. This helps prevent mistakes like releasing out of order in cleanup functions and forgetting to release on error paths. Signed-off-by: Beleswar Padhi --- drivers/remoteproc/ti_k3_r5_remoteproc.c | 21 + 1 file

[PATCH 3/5] remoteproc: k3-r5: Add devm action to release tsp

2024-12-04 Thread Beleswar Padhi
Use a device lifecycle managed action to release tsp ti_sci_proc handle. This helps prevent mistakes like releasing out of order in cleanup functions and forgetting to release on error paths. Signed-off-by: Beleswar Padhi --- drivers/remoteproc/ti_k3_r5_remoteproc.c | 17 +++-- 1

[PATCH 2/5] remoteproc: k3-r5: Use devm_kcalloc() helper

2024-12-04 Thread Beleswar Padhi
Use a device lifecycle managed action to free memory. This helps prevent mistakes like freeing out of order in cleanup functions and forgetting to free on error paths. Signed-off-by: Beleswar Padhi --- drivers/remoteproc/ti_k3_r5_remoteproc.c | 4 +--- 1 file changed, 1 insertion(+), 3

[PATCH 5/5] remoteproc: k3-r5: Use devm_rproc_add() helper

2024-12-04 Thread Beleswar Padhi
Use device lifecycle managed devm_rproc_add() helper function. This helps prevent mistakes like deleting out of order in cleanup functions and forgetting to delete on all error paths. Signed-off-by: Beleswar Padhi --- drivers/remoteproc/ti_k3_r5_remoteproc.c | 4 +--- 1 file changed, 1

[PATCH 4/5] remoteproc: k3-r5: Use devm_ioremap_wc() helper

2024-12-04 Thread Beleswar Padhi
Use a device lifecycle managed ioremap helper function. This helps prevent mistakes like unmapping out of order in cleanup functions and forgetting to unmap on all error paths. Signed-off-by: Beleswar Padhi --- drivers/remoteproc/ti_k3_r5_remoteproc.c | 40 +--- 1 file

[PATCH v8 10/20] remoteproc: k3: Refactor .unprepare rproc ops into common driver

2025-01-03 Thread Beleswar Padhi
.unprepare ops. Signed-off-by: Beleswar Padhi --- drivers/remoteproc/ti_k3_common.c | 30 ++ drivers/remoteproc/ti_k3_common.h | 1 + drivers/remoteproc/ti_k3_dsp_remoteproc.c | 26 +-- drivers/remoteproc/ti_k3_m4_remoteproc.c | 31

[PATCH v2 1/3] remoteproc: k3-r5: Fix checks in k3_r5_rproc_{mbox_callback/kick}

2025-01-07 Thread Beleswar Padhi
tached. The callbacks are updated to return early only if the core is actually detached and not during an ongoing attach operation in IPC-only mode. Reported-by: Siddharth Vadapalli Closes: https://lore.kernel.org/all/20240916083131.2801755-1-s-vadapa...@ti.com/ Fixes: f3f11cfe8907 ("remotepro

[PATCH v2 2/3] remoteproc: k3-dsp: Fix checks in k3_dsp_rproc_{mbox_callback/kick}

2025-01-07 Thread Beleswar Padhi
tached. The callbacks are updated to return early only if the core is actually detached and not during an ongoing attach operation in IPC-only mode. Reported-by: Siddharth Vadapalli Closes: https://lore.kernel.org/all/20240916083131.2801755-1-s-vadapa...@ti.com/ Fixes: ea1d6fb5b571 ("remoteproc

[PATCH v3 3/3] remoteproc: k3-r5: Refactor sequential core power up/down operations

2025-01-07 Thread Beleswar Padhi
they deal with Core Run/Halt operations, and as such, there is no constraint in Running or Halting the cores of a cluster in order. Fixes: 61f6f68447ab ("remoteproc: k3-r5: Wait for core0 power-up before powering up core1") Signed-off-by: Beleswar Padhi --- Link to v2: https://lore.ker

[PATCH v2 0/3] Rework TI K3 R5F remoteproc driver

2025-01-07 Thread Beleswar Padhi
/ [1]: https://lore.kernel.org/all/20250103101231.1508151-1-b-pa...@ti.com/ [2]: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/include/linux/wait.h#n289 Beleswar Padhi (3): remoteproc: k3-r5: Fix checks in k3_r5_rproc_{mbox_callback/kick} remoteproc: k3-dsp: Fix che

[PATCH 1/3] remoteproc: k3-r5: Fix checks in k3_r5_rproc_{mbox_callback/kick}

2024-12-24 Thread Beleswar Padhi
tached. The callbacks are updated to return early only if the core is actually detached and not during an ongoing attach operation in IPC-only mode. Reported-by: Siddharth Vadapalli Closes: https://lore.kernel.org/all/20240916083131.2801755-1-s-vadapa...@ti.com/ Fixes: f3f11cfe8907 ("re

[PATCH v2 3/3] remoteproc: k3-r5: Refactor sequential core power up/down operations

2024-12-24 Thread Beleswar Padhi
they deal with Core Run/Halt operations, and as such, there is no constraint in Running or Halting the cores of a cluster in order. Fixes: 61f6f68447ab ("remoteproc: k3-r5: Wait for core0 power-up before powering up core1") Signed-off-by: Beleswar Padhi --- Link to v1: https://lore.ker

[PATCH 2/3] remoteproc: k3-dsp: Fix checks in k3_dsp_rproc_{mbox_callback/kick}

2024-12-24 Thread Beleswar Padhi
attached. The callbacks are updated to return early only if the core is actually detached and not during an ongoing attach operation in IPC-only mode. Reported-by: Siddharth Vadapalli Closes: https://lore.kernel.org/all/20240916083131.2801755-1-s-vadapa...@ti.com/ Fixes: ea1d6fb5b571 ("rem

[PATCH 0/3] Rework TI K3 R5F remoteproc driver

2024-12-24 Thread Beleswar Padhi
ning, which is expected as it is called out in the implementation of the macro itself[1]. Thanks, Beleswar [0]: https://lore.kernel.org/all/20241219110545.1898883-1-b-pa...@ti.com/ [1]: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/include/linux/wait.h#n289 Bel

[PATCH v2 0/5] Use Device Lifecycle managed functions in TI R5 Remoteproc driver

2024-12-19 Thread Beleswar Padhi
r4w8Vj0mVo5sBsJ@p14s/ Beleswar Padhi (5): remoteproc: k3-r5: Add devm action to release reserved memory remoteproc: k3-r5: Use devm_kcalloc() helper remoteproc: k3-r5: Use devm_ioremap_wc() helper remoteproc: k3-r5: Use devm_rproc_add() helper remoteproc: k3-r5: Add devm action to r

[PATCH v2 3/5] remoteproc: k3-r5: Use devm_ioremap_wc() helper

2024-12-19 Thread Beleswar Padhi
Use a device lifecycle managed ioremap helper function. This helps prevent mistakes like unmapping out of order in cleanup functions and forgetting to unmap on all error paths. Signed-off-by: Beleswar Padhi --- v2: Changelog: 1. Re-ordered [PATCH 4/5] from v1 to [PATCH v2 3/5] in v2. [Andrew] 2

[PATCH v2 1/5] remoteproc: k3-r5: Add devm action to release reserved memory

2024-12-19 Thread Beleswar Padhi
Use a device lifecycle managed action to release reserved memory. This helps prevent mistakes like releasing out of order in cleanup functions and forgetting to release on error paths. Signed-off-by: Beleswar Padhi --- v2: Changelog: 1. None to this patch Link to v1: https://lore.kernel.org

[PATCH v2 2/5] remoteproc: k3-r5: Use devm_kcalloc() helper

2024-12-19 Thread Beleswar Padhi
Use a device lifecycle managed action to free memory. This helps prevent mistakes like freeing out of order in cleanup functions and forgetting to free on error paths. Signed-off-by: Beleswar Padhi --- v2: Changelog: 1. None to this patch Link to v1: https://lore.kernel.org/all

[PATCH v2 4/5] remoteproc: k3-r5: Use devm_rproc_add() helper

2024-12-19 Thread Beleswar Padhi
Use device lifecycle managed devm_rproc_add() helper function. This helps prevent mistakes like deleting out of order in cleanup functions and forgetting to delete on all error paths. Signed-off-by: Beleswar Padhi --- v2: Changelog: 1. Re-ordered [PATCH 5/5] from v1 to [PATCH v2 4/5] in v2

[PATCH v2 5/5] remoteproc: k3-r5: Add devm action to release tsp

2024-12-19 Thread Beleswar Padhi
Use a device lifecycle managed action to release tsp ti_sci_proc handle. This helps prevent mistakes like releasing out of order in cleanup functions and forgetting to release on error paths. Signed-off-by: Beleswar Padhi --- v2: Changelog: 1. Re-ordered [PATCH 3/5] from v1 to [PATCH v2 5/5] in

[PATCH v8 01/20] remoteproc: k3-m4: Prevent Mailbox level IPC with detached core

2025-01-03 Thread Beleswar Padhi
is detached, and is not undergoing an attach operation in IPC-only mode. Signed-off-by: Beleswar Padhi --- drivers/remoteproc/ti_k3_m4_remoteproc.c | 41 1 file changed, 35 insertions(+), 6 deletions(-) diff --git a/drivers/remoteproc/ti_k3_m4_remoteproc.c b/drivers

[PATCH v8 00/20] Refactor TI K3 DSP and M4 Drivers

2025-01-03 Thread Beleswar Padhi
1050233-1-b-pa...@ti.com/ Beleswar Padhi (20): remoteproc: k3-m4: Prevent Mailbox level IPC with detached core remoteproc: k3: Refactor shared data structures remoteproc: k3: Refactor mailbox rx_callback functions into common driver remoteproc: k3: Refactor .kick rproc ops into common dr

[PATCH v8 02/20] remoteproc: k3: Refactor shared data structures

2025-01-03 Thread Beleswar Padhi
The ti_k3_dsp_remoteproc.c and ti_k3_m4_remoteproc.c drivers share the same data structure definitions. Refactor the shared data structures into a new common header file, 'ti_k3_common.h', and update both drivers to use the unified data structures. Signed-off-by: Beleswar Padhi --

[PATCH v8 03/20] remoteproc: k3: Refactor mailbox rx_callback functions into common driver

2025-01-03 Thread Beleswar Padhi
n it. Signed-off-by: Beleswar Padhi --- drivers/remoteproc/Makefile | 4 +- drivers/remoteproc/ti_k3_common.c | 90 +++ drivers/remoteproc/ti_k3_common.h | 1 + drivers/remoteproc/ti_k3_dsp_remoteproc.c | 57 +- drivers/remoteproc/t

[PATCH v8 06/20] remoteproc: k3: Refactor rproc_reset() implementation into common driver

2025-01-03 Thread Beleswar Padhi
, refactor the above function into the ti_k3_common.c driver as k3_rproc_reset() and use it throughout DSP and M4 drivers for resetting the remote processor. Signed-off-by: Beleswar Padhi --- drivers/remoteproc/ti_k3_common.c | 25 +++ drivers/remoteproc/ti_k3_common.h

[PATCH v8 04/20] remoteproc: k3: Refactor .kick rproc ops into common driver

2025-01-03 Thread Beleswar Padhi
The .kick rproc ops implementations in ti_k3_dsp_remoteproc.c and ti_k3_m4_remoteproc.c drivers sends a mailbox message to the remote processor in the same way. Refactor the implementations into a common function 'k3_rproc_kick()' in the ti_k3_common.c driver. Signed-off-by: Bele

[PATCH v8 07/20] remoteproc: k3: Refactor rproc_release() implementation into common driver

2025-01-03 Thread Beleswar Padhi
. Further, refactor the above function into the ti_k3_common.c driver as k3_rproc_release() and use it throughout DSP and M4 drivers for releasing the reset from the remote processor. Signed-off-by: Beleswar Padhi --- drivers/remoteproc/ti_k3_common.c | 27 drivers/remoteproc

[PATCH v8 05/20] remoteproc: k3-m4: Use k3_rproc_mem_data structure for memory info

2025-01-03 Thread Beleswar Padhi
The ti_k3_m4_remoteproc.c driver previously hardcoded device memory region addresses and names. Change this to use the k3_rproc_mem_data structure to store memory information. This aligns with ti_k3_dsp_remoteproc.c driver, and can be refactored out later. Signed-off-by: Beleswar Padhi

[PATCH v8 13/20] remoteproc: k3: Refactor .attach rproc ops into common driver

2025-01-03 Thread Beleswar Padhi
tach() and align DSP and M4 drivers to register this common function as .attach ops. Signed-off-by: Beleswar Padhi --- drivers/remoteproc/ti_k3_common.c | 20 drivers/remoteproc/ti_k3_common.h | 1 + drivers/remoteproc/ti_k3_dsp_remotep

[PATCH v8 09/20] remoteproc: k3: Refactor .prepare rproc ops into common driver

2025-01-03 Thread Beleswar Padhi
from sysfs. Refactor the k3_m4_rproc_prepare() function into the ti_k3_common.c driver as k3_rproc_prepare() and align DSP and M4 drivers to register this common function as .prepare ops. Signed-off-by: Beleswar Padhi --- drivers/remoteproc/ti_k3_common.c | 46

[PATCH v8 14/20] remoteproc: k3: Refactor .detach rproc ops into common driver

2025-01-03 Thread Beleswar Padhi
his common function as .detach ops. Signed-off-by: Beleswar Padhi --- drivers/remoteproc/ti_k3_common.c | 19 +++ drivers/remoteproc/ti_k3_common.h | 1 + drivers/remoteproc/ti_k3_dsp_remoteproc.c | 20 +--- drivers/remoteproc/ti_k3_m4_remotepr

[PATCH v8 15/20] remoteproc: k3: Refactor .get_loaded_rsc_table ops into common driver

2025-01-03 Thread Beleswar Padhi
k3_get_loaded_rsc_table() and align DSP and M4 drivers to register this common function as .get_loaded_rsc_table ops. Signed-off-by: Beleswar Padhi --- drivers/remoteproc/ti_k3_common.c | 33 +++ drivers/remoteproc/ti_k3_common.h | 2 + drivers/remoteproc

[PATCH v8 11/20] remoteproc: k3: Refactor .start rproc ops into common driver

2025-01-03 Thread Beleswar Padhi
this common function when releasing the reset on the remote processor. Further, do not override the .start ops with NULL when operating in IPC-only mode in ti_k3_dsp_remoteproc.c, as .start is never invoked in rproc_attach routine. Signed-off-by: Beleswar Padhi --- drivers/remoteproc/ti_k3_common.c

[PATCH v8 12/20] remoteproc: k3: Refactor .stop rproc ops into common driver

2025-01-03 Thread Beleswar Padhi
not override the .stop ops with NULL when operating in IPC-only mode in ti_k3_dsp_remoteproc.c, as .stop is never invoked in rproc_detach routine. Signed-off-by: Beleswar Padhi --- drivers/remoteproc/ti_k3_common.c | 14 ++ drivers/remoteproc/ti_k3_common.h | 1

[PATCH v8 08/20] remoteproc: k3: Refactor rproc_request_mbox() implementations into common driver

2025-01-03 Thread Beleswar Padhi
() function into ti_k3_common.c as k3_rproc_request_mbox() and align DSP and M4 drivers to use this common function during probe routine. Signed-off-by: Beleswar Padhi --- drivers/remoteproc/ti_k3_common.c | 36 +++ drivers/remoteproc/ti_k3_common.h | 1 + drivers

[PATCH v8 16/20] remoteproc: k3: Refactor .da_to_va rproc ops into common driver

2025-01-03 Thread Beleswar Padhi
common function as .da_to_va ops. Signed-off-by: Beleswar Padhi --- drivers/remoteproc/ti_k3_common.c | 61 ++ drivers/remoteproc/ti_k3_common.h | 4 ++ drivers/remoteproc/ti_k3_dsp_remoteproc.c | 63 +-- drivers/remoteproc

[PATCH v8 19/20] remoteproc: k3: Refactor reserved_mem_init() functions into common driver

2025-01-03 Thread Beleswar Padhi
The k3_{dsp_/m4_}reserved_mem_init() functions initialize the reserved memory regions associated with the remote processor. Refactor these functions into ti_k3_common.c driver as k3_reserved_mem_init() and align DSP and M4 drivers to use this common function throughout. Signed-off-by: Beleswar

[PATCH v8 18/20] remoteproc: k3: Refactor mem_release() functions into common driver

2025-01-03 Thread Beleswar Padhi
. Signed-off-by: Beleswar Padhi --- drivers/remoteproc/ti_k3_common.c | 8 drivers/remoteproc/ti_k3_common.h | 1 + drivers/remoteproc/ti_k3_dsp_remoteproc.c | 9 + drivers/remoteproc/ti_k3_m4_remoteproc.c | 9 + 4 files changed, 11 insertions(+), 16

[PATCH v8 17/20] remoteproc: k3: Refactor of_get_memories() functions into common driver

2025-01-03 Thread Beleswar Padhi
: Beleswar Padhi --- drivers/remoteproc/ti_k3_common.c | 53 ++ drivers/remoteproc/ti_k3_common.h | 2 + drivers/remoteproc/ti_k3_dsp_remoteproc.c | 54 +-- drivers/remoteproc/ti_k3_m4_remoteproc.c | 54 +-- 4 files changed, 57

[PATCH v8 20/20] remoteproc: k3: Refactor release_tsp() functions into common driver

2025-01-03 Thread Beleswar Padhi
-by: Beleswar Padhi --- drivers/remoteproc/ti_k3_common.c | 8 drivers/remoteproc/ti_k3_common.h | 1 + drivers/remoteproc/ti_k3_dsp_remoteproc.c | 9 + drivers/remoteproc/ti_k3_m4_remoteproc.c | 9 + 4 files changed, 11 insertions(+), 16 deletions

[PATCH v9 23/26] remoteproc: k3: Refactor of_get_memories() functions into common driver

2025-03-17 Thread Beleswar Padhi
common function throughout. Further, override the bus_addr assignment for TCMs for R5 remote processors by reading the 'loczrama' DT property in k3_r5_core_of_get_internal_memories(). Signed-off-by: Beleswar Padhi --- drivers/remoteproc/ti_k3_common.c | 53 +

[PATCH v9 26/26] remoteproc: k3: Refactor release_tsp() functions into common driver

2025-03-17 Thread Beleswar Padhi
. Signed-off-by: Beleswar Padhi --- drivers/remoteproc/ti_k3_common.c | 8 drivers/remoteproc/ti_k3_common.h | 1 + drivers/remoteproc/ti_k3_dsp_remoteproc.c | 9 + drivers/remoteproc/ti_k3_m4_remoteproc.c | 9 + drivers/remoteproc/ti_k3_r5_remoteproc.c | 9

[PATCH v9 05/26] remoteproc: k3-m4: Use k3_rproc_mem_data structure for memory info

2025-03-17 Thread Beleswar Padhi
The ti_k3_m4_remoteproc.c driver previously hardcoded device memory region addresses and names. Change this to use the k3_rproc_mem_data structure to store memory information. This aligns with DSP and R5 drivers, and can be refactored out later. Signed-off-by: Beleswar Padhi --- drivers

[PATCH v9 09/26] remoteproc: k3: Refactor shared data structures

2025-03-17 Thread Beleswar Padhi
The TI K3 R5, DSP and M4 remoteproc drivers share the same data structure definitions. Refactor the shared data structures into a new common header file, 'ti_k3_common.h', and update the drivers to use the unified data structures. Signed-off-by: Beleswar Padhi --- drivers/

[PATCH v9 10/26] remoteproc: k3: Refactor mailbox rx_callback functions into common driver

2025-03-17 Thread Beleswar Padhi
The mailbox .rx_callback implementations in TI K3 R5, DSP and M4 remoteproc drivers handle inbound mailbox messages in the same way. Introduce a common driver 'ti_k3_common.c' and refactor the implementations into a common function 'k3_rproc_mbox_callback'() in it. Signed-of

[PATCH v9 11/26] remoteproc: k3: Refactor .kick rproc ops into common driver

2025-03-17 Thread Beleswar Padhi
The .kick rproc ops implementations in TI K3 R5, DSP and M4 remoteproc drivers sends a mailbox message to the remote processor in the same way. Refactor the implementations into a common function 'k3_rproc_kick()' in the ti_k3_common.c driver. Signed-off-by: Beleswar Padhi --

[PATCH v9 00/26] Refactor TI K3 R5, DSP and M4 Remoteproc Drivers

2025-03-17 Thread Beleswar Padhi
6-1-hnaga...@ti.com/ Thanks, Beleswar Beleswar Padhi (24): remoteproc: k3-r5: Re-order internal memory initialization function remoteproc: k3-r5: Refactor Data Structures to Align with DSP and M4 remoteproc: k3-r5: Use k3_r5_rproc_mem_data structure for memory info remoteproc: k3-{m4/dsp

[PATCH v9 07/26] remoteproc: k3-dsp: Drop check performed in k3_dsp_rproc_{mbox_callback/kick}

2025-03-17 Thread Beleswar Padhi
nction triggers the probe of the Virtio RPMsg devices associated with the remote core, which require that the "k3_dsp_rproc_kick()" and "k3_dsp_rproc_mbox_callback()" callbacks are functional. Hence, drop the check in the callbacks. Fixes: ea1d6fb5b571 ("remoteproc: k3-d

[PATCH v9 06/26] remoteproc: k3-r5: Drop check performed in k3_r5_rproc_{mbox_callback/kick}

2025-03-17 Thread Beleswar Padhi
nction triggers the probe of the Virtio RPMsg devices associated with the remote core, which require that the "k3_r5_rproc_kick()" and "k3_r5_rproc_mbox_callback()" callbacks are functional. Hence, drop the check in the callbacks. Fixes: f3f11cfe8907 ("remoteproc: k3-r5: Ac

[PATCH v9 08/26] remoteproc: k3-r5: Refactor sequential core power up/down operations

2025-03-17 Thread Beleswar Padhi
they deal with Core Run/Halt operations, and as such, there is no constraint in Running or Halting the cores of a cluster in order. Fixes: 61f6f68447ab ("remoteproc: k3-r5: Wait for core0 power-up before powering up core1") Signed-off-by: Beleswar Padhi --- drivers/remoteproc/t

[PATCH v9 12/26] remoteproc: k3: Refactor rproc_reset() implementation into common driver

2025-03-17 Thread Beleswar Padhi
, refactor the above function into the ti_k3_common.c driver as k3_rproc_reset() and use it throughout DSP and M4 drivers for resetting the remote processor. Signed-off-by: Beleswar Padhi --- drivers/remoteproc/ti_k3_common.c | 25 +++ drivers/remoteproc/ti_k3_common.h

[PATCH v9 17/26] remoteproc: k3: Refactor .start rproc ops into common driver

2025-03-17 Thread Beleswar Padhi
this common function when releasing the reset on the remote processor. Further, do not override the .start ops with NULL when operating in IPC-only mode in ti_k3_dsp_remoteproc.c, as .start is never invoked in rproc_attach routine. Signed-off-by: Beleswar Padhi --- drivers/remoteproc/ti_k3_common.c

[PATCH v9 15/26] remoteproc: k3: Refactor .prepare rproc ops into common driver

2025-03-17 Thread Beleswar Padhi
from sysfs. Refactor the k3_m4_rproc_prepare() function into the ti_k3_common.c driver as k3_rproc_prepare() and align DSP and M4 drivers to register this common function as .prepare ops. Signed-off-by: Beleswar Padhi --- drivers/remoteproc/ti_k3_common.c | 46

[PATCH v9 22/26] remoteproc: k3: Refactor .da_to_va rproc ops into common driver

2025-03-17 Thread Beleswar Padhi
for address translation. Additionally, handle R5 SRAM memory translations specifically in the R5 remoteproc driver. Signed-off-by: Beleswar Padhi --- drivers/remoteproc/ti_k3_common.c | 57 drivers/remoteproc/ti_k3_common.h | 4 ++ drivers/remoteproc

[PATCH v9 24/26] remoteproc: k3: Refactor mem_release() functions into common driver

2025-03-17 Thread Beleswar Padhi
throughout. Signed-off-by: Beleswar Padhi --- drivers/remoteproc/ti_k3_common.c | 8 drivers/remoteproc/ti_k3_common.h | 1 + drivers/remoteproc/ti_k3_dsp_remoteproc.c | 9 + drivers/remoteproc/ti_k3_m4_remoteproc.c | 9 + drivers/remoteproc

[PATCH v9 02/26] remoteproc: k3-r5: Refactor Data Structures to Align with DSP and M4

2025-03-17 Thread Beleswar Padhi
e a void *priv pointer in k3_r5_rproc that can be typecasted to point to the k3_r5_core structure. This abstraction is done to ensure common functionalities across R5, DSP and M4 drivers can be refactored at a later stage. Signed-off-by: Beleswar Padhi --- drivers/remoteproc/ti_k3_r5_remotepro

[PATCH v9 01/26] remoteproc: k3-r5: Re-order internal memory initialization function

2025-03-17 Thread Beleswar Padhi
ation function, k3_r5_core_of_get_internal_memories() above k3_r5_rproc_init() so that it can be invoked from there. Signed-off-by: Beleswar Padhi --- drivers/remoteproc/ti_k3_r5_remoteproc.c | 158 +++ 1 file changed, 79 insertions(+), 79 deletions(-) diff --git a/dr

[PATCH v9 04/26] remoteproc: k3-{m4/dsp}: Align internal rproc data structure with R5

2025-03-17 Thread Beleswar Padhi
within k3_m4_rproc internal struct. This is done to align the data structures with R5 driver which can be factored out at a later stage. Signed-off-by: Beleswar Padhi --- drivers/remoteproc/ti_k3_dsp_remoteproc.c | 2 ++ drivers/remoteproc/ti_k3_m4_remoteproc.c | 5 + 2 files changed, 7

[PATCH v9 14/26] remoteproc: k3: Refactor rproc_request_mbox() implementations into common driver

2025-03-17 Thread Beleswar Padhi
() function into ti_k3_common.c as k3_rproc_request_mbox() and align R5, DSP and M4 drivers to use this common function during probe routine. Signed-off-by: Beleswar Padhi --- drivers/remoteproc/ti_k3_common.c | 36 +++ drivers/remoteproc/ti_k3_common.h | 1

[PATCH v9 16/26] remoteproc: k3: Refactor .unprepare rproc ops into common driver

2025-03-17 Thread Beleswar Padhi
.unprepare ops. Signed-off-by: Beleswar Padhi --- drivers/remoteproc/ti_k3_common.c | 30 ++ drivers/remoteproc/ti_k3_common.h | 1 + drivers/remoteproc/ti_k3_dsp_remoteproc.c | 26 +-- drivers/remoteproc/ti_k3_m4_remoteproc.c | 31

[PATCH v9 18/26] remoteproc: k3: Refactor .stop rproc ops into common driver

2025-03-17 Thread Beleswar Padhi
not override the .stop ops with NULL when operating in IPC-only mode in ti_k3_dsp_remoteproc.c, as .stop is never invoked in rproc_detach routine. Signed-off-by: Beleswar Padhi --- drivers/remoteproc/ti_k3_common.c | 14 ++ drivers/remoteproc/ti_k3_common.h | 1

[PATCH v9 13/26] remoteproc: k3: Refactor rproc_release() implementation into common driver

2025-03-17 Thread Beleswar Padhi
. Further, refactor the above function into the ti_k3_common.c driver as k3_rproc_release() and use it throughout DSP and M4 drivers for releasing the reset from the remote processor. Signed-off-by: Beleswar Padhi --- drivers/remoteproc/ti_k3_common.c | 27 drivers/remoteproc

[PATCH v9 19/26] remoteproc: k3: Refactor .attach rproc ops into common driver

2025-03-17 Thread Beleswar Padhi
The .attach rproc ops implementations in TI K3 R5, DSP and M4 drivers are NOPs. Refactor the implementations into ti_k3_common.c driver as k3_rproc_attach() and align R5, DSP and M4 drivers to register this common function as .attach ops. Signed-off-by: Beleswar Padhi --- drivers/remoteproc

[PATCH v9 21/26] remoteproc: k3: Refactor .get_loaded_rsc_table ops into common driver

2025-03-17 Thread Beleswar Padhi
k3_get_loaded_rsc_table() and align R5, DSP and M4 drivers to register this common function as .get_loaded_rsc_table ops. Signed-off-by: Beleswar Padhi --- drivers/remoteproc/ti_k3_common.c | 33 +++ drivers/remoteproc/ti_k3_common.h | 2 + drivers/remoteproc/ti_k3_dsp_remoteproc.c

[PATCH v9 20/26] remoteproc: k3: Refactor .detach rproc ops into common driver

2025-03-17 Thread Beleswar Padhi
The .detach rproc ops implementations in TI K3 R5, DSP and M4 remoteproc drivers are NOPs. Refactor the implementations into ti_k3_common.c driver as k3_rproc_detach() and align R5, DSP and M4 drivers to register this common function as .detach ops. Signed-off-by: Beleswar Padhi --- drivers

[PATCH v9 03/26] remoteproc: k3-r5: Use k3_r5_rproc_mem_data structure for memory info

2025-03-17 Thread Beleswar Padhi
The ti_k3_r5_remoteproc.c driver previously hardcoded device memory region addresses and names. Change this to use the k3_r5_rproc_mem_data structure to store memory information. This aligns with K3 DSP and M4 drivers, and can be refactored out later. Signed-off-by: Beleswar Padhi --- drivers

[PATCH v9 25/26] remoteproc: k3: Refactor reserved_mem_init() functions into common driver

2025-03-17 Thread Beleswar Padhi
: Beleswar Padhi --- drivers/remoteproc/ti_k3_common.c | 70 +++ drivers/remoteproc/ti_k3_common.h | 1 + drivers/remoteproc/ti_k3_dsp_remoteproc.c | 72 +--- drivers/remoteproc/ti_k3_m4_remoteproc.c | 71 +--- drivers/remoteproc

[PATCH v10 13/33] remoteproc: k3: Refactor .kick rproc ops into common driver

2025-04-17 Thread Beleswar Padhi
The .kick rproc ops implementations in TI K3 R5, DSP and M4 remoteproc drivers sends a mailbox message to the remote processor in the same way. Refactor the implementations into a common function 'k3_rproc_kick()' in the ti_k3_common.c driver. Signed-off-by: Beleswar Padhi --- v10:

[PATCH v10 27/33] remoteproc: k3: Refactor .detach rproc ops into common driver

2025-04-17 Thread Beleswar Padhi
The .detach rproc ops implementations in TI K3 R5, DSP and M4 remoteproc drivers are NOPs. Refactor the implementations into ti_k3_common.c driver as k3_rproc_detach() and register this common function as .detach ops in R5, DSP and M4 drivers. Signed-off-by: Beleswar Padhi --- v10: Changelog: 1

[PATCH v10 04/33] remoteproc: k3-r5: Re-order internal memory initialization functions

2025-04-17 Thread Beleswar Padhi
invoked by the later. While at it, also re-order the k3_r5_core_of_get_sram_memories() to keep all the internal memory initialization functions at one place. Signed-off-by: Beleswar Padhi --- v10: Changelog: 1. Re-ordered both core_of_get_{internal/sram}_memories() together. 2. Moved releas

[PATCH v10 30/33] remoteproc: k3: Refactor of_get_memories() functions into common driver

2025-04-17 Thread Beleswar Padhi
#x27; DT property in k3_r5_core_of_get_internal_memories(). Signed-off-by: Beleswar Padhi --- v10: Changelog: 1. Updated commit message to call out the changes better. Link to v9: https://lore.kernel.org/all/20250317120622.1746415-24-b-pa...@ti.com/ drivers/remoteproc/ti_k3_common.c | 53 ++

[PATCH v10 10/33] remoteproc: k3-m4: Use k3_rproc_mem_data structure for memory info

2025-04-17 Thread Beleswar Padhi
The ti_k3_m4_remoteproc.c driver previously hardcoded device memory region addresses and names. Change this to use the k3_rproc_mem_data structure to store memory information. This aligns with DSP and R5 drivers, and can be refactored out later. Signed-off-by: Beleswar Padhi --- v10: Changelog

[PATCH v10 00/33] Refactor TI K3 R5, DSP and M4 Remoteproc Drivers

2025-04-17 Thread Beleswar Padhi
all/20230302171450.1598576-1-martyn.we...@collabora.com/ v2: https://lore.kernel.org/all/2023030323.1532479-4-martyn.we...@collabora.com/ v1: https://lore.kernel.org/all/20220110040650.18186-1-hnaga...@ti.com/ Thanks, Beleswar Beleswar Padhi (31): remoteproc: k3-r5: Refactor sequential c

  1   2   3   >