public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH] arch: arm: mach-k3: Delete tifs node in DT fixup
@ 2023-04-19  6:13 Udit Kumar
  2023-04-19 15:52 ` Nishanth Menon
  0 siblings, 1 reply; 5+ messages in thread
From: Udit Kumar @ 2023-04-19  6:13 UTC (permalink / raw)
  To: afd, nm, vigneshr, trini, u-boot, n-francis, n-dasan; +Cc: Udit Kumar

This patch deletes tifs DT node as part of fixup.

TISCI API reported msmc_size, does not include
64KB reserved size for tifs aka MSMC comms memory.

As part of fixup, original code uses TISCI API
reported msmc_size as size for sram DT node.

tifs node is similar to l3-cache, which should
hold address above msms_size, and should be deleted
before passing control to OS.

Documentation
https://software-dl.ti.com/tisci/esd/latest/2_tisci_msgs/general/core.html?highlight=msmc#tisci-msg-query-msmc

Signed-off-by: Udit Kumar <u-kumar1@ti.com>
---
 arch/arm/mach-k3/common.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-k3/common.c b/arch/arm/mach-k3/common.c
index a2adb791f6..4651744821 100644
--- a/arch/arm/mach-k3/common.c
+++ b/arch/arm/mach-k3/common.c
@@ -349,9 +349,11 @@ int fdt_fixup_msmc_ram(void *blob, char *parent_path, char *node_name)
 		size = fdt_read_number(sub_reg, 1);
 		debug("%s: subnode = %d, addr = 0x%x. size = 0x%x\n", __func__,
 		      subnode, addr, size);
+
 		if (addr + size > msmc_size ||
 		    !strncmp(fdt_get_name(blob, subnode, &len), "sysfw", 5) ||
-		    !strncmp(fdt_get_name(blob, subnode, &len), "l3cache", 7)) {
+		    !strncmp(fdt_get_name(blob, subnode, &len), "l3cache", 7) ||
+		    !strncmp(fdt_get_name(blob, subnode, &len), "tifs", 4)) {
 			fdt_del_node(blob, subnode);
 			debug("%s: deleting subnode %d\n", __func__, subnode);
 			if (!prev_node)
-- 
2.34.1


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

* Re: [PATCH] arch: arm: mach-k3: Delete tifs node in DT fixup
  2023-04-19  6:13 Udit Kumar
@ 2023-04-19 15:52 ` Nishanth Menon
  2023-04-20  7:58   ` Kumar, Udit
  0 siblings, 1 reply; 5+ messages in thread
From: Nishanth Menon @ 2023-04-19 15:52 UTC (permalink / raw)
  To: Udit Kumar; +Cc: afd, vigneshr, trini, u-boot, n-francis, n-dasan

On 11:43-20230419, Udit Kumar wrote:
> This patch deletes tifs DT node as part of fixup.
> 
> TISCI API reported msmc_size, does not include
> 64KB reserved size for tifs aka MSMC comms memory.
> 
> As part of fixup, original code uses TISCI API
> reported msmc_size as size for sram DT node.
> 
> tifs node is similar to l3-cache, which should
> hold address above msms_size, and should be deleted
> before passing control to OS.
> 
> Documentation
> https://software-dl.ti.com/tisci/esd/latest/2_tisci_msgs/general/core.html?highlight=msmc#tisci-msg-query-msmc
> 
> Signed-off-by: Udit Kumar <u-kumar1@ti.com>
> ---
>  arch/arm/mach-k3/common.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/mach-k3/common.c b/arch/arm/mach-k3/common.c
> index a2adb791f6..4651744821 100644
> --- a/arch/arm/mach-k3/common.c
> +++ b/arch/arm/mach-k3/common.c
> @@ -349,9 +349,11 @@ int fdt_fixup_msmc_ram(void *blob, char *parent_path, char *node_name)
>  		size = fdt_read_number(sub_reg, 1);
>  		debug("%s: subnode = %d, addr = 0x%x. size = 0x%x\n", __func__,
>  		      subnode, addr, size);
> +
>  		if (addr + size > msmc_size ||
>  		    !strncmp(fdt_get_name(blob, subnode, &len), "sysfw", 5) ||
> -		    !strncmp(fdt_get_name(blob, subnode, &len), "l3cache", 7)) {
> +		    !strncmp(fdt_get_name(blob, subnode, &len), "l3cache", 7) ||
> +		    !strncmp(fdt_get_name(blob, subnode, &len), "tifs", 4)) {
I would probably move the tifs check above the l3cache check.

>  			fdt_del_node(blob, subnode);
>  			debug("%s: deleting subnode %d\n", __func__, subnode);
>  			if (!prev_node)
> -- 
> 2.34.1
> 

-- 
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3  1A34 DDB5 849D 1736 249D

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

* Re: [PATCH] arch: arm: mach-k3: Delete tifs node in DT fixup
  2023-04-19 15:52 ` Nishanth Menon
