1 /***************************************************************************/
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
15 /***************************************************************************/
17 #include <linux/config.h>
18 #include <linux/types.h>
19 #include <linux/kernel.h>
21 #include <linux/tty.h>
22 #include <linux/console.h>
24 #include <linux/netdevice.h>
26 #include <asm/setup.h>
27 #include <asm/system.h>
28 #include <asm/pgtable.h>
30 #include <asm/machdep.h>
31 #include <asm/MC68VZ328.h>
32 #include <asm/bootstd.h>
34 #ifdef CONFIG_INIT_LCD
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)
54 #ifdef CONFIG_INIT_LCD
55 PBDATA |= 0x20; /* disable CCFL light */
56 PKDATA |= 0x4; /* disable LCD controller */
62 "moveal #0x04000000, %a0\n\t"
63 "moveal 0(%a0), %sp\n\t"
64 "moveal 4(%a0), %a0\n\t"
69 static void init_hardware(char *command, int size)
71 #ifdef CONFIG_DIRECT_IO_ACCESS
72 SCR = 0x10; /* allow user access to internal registers */
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 */
92 { int i; for (i = 0; i < 32000; ++i); }
95 /* INT1 enable (cs8900 IRQ) */
96 PDPOL &= ~PD(1); /* active high signal */
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));
105 #ifdef CONFIG_INIT_LCD
106 /* initialize LCD controller */
107 LSSA = (long) screen_bits;
119 /* Enable LCD controller */
124 /* Enable CCFL backlighting circuit */
129 /* contrast control register */
136 /***************************************************************************/
137 /* Init RT-Control uCdimm hardware */
138 /***************************************************************************/
139 #elif defined(CONFIG_UCDIMM)
141 static void m68vz328_reset(void)
145 moveal #0x10c00000, %a0;
146 moveb #0, 0xFFFFF300;
153 unsigned char *cs8900a_hwaddr;
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)
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");
175 /***************************************************************************/
178 static void m68vz328_reset(void)
182 static void init_hardware(char *command, int size)
186 /***************************************************************************/
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);
198 memset(command, 0, size);
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 /***************************************************************************/