[ARM] Support register switch in nommu mode
[linux-2.6/verdex.git] / arch / m68knommu / platform / 68VZ328 / config.c
blobd926524cdf82632e9b456996a61406694fbf3fea
1 /***************************************************************************/
3 /*
4 * linux/arch/m68knommu/platform/68VZ328/config.c
6 * Copyright (C) 1993 Hamish Macdonald
7 * Copyright (C) 1999 D. Jeff Dionne
8 * Copyright (C) 2001 Georges Menie, Ken Desmet
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.
15 /***************************************************************************/
17 #include <linux/config.h>
18 #include <linux/types.h>
19 #include <linux/kernel.h>
20 #include <linux/mm.h>
21 #include <linux/tty.h>
22 #include <linux/console.h>
23 #include <linux/kd.h>
24 #include <linux/netdevice.h>
26 #include <asm/setup.h>
27 #include <asm/system.h>
28 #include <asm/pgtable.h>
29 #include <asm/irq.h>
30 #include <asm/machdep.h>
31 #include <asm/MC68VZ328.h>
32 #include <asm/bootstd.h>
34 #ifdef CONFIG_INIT_LCD
35 #include "bootlogo.h"
36 #endif
38 /***************************************************************************/
40 void m68328_timer_init(irqreturn_t (*timer_routine) (int, void *, struct pt_regs *));
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);
45 /***************************************************************************/
46 /* Init Drangon Engine hardware */
47 /***************************************************************************/
48 #if defined(CONFIG_DRAGEN2)
50 static void m68vz328_reset(void)
52 local_irq_disable();
54 #ifdef CONFIG_INIT_LCD
55 PBDATA |= 0x20; /* disable CCFL light */
56 PKDATA |= 0x4; /* disable LCD controller */
57 LCKCON = 0;
58 #endif
60 __asm__ __volatile__(
61 "reset\n\t"
62 "moveal #0x04000000, %a0\n\t"
63 "moveal 0(%a0), %sp\n\t"
64 "moveal 4(%a0), %a0\n\t"
65 "jmp (%a0)"
69 static void init_hardware(char *command, int size)
71 #ifdef CONFIG_DIRECT_IO_ACCESS
72 SCR = 0x10; /* allow user access to internal registers */
73 #endif
75 /* CSGB Init */
76 CSGBB = 0x4000;
77 CSB = 0x1a1;
79 /* CS8900 init */
80 /* PK3: hardware sleep function pin, active low */
81 PKSEL |= PK(3); /* select pin as I/O */
82 PKDIR |= PK(3); /* select pin as output */
83 PKDATA |= PK(3); /* set pin high */
85 /* PF5: hardware reset function pin, active high */
86 PFSEL |= PF(5); /* select pin as I/O */
87 PFDIR |= PF(5); /* select pin as output */
88 PFDATA &= ~PF(5); /* set pin low */
90 /* cs8900 hardware reset */
91 PFDATA |= PF(5);
92 { int i; for (i = 0; i < 32000; ++i); }
93 PFDATA &= ~PF(5);
95 /* INT1 enable (cs8900 IRQ) */
96 PDPOL &= ~PD(1); /* active high signal */
97 PDIQEG &= ~PD(1);
98 PDIRQEN |= PD(1); /* IRQ enabled */
100 #ifdef CONFIG_68328_SERIAL_UART2
101 /* Enable RXD TXD port bits to enable UART2 */
102 PJSEL &= ~(PJ(5) | PJ(4));
103 #endif
105 #ifdef CONFIG_INIT_LCD
106 /* initialize LCD controller */
107 LSSA = (long) screen_bits;
108 LVPW = 0x14;
109 LXMAX = 0x140;
110 LYMAX = 0xef;
111 LRRA = 0;
112 LPXCD = 3;
113 LPICF = 0x08;
114 LPOLCF = 0;
115 LCKCON = 0x80;
116 PCPDEN = 0xff;
117 PCSEL = 0;
119 /* Enable LCD controller */
120 PKDIR |= 0x4;
121 PKSEL |= 0x4;
122 PKDATA &= ~0x4;
124 /* Enable CCFL backlighting circuit */
125 PBDIR |= 0x20;
126 PBSEL |= 0x20;
127 PBDATA &= ~0x20;
129 /* contrast control register */
130 PFDIR |= 0x1;
131 PFSEL &= ~0x1;
132 PWMR = 0x037F;
133 #endif
136 /***************************************************************************/
137 /* Init RT-Control uCdimm hardware */
138 /***************************************************************************/
139 #elif defined(CONFIG_UCDIMM)
141 static void m68vz328_reset(void)
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);
153 unsigned char *cs8900a_hwaddr;
154 static int errno;
156 _bsc0(char *, getserialnum)
157 _bsc1(unsigned char *, gethwaddr, int, a)
158 _bsc1(char *, getbenv, char *, a)
160 static void init_hardware(char *command, int size)
162 char *p;
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;
175 /***************************************************************************/
176 #else
178 static void m68vz328_reset(void)
182 static void init_hardware(char *command, int size)
186 /***************************************************************************/
187 #endif
188 /***************************************************************************/
190 void config_BSP(char *command, int size)
192 printk(KERN_INFO "68VZ328 DragonBallVZ support (c) 2001 Lineo, Inc.\n");
194 #if defined(CONFIG_BOOTPARAM)
195 strncpy(command, CONFIG_BOOTPARAM_STRING, size);
196 command[size-1] = 0;
197 #else
198 memset(command, 0, size);
199 #endif
201 init_hardware(command, size);
203 mach_sched_init = (void *) m68328_timer_init;
204 mach_tick = m68328_timer_tick;
205 mach_gettimeoffset = m68328_timer_gettimeoffset;
206 mach_gettod = m68328_timer_gettod;
207 mach_reset = m68vz328_reset;
210 /***************************************************************************/