Thread (21 messages) 21 messages, 4 authors, 2004-07-01

Re: Pegasos 2 support patch ...

From: Geert Uytterhoeven <geert@linux-m68k.org>
Date: 2004-06-30 08:10:07

On Wed, 30 Jun 2004, Sven Luther wrote:
On Tue, Jun 29, 2004 at 09:57:29PM -0500, Benjamin Herrenschmidt wrote:
quoted
quoted
Another solution would be to test before doing the translate call, maybe
this would be more elegant ?
Yup, if you know it will be broken, don't bother calling it,
and please, avoid the over-long line :)
Ok, this is then the final patch, i hope it is now correct.
quoted hunk ↗ jump to hunk
--- kernel-source-2.6.7.orig/arch/ppc/syslib/prom_init.c	2004-06-16 07:20:24.000000000 +0200
+++ kernel-source-2.6.7.peg2/arch/ppc/syslib/prom_init.c	2004-06-30 07:51:49.975232432 +0200
@@ -850,11 +853,20 @@

 	klimit = (char *) (mem - offset);

-	/* If we are already running at 0xc0000000, we assume we were
-	 * loaded by an OF bootloader which did set a BAT for us.
-	 * This breaks OF translate so we force phys to be 0.
-	 */
-	if (offset == 0) {
+	node = call_prom("finddevice", 1, 1, "/");
+	rc = call_prom("getprop", 4, 1, node, "model", model, sizeof(model));
+	if (rc > 0 && !strncmp (model, "Pegasos", 7)
+		&& strncmp (model, "Pegasos2", 8)) {
+		/* Pegasos 1 has a broken translate method in the OF,
+		 * and furthermore the BATs are mapped 1:1 so the phys
+		 * address calculated above is * correct, so let's use
                                               ^
Bogus asterisk
+		 * it directly.
Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help