@ 2023-04-20  7:58   ` Kumar, Udit
  0 siblings, 0 replies; 5+ messages in thread
From: Kumar, Udit @ 2023-04-20  7:58 UTC (permalink / raw)
  To: Nishanth Menon; +Cc: afd, vigneshr, trini, u-boot, n-francis, n-dasan

Thanks for review

On 4/19/2023 9:22 PM, Nishanth Menon wrote:
> On 11:43-20230419, Udit Kumar wrote:
>> This patch deletes tifs DT node as part of fixup.
>>
>> TISCI API reported msmc_size, does not include
>> 64KB reserved size for tifs aka MSMC comms memory.
>>
>> As part of fixup, original code uses TISCI API
>> reported msmc_size as size for sram DT node.
>>
>> tifs node is similar to l3-cache, which should
>> hold address above msms_size, and should be deleted
>> before passing control to OS.
>>
>> Documentation
>> https://software-dl.ti.com/tisci/esd/latest/2_tisci_msgs/general/core.html?highlight=msmc#tisci-msg-query-msmc
>>
>> Signed-off-by: Udit Kumar <u-kumar1@ti.com>
>> ---
>>   arch/arm/mach-k3/common.c | 4 +++-
>>   1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/arch/arm/mach-k3/common.c b/arch/arm/mach-k3/common.c
>> index a2adb791f6..4651744821 100644
>> --- a/arch/arm/mach-k3/common.c
>> +++ b/arch/arm/mach-k3/common.c
>> @@ -349,9 +349,11 @@ int fdt_fixup_msmc_ram(void *blob, char *parent_path, char *node_name)
>>   		size = fdt_read_number(sub_reg, 1);
>>   		debug("%s: subnode = %d, addr = 0x%x. size = 0x%x\n", __func__,
>>   		      subnode, addr, size);
>> +
>>   		if (addr + size > msmc_size ||
>>   		    !strncmp(fdt_get_name(blob, subnode, &len), "sysfw", 5) ||
>> -		    !strncmp(fdt_get_name(blob, subnode, &len), "l3cache", 7)) {
>> +		    !strncmp(fdt_get_name(blob, subnode, &len), "l3cache", 7) ||
>> +		    !strncmp(fdt_get_name(blob, subnode, &len), "tifs", 4)) {
> I would probably move the tifs check above the l3cache check.

I will move this in v2.

you want to stay close to DT nodes order. or there is some other reason ?


>
>>   			fdt_del_node(blob, subnode);
>>   			debug("%s: deleting subnode %d\n", __func__, subnode);
>>   			if (!prev_node)
>> -- 
>> 2.34.1
>>

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

* [PATCH] arch: arm: mach-k3: Delete tifs node in DT fixup
@ 2025-01-13  4:25 Udit Kumar
  2025-01-20 18:07 ` Tom Rini
  0 siblings, 1 reply; 5+ messages in thread
