set hz for LUNA-I
authorAkito Fujita <akito@ucbvax.Berkeley.EDU>
Thu, 13 May 1993 07:27:57 +0000 (23:27 -0800)
committerAkito Fujita <akito@ucbvax.Berkeley.EDU>
Thu, 13 May 1993 07:27:57 +0000 (23:27 -0800)
SCCS-vsn: sys/luna68k/luna68k/locore.s 7.13
SCCS-vsn: sys/luna68k/luna68k/clock.c 7.9

usr/src/sys/luna68k/luna68k/clock.c
usr/src/sys/luna68k/luna68k/locore.s

index 8d78158..1e47ad1 100644 (file)
@@ -13,7 +13,7 @@
  * from: Utah $Hdr: clock.c 1.18 91/01/21$
  * from: hp300/hp300/clock.c   7.19 (Berkeley) 2/18/93
  *
  * from: Utah $Hdr: clock.c 1.18 91/01/21$
  * from: hp300/hp300/clock.c   7.19 (Berkeley) 2/18/93
  *
- *     @(#)clock.c     7.8 (Berkeley) %G%
+ *     @(#)clock.c     7.9 (Berkeley) %G%
  */
 
 #include <sys/param.h>
  */
 
 #include <sys/param.h>
@@ -155,20 +155,12 @@ resettodr()
        /* set bb-clock */
 #ifdef LUNA2
        if (machineid == LUNA_II) {
        /* set bb-clock */
 #ifdef LUNA2
        if (machineid == LUNA_II) {
-#if 1
-               /* not yet */
-               printf("WARNING: not supported resettodr() at LUNA2 yet.\n");
-               return;
-#else
-               /* bbc2->cal_ctl_? |= BBC_WRT; */
                bbc2->cal_sec = tmptr->tm_sec;
                bbc2->cal_min = tmptr->tm_min;
                bbc2->cal_hour =tmptr->tm_hour;
                bbc2->cal_day = tmptr->tm_mday;
                bbc2->cal_mon = tmptr->tm_mon;
                bbc2->cal_sec = tmptr->tm_sec;
                bbc2->cal_min = tmptr->tm_min;
                bbc2->cal_hour =tmptr->tm_hour;
                bbc2->cal_day = tmptr->tm_mday;
                bbc2->cal_mon = tmptr->tm_mon;
-               bbc2->cal_year = tmptr->tm_year);
-               /* bbc2->cal_ctl_? &= ~BBC_WRT; */
-#endif
+               bbc2->cal_year = tmptr->tm_year;
        } else 
 #endif
        {
        } else 
 #endif
        {
@@ -312,3 +304,16 @@ batterychk()
        battery_clock = 1;
        return;
 }
        battery_clock = 1;
        return;
 }
+
+#define        LUNA1_HZ        60
+
+modify_clock_param()
+{
+       extern int      hz, tick, tickadj;
+
+       if (machineid == LUNA_I) {
+               hz = LUNA1_HZ;
+               tick = 1000000 / hz;
+               tickadj = 30000 / (60 * hz);    /* can adjust 30ms in 60s */
+       }
+}
index 3a30082..3813afa 100644 (file)
@@ -13,7 +13,7 @@
  * from: Utah $Hdr: locore.s 1.62 92/01/20$
  * from: hp300/hp300/locore.s  7.22 (Berkeley) 2/18/93
  *
  * from: Utah $Hdr: locore.s 1.62 92/01/20$
  * from: hp300/hp300/locore.s  7.22 (Berkeley) 2/18/93
  *
- *     @(#)locore.s    7.12 (Berkeley) %G%
+ *     @(#)locore.s    7.13 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
@@ -803,6 +803,9 @@ Lnot68030:
 #endif
 Lstart1:
 #endif
 #endif
 Lstart1:
 #endif
+/* set 60 to hz, when running LUNA-I */
+       .globl  _modify_clock_param
+       jbsr    _modify_clock_param
 
 /* initialize source/destination control registers for movs */
        moveq   #FC_USERD,d0            | user space
 
 /* initialize source/destination control registers for movs */
        moveq   #FC_USERD,d0            | user space
@@ -2318,12 +2321,12 @@ _doboot:
        cmpl    #-2,_mmutype            | 68040?
        jne     LmotommuF               | no, skip
 
        cmpl    #-2,_mmutype            | 68040?
        jne     LmotommuF               | no, skip
 
+       movw    #PSL_HIGHIPL,sr         | no interrupts
+
        movl    #0x41000000,a0
        movl    a0@,d0
        movc    d0,isp                  | set ISP
 
        movl    #0x41000000,a0
        movl    a0@,d0
        movc    d0,isp                  | set ISP
 
-       movw    #PSL_HIGHIPL,sr         | no interrupts
-
        .word   0xf4f8                  | cpusha bc
        movl    #0,d0
        movc    d0,cacr                 | caches off
        .word   0xf4f8                  | cpusha bc
        movl    #0,d0
        movc    d0,cacr                 | caches off