X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=arch%2Fppc%2Fsyslib%2Fprom_init.c;h=83686bc4d79f9fe0bd3c8e5d5826f2d9cae61885;hb=6a77f38946aaee1cd85eeec6cf4229b204c15071;hp=ac4c8b158041cfeac7729ac250cb56f58098b250;hpb=87fc8d1bb10cd459024a742c6a10961fefcef18f;p=linux-2.6.git diff --git a/arch/ppc/syslib/prom_init.c b/arch/ppc/syslib/prom_init.c index ac4c8b158..83686bc4d 100644 --- a/arch/ppc/syslib/prom_init.c +++ b/arch/ppc/syslib/prom_init.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include @@ -26,7 +27,6 @@ #include #include #include -#include #include #include #include @@ -810,6 +810,9 @@ prom_init(int r3, int r4, prom_entry pp) char *p, *d; unsigned long phys; void *result[3]; + char model[32]; + phandle node; + int rc; /* Default */ phys = (unsigned long) &_stext; @@ -866,11 +869,20 @@ prom_init(int r3, int r4, prom_entry pp) 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 + * it directly. + */ + } else if (offset == 0) { + /* 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. + */ prom_print("(already at 0xc0000000) phys=0\n"); phys = 0; } else if ((int) call_prom("getprop", 4, 1, prom_chosen, "mmu",