patch-2.4.19 linux-2.4.19/arch/m68k/bvme6000/config.c
Next file: linux-2.4.19/arch/m68k/bvme6000/rtc.c
Previous file: linux-2.4.19/arch/m68k/atari/time.c
Back to the patch index
Back to the overall index
- Lines: 145
- Date:
Fri Aug 2 17:39:43 2002
- Orig file:
linux-2.4.18/arch/m68k/bvme6000/config.c
- Orig date:
Mon Jun 11 19:15:27 2001
diff -urN linux-2.4.18/arch/m68k/bvme6000/config.c linux-2.4.19/arch/m68k/bvme6000/config.c
@@ -22,6 +22,7 @@
#include <linux/linkage.h>
#include <linux/init.h>
#include <linux/major.h>
+#include <linux/rtc.h>
#include <asm/bootinfo.h>
#include <asm/system.h>
@@ -48,7 +49,7 @@
extern unsigned long bvme6000_gettimeoffset (void);
extern void bvme6000_gettod (int *year, int *mon, int *day, int *hour,
int *min, int *sec);
-extern int bvme6000_hwclk (int, struct hwclk_time *);
+extern int bvme6000_hwclk (int, struct rtc_time *);
extern int bvme6000_set_clock_mmss (unsigned long);
extern void bvme6000_check_partition (struct gendisk *hd, unsigned int dev);
extern void bvme6000_mksound( unsigned int count, unsigned int ticks );
@@ -181,8 +182,8 @@
unsigned long *old = (unsigned long *)0xf8000000;
/* Wait for button release */
- while (*config_reg_ptr & BVME_ABORT_STATUS)
- ;
+ while (*(volatile unsigned char *)BVME_LOCAL_IRQ_STAT & BVME_ABORT_STATUS)
+ ;
*(new+4) = *(old+4); /* Illegal instruction */
*(new+9) = *(old+9); /* Trace */
@@ -330,7 +331,7 @@
* };
*/
-int bvme6000_hwclk(int op, struct hwclk_time *t)
+int bvme6000_hwclk(int op, struct rtc_time *t)
{
volatile RtcPtr_t rtc = (RtcPtr_t)BVME_RTC_BASE;
unsigned char msr = rtc->msr & 0xc0;
@@ -339,31 +340,31 @@
* are accessible */
if (op)
{ /* Write.... */
- rtc->t0cr_rtmr = t->year%4;
+ rtc->t0cr_rtmr = t->tm_year%4;
rtc->bcd_tenms = 0;
- rtc->bcd_sec = bin2bcd(t->sec);
- rtc->bcd_min = bin2bcd(t->min);
- rtc->bcd_hr = bin2bcd(t->hour);
- rtc->bcd_dom = bin2bcd(t->day);
- rtc->bcd_mth = bin2bcd(t->mon + 1);
- rtc->bcd_year = bin2bcd(t->year%100);
- if (t->wday >= 0)
- rtc->bcd_dow = bin2bcd(t->wday+1);
- rtc->t0cr_rtmr = t->year%4 | 0x08;
+ rtc->bcd_sec = bin2bcd(t->tm_sec);
+ rtc->bcd_min = bin2bcd(t->tm_min);
+ rtc->bcd_hr = bin2bcd(t->tm_hour);
+ rtc->bcd_dom = bin2bcd(t->tm_mday);
+ rtc->bcd_mth = bin2bcd(t->tm_mon + 1);
+ rtc->bcd_year = bin2bcd(t->tm_year%100);
+ if (t->tm_wday >= 0)
+ rtc->bcd_dow = bin2bcd(t->tm_wday+1);
+ rtc->t0cr_rtmr = t->tm_year%4 | 0x08;
}
else
{ /* Read.... */
do {
- t->sec = bcd2bin(rtc->bcd_sec);
- t->min = bcd2bin(rtc->bcd_min);
- t->hour = bcd2bin(rtc->bcd_hr);
- t->day = bcd2bin(rtc->bcd_dom);
- t->mon = bcd2bin(rtc->bcd_mth)-1;
- t->year = bcd2bin(rtc->bcd_year);
- if (t->year < 70)
- t->year += 100;
- t->wday = bcd2bin(rtc->bcd_dow)-1;
- } while (t->sec != bcd2bin(rtc->bcd_sec));
+ t->tm_sec = bcd2bin(rtc->bcd_sec);
+ t->tm_min = bcd2bin(rtc->bcd_min);
+ t->tm_hour = bcd2bin(rtc->bcd_hr);
+ t->tm_mday = bcd2bin(rtc->bcd_dom);
+ t->tm_mon = bcd2bin(rtc->bcd_mth)-1;
+ t->tm_year = bcd2bin(rtc->bcd_year);
+ if (t->tm_year < 70)
+ t->tm_year += 100;
+ t->tm_wday = bcd2bin(rtc->bcd_dow)-1;
+ } while (t->tm_sec != bcd2bin(rtc->bcd_sec));
}
rtc->msr = msr;
@@ -419,55 +420,3 @@
{
return 0;
}
-
-/*------------------- Serial console stuff ------------------------*/
-
-static void bvme_scc_write(struct console *co, const char *str, unsigned cnt);
-
-
-void bvme6000_init_console_port (struct console *co, int cflag)
-{
- co->write = bvme_scc_write;
-}
-
-
-static void scc_delay (void)
-{
- int n;
- volatile int trash;
-
- for (n = 0; n < 20; n++)
- trash = n;
-}
-
-static void scc_write (char ch)
-{
- volatile char *p = (volatile char *)BVME_SCC_A_ADDR;
-
- do {
- scc_delay();
- }
- while (!(*p & 4));
- scc_delay();
- *p = 8;
- scc_delay();
- *p = ch;
-}
-
-
-static void bvme_scc_write (struct console *co, const char *str, unsigned count)
-{
- unsigned long flags;
-
- save_flags(flags);
- cli();
-
- while (count--)
- {
- if (*str == '\n')
- scc_write ('\r');
- scc_write (*str++);
- }
- restore_flags(flags);
-}
-
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)