diff options
Diffstat (limited to 'arch/m68knommu')
-rw-r--r-- | arch/m68knommu/platform/523x/Makefile | 19 | ||||
-rw-r--r-- | arch/m68knommu/platform/5272/config.c | 6 | ||||
-rw-r--r-- | arch/m68knommu/platform/5307/Makefile | 1 | ||||
-rw-r--r-- | arch/m68knommu/platform/68328/config.c | 94 | ||||
-rw-r--r-- | arch/m68knommu/platform/68328/timers.c | 106 | ||||
-rw-r--r-- | arch/m68knommu/platform/68EZ328/config.c | 80 | ||||
-rw-r--r-- | arch/m68knommu/platform/68VZ328/config.c (renamed from arch/m68knommu/platform/68VZ328/de2/config.c) | 141 | ||||
-rw-r--r-- | arch/m68knommu/platform/68VZ328/ucdimm/config.c | 117 |
8 files changed, 251 insertions, 313 deletions
diff --git a/arch/m68knommu/platform/523x/Makefile b/arch/m68knommu/platform/523x/Makefile new file mode 100644 index 000000000000..c1578b016160 --- /dev/null +++ b/arch/m68knommu/platform/523x/Makefile | |||
@@ -0,0 +1,19 @@ | |||
1 | # | ||
2 | # Makefile for the m68knommu linux kernel. | ||
3 | # | ||
4 | |||
5 | # | ||
6 | # If you want to play with the HW breakpoints then you will | ||
7 | # need to add define this, which will give you a stack backtrace | ||
8 | # on the console port whenever a DBG interrupt occurs. You have to | ||
9 | # set up you HW breakpoints to trigger a DBG interrupt: | ||
10 | # | ||
11 | # EXTRA_CFLAGS += -DTRAP_DBG_INTERRUPT | ||
12 | # EXTRA_AFLAGS += -DTRAP_DBG_INTERRUPT | ||
13 | # | ||
14 | |||
15 | ifdef CONFIG_FULLDEBUG | ||
16 | AFLAGS += -DDEBUGGER_COMPATIBLE_CACHE=1 | ||
17 | endif | ||
18 | |||
19 | obj-y := config.o | ||
diff --git a/arch/m68knommu/platform/5272/config.c b/arch/m68knommu/platform/5272/config.c index 5cb28690f89a..cf36e7d007b9 100644 --- a/arch/m68knommu/platform/5272/config.c +++ b/arch/m68knommu/platform/5272/config.c | |||
@@ -104,11 +104,11 @@ int mcf_timerirqpending(int timer) | |||
104 | 104 | ||
105 | void config_BSP(char *commandp, int size) | 105 | void config_BSP(char *commandp, int size) |
106 | { | 106 | { |
107 | #if 0 | 107 | #if defined (CONFIG_MOD5272) |
108 | volatile unsigned long *pivrp; | 108 | volatile unsigned char *pivrp; |
109 | 109 | ||
110 | /* Set base of device vectors to be 64 */ | 110 | /* Set base of device vectors to be 64 */ |
111 | pivrp = (volatile unsigned long *) (MCF_MBAR + MCFSIM_PIVR); | 111 | pivrp = (volatile unsigned char *) (MCF_MBAR + MCFSIM_PIVR); |
112 | *pivrp = 0x40; | 112 | *pivrp = 0x40; |
113 | #endif | 113 | #endif |
114 | 114 | ||
diff --git a/arch/m68knommu/platform/5307/Makefile b/arch/m68knommu/platform/5307/Makefile index 84b6b70641e1..6fe5a2b8fb08 100644 --- a/arch/m68knommu/platform/5307/Makefile +++ b/arch/m68knommu/platform/5307/Makefile | |||
@@ -19,6 +19,7 @@ endif | |||
19 | obj-$(CONFIG_COLDFIRE) += entry.o vectors.o ints.o | 19 | obj-$(CONFIG_COLDFIRE) += entry.o vectors.o ints.o |
20 | obj-$(CONFIG_M5206) += timers.o | 20 | obj-$(CONFIG_M5206) += timers.o |
21 | obj-$(CONFIG_M5206e) += timers.o | 21 | obj-$(CONFIG_M5206e) += timers.o |
22 | obj-$(CONFIG_M523x) += pit.o | ||
22 | obj-$(CONFIG_M5249) += timers.o | 23 | obj-$(CONFIG_M5249) += timers.o |
23 | obj-$(CONFIG_M527x) += pit.o | 24 | obj-$(CONFIG_M527x) += pit.o |
24 | obj-$(CONFIG_M5272) += timers.o | 25 | obj-$(CONFIG_M5272) += timers.o |
diff --git a/arch/m68knommu/platform/68328/config.c b/arch/m68knommu/platform/68328/config.c index fd7c93f86481..bcfa5d7fe1e2 100644 --- a/arch/m68knommu/platform/68328/config.c +++ b/arch/m68knommu/platform/68328/config.c | |||
@@ -1,5 +1,7 @@ | |||
1 | /***************************************************************************/ | ||
2 | |||
1 | /* | 3 | /* |
2 | * linux/arch/$(ARCH)/platform/$(PLATFORM)/config.c | 4 | * linux/arch/m68knommu/platform/68328/config.c |
3 | * | 5 | * |
4 | * Copyright (C) 1993 Hamish Macdonald | 6 | * Copyright (C) 1993 Hamish Macdonald |
5 | * Copyright (C) 1999 D. Jeff Dionne | 7 | * Copyright (C) 1999 D. Jeff Dionne |
@@ -11,6 +13,8 @@ | |||
11 | * VZ Support/Fixes Evan Stawnyczy <e@lineo.ca> | 13 | * VZ Support/Fixes Evan Stawnyczy <e@lineo.ca> |
12 | */ | 14 | */ |
13 | 15 | ||
16 | /***************************************************************************/ | ||
17 | |||
14 | #include <asm/dbg.h> | 18 | #include <asm/dbg.h> |
15 | #include <stdarg.h> | 19 | #include <stdarg.h> |
16 | #include <linux/config.h> | 20 | #include <linux/config.h> |
@@ -29,76 +33,16 @@ | |||
29 | #include <asm/machdep.h> | 33 | #include <asm/machdep.h> |
30 | #include <asm/MC68328.h> | 34 | #include <asm/MC68328.h> |
31 | 35 | ||
36 | /***************************************************************************/ | ||
32 | 37 | ||
33 | void BSP_sched_init(irqreturn_t (*timer_routine)(int, void *, struct pt_regs *)) | 38 | void m68328_timer_init(irqreturn_t (*timer_routine) (int, void *, struct pt_regs *)); |
34 | { | 39 | void m68328_timer_tick(void); |
35 | 40 | unsigned long m68328_timer_gettimeoffset(void); | |
36 | #ifdef CONFIG_XCOPILOT_BUGS | 41 | void m68328_timer_gettod(int *year, int *mon, int *day, int *hour, int *min, int *sec); |
37 | /* | ||
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 | ||
42 | */ | ||
43 | |||
44 | /* Restart mode, Enable int, SYSCLK, Enable timer */ | ||
45 | TCTL2 = TCTL_OM | TCTL_IRQEN | TCTL_CLKSOURCE_SYSCLK | TCTL_TEN; | ||
46 | /* Set prescaler */ | ||
47 | TPRER2 = 2; | ||
48 | /* Set compare register */ | ||
49 | TCMP2 = 0xd7e4; | ||
50 | #else | ||
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)*/ | ||
54 | TPRER2 = 31; | ||
55 | /* Set compare register 32Khz / 32 / 10 = 100 */ | ||
56 | TCMP2 = 10; | ||
57 | #endif | ||
58 | |||
59 | request_irq(TMR2_IRQ_NUM, timer_routine, IRQ_FLG_LOCK, "timer", NULL); | ||
60 | } | ||
61 | |||
62 | void BSP_tick(void) | ||
63 | { | ||
64 | /* Reset Timer2 */ | ||
65 | TSTAT2 &= 0; | ||
66 | } | ||
67 | 42 | ||
68 | unsigned long BSP_gettimeoffset (void) | 43 | /***************************************************************************/ |
69 | { | ||
70 | return 0; | ||
71 | } | ||
72 | 44 | ||
73 | void BSP_gettod (int *yearp, int *monp, int *dayp, | 45 | void m68328_reset (void) |
74 | int *hourp, int *minp, int *secp) | ||
75 | { | ||
76 | } | ||
77 | |||
78 | int BSP_hwclk(int op, struct hwclk_time *t) | ||
79 | { | ||
80 | if (!op) { | ||
81 | /* read */ | ||
82 | } else { | ||
83 | /* write */ | ||
84 | } | ||
85 | return 0; | ||
86 | } | ||
87 | |||
88 | int BSP_set_clock_mmss (unsigned long nowtime) | ||
89 | { | ||
90 | #if 0 | ||
91 | short real_seconds = nowtime % 60, real_minutes = (nowtime / 60) % 60; | ||
92 | |||
93 | tod->second1 = real_seconds / 10; | ||
94 | tod->second2 = real_seconds % 10; | ||
95 | tod->minute1 = real_minutes / 10; | ||
96 | tod->minute2 = real_minutes % 10; | ||
97 | #endif | ||
98 | return 0; | ||
99 | } | ||
100 | |||
101 | void BSP_reset (void) | ||
102 | { | 46 | { |
103 | local_irq_disable(); | 47 | local_irq_disable(); |
104 | asm volatile ("moveal #0x10c00000, %a0;\n\t" | 48 | asm volatile ("moveal #0x10c00000, %a0;\n\t" |
@@ -108,18 +52,22 @@ void BSP_reset (void) | |||
108 | "jmp (%a0);"); | 52 | "jmp (%a0);"); |
109 | } | 53 | } |
110 | 54 | ||
55 | /***************************************************************************/ | ||
56 | |||
111 | void config_BSP(char *command, int len) | 57 | void config_BSP(char *command, int len) |
112 | { | 58 | { |
113 | printk(KERN_INFO "\n68328 support D. Jeff Dionne <jeff@uclinux.org>\n"); | 59 | printk(KERN_INFO "\n68328 support D. Jeff Dionne <jeff@uclinux.org>\n"); |
114 | printk(KERN_INFO "68328 support Kenneth Albanowski <kjahds@kjshds.com>\n"); | 60 | 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"); | 61 | printk(KERN_INFO "68328/Pilot support Bernhard Kuhn <kuhn@lpr.e-technik.tu-muenchen.de>\n"); |
116 | 62 | ||
117 | mach_sched_init = BSP_sched_init; | 63 | mach_sched_init = m68328_timer_init; |
118 | mach_tick = BSP_tick; | 64 | mach_tick = m68328_timer_tick; |
119 | mach_gettimeoffset = BSP_gettimeoffset; | 65 | mach_gettimeoffset = m68328_timer_gettimeoffset; |
120 | mach_gettod = BSP_gettod; | 66 | mach_gettod = m68328_timer_gettod; |
121 | mach_hwclk = NULL; | 67 | mach_hwclk = NULL; |
122 | mach_set_clock_mmss = NULL; | 68 | mach_set_clock_mmss = NULL; |
123 | mach_reset = BSP_reset; | 69 | mach_reset = m68328_reset; |
124 | *command = '\0'; | 70 | *command = '\0'; |
125 | } | 71 | } |
72 | |||
73 | /***************************************************************************/ | ||
diff --git a/arch/m68knommu/platform/68328/timers.c b/arch/m68knommu/platform/68328/timers.c new file mode 100644 index 000000000000..68c2cd6b0030 --- /dev/null +++ b/arch/m68knommu/platform/68328/timers.c | |||
@@ -0,0 +1,106 @@ | |||
1 | /***************************************************************************/ | ||
2 | |||
3 | /* | ||
4 | * linux/arch/m68knommu/platform/68328/timers.c | ||
5 | * | ||
6 | * Copyright (C) 1993 Hamish Macdonald | ||
7 | * Copyright (C) 1999 D. Jeff Dionne | ||
8 | * Copyright (C) 2001 Georges Menie, Ken Desmet | ||
9 | * | ||
10 | * This file is subject to the terms and conditions of the GNU General Public | ||
11 | * License. See the file COPYING in the main directory of this archive | ||
12 | * for more details. | ||
13 | */ | ||
14 | |||
15 | /***************************************************************************/ | ||
16 | |||
17 | #include <linux/config.h> | ||
18 | #include <linux/types.h> | ||
19 | #include <linux/kernel.h> | ||
20 | #include <linux/mm.h> | ||
21 | #include <asm/setup.h> | ||
22 | #include <asm/system.h> | ||
23 | #include <asm/pgtable.h> | ||
24 | #include <asm/irq.h> | ||
25 | #include <asm/machdep.h> | ||
26 | #include <asm/MC68VZ328.h> | ||
27 | |||
28 | /***************************************************************************/ | ||
29 | |||
30 | #if defined(CONFIG_DRAGEN2) | ||
31 | /* with a 33.16 MHz clock, this will give usec resolution to the time functions */ | ||
32 | #define CLOCK_SOURCE TCTL_CLKSOURCE_SYSCLK | ||
33 | #define CLOCK_PRE 7 | ||
34 | #define TICKS_PER_JIFFY 41450 | ||
35 | |||
36 | #elif defined(CONFIG_XCOPILOT_BUGS) | ||
37 | /* | ||
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 | ||
42 | */ | ||
43 | #define CLOCK_SOURCE TCTL_CLKSOURCE_SYSCLK | ||
44 | #define CLOCK_PRE 2 | ||
45 | #define TICKS_PER_JIFFY 0xd7e4 | ||
46 | |||
47 | #else | ||
48 | /* default to using the 32Khz clock */ | ||
49 | #define CLOCK_SOURCE TCTL_CLKSOURCE_32KHZ | ||
50 | #define CLOCK_PRE 31 | ||
51 | #define TICKS_PER_JIFFY 10 | ||
52 | #endif | ||
53 | |||
54 | /***************************************************************************/ | ||
55 | |||
56 | void m68328_timer_init(irqreturn_t (*timer_routine) (int, void *, struct pt_regs *)) | ||
57 | { | ||
58 | /* disable timer 1 */ | ||
59 | TCTL = 0; | ||
60 | |||
61 | /* set ISR */ | ||
62 | if (request_irq(TMR_IRQ_NUM, timer_routine, IRQ_FLG_LOCK, "timer", NULL)) | ||
63 | panic("Unable to attach timer interrupt\n"); | ||
64 | |||
65 | /* Restart mode, Enable int, Set clock source */ | ||
66 | TCTL = TCTL_OM | TCTL_IRQEN | CLOCK_SOURCE; | ||
67 | TPRER = CLOCK_PRE; | ||
68 | TCMP = TICKS_PER_JIFFY; | ||
69 | |||
70 | /* Enable timer 1 */ | ||
71 | TCTL |= TCTL_TEN; | ||
72 | } | ||
73 | |||
74 | /***************************************************************************/ | ||
75 | |||
76 | void m68328_timer_tick(void) | ||
77 | { | ||
78 | /* Reset Timer1 */ | ||
79 | TSTAT &= 0; | ||
80 | } | ||
81 | /***************************************************************************/ | ||
82 | |||
83 | unsigned long m68328_timer_gettimeoffset(void) | ||
84 | { | ||
85 | unsigned long ticks = TCN, offset = 0; | ||
86 | |||
87 | /* check for pending interrupt */ | ||
88 | if (ticks < (TICKS_PER_JIFFY >> 1) && (ISR & (1 << TMR_IRQ_NUM))) | ||
89 | offset = 1000000 / HZ; | ||
90 | ticks = (ticks * 1000000 / HZ) / TICKS_PER_JIFFY; | ||
91 | return ticks + offset; | ||
92 | } | ||
93 | |||
94 | /***************************************************************************/ | ||
95 | |||
96 | void m68328_timer_gettod(int *year, int *mon, int *day, int *hour, int *min, int *sec) | ||
97 | { | ||
98 | long now = RTCTIME; | ||
99 | |||
100 | *year = *mon = *day = 1; | ||
101 | *hour = (now >> 24) % 24; | ||
102 | *min = (now >> 16) % 60; | ||
103 | *sec = now % 60; | ||
104 | } | ||
105 | |||
106 | /***************************************************************************/ | ||
diff --git a/arch/m68knommu/platform/68EZ328/config.c b/arch/m68knommu/platform/68EZ328/config.c index c21971971ff5..d8d56e5de310 100644 --- a/arch/m68knommu/platform/68EZ328/config.c +++ b/arch/m68knommu/platform/68EZ328/config.c | |||
@@ -1,5 +1,7 @@ | |||
1 | /***************************************************************************/ | ||
2 | |||
1 | /* | 3 | /* |
2 | * linux/arch/$(ARCH)/platform/$(PLATFORM)/config.c | 4 | * linux/arch/m68knommu/platform/68EZ328/config.c |
3 | * | 5 | * |
4 | * Copyright (C) 1993 Hamish Macdonald | 6 | * Copyright (C) 1993 Hamish Macdonald |
5 | * Copyright (C) 1999 D. Jeff Dionne | 7 | * Copyright (C) 1999 D. Jeff Dionne |
@@ -9,6 +11,8 @@ | |||
9 | * for more details. | 11 | * for more details. |
10 | */ | 12 | */ |
11 | 13 | ||
14 | /***************************************************************************/ | ||
15 | |||
12 | #include <stdarg.h> | 16 | #include <stdarg.h> |
13 | #include <linux/config.h> | 17 | #include <linux/config.h> |
14 | #include <linux/types.h> | 18 | #include <linux/types.h> |
@@ -20,68 +24,22 @@ | |||
20 | #include <asm/setup.h> | 24 | #include <asm/setup.h> |
21 | #include <asm/system.h> | 25 | #include <asm/system.h> |
22 | #include <asm/pgtable.h> | 26 | #include <asm/pgtable.h> |
23 | #include <asm/irq.h> | ||
24 | #include <asm/machdep.h> | 27 | #include <asm/machdep.h> |
25 | #include <asm/MC68EZ328.h> | 28 | #include <asm/MC68EZ328.h> |
26 | #ifdef CONFIG_UCSIMM | 29 | #ifdef CONFIG_UCSIMM |
27 | #include <asm/bootstd.h> | 30 | #include <asm/bootstd.h> |
28 | #endif | 31 | #endif |
29 | #ifdef CONFIG_PILOT | ||
30 | #include "PalmV/romfs.h" | ||
31 | #endif | ||
32 | |||
33 | void BSP_sched_init(void (*timer_routine)(int, void *, struct pt_regs *)) | ||
34 | { | ||
35 | /* Restart mode, Enable int, 32KHz, Enable timer */ | ||
36 | TCTL = TCTL_OM | TCTL_IRQEN | TCTL_CLKSOURCE_32KHZ | TCTL_TEN; | ||
37 | /* Set prescaler (Divide 32KHz by 32)*/ | ||
38 | TPRER = 31; | ||
39 | /* Set compare register 32Khz / 32 / 10 = 100 */ | ||
40 | TCMP = 10; | ||
41 | |||
42 | request_irq(TMR_IRQ_NUM, timer_routine, IRQ_FLG_LOCK, "timer", NULL); | ||
43 | } | ||
44 | |||
45 | void BSP_tick(void) | ||
46 | { | ||
47 | /* Reset Timer1 */ | ||
48 | TSTAT &= 0; | ||
49 | } | ||
50 | |||
51 | unsigned long BSP_gettimeoffset (void) | ||
52 | { | ||
53 | return 0; | ||
54 | } | ||
55 | 32 | ||
56 | void BSP_gettod (int *yearp, int *monp, int *dayp, | 33 | /***************************************************************************/ |
57 | int *hourp, int *minp, int *secp) | ||
58 | { | ||
59 | } | ||
60 | 34 | ||
61 | int BSP_hwclk(int op, struct hwclk_time *t) | 35 | void m68328_timer_init(irqreturn_t (*timer_routine) (int, void *, struct pt_regs *)); |
62 | { | 36 | void m68328_timer_tick(void); |
63 | if (!op) { | 37 | unsigned long m68328_timer_gettimeoffset(void); |
64 | /* read */ | 38 | void m68328_timer_gettod(int *year, int *mon, int *day, int *hour, int *min, int *sec); |
65 | } else { | ||
66 | /* write */ | ||
67 | } | ||
68 | return 0; | ||
69 | } | ||
70 | 39 | ||
71 | int BSP_set_clock_mmss (unsigned long nowtime) | 40 | /***************************************************************************/ |
72 | { | ||
73 | #if 0 | ||
74 | short real_seconds = nowtime % 60, real_minutes = (nowtime / 60) % 60; | ||
75 | 41 | ||
76 | tod->second1 = real_seconds / 10; | 42 | void m68ez328_reset(void) |
77 | tod->second2 = real_seconds % 10; | ||
78 | tod->minute1 = real_minutes / 10; | ||
79 | tod->minute2 = real_minutes % 10; | ||
80 | #endif | ||
81 | return 0; | ||
82 | } | ||
83 | |||
84 | void BSP_reset (void) | ||
85 | { | 43 | { |
86 | local_irq_disable(); | 44 | local_irq_disable(); |
87 | asm volatile (" | 45 | asm volatile (" |
@@ -93,6 +51,8 @@ void BSP_reset (void) | |||
93 | "); | 51 | "); |
94 | } | 52 | } |
95 | 53 | ||
54 | /***************************************************************************/ | ||
55 | |||
96 | unsigned char *cs8900a_hwaddr; | 56 | unsigned char *cs8900a_hwaddr; |
97 | static int errno; | 57 | static int errno; |
98 | 58 | ||
@@ -119,11 +79,13 @@ void config_BSP(char *command, int len) | |||
119 | else command[0] = 0; | 79 | else command[0] = 0; |
120 | #endif | 80 | #endif |
121 | 81 | ||
122 | mach_sched_init = BSP_sched_init; | 82 | mach_sched_init = m68328_timer_init; |
123 | mach_tick = BSP_tick; | 83 | mach_tick = m68328_timer_tick; |
124 | mach_gettimeoffset = BSP_gettimeoffset; | 84 | mach_gettimeoffset = m68328_timer_gettimeoffset; |
125 | mach_gettod = BSP_gettod; | 85 | mach_gettod = m68328_timer_gettod; |
126 | mach_hwclk = NULL; | 86 | mach_hwclk = NULL; |
127 | mach_set_clock_mmss = NULL; | 87 | mach_set_clock_mmss = NULL; |
128 | mach_reset = BSP_reset; | 88 | mach_reset = m68ez328_reset; |
129 | } | 89 | } |
90 | |||
91 | /***************************************************************************/ | ||
diff --git a/arch/m68knommu/platform/68VZ328/de2/config.c b/arch/m68knommu/platform/68VZ328/config.c index d0586197f113..d926524cdf82 100644 --- a/arch/m68knommu/platform/68VZ328/de2/config.c +++ b/arch/m68knommu/platform/68VZ328/config.c | |||
@@ -1,5 +1,7 @@ | |||
1 | /***************************************************************************/ | ||
2 | |||
1 | /* | 3 | /* |
2 | * linux/arch/m68knommu/platform/MC68VZ328/de2/config.c | 4 | * linux/arch/m68knommu/platform/68VZ328/config.c |
3 | * | 5 | * |
4 | * Copyright (C) 1993 Hamish Macdonald | 6 | * Copyright (C) 1993 Hamish Macdonald |
5 | * Copyright (C) 1999 D. Jeff Dionne | 7 | * Copyright (C) 1999 D. Jeff Dionne |
@@ -10,6 +12,8 @@ | |||
10 | * for more details. | 12 | * for more details. |
11 | */ | 13 | */ |
12 | 14 | ||
15 | /***************************************************************************/ | ||
16 | |||
13 | #include <linux/config.h> | 17 | #include <linux/config.h> |
14 | #include <linux/types.h> | 18 | #include <linux/types.h> |
15 | #include <linux/kernel.h> | 19 | #include <linux/kernel.h> |
@@ -25,66 +29,25 @@ | |||
25 | #include <asm/irq.h> | 29 | #include <asm/irq.h> |
26 | #include <asm/machdep.h> | 30 | #include <asm/machdep.h> |
27 | #include <asm/MC68VZ328.h> | 31 | #include <asm/MC68VZ328.h> |
32 | #include <asm/bootstd.h> | ||
28 | 33 | ||
29 | #ifdef CONFIG_INIT_LCD | 34 | #ifdef CONFIG_INIT_LCD |
30 | #include "screen.h" | 35 | #include "bootlogo.h" |
31 | #endif | 36 | #endif |
32 | 37 | ||
33 | /* with a 33.16 MHz clock, this will give usec resolution to the time functions */ | 38 | /***************************************************************************/ |
34 | #define CLOCK_SOURCE TCTL_CLKSOURCE_SYSCLK | ||
35 | #define CLOCK_PRE 7 | ||
36 | #define TICKS_PER_JIFFY 41450 | ||
37 | |||
38 | static void | ||
39 | dragen2_sched_init(irqreturn_t (*timer_routine) (int, void *, struct pt_regs *)) | ||
40 | { | ||
41 | /* disable timer 1 */ | ||
42 | TCTL = 0; | ||
43 | |||
44 | /* set ISR */ | ||
45 | if (request_irq(TMR_IRQ_NUM, timer_routine, IRQ_FLG_LOCK, "timer", NULL)) | ||
46 | panic("Unable to attach timer interrupt\n"); | ||
47 | |||
48 | /* Restart mode, Enable int, Set clock source */ | ||
49 | TCTL = TCTL_OM | TCTL_IRQEN | CLOCK_SOURCE; | ||
50 | TPRER = CLOCK_PRE; | ||
51 | TCMP = TICKS_PER_JIFFY; | ||
52 | |||
53 | /* Enable timer 1 */ | ||
54 | TCTL |= TCTL_TEN; | ||
55 | } | ||
56 | |||
57 | static void dragen2_tick(void) | ||
58 | { | ||
59 | /* Reset Timer1 */ | ||
60 | TSTAT &= 0; | ||
61 | } | ||
62 | |||
63 | static unsigned long dragen2_gettimeoffset(void) | ||
64 | { | ||
65 | unsigned long ticks = TCN, offset = 0; | ||
66 | |||
67 | /* check for pending interrupt */ | ||
68 | if (ticks < (TICKS_PER_JIFFY >> 1) && (ISR & (1 << TMR_IRQ_NUM))) | ||
69 | offset = 1000000 / HZ; | ||
70 | |||
71 | ticks = (ticks * 1000000 / HZ) / TICKS_PER_JIFFY; | ||
72 | 39 | ||
73 | return ticks + offset; | 40 | void m68328_timer_init(irqreturn_t (*timer_routine) (int, void *, struct pt_regs *)); |
74 | } | 41 | void m68328_timer_tick(void); |
42 | unsigned long m68328_timer_gettimeoffset(void); | ||
43 | void m68328_timer_gettod(int *year, int *mon, int *day, int *hour, int *min, int *sec); | ||
75 | 44 | ||
76 | static void dragen2_gettod(int *year, int *mon, int *day, int *hour, | 45 | /***************************************************************************/ |
77 | int *min, int *sec) | 46 | /* Init Drangon Engine hardware */ |
78 | { | 47 | /***************************************************************************/ |
79 | long now = RTCTIME; | 48 | #if defined(CONFIG_DRAGEN2) |
80 | 49 | ||
81 | *year = *mon = *day = 1; | 50 | static void m68vz328_reset(void) |
82 | *hour = (now >> 24) % 24; | ||
83 | *min = (now >> 16) % 60; | ||
84 | *sec = now % 60; | ||
85 | } | ||
86 | |||
87 | static void dragen2_reset(void) | ||
88 | { | 51 | { |
89 | local_irq_disable(); | 52 | local_irq_disable(); |
90 | 53 | ||
@@ -103,7 +66,7 @@ static void dragen2_reset(void) | |||
103 | ); | 66 | ); |
104 | } | 67 | } |
105 | 68 | ||
106 | static void init_hardware(void) | 69 | static void init_hardware(char *command, int size) |
107 | { | 70 | { |
108 | #ifdef CONFIG_DIRECT_IO_ACCESS | 71 | #ifdef CONFIG_DIRECT_IO_ACCESS |
109 | SCR = 0x10; /* allow user access to internal registers */ | 72 | SCR = 0x10; /* allow user access to internal registers */ |
@@ -170,6 +133,60 @@ static void init_hardware(void) | |||
170 | #endif | 133 | #endif |
171 | } | 134 | } |
172 | 135 | ||
136 | /***************************************************************************/ | ||
137 | /* Init RT-Control uCdimm hardware */ | ||
138 | /***************************************************************************/ | ||
139 | #elif defined(CONFIG_UCDIMM) | ||
140 | |||
141 | static void m68vz328_reset(void) | ||
142 | { | ||
143 | local_irq_disable(); | ||
144 | asm volatile (" | ||
145 | moveal #0x10c00000, %a0; | ||
146 | moveb #0, 0xFFFFF300; | ||
147 | moveal 0(%a0), %sp; | ||
148 | moveal 4(%a0), %a0; | ||
149 | jmp (%a0); | ||
150 | "); | ||
151 | } | ||
152 | |||
153 | unsigned char *cs8900a_hwaddr; | ||
154 | static int errno; | ||
155 | |||
156 | _bsc0(char *, getserialnum) | ||
157 | _bsc1(unsigned char *, gethwaddr, int, a) | ||
158 | _bsc1(char *, getbenv, char *, a) | ||
159 | |||
160 | static void init_hardware(char *command, int size) | ||
161 | { | ||
162 | char *p; | ||
163 | |||
164 | printk(KERN_INFO "uCdimm serial string [%s]\n", getserialnum()); | ||
165 | p = cs8900a_hwaddr = gethwaddr(0); | ||
166 | printk(KERN_INFO "uCdimm hwaddr %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n", | ||
167 | p[0], p[1], p[2], p[3], p[4], p[5]); | ||
168 | p = getbenv("APPEND"); | ||
169 | if (p) | ||
170 | strcpy(p, command); | ||
171 | else | ||
172 | command[0] = 0; | ||
173 | } | ||
174 | |||
175 | /***************************************************************************/ | ||
176 | #else | ||
177 | |||
178 | static void m68vz328_reset(void) | ||
179 | { | ||
180 | } | ||
181 | |||
182 | static void init_hardware(char *command, int size) | ||
183 | { | ||
184 | } | ||
185 | |||
186 | /***************************************************************************/ | ||
187 | #endif | ||
188 | /***************************************************************************/ | ||
189 | |||
173 | void config_BSP(char *command, int size) | 190 | void config_BSP(char *command, int size) |
174 | { | 191 | { |
175 | printk(KERN_INFO "68VZ328 DragonBallVZ support (c) 2001 Lineo, Inc.\n"); | 192 | printk(KERN_INFO "68VZ328 DragonBallVZ support (c) 2001 Lineo, Inc.\n"); |
@@ -181,11 +198,13 @@ void config_BSP(char *command, int size) | |||
181 | memset(command, 0, size); | 198 | memset(command, 0, size); |
182 | #endif | 199 | #endif |
183 | 200 | ||
184 | init_hardware(); | 201 | init_hardware(command, size); |
185 | 202 | ||
186 | mach_sched_init = (void *)dragen2_sched_init; | 203 | mach_sched_init = (void *) m68328_timer_init; |
187 | mach_tick = dragen2_tick; | 204 | mach_tick = m68328_timer_tick; |
188 | mach_gettimeoffset = dragen2_gettimeoffset; | 205 | mach_gettimeoffset = m68328_timer_gettimeoffset; |
189 | mach_reset = dragen2_reset; | 206 | mach_gettod = m68328_timer_gettod; |
190 | mach_gettod = dragen2_gettod; | 207 | mach_reset = m68vz328_reset; |
191 | } | 208 | } |
209 | |||
210 | /***************************************************************************/ | ||
diff --git a/arch/m68knommu/platform/68VZ328/ucdimm/config.c b/arch/m68knommu/platform/68VZ328/ucdimm/config.c deleted file mode 100644 index 2deadaffd81e..000000000000 --- a/arch/m68knommu/platform/68VZ328/ucdimm/config.c +++ /dev/null | |||
@@ -1,117 +0,0 @@ | |||
1 | /* | ||
2 | * linux/arch/m68knommu/platform/68VZ328/ucdimm/config.c | ||
3 | * | ||
4 | * Copyright (C) 1993 Hamish Macdonald | ||
5 | * Copyright (C) 1999 D. Jeff Dionne | ||
6 | * | ||
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. | ||
10 | */ | ||
11 | |||
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> | ||
19 | |||
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> | ||
27 | |||
28 | void BSP_sched_init(void (*timer_routine)(int, void *, struct pt_regs *)) | ||
29 | { | ||
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; | ||
36 | |||
37 | request_irq(TMR_IRQ_NUM, timer_routine, IRQ_FLG_LOCK, "timer", NULL); | ||
38 | } | ||
39 | |||
40 | void BSP_tick(void) | ||
41 | { | ||
42 | /* Reset Timer1 */ | ||
43 | TSTAT &= 0; | ||
44 | } | ||
45 | |||
46 | unsigned long BSP_gettimeoffset (void) | ||
47 | { | ||
48 | return 0; | ||
49 | } | ||
50 | |||
51 | void BSP_gettod (int *yearp, int *monp, int *dayp, | ||
52 | int *hourp, int *minp, int *secp) | ||
53 | { | ||
54 | } | ||
55 | |||
56 | int BSP_hwclk(int op, struct hwclk_time *t) | ||
57 | { | ||
58 | if (!op) { | ||
59 | /* read */ | ||
60 | } else { | ||
61 | /* write */ | ||
62 | } | ||
63 | return 0; | ||
64 | } | ||
65 | |||
66 | int BSP_set_clock_mmss (unsigned long nowtime) | ||
67 | { | ||
68 | #if 0 | ||
69 | short real_seconds = nowtime % 60, real_minutes = (nowtime / 60) % 60; | ||
70 | |||
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; | ||
77 | } | ||
78 | |||
79 | void BSP_reset (void) | ||
80 | { | ||
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 | "); | ||
89 | } | ||
90 | |||
91 | unsigned char *cs8900a_hwaddr; | ||
92 | static int errno; | ||
93 | |||
94 | _bsc0(char *, getserialnum) | ||
95 | _bsc1(unsigned char *, gethwaddr, int, a) | ||
96 | _bsc1(char *, getbenv, char *, a) | ||
97 | |||
98 | void config_BSP(char *command, int len) | ||
99 | { | ||
100 | unsigned char *p; | ||
101 | |||
102 | printk(KERN_INFO "\n68VZ328 DragonBallVZ support (c) 2001 Lineo, Inc.\n"); | ||
103 | |||
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; | ||
111 | |||
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; | ||
117 | } | ||