aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m68k/platform/68VZ328/config.c
diff options
context:
space:
mode:
authorGreg Ungerer <gerg@uclinux.org>2011-03-21 23:39:27 -0400
committerGreg Ungerer <gerg@uclinux.org>2011-03-25 00:05:13 -0400
commit66d857b08b8c3ed5c72c361f863cce77d2a978d7 (patch)
tree47222d86f4d78dc0da31baf64188bd2e4b38ac1e /arch/m68k/platform/68VZ328/config.c
parentd39dd11c3e6a7af5c20bfac40594db36cf270f42 (diff)
m68k: merge m68k and m68knommu arch directories
There is a lot of common code that could be shared between the m68k and m68knommu arch branches. It makes sense to merge the two branches into a single directory structure so that we can more easily share that common code. This is a brute force merge, based on a script from Stephen King <sfking@fdwdc.com>, which was originally written by Arnd Bergmann <arnd@arndb.de>. > The script was inspired by the script Sam Ravnborg used to merge the > includes from m68knommu. For those files common to both arches but > differing in content, the m68k version of the file is renamed to > <file>_mm.<ext> and the m68knommu version of the file is moved into the > corresponding m68k directory and renamed <file>_no.<ext> and a small > wrapper file <file>.<ext> is used to select between the two version. Files > that are common to both but don't differ are removed from the m68knommu > tree and files and directories that are unique to the m68knommu tree are > moved to the m68k tree. Finally, the arch/m68knommu tree is removed. > > To select between the the versions of the files, the wrapper uses > > #ifdef CONFIG_MMU > #include <file>_mm.<ext> > #else > #include <file>_no.<ext> > #endif On top of this file merge I have done a simplistic merge of m68k and m68knommu Kconfig, which primarily attempts to keep existing options and menus in place. Other than a handful of options being moved it produces identical .config outputs on m68k and m68knommu targets I tested it on. With this in place there is now quite a bit of scope for merge cleanups in future patches. Signed-off-by: Greg Ungerer <gerg@uclinux.org>
Diffstat (limited to 'arch/m68k/platform/68VZ328/config.c')
-rw-r--r--arch/m68k/platform/68VZ328/config.c188
1 files changed, 188 insertions, 0 deletions
diff --git a/arch/m68k/platform/68VZ328/config.c b/arch/m68k/platform/68VZ328/config.c
new file mode 100644
index 000000000000..eabaabe8af36
--- /dev/null
+++ b/arch/m68k/platform/68VZ328/config.c
@@ -0,0 +1,188 @@
1/***************************************************************************/
2
3/*
4 * linux/arch/m68knommu/platform/68VZ328/config.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/types.h>
18#include <linux/kernel.h>
19#include <linux/kd.h>
20#include <linux/netdevice.h>
21#include <linux/interrupt.h>
22#include <linux/irq.h>
23
24#include <asm/system.h>
25#include <asm/pgtable.h>
26#include <asm/machdep.h>
27#include <asm/MC68VZ328.h>
28#include <asm/bootstd.h>
29
30#ifdef CONFIG_INIT_LCD
31#include "bootlogo.h"
32#endif
33
34/***************************************************************************/
35
36void m68328_timer_gettod(int *year, int *mon, int *day, int *hour, int *min, int *sec);
37
38/***************************************************************************/
39/* Init Drangon Engine hardware */
40/***************************************************************************/
41#if defined(CONFIG_DRAGEN2)
42
43static void m68vz328_reset(void)
44{
45 local_irq_disable();
46
47#ifdef CONFIG_INIT_LCD
48 PBDATA |= 0x20; /* disable CCFL light */
49 PKDATA |= 0x4; /* disable LCD controller */
50 LCKCON = 0;
51#endif
52
53 __asm__ __volatile__(
54 "reset\n\t"
55 "moveal #0x04000000, %a0\n\t"
56 "moveal 0(%a0), %sp\n\t"
57 "moveal 4(%a0), %a0\n\t"
58 "jmp (%a0)"
59 );
60}
61
62static void init_hardware(char *command, int size)
63{
64#ifdef CONFIG_DIRECT_IO_ACCESS
65 SCR = 0x10; /* allow user access to internal registers */
66#endif
67
68 /* CSGB Init */
69 CSGBB = 0x4000;
70 CSB = 0x1a1;
71
72 /* CS8900 init */
73 /* PK3: hardware sleep function pin, active low */
74 PKSEL |= PK(3); /* select pin as I/O */
75 PKDIR |= PK(3); /* select pin as output */
76 PKDATA |= PK(3); /* set pin high */
77
78 /* PF5: hardware reset function pin, active high */
79 PFSEL |= PF(5); /* select pin as I/O */
80 PFDIR |= PF(5); /* select pin as output */
81 PFDATA &= ~PF(5); /* set pin low */
82
83 /* cs8900 hardware reset */
84 PFDATA |= PF(5);
85 { int i; for (i = 0; i < 32000; ++i); }
86 PFDATA &= ~PF(5);
87
88 /* INT1 enable (cs8900 IRQ) */
89 PDPOL &= ~PD(1); /* active high signal */
90 PDIQEG &= ~PD(1);
91 PDIRQEN |= PD(1); /* IRQ enabled */
92
93#ifdef CONFIG_INIT_LCD
94 /* initialize LCD controller */
95 LSSA = (long) screen_bits;
96 LVPW = 0x14;
97 LXMAX = 0x140;
98 LYMAX = 0xef;
99 LRRA = 0;
100 LPXCD = 3;
101 LPICF = 0x08;
102 LPOLCF = 0;
103 LCKCON = 0x80;
104 PCPDEN = 0xff;
105 PCSEL = 0;
106
107 /* Enable LCD controller */
108 PKDIR |= 0x4;
109 PKSEL |= 0x4;
110 PKDATA &= ~0x4;
111
112 /* Enable CCFL backlighting circuit */
113 PBDIR |= 0x20;
114 PBSEL |= 0x20;
115 PBDATA &= ~0x20;
116
117 /* contrast control register */
118 PFDIR |= 0x1;
119 PFSEL &= ~0x1;
120 PWMR = 0x037F;
121#endif
122}
123
124/***************************************************************************/
125/* Init RT-Control uCdimm hardware */
126/***************************************************************************/
127#elif defined(CONFIG_UCDIMM)
128
129static void m68vz328_reset(void)
130{
131 local_irq_disable();
132 asm volatile (
133 "moveal #0x10c00000, %a0;\n\t"
134 "moveb #0, 0xFFFFF300;\n\t"
135 "moveal 0(%a0), %sp;\n\t"
136 "moveal 4(%a0), %a0;\n\t"
137 "jmp (%a0);\n"
138 );
139}
140
141unsigned char *cs8900a_hwaddr;
142static int errno;
143
144_bsc0(char *, getserialnum)
145_bsc1(unsigned char *, gethwaddr, int, a)
146_bsc1(char *, getbenv, char *, a)
147
148static void init_hardware(char *command, int size)
149{
150 char *p;
151
152 printk(KERN_INFO "uCdimm serial string [%s]\n", getserialnum());
153 p = cs8900a_hwaddr = gethwaddr(0);
154 printk(KERN_INFO "uCdimm hwaddr %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n",
155 p[0], p[1], p[2], p[3], p[4], p[5]);
156 p = getbenv("APPEND");
157 if (p)
158 strcpy(p, command);
159 else
160 command[0] = 0;
161}
162
163/***************************************************************************/
164#else
165
166static void m68vz328_reset(void)
167{
168}
169
170static void init_hardware(char *command, int size)
171{
172}
173
174/***************************************************************************/
175#endif
176/***************************************************************************/
177
178void config_BSP(char *command, int size)
179{
180 printk(KERN_INFO "68VZ328 DragonBallVZ support (c) 2001 Lineo, Inc.\n");
181
182 init_hardware(command, size);
183
184 mach_gettod = m68328_timer_gettod;
185 mach_reset = m68vz328_reset;
186}
187
188/***************************************************************************/