linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Sven Luther <sven.luther@wanadoo.fr>
To: Sven Luther <sven.luther@wanadoo.fr>
Cc: linuxppc-dev@lists.linuxppc.org
Subject: Re: Pegasos 2 support patch ...
Date: Tue, 29 Jun 2004 22:42:30 +0200	[thread overview]
Message-ID: <20040629204230.GA15900@pegasos> (raw)
In-Reply-To: <20040629165029.GA13468@pegasos>

[-- Attachment #1: Type: text/plain, Size: 1082 bytes --]

On Tue, Jun 29, 2004 at 06:50:29PM +0200, Sven Luther wrote:
> The pegasos1 support is not complete, but i believe this is due to some
> brokeness in the OF. The main problem being that the translate function
> is broken, and altough phys has the right value (0x00010000) before
> calling it, it is 0 afterwards. I suppose the initial value is taken
> from &_stext, so it should be feasible to detect that this is the
> correct value before calling the translate OF method, or fixing it if we
> detect a Pegasos 1 with the model OF property. Comments on this would
> also be welcome. There may be some interrupt level thing left on pegasos
> 1 also, but i would need to check that.

Well, the pegasos 1 seems to start with mmu enabled, but with BATs
mapped 1:1. There is not much we can do unless we fix the translate
method, i think. The attached patch tests if the machine is a pegasos 1
(but not 2) and sets the phys to 0x00010000 if this is the case.

Another solution would be to test before doing the translate call, maybe
this would be more elegant ?

Friendly,

Sven Luther

[-- Attachment #2: pegasos1.diff --]
[-- Type: text/plain, Size: 976 bytes --]

diff -urN kernel-source-2.6.7.orig/arch/ppc/syslib/prom_init.c kernel-source-2.6.7.peg2/arch/ppc/syslib/prom_init.c
--- 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-29 21:07:04.491319912 +0200
@@ -794,6 +794,9 @@
 	char *p, *d;
  	unsigned long phys;
 	void *result[3];
+	char model[32];
+	phandle node;
+	int rc;

  	/* Default */
  	phys = (unsigned long) &_stext;
@@ -880,6 +883,11 @@
 	for (i = 0; i < prom_num_displays; ++i)
 		prom_display_paths[i] = PTRUNRELOC(prom_display_paths[i]);

+	/* Pegasos 1 has a broken translate method in the OF, fix it */
+	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)) phys = 0x00010000;
+
 	prom_print("returning 0x");
 	prom_print_hex(phys);
 	prom_print("from prom_init\n");

  reply	other threads:[~2004-06-29 20:42 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-29 16:50 Pegasos 2 support patch Sven Luther
2004-06-29 20:42 ` Sven Luther [this message]
2004-06-30  2:57   ` Benjamin Herrenschmidt
2004-06-30  6:00     ` Sven Luther
2004-06-30  8:10       ` Geert Uytterhoeven
2004-06-30  8:21         ` Sven Luther
2004-06-30  9:18 ` Adrian Cox
2004-06-30  9:30   ` Sven Luther
2004-06-30  9:40     ` Adrian Cox
2004-06-30  9:45       ` Sven Luther
2004-06-30 15:50   ` Sven Luther
2004-06-30 16:12     ` Adrian Cox
2004-06-30 16:23       ` Sven Luther
2004-06-30 16:39         ` Adrian Cox
2004-06-30 18:52           ` Sven Luther
2004-06-30 19:05             ` Adrian Cox
2004-06-30 19:38               ` Sven Luther
2004-07-01  7:59                 ` Geert Uytterhoeven
2004-07-01  8:42                   ` Adrian Cox
2004-07-01  8:48                     ` Geert Uytterhoeven
2004-07-01  8:57                     ` Sven Luther

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040629204230.GA15900@pegasos \
    --to=sven.luther@wanadoo.fr \
    --cc=linuxppc-dev@lists.linuxppc.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).