Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/amiga Reboot support for P5PPC+68K boards, compiled...



details:   https://anonhg.NetBSD.org/src/rev/ade549c6f3e9
branches:  trunk
changeset: 477216:ade549c6f3e9
user:      is <is%NetBSD.org@localhost>
date:      Fri Oct 15 21:50:34 1999 +0000

description:
Reboot support for P5PPC+68K boards, compiled in by "options P5PPC68KBOARD".
Without this, at least cyberppc+040 boards won't reboot, but just hang when
down.
The method is similar to what LinuxPPC/APUS does, but without EIEIO.

diffstat:

 sys/arch/amiga/amiga/amiga_init.c |  21 ++++++++++++++++++++-
 sys/arch/amiga/amiga/locore.s     |  30 +++++++++++++++++++++++++++++-
 sys/arch/amiga/conf/GENERIC       |   3 ++-
 sys/arch/amiga/conf/files.amiga   |   3 ++-
 4 files changed, 53 insertions(+), 4 deletions(-)

diffs (155 lines):

diff -r 6b84c02a402d -r ade549c6f3e9 sys/arch/amiga/amiga/amiga_init.c
--- a/sys/arch/amiga/amiga/amiga_init.c Fri Oct 15 20:39:52 1999 +0000
+++ b/sys/arch/amiga/amiga/amiga_init.c Fri Oct 15 21:50:34 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: amiga_init.c,v 1.66 1999/09/25 21:47:03 is Exp $       */
+/*     $NetBSD: amiga_init.c,v 1.67 1999/10/15 21:50:35 is Exp $       */
 
 /*
  * Copyright (c) 1994 Michael L. Hitch
@@ -32,6 +32,7 @@
  */
 
 #include "opt_amigaccgrf.h"
+#include "opt_p5ppc68kboard.h"
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -74,6 +75,9 @@
 #endif
 extern u_long boot_partition;
 vaddr_t                amiga_uptbase;
+#ifdef P5PPC68KBOARD
+extern int     p5ppc;
+#endif
 
 extern char *esym;
 
@@ -203,6 +207,7 @@
        struct boot_memlist *ml;
        u_int loadbase = 0;     /* XXXXXXXXXXXXXXXXXXXXXXXXXXXX */
        u_int *shadow_pt = 0;   /* XXXXXXXXXXXXXXXXXXXXXXXXXXXX */
+        struct cfdev *cdp, *ecdp;
 
 #ifdef DEBUG_KERNEL_START
        /* XXX this only is valid if Altais is in slot 0 */
@@ -991,6 +996,20 @@
                *a3000_magic_reset |= 0x80;
        }
 
+#ifdef P5PPC68KBOARD
+       /*
+        * Are we an P5 PPC/68K board? install different reset 
+        * routine.
+        */
+        
+        for (cdp = cfdev, ecdp = &cfdev[ncfdev]; cdp < ecdp; cdp++) {
+               if (cdp->rom.manid == 8512 &&
+                   (cdp->rom.prodid == 100 || cdp->rom.prodid == 110)) {
+                               p5ppc = 1;
+                               break;
+                       }
+        }
+#endif
 }
 
 void
diff -r 6b84c02a402d -r ade549c6f3e9 sys/arch/amiga/amiga/locore.s
--- a/sys/arch/amiga/amiga/locore.s     Fri Oct 15 20:39:52 1999 +0000
+++ b/sys/arch/amiga/amiga/locore.s     Fri Oct 15 21:50:34 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: locore.s,v 1.111 1999/09/17 19:59:37 thorpej Exp $     */
+/*     $NetBSD: locore.s,v 1.112 1999/10/15 21:50:35 is Exp $  */
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -47,6 +47,7 @@
  */
 
 #include "opt_bb060stupidrom.h"
+#include "opt_p5ppc68kboard.h"
 #include "opt_compat_netbsd.h"
 #include "opt_compat_svr4.h"
 #include "opt_compat_sunos.h"
@@ -1647,6 +1648,13 @@
  * Handle the nitty-gritty of rebooting the machine.
  *
  */
+#if defined(P5PPC68KBOARD)
+       .data
+GLOBAL(p5ppc)
+       .long   0
+       .text
+#endif
+
        .globl  _doboot
 _doboot:
        movl    #CACHE_OFF,d0
@@ -1660,6 +1668,10 @@
 
        movw    #0x2700,sr                      | cut off any interrupts
 
+#if defined(P5PPC68KBOARD)
+       tstl    _C_LABEL(p5ppc)
+       jne     Lp5ppcboot
+#endif
 #if defined(DRACO)
        cmpb    #0x7d,_machineid
        jeq     LdbOnDraCo
@@ -1724,6 +1736,22 @@
        | now rely on prefetch for next jmp
        jmp     a0@
        | NOT REACHED
+
+#if defined(P5PPC68KBOARD)
+Lp5ppcboot:
+| The Linux-Apus boot code does it in a similar way
+| For 040 on uncached pages, eieio can be replaced by nothing.
+       movl    _C_LABEL(ZTWOROMADDR),a0
+       lea     a0@(0xf60000-0xd80000),a0
+       movb    #0x60,a0@(0x20)
+       movb    #0x50,a0@(0x20)
+       movb    #0x30,a0@(0x20)
+       movb    #0x40,a0@(0x18)
+       movb    #0x04,a0@
+Lwaithere:
+       jra     Lwaithere
+#endif
+
 #ifdef DRACO
 LdbOnDraCo:
 | we use a TTR. We want to boot even if half of us is already dead.
diff -r 6b84c02a402d -r ade549c6f3e9 sys/arch/amiga/conf/GENERIC
--- a/sys/arch/amiga/conf/GENERIC       Fri Oct 15 20:39:52 1999 +0000
+++ b/sys/arch/amiga/conf/GENERIC       Fri Oct 15 21:50:34 1999 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: GENERIC,v 1.128 1999/07/29 10:37:14 augustss Exp $
+#      $NetBSD: GENERIC,v 1.129 1999/10/15 21:50:34 is Exp $
 
 #
 #if 0
@@ -30,6 +30,7 @@
                                # bootblock.
                                # You do not need this if you have a DraCo,
                                # have no 68060 or NEVER use the bootblock
+options                P5PPC68KBOARD   # Phase5 PPC/68K board support
 #endif
 #
 # processors this kernel should support
diff -r 6b84c02a402d -r ade549c6f3e9 sys/arch/amiga/conf/files.amiga
--- a/sys/arch/amiga/conf/files.amiga   Fri Oct 15 20:39:52 1999 +0000
+++ b/sys/arch/amiga/conf/files.amiga   Fri Oct 15 21:50:34 1999 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.amiga,v 1.92 1999/09/20 23:17:13 is Exp $
+#      $NetBSD: files.amiga,v 1.93 1999/10/15 21:50:34 is Exp $
 
 # maxpartitions must be first item in files.${ARCH}.newconf
 maxpartitions 16                       # NOTE THAT AMIGA IS SPECIAL!
@@ -21,6 +21,7 @@
 defopt opt_retina.h            RETINA_SPEED_HACK
 
 defopt                         BB060STUPIDROM
+defopt                         P5PPC68KBOARD
 
 device  mainbus {}
 attach  mainbus at root



Home | Main Index | Thread Index | Old Index