* [PATCH v3 1/2] powerpc32/booke: consistently return phys_addr_t in __pa()
@ 2020-01-06 4:29 yingjie_bai
2020-01-06 4:29 ` [PATCH v3 2/2] powerpc/mpc85xx: also write addr_h to spin table for 64bit boot entry yingjie_bai
2020-01-29 5:17 ` [PATCH v3 1/2] powerpc32/booke: consistently return phys_addr_t in __pa() Michael Ellerman
0 siblings, 2 replies; 4+ messages in thread
From: yingjie_bai @ 2020-01-06 4:29 UTC (permalink / raw)
To: Scott Wood, Kumar Gala
Cc: Jason Yan, Aneesh Kumar K.V, Greg Kroah-Hartman, Nicholas Piggin,
linux-kernel, Paul Mackerras, Allison Randal, Bai Yingjie,
Thomas Gleixner, linuxppc-dev, Nicolas Saenz Julienne
From: Bai Yingjie <byj.tea@gmail.com>
When CONFIG_RELOCATABLE=y is set, VIRT_PHYS_OFFSET is a 64bit variable,
thus __pa() returns as 64bit value.
But when CONFIG_RELOCATABLE=n, __pa() returns 32bit value.
When CONFIG_PHYS_64BIT is set, __pa() should consistently return as
64bit value irrelevant to CONFIG_RELOCATABLE.
So we'd make __pa() consistently return phys_addr_t, which is 64bit
when CONFIG_PHYS_64BIT is set.
Signed-off-by: Bai Yingjie <byj.tea@gmail.com>
---
arch/powerpc/include/asm/page.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/include/asm/page.h b/arch/powerpc/include/asm/page.h
index 7f1fd41e3065..86332080399a 100644
--- a/arch/powerpc/include/asm/page.h
+++ b/arch/powerpc/include/asm/page.h
@@ -209,7 +209,7 @@ static inline bool pfn_valid(unsigned long pfn)
*/
#if defined(CONFIG_PPC32) && defined(CONFIG_BOOKE)
#define __va(x) ((void *)(unsigned long)((phys_addr_t)(x) + VIRT_PHYS_OFFSET))
-#define __pa(x) ((unsigned long)(x) - VIRT_PHYS_OFFSET)
+#define __pa(x) ((phys_addr_t)(unsigned long)(x) - VIRT_PHYS_OFFSET)
#else
#ifdef CONFIG_PPC64
/*
--
2.17.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH v3 2/2] powerpc/mpc85xx: also write addr_h to spin table for 64bit boot entry
2020-01-06 4:29 [PATCH v3 1/2] powerpc32/booke: consistently return phys_addr_t in __pa() yingjie_bai
@ 2020-01-06 4:29 ` yingjie_bai
2020-01-06 18:05 ` Scott Wood
2020-01-29 5:17 ` [PATCH v3 1/2] powerpc32/booke: consistently return phys_addr_t in __pa() Michael Ellerman
1 sibling, 1 reply; 4+ messages in thread
From: yingjie_bai @ 2020-01-06 4:29 UTC (permalink / raw)
To: Scott Wood, Kumar Gala
Cc: Jason Yan, Aneesh Kumar K.V, Greg Kroah-Hartman, Nicholas Piggin,
linux-kernel, Diana Craciun, Paul Mackerras, Allison Randal,
Bai Yingjie, Thomas Gleixner, linuxppc-dev,
Nicolas Saenz Julienne
From: Bai Yingjie <byj.tea@gmail.com>
CPU like P4080 has 36bit physical address, its DDR physical
start address can be configured above 4G by LAW registers.
For such systems in which their physical memory start address was
configured higher than 4G, we need also to write addr_h into the spin
table of the target secondary CPU, so that addr_h and addr_l together
represent a 64bit physical address.
Otherwise the secondary core can not get correct entry to start from.
Signed-off-by: Bai Yingjie <byj.tea@gmail.com>
---
arch/powerpc/platforms/85xx/smp.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/arch/powerpc/platforms/85xx/smp.c b/arch/powerpc/platforms/85xx/smp.c
index 8c7ea2486bc0..48f7d96ae37d 100644
--- a/arch/powerpc/platforms/85xx/smp.c
+++ b/arch/powerpc/platforms/85xx/smp.c
@@ -252,6 +252,15 @@ static int smp_85xx_start_cpu(int cpu)
out_be64((u64 *)(&spin_table->addr_h),
__pa(ppc_function_entry(generic_secondary_smp_init)));
#else
+#ifdef CONFIG_PHYS_ADDR_T_64BIT
+ /*
+ * We need also to write addr_h to spin table for systems
+ * in which their physical memory start address was configured
+ * to above 4G, otherwise the secondary core can not get
+ * correct entry to start from.
+ */
+ out_be32(&spin_table->addr_h, __pa(__early_start) >> 32);
+#endif
out_be32(&spin_table->addr_l, __pa(__early_start));
#endif
flush_spin_table(spin_table);
--
2.17.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v3 2/2] powerpc/mpc85xx: also write addr_h to spin table for 64bit boot entry
2020-01-06 4:29 ` [PATCH v3 2/2] powerpc/mpc85xx: also write addr_h to spin table for 64bit boot entry yingjie_bai
@ 2020-01-06 18:05 ` Scott Wood
0 siblings, 0 replies; 4+ messages in thread
From: Scott Wood @ 2020-01-06 18:05 UTC (permalink / raw)
To: yingjie_bai, Kumar Gala
Cc: Jason Yan, Aneesh Kumar K.V, Greg Kroah-Hartman, Nicholas Piggin,
linux-kernel, Diana Craciun, Paul Mackerras, Allison Randal,
Bai Yingjie, Thomas Gleixner, linuxppc-dev,
Nicolas Saenz Julienne
On Mon, 2020-01-06 at 12:29 +0800, yingjie_bai@126.com wrote:
> From: Bai Yingjie <byj.tea@gmail.com>
>
> CPU like P4080 has 36bit physical address, its DDR physical
> start address can be configured above 4G by LAW registers.
>
> For such systems in which their physical memory start address was
> configured higher than 4G, we need also to write addr_h into the spin
> table of the target secondary CPU, so that addr_h and addr_l together
> represent a 64bit physical address.
> Otherwise the secondary core can not get correct entry to start from.
>
> Signed-off-by: Bai Yingjie <byj.tea@gmail.com>
> ---
> arch/powerpc/platforms/85xx/smp.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
Acked-by: Scott Wood <oss@buserror.net>
-Scott
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v3 1/2] powerpc32/booke: consistently return phys_addr_t in __pa()
2020-01-06 4:29 [PATCH v3 1/2] powerpc32/booke: consistently return phys_addr_t in __pa() yingjie_bai
2020-01-06 4:29 ` [PATCH v3 2/2] powerpc/mpc85xx: also write addr_h to spin table for 64bit boot entry yingjie_bai
@ 2020-01-29 5:17 ` Michael Ellerman
1 sibling, 0 replies; 4+ messages in thread
From: Michael Ellerman @ 2020-01-29 5:17 UTC (permalink / raw)
To: yingjie_bai, Scott Wood, Kumar Gala
Cc: Jason Yan, Aneesh Kumar K.V, linux-kernel, Nicholas Piggin,
Paul Mackerras, Nicolas Saenz Julienne, Greg Kroah-Hartman,
Bai Yingjie, Thomas Gleixner, linuxppc-dev, Allison Randal
On Mon, 2020-01-06 at 04:29:53 UTC, yingjie_bai@126.com wrote:
> From: Bai Yingjie <byj.tea@gmail.com>
>
> When CONFIG_RELOCATABLE=y is set, VIRT_PHYS_OFFSET is a 64bit variable,
> thus __pa() returns as 64bit value.
> But when CONFIG_RELOCATABLE=n, __pa() returns 32bit value.
>
> When CONFIG_PHYS_64BIT is set, __pa() should consistently return as
> 64bit value irrelevant to CONFIG_RELOCATABLE.
> So we'd make __pa() consistently return phys_addr_t, which is 64bit
> when CONFIG_PHYS_64BIT is set.
>
> Signed-off-by: Bai Yingjie <byj.tea@gmail.com>
Series applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/6ad4afc97bc6c5cca9786030492ddfab871ce79e
cheers
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-01-29 6:01 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-01-06 4:29 [PATCH v3 1/2] powerpc32/booke: consistently return phys_addr_t in __pa() yingjie_bai
2020-01-06 4:29 ` [PATCH v3 2/2] powerpc/mpc85xx: also write addr_h to spin table for 64bit boot entry yingjie_bai
2020-01-06 18:05 ` Scott Wood
2020-01-29 5:17 ` [PATCH v3 1/2] powerpc32/booke: consistently return phys_addr_t in __pa() Michael Ellerman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).