linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc: Fix machine detection in prom_init.c
@ 2006-04-05 16:18 Michael Ellerman
  2006-04-07  3:46 ` Michael Neuling
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Ellerman @ 2006-04-05 16:18 UTC (permalink / raw)
  To: Paul Mackerras, linuxppc-dev

In e8222502ee6157e2713da9e0792c21f4ad458d50 the detection of machine types
in prom_init broke for some machines. We should be checking /device_type
instead of /model. This should make Power3 and Power4 boot again. Haven't
been able to test this.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---

 arch/powerpc/kernel/prom_init.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: to-merge/arch/powerpc/kernel/prom_init.c
===================================================================
--- to-merge.orig/arch/powerpc/kernel/prom_init.c
+++ to-merge/arch/powerpc/kernel/prom_init.c
@@ -1528,7 +1528,7 @@ static int __init prom_find_machine_type
 	 *    non-IBM designs !
 	 *  - it has /rtas
 	 */
-	len = prom_getprop(_prom->root, "model",
+	len = prom_getprop(_prom->root, "device_type",
 			   compat, sizeof(compat)-1);
 	if (len <= 0)
 		return PLATFORM_GENERIC;

^ permalink raw reply	[flat|nested] 3+ messages in thread
* Re: [PATCH] powerpc: Fix machine detection in prom_init.c
@ 2006-04-07  3:56 Michael Neuling
  0 siblings, 0 replies; 3+ messages in thread
From: Michael Neuling @ 2006-04-07  3:56 UTC (permalink / raw)
  To: Michael Ellerman, Paul Mackerras, linuxppc-dev

From: Michael Ellerman <michael@ellerman.id.au>

In e8222502ee6157e2713da9e0792c21f4ad458d50 the detection of machine types
in prom_init broke for some machines. We should be checking /device_type
instead of /model. This should make Power3 and Power4 boot again. Haven't
been able to test this.  We also need to relocate before comparing. 

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Michael Neuling <mikey@neuling.org>
---
> > In e8222502ee6157e2713da9e0792c21f4ad458d50 the detection of machine
> > types in prom_init broke for some machines. We should be checking
> > /device_type instead of /model. This should make Power3 and Power4
> > boot again. Haven't been able to test this.
> 
> We also need to relocate the string before comparing.
> 
> Combined patch below.  Tested on POWER3.  

Oops, let's be a little more careful walking off into nowhere.

Again, combined patch below.  Tested on POWER3.  

 arch/powerpc/kernel/prom_init.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

Index: linux-2.6-powerpc/arch/powerpc/kernel/prom_init.c
===================================================================
--- linux-2.6-powerpc.orig/arch/powerpc/kernel/prom_init.c
+++ linux-2.6-powerpc/arch/powerpc/kernel/prom_init.c
@@ -1528,12 +1528,11 @@ static int __init prom_find_machine_type
 	 *    non-IBM designs !
 	 *  - it has /rtas
 	 */
-	len = prom_getprop(_prom->root, "model",
+	len = prom_getprop(_prom->root, "device_type",
 			   compat, sizeof(compat)-1);
 	if (len <= 0)
 		return PLATFORM_GENERIC;
-	compat[len] = 0;
-	if (strcmp(compat, "chrp"))
+	if (strncmp(compat, RELOC("chrp"), 4))
 		return PLATFORM_GENERIC;
 
 	/* Default to pSeries. We need to know if we are running LPAR */

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

end of thread, other threads:[~2006-04-07  3:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-05 16:18 [PATCH] powerpc: Fix machine detection in prom_init.c Michael Ellerman
2006-04-07  3:46 ` Michael Neuling
  -- strict thread matches above, loose matches on Subject: below --
2006-04-07  3:56 Michael Neuling

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).