All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] powerpc/pasemi/nemo: Fix low memory values for boot.
@ 2017-01-20 17:46 Darren Stevens
  2017-01-20 20:22 ` Segher Boessenkool
  2017-01-23  6:15 ` Michael Ellerman
  0 siblings, 2 replies; 5+ messages in thread
From: Darren Stevens @ 2017-01-20 17:46 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Christian Zigotzky, rtd, Pat Wall, aperez

Commit 5c0484e25ec0 ('powerpc: Endian safe trampoline') added a
macro 'FIXUP_ENDIAN' to head_64.S. The CFE on Nemo has a bug 
that shows up when this is included, the system hangs right after
printing the initial memory map, before the CPU's are started.

Clearing the long long at addr 8 has been shown to fix this, so
add an initalisation to head_64.S so the system will boot.

Signed-off-by: Darren Stevens <darren@stevens-zone.net>

---

diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S
index 1dc5eae..032b317 100644
--- a/arch/powerpc/kernel/head_64.S
+++ b/arch/powerpc/kernel/head_64.S
@@ -79,6 +79,13 @@ _GLOBAL(__start)
    /* NOP this out unconditionally */
 BEGIN_FTR_SECTION
    FIXUP_ENDIAN
+#ifdef CONFIG_PPC_PASEMI_NEMO
+   /*
+    * Zero address 8 so Nemo will boot
+    */
+   li  r0,0
+   std 0,8(0)
+#endif
    b   __start_initialization_multiplatform
 END_FTR_SECTION(0, 1)
 

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

* Re: [PATCH] powerpc/pasemi/nemo: Fix low memory values for boot.
  2017-01-20 17:46 [PATCH] powerpc/pasemi/nemo: Fix low memory values for boot Darren Stevens
@ 2017-01-20 20:22 ` Segher Boessenkool
  2017-01-23  6:15 ` Michael Ellerman
  1 sibling, 0 replies; 5+ messages in thread
From: Segher Boessenkool @ 2017-01-20 20:22 UTC (permalink / raw)
  To: Darren Stevens; +Cc: linuxppc-dev, Pat Wall, rtd, aperez, Christian Zigotzky

On Fri, Jan 20, 2017 at 05:46:13PM +0000, Darren Stevens wrote:
> --- a/arch/powerpc/kernel/head_64.S
> +++ b/arch/powerpc/kernel/head_64.S
> @@ -79,6 +79,13 @@ _GLOBAL(__start)
>     /* NOP this out unconditionally */
>  BEGIN_FTR_SECTION
>     FIXUP_ENDIAN
> +#ifdef CONFIG_PPC_PASEMI_NEMO
> +   /*
> +    * Zero address 8 so Nemo will boot
> +    */
> +   li  r0,0
> +   std 0,8(0)
> +#endif

std r0,8(0)   for clarity?


Segher

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

* Re: [PATCH] powerpc/pasemi/nemo: Fix low memory values for boot.
  2017-01-20 17:46 [PATCH] powerpc/pasemi/nemo: Fix low memory values for boot Darren Stevens
  2017-01-20 20:22 ` Segher Boessenkool
@ 2017-01-23  6:15 ` Michael Ellerman
  2017-01-23 19:15   ` Darren Stevens
  1 sibling, 1 reply; 5+ messages in thread
From: Michael Ellerman @ 2017-01-23  6:15 UTC (permalink / raw)
  To: Darren Stevens, linuxppc-dev; +Cc: Pat Wall, rtd, aperez, Christian Zigotzky

Darren Stevens <darren@stevens-zone.net> writes:

> Commit 5c0484e25ec0 ('powerpc: Endian safe trampoline') added a
> macro 'FIXUP_ENDIAN' to head_64.S. The CFE on Nemo has a bug 
> that shows up when this is included, the system hangs right after
> printing the initial memory map, before the CPU's are started.
>
> Clearing the long long at addr 8 has been shown to fix this, so
> add an initalisation to head_64.S so the system will boot.

I'd really prefer it if someone could tell me why we need to clear it.
But I assume no one knows?

> diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S
> index 1dc5eae..032b317 100644
> --- a/arch/powerpc/kernel/head_64.S
> +++ b/arch/powerpc/kernel/head_64.S
> @@ -79,6 +79,13 @@ _GLOBAL(__start)
>     /* NOP this out unconditionally */
>  BEGIN_FTR_SECTION
>     FIXUP_ENDIAN
> +#ifdef CONFIG_PPC_PASEMI_NEMO
> +   /*
> +    * Zero address 8 so Nemo will boot
> +    */
> +   li  r0,0
> +   std 0,8(0)
> +#endif
>     b   __start_initialization_multiplatform
>  END_FTR_SECTION(0, 1)
 
I don't want to pollute this code with NEMO workarounds if we can avoid
it.

You said the hang happens after printing the initial memory map, I'm not
quite sure where you mean, but it sounds like that will be late enough
that we can do the clear in pasemi platform code?

cheers

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

* Re: powerpc/pasemi/nemo: Fix low memory values for boot.
  2017-01-23  6:15 ` Michael Ellerman
@ 2017-01-23 19:15   ` Darren Stevens
  2017-01-24  4:46     ` Michael Ellerman
  0 siblings, 1 reply; 5+ messages in thread
From: Darren Stevens @ 2017-01-23 19:15 UTC (permalink / raw)
  To: Michael Ellerman; +Cc: linuxppc-dev, Pat Wall, rtd, aperez, Christian Zigotzky

Hello Michael

On 23/01/2017, Michael Ellerman wrote:
>> Clearing the long long at addr 8 has been shown to fix this, so
>> add an initalisation to head_64.S so the system will boot.
>
> I'd really prefer it if someone could tell me why we need to clear it.
> But I assume no one knows?

The problem was found by Christian, and the fix comes courtesy of Olof
Johansson, I've not looked into it before.

> I don't want to pollute this code with NEMO workarounds if we can avoid
> it.

To be honest, so would I.

> You said the hang happens after printing the initial memory map, I'm not
> quite sure where you mean, but it sounds like that will be late enough
> that we can do the clear in pasemi platform code?

During prom_init. Where it says 'Memory layout at Init'

I took a long look today and traced the problem the 'prom_find_boot_cpu' and a
much better patch will follow.

Regards
Darren

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

* Re: powerpc/pasemi/nemo: Fix low memory values for boot.
  2017-01-23 19:15   ` Darren Stevens
@ 2017-01-24  4:46     ` Michael Ellerman
  0 siblings, 0 replies; 5+ messages in thread
From: Michael Ellerman @ 2017-01-24  4:46 UTC (permalink / raw)
  To: Darren Stevens; +Cc: linuxppc-dev, Pat Wall, rtd, aperez, Christian Zigotzky

Darren Stevens <darren@stevens-zone.net> writes:
> On 23/01/2017, Michael Ellerman wrote:
>>> Clearing the long long at addr 8 has been shown to fix this, so
>>> add an initalisation to head_64.S so the system will boot.
>>
>> I'd really prefer it if someone could tell me why we need to clear it.
>> But I assume no one knows?
...
>
> I took a long look today and traced the problem the 'prom_find_boot_cpu' and a
> much better patch will follow.

Awesome work, thanks.

cheers

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

end of thread, other threads:[~2017-01-24  4:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-20 17:46 [PATCH] powerpc/pasemi/nemo: Fix low memory values for boot Darren Stevens
2017-01-20 20:22 ` Segher Boessenkool
2017-01-23  6:15 ` Michael Ellerman
2017-01-23 19:15   ` Darren Stevens
2017-01-24  4:46     ` Michael Ellerman

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.