2 * linux/arch/$(ARCH)/platform/$(PLATFORM)/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
11 * VZ Support/Fixes Evan Stawnyczy <e@lineo.ca>
16 #include <linux/config.h>
17 #include <linux/types.h>
18 #include <linux/kernel.h>
20 #include <linux/tty.h>
21 #include <linux/console.h>
22 #include <linux/interrupt.h>
23 #include <asm/current.h>
25 #include <asm/setup.h>
26 #include <asm/system.h>
27 #include <asm/pgtable.h>
29 #include <asm/machdep.h>
30 #include <asm/MC68328.h>
33 void BSP_sched_init(irqreturn_t (*timer_routine
)(int, void *, struct pt_regs
*))
36 #ifdef CONFIG_XCOPILOT_BUGS
38 * The only thing I know is that CLK32 is not available on Xcopilot
39 * I have little idea about what frequency SYSCLK has on Xcopilot.
40 * The values for prescaler and compare registers were simply
41 * taken from the original source
44 /* Restart mode, Enable int, SYSCLK, Enable timer */
45 TCTL2
= TCTL_OM
| TCTL_IRQEN
| TCTL_CLKSOURCE_SYSCLK
| TCTL_TEN
;
48 /* Set compare register */
51 /* Restart mode, Enable int, 32KHz, Enable timer */
52 TCTL2
= TCTL_OM
| TCTL_IRQEN
| TCTL_CLKSOURCE_32KHZ
| TCTL_TEN
;
53 /* Set prescaler (Divide 32KHz by 32)*/
55 /* Set compare register 32Khz / 32 / 10 = 100 */
59 request_irq(TMR2_IRQ_NUM
, timer_routine
, IRQ_FLG_LOCK
, "timer", NULL
);
68 unsigned long BSP_gettimeoffset (void)
73 void BSP_gettod (int *yearp
, int *monp
, int *dayp
,
74 int *hourp
, int *minp
, int *secp
)
78 int BSP_hwclk(int op
, struct hwclk_time
*t
)
88 int BSP_set_clock_mmss (unsigned long nowtime
)
91 short real_seconds
= nowtime
% 60, real_minutes
= (nowtime
/ 60) % 60;
93 tod
->second1
= real_seconds
/ 10;
94 tod
->second2
= real_seconds
% 10;
95 tod
->minute1
= real_minutes
/ 10;
96 tod
->minute2
= real_minutes
% 10;
101 void BSP_reset (void)
104 asm volatile ("moveal #0x10c00000, %a0;\n\t"
105 "moveb #0, 0xFFFFF300;\n\t"
106 "moveal 0(%a0), %sp;\n\t"
107 "moveal 4(%a0), %a0;\n\t"
111 void config_BSP(char *command
, int len
)
113 printk(KERN_INFO
"\n68328 support D. Jeff Dionne <jeff@uclinux.org>\n");
114 printk(KERN_INFO
"68328 support Kenneth Albanowski <kjahds@kjshds.com>\n");
115 printk(KERN_INFO
"68328/Pilot support Bernhard Kuhn <kuhn@lpr.e-technik.tu-muenchen.de>\n");
117 mach_sched_init
= BSP_sched_init
;
118 mach_tick
= BSP_tick
;
119 mach_gettimeoffset
= BSP_gettimeoffset
;
120 mach_gettod
= BSP_gettod
;
122 mach_set_clock_mmss
= NULL
;
123 mach_reset
= BSP_reset
;