All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] armv8/spin_table.c: fix spin table release address
@ 2016-11-24 22:38 Tsung-Han Lin
  2016-11-26  2:17 ` Masahiro Yamada
  0 siblings, 1 reply; 5+ messages in thread
From: Tsung-Han Lin @ 2016-11-24 22:38 UTC (permalink / raw)
  To: u-boot

Since only the master core will relocate itself, the spin-table release
address seen by master core and other slave cores is different.
This commit fixes this issue by recalculating the spin-table release
address' offset instead of leaving it to compiler.

Signed-off-by: Tsung-Han Lin <tsunghan.tw@gmail.com>
---
 arch/arm/cpu/armv8/spin_table.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/arm/cpu/armv8/spin_table.c b/arch/arm/cpu/armv8/spin_table.c
index ec1c9b8ddb6f..1169e2df5f47 100644
--- a/arch/arm/cpu/armv8/spin_table.c
+++ b/arch/arm/cpu/armv8/spin_table.c
@@ -11,12 +11,16 @@
 
 int spin_table_update_dt(void *fdt)
 {
+	extern unsigned long _start;
 	int cpus_offset, offset;
 	const char *prop;
 	int ret;
 	unsigned long rsv_addr = (unsigned long)&spin_table_reserve_begin;
 	unsigned long rsv_size = &spin_table_reserve_end -
 						&spin_table_reserve_begin;
+	unsigned long unreloc_spin_release_addr = CONFIG_SYS_TEXT_BASE +
+		(unsigned long)&spin_table_cpu_release_addr -
+		(unsigned long)&_start;
 
 	cpus_offset = fdt_path_offset(fdt, "/cpus");
 	if (cpus_offset < 0)
@@ -47,7 +51,7 @@ int spin_table_update_dt(void *fdt)
 			continue;
 
 		ret = fdt_setprop_u64(fdt, offset, "cpu-release-addr",
-				(unsigned long)&spin_table_cpu_release_addr);
+				unreloc_spin_release_addr);
 		if (ret)
 			return -ENOSPC;
 	}
-- 
2.7.4

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

* [U-Boot] [PATCH] armv8/spin_table.c: fix spin table release address
  2016-11-24 22:38 [U-Boot] [PATCH] armv8/spin_table.c: fix spin table release address Tsung-Han Lin
@ 2016-11-26  2:17 ` Masahiro Yamada
  2016-11-26 12:43   ` Tsung-Han Lin
  0 siblings, 1 reply; 5+ messages in thread
From: Masahiro Yamada @ 2016-11-26  2:17 UTC (permalink / raw)
  To: u-boot

2016-11-25 7:38 GMT+09:00 Tsung-Han Lin <tsunghan.tw@gmail.com>:
> Since only the master core will relocate itself, the spin-table release
> address seen by master core and other slave cores is different.
> This commit fixes this issue by recalculating the spin-table release
> address' offset instead of leaving it to compiler.

No.
You should bring the slaves cores in after relocation
so that the slaves enter the *relocated* _start.

-- 
Best Regards
Masahiro Yamada

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

* [U-Boot] [PATCH] armv8/spin_table.c: fix spin table release address
  2016-11-26  2:17 ` Masahiro Yamada
@ 2016-11-26 12:43   ` Tsung-Han Lin
  0 siblings, 0 replies; 5+ messages in thread
From: Tsung-Han Lin @ 2016-11-26 12:43 UTC (permalink / raw)
  To: u-boot

Oops,

Seems like I misunderstood this approach.
Thanks for the clarification!

Regards,

2016-11-26 11:17 GMT+09:00 Masahiro Yamada <yamada.masahiro@socionext.com>:

> 2016-11-25 7:38 GMT+09:00 Tsung-Han Lin <tsunghan.tw@gmail.com>:
> > Since only the master core will relocate itself, the spin-table release
> > address seen by master core and other slave cores is different.
> > This commit fixes this issue by recalculating the spin-table release
> > address' offset instead of leaving it to compiler.
>
> No.
> You should bring the slaves cores in after relocation
> so that the slaves enter the *relocated* _start.
>
> --
> Best Regards
> Masahiro Yamada
>



-- 
Tsung-Han "*Johnny*" Lin

Page: http://tsunghanlin.github.com/
Email: tsunghan.tw at gmail.com

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

* [U-Boot] [PATCH] armv8/spin_table.c: fix spin table release address
  2016-11-25 10:44 Tsung-Han Lin
@ 2016-11-25 23:36 ` Tsung-Han Lin
  0 siblings, 0 replies; 5+ messages in thread
From: Tsung-Han Lin @ 2016-11-25 23:36 UTC (permalink / raw)
  To: u-boot

Hi,

