aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m68knommu/platform/68VZ328
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /arch/m68knommu/platform/68VZ328
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'arch/m68knommu/platform/68VZ328')
-rw-r--r--arch/m68knommu/platform/68VZ328/Makefile16
-rw-r--r--arch/m68knommu/platform/68VZ328/de2/config.c191
-rw-r--r--arch/m68knommu/platform/68VZ328/ucdimm/config.c117
3 files changed, 324 insertions, 0 deletions
diff --git a/arch/m68knommu/platform/68VZ328/Makefile b/arch/m68knommu/platform/68VZ328/Makefile
new file mode 100644
index 000000000000..447ffa0fd7c7
--- /dev/null
+++ b/arch/m68knommu/platform/68VZ328/Makefile
@@ -0,0 +1,16 @@
1#
2# Makefile for arch/m68knommu/platform/68VZ328.
3#
4
5obj-y := config.o
6logo-$(UCDIMM) := bootlogo.rh
7logo-$(DRAGEN2) := screen.h
8extra-y := $(logo-y)
9
10$(obj)/bootlogo.rh: $(src)/../68EZ328/bootlogo.h
11 perl $(src)/bootlogo.pl < $(src)/../68328/bootlogo.h > $(obj)/bootlogo.rh
12
13$(obj)/screen.h: $(src)/screen.xbm $(src)/xbm2lcd.pl
14 perl $(src)/xbm2lcd.pl < $(src)/screen.xbm > $(obj)/screen.h
15
16clean-files := $(obj)/screen.h $(obj)/bootlogo.rh
diff --git a/arch/m68knommu/platform/68VZ328/de2/config.c b/arch/m68knommu/platform/68VZ328/de2/config.c
new file mode 100644
index 000000000000..d0586197f113
--- /dev/null
+++ b/arch/m68knommu/platform/68VZ328/de2/config.c
@@ -0,0 +1,191 @@
1/*
2 * linux/arch/m68knommu/platform/MC68VZ328/de2/config.c
3 *
4 * Copyright (C) 1993 Hamish Macdonald
5 * Copyright (C) 1999 D. Jeff Dionne
6 * Copyright (C) 2001 Georges Menie, Ken Desmet
7 *
8 * This file is subject to the terms and conditions of the GNU General Public
9 * License. See the file COPYING in the main directory of this archive
10 * for more details.
11 */
12
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#include <linux/kd.h>
20#include <linux/netdevice.h>
21
22#include <asm/setup.h>
23#include <asm/system.h>
24#include <asm/pgtable.h>
25#include <asm/irq.h>
26#include <asm/machdep.h>
27#include <asm/MC68VZ328.h>
28
29#ifdef CONFIG_INIT_LCD
30#include "screen.h"
31#endif
32
33/* with a 33.16 MHz clock, this will give usec resolution to the time functions */
34#define CLOCK_SOURCE TCTL_CLKSOURCE_SYSCLK
35#define CLOCK_PRE 7
36#define TICKS_PER_JIFFY 41450
37
38static void
39dragen2_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
57static void dragen2_tick(void)
58{
59 /* Reset Timer1 */
60 TSTAT &= 0;
61}
62
63static 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
73 return ticks + offset;
74}
75
76static void dragen2_gettod(int *year, int *mon, int *day, int *hour,
77 int *min, int *sec)
78{
79 long now = RTCTIME;
80
81 *year = *mon = *day = 1;
82 *hour = (now >> 24) % 24;
83 *min = (now >> 16) % 60;
84 *sec = now % 60;
85}
86
87static void dragen2_reset(void)
88{
89 local_irq_disable();
90
91#ifdef CONFIG_INIT_LCD
92 PBDATA |= 0x20; /* disable CCFL light */
93 PKDATA |= 0x4; /* disable LCD controller */
94 LCKCON = 0;
95#endif
96
97 __asm__ __volatile__(
98 "reset\n\t"
99 "moveal #0x04000000, %a0\n\t"
100 "moveal 0(%a0), %sp\n\t"
101 "moveal 4(%a0), %a0\n\t"
102 "jmp (%a0)"
103 );
104}
105
106static void init_hardware(void)
107{
108#ifdef CONFIG_DIRECT_IO_ACCESS
109 SCR = 0x10; /* allow user access to internal registers */
110#endif
111
112 /* CSGB Init */
113 CSGBB = 0x4000;
114 CSB = 0x1a1;
115
116 /* CS8900 init */
117 /* PK3: hardware sleep function pin, active low */
118 PKSEL |= PK(3); /* select pin as I/O */
119 PKDIR |= PK(3); /* select pin as output */
120 PKDATA |= PK(3); /* set pin high */
121
122 /* PF5: hardware reset function pin, active high */
123 PFSEL |= PF(5); /* select pin as I/O */
124 PFDIR |= PF(5); /* select pin as output */
125 PFDATA &= ~PF(5); /* set pin low */
126
127 /* cs8900 hardware reset */
128 PFDATA |= PF(5);
129 { int i; for (i = 0; i < 32000; ++i); }
130 PFDATA &= ~PF(5);
131
132 /* INT1 enable (cs8900 IRQ) */
133 PDPOL &= ~PD(1); /* active high signal */
134 PDIQEG &= ~PD(1);
135 PDIRQEN |= PD(1); /* IRQ enabled */
136
137#ifdef CONFIG_68328_SERIAL_UART2
138 /* Enable RXD TXD port bits to enable UART2 */
139 PJSEL &= ~(PJ(5) | PJ(4));
140#endif
141
142#ifdef CONFIG_INIT_LCD
143 /* initialize LCD controller */
144 LSSA = (long) screen_bits;
145 LVPW = 0x14;
146 LXMAX = 0x140;
147 LYMAX = 0xef;
148 LRRA = 0;
149 LPXCD = 3;
150 LPICF = 0x08;
151 LPOLCF = 0;
152 LCKCON = 0x80;
153 PCPDEN = 0xff;
154 PCSEL = 0;
155
156 /* Enable LCD controller */
157 PKDIR |= 0x4;
158 PKSEL |= 0x4;
159 PKDATA &= ~0x4;
160
161 /* Enable CCFL backlighting circuit */
162 PBDIR |= 0x20;
163 PBSEL |= 0x20;
164 PBDATA &= ~0x20;
165
166 /* contrast control register */
167 PFDIR |= 0x1;
168 PFSEL &= ~0x1;
169 PWMR = 0x037F;
170#endif
171}
172
173void config_BSP(char *command, int size)
174{
175 printk(KERN_INFO "68VZ328 DragonBallVZ support (c) 2001 Lineo, Inc.\n");
176
177#if defined(CONFIG_BOOTPARAM)
178 strncpy(command, CONFIG_BOOTPARAM_STRING, size);
179 command[size-1] = 0;
180#else
181 memset(command, 0, size);
182#endif
183
184 init_hardware();
185
186 mach_sched_init = (void *)dragen2_sched_init;
187 mach_tick = dragen2_tick;
188 mach_gettimeoffset = dragen2_gettimeoffset;
189 mach_reset = dragen2_reset;
190 mach_gettod = dragen2_gettod;
191}
diff --git a/arch/m68knommu/platform/68VZ328/ucdimm/config.c b/arch/m68knommu/platform/68VZ328/ucdimm/config.c
new file mode 100644
index 000000000000..2deadaffd81e
--- /dev/null
+++ b/arch/m68knommu/platform/68VZ328/ucdimm/config.c
@@ -0,0 +1,117 @@
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
28void 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
40void BSP_tick(void)
41{
42 /* Reset Timer1 */
43 TSTAT &= 0;
44}
45
46unsigned long BSP_gettimeoffset (void)
47{
48 return 0;
49}
50
51void BSP_gettod (int *yearp, int *monp, int *dayp,
52 int *hourp, int *minp, int *secp)
53{
54}
55
56int BSP_hwclk(int op, struct hwclk_time *t)
57{
58 if (!op) {
59 /* read */
60 } else {
61 /* write */
62 }
63 return 0;
64}
65
66int 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
79void 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
91unsigned char *cs8900a_hwaddr;
92static int errno;
93
94_bsc0(char *, getserialnum)
95_bsc1(unsigned char *, gethwaddr, int, a)
96_bsc1(char *, getbenv, char *, a)
97
98void 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}