Linux-2.6.12-rc2
[linux-2.6/next.git] / arch / m68knommu / platform / 68VZ328 / ucdimm / config.c
blob2deadaffd81e4ddee52ba3615dc72477e71cb048
1 /*
2 * linux/arch/m68knommu/platform/68VZ328/ucdimm/config.c
4 * Copyright (C) 1993 Hamish Macdonald
5 * Copyright (C) 1999 D. Jeff Dionne
7 * This file is subject to the terms and conditions of the GNU General Public
8 * License. See the file COPYING in the main directory of this archive
9 * for more details.
12 #include <stdarg.h>
13 #include <linux/config.h>
14 #include <linux/types.h>
15 #include <linux/kernel.h>
16 #include <linux/mm.h>
17 #include <linux/tty.h>
18 #include <linux/console.h>
20 #include <asm/setup.h>
21 #include <asm/system.h>
22 #include <asm/pgtable.h>
23 #include <asm/irq.h>
24 #include <asm/machdep.h>
25 #include <asm/MC68VZ328.h>
26 #include <asm/bootstd.h>
28 void BSP_sched_init(void (*timer_routine)(int, void *, struct pt_regs *))
30 /* Restart mode, Enable int, 32KHz, Enable timer */
31 TCTL = TCTL_OM | TCTL_IRQEN | TCTL_CLKSOURCE_32KHZ | TCTL_TEN;
32 /* Set prescaler (Divide 32KHz by 32)*/
33 TPRER = 31;
34 /* Set compare register 32Khz / 32 / 10 = 100 */
35 TCMP = 10;
37 request_irq(TMR_IRQ_NUM, timer_routine, IRQ_FLG_LOCK, "timer", NULL);
40 void BSP_tick(void)
42 /* Reset Timer1 */
43 TSTAT &= 0;
46 unsigned long BSP_gettimeoffset (void)
48 return 0;
51 void BSP_gettod (int *yearp, int *monp, int *dayp,
52 int *hourp, int *minp, int *secp)
56 int BSP_hwclk(int op, struct hwclk_time *t)
58 if (!op) {
59 /* read */
60 } else {
61 /* write */
63 return 0;
66 int BSP_set_clock_mmss (unsigned long nowtime)
68 #if 0
69 short real_seconds = nowtime % 60, real_minutes = (nowtime / 60) % 60;
71 tod->second1 = real_seconds / 10;
72 tod->second2 = real_seconds % 10;
73 tod->minute1 = real_minutes / 10;
74 tod->minute2 = real_minutes % 10;
75 #endif
76 return 0;
79 void BSP_reset (void)
81 local_irq_disable();
82 asm volatile ("
83 moveal #0x10c00000, %a0;
84 moveb #0, 0xFFFFF300;
85 moveal 0(%a0), %sp;
86 moveal 4(%a0), %a0;
87 jmp (%a0);
88 ");
91 unsigned char *cs8900a_hwaddr;
92 static int errno;
94 _bsc0(char *, getserialnum)
95 _bsc1(unsigned char *, gethwaddr, int, a)
96 _bsc1(char *, getbenv, char *, a)
98 void config_BSP(char *command, int len)
100 unsigned char *p;
102 printk(KERN_INFO "\n68VZ328 DragonBallVZ support (c) 2001 Lineo, Inc.\n");
104 printk(KERN_INFO "uCdimm serial string [%s]\n",getserialnum());
105 p = cs8900a_hwaddr = gethwaddr(0);
106 printk(KERN_INFO "uCdimm hwaddr %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n",
107 p[0], p[1], p[2], p[3], p[4], p[5]);
108 p = getbenv("APPEND");
109 if (p) strcpy(p,command);
110 else command[0] = 0;
112 mach_sched_init = BSP_sched_init;
113 mach_tick = BSP_tick;
114 mach_gettimeoffset = BSP_gettimeoffset;
115 mach_gettod = BSP_gettod;
116 mach_reset = BSP_reset;