Sorry that I sent this patch twice and they are actually the same one.
I thought the first mail was failed because I got a message from the mail
server said that it is not sent to one of the maintainers.

Regards,
Tsung-Han

2016-11-25 19:44 GMT+09:00 Tsung-Han Lin <tsunghan.tw@gmail.com>:

> Since only the master core will relocate itself, the spin-table release
> address seen by master core and other slave cores is different.
> This commit fixes this issue by recalculating the spin-table release
> address' offset instead of leaving it to compiler.
>
> Signed-off-by: Tsung-Han Lin <tsunghan.tw@gmail.com>
> ---
>  arch/arm/cpu/armv8/spin_table.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm/cpu/armv8/spin_table.c b/arch/arm/cpu/armv8/spin_
> table.c
> index ec1c9b8ddb6f..1169e2df5f47 100644
> --- a/arch/arm/cpu/armv8/spin_table.c
> +++ b/arch/arm/cpu/armv8/spin_table.c
> @@ -11,12 +11,16 @@
>
>  int spin_table_update_dt(void *fdt)
>  {
> +       extern unsigned long _start;
>         int cpus_offset, offset;
>         const char *prop;
>         int ret;
>         unsigned long rsv_addr = (unsigned long)&spin_table_reserve_begin;
>         unsigned long rsv_size = &spin_table_reserve_end -
>                                                 &spin_table_reserve_begin;
> +       unsigned long unreloc_spin_release_addr = CONFIG_SYS_TEXT_BASE +
> +               (unsigned long)&spin_table_cpu_release_addr -
> +               (unsigned long)&_start;
>
>         cpus_offset = fdt_path_offset(fdt, "/cpus");
>         if (cpus_offset < 0)
> @@ -47,7 +51,7 @@ int spin_table_update_dt(void *fdt)
>                         continue;
>
>                 ret = fdt_setprop_u64(fdt, offset, "cpu-release-addr",
> -                               (unsigned long)&spin_table_cpu_release_
> addr);
> +                               unreloc_spin_release_addr);
>                 if (ret)
>                         return -ENOSPC;
>         }
> --
> 2.7.4
>
>


-- 
Tsung-Han "*Johnny*" Lin

Page: http://tsunghanlin.github.com/
Email: tsunghan.tw at gmail.com

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

* [U-Boot] [PATCH] armv8/spin_table.c: fix spin table release address
@ 2016-11-25 10:44 Tsung-Han Lin
  2016-11-25 23:36 ` Tsung-Han Lin
  0 siblings, 1 reply; 5+ messages in thread
From: Tsung-Han Lin @ 2016-11-25 10:44 UTC (permalink / raw)
  To: u-boot

Since only the master core will relocate itself, the spin-table release
address seen by master core and other slave cores is different.
This commit fixes this issue by recalculating the spin-table release
address' offset instead of leaving it to compiler.

Signed-off-by: Tsung-Han Lin <tsunghan.tw@gmail.com>
---
 arch/arm/cpu/armv8/spin_table.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/arm/cpu/armv8/spin_table.c b/arch/arm/cpu/armv8/spin_table.c
index ec1c9b8ddb6f..1169e2df5f47 100644
--- a/arch/arm/cpu/armv8/spin_table.c
+++ b/arch/arm/cpu/armv8/spin_table.c
@@ -11,12 +11,16 @@
 
 int spin_table_update_dt(void *fdt)
 {
+	extern unsigned long _start;
 	int cpus_offset, offset;
 	const char *prop;
 	int ret;
 	unsigned long rsv_addr = (unsigned long)&spin_table_reserve_begin;
 	unsigned long rsv_size = &spin_table_reserve_end -
 						&spin_table_reserve_begin;
+	unsigned long unreloc_spin_release_addr = CONFIG_SYS_TEXT_BASE +
+		(unsigned long)&spin_table_cpu_release_addr -
+		(unsigned long)&_start;
 
 	cpus_offset = fdt_path_offset(fdt, "/cpus");
 	if (cpus_offset < 0)
@@ -47,7 +51,7 @@ int spin_table_update_dt(void *fdt)
 			continue;
 
 		ret = fdt_setprop_u64(fdt, offset, "cpu-release-addr",
-				(unsigned long)&spin_table_cpu_release_addr);
+				unreloc_spin_release_addr);
 		if (ret)
 			return -ENOSPC;
 	}
-- 
2.7.4

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

end of thread, other threads:[~2016-11-26 12:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-24 22:38 [U-Boot] [PATCH] armv8/spin_table.c: fix spin table release address Tsung-Han Lin
2016-11-26  2:17 ` Masahiro Yamada
2016-11-26 12:43   ` Tsung-Han Lin
2016-11-25 10:44 Tsung-Han Lin
2016-11-25 23:36 ` Tsung-Han Lin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.