From: Udit Kumar @ 2025-01-13  4:25 UTC (permalink / raw)
  To: trini, bb; +Cc: nm, afd, u-boot, vigneshr, Udit Kumar, Neha Malcom Francis

Delete tifs DT node as part of fixup.

TISCI API reported msmc_size, does not include 64KB reserved size for
tifs aka MSMC comms memory, see documentation[0].

As part of fixup, original code uses TISCI API reported msmc_size as
size for SRAM DT node.

tifs node is similar to l3-cache, which should hold address above
msmc_size, and should be deleted before passing control to OS.

[0] https://software-dl.ti.com/tisci/esd/latest/2_tisci_msgs/general/core.html?highlight=msmc#tisci-msg-query-msmc

Reviewed-by: Neha Malcom Francis <n-francis@ti.com>
Signed-off-by: Udit Kumar <u-kumar1@ti.com>
---
RFC was sent to k.org with https://lore.kernel.org/all/20230506100826.1525641-1-u-kumar1@ti.com/
So planning to go ahead with option 1.

Changelog:
Changes in v3:
- Collected R/B of v2
- Updated commit message typo

Changes since v2:
- moved tifs check above l3 as

v2: https://lore.kernel.org/all/20230420081128.3617214-1-u-kumar1@ti.com/
v1: https://lore.kernel.org/all/20230419061352.3156023-1-u-kumar1@ti.com/

 arch/arm/mach-k3/common_fdt.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/mach-k3/common_fdt.c b/arch/arm/mach-k3/common_fdt.c
index 3bdedd7b50..4a01671156 100644
--- a/arch/arm/mach-k3/common_fdt.c
+++ b/arch/arm/mach-k3/common_fdt.c
@@ -65,6 +65,7 @@ static int fdt_fixup_msmc_ram(void *blob, char *parent_path, char *node_name)
 		      subnode, addr, size);
 		if (addr + size > msmc_size ||
 		    !strncmp(fdt_get_name(blob, subnode, &len), "sysfw", 5) ||
+		    !strncmp(fdt_get_name(blob, subnode, &len), "tifs", 4)  ||
 		    !strncmp(fdt_get_name(blob, subnode, &len), "l3cache", 7)) {
 			fdt_del_node(blob, subnode);
 			debug("%s: deleting subnode %d\n", __func__, subnode);
-- 
2.34.1


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

* Re: [PATCH] arch: arm: mach-k3: Delete tifs node in DT fixup
  2025-01-13  4:25 [PATCH] arch: arm: mach-k3: Delete tifs node in DT fixup Udit Kumar
@ 2025-01-20 18:07 ` Tom Rini
  0 siblings, 0 replies; 5+ messages in thread
From: Tom Rini @ 2025-01-20 18:07 UTC (permalink / raw)
  To: bb, Udit Kumar; +Cc: nm, afd, u-boot, vigneshr, Neha Malcom Francis

On Mon, 13 Jan 2025 09:55:24 +0530, Udit Kumar wrote:

> Delete tifs DT node as part of fixup.
> 
> TISCI API reported msmc_size, does not include 64KB reserved size for
> tifs aka MSMC comms memory, see documentation[0].
> 
> As part of fixup, original code uses TISCI API reported msmc_size as
> size for SRAM DT node.
> 
> [...]

Applied to u-boot/master, thanks!

-- 
Tom



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

end of thread, other threads:[~2025-01-20 18:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-13  4:25 [PATCH] arch: arm: mach-k3: Delete tifs node in DT fixup Udit Kumar
2025-01-20 18:07 ` Tom Rini
  -- strict thread matches above, loose matches on Subject: below --
2023-04-19  6:13 Udit Kumar
2023-04-19 15:52 ` Nishanth Menon
2023-04-20  7:58   ` Kumar, Udit

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