From: Jon Smirl <hidden> Date: 2008-07-25 21:51:24
I've lost my ability to boot on the mpc5200. Reverting this patch fixes it.
powerpc: Enable AT_BASE_PLATFORM aux vector
9115d13453dee22473a1e8cacc90a8d64a9c4bc9
commit 9115d13453dee22473a1e8cacc90a8d64a9c4bc9
Author: Nathan Lynch [off-list ref]
Date: Wed Jul 16 09:58:51 2008 +1000
powerpc: Enable AT_BASE_PLATFORM aux vector
Stash the first platform string matched by identify_cpu() in
powerpc_base_platform, and supply that to the ELF loader for the value
of AT_BASE_PLATFORM.
Signed-off-by: Nathan Lynch [off-list ref]
Signed-off-by: Benjamin Herrenschmidt [off-list ref]
@@ -23,6 +23,9 @@structcpu_spec*cur_cpu_spec=NULL;EXPORT_SYMBOL(cur_cpu_spec);+/* The platform string corresponding to the real PVR */+constchar*powerpc_base_platform;+/* NOTE:*Unlikeppc32,ppc64willonlycallthisonceforthebootCPU,it's*theresponsibilityoftheappropriateCPUsave/restorefunctionsto
long offset, unsigned int pvr)
} else
*t = *s;
*PTRRELOC(&cur_cpu_spec) = &the_cpu_spec;
+
+ /*
+ * Set the base platform string once; assumes
+ * we're called with real pvr first.
+ */
+ if (powerpc_base_platform == NULL)
+ powerpc_base_platform = t->platform;
+
#if defined(CONFIG_PPC64) || defined(CONFIG_BOOKE)
/* ppc64 and booke expect identify_cpu to also call
* setup_cpu for that processor. I will consolidate
@@ -217,6 +217,14 @@ typedef elf_vrregset_t elf_fpxregset_t;#define ELF_PLATFORM (cur_cpu_spec->platform)+/* While ELF_PLATFORM indicates the ISA supported by the platform, it+*maynotaccuratelyreflecttheunderlyingbehaviorofthehardware+*(asinthecaseofrunninginPower5+compatibilitymodeona+*Power6machine).ELF_BASE_PLATFORMallowsld.sotoloadlibraries+*thataretunedfortherealhardware.+*/+#define ELF_BASE_PLATFORM (powerpc_base_platform)+#ifdef __powerpc64__# define ELF_PLAT_INIT(_r, load_addr) do { \_r->gpr[2]=load_addr;\
long offset, unsigned int pvr)
} else
*t = *s;
*PTRRELOC(&cur_cpu_spec) = &the_cpu_spec;
+
+ /*
+ * Set the base platform string once; assumes
+ * we're called with real pvr first.
+ */
+ if (powerpc_base_platform == NULL)
+ powerpc_base_platform = t->platform;
+
long offset, unsigned int pvr)
} else
*t = *s;
*PTRRELOC(&cur_cpu_spec) = &the_cpu_spec;
+
+ /*
+ * Set the base platform string once; assumes
+ * we're called with real pvr first.
+ */
+ if (powerpc_base_platform == NULL)
+ powerpc_base_platform = t->platform;
+
Hmm, maybe this needs RELOC/PTRRELOC tricks?
Hrm... indeed.
if (RELOC(powerpc_base_platform))
RELOC(powerpc_base_platform) = t->platform;
try that.
Ben.
Commit 9115d13453dee22473a1e8cacc90a8d64a9c4bc9 ("powerpc: Enable
AT_BASE_PLATFORM aux vector") broke boot on 32-bit powerpc systems; we
have to use PTRRELOC to initialize powerpc_base_platform this early in
boot.
Bug reported by Jon Smirl.
Signed-off-by: Nathan Lynch <redacted>
---
Benjamin Herrenschmidt wrote:
if (RELOC(powerpc_base_platform))
RELOC(powerpc_base_platform) = t->platform;
try that.
Maybe this? (RELOC isn't defined in any header AFAICT).
arch/powerpc/kernel/cputable.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
@@ -1660,8 +1660,8 @@ struct cpu_spec * __init identify_cpu(unsigned long offset, unsigned int pvr)*Setthebaseplatformstringonce;assumes*we'recalledwithrealpvrfirst.*/-if(powerpc_base_platform==NULL)-powerpc_base_platform=t->platform;+if(*PTRRELOC(&powerpc_base_platform)==NULL)+*PTRRELOC(&powerpc_base_platform)=t->platform;#if defined(CONFIG_PPC64) || defined(CONFIG_BOOKE)/* ppc64 and booke expect identify_cpu to also call
From: Jon Smirl <hidden> Date: 2008-07-25 22:52:51
On 7/25/08, Nathan Lynch [off-list ref] wrote:
quoted hunk
Commit 9115d13453dee22473a1e8cacc90a8d64a9c4bc9 ("powerpc: Enable
AT_BASE_PLATFORM aux vector") broke boot on 32-bit powerpc systems; we
have to use PTRRELOC to initialize powerpc_base_platform this early in
boot.
Bug reported by Jon Smirl.
Signed-off-by: Nathan Lynch [off-list ref]
---
Benjamin Herrenschmidt wrote:
> if (RELOC(powerpc_base_platform))
> RELOC(powerpc_base_platform) = t->platform;
>
> try that.
Maybe this? (RELOC isn't defined in any header AFAICT).
arch/powerpc/kernel/cputable.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
index 25a052c..25c273c 100644
@@ -1660,8 +1660,8 @@ struct cpu_spec * __init identify_cpu(unsigned long offset, unsigned int pvr) * Set the base platform string once; assumes * we're called with real pvr first. */ - if (powerpc_base_platform == NULL) - powerpc_base_platform = t->platform;+ if (*PTRRELOC(&powerpc_base_platform) == NULL) + *PTRRELOC(&powerpc_base_platform) = t->platform;
This works too.
#if defined(CONFIG_PPC64) || defined(CONFIG_BOOKE)
/* ppc64 and booke expect identify_cpu to also call
--
1.5.6.2
_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev