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/types.h>
18 #include <linux/kernel.h>
20 #include <linux/tty.h>
21 #include <linux/console.h>
23 #include <linux/netdevice.h>
25 #include <asm/setup.h>
26 #include <asm/system.h>
27 #include <asm/pgtable.h>
29 #include <asm/machdep.h>
30 #include <asm/MC68VZ328.h>
31 #include <asm/bootstd.h>
33 #ifdef CONFIG_INIT_LCD
37 /***************************************************************************/
39 void m68328_timer_init(irqreturn_t (*timer_routine) (int, void *, struct pt_regs *));
40 void m68328_timer_tick(void);
41 unsigned long m68328_timer_gettimeoffset(void);
42 void m68328_timer_gettod(int *year, int *mon, int *day, int *hour, int *min, int *sec);
44 /***************************************************************************/
45 /* Init Drangon Engine hardware */
46 /***************************************************************************/
47 #if defined(CONFIG_DRAGEN2)
49 static void m68vz328_reset(void)
53 #ifdef CONFIG_INIT_LCD
54 PBDATA |= 0x20; /* disable CCFL light */
55 PKDATA |= 0x4; /* disable LCD controller */
61 "moveal #0x04000000, %a0\n\t"
62 "moveal 0(%a0), %sp\n\t"
63 "moveal 4(%a0), %a0\n\t"
68 static void init_hardware(char *command, int size)
70 #ifdef CONFIG_DIRECT_IO_ACCESS
71 SCR = 0x10; /* allow user access to internal registers */
79 /* PK3: hardware sleep function pin, active low */
80 PKSEL |= PK(3); /* select pin as I/O */
81 PKDIR |= PK(3); /* select pin as output */
82 PKDATA |= PK(3); /* set pin high */
84 /* PF5: hardware reset function pin, active high */
85 PFSEL |= PF(5); /* select pin as I/O */
86 PFDIR |= PF(5); /* select pin as output */
87 PFDATA &= ~PF(5); /* set pin low */
89 /* cs8900 hardware reset */
91 { int i; for (i = 0; i < 32000; ++i); }
94 /* INT1 enable (cs8900 IRQ) */
95 PDPOL &= ~PD(1); /* active high signal */
97 PDIRQEN |= PD(1); /* IRQ enabled */
99 #ifdef CONFIG_68328_SERIAL_UART2
100 /* Enable RXD TXD port bits to enable UART2 */
101 PJSEL &= ~(PJ(5) | PJ(4));
104 #ifdef CONFIG_INIT_LCD
105 /* initialize LCD controller */
106 LSSA = (long) screen_bits;
118 /* Enable LCD controller */
123 /* Enable CCFL backlighting circuit */
128 /* contrast control register */
135 /***************************************************************************/
136 /* Init RT-Control uCdimm hardware */
137 /***************************************************************************/
138 #elif defined(CONFIG_UCDIMM)
140 static void m68vz328_reset(void)
144 "moveal #0x10c00000, %a0;\n\t"
145 "moveb #0, 0xFFFFF300;\n\t"
146 "moveal 0(%a0), %sp;\n\t"
147 "moveal 4(%a0), %a0;\n\t"
152 unsigned char *cs8900a_hwaddr;
155 _bsc0(char *, getserialnum)
156 _bsc1(unsigned char *, gethwaddr, int, a)
157 _bsc1(char *, getbenv, char *, a)
159 static void init_hardware(char *command, int size)
163 printk(KERN_INFO "uCdimm serial string [%s]\n", getserialnum());
164 p = cs8900a_hwaddr = gethwaddr(0);
165 printk(KERN_INFO "uCdimm hwaddr %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n",
166 p[0], p[1], p[2], p[3], p[4], p[5]);
167 p = getbenv("APPEND");
174 /***************************************************************************/
177 static void m68vz328_reset(void)
181 static void init_hardware(char *command, int size)
185 /***************************************************************************/
187 /***************************************************************************/
189 void config_BSP(char *command, int size)
191 printk(KERN_INFO "68VZ328 DragonBallVZ support (c) 2001 Lineo, Inc.\n");
193 #if defined(CONFIG_BOOTPARAM)
194 strncpy(command, CONFIG_BOOTPARAM_STRING, size);
197 memset(command, 0, size);
200 init_hardware(command, size);
202 mach_sched_init = (void *) m68328_timer_init;
203 mach_tick = m68328_timer_tick;
204 mach_gettimeoffset = m68328_timer_gettimeoffset;
205 mach_gettod = m68328_timer_gettod;
206 mach_reset = m68vz328_reset;
209 /***************************************************************************/