diff options
Diffstat (limited to 'arch/ppc')
-rw-r--r-- | arch/ppc/8xx_io/cs4218_tdm.c | 1 | ||||
-rw-r--r-- | arch/ppc/Kconfig | 9 | ||||
-rw-r--r-- | arch/ppc/boot/simple/Makefile | 4 | ||||
-rw-r--r-- | arch/ppc/boot/simple/misc.c | 15 | ||||
-rw-r--r-- | arch/ppc/configs/gemini_defconfig | 618 | ||||
-rw-r--r-- | arch/ppc/kernel/Makefile | 1 | ||||
-rw-r--r-- | arch/ppc/kernel/dma-mapping.c | 442 | ||||
-rw-r--r-- | arch/ppc/kernel/head.S | 18 | ||||
-rw-r--r-- | arch/ppc/kernel/ppc_ksyms.c | 1 | ||||
-rw-r--r-- | arch/ppc/lib/rheap.c | 3 | ||||
-rw-r--r-- | arch/ppc/mm/pgtable.c | 5 | ||||
-rw-r--r-- | arch/ppc/platforms/Makefile | 1 | ||||
-rw-r--r-- | arch/ppc/platforms/gemini.h | 165 | ||||
-rw-r--r-- | arch/ppc/platforms/gemini_pci.c | 41 | ||||
-rw-r--r-- | arch/ppc/platforms/gemini_prom.S | 90 | ||||
-rw-r--r-- | arch/ppc/platforms/gemini_serial.h | 40 | ||||
-rw-r--r-- | arch/ppc/platforms/gemini_setup.c | 577 | ||||
-rw-r--r-- | arch/ppc/platforms/mpc866ads_setup.c | 2 | ||||
-rw-r--r-- | arch/ppc/syslib/Makefile | 1 | ||||
-rw-r--r-- | arch/ppc/syslib/m8260_pci_erratum9.c | 3 | ||||
-rw-r--r-- | arch/ppc/syslib/m8xx_setup.c | 2 | ||||
-rw-r--r-- | arch/ppc/syslib/ppc85xx_rio.c | 2 | ||||
-rw-r--r-- | arch/ppc/xmon/ppc-opc.c | 7 | ||||
-rw-r--r-- | arch/ppc/xmon/start.c | 5 |
24 files changed, 13 insertions, 2040 deletions
diff --git a/arch/ppc/8xx_io/cs4218_tdm.c b/arch/ppc/8xx_io/cs4218_tdm.c index b7bb5f0b3c5f..684ed04eb8b8 100644 --- a/arch/ppc/8xx_io/cs4218_tdm.c +++ b/arch/ppc/8xx_io/cs4218_tdm.c | |||
@@ -1379,7 +1379,6 @@ static void cs_nosound(unsigned long xx) | |||
1379 | } | 1379 | } |
1380 | 1380 | ||
1381 | static DEFINE_TIMER(beep_timer, cs_nosound, 0, 0); | 1381 | static DEFINE_TIMER(beep_timer, cs_nosound, 0, 0); |
1382 | }; | ||
1383 | 1382 | ||
1384 | static void cs_mksound(unsigned int hz, unsigned int ticks) | 1383 | static void cs_mksound(unsigned int hz, unsigned int ticks) |
1385 | { | 1384 | { |
diff --git a/arch/ppc/Kconfig b/arch/ppc/Kconfig index 8eb82efe05a1..c22e60619d9b 100644 --- a/arch/ppc/Kconfig +++ b/arch/ppc/Kconfig | |||
@@ -670,15 +670,6 @@ config RADSTONE_PPC7D | |||
670 | config PAL4 | 670 | config PAL4 |
671 | bool "SBS-Palomar4" | 671 | bool "SBS-Palomar4" |
672 | 672 | ||
673 | config GEMINI | ||
674 | bool "Synergy-Gemini" | ||
675 | depends on BROKEN | ||
676 | select PPC_INDIRECT_PCI | ||
677 | help | ||
678 | Select Gemini if configuring for a Synergy Microsystems' Gemini | ||
679 | series Single Board Computer. More information is available at: | ||
680 | <http://www.synergymicro.com/PressRel/97_10_15.html>. | ||
681 | |||
682 | config EST8260 | 673 | config EST8260 |
683 | bool "EST8260" | 674 | bool "EST8260" |
684 | ---help--- | 675 | ---help--- |
diff --git a/arch/ppc/boot/simple/Makefile b/arch/ppc/boot/simple/Makefile index 28be01b99c44..bcfb6cde70c4 100644 --- a/arch/ppc/boot/simple/Makefile +++ b/arch/ppc/boot/simple/Makefile | |||
@@ -116,10 +116,6 @@ zimageinitrd-$(CONFIG_WALNUT) := zImage.initrd-TREE | |||
116 | extra.o-$(CONFIG_CHESTNUT) := misc-chestnut.o | 116 | extra.o-$(CONFIG_CHESTNUT) := misc-chestnut.o |
117 | end-$(CONFIG_CHESTNUT) := chestnut | 117 | end-$(CONFIG_CHESTNUT) := chestnut |
118 | 118 | ||
119 | zimage-$(CONFIG_GEMINI) := zImage-STRIPELF | ||
120 | zimageinitrd-$(CONFIG_GEMINI) := zImage.initrd-STRIPELF | ||
121 | end-$(CONFIG_GEMINI) := gemini | ||
122 | |||
123 | extra.o-$(CONFIG_KATANA) := misc-katana.o | 119 | extra.o-$(CONFIG_KATANA) := misc-katana.o |
124 | end-$(CONFIG_KATANA) := katana | 120 | end-$(CONFIG_KATANA) := katana |
125 | cacheflag-$(CONFIG_KATANA) := -include $(clear_L2_L3) | 121 | cacheflag-$(CONFIG_KATANA) := -include $(clear_L2_L3) |
diff --git a/arch/ppc/boot/simple/misc.c b/arch/ppc/boot/simple/misc.c index a5df08963695..c3d3305eb5ca 100644 --- a/arch/ppc/boot/simple/misc.c +++ b/arch/ppc/boot/simple/misc.c | |||
@@ -42,14 +42,11 @@ | |||
42 | #endif | 42 | #endif |
43 | 43 | ||
44 | /* Will / Can the user give input? | 44 | /* Will / Can the user give input? |
45 | * Val Henson has requested that Gemini doesn't wait for the | ||
46 | * user to edit the cmdline or not. | ||
47 | */ | 45 | */ |
48 | #if (defined(CONFIG_SERIAL_8250_CONSOLE) \ | 46 | #if (defined(CONFIG_SERIAL_8250_CONSOLE) \ |
49 | || defined(CONFIG_VGA_CONSOLE) \ | 47 | || defined(CONFIG_VGA_CONSOLE) \ |
50 | || defined(CONFIG_SERIAL_MPC52xx_CONSOLE) \ | 48 | || defined(CONFIG_SERIAL_MPC52xx_CONSOLE) \ |
51 | || defined(CONFIG_SERIAL_MPSC_CONSOLE)) \ | 49 | || defined(CONFIG_SERIAL_MPSC_CONSOLE)) |
52 | && !defined(CONFIG_GEMINI) | ||
53 | #define INTERACTIVE_CONSOLE 1 | 50 | #define INTERACTIVE_CONSOLE 1 |
54 | #endif | 51 | #endif |
55 | 52 | ||
@@ -178,16 +175,6 @@ decompress_kernel(unsigned long load_addr, int num_words, unsigned long cksum) | |||
178 | 175 | ||
179 | if (keyb_present) | 176 | if (keyb_present) |
180 | CRT_tstc(); /* Forces keyboard to be initialized */ | 177 | CRT_tstc(); /* Forces keyboard to be initialized */ |
181 | #ifdef CONFIG_GEMINI | ||
182 | /* | ||
183 | * If cmd_line is empty and cmd_preset is not, copy cmd_preset | ||
184 | * to cmd_line. This way we can override cmd_preset with the | ||
185 | * command line from Smon. | ||
186 | */ | ||
187 | |||
188 | if ( (cmd_line[0] == '\0') && (cmd_preset[0] != '\0')) | ||
189 | memcpy (cmd_line, cmd_preset, sizeof(cmd_preset)); | ||
190 | #endif | ||
191 | 178 | ||
192 | /* Display standard Linux/PPC boot prompt for kernel args */ | 179 | /* Display standard Linux/PPC boot prompt for kernel args */ |
193 | puts("\nLinux/PPC load: "); | 180 | puts("\nLinux/PPC load: "); |
diff --git a/arch/ppc/configs/gemini_defconfig b/arch/ppc/configs/gemini_defconfig deleted file mode 100644 index ebcd17b097f1..000000000000 --- a/arch/ppc/configs/gemini_defconfig +++ /dev/null | |||
@@ -1,618 +0,0 @@ | |||
1 | # | ||
2 | # Automatically generated make config: don't edit | ||
3 | # | ||
4 | CONFIG_MMU=y | ||
5 | CONFIG_RWSEM_XCHGADD_ALGORITHM=y | ||
6 | CONFIG_HAVE_DEC_LOCK=y | ||
7 | |||
8 | # | ||
9 | # Code maturity level options | ||
10 | # | ||
11 | CONFIG_EXPERIMENTAL=y | ||
12 | |||
13 | # | ||
14 | # General setup | ||
15 | # | ||
16 | CONFIG_SWAP=y | ||
17 | CONFIG_SYSVIPC=y | ||
18 | # CONFIG_BSD_PROCESS_ACCT is not set | ||
19 | CONFIG_SYSCTL=y | ||
20 | CONFIG_LOG_BUF_SHIFT=14 | ||
21 | # CONFIG_EMBEDDED is not set | ||
22 | CONFIG_FUTEX=y | ||
23 | CONFIG_EPOLL=y | ||
24 | |||
25 | # | ||
26 | # Loadable module support | ||
27 | # | ||
28 | CONFIG_MODULES=y | ||
29 | CONFIG_MODULE_UNLOAD=y | ||
30 | # CONFIG_MODULE_FORCE_UNLOAD is not set | ||
31 | CONFIG_OBSOLETE_MODPARM=y | ||
32 | # CONFIG_MODVERSIONS is not set | ||
33 | CONFIG_KMOD=y | ||
34 | |||
35 | # | ||
36 | # Platform support | ||
37 | # | ||
38 | CONFIG_PPC=y | ||
39 | CONFIG_PPC32=y | ||
40 | CONFIG_6xx=y | ||
41 | # CONFIG_40x is not set | ||
42 | # CONFIG_POWER3 is not set | ||
43 | # CONFIG_8xx is not set | ||
44 | |||
45 | # | ||
46 | # IBM 4xx options | ||
47 | # | ||
48 | # CONFIG_8260 is not set | ||
49 | CONFIG_GENERIC_ISA_DMA=y | ||
50 | CONFIG_PPC_STD_MMU=y | ||
51 | # CONFIG_PPC_MULTIPLATFORM is not set | ||
52 | # CONFIG_APUS is not set | ||
53 | # CONFIG_WILLOW_2 is not set | ||
54 | # CONFIG_PCORE is not set | ||
55 | # CONFIG_POWERPMC250 is not set | ||
56 | # CONFIG_EV64260 is not set | ||
57 | # CONFIG_SPRUCE is not set | ||
58 | # CONFIG_LOPEC is not set | ||
59 | # CONFIG_MCPN765 is not set | ||
60 | # CONFIG_MVME5100 is not set | ||
61 | # CONFIG_PPLUS is not set | ||
62 | # CONFIG_PRPMC750 is not set | ||
63 | # CONFIG_PRPMC800 is not set | ||
64 | # CONFIG_SANDPOINT is not set | ||
65 | # CONFIG_ADIR is not set | ||
66 | # CONFIG_K2 is not set | ||
67 | # CONFIG_PAL4 is not set | ||
68 | CONFIG_GEMINI=y | ||
69 | # CONFIG_SMP is not set | ||
70 | # CONFIG_PREEMPT is not set | ||
71 | CONFIG_ALTIVEC=y | ||
72 | CONFIG_TAU=y | ||
73 | # CONFIG_TAU_INT is not set | ||
74 | # CONFIG_TAU_AVERAGE is not set | ||
75 | # CONFIG_CPU_FREQ is not set | ||
76 | |||
77 | # | ||
78 | # General setup | ||
79 | # | ||
80 | # CONFIG_HIGHMEM is not set | ||
81 | CONFIG_PCI=y | ||
82 | CONFIG_PCI_DOMAINS=y | ||
83 | CONFIG_KCORE_ELF=y | ||
84 | CONFIG_BINFMT_ELF=y | ||
85 | CONFIG_KERNEL_ELF=y | ||
86 | # CONFIG_BINFMT_MISC is not set | ||
87 | CONFIG_PCI_LEGACY_PROC=y | ||
88 | CONFIG_PCI_NAMES=y | ||
89 | # CONFIG_HOTPLUG is not set | ||
90 | |||
91 | # | ||
92 | # Parallel port support | ||
93 | # | ||
94 | # CONFIG_PARPORT is not set | ||
95 | # CONFIG_PPC601_SYNC_FIX is not set | ||
96 | # CONFIG_CMDLINE_BOOL is not set | ||
97 | |||
98 | # | ||
99 | # Advanced setup | ||
100 | # | ||
101 | # CONFIG_ADVANCED_OPTIONS is not set | ||
102 | |||
103 | # | ||
104 | # Default settings for advanced configuration options are used | ||
105 | # | ||
106 | CONFIG_HIGHMEM_START=0xfe000000 | ||
107 | CONFIG_LOWMEM_SIZE=0x30000000 | ||
108 | CONFIG_KERNEL_START=0xc0000000 | ||
109 | CONFIG_TASK_SIZE=0x80000000 | ||
110 | CONFIG_BOOT_LOAD=0x00800000 | ||
111 | |||
112 | # | ||
113 | # Memory Technology Devices (MTD) | ||
114 | # | ||
115 | # CONFIG_MTD is not set | ||
116 | |||
117 | # | ||
118 | # Plug and Play support | ||
119 | # | ||
120 | # CONFIG_PNP is not set | ||
121 | |||
122 | # | ||
123 | # Block devices | ||
124 | # | ||
125 | # CONFIG_BLK_DEV_FD is not set | ||
126 | # CONFIG_BLK_CPQ_DA is not set | ||
127 | # CONFIG_BLK_CPQ_CISS_DA is not set | ||
128 | # CONFIG_BLK_DEV_DAC960 is not set | ||
129 | # CONFIG_BLK_DEV_UMEM is not set | ||
130 | # CONFIG_BLK_DEV_LOOP is not set | ||
131 | # CONFIG_BLK_DEV_NBD is not set | ||
132 | CONFIG_BLK_DEV_RAM=y | ||
133 | CONFIG_BLK_DEV_RAM_SIZE=4096 | ||
134 | CONFIG_BLK_DEV_INITRD=y | ||
135 | |||
136 | # | ||
137 | # Multi-device support (RAID and LVM) | ||
138 | # | ||
139 | # CONFIG_MD is not set | ||
140 | |||
141 | # | ||
142 | # ATA/IDE/MFM/RLL support | ||
143 | # | ||
144 | # CONFIG_IDE is not set | ||
145 | |||
146 | # | ||
147 | # SCSI support | ||
148 | # | ||
149 | CONFIG_SCSI=y | ||
150 | |||
151 | # | ||
152 | # SCSI support type (disk, tape, CD-ROM) | ||
153 | # | ||
154 | CONFIG_BLK_DEV_SD=y | ||
155 | # CONFIG_CHR_DEV_ST is not set | ||
156 | # CONFIG_CHR_DEV_OSST is not set | ||
157 | CONFIG_BLK_DEV_SR=y | ||
158 | CONFIG_BLK_DEV_SR_VENDOR=y | ||
159 | CONFIG_CHR_DEV_SG=y | ||
160 | |||
161 | # | ||
162 | # Some SCSI devices (e.g. CD jukebox) support multiple LUNs | ||
163 | # | ||
164 | # CONFIG_SCSI_MULTI_LUN is not set | ||
165 | # CONFIG_SCSI_REPORT_LUNS is not set | ||
166 | CONFIG_SCSI_CONSTANTS=y | ||
167 | # CONFIG_SCSI_LOGGING is not set | ||
168 | |||
169 | # | ||
170 | # SCSI low-level drivers | ||
171 | # | ||
172 | # CONFIG_BLK_DEV_3W_XXXX_RAID is not set | ||
173 | # CONFIG_SCSI_ACARD is not set | ||
174 | # CONFIG_SCSI_AACRAID is not set | ||
175 | # CONFIG_SCSI_AIC7XXX is not set | ||
176 | # CONFIG_SCSI_AIC7XXX_OLD is not set | ||
177 | # CONFIG_SCSI_AIC79XX is not set | ||
178 | # CONFIG_SCSI_DPT_I2O is not set | ||
179 | # CONFIG_SCSI_ADVANSYS is not set | ||
180 | # CONFIG_SCSI_IN2000 is not set | ||
181 | # CONFIG_SCSI_AM53C974 is not set | ||
182 | # CONFIG_SCSI_MEGARAID is not set | ||
183 | # CONFIG_SCSI_BUSLOGIC is not set | ||
184 | # CONFIG_SCSI_CPQFCTS is not set | ||
185 | # CONFIG_SCSI_DMX3191D is not set | ||
186 | # CONFIG_SCSI_EATA is not set | ||
187 | # CONFIG_SCSI_EATA_PIO is not set | ||
188 | # CONFIG_SCSI_FUTURE_DOMAIN is not set | ||
189 | # CONFIG_SCSI_GDTH is not set | ||
190 | # CONFIG_SCSI_GENERIC_NCR5380 is not set | ||
191 | # CONFIG_SCSI_GENERIC_NCR5380_MMIO is not set | ||
192 | # CONFIG_SCSI_INITIO is not set | ||
193 | # CONFIG_SCSI_INIA100 is not set | ||
194 | # CONFIG_SCSI_NCR53C7xx is not set | ||
195 | CONFIG_SCSI_SYM53C8XX_2=y | ||
196 | CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=0 | ||
197 | CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16 | ||
198 | CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64 | ||
199 | # CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set | ||
200 | # CONFIG_SCSI_PCI2000 is not set | ||
201 | # CONFIG_SCSI_PCI2220I is not set | ||
202 | # CONFIG_SCSI_QLOGIC_ISP is not set | ||
203 | # CONFIG_SCSI_QLOGIC_FC is not set | ||
204 | # CONFIG_SCSI_QLOGIC_1280 is not set | ||
205 | # CONFIG_SCSI_DC395x is not set | ||
206 | # CONFIG_SCSI_DC390T is not set | ||
207 | # CONFIG_SCSI_U14_34F is not set | ||
208 | # CONFIG_SCSI_NSP32 is not set | ||
209 | # CONFIG_SCSI_DEBUG is not set | ||
210 | |||
211 | # | ||
212 | # Fusion MPT device support | ||
213 | # | ||
214 | # CONFIG_FUSION is not set | ||
215 | |||
216 | # | ||
217 | # IEEE 1394 (FireWire) support (EXPERIMENTAL) | ||
218 | # | ||
219 | # CONFIG_IEEE1394 is not set | ||
220 | |||
221 | # | ||
222 | # I2O device support | ||
223 | # | ||
224 | # CONFIG_I2O is not set | ||
225 | |||
226 | # | ||
227 | # Networking support | ||
228 | # | ||
229 | CONFIG_NET=y | ||
230 | |||
231 | # | ||
232 | # Networking options | ||
233 | # | ||
234 | CONFIG_PACKET=y | ||
235 | # CONFIG_PACKET_MMAP is not set | ||
236 | # CONFIG_NETLINK_DEV is not set | ||
237 | CONFIG_NETFILTER=y | ||
238 | # CONFIG_NETFILTER_DEBUG is not set | ||
239 | CONFIG_UNIX=y | ||
240 | # CONFIG_NET_KEY is not set | ||
241 | CONFIG_INET=y | ||
242 | # CONFIG_IP_MULTICAST is not set | ||
243 | # CONFIG_IP_ADVANCED_ROUTER is not set | ||
244 | # CONFIG_IP_PNP is not set | ||
245 | # CONFIG_NET_IPIP is not set | ||
246 | # CONFIG_NET_IPGRE is not set | ||
247 | # CONFIG_ARPD is not set | ||
248 | # CONFIG_INET_ECN is not set | ||
249 | # CONFIG_SYN_COOKIES is not set | ||
250 | # CONFIG_INET_AH is not set | ||
251 | # CONFIG_INET_ESP is not set | ||
252 | # CONFIG_INET_IPCOMP is not set | ||
253 | |||
254 | # | ||
255 | # IP: Netfilter Configuration | ||
256 | # | ||
257 | # CONFIG_IP_NF_CONNTRACK is not set | ||
258 | # CONFIG_IP_NF_QUEUE is not set | ||
259 | # CONFIG_IP_NF_IPTABLES is not set | ||
260 | # CONFIG_IP_NF_ARPTABLES is not set | ||
261 | # CONFIG_IP_NF_COMPAT_IPCHAINS is not set | ||
262 | # CONFIG_IP_NF_COMPAT_IPFWADM is not set | ||
263 | # CONFIG_IPV6 is not set | ||
264 | # CONFIG_XFRM_USER is not set | ||
265 | |||
266 | # | ||
267 | # SCTP Configuration (EXPERIMENTAL) | ||
268 | # | ||
269 | CONFIG_IPV6_SCTP__=y | ||
270 | # CONFIG_IP_SCTP is not set | ||
271 | # CONFIG_ATM is not set | ||
272 | # CONFIG_VLAN_8021Q is not set | ||
273 | # CONFIG_LLC is not set | ||
274 | # CONFIG_DECNET is not set | ||
275 | # CONFIG_BRIDGE is not set | ||
276 | # CONFIG_X25 is not set | ||
277 | # CONFIG_LAPB is not set | ||
278 | # CONFIG_NET_DIVERT is not set | ||
279 | # CONFIG_ECONET is not set | ||
280 | # CONFIG_WAN_ROUTER is not set | ||
281 | # CONFIG_NET_HW_FLOWCONTROL is not set | ||
282 | |||
283 | # | ||
284 | # QoS and/or fair queueing | ||
285 | # | ||
286 | # CONFIG_NET_SCHED is not set | ||
287 | |||
288 | # | ||
289 | # Network testing | ||
290 | # | ||
291 | # CONFIG_NET_PKTGEN is not set | ||
292 | CONFIG_NETDEVICES=y | ||
293 | |||
294 | # | ||
295 | # ARCnet devices | ||
296 | # | ||
297 | # CONFIG_ARCNET is not set | ||
298 | # CONFIG_DUMMY is not set | ||
299 | # CONFIG_BONDING is not set | ||
300 | # CONFIG_EQUALIZER is not set | ||
301 | # CONFIG_TUN is not set | ||
302 | # CONFIG_ETHERTAP is not set | ||
303 | |||
304 | # | ||
305 | # Ethernet (10 or 100Mbit) | ||
306 | # | ||
307 | CONFIG_NET_ETHERNET=y | ||
308 | # CONFIG_MII is not set | ||
309 | # CONFIG_OAKNET is not set | ||
310 | # CONFIG_HAPPYMEAL is not set | ||
311 | # CONFIG_SUNGEM is not set | ||
312 | # CONFIG_NET_VENDOR_3COM is not set | ||
313 | |||
314 | # | ||
315 | # Tulip family network device support | ||
316 | # | ||
317 | # CONFIG_NET_TULIP is not set | ||
318 | # CONFIG_HP100 is not set | ||
319 | # CONFIG_NET_PCI is not set | ||
320 | |||
321 | # | ||
322 | # Ethernet (1000 Mbit) | ||
323 | # | ||
324 | # CONFIG_ACENIC is not set | ||
325 | # CONFIG_DL2K is not set | ||
326 | # CONFIG_E1000 is not set | ||
327 | # CONFIG_NS83820 is not set | ||
328 | # CONFIG_HAMACHI is not set | ||
329 | # CONFIG_YELLOWFIN is not set | ||
330 | # CONFIG_R8169 is not set | ||
331 | # CONFIG_SK98LIN is not set | ||
332 | # CONFIG_TIGON3 is not set | ||
333 | |||
334 | # | ||
335 | # Ethernet (10000 Mbit) | ||
336 | # | ||
337 | # CONFIG_IXGB is not set | ||
338 | # CONFIG_FDDI is not set | ||
339 | # CONFIG_HIPPI is not set | ||
340 | # CONFIG_PPP is not set | ||
341 | # CONFIG_SLIP is not set | ||
342 | |||
343 | # | ||
344 | # Wireless LAN (non-hamradio) | ||
345 | # | ||
346 | # CONFIG_NET_RADIO is not set | ||
347 | |||
348 | # | ||
349 | # Token Ring devices (depends on LLC=y) | ||
350 | # | ||
351 | # CONFIG_NET_FC is not set | ||
352 | # CONFIG_RCPCI is not set | ||
353 | # CONFIG_SHAPER is not set | ||
354 | |||
355 | # | ||
356 | # Wan interfaces | ||
357 | # | ||
358 | # CONFIG_WAN is not set | ||
359 | |||
360 | # | ||
361 | # Amateur Radio support | ||
362 | # | ||
363 | # CONFIG_HAMRADIO is not set | ||
364 | |||
365 | # | ||
366 | # IrDA (infrared) support | ||
367 | # | ||
368 | # CONFIG_IRDA is not set | ||
369 | |||
370 | # | ||
371 | # ISDN subsystem | ||
372 | # | ||
373 | # CONFIG_ISDN_BOOL is not set | ||
374 | |||
375 | # | ||
376 | # Graphics support | ||
377 | # | ||
378 | # CONFIG_FB is not set | ||
379 | |||
380 | # | ||
381 | # Old CD-ROM drivers (not SCSI, not IDE) | ||
382 | # | ||
383 | # CONFIG_CD_NO_IDESCSI is not set | ||
384 | |||
385 | # | ||
386 | # Input device support | ||
387 | # | ||
388 | # CONFIG_INPUT is not set | ||
389 | |||
390 | # | ||
391 | # Userland interfaces | ||
392 | # | ||
393 | |||
394 | # | ||
395 | # Input I/O drivers | ||
396 | # | ||
397 | # CONFIG_GAMEPORT is not set | ||
398 | CONFIG_SOUND_GAMEPORT=y | ||
399 | # CONFIG_SERIO is not set | ||
400 | |||
401 | # | ||
402 | # Input Device Drivers | ||
403 | # | ||
404 | |||
405 | # | ||
406 | # Macintosh device drivers | ||
407 | # | ||
408 | |||
409 | # | ||
410 | # Character devices | ||
411 | # | ||
412 | # CONFIG_SERIAL_NONSTANDARD is not set | ||
413 | |||
414 | # | ||
415 | # Serial drivers | ||
416 | # | ||
417 | CONFIG_SERIAL_8250=y | ||
418 | CONFIG_SERIAL_8250_CONSOLE=y | ||
419 | # CONFIG_SERIAL_8250_EXTENDED is not set | ||
420 | |||
421 | # | ||
422 | # Non-8250 serial port support | ||
423 | # | ||
424 | CONFIG_SERIAL_CORE=y | ||
425 | CONFIG_SERIAL_CORE_CONSOLE=y | ||
426 | CONFIG_UNIX98_PTYS=y | ||
427 | CONFIG_UNIX98_PTY_COUNT=256 | ||
428 | |||
429 | # | ||
430 | # I2C support | ||
431 | # | ||
432 | # CONFIG_I2C is not set | ||
433 | |||
434 | # | ||
435 | # I2C Hardware Sensors Mainboard support | ||
436 | # | ||
437 | |||
438 | # | ||
439 | # I2C Hardware Sensors Chip support | ||
440 | # | ||
441 | # CONFIG_I2C_SENSOR is not set | ||
442 | |||
443 | # | ||
444 | # Mice | ||
445 | # | ||
446 | # CONFIG_BUSMOUSE is not set | ||
447 | # CONFIG_QIC02_TAPE is not set | ||
448 | |||
449 | # | ||
450 | # IPMI | ||
451 | # | ||
452 | # CONFIG_IPMI_HANDLER is not set | ||
453 | |||
454 | # | ||
455 | # Watchdog Cards | ||
456 | # | ||
457 | # CONFIG_WATCHDOG is not set | ||
458 | # CONFIG_NVRAM is not set | ||
459 | CONFIG_GEN_RTC=y | ||
460 | # CONFIG_GEN_RTC_X is not set | ||
461 | # CONFIG_DTLK is not set | ||
462 | # CONFIG_R3964 is not set | ||
463 | # CONFIG_APPLICOM is not set | ||
464 | |||
465 | # | ||
466 | # Ftape, the floppy tape device driver | ||
467 | # | ||
468 | # CONFIG_FTAPE is not set | ||
469 | # CONFIG_AGP is not set | ||
470 | # CONFIG_DRM is not set | ||
471 | # CONFIG_RAW_DRIVER is not set | ||
472 | # CONFIG_HANGCHECK_TIMER is not set | ||
473 | |||
474 | # | ||
475 | # Multimedia devices | ||
476 | # | ||
477 | # CONFIG_VIDEO_DEV is not set | ||
478 | |||
479 | # | ||
480 | # Digital Video Broadcasting Devices | ||
481 | # | ||
482 | # CONFIG_DVB is not set | ||
483 | |||
484 | # | ||
485 | # File systems | ||
486 | # | ||
487 | CONFIG_EXT2_FS=y | ||
488 | # CONFIG_EXT2_FS_XATTR is not set | ||
489 | # CONFIG_EXT3_FS is not set | ||
490 | # CONFIG_JBD is not set | ||
491 | # CONFIG_REISERFS_FS is not set | ||
492 | # CONFIG_JFS_FS is not set | ||
493 | # CONFIG_XFS_FS is not set | ||
494 | # CONFIG_MINIX_FS is not set | ||
495 | # CONFIG_ROMFS_FS is not set | ||
496 | # CONFIG_QUOTA is not set | ||
497 | # CONFIG_AUTOFS_FS is not set | ||
498 | # CONFIG_AUTOFS4_FS is not set | ||
499 | |||
500 | # | ||
501 | # CD-ROM/DVD Filesystems | ||
502 | # | ||
503 | CONFIG_ISO9660_FS=y | ||
504 | # CONFIG_JOLIET is not set | ||
505 | # CONFIG_ZISOFS is not set | ||
506 | # CONFIG_UDF_FS is not set | ||
507 | |||
508 | # | ||
509 | # DOS/FAT/NT Filesystems | ||
510 | # | ||
511 | # CONFIG_FAT_FS is not set | ||
512 | # CONFIG_NTFS_FS is not set | ||
513 | |||
514 | # | ||
515 | # Pseudo filesystems | ||
516 | # | ||
517 | CONFIG_PROC_FS=y | ||
518 | CONFIG_DEVFS_FS=y | ||
519 | # CONFIG_DEVFS_MOUNT is not set | ||
520 | # CONFIG_DEVFS_DEBUG is not set | ||
521 | CONFIG_DEVPTS_FS=y | ||
522 | # CONFIG_DEVPTS_FS_XATTR is not set | ||
523 | CONFIG_TMPFS=y | ||
524 | CONFIG_RAMFS=y | ||
525 | |||
526 | # | ||
527 | # Miscellaneous filesystems | ||
528 | # | ||
529 | # CONFIG_ADFS_FS is not set | ||
530 | # CONFIG_AFFS_FS is not set | ||
531 | # CONFIG_HFS_FS is not set | ||
532 | # CONFIG_BEFS_FS is not set | ||
533 | # CONFIG_BFS_FS is not set | ||
534 | # CONFIG_EFS_FS is not set | ||
535 | # CONFIG_CRAMFS is not set | ||
536 | # CONFIG_VXFS_FS is not set | ||
537 | # CONFIG_HPFS_FS is not set | ||
538 | # CONFIG_QNX4FS_FS is not set | ||
539 | # CONFIG_SYSV_FS is not set | ||
540 | # CONFIG_UFS_FS is not set | ||
541 | |||
542 | # | ||
543 | # Network File Systems | ||
544 | # | ||
545 | CONFIG_NFS_FS=y | ||
546 | # CONFIG_NFS_V3 is not set | ||
547 | # CONFIG_NFS_V4 is not set | ||
548 | CONFIG_NFSD=y | ||
549 | # CONFIG_NFSD_V3 is not set | ||
550 | # CONFIG_NFSD_TCP is not set | ||
551 | CONFIG_LOCKD=y | ||
552 | CONFIG_EXPORTFS=y | ||
553 | CONFIG_SUNRPC=y | ||
554 | # CONFIG_SUNRPC_GSS is not set | ||
555 | # CONFIG_SMB_FS is not set | ||
556 | # CONFIG_CIFS is not set | ||
557 | # CONFIG_NCP_FS is not set | ||
558 | # CONFIG_CODA_FS is not set | ||
559 | # CONFIG_INTERMEZZO_FS is not set | ||
560 | # CONFIG_AFS_FS is not set | ||
561 | |||
562 | # | ||
563 | # Partition Types | ||
564 | # | ||
565 | CONFIG_PARTITION_ADVANCED=y | ||
566 | # CONFIG_ACORN_PARTITION is not set | ||
567 | # CONFIG_OSF_PARTITION is not set | ||
568 | # CONFIG_AMIGA_PARTITION is not set | ||
569 | # CONFIG_ATARI_PARTITION is not set | ||
570 | # CONFIG_MAC_PARTITION is not set | ||
571 | CONFIG_MSDOS_PARTITION=y | ||
572 | # CONFIG_BSD_DISKLABEL is not set | ||
573 | # CONFIG_MINIX_SUBPARTITION is not set | ||
574 | CONFIG_SOLARIS_X86_PARTITION=y | ||
575 | # CONFIG_UNIXWARE_DISKLABEL is not set | ||
576 | # CONFIG_LDM_PARTITION is not set | ||
577 | # CONFIG_NEC98_PARTITION is not set | ||
578 | # CONFIG_SGI_PARTITION is not set | ||
579 | # CONFIG_ULTRIX_PARTITION is not set | ||
580 | # CONFIG_SUN_PARTITION is not set | ||
581 | # CONFIG_EFI_PARTITION is not set | ||
582 | |||
583 | # | ||
584 | # Sound | ||
585 | # | ||
586 | # CONFIG_SOUND is not set | ||
587 | |||
588 | # | ||
589 | # USB support | ||
590 | # | ||
591 | # CONFIG_USB is not set | ||
592 | # CONFIG_USB_GADGET is not set | ||
593 | |||
594 | # | ||
595 | # Bluetooth support | ||
596 | # | ||
597 | # CONFIG_BT is not set | ||
598 | |||
599 | # | ||
600 | # Library routines | ||
601 | # | ||
602 | # CONFIG_CRC32 is not set | ||
603 | |||
604 | # | ||
605 | # Kernel hacking | ||
606 | # | ||
607 | # CONFIG_DEBUG_KERNEL is not set | ||
608 | # CONFIG_KALLSYMS is not set | ||
609 | |||
610 | # | ||
611 | # Security options | ||
612 | # | ||
613 | # CONFIG_SECURITY is not set | ||
614 | |||
615 | # | ||
616 | # Cryptographic options | ||
617 | # | ||
618 | # CONFIG_CRYPTO is not set | ||
diff --git a/arch/ppc/kernel/Makefile b/arch/ppc/kernel/Makefile index 466437f4bcbb..6b4f022111e7 100644 --- a/arch/ppc/kernel/Makefile +++ b/arch/ppc/kernel/Makefile | |||
@@ -12,7 +12,6 @@ obj-y := entry.o traps.o time.o misc.o \ | |||
12 | setup.o \ | 12 | setup.o \ |
13 | ppc_htab.o | 13 | ppc_htab.o |
14 | obj-$(CONFIG_MODULES) += ppc_ksyms.o | 14 | obj-$(CONFIG_MODULES) += ppc_ksyms.o |
15 | obj-$(CONFIG_NOT_COHERENT_CACHE) += dma-mapping.o | ||
16 | obj-$(CONFIG_PCI) += pci.o | 15 | obj-$(CONFIG_PCI) += pci.o |
17 | obj-$(CONFIG_RAPIDIO) += rio.o | 16 | obj-$(CONFIG_RAPIDIO) += rio.o |
18 | obj-$(CONFIG_KGDB) += ppc-stub.o | 17 | obj-$(CONFIG_KGDB) += ppc-stub.o |
diff --git a/arch/ppc/kernel/dma-mapping.c b/arch/ppc/kernel/dma-mapping.c deleted file mode 100644 index 10fec7363962..000000000000 --- a/arch/ppc/kernel/dma-mapping.c +++ /dev/null | |||
@@ -1,442 +0,0 @@ | |||
1 | /* | ||
2 | * PowerPC version derived from arch/arm/mm/consistent.c | ||
3 | * Copyright (C) 2001 Dan Malek (dmalek@jlc.net) | ||
4 | * | ||
5 | * Copyright (C) 2000 Russell King | ||
6 | * | ||
7 | * Consistent memory allocators. Used for DMA devices that want to | ||
8 | * share uncached memory with the processor core. The function return | ||
9 | * is the virtual address and 'dma_handle' is the physical address. | ||
10 | * Mostly stolen from the ARM port, with some changes for PowerPC. | ||
11 | * -- Dan | ||
12 | * | ||
13 | * Reorganized to get rid of the arch-specific consistent_* functions | ||
14 | * and provide non-coherent implementations for the DMA API. -Matt | ||
15 | * | ||
16 | * Added in_interrupt() safe dma_alloc_coherent()/dma_free_coherent() | ||
17 | * implementation. This is pulled straight from ARM and barely | ||
18 | * modified. -Matt | ||
19 | * | ||
20 | * This program is free software; you can redistribute it and/or modify | ||
21 | * it under the terms of the GNU General Public License version 2 as | ||
22 | * published by the Free Software Foundation. | ||
23 | */ | ||
24 | |||
25 | #include <linux/module.h> | ||
26 | #include <linux/signal.h> | ||
27 | #include <linux/sched.h> | ||
28 | #include <linux/kernel.h> | ||
29 | #include <linux/errno.h> | ||
30 | #include <linux/string.h> | ||
31 | #include <linux/types.h> | ||
32 | #include <linux/ptrace.h> | ||
33 | #include <linux/mman.h> | ||
34 | #include <linux/mm.h> | ||
35 | #include <linux/swap.h> | ||
36 | #include <linux/stddef.h> | ||
37 | #include <linux/vmalloc.h> | ||
38 | #include <linux/init.h> | ||
39 | #include <linux/delay.h> | ||
40 | #include <linux/bootmem.h> | ||
41 | #include <linux/highmem.h> | ||
42 | #include <linux/dma-mapping.h> | ||
43 | #include <linux/hardirq.h> | ||
44 | |||
45 | #include <asm/pgalloc.h> | ||
46 | #include <asm/prom.h> | ||
47 | #include <asm/io.h> | ||
48 | #include <asm/mmu_context.h> | ||
49 | #include <asm/pgtable.h> | ||
50 | #include <asm/mmu.h> | ||
51 | #include <asm/uaccess.h> | ||
52 | #include <asm/smp.h> | ||
53 | #include <asm/machdep.h> | ||
54 | |||
55 | int map_page(unsigned long va, phys_addr_t pa, int flags); | ||
56 | |||
57 | #include <asm/tlbflush.h> | ||
58 | |||
59 | /* | ||
60 | * This address range defaults to a value that is safe for all | ||
61 | * platforms which currently set CONFIG_NOT_COHERENT_CACHE. It | ||
62 | * can be further configured for specific applications under | ||
63 | * the "Advanced Setup" menu. -Matt | ||
64 | */ | ||
65 | #define CONSISTENT_BASE (CONFIG_CONSISTENT_START) | ||
66 | #define CONSISTENT_END (CONFIG_CONSISTENT_START + CONFIG_CONSISTENT_SIZE) | ||
67 | #define CONSISTENT_OFFSET(x) (((unsigned long)(x) - CONSISTENT_BASE) >> PAGE_SHIFT) | ||
68 | |||
69 | /* | ||
70 | * This is the page table (2MB) covering uncached, DMA consistent allocations | ||
71 | */ | ||
72 | static pte_t *consistent_pte; | ||
73 | static DEFINE_SPINLOCK(consistent_lock); | ||
74 | |||
75 | /* | ||
76 | * VM region handling support. | ||
77 | * | ||
78 | * This should become something generic, handling VM region allocations for | ||
79 | * vmalloc and similar (ioremap, module space, etc). | ||
80 | * | ||
81 | * I envisage vmalloc()'s supporting vm_struct becoming: | ||
82 | * | ||
83 | * struct vm_struct { | ||
84 | * struct vm_region region; | ||
85 | * unsigned long flags; | ||
86 | * struct page **pages; | ||
87 | * unsigned int nr_pages; | ||
88 | * unsigned long phys_addr; | ||
89 | * }; | ||
90 | * | ||
91 | * get_vm_area() would then call vm_region_alloc with an appropriate | ||
92 | * struct vm_region head (eg): | ||
93 | * | ||
94 | * struct vm_region vmalloc_head = { | ||
95 | * .vm_list = LIST_HEAD_INIT(vmalloc_head.vm_list), | ||
96 | * .vm_start = VMALLOC_START, | ||
97 | * .vm_end = VMALLOC_END, | ||
98 | * }; | ||
99 | * | ||
100 | * However, vmalloc_head.vm_start is variable (typically, it is dependent on | ||
101 | * the amount of RAM found at boot time.) I would imagine that get_vm_area() | ||
102 | * would have to initialise this each time prior to calling vm_region_alloc(). | ||
103 | */ | ||
104 | struct vm_region { | ||
105 | struct list_head vm_list; | ||
106 | unsigned long vm_start; | ||
107 | unsigned long vm_end; | ||
108 | }; | ||
109 | |||
110 | static struct vm_region consistent_head = { | ||
111 | .vm_list = LIST_HEAD_INIT(consistent_head.vm_list), | ||
112 | .vm_start = CONSISTENT_BASE, | ||
113 | .vm_end = CONSISTENT_END, | ||
114 | }; | ||
115 | |||
116 | static struct vm_region * | ||
117 | vm_region_alloc(struct vm_region *head, size_t size, gfp_t gfp) | ||
118 | { | ||
119 | unsigned long addr = head->vm_start, end = head->vm_end - size; | ||
120 | unsigned long flags; | ||
121 | struct vm_region *c, *new; | ||
122 | |||
123 | new = kmalloc(sizeof(struct vm_region), gfp); | ||
124 | if (!new) | ||
125 | goto out; | ||
126 | |||
127 | spin_lock_irqsave(&consistent_lock, flags); | ||
128 | |||
129 | list_for_each_entry(c, &head->vm_list, vm_list) { | ||
130 | if ((addr + size) < addr) | ||
131 | goto nospc; | ||
132 | if ((addr + size) <= c->vm_start) | ||
133 | goto found; | ||
134 | addr = c->vm_end; | ||
135 | if (addr > end) | ||
136 | goto nospc; | ||
137 | } | ||
138 | |||
139 | found: | ||
140 | /* | ||
141 | * Insert this entry _before_ the one we found. | ||
142 | */ | ||
143 | list_add_tail(&new->vm_list, &c->vm_list); | ||
144 | new->vm_start = addr; | ||
145 | new->vm_end = addr + size; | ||
146 | |||
147 | spin_unlock_irqrestore(&consistent_lock, flags); | ||
148 | return new; | ||
149 | |||
150 | nospc: | ||
151 | spin_unlock_irqrestore(&consistent_lock, flags); | ||
152 | kfree(new); | ||
153 | out: | ||
154 | return NULL; | ||
155 | } | ||
156 | |||
157 | static struct vm_region *vm_region_find(struct vm_region *head, unsigned long addr) | ||
158 | { | ||
159 | struct vm_region *c; | ||
160 | |||
161 | list_for_each_entry(c, &head->vm_list, vm_list) { | ||
162 | if (c->vm_start == addr) | ||
163 | goto out; | ||
164 | } | ||
165 | c = NULL; | ||
166 | out: | ||
167 | return c; | ||
168 | } | ||
169 | |||
170 | /* | ||
171 | * Allocate DMA-coherent memory space and return both the kernel remapped | ||
172 | * virtual and bus address for that space. | ||
173 | */ | ||
174 | void * | ||
175 | __dma_alloc_coherent(size_t size, dma_addr_t *handle, gfp_t gfp) | ||
176 | { | ||
177 | struct page *page; | ||
178 | struct vm_region *c; | ||
179 | unsigned long order; | ||
180 | u64 mask = 0x00ffffff, limit; /* ISA default */ | ||
181 | |||
182 | if (!consistent_pte) { | ||
183 | printk(KERN_ERR "%s: not initialised\n", __func__); | ||
184 | dump_stack(); | ||
185 | return NULL; | ||
186 | } | ||
187 | |||
188 | size = PAGE_ALIGN(size); | ||
189 | limit = (mask + 1) & ~mask; | ||
190 | if ((limit && size >= limit) || size >= (CONSISTENT_END - CONSISTENT_BASE)) { | ||
191 | printk(KERN_WARNING "coherent allocation too big (requested %#x mask %#Lx)\n", | ||
192 | size, mask); | ||
193 | return NULL; | ||
194 | } | ||
195 | |||
196 | order = get_order(size); | ||
197 | |||
198 | if (mask != 0xffffffff) | ||
199 | gfp |= GFP_DMA; | ||
200 | |||
201 | page = alloc_pages(gfp, order); | ||
202 | if (!page) | ||
203 | goto no_page; | ||
204 | |||
205 | /* | ||
206 | * Invalidate any data that might be lurking in the | ||
207 | * kernel direct-mapped region for device DMA. | ||
208 | */ | ||
209 | { | ||
210 | unsigned long kaddr = (unsigned long)page_address(page); | ||
211 | memset(page_address(page), 0, size); | ||
212 | flush_dcache_range(kaddr, kaddr + size); | ||
213 | } | ||
214 | |||
215 | /* | ||
216 | * Allocate a virtual address in the consistent mapping region. | ||
217 | */ | ||
218 | c = vm_region_alloc(&consistent_head, size, | ||
219 | gfp & ~(__GFP_DMA | __GFP_HIGHMEM)); | ||
220 | if (c) { | ||
221 | unsigned long vaddr = c->vm_start; | ||
222 | pte_t *pte = consistent_pte + CONSISTENT_OFFSET(vaddr); | ||
223 | struct page *end = page + (1 << order); | ||
224 | |||
225 | split_page(page, order); | ||
226 | |||
227 | /* | ||
228 | * Set the "dma handle" | ||
229 | */ | ||
230 | *handle = page_to_bus(page); | ||
231 | |||
232 | do { | ||
233 | BUG_ON(!pte_none(*pte)); | ||
234 | |||
235 | SetPageReserved(page); | ||
236 | set_pte_at(&init_mm, vaddr, | ||
237 | pte, mk_pte(page, pgprot_noncached(PAGE_KERNEL))); | ||
238 | page++; | ||
239 | pte++; | ||
240 | vaddr += PAGE_SIZE; | ||
241 | } while (size -= PAGE_SIZE); | ||
242 | |||
243 | /* | ||
244 | * Free the otherwise unused pages. | ||
245 | */ | ||
246 | while (page < end) { | ||
247 | __free_page(page); | ||
248 | page++; | ||
249 | } | ||
250 | |||
251 | return (void *)c->vm_start; | ||
252 | } | ||
253 | |||
254 | if (page) | ||
255 | __free_pages(page, order); | ||
256 | no_page: | ||
257 | return NULL; | ||
258 | } | ||
259 | EXPORT_SYMBOL(__dma_alloc_coherent); | ||
260 | |||
261 | /* | ||
262 | * free a page as defined by the above mapping. | ||
263 | */ | ||
264 | void __dma_free_coherent(size_t size, void *vaddr) | ||
265 | { | ||
266 | struct vm_region *c; | ||
267 | unsigned long flags, addr; | ||
268 | pte_t *ptep; | ||
269 | |||
270 | size = PAGE_ALIGN(size); | ||
271 | |||
272 | spin_lock_irqsave(&consistent_lock, flags); | ||
273 | |||
274 | c = vm_region_find(&consistent_head, (unsigned long)vaddr); | ||
275 | if (!c) | ||
276 | goto no_area; | ||
277 | |||
278 | if ((c->vm_end - c->vm_start) != size) { | ||
279 | printk(KERN_ERR "%s: freeing wrong coherent size (%ld != %d)\n", | ||
280 | __func__, c->vm_end - c->vm_start, size); | ||
281 | dump_stack(); | ||
282 | size = c->vm_end - c->vm_start; | ||
283 | } | ||
284 | |||
285 | ptep = consistent_pte + CONSISTENT_OFFSET(c->vm_start); | ||
286 | addr = c->vm_start; | ||
287 | do { | ||
288 | pte_t pte = ptep_get_and_clear(&init_mm, addr, ptep); | ||
289 | unsigned long pfn; | ||
290 | |||
291 | ptep++; | ||
292 | addr += PAGE_SIZE; | ||
293 | |||
294 | if (!pte_none(pte) && pte_present(pte)) { | ||
295 | pfn = pte_pfn(pte); | ||
296 | |||
297 | if (pfn_valid(pfn)) { | ||
298 | struct page *page = pfn_to_page(pfn); | ||
299 | ClearPageReserved(page); | ||
300 | |||
301 | __free_page(page); | ||
302 | continue; | ||
303 | } | ||
304 | } | ||
305 | |||
306 | printk(KERN_CRIT "%s: bad page in kernel page table\n", | ||
307 | __func__); | ||
308 | } while (size -= PAGE_SIZE); | ||
309 | |||
310 | flush_tlb_kernel_range(c->vm_start, c->vm_end); | ||
311 | |||
312 | list_del(&c->vm_list); | ||
313 | |||
314 | spin_unlock_irqrestore(&consistent_lock, flags); | ||
315 | |||
316 | kfree(c); | ||
317 | return; | ||
318 | |||
319 | no_area: | ||
320 | spin_unlock_irqrestore(&consistent_lock, flags); | ||
321 | printk(KERN_ERR "%s: trying to free invalid coherent area: %p\n", | ||
322 | __func__, vaddr); | ||
323 | dump_stack(); | ||
324 | } | ||
325 | EXPORT_SYMBOL(__dma_free_coherent); | ||
326 | |||
327 | /* | ||
328 | * Initialise the consistent memory allocation. | ||
329 | */ | ||
330 | static int __init dma_alloc_init(void) | ||
331 | { | ||
332 | pgd_t *pgd; | ||
333 | pmd_t *pmd; | ||
334 | pte_t *pte; | ||
335 | int ret = 0; | ||
336 | |||
337 | do { | ||
338 | pgd = pgd_offset(&init_mm, CONSISTENT_BASE); | ||
339 | pmd = pmd_alloc(&init_mm, pgd, CONSISTENT_BASE); | ||
340 | if (!pmd) { | ||
341 | printk(KERN_ERR "%s: no pmd tables\n", __func__); | ||
342 | ret = -ENOMEM; | ||
343 | break; | ||
344 | } | ||
345 | WARN_ON(!pmd_none(*pmd)); | ||
346 | |||
347 | pte = pte_alloc_kernel(pmd, CONSISTENT_BASE); | ||
348 | if (!pte) { | ||
349 | printk(KERN_ERR "%s: no pte tables\n", __func__); | ||
350 | ret = -ENOMEM; | ||
351 | break; | ||
352 | } | ||
353 | |||
354 | consistent_pte = pte; | ||
355 | } while (0); | ||
356 | |||
357 | return ret; | ||
358 | } | ||
359 | |||
360 | core_initcall(dma_alloc_init); | ||
361 | |||
362 | /* | ||
363 | * make an area consistent. | ||
364 | */ | ||
365 | void __dma_sync(void *vaddr, size_t size, int direction) | ||
366 | { | ||
367 | unsigned long start = (unsigned long)vaddr; | ||
368 | unsigned long end = start + size; | ||
369 | |||
370 | switch (direction) { | ||
371 | case DMA_NONE: | ||
372 | BUG(); | ||
373 | case DMA_FROM_DEVICE: /* invalidate only */ | ||
374 | invalidate_dcache_range(start, end); | ||
375 | break; | ||
376 | case DMA_TO_DEVICE: /* writeback only */ | ||
377 | clean_dcache_range(start, end); | ||
378 | break; | ||
379 | case DMA_BIDIRECTIONAL: /* writeback and invalidate */ | ||
380 | flush_dcache_range(start, end); | ||
381 | break; | ||
382 | } | ||
383 | } | ||
384 | EXPORT_SYMBOL(__dma_sync); | ||
385 | |||
386 | #ifdef CONFIG_HIGHMEM | ||
387 | /* | ||
388 | * __dma_sync_page() implementation for systems using highmem. | ||
389 | * In this case, each page of a buffer must be kmapped/kunmapped | ||
390 | * in order to have a virtual address for __dma_sync(). This must | ||
391 | * not sleep so kmap_atomic()/kunmap_atomic() are used. | ||
392 | * | ||
393 | * Note: yes, it is possible and correct to have a buffer extend | ||
394 | * beyond the first page. | ||
395 | */ | ||
396 | static inline void __dma_sync_page_highmem(struct page *page, | ||
397 | unsigned long offset, size_t size, int direction) | ||
398 | { | ||
399 | size_t seg_size = min((size_t)(PAGE_SIZE - offset), size); | ||
400 | size_t cur_size = seg_size; | ||
401 | unsigned long flags, start, seg_offset = offset; | ||
402 | int nr_segs = 1 + ((size - seg_size) + PAGE_SIZE - 1)/PAGE_SIZE; | ||
403 | int seg_nr = 0; | ||
404 | |||
405 | local_irq_save(flags); | ||
406 | |||
407 | do { | ||
408 | start = (unsigned long)kmap_atomic(page + seg_nr, | ||
409 | KM_PPC_SYNC_PAGE) + seg_offset; | ||
410 | |||
411 | /* Sync this buffer segment */ | ||
412 | __dma_sync((void *)start, seg_size, direction); | ||
413 | kunmap_atomic((void *)start, KM_PPC_SYNC_PAGE); | ||
414 | seg_nr++; | ||
415 | |||
416 | /* Calculate next buffer segment size */ | ||
417 | seg_size = min((size_t)PAGE_SIZE, size - cur_size); | ||
418 | |||
419 | /* Add the segment size to our running total */ | ||
420 | cur_size += seg_size; | ||
421 | seg_offset = 0; | ||
422 | } while (seg_nr < nr_segs); | ||
423 | |||
424 | local_irq_restore(flags); | ||
425 | } | ||
426 | #endif /* CONFIG_HIGHMEM */ | ||
427 | |||
428 | /* | ||
429 | * __dma_sync_page makes memory consistent. identical to __dma_sync, but | ||
430 | * takes a struct page instead of a virtual address | ||
431 | */ | ||
432 | void __dma_sync_page(struct page *page, unsigned long offset, | ||
433 | size_t size, int direction) | ||
434 | { | ||
435 | #ifdef CONFIG_HIGHMEM | ||
436 | __dma_sync_page_highmem(page, offset, size, direction); | ||
437 | #else | ||
438 | unsigned long start = (unsigned long)page_address(page) + offset; | ||
439 | __dma_sync((void *)start, size, direction); | ||
440 | #endif | ||
441 | } | ||
442 | EXPORT_SYMBOL(__dma_sync_page); | ||
diff --git a/arch/ppc/kernel/head.S b/arch/ppc/kernel/head.S index 100052aaea9a..c7cb9d5f24a3 100644 --- a/arch/ppc/kernel/head.S +++ b/arch/ppc/kernel/head.S | |||
@@ -310,12 +310,7 @@ i##n: \ | |||
310 | /* System reset */ | 310 | /* System reset */ |
311 | /* core99 pmac starts the seconary here by changing the vector, and | 311 | /* core99 pmac starts the seconary here by changing the vector, and |
312 | putting it back to what it was (unknown_exception) when done. */ | 312 | putting it back to what it was (unknown_exception) when done. */ |
313 | #if defined(CONFIG_GEMINI) && defined(CONFIG_SMP) | ||
314 | . = 0x100 | ||
315 | b __secondary_start_gemini | ||
316 | #else | ||
317 | EXCEPTION(0x100, Reset, unknown_exception, EXC_XFER_STD) | 313 | EXCEPTION(0x100, Reset, unknown_exception, EXC_XFER_STD) |
318 | #endif | ||
319 | 314 | ||
320 | /* Machine check */ | 315 | /* Machine check */ |
321 | . = 0x200 | 316 | . = 0x200 |
@@ -897,19 +892,6 @@ fix_mem_constants: | |||
897 | #endif /* CONFIG_APUS */ | 892 | #endif /* CONFIG_APUS */ |
898 | 893 | ||
899 | #ifdef CONFIG_SMP | 894 | #ifdef CONFIG_SMP |
900 | #ifdef CONFIG_GEMINI | ||
901 | .globl __secondary_start_gemini | ||
902 | __secondary_start_gemini: | ||
903 | mfspr r4,SPRN_HID0 | ||
904 | ori r4,r4,HID0_ICFI | ||
905 | li r3,0 | ||
906 | ori r3,r3,HID0_ICE | ||
907 | andc r4,r4,r3 | ||
908 | mtspr SPRN_HID0,r4 | ||
909 | sync | ||
910 | b __secondary_start | ||
911 | #endif /* CONFIG_GEMINI */ | ||
912 | |||
913 | .globl __secondary_start_pmac_0 | 895 | .globl __secondary_start_pmac_0 |
914 | __secondary_start_pmac_0: | 896 | __secondary_start_pmac_0: |
915 | /* NB the entries for cpus 0, 1, 2 must each occupy 8 bytes. */ | 897 | /* NB the entries for cpus 0, 1, 2 must each occupy 8 bytes. */ |
diff --git a/arch/ppc/kernel/ppc_ksyms.c b/arch/ppc/kernel/ppc_ksyms.c index c8b65ca8a350..1f49503317cb 100644 --- a/arch/ppc/kernel/ppc_ksyms.c +++ b/arch/ppc/kernel/ppc_ksyms.c | |||
@@ -43,6 +43,7 @@ | |||
43 | #include <asm/div64.h> | 43 | #include <asm/div64.h> |
44 | #include <asm/xmon.h> | 44 | #include <asm/xmon.h> |
45 | #include <asm/signal.h> | 45 | #include <asm/signal.h> |
46 | #include <asm/dcr.h> | ||
46 | 47 | ||
47 | #ifdef CONFIG_8xx | 48 | #ifdef CONFIG_8xx |
48 | #include <asm/commproc.h> | 49 | #include <asm/commproc.h> |
diff --git a/arch/ppc/lib/rheap.c b/arch/ppc/lib/rheap.c index 31e511856dc5..d40700795a9c 100644 --- a/arch/ppc/lib/rheap.c +++ b/arch/ppc/lib/rheap.c | |||
@@ -14,6 +14,7 @@ | |||
14 | */ | 14 | */ |
15 | #include <linux/types.h> | 15 | #include <linux/types.h> |
16 | #include <linux/errno.h> | 16 | #include <linux/errno.h> |
17 | #include <linux/kernel.h> | ||
17 | #include <linux/mm.h> | 18 | #include <linux/mm.h> |
18 | #include <linux/slab.h> | 19 | #include <linux/slab.h> |
19 | 20 | ||
@@ -654,7 +655,7 @@ void rh_dump(rh_info_t * info) | |||
654 | int maxnr; | 655 | int maxnr; |
655 | int i, nr; | 656 | int i, nr; |
656 | 657 | ||
657 | maxnr = sizeof(st) / sizeof(st[0]); | 658 | maxnr = ARRAY_SIZE(st); |
658 | 659 | ||
659 | printk(KERN_INFO | 660 | printk(KERN_INFO |
660 | "info @0x%p (%d slots empty / %d max)\n", | 661 | "info @0x%p (%d slots empty / %d max)\n", |
diff --git a/arch/ppc/mm/pgtable.c b/arch/ppc/mm/pgtable.c index 354a9408f024..82b06a1ef95d 100644 --- a/arch/ppc/mm/pgtable.c +++ b/arch/ppc/mm/pgtable.c | |||
@@ -313,11 +313,8 @@ void __init mapin_ram(void) | |||
313 | } | 313 | } |
314 | } | 314 | } |
315 | 315 | ||
316 | /* is x a power of 2? */ | ||
317 | #define is_power_of_2(x) ((x) != 0 && (((x) & ((x) - 1)) == 0)) | ||
318 | |||
319 | /* is x a power of 4? */ | 316 | /* is x a power of 4? */ |
320 | #define is_power_of_4(x) ((x) != 0 && (((x) & (x-1)) == 0) && (ffs(x) & 1)) | 317 | #define is_power_of_4(x) is_power_of_2(x) && (ffs(x) & 1)) |
321 | 318 | ||
322 | /* | 319 | /* |
323 | * Set up a mapping for a block of I/O. | 320 | * Set up a mapping for a block of I/O. |
diff --git a/arch/ppc/platforms/Makefile b/arch/ppc/platforms/Makefile index 90c622294423..e17fad470621 100644 --- a/arch/ppc/platforms/Makefile +++ b/arch/ppc/platforms/Makefile | |||
@@ -13,7 +13,6 @@ obj-$(CONFIG_TQM8260) += tqm8260_setup.o | |||
13 | obj-$(CONFIG_CPCI690) += cpci690.o | 13 | obj-$(CONFIG_CPCI690) += cpci690.o |
14 | obj-$(CONFIG_EV64260) += ev64260.o | 14 | obj-$(CONFIG_EV64260) += ev64260.o |
15 | obj-$(CONFIG_CHESTNUT) += chestnut.o | 15 | obj-$(CONFIG_CHESTNUT) += chestnut.o |
16 | obj-$(CONFIG_GEMINI) += gemini_pci.o gemini_setup.o gemini_prom.o | ||
17 | obj-$(CONFIG_LOPEC) += lopec.o | 16 | obj-$(CONFIG_LOPEC) += lopec.o |
18 | obj-$(CONFIG_KATANA) += katana.o | 17 | obj-$(CONFIG_KATANA) += katana.o |
19 | obj-$(CONFIG_HDPU) += hdpu.o | 18 | obj-$(CONFIG_HDPU) += hdpu.o |
diff --git a/arch/ppc/platforms/gemini.h b/arch/ppc/platforms/gemini.h deleted file mode 100644 index 5528fd0a1216..000000000000 --- a/arch/ppc/platforms/gemini.h +++ /dev/null | |||
@@ -1,165 +0,0 @@ | |||
1 | /* | ||
2 | * Onboard registers and descriptions for Synergy Microsystems' | ||
3 | * "Gemini" boards. | ||
4 | * | ||
5 | */ | ||
6 | #ifdef __KERNEL__ | ||
7 | #ifndef __PPC_GEMINI_H | ||
8 | #define __PPC_GEMINI_H | ||
9 | |||
10 | /* Registers */ | ||
11 | |||
12 | #define GEMINI_SERIAL_B (0xffeffb00) | ||
13 | #define GEMINI_SERIAL_A (0xffeffb08) | ||
14 | #define GEMINI_USWITCH (0xffeffd00) | ||
15 | #define GEMINI_BREV (0xffeffe00) | ||
16 | #define GEMINI_BECO (0xffeffe08) | ||
17 | #define GEMINI_FEAT (0xffeffe10) | ||
18 | #define GEMINI_BSTAT (0xffeffe18) | ||
19 | #define GEMINI_CPUSTAT (0xffeffe20) | ||
20 | #define GEMINI_L2CFG (0xffeffe30) | ||
21 | #define GEMINI_MEMCFG (0xffeffe38) | ||
22 | #define GEMINI_FLROM (0xffeffe40) | ||
23 | #define GEMINI_P0PCI (0xffeffe48) | ||
24 | #define GEMINI_FLWIN (0xffeffe50) | ||
25 | #define GEMINI_P0INTMASK (0xffeffe60) | ||
26 | #define GEMINI_P0INTAP (0xffeffe68) | ||
27 | #define GEMINI_PCIERR (0xffeffe70) | ||
28 | #define GEMINI_LEDBASE (0xffeffe80) | ||
29 | #define GEMINI_RTC (0xffe9fff8) | ||
30 | #define GEMINI_LEDS 8 | ||
31 | #define GEMINI_SWITCHES 8 | ||
32 | |||
33 | |||
34 | /* Flash ROM bit definitions */ | ||
35 | #define GEMINI_FLS_WEN (1<<0) | ||
36 | #define GEMINI_FLS_JMP (1<<6) | ||
37 | #define GEMINI_FLS_BOOT (1<<7) | ||
38 | |||
39 | /* Memory bit definitions */ | ||
40 | #define GEMINI_MEM_TYPE_MASK 0xc0 | ||
41 | #define GEMINI_MEM_SIZE_MASK 0x38 | ||
42 | #define GEMINI_MEM_BANK_MASK 0x07 | ||
43 | |||
44 | /* L2 cache bit definitions */ | ||
45 | #define GEMINI_L2_SIZE_MASK 0xc0 | ||
46 | #define GEMINI_L2_RATIO_MASK 0x03 | ||
47 | |||
48 | /* Timebase register bit definitons */ | ||
49 | #define GEMINI_TIMEB0_EN (1<<0) | ||
50 | #define GEMINI_TIMEB1_EN (1<<1) | ||
51 | #define GEMINI_TIMEB2_EN (1<<2) | ||
52 | #define GEMINI_TIMEB3_EN (1<<3) | ||
53 | |||
54 | /* CPU status bit definitions */ | ||
55 | #define GEMINI_CPU_ID_MASK 0x03 | ||
56 | #define GEMINI_CPU_COUNT_MASK 0x0c | ||
57 | #define GEMINI_CPU0_HALTED (1<<4) | ||
58 | #define GEMINI_CPU1_HALTED (1<<5) | ||
59 | #define GEMINI_CPU2_HALTED (1<<6) | ||
60 | #define GEMINI_CPU3_HALTED (1<<7) | ||
61 | |||
62 | /* Board status bit definitions */ | ||
63 | #define GEMINI_BRD_FAIL (1<<0) /* FAIL led is lit */ | ||
64 | #define GEMINI_BRD_BUS_MASK 0x0c /* PowerPC bus speed */ | ||
65 | |||
66 | /* Board family/feature bit descriptions */ | ||
67 | #define GEMINI_FEAT_HAS_FLASH (1<<0) | ||
68 | #define GEMINI_FEAT_HAS_ETH (1<<1) | ||
69 | #define GEMINI_FEAT_HAS_SCSI (1<<2) | ||
70 | #define GEMINI_FEAT_HAS_P0 (1<<3) | ||
71 | #define GEMINI_FEAT_FAM_MASK 0xf0 | ||
72 | |||
73 | /* Mod/ECO bit definitions */ | ||
74 | #define GEMINI_ECO_LEVEL_MASK 0x0f | ||
75 | #define GEMINI_MOD_MASK 0xf0 | ||
76 | |||
77 | /* Type/revision bit definitions */ | ||
78 | #define GEMINI_REV_MASK 0x0f | ||
79 | #define GEMINI_TYPE_MASK 0xf0 | ||
80 | |||
81 | /* User switch definitions */ | ||
82 | #define GEMINI_SWITCH_VERBOSE 1 /* adds "debug" to boot cmd line */ | ||
83 | #define GEMINI_SWITCH_SINGLE_USER 7 /* boots into "single-user" mode */ | ||
84 | |||
85 | #define SGS_RTC_CONTROL 0 | ||
86 | #define SGS_RTC_SECONDS 1 | ||
87 | #define SGS_RTC_MINUTES 2 | ||
88 | #define SGS_RTC_HOURS 3 | ||
89 | #define SGS_RTC_DAY 4 | ||
90 | #define SGS_RTC_DAY_OF_MONTH 5 | ||
91 | #define SGS_RTC_MONTH 6 | ||
92 | #define SGS_RTC_YEAR 7 | ||
93 | |||
94 | #define SGS_RTC_SET 0x80 | ||
95 | #define SGS_RTC_IS_STOPPED 0x80 | ||
96 | |||
97 | #define GRACKLE_CONFIG_ADDR_ADDR (0xfec00000) | ||
98 | #define GRACKLE_CONFIG_DATA_ADDR (0xfee00000) | ||
99 | |||
100 | #define GEMINI_BOOT_INIT (0xfff00100) | ||
101 | |||
102 | #ifndef __ASSEMBLY__ | ||
103 | |||
104 | static inline void grackle_write( unsigned long addr, unsigned long data ) | ||
105 | { | ||
106 | __asm__ __volatile__( | ||
107 | " stwbrx %1, 0, %0\n \ | ||
108 | sync\n \ | ||
109 | stwbrx %3, 0, %2\n \ | ||
110 | sync " | ||
111 | : /* no output */ | ||
112 | : "r" (GRACKLE_CONFIG_ADDR_ADDR), "r" (addr), | ||
113 | "r" (GRACKLE_CONFIG_DATA_ADDR), "r" (data)); | ||
114 | } | ||
115 | |||
116 | static inline unsigned long grackle_read( unsigned long addr ) | ||
117 | { | ||
118 | unsigned long val; | ||
119 | |||
120 | __asm__ __volatile__( | ||
121 | " stwbrx %1, 0, %2\n \ | ||
122 | sync\n \ | ||
123 | lwbrx %0, 0, %3\n \ | ||
124 | sync " | ||
125 | : "=r" (val) | ||
126 | : "r" (addr), "r" (GRACKLE_CONFIG_ADDR_ADDR), | ||
127 | "r" (GRACKLE_CONFIG_DATA_ADDR)); | ||
128 | |||
129 | return val; | ||
130 | } | ||
131 | |||
132 | static inline void gemini_led_on( int led ) | ||
133 | { | ||
134 | if (led >= 0 && led < GEMINI_LEDS) | ||
135 | *(unsigned char *)(GEMINI_LEDBASE + (led<<3)) = 1; | ||
136 | } | ||
137 | |||
138 | static inline void gemini_led_off(int led) | ||
139 | { | ||
140 | if (led >= 0 && led < GEMINI_LEDS) | ||
141 | *(unsigned char *)(GEMINI_LEDBASE + (led<<3)) = 0; | ||
142 | } | ||
143 | |||
144 | static inline int gemini_led_val(int led) | ||
145 | { | ||
146 | int val = 0; | ||
147 | if (led >= 0 && led < GEMINI_LEDS) | ||
148 | val = *(unsigned char *)(GEMINI_LEDBASE + (led<<3)); | ||
149 | return (val & 0x1); | ||
150 | } | ||
151 | |||
152 | /* returns processor id from the board */ | ||
153 | static inline int gemini_processor(void) | ||
154 | { | ||
155 | unsigned char cpu = *(unsigned char *)(GEMINI_CPUSTAT); | ||
156 | return (int) ((cpu == 0) ? 4 : (cpu & GEMINI_CPU_ID_MASK)); | ||
157 | } | ||
158 | |||
159 | |||
160 | extern void _gemini_reboot(void); | ||
161 | extern void gemini_prom_init(void); | ||
162 | extern void gemini_init_l2(void); | ||
163 | #endif /* __ASSEMBLY__ */ | ||
164 | #endif | ||
165 | #endif /* __KERNEL__ */ | ||
diff --git a/arch/ppc/platforms/gemini_pci.c b/arch/ppc/platforms/gemini_pci.c deleted file mode 100644 index 95656091ba2b..000000000000 --- a/arch/ppc/platforms/gemini_pci.c +++ /dev/null | |||
@@ -1,41 +0,0 @@ | |||
1 | #include <linux/kernel.h> | ||
2 | #include <linux/init.h> | ||
3 | #include <linux/pci.h> | ||
4 | #include <linux/slab.h> | ||
5 | |||
6 | #include <asm/machdep.h> | ||
7 | #include <platforms/gemini.h> | ||
8 | #include <asm/byteorder.h> | ||
9 | #include <asm/io.h> | ||
10 | #include <asm/uaccess.h> | ||
11 | #include <asm/pci-bridge.h> | ||
12 | |||
13 | void __init gemini_pcibios_fixup(void) | ||
14 | { | ||
15 | int i; | ||
16 | struct pci_dev *dev = NULL; | ||
17 | |||
18 | for_each_pci_dev(dev) { | ||
19 | for(i = 0; i < 6; i++) { | ||
20 | if (dev->resource[i].flags & IORESOURCE_IO) { | ||
21 | dev->resource[i].start |= (0xfe << 24); | ||
22 | dev->resource[i].end |= (0xfe << 24); | ||
23 | } | ||
24 | } | ||
25 | } | ||
26 | } | ||
27 | |||
28 | |||
29 | /* The "bootloader" for Synergy boards does none of this for us, so we need to | ||
30 | lay it all out ourselves... --Dan */ | ||
31 | void __init gemini_find_bridges(void) | ||
32 | { | ||
33 | struct pci_controller* hose; | ||
34 | |||
35 | ppc_md.pcibios_fixup = gemini_pcibios_fixup; | ||
36 | |||
37 | hose = pcibios_alloc_controller(); | ||
38 | if (!hose) | ||
39 | return; | ||
40 | setup_indirect_pci(hose, 0xfec00000, 0xfee00000); | ||
41 | } | ||
diff --git a/arch/ppc/platforms/gemini_prom.S b/arch/ppc/platforms/gemini_prom.S deleted file mode 100644 index e8c84d24f01f..000000000000 --- a/arch/ppc/platforms/gemini_prom.S +++ /dev/null | |||
@@ -1,90 +0,0 @@ | |||
1 | /* | ||
2 | * Not really prom support code (yet), but sort of anti-prom code. The current | ||
3 | * bootloader does a number of things it shouldn't and doesn't do things that it | ||
4 | * should. The stuff in here is mainly a hodge-podge collection of setup code | ||
5 | * to get the board up and running. | ||
6 | * ---Dan | ||
7 | */ | ||
8 | |||
9 | #include <asm/reg.h> | ||
10 | #include <asm/page.h> | ||
11 | #include <platforms/gemini.h> | ||
12 | #include <asm/ppc_asm.h> | ||
13 | |||
14 | /* | ||
15 | * On 750's the MMU is on when Linux is booted, so we need to clear out the | ||
16 | * bootloader's BAT settings, make sure we're in supervisor state (gotcha!), | ||
17 | * and turn off the MMU. | ||
18 | * | ||
19 | */ | ||
20 | |||
21 | _GLOBAL(gemini_prom_init) | ||
22 | #ifdef CONFIG_SMP | ||
23 | /* Since the MMU's on, get stuff in rom space that we'll need */ | ||
24 | lis r4,GEMINI_CPUSTAT@h | ||
25 | ori r4,r4,GEMINI_CPUSTAT@l | ||
26 | lbz r5,0(r4) | ||
27 | andi. r5,r5,3 | ||
28 | mr r24,r5 /* cpu # used later on */ | ||
29 | #endif | ||
30 | mfmsr r4 | ||
31 | li r3,MSR_PR /* ensure supervisor! */ | ||
32 | ori r3,r3,MSR_IR|MSR_DR | ||
33 | andc r4,r4,r3 | ||
34 | mtmsr r4 | ||
35 | isync | ||
36 | #if 0 | ||
37 | /* zero out the bats now that the MMU is off */ | ||
38 | prom_no_mmu: | ||
39 | li r3,0 | ||
40 | mtspr SPRN_IBAT0U,r3 | ||
41 | mtspr SPRN_IBAT0L,r3 | ||
42 | mtspr SPRN_IBAT1U,r3 | ||
43 | mtspr SPRN_IBAT1L,r3 | ||
44 | mtspr SPRN_IBAT2U,r3 | ||
45 | mtspr SPRN_IBAT2L,r3 | ||
46 | mtspr SPRN_IBAT3U,r3 | ||
47 | mtspr SPRN_IBAT3L,r3 | ||
48 | |||
49 | mtspr SPRN_DBAT0U,r3 | ||
50 | mtspr SPRN_DBAT0L,r3 | ||
51 | mtspr SPRN_DBAT1U,r3 | ||
52 | mtspr SPRN_DBAT1L,r3 | ||
53 | mtspr SPRN_DBAT2U,r3 | ||
54 | mtspr SPRN_DBAT2L,r3 | ||
55 | mtspr SPRN_DBAT3U,r3 | ||
56 | mtspr SPRN_DBAT3L,r3 | ||
57 | #endif | ||
58 | |||
59 | /* the bootloader (as far as I'm currently aware) doesn't mess with page | ||
60 | tables, but since we're already here, might as well zap these, too */ | ||
61 | li r4,0 | ||
62 | mtspr SPRN_SDR1,r4 | ||
63 | |||
64 | li r4,16 | ||
65 | mtctr r4 | ||
66 | li r3,0 | ||
67 | li r4,0 | ||
68 | 3: mtsrin r3,r4 | ||
69 | addi r3,r3,1 | ||
70 | bdnz 3b | ||
71 | |||
72 | #ifdef CONFIG_SMP | ||
73 | /* The 750 book (and Mot/IBM support) says that this will "assist" snooping | ||
74 | when in SMP. Not sure yet whether this should stay or leave... */ | ||
75 | mfspr r4,SPRN_HID0 | ||
76 | ori r4,r4,HID0_ABE | ||
77 | mtspr SPRN_HID0,r4 | ||
78 | sync | ||
79 | #endif /* CONFIG_SMP */ | ||
80 | blr | ||
81 | |||
82 | /* apparently, SMon doesn't pay attention to HID0[SRST]. Disable the MMU and | ||
83 | branch to 0xfff00100 */ | ||
84 | _GLOBAL(_gemini_reboot) | ||
85 | lis r5,GEMINI_BOOT_INIT@h | ||
86 | ori r5,r5,GEMINI_BOOT_INIT@l | ||
87 | li r6,MSR_IP | ||
88 | mtspr SPRN_SRR0,r5 | ||
89 | mtspr SPRN_SRR1,r6 | ||
90 | rfi | ||
diff --git a/arch/ppc/platforms/gemini_serial.h b/arch/ppc/platforms/gemini_serial.h deleted file mode 100644 index b915eff79fdb..000000000000 --- a/arch/ppc/platforms/gemini_serial.h +++ /dev/null | |||
@@ -1,40 +0,0 @@ | |||
1 | #ifdef __KERNEL__ | ||
2 | #ifndef __ASMPPC_GEMINI_SERIAL_H | ||
3 | #define __ASMPPC_GEMINI_SERIAL_H | ||
4 | |||
5 | #include <platforms/gemini.h> | ||
6 | |||
7 | #ifdef CONFIG_SERIAL_MANY_PORTS | ||
8 | #define RS_TABLE_SIZE 64 | ||
9 | #else | ||
10 | #define RS_TABLE_SIZE 4 | ||
11 | #endif | ||
12 | |||
13 | /* Rate for the 24.576 Mhz clock for the onboard serial chip */ | ||
14 | #define BASE_BAUD (24576000 / 16) | ||
15 | |||
16 | #ifdef CONFIG_SERIAL_DETECT_IRQ | ||
17 | #define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF|ASYNC_SKIP_TEST|ASYNC_AUTO_IRQ) | ||
18 | #define STD_COM4_FLAGS (ASYNC_BOOT_AUTOCONF|ASYNC_AUTO_IRQ) | ||
19 | #else | ||
20 | #define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF|ASYNC_SKIP_TEST) | ||
21 | #define STD_COM4_FLAGS (ASYNC_BOOT_AUTOCONF) | ||
22 | #endif | ||
23 | |||
24 | #define STD_SERIAL_PORT_DEFNS \ | ||
25 | { 0, BASE_BAUD, GEMINI_SERIAL_A, 15, STD_COM_FLAGS }, /* ttyS0 */ \ | ||
26 | { 0, BASE_BAUD, GEMINI_SERIAL_B, 14, STD_COM_FLAGS }, /* ttyS1 */ \ | ||
27 | |||
28 | #ifdef CONFIG_GEMINI_PU32 | ||
29 | #define PU32_SERIAL_PORT_DEFNS \ | ||
30 | { 0, BASE_BAUD, NULL, 0, STD_COM_FLAGS }, | ||
31 | #else | ||
32 | #define PU32_SERIAL_PORT_DEFNS | ||
33 | #endif | ||
34 | |||
35 | #define SERIAL_PORT_DFNS \ | ||
36 | STD_SERIAL_PORT_DEFNS \ | ||
37 | PU32_SERIAL_PORT_DEFNS | ||
38 | |||
39 | #endif | ||
40 | #endif /* __KERNEL__ */ | ||
diff --git a/arch/ppc/platforms/gemini_setup.c b/arch/ppc/platforms/gemini_setup.c deleted file mode 100644 index f48048f362a8..000000000000 --- a/arch/ppc/platforms/gemini_setup.c +++ /dev/null | |||
@@ -1,577 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 1995 Linus Torvalds | ||
3 | * Adapted from 'alpha' version by Gary Thomas | ||
4 | * Modified by Cort Dougan (cort@cs.nmt.edu) | ||
5 | * Synergy Microsystems board support by Dan Cox (dan@synergymicro.com) | ||
6 | * | ||
7 | */ | ||
8 | |||
9 | #include <linux/stddef.h> | ||
10 | #include <linux/kernel.h> | ||
11 | #include <linux/init.h> | ||
12 | #include <linux/errno.h> | ||
13 | #include <linux/reboot.h> | ||
14 | #include <linux/pci.h> | ||
15 | #include <linux/time.h> | ||
16 | #include <linux/kdev_t.h> | ||
17 | #include <linux/types.h> | ||
18 | #include <linux/major.h> | ||
19 | #include <linux/initrd.h> | ||
20 | #include <linux/console.h> | ||
21 | #include <linux/seq_file.h> | ||
22 | #include <linux/root_dev.h> | ||
23 | #include <linux/bcd.h> | ||
24 | |||
25 | #include <asm/system.h> | ||
26 | #include <asm/pgtable.h> | ||
27 | #include <asm/page.h> | ||
28 | #include <asm/dma.h> | ||
29 | #include <asm/io.h> | ||
30 | #include <asm/m48t35.h> | ||
31 | #include <platforms/gemini.h> | ||
32 | #include <asm/time.h> | ||
33 | #include <asm/open_pic.h> | ||
34 | #include <asm/bootinfo.h> | ||
35 | #include <asm/machdep.h> | ||
36 | |||
37 | void gemini_find_bridges(void); | ||
38 | static int gemini_get_clock_speed(void); | ||
39 | extern void gemini_pcibios_fixup(void); | ||
40 | |||
41 | static char *gemini_board_families[] = { | ||
42 | "VGM", "VSS", "KGM", "VGR", "VCM", "VCS", "KCM", "VCR" | ||
43 | }; | ||
44 | static int gemini_board_count = sizeof(gemini_board_families) / | ||
45 | sizeof(gemini_board_families[0]); | ||
46 | |||
47 | static unsigned int cpu_7xx[16] = { | ||
48 | 0, 15, 14, 0, 0, 13, 5, 9, 6, 11, 8, 10, 16, 12, 7, 0 | ||
49 | }; | ||
50 | static unsigned int cpu_6xx[16] = { | ||
51 | 0, 0, 14, 0, 0, 13, 5, 9, 6, 11, 8, 10, 0, 12, 7, 0 | ||
52 | }; | ||
53 | |||
54 | /* | ||
55 | * prom_init is the Gemini version of prom.c:prom_init. We only need | ||
56 | * the BSS clearing code, so I copied that out of prom.c. This is a | ||
57 | * lot simpler than hacking prom.c so it will build with Gemini. -VAL | ||
58 | */ | ||
59 | |||
60 | #define PTRRELOC(x) ((typeof(x))((unsigned long)(x) + offset)) | ||
61 | |||
62 | unsigned long | ||
63 | prom_init(void) | ||
64 | { | ||
65 | unsigned long offset = reloc_offset(); | ||
66 | unsigned long phys; | ||
67 | extern char __bss_start, _end; | ||
68 | |||
69 | /* First zero the BSS -- use memset, some arches don't have | ||
70 | * caches on yet */ | ||
71 | memset_io(PTRRELOC(&__bss_start),0 , &_end - &__bss_start); | ||
72 | |||
73 | /* Default */ | ||
74 | phys = offset + KERNELBASE; | ||
75 | |||
76 | gemini_prom_init(); | ||
77 | |||
78 | return phys; | ||
79 | } | ||
80 | |||
81 | int | ||
82 | gemini_show_cpuinfo(struct seq_file *m) | ||
83 | { | ||
84 | unsigned char reg, rev; | ||
85 | char *family; | ||
86 | unsigned int type; | ||
87 | |||
88 | reg = readb(GEMINI_FEAT); | ||
89 | family = gemini_board_families[((reg>>4) & 0xf)]; | ||
90 | if (((reg>>4) & 0xf) > gemini_board_count) | ||
91 | printk(KERN_ERR "cpuinfo(): unable to determine board family\n"); | ||
92 | |||
93 | reg = readb(GEMINI_BREV); | ||
94 | type = (reg>>4) & 0xf; | ||
95 | rev = reg & 0xf; | ||
96 | |||
97 | reg = readb(GEMINI_BECO); | ||
98 | |||
99 | seq_printf(m, "machine\t\t: Gemini %s%d, rev %c, eco %d\n", | ||
100 | family, type, (rev + 'A'), (reg & 0xf)); | ||
101 | |||
102 | seq_printf(m, "board\t\t: Gemini %s", family); | ||
103 | if (type > 9) | ||
104 | seq_printf(m, "%c", (type - 10) + 'A'); | ||
105 | else | ||
106 | seq_printf(m, "%d", type); | ||
107 | |||
108 | seq_printf(m, ", rev %c, eco %d\n", (rev + 'A'), (reg & 0xf)); | ||
109 | |||
110 | seq_printf(m, "clock\t\t: %dMhz\n", gemini_get_clock_speed()); | ||
111 | |||
112 | return 0; | ||
113 | } | ||
114 | |||
115 | static u_char gemini_openpic_initsenses[] = { | ||
116 | 1, | ||
117 | 1, | ||
118 | 1, | ||
119 | 1, | ||
120 | 0, | ||
121 | 0, | ||
122 | 1, /* remainder are level-triggered */ | ||
123 | }; | ||
124 | |||
125 | #define GEMINI_MPIC_ADDR (0xfcfc0000) | ||
126 | #define GEMINI_MPIC_PCI_CFG (0x80005800) | ||
127 | |||
128 | void __init gemini_openpic_init(void) | ||
129 | { | ||
130 | |||
131 | OpenPIC_Addr = (volatile struct OpenPIC *) | ||
132 | grackle_read(GEMINI_MPIC_PCI_CFG + 0x10); | ||
133 | OpenPIC_InitSenses = gemini_openpic_initsenses; | ||
134 | OpenPIC_NumInitSenses = sizeof( gemini_openpic_initsenses ); | ||
135 | |||
136 | ioremap( GEMINI_MPIC_ADDR, OPENPIC_SIZE); | ||
137 | } | ||
138 | |||
139 | |||
140 | extern unsigned long loops_per_jiffy; | ||
141 | extern int root_mountflags; | ||
142 | extern char cmd_line[]; | ||
143 | |||
144 | void | ||
145 | gemini_heartbeat(void) | ||
146 | { | ||
147 | static unsigned long led = GEMINI_LEDBASE+(4*8); | ||
148 | static char direction = 8; | ||
149 | |||
150 | |||
151 | /* We only want to do this on 1 CPU */ | ||
152 | if (smp_processor_id()) | ||
153 | return; | ||
154 | *(char *)led = 0; | ||
155 | if ( (led + direction) > (GEMINI_LEDBASE+(7*8)) || | ||
156 | (led + direction) < (GEMINI_LEDBASE+(4*8)) ) | ||
157 | direction *= -1; | ||
158 | led += direction; | ||
159 | *(char *)led = 0xff; | ||
160 | ppc_md.heartbeat_count = ppc_md.heartbeat_reset; | ||
161 | } | ||
162 | |||
163 | void __init gemini_setup_arch(void) | ||
164 | { | ||
165 | extern char cmd_line[]; | ||
166 | |||
167 | |||
168 | loops_per_jiffy = 50000000/HZ; | ||
169 | |||
170 | #ifdef CONFIG_BLK_DEV_INITRD | ||
171 | /* bootable off CDROM */ | ||
172 | if (initrd_start) | ||
173 | ROOT_DEV = Root_SR0; | ||
174 | else | ||
175 | #endif | ||
176 | ROOT_DEV = Root_SDA1; | ||
177 | |||
178 | /* nothing but serial consoles... */ | ||
179 | sprintf(cmd_line, "%s console=ttyS0", cmd_line); | ||
180 | |||
181 | printk("Boot arguments: %s\n", cmd_line); | ||
182 | |||
183 | ppc_md.heartbeat = gemini_heartbeat; | ||
184 | ppc_md.heartbeat_reset = HZ/8; | ||
185 | ppc_md.heartbeat_count = 1; | ||
186 | |||
187 | /* Lookup PCI hosts */ | ||
188 | gemini_find_bridges(); | ||
189 | /* take special pains to map the MPIC, since it isn't mapped yet */ | ||
190 | gemini_openpic_init(); | ||
191 | /* start the L2 */ | ||
192 | gemini_init_l2(); | ||
193 | } | ||
194 | |||
195 | |||
196 | int | ||
197 | gemini_get_clock_speed(void) | ||
198 | { | ||
199 | unsigned long hid1, pvr; | ||
200 | int clock; | ||
201 | |||
202 | pvr = mfspr(SPRN_PVR); | ||
203 | hid1 = (mfspr(SPRN_HID1) >> 28) & 0xf; | ||
204 | if (PVR_VER(pvr) == 8 || | ||
205 | PVR_VER(pvr) == 12) | ||
206 | hid1 = cpu_7xx[hid1]; | ||
207 | else | ||
208 | hid1 = cpu_6xx[hid1]; | ||
209 | |||
210 | switch((readb(GEMINI_BSTAT) & 0xc) >> 2) { | ||
211 | |||
212 | case 0: | ||
213 | default: | ||
214 | clock = (hid1*100)/3; | ||
215 | break; | ||
216 | |||
217 | case 1: | ||
218 | clock = (hid1*125)/3; | ||
219 | break; | ||
220 | |||
221 | case 2: | ||
222 | clock = (hid1*50); | ||
223 | break; | ||
224 | } | ||
225 | |||
226 | return clock; | ||
227 | } | ||
228 | |||
229 | void __init gemini_init_l2(void) | ||
230 | { | ||
231 | unsigned char reg, brev, fam, creg; | ||
232 | unsigned long cache; | ||
233 | unsigned long pvr; | ||
234 | |||
235 | reg = readb(GEMINI_L2CFG); | ||
236 | brev = readb(GEMINI_BREV); | ||
237 | fam = readb(GEMINI_FEAT); | ||
238 | pvr = mfspr(SPRN_PVR); | ||
239 | |||
240 | switch(PVR_VER(pvr)) { | ||
241 | |||
242 | case 8: | ||
243 | if (reg & 0xc0) | ||
244 | cache = (((reg >> 6) & 0x3) << 28); | ||
245 | else | ||
246 | cache = 0x3 << 28; | ||
247 | |||
248 | #ifdef CONFIG_SMP | ||
249 | /* Pre-3.0 processor revs had snooping errata. Leave | ||
250 | their L2's disabled with SMP. -- Dan */ | ||
251 | if (PVR_CFG(pvr) < 3) { | ||
252 | printk("Pre-3.0 750; L2 left disabled!\n"); | ||
253 | return; | ||
254 | } | ||
255 | #endif /* CONFIG_SMP */ | ||
256 | |||
257 | /* Special case: VGM5-B's came before L2 ratios were set on | ||
258 | the board. Processor speed shouldn't be too high, so | ||
259 | set L2 ratio to 1:1.5. */ | ||
260 | if ((brev == 0x51) && ((fam & 0xa0) >> 4) == 0) | ||
261 | reg |= 1; | ||
262 | |||
263 | /* determine best cache ratio based upon what the board | ||
264 | tells us (which sometimes _may_ not be true) and | ||
265 | the processor speed. */ | ||
266 | else { | ||
267 | if (gemini_get_clock_speed() > 250) | ||
268 | reg = 2; | ||
269 | } | ||
270 | break; | ||
271 | case 12: | ||
272 | { | ||
273 | static unsigned long l2_size_val = 0; | ||
274 | |||
275 | if (!l2_size_val) | ||
276 | l2_size_val = _get_L2CR(); | ||
277 | cache = l2_size_val; | ||
278 | break; | ||
279 | } | ||
280 | case 4: | ||
281 | case 9: | ||
282 | creg = readb(GEMINI_CPUSTAT); | ||
283 | if (((creg & 0xc) >> 2) != 1) | ||
284 | printk("Dual-604 boards don't support the use of L2\n"); | ||
285 | else | ||
286 | writeb(1, GEMINI_L2CFG); | ||
287 | return; | ||
288 | default: | ||
289 | printk("Unknown processor; L2 left disabled\n"); | ||
290 | return; | ||
291 | } | ||
292 | |||
293 | cache |= ((1<<reg) << 25); | ||
294 | cache |= (L2CR_L2RAM_MASK|L2CR_L2CTL|L2CR_L2DO); | ||
295 | _set_L2CR(0); | ||
296 | _set_L2CR(cache | L2CR_L2E); | ||
297 | |||
298 | } | ||
299 | |||
300 | void | ||
301 | gemini_restart(char *cmd) | ||
302 | { | ||
303 | local_irq_disable(); | ||
304 | /* make a clean restart, not via the MPIC */ | ||
305 | _gemini_reboot(); | ||
306 | for(;;); | ||
307 | } | ||
308 | |||
309 | void | ||
310 | gemini_power_off(void) | ||
311 | { | ||
312 | for(;;); | ||
313 | } | ||
314 | |||
315 | void | ||
316 | gemini_halt(void) | ||
317 | { | ||
318 | gemini_restart(NULL); | ||
319 | } | ||
320 | |||
321 | void __init gemini_init_IRQ(void) | ||
322 | { | ||
323 | /* gemini has no 8259 */ | ||
324 | openpic_init(1, 0, 0, -1); | ||
325 | } | ||
326 | |||
327 | #define gemini_rtc_read(x) (readb(GEMINI_RTC+(x))) | ||
328 | #define gemini_rtc_write(val,x) (writeb((val),(GEMINI_RTC+(x)))) | ||
329 | |||
330 | /* ensure that the RTC is up and running */ | ||
331 | long __init gemini_time_init(void) | ||
332 | { | ||
333 | unsigned char reg; | ||
334 | |||
335 | reg = gemini_rtc_read(M48T35_RTC_CONTROL); | ||
336 | |||
337 | if ( reg & M48T35_RTC_STOPPED ) { | ||
338 | printk(KERN_INFO "M48T35 real-time-clock was stopped. Now starting...\n"); | ||
339 | gemini_rtc_write((reg & ~(M48T35_RTC_STOPPED)), M48T35_RTC_CONTROL); | ||
340 | gemini_rtc_write((reg | M48T35_RTC_SET), M48T35_RTC_CONTROL); | ||
341 | } | ||
342 | return 0; | ||
343 | } | ||
344 | |||
345 | #undef DEBUG_RTC | ||
346 | |||
347 | unsigned long | ||
348 | gemini_get_rtc_time(void) | ||
349 | { | ||
350 | unsigned int year, mon, day, hour, min, sec; | ||
351 | unsigned char reg; | ||
352 | |||
353 | reg = gemini_rtc_read(M48T35_RTC_CONTROL); | ||
354 | gemini_rtc_write((reg|M48T35_RTC_READ), M48T35_RTC_CONTROL); | ||
355 | #ifdef DEBUG_RTC | ||
356 | printk("get rtc: reg = %x\n", reg); | ||
357 | #endif | ||
358 | |||
359 | do { | ||
360 | sec = gemini_rtc_read(M48T35_RTC_SECONDS); | ||
361 | min = gemini_rtc_read(M48T35_RTC_MINUTES); | ||
362 | hour = gemini_rtc_read(M48T35_RTC_HOURS); | ||
363 | day = gemini_rtc_read(M48T35_RTC_DOM); | ||
364 | mon = gemini_rtc_read(M48T35_RTC_MONTH); | ||
365 | year = gemini_rtc_read(M48T35_RTC_YEAR); | ||
366 | } while( sec != gemini_rtc_read(M48T35_RTC_SECONDS)); | ||
367 | #ifdef DEBUG_RTC | ||
368 | printk("get rtc: sec=%x, min=%x, hour=%x, day=%x, mon=%x, year=%x\n", | ||
369 | sec, min, hour, day, mon, year); | ||
370 | #endif | ||
371 | |||
372 | gemini_rtc_write(reg, M48T35_RTC_CONTROL); | ||
373 | |||
374 | BCD_TO_BIN(sec); | ||
375 | BCD_TO_BIN(min); | ||
376 | BCD_TO_BIN(hour); | ||
377 | BCD_TO_BIN(day); | ||
378 | BCD_TO_BIN(mon); | ||
379 | BCD_TO_BIN(year); | ||
380 | |||
381 | if ((year += 1900) < 1970) | ||
382 | year += 100; | ||
383 | #ifdef DEBUG_RTC | ||
384 | printk("get rtc: sec=%x, min=%x, hour=%x, day=%x, mon=%x, year=%x\n", | ||
385 | sec, min, hour, day, mon, year); | ||
386 | #endif | ||
387 | |||
388 | return mktime( year, mon, day, hour, min, sec ); | ||
389 | } | ||
390 | |||
391 | |||
392 | int | ||
393 | gemini_set_rtc_time( unsigned long now ) | ||
394 | { | ||
395 | unsigned char reg; | ||
396 | struct rtc_time tm; | ||
397 | |||
398 | to_tm( now, &tm ); | ||
399 | |||
400 | reg = gemini_rtc_read(M48T35_RTC_CONTROL); | ||
401 | #ifdef DEBUG_RTC | ||
402 | printk("set rtc: reg = %x\n", reg); | ||
403 | #endif | ||
404 | |||
405 | gemini_rtc_write((reg|M48T35_RTC_SET), M48T35_RTC_CONTROL); | ||
406 | #ifdef DEBUG_RTC | ||
407 | printk("set rtc: tm vals - sec=%x, min=%x, hour=%x, mon=%x, mday=%x, year=%x\n", | ||
408 | tm.tm_sec, tm.tm_min, tm.tm_hour, tm.tm_mon, tm.tm_mday, tm.tm_year); | ||
409 | #endif | ||
410 | |||
411 | tm.tm_year -= 1900; | ||
412 | BIN_TO_BCD(tm.tm_sec); | ||
413 | BIN_TO_BCD(tm.tm_min); | ||
414 | BIN_TO_BCD(tm.tm_hour); | ||
415 | BIN_TO_BCD(tm.tm_mon); | ||
416 | BIN_TO_BCD(tm.tm_mday); | ||
417 | BIN_TO_BCD(tm.tm_year); | ||
418 | #ifdef DEBUG_RTC | ||
419 | printk("set rtc: tm vals - sec=%x, min=%x, hour=%x, mon=%x, mday=%x, year=%x\n", | ||
420 | tm.tm_sec, tm.tm_min, tm.tm_hour, tm.tm_mon, tm.tm_mday, tm.tm_year); | ||
421 | #endif | ||
422 | |||
423 | gemini_rtc_write(tm.tm_sec, M48T35_RTC_SECONDS); | ||
424 | gemini_rtc_write(tm.tm_min, M48T35_RTC_MINUTES); | ||
425 | gemini_rtc_write(tm.tm_hour, M48T35_RTC_HOURS); | ||
426 | gemini_rtc_write(tm.tm_mday, M48T35_RTC_DOM); | ||
427 | gemini_rtc_write(tm.tm_mon, M48T35_RTC_MONTH); | ||
428 | gemini_rtc_write(tm.tm_year, M48T35_RTC_YEAR); | ||
429 | |||
430 | /* done writing */ | ||
431 | gemini_rtc_write(reg, M48T35_RTC_CONTROL); | ||
432 | |||
433 | return 0; | ||
434 | } | ||
435 | |||
436 | /* use the RTC to determine the decrementer count */ | ||
437 | void __init gemini_calibrate_decr(void) | ||
438 | { | ||
439 | int freq, divisor; | ||
440 | unsigned char reg; | ||
441 | |||
442 | /* determine processor bus speed */ | ||
443 | reg = readb(GEMINI_BSTAT); | ||
444 | |||
445 | switch(((reg & 0x0c)>>2)&0x3) { | ||
446 | case 0: | ||
447 | default: | ||
448 | freq = 66667; | ||
449 | break; | ||
450 | case 1: | ||
451 | freq = 83000; | ||
452 | break; | ||
453 | case 2: | ||
454 | freq = 100000; | ||
455 | break; | ||
456 | } | ||
457 | |||
458 | freq *= 1000; | ||
459 | divisor = 4; | ||
460 | tb_ticks_per_jiffy = freq / HZ / divisor; | ||
461 | tb_to_us = mulhwu_scale_factor(freq/divisor, 1000000); | ||
462 | } | ||
463 | |||
464 | unsigned long __init gemini_find_end_of_memory(void) | ||
465 | { | ||
466 | unsigned long total; | ||
467 | unsigned char reg; | ||
468 | |||
469 | reg = readb(GEMINI_MEMCFG); | ||
470 | total = ((1<<((reg & 0x7) - 1)) * | ||
471 | (8<<((reg >> 3) & 0x7))); | ||
472 | total *= (1024*1024); | ||
473 | return total; | ||
474 | } | ||
475 | |||
476 | static void __init | ||
477 | gemini_map_io(void) | ||
478 | { | ||
479 | io_block_mapping(0xf0000000, 0xf0000000, 0x10000000, _PAGE_IO); | ||
480 | io_block_mapping(0x80000000, 0x80000000, 0x10000000, _PAGE_IO); | ||
481 | } | ||
482 | |||
483 | #ifdef CONFIG_SMP | ||
484 | static int | ||
485 | smp_gemini_probe(void) | ||
486 | { | ||
487 | int i, nr; | ||
488 | |||
489 | nr = (readb(GEMINI_CPUSTAT) & GEMINI_CPU_COUNT_MASK) >> 2; | ||
490 | if (nr == 0) | ||
491 | nr = 4; | ||
492 | |||
493 | if (nr > 1) { | ||
494 | openpic_request_IPIs(); | ||
495 | for (i = 1; i < nr; ++i) | ||
496 | smp_hw_index[i] = i; | ||
497 | } | ||
498 | |||
499 | return nr; | ||
500 | } | ||
501 | |||
502 | static void | ||
503 | smp_gemini_kick_cpu(int nr) | ||
504 | { | ||
505 | openpic_reset_processor_phys(1 << nr); | ||
506 | openpic_reset_processor_phys(0); | ||
507 | } | ||
508 | |||
509 | static void | ||
510 | smp_gemini_setup_cpu(int cpu_nr) | ||
511 | { | ||
512 | if (OpenPIC_Addr) | ||
513 | do_openpic_setup_cpu(); | ||
514 | if (cpu_nr > 0) | ||
515 | gemini_init_l2(); | ||
516 | } | ||
517 | |||
518 | static struct smp_ops_t gemini_smp_ops = { | ||
519 | smp_openpic_message_pass, | ||
520 | smp_gemini_probe, | ||
521 | smp_gemini_kick_cpu, | ||
522 | smp_gemini_setup_cpu, | ||
523 | .give_timebase = smp_generic_give_timebase, | ||
524 | .take_timebase = smp_generic_take_timebase, | ||
525 | }; | ||
526 | #endif /* CONFIG_SMP */ | ||
527 | |||
528 | void __init platform_init(unsigned long r3, unsigned long r4, unsigned long r5, | ||
529 | unsigned long r6, unsigned long r7) | ||
530 | { | ||
531 | int i; | ||
532 | |||
533 | /* Restore BATs for now */ | ||
534 | mtspr(SPRN_DBAT3U, 0xf0001fff); | ||
535 | mtspr(SPRN_DBAT3L, 0xf000002a); | ||
536 | |||
537 | parse_bootinfo(find_bootinfo()); | ||
538 | |||
539 | for(i = 0; i < GEMINI_LEDS; i++) | ||
540 | gemini_led_off(i); | ||
541 | |||
542 | ISA_DMA_THRESHOLD = 0; | ||
543 | DMA_MODE_READ = 0; | ||
544 | DMA_MODE_WRITE = 0; | ||
545 | |||
546 | #ifdef CONFIG_BLK_DEV_INITRD | ||
547 | if ( r4 ) | ||
548 | { | ||
549 | initrd_start = r4 + KERNELBASE; | ||
550 | initrd_end = r5 + KERNELBASE; | ||
551 | } | ||
552 | #endif | ||
553 | |||
554 | ppc_md.setup_arch = gemini_setup_arch; | ||
555 | ppc_md.show_cpuinfo = gemini_show_cpuinfo; | ||
556 | ppc_md.init_IRQ = gemini_init_IRQ; | ||
557 | ppc_md.get_irq = openpic_get_irq; | ||
558 | ppc_md.init = NULL; | ||
559 | |||
560 | ppc_md.restart = gemini_restart; | ||
561 | ppc_md.power_off = gemini_power_off; | ||
562 | ppc_md.halt = gemini_halt; | ||
563 | |||
564 | ppc_md.time_init = gemini_time_init; | ||
565 | ppc_md.set_rtc_time = gemini_set_rtc_time; | ||
566 | ppc_md.get_rtc_time = gemini_get_rtc_time; | ||
567 | ppc_md.calibrate_decr = gemini_calibrate_decr; | ||
568 | |||
569 | ppc_md.find_end_of_memory = gemini_find_end_of_memory; | ||
570 | ppc_md.setup_io_mappings = gemini_map_io; | ||
571 | |||
572 | ppc_md.pcibios_fixup_bus = gemini_pcibios_fixup; | ||
573 | |||
574 | #ifdef CONFIG_SMP | ||
575 | smp_ops = &gemini_smp_ops; | ||
576 | #endif /* CONFIG_SMP */ | ||
577 | } | ||
diff --git a/arch/ppc/platforms/mpc866ads_setup.c b/arch/ppc/platforms/mpc866ads_setup.c index 8a0c07eb4449..5b05d4bd0df7 100644 --- a/arch/ppc/platforms/mpc866ads_setup.c +++ b/arch/ppc/platforms/mpc866ads_setup.c | |||
@@ -369,7 +369,7 @@ int __init mpc866ads_init(void) | |||
369 | ppc_sys_device_setfunc(MPC8xx_CPM_SMC1, PPC_SYS_FUNC_UART); | 369 | ppc_sys_device_setfunc(MPC8xx_CPM_SMC1, PPC_SYS_FUNC_UART); |
370 | #endif | 370 | #endif |
371 | 371 | ||
372 | #ifdef CONFIG_SERIAL_CPM_SMC | 372 | #ifdef CONFIG_SERIAL_CPM_SMC2 |
373 | ppc_sys_device_enable(MPC8xx_CPM_SMC2); | 373 | ppc_sys_device_enable(MPC8xx_CPM_SMC2); |
374 | ppc_sys_device_setfunc(MPC8xx_CPM_SMC2, PPC_SYS_FUNC_UART); | 374 | ppc_sys_device_setfunc(MPC8xx_CPM_SMC2, PPC_SYS_FUNC_UART); |
375 | #endif | 375 | #endif |
diff --git a/arch/ppc/syslib/Makefile b/arch/ppc/syslib/Makefile index dca23f2ef851..d84f04666972 100644 --- a/arch/ppc/syslib/Makefile +++ b/arch/ppc/syslib/Makefile | |||
@@ -45,7 +45,6 @@ obj-$(CONFIG_EBONY) += pci_auto.o todc_time.o | |||
45 | obj-$(CONFIG_EV64260) += todc_time.o pci_auto.o | 45 | obj-$(CONFIG_EV64260) += todc_time.o pci_auto.o |
46 | obj-$(CONFIG_EV64360) += todc_time.o | 46 | obj-$(CONFIG_EV64360) += todc_time.o |
47 | obj-$(CONFIG_CHESTNUT) += mv64360_pic.o pci_auto.o | 47 | obj-$(CONFIG_CHESTNUT) += mv64360_pic.o pci_auto.o |
48 | obj-$(CONFIG_GEMINI) += open_pic.o | ||
49 | obj-$(CONFIG_GT64260) += gt64260_pic.o | 48 | obj-$(CONFIG_GT64260) += gt64260_pic.o |
50 | obj-$(CONFIG_LOPEC) += pci_auto.o todc_time.o | 49 | obj-$(CONFIG_LOPEC) += pci_auto.o todc_time.o |
51 | obj-$(CONFIG_HDPU) += pci_auto.o | 50 | obj-$(CONFIG_HDPU) += pci_auto.o |
diff --git a/arch/ppc/syslib/m8260_pci_erratum9.c b/arch/ppc/syslib/m8260_pci_erratum9.c index 5475709ce07b..ebb8c8f8f30c 100644 --- a/arch/ppc/syslib/m8260_pci_erratum9.c +++ b/arch/ppc/syslib/m8260_pci_erratum9.c | |||
@@ -105,7 +105,8 @@ void idma_pci9_init(void) | |||
105 | idma_reg[IDMA_CHAN].idmr = 0; /* mask all IDMA interrupts */ | 105 | idma_reg[IDMA_CHAN].idmr = 0; /* mask all IDMA interrupts */ |
106 | idma_reg[IDMA_CHAN].idsr = 0xff; /* clear all event flags */ | 106 | idma_reg[IDMA_CHAN].idsr = 0xff; /* clear all event flags */ |
107 | 107 | ||
108 | printk("<4>Using IDMA%d for MPC8260 device erratum PCI 9 workaround\n", | 108 | printk(KERN_WARNING |
109 | "Using IDMA%d for MPC8260 device erratum PCI 9 workaround\n", | ||
109 | IDMA_CHAN + 1); | 110 | IDMA_CHAN + 1); |
110 | 111 | ||
111 | return; | 112 | return; |
diff --git a/arch/ppc/syslib/m8xx_setup.c b/arch/ppc/syslib/m8xx_setup.c index d8d299bd1a12..01e48d88f22d 100644 --- a/arch/ppc/syslib/m8xx_setup.c +++ b/arch/ppc/syslib/m8xx_setup.c | |||
@@ -77,7 +77,7 @@ static struct mtd_partition mpc8xxads_partitions[] = { | |||
77 | } | 77 | } |
78 | }; | 78 | }; |
79 | 79 | ||
80 | #define mpc8xxads_part_num (sizeof (mpc8xxads_partitions) / sizeof (mpc8xxads_partitions[0])) | 80 | #define mpc8xxads_part_num ARRAY_SIZE(mpc8xxads_partitions) |
81 | 81 | ||
82 | #endif | 82 | #endif |
83 | 83 | ||
diff --git a/arch/ppc/syslib/ppc85xx_rio.c b/arch/ppc/syslib/ppc85xx_rio.c index 05b0e9415085..2b097800cdd9 100644 --- a/arch/ppc/syslib/ppc85xx_rio.c +++ b/arch/ppc/syslib/ppc85xx_rio.c | |||
@@ -59,8 +59,6 @@ | |||
59 | #define DBELL_TID(x) (*(u8 *)(x + DOORBELL_TID_OFFSET)) | 59 | #define DBELL_TID(x) (*(u8 *)(x + DOORBELL_TID_OFFSET)) |
60 | #define DBELL_INF(x) (*(u16 *)(x + DOORBELL_INFO_OFFSET)) | 60 | #define DBELL_INF(x) (*(u16 *)(x + DOORBELL_INFO_OFFSET)) |
61 | 61 | ||
62 | #define is_power_of_2(x) (((x) & ((x) - 1)) == 0) | ||
63 | |||
64 | struct rio_atmu_regs { | 62 | struct rio_atmu_regs { |
65 | u32 rowtar; | 63 | u32 rowtar; |
66 | u32 pad1; | 64 | u32 pad1; |
diff --git a/arch/ppc/xmon/ppc-opc.c b/arch/ppc/xmon/ppc-opc.c index 533a6c9973d4..034313cef6e7 100644 --- a/arch/ppc/xmon/ppc-opc.c +++ b/arch/ppc/xmon/ppc-opc.c | |||
@@ -19,6 +19,7 @@ along with this file; see the file COPYING. If not, write to the Free | |||
19 | Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ | 19 | Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ |
20 | 20 | ||
21 | #include <linux/posix_types.h> | 21 | #include <linux/posix_types.h> |
22 | #include <linux/kernel.h> | ||
22 | #include "ansidecl.h" | 23 | #include "ansidecl.h" |
23 | #include "ppc.h" | 24 | #include "ppc.h" |
24 | 25 | ||
@@ -2669,8 +2670,7 @@ const struct powerpc_opcode powerpc_opcodes[] = { | |||
2669 | 2670 | ||
2670 | }; | 2671 | }; |
2671 | 2672 | ||
2672 | const int powerpc_num_opcodes = | 2673 | const int powerpc_num_opcodes = ARRAY_SIZE(powerpc_opcodes); |
2673 | sizeof (powerpc_opcodes) / sizeof (powerpc_opcodes[0]); | ||
2674 | 2674 | ||
2675 | /* The macro table. This is only used by the assembler. */ | 2675 | /* The macro table. This is only used by the assembler. */ |
2676 | 2676 | ||
@@ -2717,5 +2717,4 @@ const struct powerpc_macro powerpc_macros[] = { | |||
2717 | 2717 | ||
2718 | }; | 2718 | }; |
2719 | 2719 | ||
2720 | const int powerpc_num_macros = | 2720 | const int powerpc_num_macros = ARRAY_SIZE(powerpc_macros); |
2721 | sizeof (powerpc_macros) / sizeof (powerpc_macros[0]); | ||
diff --git a/arch/ppc/xmon/start.c b/arch/ppc/xmon/start.c index d74a883e5bde..8f0b953179fa 100644 --- a/arch/ppc/xmon/start.c +++ b/arch/ppc/xmon/start.c | |||
@@ -58,10 +58,7 @@ static struct sysrq_key_op sysrq_xmon_op = | |||
58 | void | 58 | void |
59 | xmon_map_scc(void) | 59 | xmon_map_scc(void) |
60 | { | 60 | { |
61 | #if defined(CONFIG_GEMINI) | 61 | #if defined(CONFIG_405GP) |
62 | /* should already be mapped by the kernel boot */ | ||
63 | sccd = (volatile unsigned char *) 0xffeffb08; | ||
64 | #elif defined(CONFIG_405GP) | ||
65 | sccd = (volatile unsigned char *)0xef600300; | 62 | sccd = (volatile unsigned char *)0xef600300; |
66 | #elif defined(CONFIG_440EP) | 63 | #elif defined(CONFIG_440EP) |
67 | sccd = (volatile unsigned char *) ioremap(PPC440EP_UART0_ADDR, 8); | 64 | sccd = (volatile unsigned char *) ioremap(PPC440EP_UART0_ADDR, 8); |