aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2006-03-27 18:22:10 -0500
committerPaul Mackerras <paulus@samba.org>2006-03-27 18:22:10 -0500
commit0a26b1364f14852bc9a51db0ca63c5250c775627 (patch)
tree83422473cb4bf4c450012cded06288a0dc6abedf /arch
parentff2e6d7e27cf1f757ab0d97e1a9e46de47152a0e (diff)
ppc: Remove CHRP, POWER3 and POWER4 support from arch/ppc
32-bit CHRP machines are now supported only in arch/powerpc, as are all 64-bit PowerPC processors. This means that we don't use Open Firmware on any platform in arch/ppc any more. This makes PReP support a single-platform option like every other platform support option in arch/ppc now, thus CONFIG_PPC_MULTIPLATFORM is gone from arch/ppc. CONFIG_PPC_PREP is the option that selects PReP support and is generally what has replaced CONFIG_PPC_MULTIPLATFORM within arch/ppc. _machine is all but dead now, being #defined to 0. Updated Makefiles, comments and Kconfig options generally to reflect these changes. Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/ppc/Kconfig86
-rw-r--r--arch/ppc/Kconfig.debug7
-rw-r--r--arch/ppc/Makefile2
-rw-r--r--arch/ppc/boot/Makefile7
-rw-r--r--arch/ppc/boot/openfirmware/Makefile109
-rw-r--r--arch/ppc/boot/openfirmware/chrpmain.c101
-rw-r--r--arch/ppc/boot/openfirmware/common.c146
-rw-r--r--arch/ppc/boot/openfirmware/dummy.c4
-rw-r--r--arch/ppc/boot/openfirmware/misc.S67
-rw-r--r--arch/ppc/boot/openfirmware/start.c172
-rw-r--r--arch/ppc/boot/simple/mpc10x_memory.c4
-rw-r--r--arch/ppc/boot/simple/relocate.S2
-rw-r--r--arch/ppc/boot/utils/addnote.c175
-rw-r--r--arch/ppc/boot/utils/hack-coff.c84
-rw-r--r--arch/ppc/boot/utils/mknote.c44
-rw-r--r--arch/ppc/configs/ibmchrp_defconfig875
-rw-r--r--arch/ppc/configs/pmac_defconfig1591
-rw-r--r--arch/ppc/configs/power3_defconfig1035
-rw-r--r--arch/ppc/configs/prep_defconfig (renamed from arch/ppc/configs/common_defconfig)0
-rw-r--r--arch/ppc/kernel/entry.S52
-rw-r--r--arch/ppc/kernel/head.S183
-rw-r--r--arch/ppc/kernel/pci.c396
-rw-r--r--arch/ppc/kernel/ppc_htab.c8
-rw-r--r--arch/ppc/kernel/ppc_ksyms.c22
-rw-r--r--arch/ppc/kernel/setup.c254
-rw-r--r--arch/ppc/mm/hashtable.S34
-rw-r--r--arch/ppc/mm/init.c13
-rw-r--r--arch/ppc/mm/mmu_context.c2
-rw-r--r--arch/ppc/mm/pgtable.c2
-rw-r--r--arch/ppc/mm/ppc_mmu.c28
-rw-r--r--arch/ppc/platforms/Makefile12
-rw-r--r--arch/ppc/platforms/chrp_nvram.c83
-rw-r--r--arch/ppc/platforms/chrp_pci.c309
-rw-r--r--arch/ppc/platforms/chrp_pegasos_eth.c211
-rw-r--r--arch/ppc/platforms/chrp_setup.c669
-rw-r--r--arch/ppc/platforms/chrp_smp.c99
-rw-r--r--arch/ppc/platforms/chrp_time.c251
-rw-r--r--arch/ppc/syslib/Makefile2
-rw-r--r--arch/ppc/syslib/open_pic.c2
-rw-r--r--arch/ppc/syslib/prom.c1429
-rw-r--r--arch/ppc/syslib/prom_init.c1011
-rw-r--r--arch/ppc/xmon/start.c2
42 files changed, 47 insertions, 9538 deletions
diff --git a/arch/ppc/Kconfig b/arch/ppc/Kconfig
index 75802ca0f8c7..e9a8f5d1dfcd 100644
--- a/arch/ppc/Kconfig
+++ b/arch/ppc/Kconfig
@@ -61,15 +61,15 @@ config 6xx
61 select PPC_FPU 61 select PPC_FPU
62 help 62 help
63 There are four types of PowerPC chips supported. The more common 63 There are four types of PowerPC chips supported. The more common
64 types (601, 603, 604, 740, 750, 7400), the Motorola embedded 64 types (601, 603, 604, 740, 750, 7400), the older Freescale
65 versions (821, 823, 850, 855, 860, 52xx, 82xx, 83xx), the IBM 65 (formerly Motorola) embedded versions (821, 823, 850, 855, 860,
66 embedded versions (403 and 405) and the POWER3 processor. 66 52xx, 82xx, 83xx), the IBM embedded versions (403 and 405) and
67 (For support for more recent 64-bit processors, set ARCH=powerpc.) 67 the Book E embedded processors from IBM (44x) and Freescale (85xx).
68 For support for 64-bit processors, set ARCH=powerpc.
68 Unless you are building a kernel for one of the embedded processor 69 Unless you are building a kernel for one of the embedded processor
69 systems or a POWER3-based IBM RS/6000, choose 6xx. 70 systems, choose 6xx.
70 Note that the kernel runs in 32-bit mode even on 64-bit chips. 71 Also note that because the 52xx, 82xx, & 83xx family have a 603e
71 Also note that because the 52xx, 82xx, & 83xx family has a 603e core, 72 core, specific support for that chipset is asked later on.
72 specific support for that chipset is asked later on.
73 73
74config 40x 74config 40x
75 bool "40x" 75 bool "40x"
@@ -77,10 +77,6 @@ config 40x
77config 44x 77config 44x
78 bool "44x" 78 bool "44x"
79 79
80config POWER3
81 select PPC_FPU
82 bool "POWER3"
83
84config 8xx 80config 8xx
85 bool "8xx" 81 bool "8xx"
86 82
@@ -252,14 +248,9 @@ config PPC601_SYNC_FIX
252source arch/ppc/platforms/4xx/Kconfig 248source arch/ppc/platforms/4xx/Kconfig
253source arch/ppc/platforms/85xx/Kconfig 249source arch/ppc/platforms/85xx/Kconfig
254 250
255config PPC64BRIDGE
256 bool
257 depends on POWER3
258 default y
259
260config PPC_STD_MMU 251config PPC_STD_MMU
261 bool 252 bool
262 depends on 6xx || POWER3 253 depends on 6xx
263 default y 254 default y
264 255
265config NOT_COHERENT_CACHE 256config NOT_COHERENT_CACHE
@@ -534,8 +525,8 @@ endmenu
534 525
535choice 526choice
536 prompt "Machine Type" 527 prompt "Machine Type"
537 depends on 6xx || POWER3 528 depends on 6xx
538 default PPC_MULTIPLATFORM 529 default PPC_PREP
539 ---help--- 530 ---help---
540 Linux currently supports several different kinds of PowerPC-based 531 Linux currently supports several different kinds of PowerPC-based
541 machines: Apple Power Macintoshes and clones (such as the Motorola 532 machines: Apple Power Macintoshes and clones (such as the Motorola
@@ -545,15 +536,14 @@ choice
545 Platform) machines (including all of the recent IBM RS/6000 and 536 Platform) machines (including all of the recent IBM RS/6000 and
546 pSeries machines), and several embedded PowerPC systems containing 537 pSeries machines), and several embedded PowerPC systems containing
547 4xx, 6xx, 7xx, 8xx, 74xx, and 82xx processors. Currently, the 538 4xx, 6xx, 7xx, 8xx, 74xx, and 82xx processors. Currently, the
548 default option is to build a kernel which works on PReP and CHRP. 539 default option is to build a kernel which works on PReP.
549 540
550 Note that support for Apple machines is now only available with 541 Note that support for Apple and CHRP machines is now only available
551 ARCH=powerpc, and has been removed from this menu. If you wish 542 with ARCH=powerpc, and has been removed from this menu. If you
552 to build a kernel for an Apple machine, exit this configuration 543 wish to build a kernel for an Apple or CHRP machine, exit this
553 process and re-run it with ARCH=powerpc. 544 configuration process and re-run it with ARCH=powerpc.
554 545
555 Select CHRP/PReP if configuring for an IBM RS/6000 or 546 Select PReP if configuring for a PReP machine.
556 pSeries machine, or a PReP machine.
557 547
558 Select Gemini if configuring for a Synergy Microsystems' Gemini 548 Select Gemini if configuring for a Synergy Microsystems' Gemini
559 series Single Board Computer. More information is available at: 549 series Single Board Computer. More information is available at:
@@ -562,8 +552,8 @@ choice
562 Select APUS if configuring for a PowerUP Amiga. More information is 552 Select APUS if configuring for a PowerUP Amiga. More information is
563 available at: <http://linux-apus.sourceforge.net/>. 553 available at: <http://linux-apus.sourceforge.net/>.
564 554
565config PPC_MULTIPLATFORM 555config PPC_PREP
566 bool "CHRP/PReP" 556 bool "PReP"
567 557
568config APUS 558config APUS
569 bool "Amiga-APUS" 559 bool "Amiga-APUS"
@@ -807,25 +797,6 @@ config CPM2
807 you wish to build a kernel for a machine with a CPM2 coprocessor 797 you wish to build a kernel for a machine with a CPM2 coprocessor
808 on it (826x, 827x, 8560). 798 on it (826x, 827x, 8560).
809 799
810config PPC_CHRP
811 bool "Support for CHRP (Common Hardware Reference Platform) machines"
812 depends on PPC_MULTIPLATFORM
813 select PPC_I8259
814 select PPC_INDIRECT_PCI
815 default y
816
817config PPC_PREP
818 bool "Support for PReP (PowerPC Reference Platform) machines"
819 depends on PPC_MULTIPLATFORM
820 select PPC_I8259
821 select PPC_INDIRECT_PCI
822 default y
823
824config PPC_OF
825 bool
826 depends on PPC_CHRP
827 default y
828
829config PPC_GEN550 800config PPC_GEN550
830 bool 801 bool
831 depends on SANDPOINT || SPRUCE || PPLUS || \ 802 depends on SANDPOINT || SPRUCE || PPLUS || \
@@ -984,14 +955,6 @@ source "mm/Kconfig"
984 955
985source "fs/Kconfig.binfmt" 956source "fs/Kconfig.binfmt"
986 957
987config PROC_DEVICETREE
988 bool "Support for Open Firmware device tree in /proc"
989 depends on PPC_OF && PROC_FS
990 help
991 This option adds a device-tree directory under /proc which contains
992 an image of the device tree that the kernel copies from Open
993 Firmware. If unsure, say Y here.
994
995config PREP_RESIDUAL 958config PREP_RESIDUAL
996 bool "Support for PReP Residual Data" 959 bool "Support for PReP Residual Data"
997 depends on PPC_PREP 960 depends on PPC_PREP
@@ -1184,8 +1147,7 @@ menu "Bus options"
1184 1147
1185config ISA 1148config ISA
1186 bool "Support for ISA-bus hardware" 1149 bool "Support for ISA-bus hardware"
1187 depends on PPC_PREP || PPC_CHRP 1150 depends on PPC_PREP
1188 select PPC_I8259
1189 help 1151 help
1190 Find out whether you have ISA slots on your motherboard. ISA is the 1152 Find out whether you have ISA slots on your motherboard. ISA is the
1191 name of a bus system, i.e. the way the CPU talks to the other stuff 1153 name of a bus system, i.e. the way the CPU talks to the other stuff
@@ -1195,18 +1157,18 @@ config ISA
1195 1157
1196config GENERIC_ISA_DMA 1158config GENERIC_ISA_DMA
1197 bool 1159 bool
1198 depends on POWER3 || 6xx && !CPM2 1160 depends on 6xx && !CPM2
1199 default y 1161 default y
1200 1162
1201config PPC_I8259 1163config PPC_I8259
1202 bool 1164 bool
1203 default y if 85xx 1165 default y if 85xx || PPC_PREP
1204 default n 1166 default n
1205 1167
1206config PPC_INDIRECT_PCI 1168config PPC_INDIRECT_PCI
1207 bool 1169 bool
1208 depends on PCI 1170 depends on PCI
1209 default y if 40x || 44x || 85xx || 83xx 1171 default y if 40x || 44x || 85xx || 83xx || PPC_PREP
1210 default n 1172 default n
1211 1173
1212config EISA 1174config EISA
@@ -1397,7 +1359,7 @@ config CONSISTENT_SIZE
1397 1359
1398config BOOT_LOAD_BOOL 1360config BOOT_LOAD_BOOL
1399 bool "Set the boot link/load address" 1361 bool "Set the boot link/load address"
1400 depends on ADVANCED_OPTIONS && !PPC_MULTIPLATFORM 1362 depends on ADVANCED_OPTIONS && !PPC_PREP
1401 help 1363 help
1402 This option allows you to set the initial load address of the zImage 1364 This option allows you to set the initial load address of the zImage
1403 or zImage.initrd file. This can be useful if you are on a board 1365 or zImage.initrd file. This can be useful if you are on a board
diff --git a/arch/ppc/Kconfig.debug b/arch/ppc/Kconfig.debug
index 8cc75abf3d83..f94b87740973 100644
--- a/arch/ppc/Kconfig.debug
+++ b/arch/ppc/Kconfig.debug
@@ -53,13 +53,6 @@ config BDI_SWITCH
53 Unless you are intending to debug the kernel with one of these 53 Unless you are intending to debug the kernel with one of these
54 machines, say N here. 54 machines, say N here.
55 55
56config BOOTX_TEXT
57 bool "Support for early boot text console (BootX or OpenFirmware only)"
58 depends PPC_OF
59 help
60 Say Y here to see progress messages from the boot firmware in text
61 mode. Requires either BootX or Open Firmware.
62
63config SERIAL_TEXT_DEBUG 56config SERIAL_TEXT_DEBUG
64 bool "Support for early boot texts over serial port" 57 bool "Support for early boot texts over serial port"
65 depends on 4xx || LOPEC || MV64X60 || PPLUS || PRPMC800 || \ 58 depends on 4xx || LOPEC || MV64X60 || PPLUS || PRPMC800 || \
diff --git a/arch/ppc/Makefile b/arch/ppc/Makefile
index cde5fa87f455..e250f8333edf 100644
--- a/arch/ppc/Makefile
+++ b/arch/ppc/Makefile
@@ -40,10 +40,8 @@ ifndef CONFIG_FSL_BOOKE
40CFLAGS += -mstring 40CFLAGS += -mstring
41endif 41endif
42 42
43cpu-as-$(CONFIG_PPC64BRIDGE) += -Wa,-mppc64bridge
44cpu-as-$(CONFIG_4xx) += -Wa,-m405 43cpu-as-$(CONFIG_4xx) += -Wa,-m405
45cpu-as-$(CONFIG_6xx) += -Wa,-maltivec 44cpu-as-$(CONFIG_6xx) += -Wa,-maltivec
46cpu-as-$(CONFIG_POWER4) += -Wa,-maltivec
47cpu-as-$(CONFIG_E500) += -Wa,-me500 45cpu-as-$(CONFIG_E500) += -Wa,-me500
48cpu-as-$(CONFIG_E200) += -Wa,-me200 46cpu-as-$(CONFIG_E200) += -Wa,-me200
49 47
diff --git a/arch/ppc/boot/Makefile b/arch/ppc/boot/Makefile
index 84eec0bef93c..b739e25d4728 100644
--- a/arch/ppc/boot/Makefile
+++ b/arch/ppc/boot/Makefile
@@ -19,14 +19,13 @@ HOSTCFLAGS += -Iarch/$(ARCH)/boot/include
19BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd 19BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd
20 20
21bootdir-y := simple 21bootdir-y := simple
22bootdir-$(CONFIG_PPC_OF) += openfirmware
23subdir-y := lib common images 22subdir-y := lib common images
24subdir-$(CONFIG_PPC_MULTIPLATFORM) += of1275 23subdir-$(CONFIG_PPC_PREP) += of1275
25 24
26# for cleaning 25# for cleaning
27subdir- += simple openfirmware 26subdir- += simple
28 27
29hostprogs-y := $(addprefix utils/, addnote mknote hack-coff mkprep mkbugboot mktree) 28hostprogs-y := $(addprefix utils/, mkprep mkbugboot mktree)
30 29
31PHONY += $(BOOT_TARGETS) $(bootdir-y) 30PHONY += $(BOOT_TARGETS) $(bootdir-y)
32 31
diff --git a/arch/ppc/boot/openfirmware/Makefile b/arch/ppc/boot/openfirmware/Makefile
deleted file mode 100644
index 66b739743759..000000000000
--- a/arch/ppc/boot/openfirmware/Makefile
+++ /dev/null
@@ -1,109 +0,0 @@
1# Makefile for making bootable images on various OpenFirmware machines.
2#
3# This file is included by the global makefile so that you can add your own
4# architecture-specific flags and dependencies.
5#
6# Paul Mackerras January 1997
7# XCOFF bootable images for PowerMacs
8# Geert Uytterhoeven September 1997
9# ELF bootable iamges for CHRP machines.
10# Tom Rini January 2001
11# Cleaned up, moved into arch/ppc/boot/pmac
12# Tom Rini July/August 2002
13# Merged 'chrp' and 'pmac' into 'openfirmware', and cleaned up the
14# rules.
15
16zImage.initrd znetboot.initrd: del-ramdisk-sec := -R .ramdisk
17zImage.initrd znetboot.initrd: initrd := .initrd
18
19
20boot := arch/ppc/boot
21common := $(boot)/common
22utils := $(boot)/utils
23bootlib := $(boot)/lib
24of1275 := $(boot)/of1275
25images := $(boot)/images
26
27CHRP_LD_ARGS := -T $(srctree)/$(boot)/ld.script -e _start -Ttext 0x00800000
28
29COMMONOBJS := start.o misc.o common.o
30CHRPOBJS := crt0.o $(COMMONOBJS) chrpmain.o
31
32targets := $(CHRPOBJS) dummy.o
33CHRPOBJS := $(addprefix $(obj)/, $(CHRPOBJS))
34
35LIBS := lib/lib.a $(bootlib)/lib.a $(of1275)/lib.a $(common)/lib.a
36
37ifdef CONFIG_SMP
38END := .smp
39endif
40ifdef CONFIG_PPC64BRIDGE
41END += .64
42endif
43
44
45$(images)/ramdisk.image.gz:
46 @echo ' MISSING $@'
47 @echo ' RAM disk image must be provided separately'
48 @/bin/false
49
50quiet_cmd_genimage = GEN $@
51 cmd_genimage = $(OBJCOPY) -R .comment \
52 --add-section=.image=$(images)/vmlinux.gz \
53 --set-section-flags=.image=contents,alloc,load,readonly,data $< $@
54
55targets += image.o
56$(obj)/image.o: $(obj)/dummy.o $(images)/vmlinux.gz FORCE
57 $(call if_changed,genimage)
58
59# Place the ramdisk in the initrd image.
60quiet_cmd_genimage-initrd = GEN $@
61 cmd_genimage-initrd = $(OBJCOPY) $< $@ \
62 --add-section=.ramdisk=$(images)/ramdisk.image.gz \
63 --set-section-flags=.ramdisk=contents,alloc,load,readonly,data
64targets += image.initrd.o
65$(obj)/image.initrd.o: $(obj)/image.o $(images)/ramdisk.image.gz FORCE
66 $(call if_changed,genimage-initrd)
67
68
69targets += crt0.o
70$(obj)/crt0.o: $(common)/crt0.S FORCE
71 $(call if_changed_dep,as_o_S)
72
73quiet_cmd_gen-chrp = CHRP $@
74 cmd_gen-chrp = $(LD) $(CHRP_LD_ARGS) -o $@ $(CHRPOBJS) $< $(LIBS) && \
75 $(OBJCOPY) $@ $@ -R .comment $(del-ramdisk-sec)
76
77$(images)/zImage.chrp: $(obj)/image.o $(CHRPOBJS) $(LIBS) \
78 $(srctree)/$(boot)/ld.script
79 $(call cmd,gen-chrp)
80$(images)/zImage.initrd.chrp: $(obj)/image.initrd.o $(CHRPOBJS) $(LIBS) \
81 $(srctree)/$(boot)/ld.script
82 $(call cmd,gen-chrp)
83
84quiet_cmd_addnote = ADDNOTE $@
85 cmd_addnote = cat $< > $@ && $(utils)/addnote $@
86$(images)/zImage.chrp-rs6k $(images)/zImage.initrd.chrp-rs6k: \
87 %-rs6k: %
88 $(call cmd,addnote)
89
90# The targets used on the make command-line
91
92PHONY += zImage zImage.initrd
93zImage: $(images)/zImage.chrp \
94 $(images)/zImage.chrp-rs6k
95 @echo ' kernel: $@ is ready ($<)'
96zImage.initrd: $(images)/zImage.initrd.chrp \
97 $(images)/zImage.initrd.chrp-rs6k
98 @echo ' kernel: $@ is ready ($<)'
99
100TFTPIMAGE := /tftpboot/zImage
101
102PHONY += znetboot znetboot.initrd
103znetboot: $(images)/zImage.chrp
104 cp $(images)/zImage.chrp $(TFTPIMAGE).chrp$(END)
105 @echo ' kernel: $@ is ready ($<)'
106znetboot.initrd:$(images)/zImage.initrd.chrp
107 cp $(images)/zImage.initrd.chrp $(TFTPIMAGE).chrp$(END)
108 @echo ' kernel: $@ is ready ($<)'
109
diff --git a/arch/ppc/boot/openfirmware/chrpmain.c b/arch/ppc/boot/openfirmware/chrpmain.c
deleted file mode 100644
index 245dbd9fc120..000000000000
--- a/arch/ppc/boot/openfirmware/chrpmain.c
+++ /dev/null
@@ -1,101 +0,0 @@
1/*
2 * Copyright (C) Paul Mackerras 1997.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
8 */
9#include <linux/string.h>
10#include "nonstdio.h"
11#include "of1275.h"
12#include <asm/processor.h>
13#include <asm/page.h>
14
15/* Passed from the linker */
16extern char __image_begin, __image_end;
17extern char __ramdisk_begin, __ramdisk_end;
18extern char _start, _end;
19
20extern unsigned int heap_max;
21extern void flush_cache(void *, unsigned long);
22extern void gunzip(void *, int, unsigned char *, int *);
23extern void make_bi_recs(unsigned long addr, char *name, unsigned int mach,
24 unsigned int progend);
25
26char *avail_ram;
27char *begin_avail, *end_avail;
28char *avail_high;
29
30#define RAM_START 0x00000000
31#define RAM_END (64<<20)
32
33#define BOOT_START ((unsigned long)_start)
34#define BOOT_END ((unsigned long)(_end + 0xFFF) & ~0xFFF)
35
36#define RAM_FREE ((unsigned long)(_end+0x1000)&~0xFFF)
37#define PROG_START 0x00010000
38#define PROG_SIZE 0x007f0000 /* 8MB */
39
40#define SCRATCH_SIZE (128 << 10)
41
42static char scratch[SCRATCH_SIZE]; /* 128k of scratch space for gunzip */
43
44typedef void (*kernel_start_t)(int, int, void *, unsigned int, unsigned int);
45
46void
47boot(int a1, int a2, void *prom)
48{
49 unsigned sa, len;
50 void *dst;
51 unsigned char *im;
52 unsigned int initrd_size, initrd_start;
53
54 printf("chrpboot starting: loaded at 0x%p\n\r", &_start);
55
56 initrd_size = &__ramdisk_end - &__ramdisk_begin;
57 if (initrd_size) {
58 initrd_start = (RAM_END - initrd_size) & ~0xFFF;
59 a1 = initrd_start;
60 a2 = initrd_size;
61 claim(initrd_start, RAM_END - initrd_start, 0);
62 printf("initial ramdisk moving 0x%x <- 0x%p (%x bytes)\n\r",
63 initrd_start, &__ramdisk_begin, initrd_size);
64 memcpy((char *)initrd_start, &__ramdisk_begin, initrd_size);
65 } else {
66 initrd_start = 0;
67 initrd_size = 0;
68 a2 = 0xdeadbeef;
69 }
70
71 im = &__image_begin;
72 len = &__image_end - &__image_begin;
73 /* claim 4MB starting at PROG_START */
74 claim(PROG_START, PROG_SIZE - PROG_START, 0);
75 dst = (void *) PROG_START;
76 if (im[0] == 0x1f && im[1] == 0x8b) {
77 avail_ram = scratch;
78 begin_avail = avail_high = avail_ram;
79 end_avail = scratch + sizeof(scratch);
80 printf("gunzipping (0x%p <- 0x%p:0x%p)...", dst, im, im+len);
81 gunzip(dst, PROG_SIZE - PROG_START, im, &len);
82 printf("done %u bytes\n\r", len);
83 printf("%u bytes of heap consumed, max in use %u\n\r",
84 avail_high - begin_avail, heap_max);
85 } else {
86 memmove(dst, im, len);
87 }
88
89 flush_cache(dst, len);
90 make_bi_recs(((unsigned long) dst + len), "chrpboot", _MACH_chrp,
91 (PROG_START + PROG_SIZE));
92
93 sa = PROG_START;
94 printf("start address = 0x%x\n\r", sa);
95
96 (*(kernel_start_t)sa)(a1, a2, prom, initrd_start, initrd_size);
97
98 printf("returned?\n\r");
99
100 pause();
101}
diff --git a/arch/ppc/boot/openfirmware/common.c b/arch/ppc/boot/openfirmware/common.c
deleted file mode 100644
index 0f46756a903e..000000000000
--- a/arch/ppc/boot/openfirmware/common.c
+++ /dev/null
@@ -1,146 +0,0 @@
1/*
2 * Copyright (C) Paul Mackerras 1997.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
8 */
9
10#include "nonstdio.h"
11#include "of1275.h"
12#include <linux/string.h>
13#include <linux/zlib.h>
14#include <asm/bootinfo.h>
15#include <asm/page.h>
16
17/* Information from the linker */
18
19extern int strcmp(const char *s1, const char *s2);
20extern char *avail_ram, *avail_high;
21extern char *end_avail;
22
23unsigned int heap_use, heap_max;
24
25struct memchunk {
26 unsigned int size;
27 struct memchunk *next;
28};
29
30static struct memchunk *freechunks;
31
32static void *zalloc(unsigned size)
33{
34 void *p;
35 struct memchunk **mpp, *mp;
36
37 size = (size + 7) & -8;
38 heap_use += size;
39 if (heap_use > heap_max)
40 heap_max = heap_use;
41 for (mpp = &freechunks; (mp = *mpp) != 0; mpp = &mp->next) {
42 if (mp->size == size) {
43 *mpp = mp->next;
44 return mp;
45 }
46 }
47 p = avail_ram;
48 avail_ram += size;
49 if (avail_ram > avail_high)
50 avail_high = avail_ram;
51 if (avail_ram > end_avail) {
52 printf("oops... out of memory\n\r");
53 pause();
54 }
55 return p;
56}
57
58#define HEAD_CRC 2
59#define EXTRA_FIELD 4
60#define ORIG_NAME 8
61#define COMMENT 0x10
62#define RESERVED 0xe0
63
64void gunzip(void *dst, int dstlen, unsigned char *src, int *lenp)
65{
66 z_stream s;
67 int r, i, flags;
68
69 /* skip header */
70 i = 10;
71 flags = src[3];
72 if (src[2] != Z_DEFLATED || (flags & RESERVED) != 0) {
73 printf("bad gzipped data\n\r");
74 exit();
75 }
76 if ((flags & EXTRA_FIELD) != 0)
77 i = 12 + src[10] + (src[11] << 8);
78 if ((flags & ORIG_NAME) != 0)
79 while (src[i++] != 0)
80 ;
81 if ((flags & COMMENT) != 0)
82 while (src[i++] != 0)
83 ;
84 if ((flags & HEAD_CRC) != 0)
85 i += 2;
86 if (i >= *lenp) {
87 printf("gunzip: ran out of data in header\n\r");
88 exit();
89 }
90
91 /* Initialize ourself. */
92 s.workspace = zalloc(zlib_inflate_workspacesize());
93 r = zlib_inflateInit2(&s, -MAX_WBITS);
94 if (r != Z_OK) {
95 printf("zlib_inflateInit2 returned %d\n\r", r);
96 exit();
97 }
98 s.next_in = src + i;
99 s.avail_in = *lenp - i;
100 s.next_out = dst;
101 s.avail_out = dstlen;
102 r = zlib_inflate(&s, Z_FINISH);
103 if (r != Z_OK && r != Z_STREAM_END) {
104 printf("inflate returned %d msg: %s\n\r", r, s.msg);
105 exit();
106 }
107 *lenp = s.next_out - (unsigned char *) dst;
108 zlib_inflateEnd(&s);
109}
110
111/* Make a bi_rec in OF. We need to be passed a name for BI_BOOTLOADER_ID,
112 * a machine type for BI_MACHTYPE, and the location where the end of the
113 * bootloader is (PROG_START + PROG_SIZE)
114 */
115void make_bi_recs(unsigned long addr, char *name, unsigned int mach,
116 unsigned long progend)
117{
118 struct bi_record *rec;
119
120
121 /* leave a 1MB gap then align to the next 1MB boundary */
122 addr = _ALIGN(addr+ (1<<20) - 1, (1<<20));
123 /* oldworld machine seem very unhappy about this. -- Tom */
124 if (addr >= progend)
125 claim(addr, 0x1000, 0);
126
127 rec = (struct bi_record *)addr;
128 rec->tag = BI_FIRST;
129 rec->size = sizeof(struct bi_record);
130 rec = (struct bi_record *)((unsigned long)rec + rec->size);
131
132 rec->tag = BI_BOOTLOADER_ID;
133 sprintf( (char *)rec->data, name);
134 rec->size = sizeof(struct bi_record) + strlen(name) + 1;
135 rec = (struct bi_record *)((unsigned long)rec + rec->size);
136
137 rec->tag = BI_MACHTYPE;
138 rec->data[0] = mach;
139 rec->data[1] = 1;
140 rec->size = sizeof(struct bi_record) + 2 * sizeof(unsigned long);
141 rec = (struct bi_record *)((unsigned long)rec + rec->size);
142
143 rec->tag = BI_LAST;
144 rec->size = sizeof(struct bi_record);
145 rec = (struct bi_record *)((unsigned long)rec + rec->size);
146}
diff --git a/arch/ppc/boot/openfirmware/dummy.c b/arch/ppc/boot/openfirmware/dummy.c
deleted file mode 100644
index 31dbf45bf99c..000000000000
--- a/arch/ppc/boot/openfirmware/dummy.c
+++ /dev/null
@@ -1,4 +0,0 @@
1int main(void)
2{
3 return 0;
4}
diff --git a/arch/ppc/boot/openfirmware/misc.S b/arch/ppc/boot/openfirmware/misc.S
deleted file mode 100644
index ab9e897cadd0..000000000000
--- a/arch/ppc/boot/openfirmware/misc.S
+++ /dev/null
@@ -1,67 +0,0 @@
1/*
2 * Copyright (C) Paul Mackerras 1997.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
8 */
9 .text
10
11/*
12 * Use the BAT2 & 3 registers to map the 1st 16MB of RAM to
13 * the address given as the 1st argument.
14 */
15 .globl setup_bats
16setup_bats:
17 mfpvr 5
18 rlwinm 5,5,16,16,31 /* r3 = 1 for 601, 4 for 604 */
19 cmpwi 0,5,1
20 li 0,0
21 bne 4f
22 mtibatl 3,0 /* invalidate BAT first */
23 ori 3,3,4 /* set up BAT registers for 601 */
24 li 4,0x7f
25 mtibatu 2,3
26 mtibatl 2,4
27 oris 3,3,0x80
28 oris 4,4,0x80
29 mtibatu 3,3
30 mtibatl 3,4
31 b 5f
324: mtdbatu 3,0 /* invalidate BATs first */
33 mtibatu 3,0
34 ori 3,3,0xff /* set up BAT registers for 604 */
35 li 4,2
36 mtdbatl 2,4
37 mtdbatu 2,3
38 mtibatl 2,4
39 mtibatu 2,3
40 oris 3,3,0x80
41 oris 4,4,0x80
42 mtdbatl 3,4
43 mtdbatu 3,3
44 mtibatl 3,4
45 mtibatu 3,3
465: sync
47 isync
48 blr
49
50/*
51 * Flush the dcache and invalidate the icache for a range of addresses.
52 *
53 * flush_cache(addr, len)
54 */
55 .global flush_cache
56flush_cache:
57 addi 4,4,0x1f /* len = (len + 0x1f) / 0x20 */
58 rlwinm. 4,4,27,5,31
59 mtctr 4
60 beqlr
611: dcbf 0,3
62 icbi 0,3
63 addi 3,3,0x20
64 bdnz 1b
65 sync
66 isync
67 blr
diff --git a/arch/ppc/boot/openfirmware/start.c b/arch/ppc/boot/openfirmware/start.c
deleted file mode 100644
index 1617a26956bf..000000000000
--- a/arch/ppc/boot/openfirmware/start.c
+++ /dev/null
@@ -1,172 +0,0 @@
1/*
2 * Copyright (C) Paul Mackerras 1997.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
8 */
9#include <stdarg.h>
10#include "of1275.h"
11
12extern int strlen(const char *s);
13extern void boot(int a1, int a2, void *prom);
14
15phandle stdin;
16phandle stdout;
17phandle stderr;
18
19void printk(char *fmt, ...);
20
21void
22start(int a1, int a2, void *promptr)
23{
24 ofinit(promptr);
25 if (ofstdio(&stdin, &stdout, &stderr))
26 exit();
27
28 boot(a1, a2, promptr);
29 for (;;)
30 exit();
31}
32
33int writestring(void *f, char *ptr, int nb)
34{
35 int w = 0, i;
36 char *ret = "\r";
37
38 for (i = 0; i < nb; ++i) {
39 if (ptr[i] == '\n') {
40 if (i > w) {
41 write(f, ptr + w, i - w);
42 w = i;
43 }
44 write(f, ret, 1);
45 }
46 }
47 if (w < nb)
48 write(f, ptr + w, nb - w);
49 return nb;
50}
51
52int
53putc(int c, void *f)
54{
55 char ch = c;
56
57 return writestring(f, &ch, 1) == 1? c: -1;
58}
59
60int
61putchar(int c)
62{
63 return putc(c, stdout);
64}
65
66int
67fputs(char *str, void *f)
68{
69 int n = strlen(str);
70
71 return writestring(f, str, n) == n? 0: -1;
72}
73
74int
75readchar(void)
76{
77 char ch;
78
79 for (;;) {
80 switch (read(stdin, &ch, 1)) {
81 case 1:
82 return ch;
83 case -1:
84 printk("read(stdin) returned -1\n");
85 return -1;
86 }
87 }
88}
89
90static char line[256];
91static char *lineptr;
92static int lineleft;
93
94int
95getchar(void)
96{
97 int c;
98
99 if (lineleft == 0) {
100 lineptr = line;
101 for (;;) {
102 c = readchar();
103 if (c == -1 || c == 4)
104 break;
105 if (c == '\r' || c == '\n') {
106 *lineptr++ = '\n';
107 putchar('\n');
108 break;
109 }
110 switch (c) {
111 case 0177:
112 case '\b':
113 if (lineptr > line) {
114 putchar('\b');
115 putchar(' ');
116 putchar('\b');
117 --lineptr;
118 }
119 break;
120 case 'U' & 0x1F:
121 while (lineptr > line) {
122 putchar('\b');
123 putchar(' ');
124 putchar('\b');
125 --lineptr;
126 }
127 break;
128 default:
129 if (lineptr >= &line[sizeof(line) - 1])
130 putchar('\a');
131 else {
132 putchar(c);
133 *lineptr++ = c;
134 }
135 }
136 }
137 lineleft = lineptr - line;
138 lineptr = line;
139 }
140 if (lineleft == 0)
141 return -1;
142 --lineleft;
143 return *lineptr++;
144}
145
146extern int vsprintf(char *buf, const char *fmt, va_list args);
147static char sprint_buf[1024];
148
149void
150printk(char *fmt, ...)
151{
152 va_list args;
153 int n;
154
155 va_start(args, fmt);
156 n = vsprintf(sprint_buf, fmt, args);
157 va_end(args);
158 writestring(stdout, sprint_buf, n);
159}
160
161int
162printf(char *fmt, ...)
163{
164 va_list args;
165 int n;
166
167 va_start(args, fmt);
168 n = vsprintf(sprint_buf, fmt, args);
169 va_end(args);
170 writestring(stdout, sprint_buf, n);
171 return n;
172}
diff --git a/arch/ppc/boot/simple/mpc10x_memory.c b/arch/ppc/boot/simple/mpc10x_memory.c
index c24290823f7f..8da8f576031d 100644
--- a/arch/ppc/boot/simple/mpc10x_memory.c
+++ b/arch/ppc/boot/simple/mpc10x_memory.c
@@ -50,10 +50,10 @@ MPC10X_PCI_OP(read, dword, u32 *, in_le32, 0)
50 * the system. This assumes that the firmware has correctly set up the memory 50 * the system. This assumes that the firmware has correctly set up the memory
51 * controller registers. On CONFIG_PPC_PREP, we know we are being called 51 * controller registers. On CONFIG_PPC_PREP, we know we are being called
52 * under a PReP memory map. On all other machines, we assume we are under 52 * under a PReP memory map. On all other machines, we assume we are under
53 * a CHRP memory map. Further, on CONFIG_PPC_MULTIPLATFORM we must rename 53 * a CHRP memory map. Further, on CONFIG_PPC_PREP we must rename
54 * this function. 54 * this function.
55 */ 55 */
56#ifdef CONFIG_PPC_MULTIPLATFORM 56#ifdef CONFIG_PPC_PREP
57#define get_mem_size mpc10x_get_mem_size 57#define get_mem_size mpc10x_get_mem_size
58#endif 58#endif
59unsigned long 59unsigned long
diff --git a/arch/ppc/boot/simple/relocate.S b/arch/ppc/boot/simple/relocate.S
index 7efddc507564..2533113c1cc5 100644
--- a/arch/ppc/boot/simple/relocate.S
+++ b/arch/ppc/boot/simple/relocate.S
@@ -194,7 +194,7 @@ start_ldr:
194 /* 194 /*
195 * Start at the begining. 195 * Start at the begining.
196 */ 196 */
197#ifdef CONFIG_PPC_MULTIPLATFORM 197#ifdef CONFIG_PPC_PREP
198 li r9,0xc 198 li r9,0xc
199 mtlr r9 199 mtlr r9
200 /* tell kernel we're prep, by putting 0xdeadc0de at KERNELLOAD, 200 /* tell kernel we're prep, by putting 0xdeadc0de at KERNELLOAD,
diff --git a/arch/ppc/boot/utils/addnote.c b/arch/ppc/boot/utils/addnote.c
deleted file mode 100644
index 6c52b18f2d04..000000000000
--- a/arch/ppc/boot/utils/addnote.c
+++ /dev/null
@@ -1,175 +0,0 @@
1/*
2 * Program to hack in a PT_NOTE program header entry in an ELF file.
3 * This is needed for OF on RS/6000s to load an image correctly.
4 * Note that OF needs a program header entry for the note, not an
5 * ELF section.
6 *
7 * Copyright 2000 Paul Mackerras.
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version
12 * 2 of the License, or (at your option) any later version.
13 *
14 * Usage: addnote zImage
15 */
16#include <stdio.h>
17#include <stdlib.h>
18#include <fcntl.h>
19#include <unistd.h>
20#include <string.h>
21
22char arch[] = "PowerPC";
23
24#define N_DESCR 6
25unsigned int descr[N_DESCR] = {
26#if 1
27 /* values for IBM RS/6000 machines */
28 0xffffffff, /* real-mode = true */
29 0x00c00000, /* real-base, i.e. where we expect OF to be */
30 0xffffffff, /* real-size */
31 0xffffffff, /* virt-base */
32 0xffffffff, /* virt-size */
33 0x4000, /* load-base */
34#else
35 /* values for longtrail CHRP */
36 0, /* real-mode = false */
37 0xffffffff, /* real-base */
38 0xffffffff, /* real-size */
39 0xffffffff, /* virt-base */
40 0xffffffff, /* virt-size */
41 0x00600000, /* load-base */
42#endif
43};
44
45unsigned char buf[512];
46
47#define GET_16BE(off) ((buf[off] << 8) + (buf[(off)+1]))
48#define GET_32BE(off) ((GET_16BE(off) << 16) + GET_16BE((off)+2))
49
50#define PUT_16BE(off, v) (buf[off] = ((v) >> 8) & 0xff, \
51 buf[(off) + 1] = (v) & 0xff)
52#define PUT_32BE(off, v) (PUT_16BE((off), (v) >> 16), \
53 PUT_16BE((off) + 2, (v)))
54
55/* Structure of an ELF file */
56#define E_IDENT 0 /* ELF header */
57#define E_PHOFF 28
58#define E_PHENTSIZE 42
59#define E_PHNUM 44
60#define E_HSIZE 52 /* size of ELF header */
61
62#define EI_MAGIC 0 /* offsets in E_IDENT area */
63#define EI_CLASS 4
64#define EI_DATA 5
65
66#define PH_TYPE 0 /* ELF program header */
67#define PH_OFFSET 4
68#define PH_FILESZ 16
69#define PH_HSIZE 32 /* size of program header */
70
71#define PT_NOTE 4 /* Program header type = note */
72
73#define ELFCLASS32 1
74#define ELFDATA2MSB 2
75
76unsigned char elf_magic[4] = { 0x7f, 'E', 'L', 'F' };
77
78int main(int ac, char **av)
79{
80 int fd, n, i;
81 int ph, ps, np;
82 int nnote, ns;
83
84 if (ac != 2) {
85 fprintf(stderr, "Usage: %s elf-file\n", av[0]);
86 exit(1);
87 }
88 fd = open(av[1], O_RDWR);
89 if (fd < 0) {
90 perror(av[1]);
91 exit(1);
92 }
93
94 nnote = strlen(arch) + 1 + (N_DESCR + 3) * 4;
95
96 n = read(fd, buf, sizeof(buf));
97 if (n < 0) {
98 perror("read");
99 exit(1);
100 }
101
102 if (n < E_HSIZE || memcmp(&buf[E_IDENT+EI_MAGIC], elf_magic, 4) != 0)
103 goto notelf;
104
105 if (buf[E_IDENT+EI_CLASS] != ELFCLASS32
106 || buf[E_IDENT+EI_DATA] != ELFDATA2MSB) {
107 fprintf(stderr, "%s is not a big-endian 32-bit ELF image\n",
108 av[1]);
109 exit(1);
110 }
111
112 ph = GET_32BE(E_PHOFF);
113 ps = GET_16BE(E_PHENTSIZE);
114 np = GET_16BE(E_PHNUM);
115 if (ph < E_HSIZE || ps < PH_HSIZE || np < 1)
116 goto notelf;
117 if (ph + (np + 1) * ps + nnote > n)
118 goto nospace;
119
120 for (i = 0; i < np; ++i) {
121 if (GET_32BE(ph + PH_TYPE) == PT_NOTE) {
122 fprintf(stderr, "%s already has a note entry\n",
123 av[1]);
124 exit(0);
125 }
126 ph += ps;
127 }
128
129 /* XXX check that the area we want to use is all zeroes */
130 for (i = 0; i < ps + nnote; ++i)
131 if (buf[ph + i] != 0)
132 goto nospace;
133
134 /* fill in the program header entry */
135 ns = ph + ps;
136 PUT_32BE(ph + PH_TYPE, PT_NOTE);
137 PUT_32BE(ph + PH_OFFSET, ns);
138 PUT_32BE(ph + PH_FILESZ, nnote);
139
140 /* fill in the note area we point to */
141 /* XXX we should probably make this a proper section */
142 PUT_32BE(ns, strlen(arch) + 1);
143 PUT_32BE(ns + 4, N_DESCR * 4);
144 PUT_32BE(ns + 8, 0x1275);
145 strcpy(&buf[ns + 12], arch);
146 ns += 12 + strlen(arch) + 1;
147 for (i = 0; i < N_DESCR; ++i)
148 PUT_32BE(ns + i * 4, descr[i]);
149
150 /* Update the number of program headers */
151 PUT_16BE(E_PHNUM, np + 1);
152
153 /* write back */
154 lseek(fd, (long) 0, SEEK_SET);
155 i = write(fd, buf, n);
156 if (i < 0) {
157 perror("write");
158 exit(1);
159 }
160 if (i < n) {
161 fprintf(stderr, "%s: write truncated\n", av[1]);
162 exit(1);
163 }
164
165 exit(0);
166
167 notelf:
168 fprintf(stderr, "%s does not appear to be an ELF file\n", av[0]);
169 exit(1);
170
171 nospace:
172 fprintf(stderr, "sorry, I can't find space in %s to put the note\n",
173 av[0]);
174 exit(1);
175}
diff --git a/arch/ppc/boot/utils/hack-coff.c b/arch/ppc/boot/utils/hack-coff.c
deleted file mode 100644
index 5e5a6573a1ef..000000000000
--- a/arch/ppc/boot/utils/hack-coff.c
+++ /dev/null
@@ -1,84 +0,0 @@
1/*
2 * hack-coff.c - hack the header of an xcoff file to fill in
3 * a few fields needed by the Open Firmware xcoff loader on
4 * Power Macs but not initialized by objcopy.
5 *
6 * Copyright (C) Paul Mackerras 1997.
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version
11 * 2 of the License, or (at your option) any later version.
12 */
13#include <stdio.h>
14#include <stdlib.h>
15#include <unistd.h>
16#include <fcntl.h>
17#include <string.h>
18#include "rs6000.h"
19
20#define AOUT_MAGIC 0x010b
21
22#define get_16be(x) ((((unsigned char *)(x))[0] << 8) \
23 + ((unsigned char *)(x))[1])
24#define put_16be(x, v) (((unsigned char *)(x))[0] = (v) >> 8, \
25 ((unsigned char *)(x))[1] = (v) & 0xff)
26#define get_32be(x) ((((unsigned char *)(x))[0] << 24) \
27 + (((unsigned char *)(x))[1] << 16) \
28 + (((unsigned char *)(x))[2] << 8) \
29 + ((unsigned char *)(x))[3])
30
31int
32main(int ac, char **av)
33{
34 int fd;
35 int i, nsect;
36 int aoutsz;
37 struct external_filehdr fhdr;
38 AOUTHDR aout;
39 struct external_scnhdr shdr;
40
41 if (ac != 2) {
42 fprintf(stderr, "Usage: hack-coff coff-file\n");
43 exit(1);
44 }
45 if ((fd = open(av[1], 2)) == -1) {
46 perror(av[2]);
47 exit(1);
48 }
49 if (read(fd, &fhdr, sizeof(fhdr)) != sizeof(fhdr))
50 goto readerr;
51 i = get_16be(fhdr.f_magic);
52 if (i != U802TOCMAGIC && i != U802WRMAGIC && i != U802ROMAGIC) {
53 fprintf(stderr, "%s: not an xcoff file\n", av[1]);
54 exit(1);
55 }
56 aoutsz = get_16be(fhdr.f_opthdr);
57 if (read(fd, &aout, aoutsz) != aoutsz)
58 goto readerr;
59 nsect = get_16be(fhdr.f_nscns);
60 for (i = 0; i < nsect; ++i) {
61 if (read(fd, &shdr, sizeof(shdr)) != sizeof(shdr))
62 goto readerr;
63 if (strcmp(shdr.s_name, ".text") == 0) {
64 put_16be(aout.o_snentry, i+1);
65 put_16be(aout.o_sntext, i+1);
66 } else if (strcmp(shdr.s_name, ".data") == 0) {
67 put_16be(aout.o_sndata, i+1);
68 } else if (strcmp(shdr.s_name, ".bss") == 0) {
69 put_16be(aout.o_snbss, i+1);
70 }
71 }
72 put_16be(aout.magic, AOUT_MAGIC);
73 if (lseek(fd, (long) sizeof(struct external_filehdr), 0) == -1
74 || write(fd, &aout, aoutsz) != aoutsz) {
75 fprintf(stderr, "%s: write error\n", av[1]);
76 exit(1);
77 }
78 close(fd);
79 exit(0);
80
81readerr:
82 fprintf(stderr, "%s: read error or file too short\n", av[1]);
83 exit(1);
84}
diff --git a/arch/ppc/boot/utils/mknote.c b/arch/ppc/boot/utils/mknote.c
deleted file mode 100644
index b9fbb2cbfc8f..000000000000
--- a/arch/ppc/boot/utils/mknote.c
+++ /dev/null
@@ -1,44 +0,0 @@
1/*
2 * Copyright (C) Cort Dougan 1999.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
8 *
9 * Generate a note section as per the CHRP specification.
10 *
11 */
12
13#include <stdio.h>
14#include <string.h>
15
16#define PL(x) printf("%c%c%c%c", ((x)>>24)&0xff, ((x)>>16)&0xff, ((x)>>8)&0xff, (x)&0xff );
17
18int main(void)
19{
20/* header */
21 /* namesz */
22 PL(strlen("PowerPC")+1);
23 /* descrsz */
24 PL(6*4);
25 /* type */
26 PL(0x1275);
27 /* name */
28 printf("PowerPC"); printf("%c", 0);
29
30/* descriptor */
31 /* real-mode */
32 PL(0xffffffff);
33 /* real-base */
34 PL(0x00c00000);
35 /* real-size */
36 PL(0xffffffff);
37 /* virt-base */
38 PL(0xffffffff);
39 /* virt-size */
40 PL(0xffffffff);
41 /* load-base */
42 PL(0x4000);
43 return 0;
44}
diff --git a/arch/ppc/configs/ibmchrp_defconfig b/arch/ppc/configs/ibmchrp_defconfig
deleted file mode 100644
index 27f3e69c1f96..000000000000
--- a/arch/ppc/configs/ibmchrp_defconfig
+++ /dev/null
@@ -1,875 +0,0 @@
1#
2# Automatically generated make config: don't edit
3#
4CONFIG_MMU=y
5CONFIG_RWSEM_XCHGADD_ALGORITHM=y
6CONFIG_HAVE_DEC_LOCK=y
7CONFIG_PPC=y
8CONFIG_PPC32=y
9CONFIG_GENERIC_NVRAM=y
10
11#
12# Code maturity level options
13#
14CONFIG_EXPERIMENTAL=y
15CONFIG_CLEAN_COMPILE=y
16# CONFIG_STANDALONE is not set
17CONFIG_BROKEN_ON_SMP=y
18
19#
20# General setup
21#
22CONFIG_SWAP=y
23CONFIG_SYSVIPC=y
24CONFIG_POSIX_MQUEUE=y
25# CONFIG_BSD_PROCESS_ACCT is not set
26CONFIG_SYSCTL=y
27# CONFIG_AUDIT is not set
28CONFIG_LOG_BUF_SHIFT=14
29# CONFIG_HOTPLUG is not set
30CONFIG_IKCONFIG=y
31CONFIG_IKCONFIG_PROC=y
32# CONFIG_EMBEDDED is not set
33CONFIG_KALLSYMS=y
34CONFIG_FUTEX=y
35CONFIG_EPOLL=y
36CONFIG_IOSCHED_NOOP=y
37CONFIG_IOSCHED_AS=y
38CONFIG_IOSCHED_DEADLINE=y
39CONFIG_IOSCHED_CFQ=y
40# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
41
42#
43# Loadable module support
44#
45CONFIG_MODULES=y
46CONFIG_MODULE_UNLOAD=y
47CONFIG_MODULE_FORCE_UNLOAD=y
48CONFIG_OBSOLETE_MODPARM=y
49# CONFIG_MODVERSIONS is not set
50CONFIG_KMOD=y
51
52#
53# Processor
54#
55CONFIG_6xx=y
56# CONFIG_40x is not set
57# CONFIG_44x is not set
58# CONFIG_POWER3 is not set
59# CONFIG_POWER4 is not set
60# CONFIG_8xx is not set
61# CONFIG_ALTIVEC is not set
62# CONFIG_TAU is not set
63# CONFIG_CPU_FREQ is not set
64# CONFIG_PPC601_SYNC_FIX is not set
65CONFIG_PPC_STD_MMU=y
66
67#
68# Platform options
69#
70CONFIG_PPC_MULTIPLATFORM=y
71# CONFIG_APUS is not set
72# CONFIG_WILLOW is not set
73# CONFIG_PCORE is not set
74# CONFIG_POWERPMC250 is not set
75# CONFIG_EV64260 is not set
76# CONFIG_SPRUCE is not set
77# CONFIG_LOPEC is not set
78# CONFIG_MCPN765 is not set
79# CONFIG_MVME5100 is not set
80# CONFIG_PPLUS is not set
81# CONFIG_PRPMC750 is not set
82# CONFIG_PRPMC800 is not set
83# CONFIG_SANDPOINT is not set
84# CONFIG_ADIR is not set
85# CONFIG_K2 is not set
86# CONFIG_PAL4 is not set
87# CONFIG_GEMINI is not set
88# CONFIG_EST8260 is not set
89# CONFIG_SBS8260 is not set
90# CONFIG_RPX6 is not set
91# CONFIG_TQM8260 is not set
92CONFIG_PPC_CHRP=y
93CONFIG_PPC_PMAC=y
94CONFIG_PPC_PREP=y
95CONFIG_PPC_OF=y
96CONFIG_PPCBUG_NVRAM=y
97# CONFIG_SMP is not set
98# CONFIG_PREEMPT is not set
99CONFIG_HIGHMEM=y
100CONFIG_KERNEL_ELF=y
101CONFIG_BINFMT_ELF=y
102CONFIG_BINFMT_MISC=y
103CONFIG_PROC_DEVICETREE=y
104CONFIG_PPC_RTAS=y
105# CONFIG_PREP_RESIDUAL is not set
106# CONFIG_CMDLINE_BOOL is not set
107
108#
109# Bus options
110#
111CONFIG_ISA=y
112CONFIG_GENERIC_ISA_DMA=y
113CONFIG_PCI=y
114CONFIG_PCI_DOMAINS=y
115CONFIG_PCI_LEGACY_PROC=y
116CONFIG_PCI_NAMES=y
117
118#
119# Advanced setup
120#
121# CONFIG_ADVANCED_OPTIONS is not set
122
123#
124# Default settings for advanced configuration options are used
125#
126CONFIG_HIGHMEM_START=0xfe000000
127CONFIG_LOWMEM_SIZE=0x30000000
128CONFIG_KERNEL_START=0xc0000000
129CONFIG_TASK_SIZE=0x80000000
130CONFIG_BOOT_LOAD=0x00800000
131
132#
133# Device Drivers
134#
135
136#
137# Generic Driver Options
138#
139
140#
141# Memory Technology Devices (MTD)
142#
143# CONFIG_MTD is not set
144
145#
146# Parallel port support
147#
148# CONFIG_PARPORT is not set
149
150#
151# Plug and Play support
152#
153# CONFIG_PNP is not set
154
155#
156# Block devices
157#
158CONFIG_BLK_DEV_FD=y
159# CONFIG_BLK_DEV_XD is not set
160# CONFIG_BLK_CPQ_DA is not set
161# CONFIG_BLK_CPQ_CISS_DA is not set
162# CONFIG_BLK_DEV_DAC960 is not set
163# CONFIG_BLK_DEV_UMEM is not set
164CONFIG_BLK_DEV_LOOP=y
165# CONFIG_BLK_DEV_CRYPTOLOOP is not set
166# CONFIG_BLK_DEV_NBD is not set
167# CONFIG_BLK_DEV_CARMEL is not set
168CONFIG_BLK_DEV_RAM=y
169CONFIG_BLK_DEV_RAM_SIZE=4096
170CONFIG_BLK_DEV_INITRD=y
171CONFIG_LBD=y
172
173#
174# ATA/ATAPI/MFM/RLL support
175#
176# CONFIG_IDE is not set
177
178#
179# SCSI device support
180#
181CONFIG_SCSI=y
182CONFIG_SCSI_PROC_FS=y
183
184#
185# SCSI support type (disk, tape, CD-ROM)
186#
187CONFIG_BLK_DEV_SD=y
188CONFIG_CHR_DEV_ST=y
189# CONFIG_CHR_DEV_OSST is not set
190CONFIG_BLK_DEV_SR=y
191CONFIG_BLK_DEV_SR_VENDOR=y
192CONFIG_CHR_DEV_SG=y
193
194#
195# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
196#
197# CONFIG_SCSI_MULTI_LUN is not set
198# CONFIG_SCSI_REPORT_LUNS is not set
199CONFIG_SCSI_CONSTANTS=y
200# CONFIG_SCSI_LOGGING is not set
201
202#
203# SCSI Transport Attributes
204#
205CONFIG_SCSI_SPI_ATTRS=y
206# CONFIG_SCSI_FC_ATTRS is not set
207
208#
209# SCSI low-level drivers
210#
211# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
212# CONFIG_SCSI_7000FASST is not set
213# CONFIG_SCSI_ACARD is not set
214# CONFIG_SCSI_AHA152X is not set
215# CONFIG_SCSI_AHA1542 is not set
216# CONFIG_SCSI_AACRAID is not set
217# CONFIG_SCSI_AIC7XXX is not set
218# CONFIG_SCSI_AIC7XXX_OLD is not set
219# CONFIG_SCSI_AIC79XX is not set
220# CONFIG_SCSI_ADVANSYS is not set
221# CONFIG_SCSI_IN2000 is not set
222# CONFIG_SCSI_MEGARAID is not set
223# CONFIG_SCSI_SATA is not set
224# CONFIG_SCSI_BUSLOGIC is not set
225# CONFIG_SCSI_CPQFCTS is not set
226# CONFIG_SCSI_DMX3191D is not set
227# CONFIG_SCSI_DTC3280 is not set
228# CONFIG_SCSI_EATA is not set
229# CONFIG_SCSI_EATA_PIO is not set
230# CONFIG_SCSI_FUTURE_DOMAIN is not set
231# CONFIG_SCSI_GDTH is not set
232# CONFIG_SCSI_GENERIC_NCR5380 is not set
233# CONFIG_SCSI_GENERIC_NCR5380_MMIO is not set
234# CONFIG_SCSI_IPS is not set
235# CONFIG_SCSI_INIA100 is not set
236# CONFIG_SCSI_NCR53C406A is not set
237CONFIG_SCSI_SYM53C8XX_2=y
238CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=0
239CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
240CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
241# CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set
242# CONFIG_SCSI_IPR is not set
243# CONFIG_SCSI_PAS16 is not set
244# CONFIG_SCSI_PSI240I is not set
245# CONFIG_SCSI_QLOGIC_FAS is not set
246# CONFIG_SCSI_QLOGIC_ISP is not set
247# CONFIG_SCSI_QLOGIC_FC is not set
248# CONFIG_SCSI_QLOGIC_1280 is not set
249CONFIG_SCSI_QLA2XXX=y
250# CONFIG_SCSI_QLA21XX is not set
251# CONFIG_SCSI_QLA22XX is not set
252# CONFIG_SCSI_QLA2300 is not set
253# CONFIG_SCSI_QLA2322 is not set
254# CONFIG_SCSI_QLA6312 is not set
255# CONFIG_SCSI_QLA6322 is not set
256# CONFIG_SCSI_SYM53C416 is not set
257# CONFIG_SCSI_DC395x is not set
258# CONFIG_SCSI_DC390T is not set
259# CONFIG_SCSI_T128 is not set
260# CONFIG_SCSI_U14_34F is not set
261# CONFIG_SCSI_NSP32 is not set
262# CONFIG_SCSI_DEBUG is not set
263# CONFIG_SCSI_MESH is not set
264# CONFIG_SCSI_MAC53C94 is not set
265
266#
267# Old CD-ROM drivers (not SCSI, not IDE)
268#
269# CONFIG_CD_NO_IDESCSI is not set
270
271#
272# Multi-device support (RAID and LVM)
273#
274# CONFIG_MD is not set
275
276#
277# Fusion MPT device support
278#
279# CONFIG_FUSION is not set
280
281#
282# IEEE 1394 (FireWire) support
283#
284# CONFIG_IEEE1394 is not set
285
286#
287# I2O device support
288#
289# CONFIG_I2O is not set
290
291#
292# Macintosh device drivers
293#
294# CONFIG_ADB is not set
295# CONFIG_ADB_CUDA is not set
296# CONFIG_ADB_PMU is not set
297# CONFIG_MAC_FLOPPY is not set
298# CONFIG_MAC_SERIAL is not set
299
300#
301# Networking support
302#
303CONFIG_NET=y
304
305#
306# Networking options
307#
308CONFIG_PACKET=y
309# CONFIG_PACKET_MMAP is not set
310# CONFIG_NETLINK_DEV is not set
311CONFIG_UNIX=y
312# CONFIG_NET_KEY is not set
313CONFIG_INET=y
314CONFIG_IP_MULTICAST=y
315# CONFIG_IP_ADVANCED_ROUTER is not set
316# CONFIG_IP_PNP is not set
317# CONFIG_NET_IPIP is not set
318# CONFIG_NET_IPGRE is not set
319# CONFIG_IP_MROUTE is not set
320# CONFIG_ARPD is not set
321CONFIG_SYN_COOKIES=y
322# CONFIG_INET_AH is not set
323# CONFIG_INET_ESP is not set
324# CONFIG_INET_IPCOMP is not set
325
326#
327# IP: Virtual Server Configuration
328#
329# CONFIG_IP_VS is not set
330# CONFIG_IPV6 is not set
331CONFIG_NETFILTER=y
332# CONFIG_NETFILTER_DEBUG is not set
333
334#
335# IP: Netfilter Configuration
336#
337CONFIG_IP_NF_CONNTRACK=m
338CONFIG_IP_NF_FTP=m
339CONFIG_IP_NF_IRC=m
340CONFIG_IP_NF_TFTP=m
341CONFIG_IP_NF_AMANDA=m
342# CONFIG_IP_NF_QUEUE is not set
343CONFIG_IP_NF_IPTABLES=m
344CONFIG_IP_NF_MATCH_LIMIT=m
345CONFIG_IP_NF_MATCH_IPRANGE=m
346CONFIG_IP_NF_MATCH_MAC=m
347# CONFIG_IP_NF_MATCH_PKTTYPE is not set
348CONFIG_IP_NF_MATCH_MARK=m
349CONFIG_IP_NF_MATCH_MULTIPORT=m
350CONFIG_IP_NF_MATCH_TOS=m
351CONFIG_IP_NF_MATCH_RECENT=m
352CONFIG_IP_NF_MATCH_ECN=m
353CONFIG_IP_NF_MATCH_DSCP=m
354CONFIG_IP_NF_MATCH_AH_ESP=m
355CONFIG_IP_NF_MATCH_LENGTH=m
356CONFIG_IP_NF_MATCH_TTL=m
357CONFIG_IP_NF_MATCH_TCPMSS=m
358CONFIG_IP_NF_MATCH_HELPER=m
359CONFIG_IP_NF_MATCH_STATE=m
360CONFIG_IP_NF_MATCH_CONNTRACK=m
361CONFIG_IP_NF_MATCH_OWNER=m
362CONFIG_IP_NF_FILTER=m
363CONFIG_IP_NF_TARGET_REJECT=m
364CONFIG_IP_NF_NAT=m
365CONFIG_IP_NF_NAT_NEEDED=y
366CONFIG_IP_NF_TARGET_MASQUERADE=m
367CONFIG_IP_NF_TARGET_REDIRECT=m
368CONFIG_IP_NF_TARGET_NETMAP=m
369CONFIG_IP_NF_TARGET_SAME=m
370CONFIG_IP_NF_NAT_SNMP_BASIC=m
371CONFIG_IP_NF_NAT_IRC=m
372CONFIG_IP_NF_NAT_FTP=m
373CONFIG_IP_NF_NAT_TFTP=m
374CONFIG_IP_NF_NAT_AMANDA=m
375# CONFIG_IP_NF_MANGLE is not set
376# CONFIG_IP_NF_TARGET_LOG is not set
377CONFIG_IP_NF_TARGET_ULOG=m
378CONFIG_IP_NF_TARGET_TCPMSS=m
379CONFIG_IP_NF_ARPTABLES=m
380CONFIG_IP_NF_ARPFILTER=m
381CONFIG_IP_NF_ARP_MANGLE=m
382CONFIG_IP_NF_COMPAT_IPCHAINS=m
383# CONFIG_IP_NF_COMPAT_IPFWADM is not set
384CONFIG_IP_NF_TARGET_NOTRACK=m
385CONFIG_IP_NF_RAW=m
386
387#
388# SCTP Configuration (EXPERIMENTAL)
389#
390# CONFIG_IP_SCTP is not set
391# CONFIG_ATM is not set
392# CONFIG_BRIDGE is not set
393# CONFIG_VLAN_8021Q is not set
394# CONFIG_DECNET is not set
395# CONFIG_LLC2 is not set
396# CONFIG_IPX is not set
397# CONFIG_ATALK is not set
398# CONFIG_X25 is not set
399# CONFIG_LAPB is not set
400# CONFIG_NET_DIVERT is not set
401# CONFIG_ECONET is not set
402# CONFIG_WAN_ROUTER is not set
403# CONFIG_NET_HW_FLOWCONTROL is not set
404
405#
406# QoS and/or fair queueing
407#
408# CONFIG_NET_SCHED is not set
409
410#
411# Network testing
412#
413# CONFIG_NET_PKTGEN is not set
414# CONFIG_NETPOLL is not set
415# CONFIG_NET_POLL_CONTROLLER is not set
416# CONFIG_HAMRADIO is not set
417# CONFIG_IRDA is not set
418# CONFIG_BT is not set
419CONFIG_NETDEVICES=y
420# CONFIG_DUMMY is not set
421# CONFIG_BONDING is not set
422# CONFIG_EQUALIZER is not set
423# CONFIG_TUN is not set
424
425#
426# ARCnet devices
427#
428# CONFIG_ARCNET is not set
429
430#
431# Ethernet (10 or 100Mbit)
432#
433CONFIG_NET_ETHERNET=y
434CONFIG_MII=y
435# CONFIG_MACE is not set
436# CONFIG_BMAC is not set
437# CONFIG_OAKNET is not set
438# CONFIG_HAPPYMEAL is not set
439# CONFIG_SUNGEM is not set
440# CONFIG_NET_VENDOR_3COM is not set
441# CONFIG_LANCE is not set
442# CONFIG_NET_VENDOR_SMC is not set
443# CONFIG_NET_VENDOR_RACAL is not set
444
445#
446# Tulip family network device support
447#
448# CONFIG_NET_TULIP is not set
449# CONFIG_AT1700 is not set
450# CONFIG_DEPCA is not set
451# CONFIG_HP100 is not set
452# CONFIG_NET_ISA is not set
453CONFIG_NET_PCI=y
454CONFIG_PCNET32=y
455# CONFIG_AMD8111_ETH is not set
456# CONFIG_ADAPTEC_STARFIRE is not set
457# CONFIG_AC3200 is not set
458# CONFIG_APRICOT is not set
459# CONFIG_B44 is not set
460# CONFIG_FORCEDETH is not set
461# CONFIG_CS89x0 is not set
462# CONFIG_DGRS is not set
463# CONFIG_EEPRO100 is not set
464# CONFIG_E100 is not set
465# CONFIG_FEALNX is not set
466# CONFIG_NATSEMI is not set
467# CONFIG_NE2K_PCI is not set
468# CONFIG_8139CP is not set
469# CONFIG_8139TOO is not set
470# CONFIG_SIS900 is not set
471# CONFIG_EPIC100 is not set
472# CONFIG_SUNDANCE is not set
473# CONFIG_TLAN is not set
474# CONFIG_VIA_RHINE is not set
475# CONFIG_NET_POCKET is not set
476
477#
478# Ethernet (1000 Mbit)
479#
480# CONFIG_ACENIC is not set
481# CONFIG_DL2K is not set
482# CONFIG_E1000 is not set
483# CONFIG_NS83820 is not set
484# CONFIG_HAMACHI is not set
485# CONFIG_YELLOWFIN is not set
486# CONFIG_R8169 is not set
487# CONFIG_SK98LIN is not set
488# CONFIG_TIGON3 is not set
489
490#
491# Ethernet (10000 Mbit)
492#
493# CONFIG_IXGB is not set
494# CONFIG_S2IO is not set
495
496#
497# Token Ring devices
498#
499# CONFIG_TR is not set
500
501#
502# Wireless LAN (non-hamradio)
503#
504# CONFIG_NET_RADIO is not set
505
506#
507# Wan interfaces
508#
509# CONFIG_WAN is not set
510# CONFIG_FDDI is not set
511# CONFIG_HIPPI is not set
512# CONFIG_PPP is not set
513# CONFIG_SLIP is not set
514# CONFIG_NET_FC is not set
515# CONFIG_RCPCI is not set
516# CONFIG_SHAPER is not set
517# CONFIG_NETCONSOLE is not set
518
519#
520# ISDN subsystem
521#
522# CONFIG_ISDN is not set
523
524#
525# Telephony Support
526#
527# CONFIG_PHONE is not set
528
529#
530# Input device support
531#
532CONFIG_INPUT=y
533
534#
535# Userland interfaces
536#
537CONFIG_INPUT_MOUSEDEV=y
538CONFIG_INPUT_MOUSEDEV_PSAUX=y
539CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
540CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
541# CONFIG_INPUT_JOYDEV is not set
542# CONFIG_INPUT_TSDEV is not set
543CONFIG_INPUT_EVDEV=y
544# CONFIG_INPUT_EVBUG is not set
545
546#
547# Input I/O drivers
548#
549# CONFIG_GAMEPORT is not set
550CONFIG_SOUND_GAMEPORT=y
551CONFIG_SERIO=y
552CONFIG_SERIO_I8042=y
553CONFIG_SERIO_SERPORT=y
554# CONFIG_SERIO_CT82C710 is not set
555# CONFIG_SERIO_PCIPS2 is not set
556
557#
558# Input Device Drivers
559#
560CONFIG_INPUT_KEYBOARD=y
561CONFIG_KEYBOARD_ATKBD=y
562# CONFIG_KEYBOARD_SUNKBD is not set
563# CONFIG_KEYBOARD_LKKBD is not set
564# CONFIG_KEYBOARD_XTKBD is not set
565# CONFIG_KEYBOARD_NEWTON is not set
566CONFIG_INPUT_MOUSE=y
567CONFIG_MOUSE_PS2=y
568# CONFIG_MOUSE_SERIAL is not set
569# CONFIG_MOUSE_INPORT is not set
570# CONFIG_MOUSE_LOGIBM is not set
571# CONFIG_MOUSE_PC110PAD is not set
572# CONFIG_MOUSE_VSXXXAA is not set
573# CONFIG_INPUT_JOYSTICK is not set
574# CONFIG_INPUT_TOUCHSCREEN is not set
575CONFIG_INPUT_MISC=y
576CONFIG_INPUT_UINPUT=y
577
578#
579# Character devices
580#
581CONFIG_VT=y
582CONFIG_VT_CONSOLE=y
583CONFIG_HW_CONSOLE=y
584# CONFIG_SERIAL_NONSTANDARD is not set
585
586#
587# Serial drivers
588#
589CONFIG_SERIAL_8250=y
590# CONFIG_SERIAL_8250_CONSOLE is not set
591CONFIG_SERIAL_8250_NR_UARTS=4
592# CONFIG_SERIAL_8250_EXTENDED is not set
593
594#
595# Non-8250 serial port support
596#
597CONFIG_SERIAL_CORE=y
598# CONFIG_SERIAL_PMACZILOG is not set
599CONFIG_UNIX98_PTYS=y
600CONFIG_LEGACY_PTYS=y
601CONFIG_LEGACY_PTY_COUNT=256
602# CONFIG_QIC02_TAPE is not set
603
604#
605# IPMI
606#
607# CONFIG_IPMI_HANDLER is not set
608
609#
610# Watchdog Cards
611#
612# CONFIG_WATCHDOG is not set
613CONFIG_NVRAM=y
614CONFIG_GEN_RTC=y
615# CONFIG_GEN_RTC_X is not set
616# CONFIG_DTLK is not set
617# CONFIG_R3964 is not set
618# CONFIG_APPLICOM is not set
619
620#
621# Ftape, the floppy tape device driver
622#
623# CONFIG_FTAPE is not set
624# CONFIG_AGP is not set
625# CONFIG_DRM is not set
626# CONFIG_RAW_DRIVER is not set
627
628#
629# I2C support
630#
631# CONFIG_I2C is not set
632
633#
634# Misc devices
635#
636
637#
638# Multimedia devices
639#
640# CONFIG_VIDEO_DEV is not set
641
642#
643# Digital Video Broadcasting Devices
644#
645# CONFIG_DVB is not set
646
647#
648# Graphics support
649#
650CONFIG_FB=y
651# CONFIG_FB_PM2 is not set
652# CONFIG_FB_CYBER2000 is not set
653CONFIG_FB_OF=y
654# CONFIG_FB_CONTROL is not set
655# CONFIG_FB_PLATINUM is not set
656# CONFIG_FB_VALKYRIE is not set
657# CONFIG_FB_CT65550 is not set
658# CONFIG_FB_IMSTT is not set
659# CONFIG_FB_S3TRIO is not set
660# CONFIG_FB_VGA16 is not set
661# CONFIG_FB_RIVA is not set
662CONFIG_FB_MATROX=y
663CONFIG_FB_MATROX_MILLENIUM=y
664CONFIG_FB_MATROX_MYSTIQUE=y
665# CONFIG_FB_MATROX_G450 is not set
666CONFIG_FB_MATROX_G100A=y
667CONFIG_FB_MATROX_G100=y
668# CONFIG_FB_MATROX_MULTIHEAD is not set
669# CONFIG_FB_RADEON_OLD is not set
670# CONFIG_FB_RADEON is not set
671# CONFIG_FB_ATY128 is not set
672# CONFIG_FB_ATY is not set
673# CONFIG_FB_SIS is not set
674# CONFIG_FB_NEOMAGIC is not set
675# CONFIG_FB_KYRO is not set
676CONFIG_FB_3DFX=y
677# CONFIG_FB_VOODOO1 is not set
678# CONFIG_FB_TRIDENT is not set
679# CONFIG_FB_VIRTUAL is not set
680
681#
682# Console display driver support
683#
684CONFIG_VGA_CONSOLE=y
685# CONFIG_MDA_CONSOLE is not set
686CONFIG_DUMMY_CONSOLE=y
687CONFIG_FRAMEBUFFER_CONSOLE=y
688CONFIG_PCI_CONSOLE=y
689# CONFIG_FONTS is not set
690CONFIG_FONT_8x8=y
691CONFIG_FONT_8x16=y
692
693#
694# Logo configuration
695#
696CONFIG_LOGO=y
697CONFIG_LOGO_LINUX_MONO=y
698CONFIG_LOGO_LINUX_VGA16=y
699CONFIG_LOGO_LINUX_CLUT224=y
700
701#
702# Sound
703#
704# CONFIG_SOUND is not set
705
706#
707# USB support
708#
709# CONFIG_USB is not set
710
711#
712# USB Gadget Support
713#
714# CONFIG_USB_GADGET is not set
715
716#
717# File systems
718#
719CONFIG_EXT2_FS=y
720# CONFIG_EXT2_FS_XATTR is not set
721# CONFIG_EXT3_FS is not set
722# CONFIG_JBD is not set
723# CONFIG_REISERFS_FS is not set
724# CONFIG_JFS_FS is not set
725# CONFIG_XFS_FS is not set
726# CONFIG_MINIX_FS is not set
727# CONFIG_ROMFS_FS is not set
728# CONFIG_QUOTA is not set
729# CONFIG_AUTOFS_FS is not set
730# CONFIG_AUTOFS4_FS is not set
731
732#
733# CD-ROM/DVD Filesystems
734#
735CONFIG_ISO9660_FS=y
736# CONFIG_JOLIET is not set
737# CONFIG_ZISOFS is not set
738# CONFIG_UDF_FS is not set
739
740#
741# DOS/FAT/NT Filesystems
742#
743CONFIG_FAT_FS=m
744CONFIG_MSDOS_FS=m
745CONFIG_VFAT_FS=m
746# CONFIG_NTFS_FS is not set
747
748#
749# Pseudo filesystems
750#
751CONFIG_PROC_FS=y
752CONFIG_PROC_KCORE=y
753CONFIG_SYSFS=y
754CONFIG_DEVFS_FS=y
755# CONFIG_DEVFS_MOUNT is not set
756# CONFIG_DEVFS_DEBUG is not set
757# CONFIG_DEVPTS_FS_XATTR is not set
758CONFIG_TMPFS=y
759# CONFIG_HUGETLB_PAGE is not set
760CONFIG_RAMFS=y
761
762#
763# Miscellaneous filesystems
764#
765# CONFIG_ADFS_FS is not set
766# CONFIG_AFFS_FS is not set
767# CONFIG_HFS_FS is not set
768# CONFIG_HFSPLUS_FS is not set
769# CONFIG_BEFS_FS is not set
770# CONFIG_BFS_FS is not set
771# CONFIG_EFS_FS is not set
772# CONFIG_CRAMFS is not set
773# CONFIG_VXFS_FS is not set
774# CONFIG_HPFS_FS is not set
775# CONFIG_QNX4FS_FS is not set
776# CONFIG_SYSV_FS is not set
777# CONFIG_UFS_FS is not set
778
779#
780# Network File Systems
781#
782# CONFIG_NFS_FS is not set
783# CONFIG_NFSD is not set
784# CONFIG_EXPORTFS is not set
785# CONFIG_SMB_FS is not set
786# CONFIG_CIFS is not set
787# CONFIG_NCP_FS is not set
788# CONFIG_CODA_FS is not set
789# CONFIG_AFS_FS is not set
790
791#
792# Partition Types
793#
794CONFIG_PARTITION_ADVANCED=y
795# CONFIG_ACORN_PARTITION is not set
796# CONFIG_OSF_PARTITION is not set
797# CONFIG_AMIGA_PARTITION is not set
798# CONFIG_ATARI_PARTITION is not set
799CONFIG_MAC_PARTITION=y
800CONFIG_MSDOS_PARTITION=y
801# CONFIG_BSD_DISKLABEL is not set
802# CONFIG_MINIX_SUBPARTITION is not set
803# CONFIG_SOLARIS_X86_PARTITION is not set
804# CONFIG_UNIXWARE_DISKLABEL is not set
805# CONFIG_LDM_PARTITION is not set
806# CONFIG_NEC98_PARTITION is not set
807# CONFIG_SGI_PARTITION is not set
808# CONFIG_ULTRIX_PARTITION is not set
809# CONFIG_SUN_PARTITION is not set
810# CONFIG_EFI_PARTITION is not set
811
812#
813# Native Language Support
814#
815CONFIG_NLS=y
816CONFIG_NLS_DEFAULT="iso8859-1"
817# CONFIG_NLS_CODEPAGE_437 is not set
818# CONFIG_NLS_CODEPAGE_737 is not set
819# CONFIG_NLS_CODEPAGE_775 is not set
820# CONFIG_NLS_CODEPAGE_850 is not set
821# CONFIG_NLS_CODEPAGE_852 is not set
822# CONFIG_NLS_CODEPAGE_855 is not set
823# CONFIG_NLS_CODEPAGE_857 is not set
824# CONFIG_NLS_CODEPAGE_860 is not set
825# CONFIG_NLS_CODEPAGE_861 is not set
826# CONFIG_NLS_CODEPAGE_862 is not set
827# CONFIG_NLS_CODEPAGE_863 is not set
828# CONFIG_NLS_CODEPAGE_864 is not set
829# CONFIG_NLS_CODEPAGE_865 is not set
830# CONFIG_NLS_CODEPAGE_866 is not set
831# CONFIG_NLS_CODEPAGE_869 is not set
832# CONFIG_NLS_CODEPAGE_936 is not set
833# CONFIG_NLS_CODEPAGE_950 is not set
834# CONFIG_NLS_CODEPAGE_932 is not set
835# CONFIG_NLS_CODEPAGE_949 is not set
836# CONFIG_NLS_CODEPAGE_874 is not set
837# CONFIG_NLS_ISO8859_8 is not set
838# CONFIG_NLS_CODEPAGE_1250 is not set
839# CONFIG_NLS_CODEPAGE_1251 is not set
840CONFIG_NLS_ISO8859_1=m
841# CONFIG_NLS_ISO8859_2 is not set
842# CONFIG_NLS_ISO8859_3 is not set
843# CONFIG_NLS_ISO8859_4 is not set
844# CONFIG_NLS_ISO8859_5 is not set
845# CONFIG_NLS_ISO8859_6 is not set
846# CONFIG_NLS_ISO8859_7 is not set
847# CONFIG_NLS_ISO8859_9 is not set
848# CONFIG_NLS_ISO8859_13 is not set
849# CONFIG_NLS_ISO8859_14 is not set
850# CONFIG_NLS_ISO8859_15 is not set
851# CONFIG_NLS_KOI8_R is not set
852# CONFIG_NLS_KOI8_U is not set
853# CONFIG_NLS_UTF8 is not set
854
855#
856# Library routines
857#
858CONFIG_CRC32=y
859# CONFIG_LIBCRC32C is not set
860
861#
862# Kernel hacking
863#
864# CONFIG_DEBUG_KERNEL is not set
865# CONFIG_BOOTX_TEXT is not set
866
867#
868# Security options
869#
870# CONFIG_SECURITY is not set
871
872#
873# Cryptographic options
874#
875# CONFIG_CRYPTO is not set
diff --git a/arch/ppc/configs/pmac_defconfig b/arch/ppc/configs/pmac_defconfig
deleted file mode 100644
index a2db8b541c9b..000000000000
--- a/arch/ppc/configs/pmac_defconfig
+++ /dev/null
@@ -1,1591 +0,0 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.13-rc3
4# Wed Jul 13 14:13:13 2005
5#
6CONFIG_MMU=y
7CONFIG_GENERIC_HARDIRQS=y
8CONFIG_RWSEM_XCHGADD_ALGORITHM=y
9CONFIG_GENERIC_CALIBRATE_DELAY=y
10CONFIG_HAVE_DEC_LOCK=y
11CONFIG_PPC=y
12CONFIG_PPC32=y
13CONFIG_GENERIC_NVRAM=y
14CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
15
16#
17# Code maturity level options
18#
19CONFIG_EXPERIMENTAL=y
20CONFIG_CLEAN_COMPILE=y
21CONFIG_BROKEN_ON_SMP=y
22CONFIG_INIT_ENV_ARG_LIMIT=32
23
24#
25# General setup
26#
27CONFIG_LOCALVERSION=""
28CONFIG_SWAP=y
29CONFIG_SYSVIPC=y
30CONFIG_POSIX_MQUEUE=y
31# CONFIG_BSD_PROCESS_ACCT is not set
32CONFIG_SYSCTL=y
33# CONFIG_AUDIT is not set
34CONFIG_HOTPLUG=y
35CONFIG_KOBJECT_UEVENT=y
36CONFIG_IKCONFIG=y
37CONFIG_IKCONFIG_PROC=y
38# CONFIG_EMBEDDED is not set
39CONFIG_KALLSYMS=y
40# CONFIG_KALLSYMS_ALL is not set
41# CONFIG_KALLSYMS_EXTRA_PASS is not set
42CONFIG_PRINTK=y
43CONFIG_BUG=y
44CONFIG_BASE_FULL=y
45CONFIG_FUTEX=y
46CONFIG_EPOLL=y
47CONFIG_SHMEM=y
48CONFIG_CC_ALIGN_FUNCTIONS=0
49CONFIG_CC_ALIGN_LABELS=0
50CONFIG_CC_ALIGN_LOOPS=0
51CONFIG_CC_ALIGN_JUMPS=0
52# CONFIG_TINY_SHMEM is not set
53CONFIG_BASE_SMALL=0
54
55#
56# Loadable module support
57#
58CONFIG_MODULES=y
59CONFIG_MODULE_UNLOAD=y
60# CONFIG_MODULE_FORCE_UNLOAD is not set
61CONFIG_OBSOLETE_MODPARM=y
62CONFIG_MODVERSIONS=y
63CONFIG_MODULE_SRCVERSION_ALL=y
64CONFIG_KMOD=y
65
66#
67# Processor
68#
69CONFIG_6xx=y
70# CONFIG_40x is not set
71# CONFIG_44x is not set
72# CONFIG_POWER3 is not set
73# CONFIG_POWER4 is not set
74# CONFIG_8xx is not set
75# CONFIG_E200 is not set
76# CONFIG_E500 is not set
77CONFIG_PPC_FPU=y
78CONFIG_ALTIVEC=y
79CONFIG_TAU=y
80# CONFIG_TAU_INT is not set
81# CONFIG_TAU_AVERAGE is not set
82# CONFIG_KEXEC is not set
83CONFIG_CPU_FREQ=y
84CONFIG_CPU_FREQ_TABLE=y
85# CONFIG_CPU_FREQ_DEBUG is not set
86CONFIG_CPU_FREQ_STAT=m
87CONFIG_CPU_FREQ_STAT_DETAILS=y
88CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
89# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
90CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
91CONFIG_CPU_FREQ_GOV_POWERSAVE=m
92CONFIG_CPU_FREQ_GOV_USERSPACE=m
93CONFIG_CPU_FREQ_GOV_ONDEMAND=m
94CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m
95CONFIG_CPU_FREQ_PMAC=y
96CONFIG_PPC601_SYNC_FIX=y
97CONFIG_PM=y
98CONFIG_PPC_STD_MMU=y
99
100#
101# Platform options
102#
103CONFIG_PPC_MULTIPLATFORM=y
104# CONFIG_APUS is not set
105# CONFIG_KATANA is not set
106# CONFIG_WILLOW is not set
107# CONFIG_CPCI690 is not set
108# CONFIG_PCORE is not set
109# CONFIG_POWERPMC250 is not set
110# CONFIG_CHESTNUT is not set
111# CONFIG_SPRUCE is not set
112# CONFIG_HDPU is not set
113# CONFIG_EV64260 is not set
114# CONFIG_LOPEC is not set
115# CONFIG_MCPN765 is not set
116# CONFIG_MVME5100 is not set
117# CONFIG_PPLUS is not set
118# CONFIG_PRPMC750 is not set
119# CONFIG_PRPMC800 is not set
120# CONFIG_SANDPOINT is not set
121# CONFIG_RADSTONE_PPC7D is not set
122# CONFIG_ADIR is not set
123# CONFIG_K2 is not set
124# CONFIG_PAL4 is not set
125# CONFIG_GEMINI is not set
126# CONFIG_EST8260 is not set
127# CONFIG_SBC82xx is not set
128# CONFIG_SBS8260 is not set
129# CONFIG_RPX8260 is not set
130# CONFIG_TQM8260 is not set
131# CONFIG_ADS8272 is not set
132# CONFIG_PQ2FADS is not set
133# CONFIG_LITE5200 is not set
134# CONFIG_MPC834x_SYS is not set
135CONFIG_PPC_CHRP=y
136CONFIG_PPC_PMAC=y
137CONFIG_PPC_PREP=y
138CONFIG_PPC_OF=y
139CONFIG_PPCBUG_NVRAM=y
140# CONFIG_SMP is not set
141# CONFIG_HIGHMEM is not set
142# CONFIG_HZ_100 is not set
143CONFIG_HZ_250=y
144# CONFIG_HZ_1000 is not set
145CONFIG_HZ=250
146CONFIG_PREEMPT_NONE=y
147# CONFIG_PREEMPT_VOLUNTARY is not set
148# CONFIG_PREEMPT is not set
149CONFIG_SELECT_MEMORY_MODEL=y
150CONFIG_FLATMEM_MANUAL=y
151# CONFIG_DISCONTIGMEM_MANUAL is not set
152# CONFIG_SPARSEMEM_MANUAL is not set
153CONFIG_FLATMEM=y
154CONFIG_FLAT_NODE_MEM_MAP=y
155CONFIG_BINFMT_ELF=y
156CONFIG_BINFMT_MISC=m
157CONFIG_PROC_DEVICETREE=y
158# CONFIG_PREP_RESIDUAL is not set
159# CONFIG_CMDLINE_BOOL is not set
160# CONFIG_PM_DEBUG is not set
161CONFIG_SOFTWARE_SUSPEND=y
162CONFIG_PM_STD_PARTITION=""
163# CONFIG_SECCOMP is not set
164CONFIG_ISA_DMA_API=y
165
166#
167# Bus options
168#
169# CONFIG_ISA is not set
170CONFIG_GENERIC_ISA_DMA=y
171CONFIG_PCI=y
172CONFIG_PCI_DOMAINS=y
173CONFIG_PCI_LEGACY_PROC=y
174CONFIG_PCI_NAMES=y
175# CONFIG_PCI_DEBUG is not set
176
177#
178# PCCARD (PCMCIA/CardBus) support
179#
180CONFIG_PCCARD=m
181# CONFIG_PCMCIA_DEBUG is not set
182CONFIG_PCMCIA=m
183# CONFIG_PCMCIA_LOAD_CIS is not set
184# CONFIG_PCMCIA_IOCTL is not set
185CONFIG_CARDBUS=y
186
187#
188# PC-card bridges
189#
190CONFIG_YENTA=m
191# CONFIG_PD6729 is not set
192# CONFIG_I82092 is not set
193# CONFIG_TCIC is not set
194CONFIG_PCCARD_NONSTATIC=m
195
196#
197# Advanced setup
198#
199CONFIG_ADVANCED_OPTIONS=y
200CONFIG_HIGHMEM_START=0xfe000000
201# CONFIG_LOWMEM_SIZE_BOOL is not set
202CONFIG_LOWMEM_SIZE=0x30000000
203# CONFIG_KERNEL_START_BOOL is not set
204CONFIG_KERNEL_START=0xc0000000
205CONFIG_TASK_SIZE_BOOL=y
206CONFIG_TASK_SIZE=0xc0000000
207CONFIG_BOOT_LOAD=0x00800000
208
209#
210# Networking
211#
212CONFIG_NET=y
213
214#
215# Networking options
216#
217CONFIG_PACKET=y
218# CONFIG_PACKET_MMAP is not set
219CONFIG_UNIX=y
220# CONFIG_NET_KEY is not set
221CONFIG_INET=y
222CONFIG_IP_MULTICAST=y
223# CONFIG_IP_ADVANCED_ROUTER is not set
224CONFIG_IP_FIB_HASH=y
225# CONFIG_IP_PNP is not set
226# CONFIG_NET_IPIP is not set
227# CONFIG_NET_IPGRE is not set
228# CONFIG_IP_MROUTE is not set
229# CONFIG_ARPD is not set
230CONFIG_SYN_COOKIES=y
231# CONFIG_INET_AH is not set
232# CONFIG_INET_ESP is not set
233# CONFIG_INET_IPCOMP is not set
234# CONFIG_INET_TUNNEL is not set
235CONFIG_IP_TCPDIAG=y
236# CONFIG_IP_TCPDIAG_IPV6 is not set
237# CONFIG_TCP_CONG_ADVANCED is not set
238CONFIG_TCP_CONG_BIC=y
239
240#
241# IP: Virtual Server Configuration
242#
243# CONFIG_IP_VS is not set
244# CONFIG_IPV6 is not set
245CONFIG_NETFILTER=y
246# CONFIG_NETFILTER_DEBUG is not set
247
248#
249# IP: Netfilter Configuration
250#
251CONFIG_IP_NF_CONNTRACK=m
252CONFIG_IP_NF_CT_ACCT=y
253CONFIG_IP_NF_CONNTRACK_MARK=y
254CONFIG_IP_NF_CT_PROTO_SCTP=m
255CONFIG_IP_NF_FTP=m
256CONFIG_IP_NF_IRC=m
257CONFIG_IP_NF_TFTP=m
258CONFIG_IP_NF_AMANDA=m
259CONFIG_IP_NF_QUEUE=m
260CONFIG_IP_NF_IPTABLES=m
261CONFIG_IP_NF_MATCH_LIMIT=m
262CONFIG_IP_NF_MATCH_IPRANGE=m
263CONFIG_IP_NF_MATCH_MAC=m
264CONFIG_IP_NF_MATCH_PKTTYPE=m
265CONFIG_IP_NF_MATCH_MARK=m
266CONFIG_IP_NF_MATCH_MULTIPORT=m
267CONFIG_IP_NF_MATCH_TOS=m
268CONFIG_IP_NF_MATCH_RECENT=m
269CONFIG_IP_NF_MATCH_ECN=m
270CONFIG_IP_NF_MATCH_DSCP=m
271CONFIG_IP_NF_MATCH_AH_ESP=m
272CONFIG_IP_NF_MATCH_LENGTH=m
273CONFIG_IP_NF_MATCH_TTL=m
274CONFIG_IP_NF_MATCH_TCPMSS=m
275CONFIG_IP_NF_MATCH_HELPER=m
276CONFIG_IP_NF_MATCH_STATE=m
277CONFIG_IP_NF_MATCH_CONNTRACK=m
278CONFIG_IP_NF_MATCH_OWNER=m
279CONFIG_IP_NF_MATCH_ADDRTYPE=m
280CONFIG_IP_NF_MATCH_REALM=m
281CONFIG_IP_NF_MATCH_SCTP=m
282CONFIG_IP_NF_MATCH_COMMENT=m
283CONFIG_IP_NF_MATCH_CONNMARK=m
284CONFIG_IP_NF_MATCH_HASHLIMIT=m
285CONFIG_IP_NF_FILTER=m
286CONFIG_IP_NF_TARGET_REJECT=m
287CONFIG_IP_NF_TARGET_LOG=m
288CONFIG_IP_NF_TARGET_ULOG=m
289CONFIG_IP_NF_TARGET_TCPMSS=m
290CONFIG_IP_NF_NAT=m
291CONFIG_IP_NF_NAT_NEEDED=y
292CONFIG_IP_NF_TARGET_MASQUERADE=m
293CONFIG_IP_NF_TARGET_REDIRECT=m
294CONFIG_IP_NF_TARGET_NETMAP=m
295CONFIG_IP_NF_TARGET_SAME=m
296CONFIG_IP_NF_NAT_SNMP_BASIC=m
297CONFIG_IP_NF_NAT_IRC=m
298CONFIG_IP_NF_NAT_FTP=m
299CONFIG_IP_NF_NAT_TFTP=m
300CONFIG_IP_NF_NAT_AMANDA=m
301CONFIG_IP_NF_MANGLE=m
302CONFIG_IP_NF_TARGET_TOS=m
303CONFIG_IP_NF_TARGET_ECN=m
304CONFIG_IP_NF_TARGET_DSCP=m
305CONFIG_IP_NF_TARGET_MARK=m
306CONFIG_IP_NF_TARGET_CLASSIFY=m
307CONFIG_IP_NF_TARGET_CONNMARK=m
308CONFIG_IP_NF_TARGET_CLUSTERIP=m
309CONFIG_IP_NF_RAW=m
310CONFIG_IP_NF_TARGET_NOTRACK=m
311CONFIG_IP_NF_ARPTABLES=m
312CONFIG_IP_NF_ARPFILTER=m
313CONFIG_IP_NF_ARP_MANGLE=m
314
315#
316# SCTP Configuration (EXPERIMENTAL)
317#
318# CONFIG_IP_SCTP is not set
319# CONFIG_ATM is not set
320# CONFIG_BRIDGE is not set
321# CONFIG_VLAN_8021Q is not set
322# CONFIG_DECNET is not set
323# CONFIG_LLC2 is not set
324# CONFIG_IPX is not set
325# CONFIG_ATALK is not set
326# CONFIG_X25 is not set
327# CONFIG_LAPB is not set
328# CONFIG_NET_DIVERT is not set
329# CONFIG_ECONET is not set
330# CONFIG_WAN_ROUTER is not set
331# CONFIG_NET_SCHED is not set
332CONFIG_NET_CLS_ROUTE=y
333
334#
335# Network testing
336#
337# CONFIG_NET_PKTGEN is not set
338CONFIG_NETPOLL=y
339# CONFIG_NETPOLL_RX is not set
340# CONFIG_NETPOLL_TRAP is not set
341CONFIG_NET_POLL_CONTROLLER=y
342# CONFIG_HAMRADIO is not set
343CONFIG_IRDA=m
344
345#
346# IrDA protocols
347#
348CONFIG_IRLAN=m
349CONFIG_IRNET=m
350CONFIG_IRCOMM=m
351# CONFIG_IRDA_ULTRA is not set
352
353#
354# IrDA options
355#
356CONFIG_IRDA_CACHE_LAST_LSAP=y
357CONFIG_IRDA_FAST_RR=y
358# CONFIG_IRDA_DEBUG is not set
359
360#
361# Infrared-port device drivers
362#
363
364#
365# SIR device drivers
366#
367CONFIG_IRTTY_SIR=m
368
369#
370# Dongle support
371#
372# CONFIG_DONGLE is not set
373
374#
375# Old SIR device drivers
376#
377# CONFIG_IRPORT_SIR is not set
378
379#
380# Old Serial dongle support
381#
382
383#
384# FIR device drivers
385#
386# CONFIG_USB_IRDA is not set
387# CONFIG_SIGMATEL_FIR is not set
388# CONFIG_NSC_FIR is not set
389# CONFIG_WINBOND_FIR is not set
390# CONFIG_TOSHIBA_FIR is not set
391# CONFIG_SMC_IRCC_FIR is not set
392# CONFIG_ALI_FIR is not set
393# CONFIG_VLSI_FIR is not set
394# CONFIG_VIA_FIR is not set
395# CONFIG_BT is not set
396
397#
398# Device Drivers
399#
400
401#
402# Generic Driver Options
403#
404# CONFIG_STANDALONE is not set
405CONFIG_PREVENT_FIRMWARE_BUILD=y
406CONFIG_FW_LOADER=m
407# CONFIG_DEBUG_DRIVER is not set
408
409#
410# Memory Technology Devices (MTD)
411#
412# CONFIG_MTD is not set
413
414#
415# Parallel port support
416#
417# CONFIG_PARPORT is not set
418
419#
420# Plug and Play support
421#
422
423#
424# Block devices
425#
426# CONFIG_BLK_DEV_FD is not set
427CONFIG_MAC_FLOPPY=m
428# CONFIG_BLK_CPQ_DA is not set
429# CONFIG_BLK_CPQ_CISS_DA is not set
430# CONFIG_BLK_DEV_DAC960 is not set
431# CONFIG_BLK_DEV_UMEM is not set
432# CONFIG_BLK_DEV_COW_COMMON is not set
433CONFIG_BLK_DEV_LOOP=y
434# CONFIG_BLK_DEV_CRYPTOLOOP is not set
435# CONFIG_BLK_DEV_NBD is not set
436# CONFIG_BLK_DEV_SX8 is not set
437# CONFIG_BLK_DEV_UB is not set
438CONFIG_BLK_DEV_RAM=y
439CONFIG_BLK_DEV_RAM_COUNT=16
440CONFIG_BLK_DEV_RAM_SIZE=4096
441CONFIG_BLK_DEV_INITRD=y
442CONFIG_INITRAMFS_SOURCE=""
443CONFIG_LBD=y
444CONFIG_CDROM_PKTCDVD=m
445CONFIG_CDROM_PKTCDVD_BUFFERS=8
446# CONFIG_CDROM_PKTCDVD_WCACHE is not set
447
448#
449# IO Schedulers
450#
451CONFIG_IOSCHED_NOOP=y
452CONFIG_IOSCHED_AS=y
453CONFIG_IOSCHED_DEADLINE=y
454CONFIG_IOSCHED_CFQ=y
455# CONFIG_ATA_OVER_ETH is not set
456
457#
458# ATA/ATAPI/MFM/RLL support
459#
460CONFIG_IDE=y
461CONFIG_BLK_DEV_IDE=y
462
463#
464# Please see Documentation/ide.txt for help/info on IDE drives
465#
466# CONFIG_BLK_DEV_IDE_SATA is not set
467CONFIG_BLK_DEV_IDEDISK=y
468# CONFIG_IDEDISK_MULTI_MODE is not set
469# CONFIG_BLK_DEV_IDECS is not set
470CONFIG_BLK_DEV_IDECD=y
471# CONFIG_BLK_DEV_IDETAPE is not set
472CONFIG_BLK_DEV_IDEFLOPPY=y
473CONFIG_BLK_DEV_IDESCSI=y
474# CONFIG_IDE_TASK_IOCTL is not set
475
476#
477# IDE chipset support/bugfixes
478#
479# CONFIG_IDE_GENERIC is not set
480CONFIG_BLK_DEV_IDEPCI=y
481CONFIG_IDEPCI_SHARE_IRQ=y
482# CONFIG_BLK_DEV_OFFBOARD is not set
483CONFIG_BLK_DEV_GENERIC=y
484# CONFIG_BLK_DEV_OPTI621 is not set
485# CONFIG_BLK_DEV_SL82C105 is not set
486CONFIG_BLK_DEV_IDEDMA_PCI=y
487# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
488CONFIG_IDEDMA_PCI_AUTO=y
489# CONFIG_IDEDMA_ONLYDISK is not set
490# CONFIG_BLK_DEV_AEC62XX is not set
491# CONFIG_BLK_DEV_ALI15X3 is not set
492# CONFIG_BLK_DEV_AMD74XX is not set
493CONFIG_BLK_DEV_CMD64X=y
494# CONFIG_BLK_DEV_TRIFLEX is not set
495# CONFIG_BLK_DEV_CY82C693 is not set
496# CONFIG_BLK_DEV_CS5520 is not set
497# CONFIG_BLK_DEV_CS5530 is not set
498# CONFIG_BLK_DEV_HPT34X is not set
499# CONFIG_BLK_DEV_HPT366 is not set
500# CONFIG_BLK_DEV_SC1200 is not set
501# CONFIG_BLK_DEV_PIIX is not set
502# CONFIG_BLK_DEV_IT821X is not set
503# CONFIG_BLK_DEV_NS87415 is not set
504# CONFIG_BLK_DEV_PDC202XX_OLD is not set
505CONFIG_BLK_DEV_PDC202XX_NEW=y
506# CONFIG_PDC202XX_FORCE is not set
507# CONFIG_BLK_DEV_SVWKS is not set
508# CONFIG_BLK_DEV_SIIMAGE is not set
509# CONFIG_BLK_DEV_SLC90E66 is not set
510# CONFIG_BLK_DEV_TRM290 is not set
511# CONFIG_BLK_DEV_VIA82CXXX is not set
512CONFIG_BLK_DEV_IDE_PMAC=y
513CONFIG_BLK_DEV_IDE_PMAC_ATA100FIRST=y
514CONFIG_BLK_DEV_IDEDMA_PMAC=y
515CONFIG_BLK_DEV_IDE_PMAC_BLINK=y
516# CONFIG_IDE_ARM is not set
517CONFIG_BLK_DEV_IDEDMA=y
518# CONFIG_IDEDMA_IVB is not set
519CONFIG_IDEDMA_AUTO=y
520# CONFIG_BLK_DEV_HD is not set
521
522#
523# SCSI device support
524#
525CONFIG_SCSI=y
526CONFIG_SCSI_PROC_FS=y
527
528#
529# SCSI support type (disk, tape, CD-ROM)
530#
531CONFIG_BLK_DEV_SD=y
532CONFIG_CHR_DEV_ST=y
533# CONFIG_CHR_DEV_OSST is not set
534CONFIG_BLK_DEV_SR=y
535CONFIG_BLK_DEV_SR_VENDOR=y
536CONFIG_CHR_DEV_SG=y
537# CONFIG_CHR_DEV_SCH is not set
538
539#
540# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
541#
542# CONFIG_SCSI_MULTI_LUN is not set
543CONFIG_SCSI_CONSTANTS=y
544# CONFIG_SCSI_LOGGING is not set
545
546#
547# SCSI Transport Attributes
548#
549CONFIG_SCSI_SPI_ATTRS=y
550# CONFIG_SCSI_FC_ATTRS is not set
551# CONFIG_SCSI_ISCSI_ATTRS is not set
552
553#
554# SCSI low-level drivers
555#
556# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
557# CONFIG_SCSI_3W_9XXX is not set
558# CONFIG_SCSI_ACARD is not set
559# CONFIG_SCSI_AACRAID is not set
560CONFIG_SCSI_AIC7XXX=m
561CONFIG_AIC7XXX_CMDS_PER_DEVICE=253
562CONFIG_AIC7XXX_RESET_DELAY_MS=15000
563CONFIG_AIC7XXX_DEBUG_ENABLE=y
564CONFIG_AIC7XXX_DEBUG_MASK=0
565CONFIG_AIC7XXX_REG_PRETTY_PRINT=y
566CONFIG_SCSI_AIC7XXX_OLD=m
567# CONFIG_SCSI_AIC79XX is not set
568# CONFIG_SCSI_DPT_I2O is not set
569# CONFIG_MEGARAID_NEWGEN is not set
570# CONFIG_MEGARAID_LEGACY is not set
571# CONFIG_SCSI_SATA is not set
572# CONFIG_SCSI_BUSLOGIC is not set
573# CONFIG_SCSI_DMX3191D is not set
574# CONFIG_SCSI_EATA is not set
575# CONFIG_SCSI_FUTURE_DOMAIN is not set
576# CONFIG_SCSI_GDTH is not set
577# CONFIG_SCSI_IPS is not set
578# CONFIG_SCSI_INITIO is not set
579# CONFIG_SCSI_INIA100 is not set
580CONFIG_SCSI_SYM53C8XX_2=y
581CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=0
582CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
583CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
584# CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set
585# CONFIG_SCSI_IPR is not set
586# CONFIG_SCSI_QLOGIC_FC is not set
587# CONFIG_SCSI_QLOGIC_1280 is not set
588CONFIG_SCSI_QLA2XXX=y
589# CONFIG_SCSI_QLA21XX is not set
590# CONFIG_SCSI_QLA22XX is not set
591# CONFIG_SCSI_QLA2300 is not set
592# CONFIG_SCSI_QLA2322 is not set
593# CONFIG_SCSI_QLA6312 is not set
594# CONFIG_SCSI_LPFC is not set
595# CONFIG_SCSI_DC395x is not set
596# CONFIG_SCSI_DC390T is not set
597# CONFIG_SCSI_NSP32 is not set
598# CONFIG_SCSI_DEBUG is not set
599CONFIG_SCSI_MESH=y
600CONFIG_SCSI_MESH_SYNC_RATE=5
601CONFIG_SCSI_MESH_RESET_DELAY_MS=1000
602CONFIG_SCSI_MAC53C94=y
603
604#
605# PCMCIA SCSI adapter support
606#
607# CONFIG_PCMCIA_AHA152X is not set
608# CONFIG_PCMCIA_FDOMAIN is not set
609# CONFIG_PCMCIA_NINJA_SCSI is not set
610# CONFIG_PCMCIA_QLOGIC is not set
611# CONFIG_PCMCIA_SYM53C500 is not set
612
613#
614# Multi-device support (RAID and LVM)
615#
616# CONFIG_MD is not set
617
618#
619# Fusion MPT device support
620#
621# CONFIG_FUSION is not set
622# CONFIG_FUSION_SPI is not set
623# CONFIG_FUSION_FC is not set
624
625#
626# IEEE 1394 (FireWire) support
627#
628CONFIG_IEEE1394=m
629
630#
631# Subsystem Options
632#
633# CONFIG_IEEE1394_VERBOSEDEBUG is not set
634# CONFIG_IEEE1394_OUI_DB is not set
635CONFIG_IEEE1394_EXTRA_CONFIG_ROMS=y
636CONFIG_IEEE1394_CONFIG_ROM_IP1394=y
637# CONFIG_IEEE1394_EXPORT_FULL_API is not set
638
639#
640# Device Drivers
641#
642# CONFIG_IEEE1394_PCILYNX is not set
643CONFIG_IEEE1394_OHCI1394=m
644
645#
646# Protocol Drivers
647#
648CONFIG_IEEE1394_VIDEO1394=m
649CONFIG_IEEE1394_SBP2=m
650# CONFIG_IEEE1394_SBP2_PHYS_DMA is not set
651CONFIG_IEEE1394_ETH1394=m
652CONFIG_IEEE1394_DV1394=m
653CONFIG_IEEE1394_RAWIO=m
654CONFIG_IEEE1394_CMP=m
655CONFIG_IEEE1394_AMDTP=m
656
657#
658# I2O device support
659#
660# CONFIG_I2O is not set
661
662#
663# Macintosh device drivers
664#
665CONFIG_ADB=y
666CONFIG_ADB_CUDA=y
667CONFIG_ADB_PMU=y
668CONFIG_PMAC_APM_EMU=y
669CONFIG_PMAC_MEDIABAY=y
670CONFIG_PMAC_BACKLIGHT=y
671CONFIG_ADB_MACIO=y
672CONFIG_INPUT_ADBHID=y
673CONFIG_MAC_EMUMOUSEBTN=y
674CONFIG_THERM_WINDTUNNEL=m
675CONFIG_THERM_ADT746X=m
676# CONFIG_ANSLCD is not set
677
678#
679# Network device support
680#
681CONFIG_NETDEVICES=y
682# CONFIG_DUMMY is not set
683# CONFIG_BONDING is not set
684# CONFIG_EQUALIZER is not set
685CONFIG_TUN=m
686
687#
688# ARCnet devices
689#
690# CONFIG_ARCNET is not set
691
692#
693# Ethernet (10 or 100Mbit)
694#
695CONFIG_NET_ETHERNET=y
696CONFIG_MII=y
697CONFIG_MACE=y
698# CONFIG_MACE_AAUI_PORT is not set
699CONFIG_BMAC=y
700# CONFIG_HAPPYMEAL is not set
701CONFIG_SUNGEM=y
702# CONFIG_NET_VENDOR_3COM is not set
703
704#
705# Tulip family network device support
706#
707# CONFIG_NET_TULIP is not set
708# CONFIG_HP100 is not set
709CONFIG_NET_PCI=y
710CONFIG_PCNET32=y
711# CONFIG_AMD8111_ETH is not set
712# CONFIG_ADAPTEC_STARFIRE is not set
713# CONFIG_B44 is not set
714# CONFIG_FORCEDETH is not set
715# CONFIG_DGRS is not set
716# CONFIG_EEPRO100 is not set
717# CONFIG_E100 is not set
718# CONFIG_FEALNX is not set
719# CONFIG_NATSEMI is not set
720# CONFIG_NE2K_PCI is not set
721# CONFIG_8139CP is not set
722# CONFIG_8139TOO is not set
723# CONFIG_SIS900 is not set
724# CONFIG_EPIC100 is not set
725# CONFIG_SUNDANCE is not set
726# CONFIG_TLAN is not set
727# CONFIG_VIA_RHINE is not set
728
729#
730# Ethernet (1000 Mbit)
731#
732# CONFIG_ACENIC is not set
733# CONFIG_DL2K is not set
734# CONFIG_E1000 is not set
735# CONFIG_NS83820 is not set
736# CONFIG_HAMACHI is not set
737# CONFIG_YELLOWFIN is not set
738# CONFIG_R8169 is not set
739# CONFIG_SKGE is not set
740# CONFIG_SK98LIN is not set
741# CONFIG_VIA_VELOCITY is not set
742# CONFIG_TIGON3 is not set
743# CONFIG_BNX2 is not set
744# CONFIG_MV643XX_ETH is not set
745
746#
747# Ethernet (10000 Mbit)
748#
749# CONFIG_IXGB is not set
750# CONFIG_S2IO is not set
751
752#
753# Token Ring devices
754#
755# CONFIG_TR is not set
756
757#
758# Wireless LAN (non-hamradio)
759#
760CONFIG_NET_RADIO=y
761
762#
763# Obsolete Wireless cards support (pre-802.11)
764#
765# CONFIG_STRIP is not set
766# CONFIG_PCMCIA_WAVELAN is not set
767# CONFIG_PCMCIA_NETWAVE is not set
768
769#
770# Wireless 802.11 Frequency Hopping cards support
771#
772# CONFIG_PCMCIA_RAYCS is not set
773
774#
775# Wireless 802.11b ISA/PCI cards support
776#
777CONFIG_HERMES=m
778CONFIG_APPLE_AIRPORT=m
779# CONFIG_PLX_HERMES is not set
780# CONFIG_TMD_HERMES is not set
781# CONFIG_PCI_HERMES is not set
782# CONFIG_ATMEL is not set
783
784#
785# Wireless 802.11b Pcmcia/Cardbus cards support
786#
787CONFIG_PCMCIA_HERMES=m
788# CONFIG_AIRO_CS is not set
789# CONFIG_PCMCIA_WL3501 is not set
790
791#
792# Prism GT/Duette 802.11(a/b/g) PCI/Cardbus support
793#
794# CONFIG_PRISM54 is not set
795CONFIG_NET_WIRELESS=y
796
797#
798# PCMCIA network device support
799#
800# CONFIG_NET_PCMCIA is not set
801
802#
803# Wan interfaces
804#
805# CONFIG_WAN is not set
806# CONFIG_FDDI is not set
807# CONFIG_HIPPI is not set
808CONFIG_PPP=y
809CONFIG_PPP_MULTILINK=y
810# CONFIG_PPP_FILTER is not set
811CONFIG_PPP_ASYNC=y
812CONFIG_PPP_SYNC_TTY=m
813CONFIG_PPP_DEFLATE=y
814CONFIG_PPP_BSDCOMP=m
815CONFIG_PPPOE=m
816# CONFIG_SLIP is not set
817# CONFIG_NET_FC is not set
818# CONFIG_SHAPER is not set
819CONFIG_NETCONSOLE=m
820
821#
822# ISDN subsystem
823#
824# CONFIG_ISDN is not set
825
826#
827# Telephony Support
828#
829# CONFIG_PHONE is not set
830
831#
832# Input device support
833#
834CONFIG_INPUT=y
835
836#
837# Userland interfaces
838#
839CONFIG_INPUT_MOUSEDEV=y
840# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
841CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
842CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
843# CONFIG_INPUT_JOYDEV is not set
844# CONFIG_INPUT_TSDEV is not set
845CONFIG_INPUT_EVDEV=y
846# CONFIG_INPUT_EVBUG is not set
847
848#
849# Input Device Drivers
850#
851CONFIG_INPUT_KEYBOARD=y
852# CONFIG_KEYBOARD_ATKBD is not set
853# CONFIG_KEYBOARD_SUNKBD is not set
854# CONFIG_KEYBOARD_LKKBD is not set
855# CONFIG_KEYBOARD_XTKBD is not set
856# CONFIG_KEYBOARD_NEWTON is not set
857CONFIG_INPUT_MOUSE=y
858# CONFIG_MOUSE_PS2 is not set
859# CONFIG_MOUSE_SERIAL is not set
860# CONFIG_MOUSE_VSXXXAA is not set
861# CONFIG_INPUT_JOYSTICK is not set
862# CONFIG_INPUT_TOUCHSCREEN is not set
863# CONFIG_INPUT_MISC is not set
864
865#
866# Hardware I/O ports
867#
868# CONFIG_SERIO is not set
869# CONFIG_GAMEPORT is not set
870
871#
872# Character devices
873#
874CONFIG_VT=y
875CONFIG_VT_CONSOLE=y
876CONFIG_HW_CONSOLE=y
877# CONFIG_SERIAL_NONSTANDARD is not set
878
879#
880# Serial drivers
881#
882CONFIG_SERIAL_8250=m
883CONFIG_SERIAL_8250_CS=m
884CONFIG_SERIAL_8250_NR_UARTS=4
885# CONFIG_SERIAL_8250_EXTENDED is not set
886
887#
888# Non-8250 serial port support
889#
890CONFIG_SERIAL_CORE=y
891CONFIG_SERIAL_CORE_CONSOLE=y
892CONFIG_SERIAL_PMACZILOG=y
893CONFIG_SERIAL_PMACZILOG_CONSOLE=y
894# CONFIG_SERIAL_JSM is not set
895CONFIG_UNIX98_PTYS=y
896CONFIG_LEGACY_PTYS=y
897CONFIG_LEGACY_PTY_COUNT=256
898
899#
900# IPMI
901#
902# CONFIG_IPMI_HANDLER is not set
903
904#
905# Watchdog Cards
906#
907# CONFIG_WATCHDOG is not set
908CONFIG_NVRAM=y
909CONFIG_GEN_RTC=y
910# CONFIG_GEN_RTC_X is not set
911# CONFIG_DTLK is not set
912# CONFIG_R3964 is not set
913# CONFIG_APPLICOM is not set
914
915#
916# Ftape, the floppy tape device driver
917#
918CONFIG_AGP=m
919CONFIG_AGP_UNINORTH=m
920CONFIG_DRM=m
921# CONFIG_DRM_TDFX is not set
922CONFIG_DRM_R128=m
923CONFIG_DRM_RADEON=m
924# CONFIG_DRM_MGA is not set
925# CONFIG_DRM_SIS is not set
926# CONFIG_DRM_VIA is not set
927
928#
929# PCMCIA character devices
930#
931# CONFIG_SYNCLINK_CS is not set
932# CONFIG_RAW_DRIVER is not set
933
934#
935# TPM devices
936#
937# CONFIG_TCG_TPM is not set
938
939#
940# I2C support
941#
942CONFIG_I2C=y
943CONFIG_I2C_CHARDEV=m
944
945#
946# I2C Algorithms
947#
948CONFIG_I2C_ALGOBIT=y
949# CONFIG_I2C_ALGOPCF is not set
950# CONFIG_I2C_ALGOPCA is not set
951
952#
953# I2C Hardware Bus support
954#
955# CONFIG_I2C_ALI1535 is not set
956# CONFIG_I2C_ALI1563 is not set
957# CONFIG_I2C_ALI15X3 is not set
958# CONFIG_I2C_AMD756 is not set
959# CONFIG_I2C_AMD8111 is not set
960# CONFIG_I2C_HYDRA is not set
961# CONFIG_I2C_I801 is not set
962# CONFIG_I2C_I810 is not set
963# CONFIG_I2C_PIIX4 is not set
964# CONFIG_I2C_ISA is not set
965CONFIG_I2C_KEYWEST=m
966# CONFIG_I2C_MPC is not set
967# CONFIG_I2C_NFORCE2 is not set
968# CONFIG_I2C_PARPORT_LIGHT is not set
969# CONFIG_I2C_PROSAVAGE is not set
970# CONFIG_I2C_SAVAGE4 is not set
971# CONFIG_SCx200_ACB is not set
972# CONFIG_I2C_SIS5595 is not set
973# CONFIG_I2C_SIS630 is not set
974# CONFIG_I2C_SIS96X is not set
975# CONFIG_I2C_STUB is not set
976# CONFIG_I2C_VIA is not set
977# CONFIG_I2C_VIAPRO is not set
978# CONFIG_I2C_VOODOO3 is not set
979# CONFIG_I2C_PCA_ISA is not set
980# CONFIG_I2C_SENSOR is not set
981
982#
983# Miscellaneous I2C Chip support
984#
985# CONFIG_SENSORS_DS1337 is not set
986# CONFIG_SENSORS_DS1374 is not set
987# CONFIG_SENSORS_EEPROM is not set
988# CONFIG_SENSORS_PCF8574 is not set
989# CONFIG_SENSORS_PCA9539 is not set
990# CONFIG_SENSORS_PCF8591 is not set
991# CONFIG_SENSORS_RTC8564 is not set
992# CONFIG_SENSORS_M41T00 is not set
993# CONFIG_SENSORS_MAX6875 is not set
994# CONFIG_I2C_DEBUG_CORE is not set
995# CONFIG_I2C_DEBUG_ALGO is not set
996# CONFIG_I2C_DEBUG_BUS is not set
997# CONFIG_I2C_DEBUG_CHIP is not set
998
999#
1000# Dallas's 1-wire bus
1001#
1002# CONFIG_W1 is not set
1003
1004#
1005# Hardware Monitoring support
1006#
1007# CONFIG_HWMON is not set
1008
1009#
1010# Misc devices
1011#
1012
1013#
1014# Multimedia devices
1015#
1016# CONFIG_VIDEO_DEV is not set
1017
1018#
1019# Digital Video Broadcasting Devices
1020#
1021# CONFIG_DVB is not set
1022
1023#
1024# Graphics support
1025#
1026CONFIG_FB=y
1027CONFIG_FB_CFB_FILLRECT=y
1028CONFIG_FB_CFB_COPYAREA=y
1029CONFIG_FB_CFB_IMAGEBLIT=y
1030CONFIG_FB_SOFT_CURSOR=y
1031CONFIG_FB_MACMODES=y
1032CONFIG_FB_MODE_HELPERS=y
1033CONFIG_FB_TILEBLITTING=y
1034# CONFIG_FB_CIRRUS is not set
1035# CONFIG_FB_PM2 is not set
1036# CONFIG_FB_CYBER2000 is not set
1037CONFIG_FB_OF=y
1038CONFIG_FB_CONTROL=y
1039CONFIG_FB_PLATINUM=y
1040CONFIG_FB_VALKYRIE=y
1041CONFIG_FB_CT65550=y
1042# CONFIG_FB_ASILIANT is not set
1043CONFIG_FB_IMSTT=y
1044# CONFIG_FB_VGA16 is not set
1045# CONFIG_FB_NVIDIA is not set
1046# CONFIG_FB_RIVA is not set
1047CONFIG_FB_MATROX=y
1048CONFIG_FB_MATROX_MILLENIUM=y
1049CONFIG_FB_MATROX_MYSTIQUE=y
1050CONFIG_FB_MATROX_G=y
1051# CONFIG_FB_MATROX_I2C is not set
1052# CONFIG_FB_MATROX_MULTIHEAD is not set
1053# CONFIG_FB_RADEON_OLD is not set
1054CONFIG_FB_RADEON=y
1055CONFIG_FB_RADEON_I2C=y
1056# CONFIG_FB_RADEON_DEBUG is not set
1057CONFIG_FB_ATY128=y
1058CONFIG_FB_ATY=y
1059CONFIG_FB_ATY_CT=y
1060CONFIG_FB_ATY_GENERIC_LCD=y
1061# CONFIG_FB_ATY_XL_INIT is not set
1062CONFIG_FB_ATY_GX=y
1063# CONFIG_FB_SAVAGE is not set
1064# CONFIG_FB_SIS is not set
1065# CONFIG_FB_NEOMAGIC is not set
1066# CONFIG_FB_KYRO is not set
1067CONFIG_FB_3DFX=y
1068CONFIG_FB_3DFX_ACCEL=y
1069# CONFIG_FB_VOODOO1 is not set
1070# CONFIG_FB_TRIDENT is not set
1071# CONFIG_FB_S1D13XXX is not set
1072# CONFIG_FB_VIRTUAL is not set
1073
1074#
1075# Console display driver support
1076#
1077# CONFIG_VGA_CONSOLE is not set
1078CONFIG_DUMMY_CONSOLE=y
1079CONFIG_FRAMEBUFFER_CONSOLE=y
1080# CONFIG_FONTS is not set
1081CONFIG_FONT_8x8=y
1082CONFIG_FONT_8x16=y
1083
1084#
1085# Logo configuration
1086#
1087CONFIG_LOGO=y
1088CONFIG_LOGO_LINUX_MONO=y
1089CONFIG_LOGO_LINUX_VGA16=y
1090CONFIG_LOGO_LINUX_CLUT224=y
1091CONFIG_BACKLIGHT_LCD_SUPPORT=y
1092CONFIG_BACKLIGHT_CLASS_DEVICE=y
1093CONFIG_BACKLIGHT_DEVICE=y
1094CONFIG_LCD_CLASS_DEVICE=y
1095CONFIG_LCD_DEVICE=y
1096
1097#
1098# Sound
1099#
1100CONFIG_SOUND=m
1101CONFIG_DMASOUND_PMAC=m
1102CONFIG_DMASOUND=m
1103
1104#
1105# Advanced Linux Sound Architecture
1106#
1107CONFIG_SND=m
1108CONFIG_SND_TIMER=m
1109CONFIG_SND_PCM=m
1110CONFIG_SND_HWDEP=m
1111CONFIG_SND_RAWMIDI=m
1112CONFIG_SND_SEQUENCER=m
1113CONFIG_SND_SEQ_DUMMY=m
1114CONFIG_SND_OSSEMUL=y
1115CONFIG_SND_MIXER_OSS=m
1116CONFIG_SND_PCM_OSS=m
1117CONFIG_SND_SEQUENCER_OSS=y
1118# CONFIG_SND_VERBOSE_PRINTK is not set
1119# CONFIG_SND_DEBUG is not set
1120
1121#
1122# Generic devices
1123#
1124CONFIG_SND_DUMMY=m
1125# CONFIG_SND_VIRMIDI is not set
1126# CONFIG_SND_MTPAV is not set
1127# CONFIG_SND_SERIAL_U16550 is not set
1128# CONFIG_SND_MPU401 is not set
1129
1130#
1131# PCI devices
1132#
1133# CONFIG_SND_ALI5451 is not set
1134# CONFIG_SND_ATIIXP is not set
1135# CONFIG_SND_ATIIXP_MODEM is not set
1136# CONFIG_SND_AU8810 is not set
1137# CONFIG_SND_AU8820 is not set
1138# CONFIG_SND_AU8830 is not set
1139# CONFIG_SND_AZT3328 is not set
1140# CONFIG_SND_BT87X is not set
1141# CONFIG_SND_CS46XX is not set
1142# CONFIG_SND_CS4281 is not set
1143# CONFIG_SND_EMU10K1 is not set
1144# CONFIG_SND_EMU10K1X is not set
1145# CONFIG_SND_CA0106 is not set
1146# CONFIG_SND_KORG1212 is not set
1147# CONFIG_SND_MIXART is not set
1148# CONFIG_SND_NM256 is not set
1149# CONFIG_SND_RME32 is not set
1150# CONFIG_SND_RME96 is not set
1151# CONFIG_SND_RME9652 is not set
1152# CONFIG_SND_HDSP is not set
1153# CONFIG_SND_HDSPM is not set
1154# CONFIG_SND_TRIDENT is not set
1155# CONFIG_SND_YMFPCI is not set
1156# CONFIG_SND_ALS4000 is not set
1157# CONFIG_SND_CMIPCI is not set
1158# CONFIG_SND_ENS1370 is not set
1159# CONFIG_SND_ENS1371 is not set
1160# CONFIG_SND_ES1938 is not set
1161# CONFIG_SND_ES1968 is not set
1162# CONFIG_SND_MAESTRO3 is not set
1163# CONFIG_SND_FM801 is not set
1164# CONFIG_SND_ICE1712 is not set
1165# CONFIG_SND_ICE1724 is not set
1166# CONFIG_SND_INTEL8X0 is not set
1167# CONFIG_SND_INTEL8X0M is not set
1168# CONFIG_SND_SONICVIBES is not set
1169# CONFIG_SND_VIA82XX is not set
1170# CONFIG_SND_VIA82XX_MODEM is not set
1171# CONFIG_SND_VX222 is not set
1172# CONFIG_SND_HDA_INTEL is not set
1173
1174#
1175# ALSA PowerMac devices
1176#
1177CONFIG_SND_POWERMAC=m
1178
1179#
1180# USB devices
1181#
1182CONFIG_SND_USB_AUDIO=m
1183CONFIG_SND_USB_USX2Y=m
1184
1185#
1186# PCMCIA devices
1187#
1188
1189#
1190# Open Sound System
1191#
1192# CONFIG_SOUND_PRIME is not set
1193
1194#
1195# USB support
1196#
1197CONFIG_USB_ARCH_HAS_HCD=y
1198CONFIG_USB_ARCH_HAS_OHCI=y
1199CONFIG_USB=y
1200# CONFIG_USB_DEBUG is not set
1201
1202#
1203# Miscellaneous USB options
1204#
1205CONFIG_USB_DEVICEFS=y
1206# CONFIG_USB_BANDWIDTH is not set
1207CONFIG_USB_DYNAMIC_MINORS=y
1208CONFIG_USB_SUSPEND=y
1209# CONFIG_USB_OTG is not set
1210
1211#
1212# USB Host Controller Drivers
1213#
1214# CONFIG_USB_EHCI_HCD is not set
1215# CONFIG_USB_ISP116X_HCD is not set
1216CONFIG_USB_OHCI_HCD=y
1217# CONFIG_USB_OHCI_BIG_ENDIAN is not set
1218CONFIG_USB_OHCI_LITTLE_ENDIAN=y
1219# CONFIG_USB_UHCI_HCD is not set
1220# CONFIG_USB_SL811_HCD is not set
1221
1222#
1223# USB Device Class drivers
1224#
1225# CONFIG_USB_AUDIO is not set
1226# CONFIG_USB_BLUETOOTH_TTY is not set
1227# CONFIG_USB_MIDI is not set
1228CONFIG_USB_ACM=m
1229CONFIG_USB_PRINTER=m
1230
1231#
1232# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
1233#
1234# CONFIG_USB_STORAGE is not set
1235
1236#
1237# USB Input Devices
1238#
1239CONFIG_USB_HID=y
1240CONFIG_USB_HIDINPUT=y
1241# CONFIG_HID_FF is not set
1242CONFIG_USB_HIDDEV=y
1243# CONFIG_USB_AIPTEK is not set
1244# CONFIG_USB_WACOM is not set
1245# CONFIG_USB_ACECAD is not set
1246# CONFIG_USB_KBTAB is not set
1247# CONFIG_USB_POWERMATE is not set
1248# CONFIG_USB_MTOUCH is not set
1249# CONFIG_USB_ITMTOUCH is not set
1250# CONFIG_USB_EGALAX is not set
1251# CONFIG_USB_XPAD is not set
1252# CONFIG_USB_ATI_REMOTE is not set
1253# CONFIG_USB_KEYSPAN_REMOTE is not set
1254
1255#
1256# USB Imaging devices
1257#
1258# CONFIG_USB_MDC800 is not set
1259# CONFIG_USB_MICROTEK is not set
1260
1261#
1262# USB Multimedia devices
1263#
1264# CONFIG_USB_DABUSB is not set
1265
1266#
1267# Video4Linux support is needed for USB Multimedia device support
1268#
1269
1270#
1271# USB Network Adapters
1272#
1273# CONFIG_USB_CATC is not set
1274# CONFIG_USB_KAWETH is not set
1275CONFIG_USB_PEGASUS=m
1276# CONFIG_USB_RTL8150 is not set
1277# CONFIG_USB_USBNET is not set
1278# CONFIG_USB_ZD1201 is not set
1279# CONFIG_USB_MON is not set
1280
1281#
1282# USB port drivers
1283#
1284
1285#
1286# USB Serial Converter support
1287#
1288CONFIG_USB_SERIAL=m
1289# CONFIG_USB_SERIAL_GENERIC is not set
1290# CONFIG_USB_SERIAL_AIRPRIME is not set
1291# CONFIG_USB_SERIAL_BELKIN is not set
1292# CONFIG_USB_SERIAL_WHITEHEAT is not set
1293# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
1294# CONFIG_USB_SERIAL_CP2101 is not set
1295# CONFIG_USB_SERIAL_CYPRESS_M8 is not set
1296# CONFIG_USB_SERIAL_EMPEG is not set
1297# CONFIG_USB_SERIAL_FTDI_SIO is not set
1298CONFIG_USB_SERIAL_VISOR=m
1299# CONFIG_USB_SERIAL_IPAQ is not set
1300# CONFIG_USB_SERIAL_IR is not set
1301# CONFIG_USB_SERIAL_EDGEPORT is not set
1302# CONFIG_USB_SERIAL_EDGEPORT_TI is not set
1303# CONFIG_USB_SERIAL_GARMIN is not set
1304# CONFIG_USB_SERIAL_IPW is not set
1305# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
1306CONFIG_USB_SERIAL_KEYSPAN=m
1307CONFIG_USB_SERIAL_KEYSPAN_MPR=y
1308CONFIG_USB_SERIAL_KEYSPAN_USA28=y
1309CONFIG_USB_SERIAL_KEYSPAN_USA28X=y
1310CONFIG_USB_SERIAL_KEYSPAN_USA28XA=y
1311CONFIG_USB_SERIAL_KEYSPAN_USA28XB=y
1312CONFIG_USB_SERIAL_KEYSPAN_USA19=y
1313CONFIG_USB_SERIAL_KEYSPAN_USA18X=y
1314CONFIG_USB_SERIAL_KEYSPAN_USA19W=y
1315CONFIG_USB_SERIAL_KEYSPAN_USA19QW=y
1316CONFIG_USB_SERIAL_KEYSPAN_USA19QI=y
1317CONFIG_USB_SERIAL_KEYSPAN_USA49W=y
1318CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y
1319# CONFIG_USB_SERIAL_KLSI is not set
1320# CONFIG_USB_SERIAL_KOBIL_SCT is not set
1321# CONFIG_USB_SERIAL_MCT_U232 is not set
1322# CONFIG_USB_SERIAL_PL2303 is not set
1323# CONFIG_USB_SERIAL_HP4X is not set
1324# CONFIG_USB_SERIAL_SAFE is not set
1325# CONFIG_USB_SERIAL_TI is not set
1326# CONFIG_USB_SERIAL_CYBERJACK is not set
1327# CONFIG_USB_SERIAL_XIRCOM is not set
1328# CONFIG_USB_SERIAL_OPTION is not set
1329# CONFIG_USB_SERIAL_OMNINET is not set
1330CONFIG_USB_EZUSB=y
1331
1332#
1333# USB Miscellaneous drivers
1334#
1335# CONFIG_USB_EMI62 is not set
1336# CONFIG_USB_EMI26 is not set
1337# CONFIG_USB_AUERSWALD is not set
1338# CONFIG_USB_RIO500 is not set
1339# CONFIG_USB_LEGOTOWER is not set
1340# CONFIG_USB_LCD is not set
1341# CONFIG_USB_LED is not set
1342# CONFIG_USB_CYTHERM is not set
1343# CONFIG_USB_PHIDGETKIT is not set
1344# CONFIG_USB_PHIDGETSERVO is not set
1345# CONFIG_USB_IDMOUSE is not set
1346# CONFIG_USB_LD is not set
1347# CONFIG_USB_TEST is not set
1348
1349#
1350# USB DSL modem support
1351#
1352
1353#
1354# USB Gadget Support
1355#
1356# CONFIG_USB_GADGET is not set
1357
1358#
1359# MMC/SD Card support
1360#
1361# CONFIG_MMC is not set
1362
1363#
1364# InfiniBand support
1365#
1366# CONFIG_INFINIBAND is not set
1367
1368#
1369# SN Devices
1370#
1371
1372#
1373# File systems
1374#
1375CONFIG_EXT2_FS=y
1376CONFIG_EXT2_FS_XATTR=y
1377# CONFIG_EXT2_FS_POSIX_ACL is not set
1378# CONFIG_EXT2_FS_SECURITY is not set
1379# CONFIG_EXT2_FS_XIP is not set
1380CONFIG_EXT3_FS=y
1381CONFIG_EXT3_FS_XATTR=y
1382# CONFIG_EXT3_FS_POSIX_ACL is not set
1383# CONFIG_EXT3_FS_SECURITY is not set
1384CONFIG_JBD=y
1385# CONFIG_JBD_DEBUG is not set
1386CONFIG_FS_MBCACHE=y
1387# CONFIG_REISERFS_FS is not set
1388# CONFIG_JFS_FS is not set
1389CONFIG_FS_POSIX_ACL=y
1390
1391#
1392# XFS support
1393#
1394# CONFIG_XFS_FS is not set
1395# CONFIG_MINIX_FS is not set
1396# CONFIG_ROMFS_FS is not set
1397CONFIG_INOTIFY=y
1398# CONFIG_QUOTA is not set
1399CONFIG_DNOTIFY=y
1400# CONFIG_AUTOFS_FS is not set
1401# CONFIG_AUTOFS4_FS is not set
1402
1403#
1404# CD-ROM/DVD Filesystems
1405#
1406CONFIG_ISO9660_FS=y
1407# CONFIG_JOLIET is not set
1408# CONFIG_ZISOFS is not set
1409CONFIG_UDF_FS=m
1410CONFIG_UDF_NLS=y
1411
1412#
1413# DOS/FAT/NT Filesystems
1414#
1415CONFIG_FAT_FS=m
1416CONFIG_MSDOS_FS=m
1417CONFIG_VFAT_FS=m
1418CONFIG_FAT_DEFAULT_CODEPAGE=437
1419CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
1420# CONFIG_NTFS_FS is not set
1421
1422#
1423# Pseudo filesystems
1424#
1425CONFIG_PROC_FS=y
1426CONFIG_PROC_KCORE=y
1427CONFIG_SYSFS=y
1428CONFIG_DEVPTS_FS_XATTR=y
1429CONFIG_DEVPTS_FS_SECURITY=y
1430CONFIG_TMPFS=y
1431CONFIG_TMPFS_XATTR=y
1432CONFIG_TMPFS_SECURITY=y
1433# CONFIG_HUGETLB_PAGE is not set
1434CONFIG_RAMFS=y
1435
1436#
1437# Miscellaneous filesystems
1438#
1439# CONFIG_ADFS_FS is not set
1440# CONFIG_AFFS_FS is not set
1441CONFIG_HFS_FS=m
1442CONFIG_HFSPLUS_FS=m
1443# CONFIG_BEFS_FS is not set
1444# CONFIG_BFS_FS is not set
1445# CONFIG_EFS_FS is not set
1446CONFIG_CRAMFS=m
1447# CONFIG_VXFS_FS is not set
1448# CONFIG_HPFS_FS is not set
1449# CONFIG_QNX4FS_FS is not set
1450# CONFIG_SYSV_FS is not set
1451# CONFIG_UFS_FS is not set
1452
1453#
1454# Network File Systems
1455#
1456CONFIG_NFS_FS=y
1457CONFIG_NFS_V3=y
1458CONFIG_NFS_V3_ACL=y
1459# CONFIG_NFS_V4 is not set
1460# CONFIG_NFS_DIRECTIO is not set
1461CONFIG_NFSD=y
1462CONFIG_NFSD_V2_ACL=y
1463CONFIG_NFSD_V3=y
1464CONFIG_NFSD_V3_ACL=y
1465# CONFIG_NFSD_V4 is not set
1466CONFIG_NFSD_TCP=y
1467CONFIG_LOCKD=y
1468CONFIG_LOCKD_V4=y
1469CONFIG_EXPORTFS=y
1470CONFIG_NFS_ACL_SUPPORT=y
1471CONFIG_NFS_COMMON=y
1472CONFIG_SUNRPC=y
1473# CONFIG_RPCSEC_GSS_KRB5 is not set
1474# CONFIG_RPCSEC_GSS_SPKM3 is not set
1475CONFIG_SMB_FS=m
1476# CONFIG_SMB_NLS_DEFAULT is not set
1477# CONFIG_CIFS is not set
1478# CONFIG_NCP_FS is not set
1479# CONFIG_CODA_FS is not set
1480# CONFIG_AFS_FS is not set
1481
1482#
1483# Partition Types
1484#
1485CONFIG_PARTITION_ADVANCED=y
1486# CONFIG_ACORN_PARTITION is not set
1487# CONFIG_OSF_PARTITION is not set
1488# CONFIG_AMIGA_PARTITION is not set
1489# CONFIG_ATARI_PARTITION is not set
1490CONFIG_MAC_PARTITION=y
1491CONFIG_MSDOS_PARTITION=y
1492# CONFIG_BSD_DISKLABEL is not set
1493# CONFIG_MINIX_SUBPARTITION is not set
1494# CONFIG_SOLARIS_X86_PARTITION is not set
1495# CONFIG_UNIXWARE_DISKLABEL is not set
1496# CONFIG_LDM_PARTITION is not set
1497# CONFIG_SGI_PARTITION is not set
1498# CONFIG_ULTRIX_PARTITION is not set
1499# CONFIG_SUN_PARTITION is not set
1500# CONFIG_EFI_PARTITION is not set
1501
1502#
1503# Native Language Support
1504#
1505CONFIG_NLS=y
1506CONFIG_NLS_DEFAULT="iso8859-1"
1507# CONFIG_NLS_CODEPAGE_437 is not set
1508# CONFIG_NLS_CODEPAGE_737 is not set
1509# CONFIG_NLS_CODEPAGE_775 is not set
1510# CONFIG_NLS_CODEPAGE_850 is not set
1511# CONFIG_NLS_CODEPAGE_852 is not set
1512# CONFIG_NLS_CODEPAGE_855 is not set
1513# CONFIG_NLS_CODEPAGE_857 is not set
1514# CONFIG_NLS_CODEPAGE_860 is not set
1515# CONFIG_NLS_CODEPAGE_861 is not set
1516# CONFIG_NLS_CODEPAGE_862 is not set
1517# CONFIG_NLS_CODEPAGE_863 is not set
1518# CONFIG_NLS_CODEPAGE_864 is not set
1519# CONFIG_NLS_CODEPAGE_865 is not set
1520# CONFIG_NLS_CODEPAGE_866 is not set
1521# CONFIG_NLS_CODEPAGE_869 is not set
1522# CONFIG_NLS_CODEPAGE_936 is not set
1523# CONFIG_NLS_CODEPAGE_950 is not set
1524# CONFIG_NLS_CODEPAGE_932 is not set
1525# CONFIG_NLS_CODEPAGE_949 is not set
1526# CONFIG_NLS_CODEPAGE_874 is not set
1527# CONFIG_NLS_ISO8859_8 is not set
1528CONFIG_NLS_CODEPAGE_1250=m
1529CONFIG_NLS_CODEPAGE_1251=m
1530CONFIG_NLS_ASCII=m
1531CONFIG_NLS_ISO8859_1=m
1532# CONFIG_NLS_ISO8859_2 is not set
1533# CONFIG_NLS_ISO8859_3 is not set
1534# CONFIG_NLS_ISO8859_4 is not set
1535# CONFIG_NLS_ISO8859_5 is not set
1536# CONFIG_NLS_ISO8859_6 is not set
1537# CONFIG_NLS_ISO8859_7 is not set
1538# CONFIG_NLS_ISO8859_9 is not set
1539# CONFIG_NLS_ISO8859_13 is not set
1540# CONFIG_NLS_ISO8859_14 is not set
1541CONFIG_NLS_ISO8859_15=m
1542# CONFIG_NLS_KOI8_R is not set
1543# CONFIG_NLS_KOI8_U is not set
1544CONFIG_NLS_UTF8=m
1545
1546#
1547# Library routines
1548#
1549CONFIG_CRC_CCITT=y
1550CONFIG_CRC32=y
1551# CONFIG_LIBCRC32C is not set
1552CONFIG_ZLIB_INFLATE=y
1553CONFIG_ZLIB_DEFLATE=y
1554
1555#
1556# Profiling support
1557#
1558# CONFIG_PROFILING is not set
1559
1560#
1561# Kernel hacking
1562#
1563# CONFIG_PRINTK_TIME is not set
1564CONFIG_DEBUG_KERNEL=y
1565CONFIG_MAGIC_SYSRQ=y
1566CONFIG_LOG_BUF_SHIFT=16
1567# CONFIG_SCHEDSTATS is not set
1568# CONFIG_DEBUG_SLAB is not set
1569# CONFIG_DEBUG_SPINLOCK is not set
1570# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1571# CONFIG_DEBUG_KOBJECT is not set
1572# CONFIG_DEBUG_INFO is not set
1573# CONFIG_DEBUG_FS is not set
1574# CONFIG_XMON is not set
1575# CONFIG_BDI_SWITCH is not set
1576CONFIG_BOOTX_TEXT=y
1577
1578#
1579# Security options
1580#
1581# CONFIG_KEYS is not set
1582# CONFIG_SECURITY is not set
1583
1584#
1585# Cryptographic options
1586#
1587# CONFIG_CRYPTO is not set
1588
1589#
1590# Hardware crypto devices
1591#
diff --git a/arch/ppc/configs/power3_defconfig b/arch/ppc/configs/power3_defconfig
deleted file mode 100644
index a1ef929bca59..000000000000
--- a/arch/ppc/configs/power3_defconfig
+++ /dev/null
@@ -1,1035 +0,0 @@
1#
2# Automatically generated make config: don't edit
3#
4CONFIG_MMU=y
5CONFIG_RWSEM_XCHGADD_ALGORITHM=y
6CONFIG_HAVE_DEC_LOCK=y
7CONFIG_PPC=y
8CONFIG_PPC32=y
9CONFIG_GENERIC_NVRAM=y
10
11#
12# Code maturity level options
13#
14CONFIG_EXPERIMENTAL=y
15CONFIG_CLEAN_COMPILE=y
16# CONFIG_STANDALONE is not set
17
18#
19# General setup
20#
21CONFIG_SWAP=y
22CONFIG_SYSVIPC=y
23CONFIG_POSIX_MQUEUE=y
24# CONFIG_BSD_PROCESS_ACCT is not set
25CONFIG_SYSCTL=y
26# CONFIG_AUDIT is not set
27CONFIG_LOG_BUF_SHIFT=15
28# CONFIG_HOTPLUG is not set
29CONFIG_IKCONFIG=y
30CONFIG_IKCONFIG_PROC=y
31# CONFIG_EMBEDDED is not set
32CONFIG_KALLSYMS=y
33CONFIG_FUTEX=y
34CONFIG_EPOLL=y
35CONFIG_IOSCHED_NOOP=y
36CONFIG_IOSCHED_AS=y
37CONFIG_IOSCHED_DEADLINE=y
38CONFIG_IOSCHED_CFQ=y
39# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
40
41#
42# Loadable module support
43#
44CONFIG_MODULES=y
45CONFIG_MODULE_UNLOAD=y
46CONFIG_MODULE_FORCE_UNLOAD=y
47CONFIG_OBSOLETE_MODPARM=y
48# CONFIG_MODVERSIONS is not set
49CONFIG_KMOD=y
50CONFIG_STOP_MACHINE=y
51
52#
53# Processor
54#
55# CONFIG_6xx is not set
56# CONFIG_40x is not set
57# CONFIG_44x is not set
58CONFIG_POWER3=y
59# CONFIG_POWER4 is not set
60# CONFIG_8xx is not set
61# CONFIG_CPU_FREQ is not set
62CONFIG_PPC64BRIDGE=y
63CONFIG_PPC_STD_MMU=y
64
65#
66# Platform options
67#
68CONFIG_PPC_MULTIPLATFORM=y
69# CONFIG_APUS is not set
70# CONFIG_WILLOW is not set
71# CONFIG_PCORE is not set
72# CONFIG_POWERPMC250 is not set
73# CONFIG_EV64260 is not set
74# CONFIG_SPRUCE is not set
75# CONFIG_LOPEC is not set
76# CONFIG_MCPN765 is not set
77# CONFIG_MVME5100 is not set
78# CONFIG_PPLUS is not set
79# CONFIG_PRPMC750 is not set
80# CONFIG_PRPMC800 is not set
81# CONFIG_SANDPOINT is not set
82# CONFIG_ADIR is not set
83# CONFIG_K2 is not set
84# CONFIG_PAL4 is not set
85# CONFIG_GEMINI is not set
86# CONFIG_EST8260 is not set
87# CONFIG_SBS8260 is not set
88# CONFIG_RPX6 is not set
89# CONFIG_TQM8260 is not set
90CONFIG_PPC_CHRP=y
91CONFIG_PPC_PMAC=y
92CONFIG_PPC_PREP=y
93CONFIG_PPC_OF=y
94CONFIG_PPCBUG_NVRAM=y
95CONFIG_SMP=y
96# CONFIG_IRQ_ALL_CPUS is not set
97CONFIG_NR_CPUS=32
98# CONFIG_PREEMPT is not set
99CONFIG_HIGHMEM=y
100CONFIG_KERNEL_ELF=y
101CONFIG_BINFMT_ELF=y
102CONFIG_BINFMT_MISC=y
103CONFIG_PROC_DEVICETREE=y
104CONFIG_PPC_RTAS=y
105# CONFIG_PREP_RESIDUAL is not set
106# CONFIG_CMDLINE_BOOL is not set
107
108#
109# Bus options
110#
111CONFIG_ISA=y
112CONFIG_GENERIC_ISA_DMA=y
113CONFIG_PCI=y
114CONFIG_PCI_DOMAINS=y
115CONFIG_PCI_LEGACY_PROC=y
116CONFIG_PCI_NAMES=y
117
118#
119# Advanced setup
120#
121CONFIG_ADVANCED_OPTIONS=y
122# CONFIG_HIGHMEM_START_BOOL is not set
123CONFIG_HIGHMEM_START=0xfe000000
124# CONFIG_LOWMEM_SIZE_BOOL is not set
125CONFIG_LOWMEM_SIZE=0x30000000
126# CONFIG_KERNEL_START_BOOL is not set
127CONFIG_KERNEL_START=0xc0000000
128CONFIG_TASK_SIZE_BOOL=y
129CONFIG_TASK_SIZE=0xc0000000
130CONFIG_BOOT_LOAD=0x00800000
131
132#
133# Device Drivers
134#
135
136#
137# Generic Driver Options
138#
139
140#
141# Memory Technology Devices (MTD)
142#
143# CONFIG_MTD is not set
144
145#
146# Parallel port support
147#
148CONFIG_PARPORT=m
149CONFIG_PARPORT_PC=m
150CONFIG_PARPORT_PC_CML1=m
151# CONFIG_PARPORT_SERIAL is not set
152CONFIG_PARPORT_PC_FIFO=y
153# CONFIG_PARPORT_PC_SUPERIO is not set
154# CONFIG_PARPORT_OTHER is not set
155# CONFIG_PARPORT_1284 is not set
156
157#
158# Plug and Play support
159#
160# CONFIG_PNP is not set
161
162#
163# Block devices
164#
165CONFIG_BLK_DEV_FD=y
166# CONFIG_BLK_DEV_XD is not set
167# CONFIG_PARIDE is not set
168# CONFIG_BLK_CPQ_DA is not set
169# CONFIG_BLK_CPQ_CISS_DA is not set
170# CONFIG_BLK_DEV_DAC960 is not set
171# CONFIG_BLK_DEV_UMEM is not set
172CONFIG_BLK_DEV_LOOP=y
173# CONFIG_BLK_DEV_CRYPTOLOOP is not set
174# CONFIG_BLK_DEV_NBD is not set
175# CONFIG_BLK_DEV_CARMEL is not set
176CONFIG_BLK_DEV_RAM=y
177CONFIG_BLK_DEV_RAM_SIZE=4096
178CONFIG_BLK_DEV_INITRD=y
179CONFIG_LBD=y
180
181#
182# ATA/ATAPI/MFM/RLL support
183#
184# CONFIG_IDE is not set
185
186#
187# SCSI device support
188#
189CONFIG_SCSI=y
190CONFIG_SCSI_PROC_FS=y
191
192#
193# SCSI support type (disk, tape, CD-ROM)
194#
195CONFIG_BLK_DEV_SD=y
196CONFIG_CHR_DEV_ST=y
197# CONFIG_CHR_DEV_OSST is not set
198CONFIG_BLK_DEV_SR=y
199CONFIG_BLK_DEV_SR_VENDOR=y
200CONFIG_CHR_DEV_SG=y
201
202#
203# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
204#
205# CONFIG_SCSI_MULTI_LUN is not set
206# CONFIG_SCSI_REPORT_LUNS is not set
207CONFIG_SCSI_CONSTANTS=y
208CONFIG_SCSI_LOGGING=y
209
210#
211# SCSI Transport Attributes
212#
213CONFIG_SCSI_SPI_ATTRS=y
214# CONFIG_SCSI_FC_ATTRS is not set
215
216#
217# SCSI low-level drivers
218#
219# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
220# CONFIG_SCSI_7000FASST is not set
221# CONFIG_SCSI_ACARD is not set
222# CONFIG_SCSI_AHA152X is not set
223# CONFIG_SCSI_AHA1542 is not set
224# CONFIG_SCSI_AACRAID is not set
225# CONFIG_SCSI_AIC7XXX is not set
226# CONFIG_SCSI_AIC7XXX_OLD is not set
227# CONFIG_SCSI_AIC79XX is not set
228# CONFIG_SCSI_ADVANSYS is not set
229# CONFIG_SCSI_IN2000 is not set
230# CONFIG_SCSI_MEGARAID is not set
231# CONFIG_SCSI_SATA is not set
232# CONFIG_SCSI_BUSLOGIC is not set
233# CONFIG_SCSI_CPQFCTS is not set
234# CONFIG_SCSI_DMX3191D is not set
235# CONFIG_SCSI_DTC3280 is not set
236# CONFIG_SCSI_EATA is not set
237# CONFIG_SCSI_EATA_PIO is not set
238# CONFIG_SCSI_FUTURE_DOMAIN is not set
239# CONFIG_SCSI_GDTH is not set
240# CONFIG_SCSI_GENERIC_NCR5380 is not set
241# CONFIG_SCSI_GENERIC_NCR5380_MMIO is not set
242# CONFIG_SCSI_IPS is not set
243# CONFIG_SCSI_INIA100 is not set
244# CONFIG_SCSI_PPA is not set
245# CONFIG_SCSI_IMM is not set
246# CONFIG_SCSI_NCR53C406A is not set
247CONFIG_SCSI_SYM53C8XX_2=y
248CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1
249CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
250CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
251# CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set
252# CONFIG_SCSI_IPR is not set
253# CONFIG_SCSI_PAS16 is not set
254# CONFIG_SCSI_PSI240I is not set
255# CONFIG_SCSI_QLOGIC_FAS is not set
256# CONFIG_SCSI_QLOGIC_ISP is not set
257# CONFIG_SCSI_QLOGIC_FC is not set
258# CONFIG_SCSI_QLOGIC_1280 is not set
259CONFIG_SCSI_QLA2XXX=y
260# CONFIG_SCSI_QLA21XX is not set
261# CONFIG_SCSI_QLA22XX is not set
262# CONFIG_SCSI_QLA2300 is not set
263# CONFIG_SCSI_QLA2322 is not set
264# CONFIG_SCSI_QLA6312 is not set
265# CONFIG_SCSI_QLA6322 is not set
266# CONFIG_SCSI_SYM53C416 is not set
267# CONFIG_SCSI_DC395x is not set
268# CONFIG_SCSI_DC390T is not set
269# CONFIG_SCSI_T128 is not set
270# CONFIG_SCSI_U14_34F is not set
271# CONFIG_SCSI_NSP32 is not set
272# CONFIG_SCSI_DEBUG is not set
273# CONFIG_SCSI_MESH is not set
274# CONFIG_SCSI_MAC53C94 is not set
275
276#
277# Old CD-ROM drivers (not SCSI, not IDE)
278#
279# CONFIG_CD_NO_IDESCSI is not set
280
281#
282# Multi-device support (RAID and LVM)
283#
284CONFIG_MD=y
285CONFIG_BLK_DEV_MD=y
286CONFIG_MD_LINEAR=y
287CONFIG_MD_RAID0=y
288CONFIG_MD_RAID1=y
289CONFIG_MD_RAID5=y
290CONFIG_MD_RAID6=y
291# CONFIG_MD_MULTIPATH is not set
292CONFIG_BLK_DEV_DM=y
293CONFIG_DM_CRYPT=y
294
295#
296# Fusion MPT device support
297#
298# CONFIG_FUSION is not set
299
300#
301# IEEE 1394 (FireWire) support
302#
303# CONFIG_IEEE1394 is not set
304
305#
306# I2O device support
307#
308# CONFIG_I2O is not set
309
310#
311# Macintosh device drivers
312#
313# CONFIG_ADB is not set
314# CONFIG_ADB_CUDA is not set
315# CONFIG_ADB_PMU is not set
316# CONFIG_MAC_FLOPPY is not set
317# CONFIG_MAC_SERIAL is not set
318
319#
320# Networking support
321#
322CONFIG_NET=y
323
324#
325# Networking options
326#
327CONFIG_PACKET=y
328# CONFIG_PACKET_MMAP is not set
329# CONFIG_NETLINK_DEV is not set
330CONFIG_UNIX=y
331# CONFIG_NET_KEY is not set
332CONFIG_INET=y
333CONFIG_IP_MULTICAST=y
334# CONFIG_IP_ADVANCED_ROUTER is not set
335# CONFIG_IP_PNP is not set
336# CONFIG_NET_IPIP is not set
337# CONFIG_NET_IPGRE is not set
338# CONFIG_IP_MROUTE is not set
339# CONFIG_ARPD is not set
340CONFIG_SYN_COOKIES=y
341# CONFIG_INET_AH is not set
342# CONFIG_INET_ESP is not set
343# CONFIG_INET_IPCOMP is not set
344# CONFIG_IPV6 is not set
345# CONFIG_NETFILTER is not set
346
347#
348# SCTP Configuration (EXPERIMENTAL)
349#
350# CONFIG_IP_SCTP is not set
351# CONFIG_ATM is not set
352# CONFIG_BRIDGE is not set
353# CONFIG_VLAN_8021Q is not set
354# CONFIG_DECNET is not set
355# CONFIG_LLC2 is not set
356# CONFIG_IPX is not set
357# CONFIG_ATALK is not set
358# CONFIG_X25 is not set
359# CONFIG_LAPB is not set
360# CONFIG_NET_DIVERT is not set
361# CONFIG_ECONET is not set
362# CONFIG_WAN_ROUTER is not set
363# CONFIG_NET_HW_FLOWCONTROL is not set
364
365#
366# QoS and/or fair queueing
367#
368# CONFIG_NET_SCHED is not set
369
370#
371# Network testing
372#
373# CONFIG_NET_PKTGEN is not set
374# CONFIG_NETPOLL is not set
375# CONFIG_NET_POLL_CONTROLLER is not set
376# CONFIG_HAMRADIO is not set
377# CONFIG_IRDA is not set
378# CONFIG_BT is not set
379CONFIG_NETDEVICES=y
380# CONFIG_DUMMY is not set
381# CONFIG_BONDING is not set
382# CONFIG_EQUALIZER is not set
383# CONFIG_TUN is not set
384
385#
386# ARCnet devices
387#
388# CONFIG_ARCNET is not set
389
390#
391# Ethernet (10 or 100Mbit)
392#
393CONFIG_NET_ETHERNET=y
394CONFIG_MII=y
395# CONFIG_MACE is not set
396# CONFIG_BMAC is not set
397# CONFIG_OAKNET is not set
398# CONFIG_HAPPYMEAL is not set
399# CONFIG_SUNGEM is not set
400# CONFIG_NET_VENDOR_3COM is not set
401# CONFIG_LANCE is not set
402# CONFIG_NET_VENDOR_SMC is not set
403# CONFIG_NET_VENDOR_RACAL is not set
404
405#
406# Tulip family network device support
407#
408# CONFIG_NET_TULIP is not set
409# CONFIG_AT1700 is not set
410# CONFIG_DEPCA is not set
411# CONFIG_HP100 is not set
412# CONFIG_NET_ISA is not set
413CONFIG_NET_PCI=y
414CONFIG_PCNET32=y
415# CONFIG_AMD8111_ETH is not set
416# CONFIG_ADAPTEC_STARFIRE is not set
417# CONFIG_AC3200 is not set
418# CONFIG_APRICOT is not set
419# CONFIG_B44 is not set
420# CONFIG_FORCEDETH is not set
421# CONFIG_CS89x0 is not set
422# CONFIG_DGRS is not set
423# CONFIG_EEPRO100 is not set
424CONFIG_E100=y
425# CONFIG_E100_NAPI is not set
426# CONFIG_FEALNX is not set
427# CONFIG_NATSEMI is not set
428# CONFIG_NE2K_PCI is not set
429# CONFIG_8139CP is not set
430# CONFIG_8139TOO is not set
431# CONFIG_SIS900 is not set
432# CONFIG_EPIC100 is not set
433# CONFIG_SUNDANCE is not set
434# CONFIG_TLAN is not set
435# CONFIG_VIA_RHINE is not set
436# CONFIG_NET_POCKET is not set
437
438#
439# Ethernet (1000 Mbit)
440#
441# CONFIG_ACENIC is not set
442# CONFIG_DL2K is not set
443CONFIG_E1000=y
444# CONFIG_E1000_NAPI is not set
445# CONFIG_E1000_DISABLE_PACKET_SPLIT is not set
446# CONFIG_NS83820 is not set
447# CONFIG_HAMACHI is not set
448# CONFIG_YELLOWFIN is not set
449# CONFIG_R8169 is not set
450# CONFIG_SK98LIN is not set
451# CONFIG_TIGON3 is not set
452
453#
454# Ethernet (10000 Mbit)
455#
456# CONFIG_IXGB is not set
457# CONFIG_S2IO is not set
458
459#
460# Token Ring devices
461#
462# CONFIG_TR is not set
463
464#
465# Wireless LAN (non-hamradio)
466#
467# CONFIG_NET_RADIO is not set
468
469#
470# Wan interfaces
471#
472# CONFIG_WAN is not set
473# CONFIG_FDDI is not set
474# CONFIG_HIPPI is not set
475# CONFIG_PLIP is not set
476# CONFIG_PPP is not set
477# CONFIG_SLIP is not set
478# CONFIG_NET_FC is not set
479# CONFIG_RCPCI is not set
480# CONFIG_SHAPER is not set
481# CONFIG_NETCONSOLE is not set
482
483#
484# ISDN subsystem
485#
486# CONFIG_ISDN is not set
487
488#
489# Telephony Support
490#
491# CONFIG_PHONE is not set
492
493#
494# Input device support
495#
496CONFIG_INPUT=y
497
498#
499# Userland interfaces
500#
501CONFIG_INPUT_MOUSEDEV=y
502CONFIG_INPUT_MOUSEDEV_PSAUX=y
503CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
504CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
505# CONFIG_INPUT_JOYDEV is not set
506# CONFIG_INPUT_TSDEV is not set
507CONFIG_INPUT_EVDEV=y
508# CONFIG_INPUT_EVBUG is not set
509
510#
511# Input I/O drivers
512#
513CONFIG_GAMEPORT=m
514CONFIG_SOUND_GAMEPORT=m
515# CONFIG_GAMEPORT_NS558 is not set
516# CONFIG_GAMEPORT_L4 is not set
517# CONFIG_GAMEPORT_EMU10K1 is not set
518# CONFIG_GAMEPORT_VORTEX is not set
519# CONFIG_GAMEPORT_FM801 is not set
520# CONFIG_GAMEPORT_CS461x is not set
521CONFIG_SERIO=y
522CONFIG_SERIO_I8042=y
523CONFIG_SERIO_SERPORT=y
524# CONFIG_SERIO_CT82C710 is not set
525# CONFIG_SERIO_PARKBD is not set
526# CONFIG_SERIO_PCIPS2 is not set
527
528#
529# Input Device Drivers
530#
531CONFIG_INPUT_KEYBOARD=y
532CONFIG_KEYBOARD_ATKBD=y
533# CONFIG_KEYBOARD_SUNKBD is not set
534# CONFIG_KEYBOARD_LKKBD is not set
535# CONFIG_KEYBOARD_XTKBD is not set
536# CONFIG_KEYBOARD_NEWTON is not set
537CONFIG_INPUT_MOUSE=y
538CONFIG_MOUSE_PS2=y
539# CONFIG_MOUSE_SERIAL is not set
540# CONFIG_MOUSE_INPORT is not set
541# CONFIG_MOUSE_LOGIBM is not set
542# CONFIG_MOUSE_PC110PAD is not set
543# CONFIG_MOUSE_VSXXXAA is not set
544# CONFIG_INPUT_JOYSTICK is not set
545# CONFIG_INPUT_TOUCHSCREEN is not set
546CONFIG_INPUT_MISC=y
547CONFIG_INPUT_UINPUT=y
548
549#
550# Character devices
551#
552CONFIG_VT=y
553CONFIG_VT_CONSOLE=y
554CONFIG_HW_CONSOLE=y
555# CONFIG_SERIAL_NONSTANDARD is not set
556
557#
558# Serial drivers
559#
560CONFIG_SERIAL_8250=y
561CONFIG_SERIAL_8250_CONSOLE=y
562CONFIG_SERIAL_8250_NR_UARTS=4
563# CONFIG_SERIAL_8250_EXTENDED is not set
564
565#
566# Non-8250 serial port support
567#
568CONFIG_SERIAL_CORE=y
569CONFIG_SERIAL_CORE_CONSOLE=y
570# CONFIG_SERIAL_PMACZILOG is not set
571CONFIG_UNIX98_PTYS=y
572CONFIG_LEGACY_PTYS=y
573CONFIG_LEGACY_PTY_COUNT=256
574CONFIG_PRINTER=m
575# CONFIG_LP_CONSOLE is not set
576# CONFIG_PPDEV is not set
577# CONFIG_TIPAR is not set
578# CONFIG_QIC02_TAPE is not set
579
580#
581# IPMI
582#
583# CONFIG_IPMI_HANDLER is not set
584
585#
586# Watchdog Cards
587#
588# CONFIG_WATCHDOG is not set
589CONFIG_NVRAM=y
590CONFIG_GEN_RTC=y
591# CONFIG_GEN_RTC_X is not set
592# CONFIG_DTLK is not set
593# CONFIG_R3964 is not set
594# CONFIG_APPLICOM is not set
595
596#
597# Ftape, the floppy tape device driver
598#
599# CONFIG_AGP is not set
600# CONFIG_DRM is not set
601# CONFIG_RAW_DRIVER is not set
602
603#
604# I2C support
605#
606CONFIG_I2C=y
607CONFIG_I2C_CHARDEV=y
608
609#
610# I2C Algorithms
611#
612CONFIG_I2C_ALGOBIT=y
613CONFIG_I2C_ALGOPCF=y
614
615#
616# I2C Hardware Bus support
617#
618# CONFIG_I2C_ALI1535 is not set
619# CONFIG_I2C_ALI1563 is not set
620# CONFIG_I2C_ALI15X3 is not set
621# CONFIG_I2C_AMD756 is not set
622# CONFIG_I2C_AMD8111 is not set
623# CONFIG_I2C_HYDRA is not set
624# CONFIG_I2C_I801 is not set
625# CONFIG_I2C_I810 is not set
626# CONFIG_I2C_ISA is not set
627# CONFIG_I2C_KEYWEST is not set
628# CONFIG_I2C_NFORCE2 is not set
629# CONFIG_I2C_PARPORT is not set
630# CONFIG_I2C_PARPORT_LIGHT is not set
631# CONFIG_I2C_PIIX4 is not set
632# CONFIG_I2C_PROSAVAGE is not set
633# CONFIG_I2C_SAVAGE4 is not set
634# CONFIG_SCx200_ACB is not set
635# CONFIG_I2C_SIS5595 is not set
636# CONFIG_I2C_SIS630 is not set
637# CONFIG_I2C_SIS96X is not set
638# CONFIG_I2C_VIA is not set
639# CONFIG_I2C_VIAPRO is not set
640# CONFIG_I2C_VOODOO3 is not set
641
642#
643# Hardware Sensors Chip support
644#
645# CONFIG_I2C_SENSOR is not set
646# CONFIG_SENSORS_ADM1021 is not set
647# CONFIG_SENSORS_ASB100 is not set
648# CONFIG_SENSORS_DS1621 is not set
649# CONFIG_SENSORS_FSCHER is not set
650# CONFIG_SENSORS_GL518SM is not set
651# CONFIG_SENSORS_IT87 is not set
652# CONFIG_SENSORS_LM75 is not set
653# CONFIG_SENSORS_LM78 is not set
654# CONFIG_SENSORS_LM80 is not set
655# CONFIG_SENSORS_LM83 is not set
656# CONFIG_SENSORS_LM85 is not set
657# CONFIG_SENSORS_LM90 is not set
658# CONFIG_SENSORS_VIA686A is not set
659# CONFIG_SENSORS_W83781D is not set
660# CONFIG_SENSORS_W83L785TS is not set
661# CONFIG_SENSORS_W83627HF is not set
662
663#
664# Other I2C Chip support
665#
666# CONFIG_SENSORS_EEPROM is not set
667# CONFIG_SENSORS_PCF8574 is not set
668# CONFIG_SENSORS_PCF8591 is not set
669# CONFIG_I2C_DEBUG_CORE is not set
670# CONFIG_I2C_DEBUG_ALGO is not set
671# CONFIG_I2C_DEBUG_BUS is not set
672# CONFIG_I2C_DEBUG_CHIP is not set
673
674#
675# Misc devices
676#
677
678#
679# Multimedia devices
680#
681# CONFIG_VIDEO_DEV is not set
682
683#
684# Digital Video Broadcasting Devices
685#
686# CONFIG_DVB is not set
687
688#
689# Graphics support
690#
691CONFIG_FB=y
692# CONFIG_FB_PM2 is not set
693# CONFIG_FB_CYBER2000 is not set
694CONFIG_FB_OF=y
695# CONFIG_FB_CONTROL is not set
696# CONFIG_FB_PLATINUM is not set
697# CONFIG_FB_VALKYRIE is not set
698# CONFIG_FB_CT65550 is not set
699# CONFIG_FB_IMSTT is not set
700# CONFIG_FB_S3TRIO is not set
701# CONFIG_FB_VGA16 is not set
702# CONFIG_FB_RIVA is not set
703CONFIG_FB_MATROX=y
704CONFIG_FB_MATROX_MILLENIUM=y
705CONFIG_FB_MATROX_MYSTIQUE=y
706# CONFIG_FB_MATROX_G450 is not set
707CONFIG_FB_MATROX_G100A=y
708CONFIG_FB_MATROX_G100=y
709CONFIG_FB_MATROX_I2C=y
710# CONFIG_FB_MATROX_MAVEN is not set
711CONFIG_FB_MATROX_MULTIHEAD=y
712# CONFIG_FB_RADEON_OLD is not set
713# CONFIG_FB_RADEON is not set
714# CONFIG_FB_ATY128 is not set
715# CONFIG_FB_ATY is not set
716# CONFIG_FB_SIS is not set
717# CONFIG_FB_NEOMAGIC is not set
718# CONFIG_FB_KYRO is not set
719# CONFIG_FB_3DFX is not set
720# CONFIG_FB_VOODOO1 is not set
721# CONFIG_FB_TRIDENT is not set
722# CONFIG_FB_VIRTUAL is not set
723
724#
725# Console display driver support
726#
727# CONFIG_VGA_CONSOLE is not set
728# CONFIG_MDA_CONSOLE is not set
729CONFIG_DUMMY_CONSOLE=y
730CONFIG_FRAMEBUFFER_CONSOLE=y
731CONFIG_PCI_CONSOLE=y
732# CONFIG_FONTS is not set
733CONFIG_FONT_8x8=y
734CONFIG_FONT_8x16=y
735
736#
737# Logo configuration
738#
739CONFIG_LOGO=y
740CONFIG_LOGO_LINUX_MONO=y
741CONFIG_LOGO_LINUX_VGA16=y
742CONFIG_LOGO_LINUX_CLUT224=y
743
744#
745# Sound
746#
747CONFIG_SOUND=y
748# CONFIG_DMASOUND_PMAC is not set
749
750#
751# Advanced Linux Sound Architecture
752#
753CONFIG_SND=m
754CONFIG_SND_TIMER=m
755CONFIG_SND_PCM=m
756CONFIG_SND_HWDEP=m
757CONFIG_SND_RAWMIDI=m
758CONFIG_SND_SEQUENCER=m
759CONFIG_SND_SEQ_DUMMY=m
760CONFIG_SND_OSSEMUL=y
761CONFIG_SND_MIXER_OSS=m
762CONFIG_SND_PCM_OSS=m
763CONFIG_SND_SEQUENCER_OSS=y
764# CONFIG_SND_VERBOSE_PRINTK is not set
765# CONFIG_SND_DEBUG is not set
766
767#
768# Generic devices
769#
770CONFIG_SND_MPU401_UART=m
771CONFIG_SND_OPL3_LIB=m
772CONFIG_SND_DUMMY=m
773# CONFIG_SND_VIRMIDI is not set
774# CONFIG_SND_MTPAV is not set
775# CONFIG_SND_SERIAL_U16550 is not set
776# CONFIG_SND_MPU401 is not set
777
778#
779# ISA devices
780#
781# CONFIG_SND_AD1848 is not set
782# CONFIG_SND_CS4231 is not set
783CONFIG_SND_CS4232=m
784# CONFIG_SND_CS4236 is not set
785# CONFIG_SND_ES1688 is not set
786# CONFIG_SND_ES18XX is not set
787# CONFIG_SND_GUSCLASSIC is not set
788# CONFIG_SND_GUSEXTREME is not set
789# CONFIG_SND_GUSMAX is not set
790# CONFIG_SND_INTERWAVE is not set
791# CONFIG_SND_INTERWAVE_STB is not set
792# CONFIG_SND_OPTI92X_AD1848 is not set
793# CONFIG_SND_OPTI92X_CS4231 is not set
794# CONFIG_SND_OPTI93X is not set
795# CONFIG_SND_SB8 is not set
796# CONFIG_SND_SB16 is not set
797# CONFIG_SND_SBAWE is not set
798# CONFIG_SND_WAVEFRONT is not set
799# CONFIG_SND_CMI8330 is not set
800# CONFIG_SND_OPL3SA2 is not set
801# CONFIG_SND_SGALAXY is not set
802# CONFIG_SND_SSCAPE is not set
803
804#
805# PCI devices
806#
807CONFIG_SND_AC97_CODEC=m
808# CONFIG_SND_ALI5451 is not set
809# CONFIG_SND_ATIIXP is not set
810# CONFIG_SND_AU8810 is not set
811# CONFIG_SND_AU8820 is not set
812# CONFIG_SND_AU8830 is not set
813# CONFIG_SND_AZT3328 is not set
814# CONFIG_SND_BT87X is not set
815CONFIG_SND_CS46XX=m
816# CONFIG_SND_CS46XX_NEW_DSP is not set
817CONFIG_SND_CS4281=m
818# CONFIG_SND_EMU10K1 is not set
819# CONFIG_SND_KORG1212 is not set
820# CONFIG_SND_MIXART is not set
821# CONFIG_SND_NM256 is not set
822# CONFIG_SND_RME32 is not set
823# CONFIG_SND_RME96 is not set
824# CONFIG_SND_RME9652 is not set
825# CONFIG_SND_HDSP is not set
826# CONFIG_SND_TRIDENT is not set
827# CONFIG_SND_YMFPCI is not set
828# CONFIG_SND_ALS4000 is not set
829# CONFIG_SND_CMIPCI is not set
830# CONFIG_SND_ENS1370 is not set
831# CONFIG_SND_ENS1371 is not set
832# CONFIG_SND_ES1938 is not set
833# CONFIG_SND_ES1968 is not set
834# CONFIG_SND_MAESTRO3 is not set
835# CONFIG_SND_FM801 is not set
836# CONFIG_SND_ICE1712 is not set
837# CONFIG_SND_ICE1724 is not set
838# CONFIG_SND_INTEL8X0 is not set
839# CONFIG_SND_INTEL8X0M is not set
840# CONFIG_SND_SONICVIBES is not set
841# CONFIG_SND_VIA82XX is not set
842# CONFIG_SND_VX222 is not set
843
844#
845# ALSA PowerMac devices
846#
847# CONFIG_SND_POWERMAC is not set
848
849#
850# Open Sound System
851#
852# CONFIG_SOUND_PRIME is not set
853
854#
855# USB support
856#
857# CONFIG_USB is not set
858
859#
860# USB Gadget Support
861#
862# CONFIG_USB_GADGET is not set
863
864#
865# File systems
866#
867CONFIG_EXT2_FS=y
868# CONFIG_EXT2_FS_XATTR is not set
869# CONFIG_EXT3_FS is not set
870# CONFIG_JBD is not set
871# CONFIG_REISERFS_FS is not set
872# CONFIG_JFS_FS is not set
873# CONFIG_XFS_FS is not set
874# CONFIG_MINIX_FS is not set
875# CONFIG_ROMFS_FS is not set
876# CONFIG_QUOTA is not set
877# CONFIG_AUTOFS_FS is not set
878# CONFIG_AUTOFS4_FS is not set
879
880#
881# CD-ROM/DVD Filesystems
882#
883CONFIG_ISO9660_FS=y
884CONFIG_JOLIET=y
885# CONFIG_ZISOFS is not set
886# CONFIG_UDF_FS is not set
887
888#
889# DOS/FAT/NT Filesystems
890#
891CONFIG_FAT_FS=y
892CONFIG_MSDOS_FS=y
893CONFIG_VFAT_FS=y
894# CONFIG_NTFS_FS is not set
895
896#
897# Pseudo filesystems
898#
899CONFIG_PROC_FS=y
900CONFIG_PROC_KCORE=y
901CONFIG_SYSFS=y
902# CONFIG_DEVFS_FS is not set
903# CONFIG_DEVPTS_FS_XATTR is not set
904CONFIG_TMPFS=y
905# CONFIG_HUGETLB_PAGE is not set
906CONFIG_RAMFS=y
907
908#
909# Miscellaneous filesystems
910#
911# CONFIG_ADFS_FS is not set
912# CONFIG_AFFS_FS is not set
913# CONFIG_HFS_FS is not set
914# CONFIG_HFSPLUS_FS is not set
915# CONFIG_BEFS_FS is not set
916# CONFIG_BFS_FS is not set
917# CONFIG_EFS_FS is not set
918# CONFIG_CRAMFS is not set
919# CONFIG_VXFS_FS is not set
920# CONFIG_HPFS_FS is not set
921# CONFIG_QNX4FS_FS is not set
922# CONFIG_SYSV_FS is not set
923# CONFIG_UFS_FS is not set
924
925#
926# Network File Systems
927#
928CONFIG_NFS_FS=y
929# CONFIG_NFS_V3 is not set
930# CONFIG_NFS_V4 is not set
931# CONFIG_NFS_DIRECTIO is not set
932CONFIG_NFSD=y
933# CONFIG_NFSD_V3 is not set
934# CONFIG_NFSD_TCP is not set
935CONFIG_LOCKD=y
936CONFIG_EXPORTFS=y
937CONFIG_SUNRPC=y
938# CONFIG_RPCSEC_GSS_KRB5 is not set
939# CONFIG_SMB_FS is not set
940# CONFIG_CIFS is not set
941# CONFIG_NCP_FS is not set
942# CONFIG_CODA_FS is not set
943# CONFIG_AFS_FS is not set
944
945#
946# Partition Types
947#
948# CONFIG_PARTITION_ADVANCED is not set
949CONFIG_MSDOS_PARTITION=y
950
951#
952# Native Language Support
953#
954CONFIG_NLS=y
955CONFIG_NLS_DEFAULT="iso8859-1"
956CONFIG_NLS_CODEPAGE_437=y
957# CONFIG_NLS_CODEPAGE_737 is not set
958# CONFIG_NLS_CODEPAGE_775 is not set
959# CONFIG_NLS_CODEPAGE_850 is not set
960# CONFIG_NLS_CODEPAGE_852 is not set
961# CONFIG_NLS_CODEPAGE_855 is not set
962# CONFIG_NLS_CODEPAGE_857 is not set
963# CONFIG_NLS_CODEPAGE_860 is not set
964# CONFIG_NLS_CODEPAGE_861 is not set
965# CONFIG_NLS_CODEPAGE_862 is not set
966# CONFIG_NLS_CODEPAGE_863 is not set
967# CONFIG_NLS_CODEPAGE_864 is not set
968# CONFIG_NLS_CODEPAGE_865 is not set
969# CONFIG_NLS_CODEPAGE_866 is not set
970# CONFIG_NLS_CODEPAGE_869 is not set
971# CONFIG_NLS_CODEPAGE_936 is not set
972# CONFIG_NLS_CODEPAGE_950 is not set
973# CONFIG_NLS_CODEPAGE_932 is not set
974# CONFIG_NLS_CODEPAGE_949 is not set
975# CONFIG_NLS_CODEPAGE_874 is not set
976# CONFIG_NLS_ISO8859_8 is not set
977# CONFIG_NLS_CODEPAGE_1250 is not set
978# CONFIG_NLS_CODEPAGE_1251 is not set
979CONFIG_NLS_ISO8859_1=y
980# CONFIG_NLS_ISO8859_2 is not set
981# CONFIG_NLS_ISO8859_3 is not set
982# CONFIG_NLS_ISO8859_4 is not set
983# CONFIG_NLS_ISO8859_5 is not set
984# CONFIG_NLS_ISO8859_6 is not set
985# CONFIG_NLS_ISO8859_7 is not set
986# CONFIG_NLS_ISO8859_9 is not set
987# CONFIG_NLS_ISO8859_13 is not set
988# CONFIG_NLS_ISO8859_14 is not set
989# CONFIG_NLS_ISO8859_15 is not set
990# CONFIG_NLS_KOI8_R is not set
991# CONFIG_NLS_KOI8_U is not set
992# CONFIG_NLS_UTF8 is not set
993
994#
995# Library routines
996#
997CONFIG_CRC32=y
998# CONFIG_LIBCRC32C is not set
999CONFIG_ZLIB_INFLATE=m
1000CONFIG_ZLIB_DEFLATE=m
1001
1002#
1003# Kernel hacking
1004#
1005# CONFIG_DEBUG_KERNEL is not set
1006CONFIG_BOOTX_TEXT=y
1007
1008#
1009# Security options
1010#
1011# CONFIG_SECURITY is not set
1012
1013#
1014# Cryptographic options
1015#
1016CONFIG_CRYPTO=y
1017CONFIG_CRYPTO_HMAC=y
1018CONFIG_CRYPTO_NULL=y
1019CONFIG_CRYPTO_MD4=m
1020CONFIG_CRYPTO_MD5=m
1021CONFIG_CRYPTO_SHA1=m
1022CONFIG_CRYPTO_SHA256=m
1023CONFIG_CRYPTO_SHA512=m
1024CONFIG_CRYPTO_DES=m
1025CONFIG_CRYPTO_BLOWFISH=m
1026CONFIG_CRYPTO_TWOFISH=m
1027# CONFIG_CRYPTO_SERPENT is not set
1028CONFIG_CRYPTO_AES=m
1029CONFIG_CRYPTO_CAST5=m
1030CONFIG_CRYPTO_CAST6=m
1031CONFIG_CRYPTO_ARC4=m
1032CONFIG_CRYPTO_DEFLATE=m
1033CONFIG_CRYPTO_MICHAEL_MIC=m
1034# CONFIG_CRYPTO_CRC32C is not set
1035# CONFIG_CRYPTO_TEST is not set
diff --git a/arch/ppc/configs/common_defconfig b/arch/ppc/configs/prep_defconfig
index 4d33bee23a89..4d33bee23a89 100644
--- a/arch/ppc/configs/common_defconfig
+++ b/arch/ppc/configs/prep_defconfig
diff --git a/arch/ppc/kernel/entry.S b/arch/ppc/kernel/entry.S
index fa8d49789ef1..5891ecbdc703 100644
--- a/arch/ppc/kernel/entry.S
+++ b/arch/ppc/kernel/entry.S
@@ -930,55 +930,3 @@ END_FTR_SECTION_IFSET(CPU_FTR_601)
930 b 4b 930 b 4b
931 931
932 .comm ee_restarts,4 932 .comm ee_restarts,4
933
934/*
935 * PROM code for specific machines follows. Put it
936 * here so it's easy to add arch-specific sections later.
937 * -- Cort
938 */
939#ifdef CONFIG_PPC_OF
940/*
941 * On CHRP, the Run-Time Abstraction Services (RTAS) have to be
942 * called with the MMU off.
943 */
944_GLOBAL(enter_rtas)
945 stwu r1,-INT_FRAME_SIZE(r1)
946 mflr r0
947 stw r0,INT_FRAME_SIZE+4(r1)
948 lis r4,rtas_data@ha
949 lwz r4,rtas_data@l(r4)
950 lis r6,1f@ha /* physical return address for rtas */
951 addi r6,r6,1f@l
952 tophys(r6,r6)
953 tophys(r7,r1)
954 lis r8,rtas_entry@ha
955 lwz r8,rtas_entry@l(r8)
956 mfmsr r9
957 stw r9,8(r1)
958 LOAD_MSR_KERNEL(r0,MSR_KERNEL)
959 SYNC /* disable interrupts so SRR0/1 */
960 MTMSRD(r0) /* don't get trashed */
961 li r9,MSR_KERNEL & ~(MSR_IR|MSR_DR)
962 mtlr r6
963 CLR_TOP32(r7)
964 mtspr SPRN_SPRG2,r7
965 mtspr SPRN_SRR0,r8
966 mtspr SPRN_SRR1,r9
967 RFI
9681: tophys(r9,r1)
969 lwz r8,INT_FRAME_SIZE+4(r9) /* get return address */
970 lwz r9,8(r9) /* original msr value */
971 FIX_SRR1(r9,r0)
972 addi r1,r1,INT_FRAME_SIZE
973 li r0,0
974 mtspr SPRN_SPRG2,r0
975 mtspr SPRN_SRR0,r8
976 mtspr SPRN_SRR1,r9
977 RFI /* return to caller */
978
979 .globl machine_check_in_rtas
980machine_check_in_rtas:
981 twi 31,0,0
982 /* XXX load up BATs and panic */
983
984#endif /* CONFIG_PPC_OF */
diff --git a/arch/ppc/kernel/head.S b/arch/ppc/kernel/head.S
index 53ea845fb911..01303efeddad 100644
--- a/arch/ppc/kernel/head.S
+++ b/arch/ppc/kernel/head.S
@@ -37,19 +37,6 @@
37#include <asm/amigappc.h> 37#include <asm/amigappc.h>
38#endif 38#endif
39 39
40#ifdef CONFIG_PPC64BRIDGE
41#define LOAD_BAT(n, reg, RA, RB) \
42 ld RA,(n*32)+0(reg); \
43 ld RB,(n*32)+8(reg); \
44 mtspr SPRN_IBAT##n##U,RA; \
45 mtspr SPRN_IBAT##n##L,RB; \
46 ld RA,(n*32)+16(reg); \
47 ld RB,(n*32)+24(reg); \
48 mtspr SPRN_DBAT##n##U,RA; \
49 mtspr SPRN_DBAT##n##L,RB; \
50
51#else /* CONFIG_PPC64BRIDGE */
52
53/* 601 only have IBAT; cr0.eq is set on 601 when using this macro */ 40/* 601 only have IBAT; cr0.eq is set on 601 when using this macro */
54#define LOAD_BAT(n, reg, RA, RB) \ 41#define LOAD_BAT(n, reg, RA, RB) \
55 /* see the comment for clear_bats() -- Cort */ \ 42 /* see the comment for clear_bats() -- Cort */ \
@@ -66,7 +53,6 @@
66 mtspr SPRN_DBAT##n##U,RA; \ 53 mtspr SPRN_DBAT##n##U,RA; \
67 mtspr SPRN_DBAT##n##L,RB; \ 54 mtspr SPRN_DBAT##n##L,RB; \
681: 551:
69#endif /* CONFIG_PPC64BRIDGE */
70 56
71 .text 57 .text
72 .stabs "arch/ppc/kernel/",N_SO,0,0,0f 58 .stabs "arch/ppc/kernel/",N_SO,0,0,0f
@@ -129,11 +115,6 @@ _start:
129 115
130 .globl __start 116 .globl __start
131__start: 117__start:
132/*
133 * We have to do any OF calls before we map ourselves to KERNELBASE,
134 * because OF may have I/O devices mapped into that area
135 * (particularly on CHRP).
136 */
137 mr r31,r3 /* save parameters */ 118 mr r31,r3 /* save parameters */
138 mr r30,r4 119 mr r30,r4
139 mr r29,r5 120 mr r29,r5
@@ -148,14 +129,6 @@ __start:
148 */ 129 */
149 bl early_init 130 bl early_init
150 131
151/*
152 * On POWER4, we first need to tweak some CPU configuration registers
153 * like real mode cache inhibit or exception base
154 */
155#ifdef CONFIG_POWER4
156 bl __970_cpu_preinit
157#endif /* CONFIG_POWER4 */
158
159#ifdef CONFIG_APUS 132#ifdef CONFIG_APUS
160/* On APUS the __va/__pa constants need to be set to the correct 133/* On APUS the __va/__pa constants need to be set to the correct
161 * values before continuing. 134 * values before continuing.
@@ -169,7 +142,6 @@ __start:
169 */ 142 */
170 bl mmu_off 143 bl mmu_off
171__after_mmu_off: 144__after_mmu_off:
172#ifndef CONFIG_POWER4
173 bl clear_bats 145 bl clear_bats
174 bl flush_tlbs 146 bl flush_tlbs
175 147
@@ -177,10 +149,6 @@ __after_mmu_off:
177#if !defined(CONFIG_APUS) && defined(CONFIG_BOOTX_TEXT) 149#if !defined(CONFIG_APUS) && defined(CONFIG_BOOTX_TEXT)
178 bl setup_disp_bat 150 bl setup_disp_bat
179#endif 151#endif
180#else /* CONFIG_POWER4 */
181 bl reloc_offset
182 bl initial_mm_power4
183#endif /* CONFIG_POWER4 */
184 152
185/* 153/*
186 * Call setup_cpu for CPU 0 and initialize 6xx Idle 154 * Call setup_cpu for CPU 0 and initialize 6xx Idle
@@ -192,18 +160,11 @@ __after_mmu_off:
192 bl reloc_offset 160 bl reloc_offset
193 bl init_idle_6xx 161 bl init_idle_6xx
194#endif /* CONFIG_6xx */ 162#endif /* CONFIG_6xx */
195#ifdef CONFIG_POWER4
196 bl reloc_offset
197 bl init_idle_power4
198#endif /* CONFIG_POWER4 */
199 163
200 164
201#ifndef CONFIG_APUS 165#ifndef CONFIG_APUS
202/* 166/*
203 * We need to run with _start at physical address 0. 167 * We need to run with _start at physical address 0.
204 * On CHRP, we are loaded at 0x10000 since OF on CHRP uses
205 * the exception vectors at 0 (and therefore this copy
206 * overwrites OF's exception vectors with our own).
207 * If the MMU is already turned on, we copy stuff to KERNELBASE, 168 * If the MMU is already turned on, we copy stuff to KERNELBASE,
208 * otherwise we copy it to 0. 169 * otherwise we copy it to 0.
209 */ 170 */
@@ -358,51 +319,19 @@ i##n: \
358#endif 319#endif
359 320
360/* Machine check */ 321/* Machine check */
361/*
362 * On CHRP, this is complicated by the fact that we could get a
363 * machine check inside RTAS, and we have no guarantee that certain
364 * critical registers will have the values we expect. The set of
365 * registers that might have bad values includes all the GPRs
366 * and all the BATs. We indicate that we are in RTAS by putting
367 * a non-zero value, the address of the exception frame to use,
368 * in SPRG2. The machine check handler checks SPRG2 and uses its
369 * value if it is non-zero. If we ever needed to free up SPRG2,
370 * we could use a field in the thread_info or thread_struct instead.
371 * (Other exception handlers assume that r1 is a valid kernel stack
372 * pointer when we take an exception from supervisor mode.)
373 * -- paulus.
374 */
375 . = 0x200 322 . = 0x200
376 mtspr SPRN_SPRG0,r10 323 mtspr SPRN_SPRG0,r10
377 mtspr SPRN_SPRG1,r11 324 mtspr SPRN_SPRG1,r11
378 mfcr r10 325 mfcr r10
379#ifdef CONFIG_PPC_CHRP
380 mfspr r11,SPRN_SPRG2
381 cmpwi 0,r11,0
382 bne 7f
383#endif /* CONFIG_PPC_CHRP */
384 EXCEPTION_PROLOG_1 326 EXCEPTION_PROLOG_1
3857: EXCEPTION_PROLOG_2 3277: EXCEPTION_PROLOG_2
386 addi r3,r1,STACK_FRAME_OVERHEAD 328 addi r3,r1,STACK_FRAME_OVERHEAD
387#ifdef CONFIG_PPC_CHRP
388 mfspr r4,SPRN_SPRG2
389 cmpwi cr1,r4,0
390 bne cr1,1f
391#endif
392 EXC_XFER_STD(0x200, machine_check_exception) 329 EXC_XFER_STD(0x200, machine_check_exception)
393#ifdef CONFIG_PPC_CHRP
3941: b machine_check_in_rtas
395#endif
396 330
397/* Data access exception. */ 331/* Data access exception. */
398 . = 0x300 332 . = 0x300
399#ifdef CONFIG_PPC64BRIDGE
400 b DataAccess
401DataAccessCont:
402#else
403DataAccess: 333DataAccess:
404 EXCEPTION_PROLOG 334 EXCEPTION_PROLOG
405#endif /* CONFIG_PPC64BRIDGE */
406 mfspr r10,SPRN_DSISR 335 mfspr r10,SPRN_DSISR
407 andis. r0,r10,0xa470 /* weird error? */ 336 andis. r0,r10,0xa470 /* weird error? */
408 bne 1f /* if not, try to put a PTE */ 337 bne 1f /* if not, try to put a PTE */
@@ -414,21 +343,10 @@ DataAccess:
414 mfspr r4,SPRN_DAR 343 mfspr r4,SPRN_DAR
415 EXC_XFER_EE_LITE(0x300, handle_page_fault) 344 EXC_XFER_EE_LITE(0x300, handle_page_fault)
416 345
417#ifdef CONFIG_PPC64BRIDGE
418/* SLB fault on data access. */
419 . = 0x380
420 b DataSegment
421#endif /* CONFIG_PPC64BRIDGE */
422
423/* Instruction access exception. */ 346/* Instruction access exception. */
424 . = 0x400 347 . = 0x400
425#ifdef CONFIG_PPC64BRIDGE
426 b InstructionAccess
427InstructionAccessCont:
428#else
429InstructionAccess: 348InstructionAccess:
430 EXCEPTION_PROLOG 349 EXCEPTION_PROLOG
431#endif /* CONFIG_PPC64BRIDGE */
432 andis. r0,r9,0x4000 /* no pte found? */ 350 andis. r0,r9,0x4000 /* no pte found? */
433 beq 1f /* if so, try to put a PTE */ 351 beq 1f /* if so, try to put a PTE */
434 li r3,0 /* into the hash table */ 352 li r3,0 /* into the hash table */
@@ -438,12 +356,6 @@ InstructionAccess:
438 mr r5,r9 356 mr r5,r9
439 EXC_XFER_EE_LITE(0x400, handle_page_fault) 357 EXC_XFER_EE_LITE(0x400, handle_page_fault)
440 358
441#ifdef CONFIG_PPC64BRIDGE
442/* SLB fault on instruction access. */
443 . = 0x480
444 b InstructionSegment
445#endif /* CONFIG_PPC64BRIDGE */
446
447/* External interrupt */ 359/* External interrupt */
448 EXCEPTION(0x500, HardwareInterrupt, do_IRQ, EXC_XFER_LITE) 360 EXCEPTION(0x500, HardwareInterrupt, do_IRQ, EXC_XFER_LITE)
449 361
@@ -708,15 +620,9 @@ DataStoreTLBMiss:
708 EXCEPTION(0x1300, Trap_13, instruction_breakpoint_exception, EXC_XFER_EE) 620 EXCEPTION(0x1300, Trap_13, instruction_breakpoint_exception, EXC_XFER_EE)
709 EXCEPTION(0x1400, SMI, SMIException, EXC_XFER_EE) 621 EXCEPTION(0x1400, SMI, SMIException, EXC_XFER_EE)
710 EXCEPTION(0x1500, Trap_15, unknown_exception, EXC_XFER_EE) 622 EXCEPTION(0x1500, Trap_15, unknown_exception, EXC_XFER_EE)
711#ifdef CONFIG_POWER4
712 EXCEPTION(0x1600, Trap_16, unknown_exception, EXC_XFER_EE)
713 EXCEPTION(0x1700, Trap_17, altivec_assist_exception, EXC_XFER_EE)
714 EXCEPTION(0x1800, Trap_18, TAUException, EXC_XFER_STD)
715#else /* !CONFIG_POWER4 */
716 EXCEPTION(0x1600, Trap_16, altivec_assist_exception, EXC_XFER_EE) 623 EXCEPTION(0x1600, Trap_16, altivec_assist_exception, EXC_XFER_EE)
717 EXCEPTION(0x1700, Trap_17, TAUException, EXC_XFER_STD) 624 EXCEPTION(0x1700, Trap_17, TAUException, EXC_XFER_STD)
718 EXCEPTION(0x1800, Trap_18, unknown_exception, EXC_XFER_EE) 625 EXCEPTION(0x1800, Trap_18, unknown_exception, EXC_XFER_EE)
719#endif /* CONFIG_POWER4 */
720 EXCEPTION(0x1900, Trap_19, unknown_exception, EXC_XFER_EE) 626 EXCEPTION(0x1900, Trap_19, unknown_exception, EXC_XFER_EE)
721 EXCEPTION(0x1a00, Trap_1a, unknown_exception, EXC_XFER_EE) 627 EXCEPTION(0x1a00, Trap_1a, unknown_exception, EXC_XFER_EE)
722 EXCEPTION(0x1b00, Trap_1b, unknown_exception, EXC_XFER_EE) 628 EXCEPTION(0x1b00, Trap_1b, unknown_exception, EXC_XFER_EE)
@@ -754,28 +660,6 @@ AltiVecUnavailable:
754 addi r3,r1,STACK_FRAME_OVERHEAD 660 addi r3,r1,STACK_FRAME_OVERHEAD
755 EXC_XFER_EE_LITE(0xf20, altivec_unavailable_exception) 661 EXC_XFER_EE_LITE(0xf20, altivec_unavailable_exception)
756 662
757#ifdef CONFIG_PPC64BRIDGE
758DataAccess:
759 EXCEPTION_PROLOG
760 b DataAccessCont
761
762InstructionAccess:
763 EXCEPTION_PROLOG
764 b InstructionAccessCont
765
766DataSegment:
767 EXCEPTION_PROLOG
768 addi r3,r1,STACK_FRAME_OVERHEAD
769 mfspr r4,SPRN_DAR
770 stw r4,_DAR(r11)
771 EXC_XFER_STD(0x380, unknown_exception)
772
773InstructionSegment:
774 EXCEPTION_PROLOG
775 addi r3,r1,STACK_FRAME_OVERHEAD
776 EXC_XFER_STD(0x480, unknown_exception)
777#endif /* CONFIG_PPC64BRIDGE */
778
779#ifdef CONFIG_ALTIVEC 663#ifdef CONFIG_ALTIVEC
780/* Note that the AltiVec support is closely modeled after the FP 664/* Note that the AltiVec support is closely modeled after the FP
781 * support. Changes to one are likely to be applicable to the 665 * support. Changes to one are likely to be applicable to the
@@ -1048,13 +932,6 @@ __secondary_start_pmac_0:
1048 932
1049 .globl __secondary_start 933 .globl __secondary_start
1050__secondary_start: 934__secondary_start:
1051#ifdef CONFIG_PPC64BRIDGE
1052 mfmsr r0
1053 clrldi r0,r0,1 /* make sure it's in 32-bit mode */
1054 SYNC
1055 MTMSRD(r0)
1056 isync
1057#endif
1058 /* Copy some CPU settings from CPU 0 */ 935 /* Copy some CPU settings from CPU 0 */
1059 bl __restore_cpu_setup 936 bl __restore_cpu_setup
1060 937
@@ -1065,10 +942,6 @@ __secondary_start:
1065 lis r3,-KERNELBASE@h 942 lis r3,-KERNELBASE@h
1066 bl init_idle_6xx 943 bl init_idle_6xx
1067#endif /* CONFIG_6xx */ 944#endif /* CONFIG_6xx */
1068#ifdef CONFIG_POWER4
1069 lis r3,-KERNELBASE@h
1070 bl init_idle_power4
1071#endif /* CONFIG_POWER4 */
1072 945
1073 /* get current_thread_info and current */ 946 /* get current_thread_info and current */
1074 lis r1,secondary_ti@ha 947 lis r1,secondary_ti@ha
@@ -1109,12 +982,12 @@ __secondary_start:
1109 * Those generic dummy functions are kept for CPUs not 982 * Those generic dummy functions are kept for CPUs not
1110 * included in CONFIG_6xx 983 * included in CONFIG_6xx
1111 */ 984 */
1112#if !defined(CONFIG_6xx) && !defined(CONFIG_POWER4) 985#if !defined(CONFIG_6xx)
1113_GLOBAL(__save_cpu_setup) 986_GLOBAL(__save_cpu_setup)
1114 blr 987 blr
1115_GLOBAL(__restore_cpu_setup) 988_GLOBAL(__restore_cpu_setup)
1116 blr 989 blr
1117#endif /* !defined(CONFIG_6xx) && !defined(CONFIG_POWER4) */ 990#endif /* !defined(CONFIG_6xx) */
1118 991
1119 992
1120/* 993/*
@@ -1132,11 +1005,6 @@ load_up_mmu:
1132 tophys(r6,r6) 1005 tophys(r6,r6)
1133 lwz r6,_SDR1@l(r6) 1006 lwz r6,_SDR1@l(r6)
1134 mtspr SPRN_SDR1,r6 1007 mtspr SPRN_SDR1,r6
1135#ifdef CONFIG_PPC64BRIDGE
1136 /* clear the ASR so we only use the pseudo-segment registers. */
1137 li r6,0
1138 mtasr r6
1139#endif /* CONFIG_PPC64BRIDGE */
1140 li r0,16 /* load up segment register values */ 1008 li r0,16 /* load up segment register values */
1141 mtctr r0 /* for context 0 */ 1009 mtctr r0 /* for context 0 */
1142 lis r3,0x2000 /* Ku = 1, VSID = 0 */ 1010 lis r3,0x2000 /* Ku = 1, VSID = 0 */
@@ -1145,7 +1013,7 @@ load_up_mmu:
1145 addi r3,r3,0x111 /* increment VSID */ 1013 addi r3,r3,0x111 /* increment VSID */
1146 addis r4,r4,0x1000 /* address of next segment */ 1014 addis r4,r4,0x1000 /* address of next segment */
1147 bdnz 3b 1015 bdnz 3b
1148#ifndef CONFIG_POWER4 1016
1149/* Load the BAT registers with the values set up by MMU_init. 1017/* Load the BAT registers with the values set up by MMU_init.
1150 MMU_init takes care of whether we're on a 601 or not. */ 1018 MMU_init takes care of whether we're on a 601 or not. */
1151 mfpvr r3 1019 mfpvr r3
@@ -1158,7 +1026,7 @@ load_up_mmu:
1158 LOAD_BAT(1,r3,r4,r5) 1026 LOAD_BAT(1,r3,r4,r5)
1159 LOAD_BAT(2,r3,r4,r5) 1027 LOAD_BAT(2,r3,r4,r5)
1160 LOAD_BAT(3,r3,r4,r5) 1028 LOAD_BAT(3,r3,r4,r5)
1161#endif /* CONFIG_POWER4 */ 1029
1162 blr 1030 blr
1163 1031
1164/* 1032/*
@@ -1269,9 +1137,6 @@ _GLOBAL(set_context)
1269 li r4,0 1137 li r4,0
1270 isync 1138 isync
12713: 11393:
1272#ifdef CONFIG_PPC64BRIDGE
1273 slbie r4
1274#endif /* CONFIG_PPC64BRIDGE */
1275 mtsrin r3,r4 1140 mtsrin r3,r4
1276 addi r3,r3,0x111 /* next VSID */ 1141 addi r3,r3,0x111 /* next VSID */
1277 rlwinm r3,r3,0,8,3 /* clear out any overflow from VSID field */ 1142 rlwinm r3,r3,0,8,3 /* clear out any overflow from VSID field */
@@ -1358,7 +1223,6 @@ mmu_off:
1358 sync 1223 sync
1359 RFI 1224 RFI
1360 1225
1361#ifndef CONFIG_POWER4
1362/* 1226/*
1363 * Use the first pair of BAT registers to map the 1st 16MB 1227 * Use the first pair of BAT registers to map the 1st 16MB
1364 * of RAM to KERNELBASE. From this point on we can't safely 1228 * of RAM to KERNELBASE. From this point on we can't safely
@@ -1366,7 +1230,6 @@ mmu_off:
1366 */ 1230 */
1367initial_bats: 1231initial_bats:
1368 lis r11,KERNELBASE@h 1232 lis r11,KERNELBASE@h
1369#ifndef CONFIG_PPC64BRIDGE
1370 mfspr r9,SPRN_PVR 1233 mfspr r9,SPRN_PVR
1371 rlwinm r9,r9,16,16,31 /* r9 = 1 for 601, 4 for 604 */ 1234 rlwinm r9,r9,16,16,31 /* r9 = 1 for 601, 4 for 604 */
1372 cmpwi 0,r9,1 1235 cmpwi 0,r9,1
@@ -1381,7 +1244,6 @@ initial_bats:
1381 mtspr SPRN_IBAT1L,r10 1244 mtspr SPRN_IBAT1L,r10
1382 isync 1245 isync
1383 blr 1246 blr
1384#endif /* CONFIG_PPC64BRIDGE */
1385 1247
13864: tophys(r8,r11) 12484: tophys(r8,r11)
1387#ifdef CONFIG_SMP 1249#ifdef CONFIG_SMP
@@ -1395,11 +1257,6 @@ initial_bats:
1395 ori r11,r11,BL_256M<<2|0x2 /* set up BAT registers for 604 */ 1257 ori r11,r11,BL_256M<<2|0x2 /* set up BAT registers for 604 */
1396#endif /* CONFIG_APUS */ 1258#endif /* CONFIG_APUS */
1397 1259
1398#ifdef CONFIG_PPC64BRIDGE
1399 /* clear out the high 32 bits in the BAT */
1400 clrldi r11,r11,32
1401 clrldi r8,r8,32
1402#endif /* CONFIG_PPC64BRIDGE */
1403 mtspr SPRN_DBAT0L,r8 /* N.B. 6xx (not 601) have valid */ 1260 mtspr SPRN_DBAT0L,r8 /* N.B. 6xx (not 601) have valid */
1404 mtspr SPRN_DBAT0U,r11 /* bit in upper BAT register */ 1261 mtspr SPRN_DBAT0U,r11 /* bit in upper BAT register */
1405 mtspr SPRN_IBAT0L,r8 1262 mtspr SPRN_IBAT0L,r8
@@ -1432,38 +1289,6 @@ setup_disp_bat:
1432 1289
1433#endif /* !defined(CONFIG_APUS) && defined(CONFIG_BOOTX_TEXT) */ 1290#endif /* !defined(CONFIG_APUS) && defined(CONFIG_BOOTX_TEXT) */
1434 1291
1435#else /* CONFIG_POWER4 */
1436/*
1437 * Load up the SDR1 and segment register values now
1438 * since we don't have the BATs.
1439 * Also make sure we are running in 32-bit mode.
1440 */
1441
1442initial_mm_power4:
1443 addis r14,r3,_SDR1@ha /* get the value from _SDR1 */
1444 lwz r14,_SDR1@l(r14) /* assume hash table below 4GB */
1445 mtspr SPRN_SDR1,r14
1446 slbia
1447 lis r4,0x2000 /* set pseudo-segment reg 12 */
1448 ori r5,r4,0x0ccc
1449 mtsr 12,r5
1450#if 0
1451 ori r5,r4,0x0888 /* set pseudo-segment reg 8 */
1452 mtsr 8,r5 /* (for access to serial port) */
1453#endif
1454#ifdef CONFIG_BOOTX_TEXT
1455 ori r5,r4,0x0999 /* set pseudo-segment reg 9 */
1456 mtsr 9,r5 /* (for access to screen) */
1457#endif
1458 mfmsr r0
1459 clrldi r0,r0,1
1460 sync
1461 mtmsr r0
1462 isync
1463 blr
1464
1465#endif /* CONFIG_POWER4 */
1466
1467#ifdef CONFIG_8260 1292#ifdef CONFIG_8260
1468/* Jump into the system reset for the rom. 1293/* Jump into the system reset for the rom.
1469 * We first disable the MMU, and then jump to the ROM reset address. 1294 * We first disable the MMU, and then jump to the ROM reset address.
diff --git a/arch/ppc/kernel/pci.c b/arch/ppc/kernel/pci.c
index 04d04c5bfdd0..809673a36f7a 100644
--- a/arch/ppc/kernel/pci.c
+++ b/arch/ppc/kernel/pci.c
@@ -46,9 +46,6 @@ static void pcibios_fixup_resources(struct pci_dev* dev);
46static void fixup_broken_pcnet32(struct pci_dev* dev); 46static void fixup_broken_pcnet32(struct pci_dev* dev);
47static int reparent_resources(struct resource *parent, struct resource *res); 47static int reparent_resources(struct resource *parent, struct resource *res);
48static void fixup_cpc710_pci64(struct pci_dev* dev); 48static void fixup_cpc710_pci64(struct pci_dev* dev);
49#ifdef CONFIG_PPC_OF
50static u8* pci_to_OF_bus_map;
51#endif
52 49
53/* By default, we don't re-assign bus numbers. 50/* By default, we don't re-assign bus numbers.
54 */ 51 */
@@ -625,406 +622,13 @@ pcibios_alloc_controller(void)
625 return hose; 622 return hose;
626} 623}
627 624
628#ifdef CONFIG_PPC_OF
629/*
630 * Functions below are used on OpenFirmware machines.
631 */
632static void
633make_one_node_map(struct device_node* node, u8 pci_bus)
634{
635 int *bus_range;
636 int len;
637
638 if (pci_bus >= pci_bus_count)
639 return;
640 bus_range = (int *) get_property(node, "bus-range", &len);
641 if (bus_range == NULL || len < 2 * sizeof(int)) {
642 printk(KERN_WARNING "Can't get bus-range for %s, "
643 "assuming it starts at 0\n", node->full_name);
644 pci_to_OF_bus_map[pci_bus] = 0;
645 } else
646 pci_to_OF_bus_map[pci_bus] = bus_range[0];
647
648 for (node=node->child; node != 0;node = node->sibling) {
649 struct pci_dev* dev;
650 unsigned int *class_code, *reg;
651
652 class_code = (unsigned int *) get_property(node, "class-code", NULL);
653 if (!class_code || ((*class_code >> 8) != PCI_CLASS_BRIDGE_PCI &&
654 (*class_code >> 8) != PCI_CLASS_BRIDGE_CARDBUS))
655 continue;
656 reg = (unsigned int *)get_property(node, "reg", NULL);
657 if (!reg)
658 continue;
659 dev = pci_find_slot(pci_bus, ((reg[0] >> 8) & 0xff));
660 if (!dev || !dev->subordinate)
661 continue;
662 make_one_node_map(node, dev->subordinate->number);
663 }
664}
665
666void
667pcibios_make_OF_bus_map(void)
668{
669 int i;
670 struct pci_controller* hose;
671 u8* of_prop_map;
672
673 pci_to_OF_bus_map = (u8*)kmalloc(pci_bus_count, GFP_KERNEL);
674 if (!pci_to_OF_bus_map) {
675 printk(KERN_ERR "Can't allocate OF bus map !\n");
676 return;
677 }
678
679 /* We fill the bus map with invalid values, that helps
680 * debugging.
681 */
682 for (i=0; i<pci_bus_count; i++)
683 pci_to_OF_bus_map[i] = 0xff;
684
685 /* For each hose, we begin searching bridges */
686 for(hose=hose_head; hose; hose=hose->next) {
687 struct device_node* node;
688 node = (struct device_node *)hose->arch_data;
689 if (!node)
690 continue;
691 make_one_node_map(node, hose->first_busno);
692 }
693 of_prop_map = get_property(find_path_device("/"), "pci-OF-bus-map", NULL);
694 if (of_prop_map)
695 memcpy(of_prop_map, pci_to_OF_bus_map, pci_bus_count);
696#ifdef DEBUG
697 printk("PCI->OF bus map:\n");
698 for (i=0; i<pci_bus_count; i++) {
699 if (pci_to_OF_bus_map[i] == 0xff)
700 continue;
701 printk("%d -> %d\n", i, pci_to_OF_bus_map[i]);
702 }
703#endif
704}
705
706typedef int (*pci_OF_scan_iterator)(struct device_node* node, void* data);
707
708static struct device_node*
709scan_OF_pci_childs(struct device_node* node, pci_OF_scan_iterator filter, void* data)
710{
711 struct device_node* sub_node;
712
713 for (; node != 0;node = node->sibling) {
714 unsigned int *class_code;
715
716 if (filter(node, data))
717 return node;
718
719 /* For PCI<->PCI bridges or CardBus bridges, we go down
720 * Note: some OFs create a parent node "multifunc-device" as
721 * a fake root for all functions of a multi-function device,
722 * we go down them as well.
723 */
724 class_code = (unsigned int *) get_property(node, "class-code", NULL);
725 if ((!class_code || ((*class_code >> 8) != PCI_CLASS_BRIDGE_PCI &&
726 (*class_code >> 8) != PCI_CLASS_BRIDGE_CARDBUS)) &&
727 strcmp(node->name, "multifunc-device"))
728 continue;
729 sub_node = scan_OF_pci_childs(node->child, filter, data);
730 if (sub_node)
731 return sub_node;
732 }
733 return NULL;
734}
735
736static int
737scan_OF_pci_childs_iterator(struct device_node* node, void* data)
738{
739 unsigned int *reg;
740 u8* fdata = (u8*)data;
741
742 reg = (unsigned int *) get_property(node, "reg", NULL);
743 if (reg && ((reg[0] >> 8) & 0xff) == fdata[1]
744 && ((reg[0] >> 16) & 0xff) == fdata[0])
745 return 1;
746 return 0;
747}
748
749static struct device_node*
750scan_OF_childs_for_device(struct device_node* node, u8 bus, u8 dev_fn)
751{
752 u8 filter_data[2] = {bus, dev_fn};
753
754 return scan_OF_pci_childs(node, scan_OF_pci_childs_iterator, filter_data);
755}
756
757/*
758 * Scans the OF tree for a device node matching a PCI device
759 */
760struct device_node *
761pci_busdev_to_OF_node(struct pci_bus *bus, int devfn)
762{
763 struct pci_controller *hose;
764 struct device_node *node;
765 int busnr;
766
767 if (!have_of)
768 return NULL;
769
770 /* Lookup the hose */
771 busnr = bus->number;
772 hose = pci_bus_to_hose(busnr);
773 if (!hose)
774 return NULL;
775
776 /* Check it has an OF node associated */
777 node = (struct device_node *) hose->arch_data;
778 if (!node)
779 return NULL;
780
781 /* Fixup bus number according to what OF think it is. */
782 if (pci_to_OF_bus_map)
783 busnr = pci_to_OF_bus_map[busnr];
784 if (busnr == 0xff)
785 return NULL;
786
787 /* Now, lookup childs of the hose */
788 return scan_OF_childs_for_device(node->child, busnr, devfn);
789}
790EXPORT_SYMBOL(pci_busdev_to_OF_node);
791
792struct device_node*
793pci_device_to_OF_node(struct pci_dev *dev)
794{
795 return pci_busdev_to_OF_node(dev->bus, dev->devfn);
796}
797EXPORT_SYMBOL(pci_device_to_OF_node);
798
799/* This routine is meant to be used early during boot, when the
800 * PCI bus numbers have not yet been assigned, and you need to
801 * issue PCI config cycles to an OF device.
802 * It could also be used to "fix" RTAS config cycles if you want
803 * to set pci_assign_all_buses to 1 and still use RTAS for PCI
804 * config cycles.
805 */
806struct pci_controller* pci_find_hose_for_OF_device(struct device_node* node)
807{
808 if (!have_of)
809 return NULL;
810 while(node) {
811 struct pci_controller* hose;
812 for (hose=hose_head;hose;hose=hose->next)
813 if (hose->arch_data == node)
814 return hose;
815 node=node->parent;
816 }
817 return NULL;
818}
819
820static int
821find_OF_pci_device_filter(struct device_node* node, void* data)
822{
823 return ((void *)node == data);
824}
825
826/*
827 * Returns the PCI device matching a given OF node
828 */
829int
830pci_device_from_OF_node(struct device_node* node, u8* bus, u8* devfn)
831{
832 unsigned int *reg;
833 struct pci_controller* hose;
834 struct pci_dev* dev = NULL;
835
836 if (!have_of)
837 return -ENODEV;
838 /* Make sure it's really a PCI device */
839 hose = pci_find_hose_for_OF_device(node);
840 if (!hose || !hose->arch_data)
841 return -ENODEV;
842 if (!scan_OF_pci_childs(((struct device_node*)hose->arch_data)->child,
843 find_OF_pci_device_filter, (void *)node))
844 return -ENODEV;
845 reg = (unsigned int *) get_property(node, "reg", NULL);
846 if (!reg)
847 return -ENODEV;
848 *bus = (reg[0] >> 16) & 0xff;
849 *devfn = ((reg[0] >> 8) & 0xff);
850
851 /* Ok, here we need some tweak. If we have already renumbered
852 * all busses, we can't rely on the OF bus number any more.
853 * the pci_to_OF_bus_map is not enough as several PCI busses
854 * may match the same OF bus number.
855 */
856 if (!pci_to_OF_bus_map)
857 return 0;
858
859 for_each_pci_dev(dev)
860 if (pci_to_OF_bus_map[dev->bus->number] == *bus &&
861 dev->devfn == *devfn) {
862 *bus = dev->bus->number;
863 pci_dev_put(dev);
864 return 0;
865 }
866
867 return -ENODEV;
868}
869EXPORT_SYMBOL(pci_device_from_OF_node);
870
871void __init
872pci_process_bridge_OF_ranges(struct pci_controller *hose,
873 struct device_node *dev, int primary)
874{
875 static unsigned int static_lc_ranges[256] __initdata;
876 unsigned int *dt_ranges, *lc_ranges, *ranges, *prev;
877 unsigned int size;
878 int rlen = 0, orig_rlen;
879 int memno = 0;
880 struct resource *res;
881 int np, na = prom_n_addr_cells(dev);
882 np = na + 5;
883
884 /* First we try to merge ranges to fix a problem with some pmacs
885 * that can have more than 3 ranges, fortunately using contiguous
886 * addresses -- BenH
887 */
888 dt_ranges = (unsigned int *) get_property(dev, "ranges", &rlen);
889 if (!dt_ranges)
890 return;
891 /* Sanity check, though hopefully that never happens */
892 if (rlen > sizeof(static_lc_ranges)) {
893 printk(KERN_WARNING "OF ranges property too large !\n");
894 rlen = sizeof(static_lc_ranges);
895 }
896 lc_ranges = static_lc_ranges;
897 memcpy(lc_ranges, dt_ranges, rlen);
898 orig_rlen = rlen;
899
900 /* Let's work on a copy of the "ranges" property instead of damaging
901 * the device-tree image in memory
902 */
903 ranges = lc_ranges;
904 prev = NULL;
905 while ((rlen -= np * sizeof(unsigned int)) >= 0) {
906 if (prev) {
907 if (prev[0] == ranges[0] && prev[1] == ranges[1] &&
908 (prev[2] + prev[na+4]) == ranges[2] &&
909 (prev[na+2] + prev[na+4]) == ranges[na+2]) {
910 prev[na+4] += ranges[na+4];
911 ranges[0] = 0;
912 ranges += np;
913 continue;
914 }
915 }
916 prev = ranges;
917 ranges += np;
918 }
919
920 /*
921 * The ranges property is laid out as an array of elements,
922 * each of which comprises:
923 * cells 0 - 2: a PCI address
924 * cells 3 or 3+4: a CPU physical address
925 * (size depending on dev->n_addr_cells)
926 * cells 4+5 or 5+6: the size of the range
927 */
928 ranges = lc_ranges;
929 rlen = orig_rlen;
930 while (ranges && (rlen -= np * sizeof(unsigned int)) >= 0) {
931 res = NULL;
932 size = ranges[na+4];
933 switch ((ranges[0] >> 24) & 0x3) {
934 case 1: /* I/O space */
935 if (ranges[2] != 0)
936 break;
937 hose->io_base_phys = ranges[na+2];
938 /* limit I/O space to 16MB */
939 if (size > 0x01000000)
940 size = 0x01000000;
941 hose->io_base_virt = ioremap(ranges[na+2], size);
942 if (primary)
943 isa_io_base = (unsigned long) hose->io_base_virt;
944 res = &hose->io_resource;
945 res->flags = IORESOURCE_IO;
946 res->start = ranges[2];
947 DBG("PCI: IO 0x%lx -> 0x%lx\n",
948 res->start, res->start + size - 1);
949 break;
950 case 2: /* memory space */
951 memno = 0;
952 if (ranges[1] == 0 && ranges[2] == 0
953 && ranges[na+4] <= (16 << 20)) {
954 /* 1st 16MB, i.e. ISA memory area */
955 if (primary)
956 isa_mem_base = ranges[na+2];
957 memno = 1;
958 }
959 while (memno < 3 && hose->mem_resources[memno].flags)
960 ++memno;
961 if (memno == 0)
962 hose->pci_mem_offset = ranges[na+2] - ranges[2];
963 if (memno < 3) {
964 res = &hose->mem_resources[memno];
965 res->flags = IORESOURCE_MEM;
966 if(ranges[0] & 0x40000000)
967 res->flags |= IORESOURCE_PREFETCH;
968 res->start = ranges[na+2];
969 DBG("PCI: MEM[%d] 0x%lx -> 0x%lx\n", memno,
970 res->start, res->start + size - 1);
971 }
972 break;
973 }
974 if (res != NULL) {
975 res->name = dev->full_name;
976 res->end = res->start + size - 1;
977 res->parent = NULL;
978 res->sibling = NULL;
979 res->child = NULL;
980 }
981 ranges += np;
982 }
983}
984
985/* We create the "pci-OF-bus-map" property now so it appears in the
986 * /proc device tree
987 */
988void __init
989pci_create_OF_bus_map(void)
990{
991 struct property* of_prop;
992
993 of_prop = (struct property*) alloc_bootmem(sizeof(struct property) + 256);
994 if (of_prop && find_path_device("/")) {
995 memset(of_prop, -1, sizeof(struct property) + 256);
996 of_prop->name = "pci-OF-bus-map";
997 of_prop->length = 256;
998 of_prop->value = (unsigned char *)&of_prop[1];
999 prom_add_property(find_path_device("/"), of_prop);
1000 }
1001}
1002
1003static ssize_t pci_show_devspec(struct device *dev, struct device_attribute *attr, char *buf)
1004{
1005 struct pci_dev *pdev;
1006 struct device_node *np;
1007
1008 pdev = to_pci_dev (dev);
1009 np = pci_device_to_OF_node(pdev);
1010 if (np == NULL || np->full_name == NULL)
1011 return 0;
1012 return sprintf(buf, "%s", np->full_name);
1013}
1014static DEVICE_ATTR(devspec, S_IRUGO, pci_show_devspec, NULL);
1015
1016#else /* CONFIG_PPC_OF */
1017void pcibios_make_OF_bus_map(void) 625void pcibios_make_OF_bus_map(void)
1018{ 626{
1019} 627}
1020#endif /* CONFIG_PPC_OF */
1021 628
1022/* Add sysfs properties */ 629/* Add sysfs properties */
1023void pcibios_add_platform_entries(struct pci_dev *pdev) 630void pcibios_add_platform_entries(struct pci_dev *pdev)
1024{ 631{
1025#ifdef CONFIG_PPC_OF
1026 device_create_file(&pdev->dev, &dev_attr_devspec);
1027#endif /* CONFIG_PPC_OF */
1028} 632}
1029 633
1030 634
diff --git a/arch/ppc/kernel/ppc_htab.c b/arch/ppc/kernel/ppc_htab.c
index 2f5c7650274f..eabac6cad1f5 100644
--- a/arch/ppc/kernel/ppc_htab.c
+++ b/arch/ppc/kernel/ppc_htab.c
@@ -104,7 +104,7 @@ static char *pmc2_lookup(unsigned long mmcr0)
104static int ppc_htab_show(struct seq_file *m, void *v) 104static int ppc_htab_show(struct seq_file *m, void *v)
105{ 105{
106 unsigned long mmcr0 = 0, pmc1 = 0, pmc2 = 0; 106 unsigned long mmcr0 = 0, pmc1 = 0, pmc2 = 0;
107#if defined(CONFIG_PPC_STD_MMU) && !defined(CONFIG_PPC64BRIDGE) 107#if defined(CONFIG_PPC_STD_MMU)
108 unsigned int kptes = 0, uptes = 0; 108 unsigned int kptes = 0, uptes = 0;
109 PTE *ptr; 109 PTE *ptr;
110#endif /* CONFIG_PPC_STD_MMU */ 110#endif /* CONFIG_PPC_STD_MMU */
@@ -133,7 +133,6 @@ static int ppc_htab_show(struct seq_file *m, void *v)
133 return 0; 133 return 0;
134 } 134 }
135 135
136#ifndef CONFIG_PPC64BRIDGE
137 for (ptr = Hash; ptr < Hash_end; ptr++) { 136 for (ptr = Hash; ptr < Hash_end; ptr++) {
138 unsigned int mctx, vsid; 137 unsigned int mctx, vsid;
139 138
@@ -147,7 +146,6 @@ static int ppc_htab_show(struct seq_file *m, void *v)
147 else 146 else
148 uptes++; 147 uptes++;
149 } 148 }
150#endif
151 149
152 seq_printf(m, 150 seq_printf(m,
153 "PTE Hash Table Information\n" 151 "PTE Hash Table Information\n"
@@ -155,20 +153,16 @@ static int ppc_htab_show(struct seq_file *m, void *v)
155 "Buckets\t\t: %lu\n" 153 "Buckets\t\t: %lu\n"
156 "Address\t\t: %08lx\n" 154 "Address\t\t: %08lx\n"
157 "Entries\t\t: %lu\n" 155 "Entries\t\t: %lu\n"
158#ifndef CONFIG_PPC64BRIDGE
159 "User ptes\t: %u\n" 156 "User ptes\t: %u\n"
160 "Kernel ptes\t: %u\n" 157 "Kernel ptes\t: %u\n"
161 "Percent full\t: %lu%%\n" 158 "Percent full\t: %lu%%\n"
162#endif
163 , (unsigned long)(Hash_size>>10), 159 , (unsigned long)(Hash_size>>10),
164 (Hash_size/(sizeof(PTE)*8)), 160 (Hash_size/(sizeof(PTE)*8)),
165 (unsigned long)Hash, 161 (unsigned long)Hash,
166 Hash_size/sizeof(PTE) 162 Hash_size/sizeof(PTE)
167#ifndef CONFIG_PPC64BRIDGE
168 , uptes, 163 , uptes,
169 kptes, 164 kptes,
170 ((kptes+uptes)*100) / (Hash_size/sizeof(PTE)) 165 ((kptes+uptes)*100) / (Hash_size/sizeof(PTE))
171#endif
172 ); 166 );
173 167
174 seq_printf(m, 168 seq_printf(m,
diff --git a/arch/ppc/kernel/ppc_ksyms.c b/arch/ppc/kernel/ppc_ksyms.c
index 683e028000e9..865ba74991a9 100644
--- a/arch/ppc/kernel/ppc_ksyms.c
+++ b/arch/ppc/kernel/ppc_ksyms.c
@@ -29,7 +29,6 @@
29#include <linux/adb.h> 29#include <linux/adb.h>
30#include <linux/cuda.h> 30#include <linux/cuda.h>
31#include <linux/pmu.h> 31#include <linux/pmu.h>
32#include <asm/prom.h>
33#include <asm/system.h> 32#include <asm/system.h>
34#include <asm/pci-bridge.h> 33#include <asm/pci-bridge.h>
35#include <asm/irq.h> 34#include <asm/irq.h>
@@ -207,27 +206,6 @@ EXPORT_SYMBOL(adb_try_handler_change);
207EXPORT_SYMBOL(cuda_request); 206EXPORT_SYMBOL(cuda_request);
208EXPORT_SYMBOL(cuda_poll); 207EXPORT_SYMBOL(cuda_poll);
209#endif /* CONFIG_ADB_CUDA */ 208#endif /* CONFIG_ADB_CUDA */
210#ifdef CONFIG_PPC_OF
211EXPORT_SYMBOL(find_devices);
212EXPORT_SYMBOL(find_type_devices);
213EXPORT_SYMBOL(find_compatible_devices);
214EXPORT_SYMBOL(find_path_device);
215EXPORT_SYMBOL(device_is_compatible);
216EXPORT_SYMBOL(machine_is_compatible);
217EXPORT_SYMBOL(find_all_nodes);
218EXPORT_SYMBOL(get_property);
219EXPORT_SYMBOL(request_OF_resource);
220EXPORT_SYMBOL(release_OF_resource);
221EXPORT_SYMBOL(of_find_node_by_name);
222EXPORT_SYMBOL(of_find_node_by_type);
223EXPORT_SYMBOL(of_find_compatible_node);
224EXPORT_SYMBOL(of_find_node_by_path);
225EXPORT_SYMBOL(of_find_all_nodes);
226EXPORT_SYMBOL(of_get_parent);
227EXPORT_SYMBOL(of_get_next_child);
228EXPORT_SYMBOL(of_node_get);
229EXPORT_SYMBOL(of_node_put);
230#endif /* CONFIG_PPC_OF */
231#if defined(CONFIG_BOOTX_TEXT) 209#if defined(CONFIG_BOOTX_TEXT)
232EXPORT_SYMBOL(btext_update_display); 210EXPORT_SYMBOL(btext_update_display);
233#endif 211#endif
diff --git a/arch/ppc/kernel/setup.c b/arch/ppc/kernel/setup.c
index 53e9deacee82..7eb91a2e818a 100644
--- a/arch/ppc/kernel/setup.c
+++ b/arch/ppc/kernel/setup.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Common prep/chrp boot and setup code. 2 * Common prep boot and setup code.
3 */ 3 */
4 4
5#include <linux/config.h> 5#include <linux/config.h>
@@ -72,17 +72,12 @@ unsigned long ISA_DMA_THRESHOLD;
72unsigned int DMA_MODE_READ; 72unsigned int DMA_MODE_READ;
73unsigned int DMA_MODE_WRITE; 73unsigned int DMA_MODE_WRITE;
74 74
75#ifdef CONFIG_PPC_MULTIPLATFORM 75#ifdef CONFIG_PPC_PREP
76int _machine = 0;
77EXPORT_SYMBOL(_machine);
78
79extern void prep_init(unsigned long r3, unsigned long r4, 76extern void prep_init(unsigned long r3, unsigned long r4,
80 unsigned long r5, unsigned long r6, unsigned long r7); 77 unsigned long r5, unsigned long r6, unsigned long r7);
81extern void chrp_init(unsigned long r3, unsigned long r4,
82 unsigned long r5, unsigned long r6, unsigned long r7);
83 78
84dev_t boot_dev; 79dev_t boot_dev;
85#endif /* CONFIG_PPC_MULTIPLATFORM */ 80#endif /* CONFIG_PPC_PREP */
86 81
87int have_of; 82int have_of;
88EXPORT_SYMBOL(have_of); 83EXPORT_SYMBOL(have_of);
@@ -319,72 +314,12 @@ early_init(int r3, int r4, int r5)
319 identify_cpu(offset, 0); 314 identify_cpu(offset, 0);
320 do_cpu_ftr_fixups(offset); 315 do_cpu_ftr_fixups(offset);
321 316
322#if defined(CONFIG_PPC_OF)
323 reloc_got2(offset);
324
325 /*
326 * don't do anything on prep
327 * for now, don't use bootinfo because it breaks yaboot 0.5
328 * and assume that if we didn't find a magic number, we have OF
329 */
330 if (*(unsigned long *)(0) != 0xdeadc0de)
331 phys = prom_init(r3, r4, (prom_entry)r5);
332
333 reloc_got2(-offset);
334#endif
335
336 return phys; 317 return phys;
337} 318}
338 319
339#ifdef CONFIG_PPC_OF 320#ifdef CONFIG_PPC_PREP
340/*
341 * Assume here that all clock rates are the same in a
342 * smp system. -- Cort
343 */
344int
345of_show_percpuinfo(struct seq_file *m, int i)
346{
347 struct device_node *cpu_node;
348 u32 *fp;
349 int s;
350
351 cpu_node = find_type_devices("cpu");
352 if (!cpu_node)
353 return 0;
354 for (s = 0; s < i && cpu_node->next; s++)
355 cpu_node = cpu_node->next;
356 fp = (u32 *)get_property(cpu_node, "clock-frequency", NULL);
357 if (fp)
358 seq_printf(m, "clock\t\t: %dMHz\n", *fp / 1000000);
359 return 0;
360}
361
362void __init
363intuit_machine_type(void)
364{
365 char *model;
366 struct device_node *root;
367
368 /* ask the OF info if we're a chrp or pmac */
369 root = find_path_device("/");
370 if (root != 0) {
371 /* assume pmac unless proven to be chrp -- Cort */
372 _machine = _MACH_Pmac;
373 model = get_property(root, "device_type", NULL);
374 if (model && !strncmp("chrp", model, 4))
375 _machine = _MACH_chrp;
376 else {
377 model = get_property(root, "model", NULL);
378 if (model && !strncmp(model, "IBM", 3))
379 _machine = _MACH_chrp;
380 }
381 }
382}
383#endif
384
385#ifdef CONFIG_PPC_MULTIPLATFORM
386/* 321/*
387 * The PPC_MULTIPLATFORM version of platform_init... 322 * The PPC_PREP version of platform_init...
388 */ 323 */
389void __init 324void __init
390platform_init(unsigned long r3, unsigned long r4, unsigned long r5, 325platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
@@ -399,161 +334,9 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
399 334
400 parse_bootinfo(find_bootinfo()); 335 parse_bootinfo(find_bootinfo());
401 336
402 /* if we didn't get any bootinfo telling us what we are... */ 337 prep_init(r3, r4, r5, r6, r7);
403 if (_machine == 0) {
404 /* prep boot loader tells us if we're prep or not */
405 if ( *(unsigned long *)(KERNELBASE) == (0xdeadc0de) )
406 _machine = _MACH_prep;
407 }
408
409#ifdef CONFIG_PPC_PREP
410 /* not much more to do here, if prep */
411 if (_machine == _MACH_prep) {
412 prep_init(r3, r4, r5, r6, r7);
413 return;
414 }
415#endif
416
417#ifdef CONFIG_PPC_OF
418 have_of = 1;
419
420 /* prom_init has already been called from __start */
421 if (boot_infos)
422 relocate_nodes();
423
424 /* If we aren't PReP, we can find out if we're Pmac
425 * or CHRP with this. */
426 if (_machine == 0)
427 intuit_machine_type();
428
429 /* finish_device_tree may need _machine defined. */
430 finish_device_tree();
431
432 /*
433 * If we were booted via quik, r3 points to the physical
434 * address of the command-line parameters.
435 * If we were booted from an xcoff image (i.e. netbooted or
436 * booted from floppy), we get the command line from the
437 * bootargs property of the /chosen node.
438 * If an initial ramdisk is present, r3 and r4
439 * are used for initrd_start and initrd_size,
440 * otherwise they contain 0xdeadbeef.
441 */
442 if (r3 >= 0x4000 && r3 < 0x800000 && r4 == 0) {
443 strlcpy(cmd_line, (char *)r3 + KERNELBASE,
444 sizeof(cmd_line));
445 } else if (boot_infos != 0) {
446 /* booted by BootX - check for ramdisk */
447 if (boot_infos->kernelParamsOffset != 0)
448 strlcpy(cmd_line, (char *) boot_infos
449 + boot_infos->kernelParamsOffset,
450 sizeof(cmd_line));
451#ifdef CONFIG_BLK_DEV_INITRD
452 if (boot_infos->ramDisk) {
453 initrd_start = (unsigned long) boot_infos
454 + boot_infos->ramDisk;
455 initrd_end = initrd_start + boot_infos->ramDiskSize;
456 initrd_below_start_ok = 1;
457 }
458#endif
459 } else {
460 struct device_node *chosen;
461 char *p;
462
463#ifdef CONFIG_BLK_DEV_INITRD
464 if (r3 && r4 && r4 != 0xdeadbeef) {
465 if (r3 < KERNELBASE)
466 r3 += KERNELBASE;
467 initrd_start = r3;
468 initrd_end = r3 + r4;
469 ROOT_DEV = Root_RAM0;
470 initrd_below_start_ok = 1;
471 }
472#endif
473 chosen = find_devices("chosen");
474 if (chosen != NULL) {
475 p = get_property(chosen, "bootargs", NULL);
476 if (p && *p) {
477 strlcpy(cmd_line, p, sizeof(cmd_line));
478 }
479 }
480 }
481#ifdef CONFIG_ADB
482 if (strstr(cmd_line, "adb_sync")) {
483 extern int __adb_probe_sync;
484 __adb_probe_sync = 1;
485 }
486#endif /* CONFIG_ADB */
487
488 switch (_machine) {
489#ifdef CONFIG_PPC_CHRP
490 case _MACH_chrp:
491 chrp_init(r3, r4, r5, r6, r7);
492 break;
493#endif
494 }
495#endif /* CONFIG_PPC_OF */
496} 338}
497#endif /* CONFIG_PPC_MULTIPLATFORM */ 339#endif /* CONFIG_PPC_PREP */
498
499#ifdef CONFIG_PPC_OF
500#ifdef CONFIG_SERIAL_CORE_CONSOLE
501extern char *of_stdout_device;
502
503static int __init set_preferred_console(void)
504{
505 struct device_node *prom_stdout;
506 char *name;
507 int offset = 0;
508
509 if (of_stdout_device == NULL)
510 return -ENODEV;
511
512 /* The user has requested a console so this is already set up. */
513 if (strstr(saved_command_line, "console="))
514 return -EBUSY;
515
516 prom_stdout = find_path_device(of_stdout_device);
517 if (!prom_stdout)
518 return -ENODEV;
519
520 name = (char *)get_property(prom_stdout, "name", NULL);
521 if (!name)
522 return -ENODEV;
523
524 if (strcmp(name, "serial") == 0) {
525 int i;
526 u32 *reg = (u32 *)get_property(prom_stdout, "reg", &i);
527 if (i > 8) {
528 switch (reg[1]) {
529 case 0x3f8:
530 offset = 0;
531 break;
532 case 0x2f8:
533 offset = 1;
534 break;
535 case 0x898:
536 offset = 2;
537 break;
538 case 0x890:
539 offset = 3;
540 break;
541 default:
542 /* We dont recognise the serial port */
543 return -ENODEV;
544 }
545 }
546 } else if (strcmp(name, "ch-a") == 0)
547 offset = 0;
548 else if (strcmp(name, "ch-b") == 0)
549 offset = 1;
550 else
551 return -ENODEV;
552 return add_preferred_console("ttyS", offset, NULL);
553}
554console_initcall(set_preferred_console);
555#endif /* CONFIG_SERIAL_CORE_CONSOLE */
556#endif /* CONFIG_PPC_OF */
557 340
558struct bi_record *find_bootinfo(void) 341struct bi_record *find_bootinfo(void)
559{ 342{
@@ -589,23 +372,6 @@ void parse_bootinfo(struct bi_record *rec)
589 initrd_end = data[0] + data[1] + KERNELBASE; 372 initrd_end = data[0] + data[1] + KERNELBASE;
590 break; 373 break;
591#endif /* CONFIG_BLK_DEV_INITRD */ 374#endif /* CONFIG_BLK_DEV_INITRD */
592#ifdef CONFIG_PPC_MULTIPLATFORM
593 case BI_MACHTYPE:
594 /* Machine types changed with the merge. Since the
595 * bootinfo are now deprecated, we can just hard code
596 * the appropriate conversion here for when we are
597 * called with yaboot which passes us a machine type
598 * this way.
599 */
600 switch(data[0]) {
601 case 1: _machine = _MACH_prep; break;
602 case 2: _machine = _MACH_Pmac; break;
603 case 4: _machine = _MACH_chrp; break;
604 default:
605 _machine = data[0];
606 }
607 break;
608#endif
609 case BI_MEMSIZE: 375 case BI_MEMSIZE:
610 boot_mem_size = data[0]; 376 boot_mem_size = data[0];
611 break; 377 break;
@@ -631,9 +397,6 @@ machine_init(unsigned long r3, unsigned long r4, unsigned long r5,
631#ifdef CONFIG_6xx 397#ifdef CONFIG_6xx
632 ppc_md.power_save = ppc6xx_idle; 398 ppc_md.power_save = ppc6xx_idle;
633#endif 399#endif
634#ifdef CONFIG_POWER4
635 ppc_md.power_save = power4_idle;
636#endif
637 400
638 platform_init(r3, r4, r5, r6, r7); 401 platform_init(r3, r4, r5, r6, r7);
639 402
@@ -799,7 +562,4 @@ void __init setup_arch(char **cmdline_p)
799 if ( ppc_md.progress ) ppc_md.progress("arch: exit", 0x3eab); 562 if ( ppc_md.progress ) ppc_md.progress("arch: exit", 0x3eab);
800 563
801 paging_init(); 564 paging_init();
802
803 /* this is for modules since _machine can be a define -- Cort */
804 ppc_md.ppc_machine = _machine;
805} 565}
diff --git a/arch/ppc/mm/hashtable.S b/arch/ppc/mm/hashtable.S
index f09fa88db35a..31d0a924317c 100644
--- a/arch/ppc/mm/hashtable.S
+++ b/arch/ppc/mm/hashtable.S
@@ -74,12 +74,6 @@ _GLOBAL(hash_page_sync)
74 */ 74 */
75 .text 75 .text
76_GLOBAL(hash_page) 76_GLOBAL(hash_page)
77#ifdef CONFIG_PPC64BRIDGE
78 mfmsr r0
79 clrldi r0,r0,1 /* make sure it's in 32-bit mode */
80 MTMSRD(r0)
81 isync
82#endif
83 tophys(r7,0) /* gets -KERNELBASE into r7 */ 77 tophys(r7,0) /* gets -KERNELBASE into r7 */
84#ifdef CONFIG_SMP 78#ifdef CONFIG_SMP
85 addis r8,r7,mmu_hash_lock@h 79 addis r8,r7,mmu_hash_lock@h
@@ -303,7 +297,6 @@ Hash_base = 0xc0180000
303Hash_bits = 12 /* e.g. 256kB hash table */ 297Hash_bits = 12 /* e.g. 256kB hash table */
304Hash_msk = (((1 << Hash_bits) - 1) * 64) 298Hash_msk = (((1 << Hash_bits) - 1) * 64)
305 299
306#ifndef CONFIG_PPC64BRIDGE
307/* defines for the PTE format for 32-bit PPCs */ 300/* defines for the PTE format for 32-bit PPCs */
308#define PTE_SIZE 8 301#define PTE_SIZE 8
309#define PTEG_SIZE 64 302#define PTEG_SIZE 64
@@ -317,21 +310,6 @@ Hash_msk = (((1 << Hash_bits) - 1) * 64)
317#define SET_V(r) oris r,r,PTE_V@h 310#define SET_V(r) oris r,r,PTE_V@h
318#define CLR_V(r,t) rlwinm r,r,0,1,31 311#define CLR_V(r,t) rlwinm r,r,0,1,31
319 312
320#else
321/* defines for the PTE format for 64-bit PPCs */
322#define PTE_SIZE 16
323#define PTEG_SIZE 128
324#define LG_PTEG_SIZE 7
325#define LDPTEu ldu
326#define STPTE std
327#define CMPPTE cmpd
328#define PTE_H 2
329#define PTE_V 1
330#define TST_V(r) andi. r,r,PTE_V
331#define SET_V(r) ori r,r,PTE_V
332#define CLR_V(r,t) li t,PTE_V; andc r,r,t
333#endif /* CONFIG_PPC64BRIDGE */
334
335#define HASH_LEFT 31-(LG_PTEG_SIZE+Hash_bits-1) 313#define HASH_LEFT 31-(LG_PTEG_SIZE+Hash_bits-1)
336#define HASH_RIGHT 31-LG_PTEG_SIZE 314#define HASH_RIGHT 31-LG_PTEG_SIZE
337 315
@@ -349,14 +327,8 @@ BEGIN_FTR_SECTION
349END_FTR_SECTION_IFSET(CPU_FTR_NEED_COHERENT) 327END_FTR_SECTION_IFSET(CPU_FTR_NEED_COHERENT)
350 328
351 /* Construct the high word of the PPC-style PTE (r5) */ 329 /* Construct the high word of the PPC-style PTE (r5) */
352#ifndef CONFIG_PPC64BRIDGE
353 rlwinm r5,r3,7,1,24 /* put VSID in 0x7fffff80 bits */ 330 rlwinm r5,r3,7,1,24 /* put VSID in 0x7fffff80 bits */
354 rlwimi r5,r4,10,26,31 /* put in API (abbrev page index) */ 331 rlwimi r5,r4,10,26,31 /* put in API (abbrev page index) */
355#else /* CONFIG_PPC64BRIDGE */
356 clrlwi r3,r3,8 /* reduce vsid to 24 bits */
357 sldi r5,r3,12 /* shift vsid into position */
358 rlwimi r5,r4,16,20,24 /* put in API (abbrev page index) */
359#endif /* CONFIG_PPC64BRIDGE */
360 SET_V(r5) /* set V (valid) bit */ 332 SET_V(r5) /* set V (valid) bit */
361 333
362 /* Get the address of the primary PTE group in the hash table (r3) */ 334 /* Get the address of the primary PTE group in the hash table (r3) */
@@ -540,14 +512,8 @@ _GLOBAL(flush_hash_pages)
540 add r3,r3,r0 /* note code below trims to 24 bits */ 512 add r3,r3,r0 /* note code below trims to 24 bits */
541 513
542 /* Construct the high word of the PPC-style PTE (r11) */ 514 /* Construct the high word of the PPC-style PTE (r11) */
543#ifndef CONFIG_PPC64BRIDGE
544 rlwinm r11,r3,7,1,24 /* put VSID in 0x7fffff80 bits */ 515 rlwinm r11,r3,7,1,24 /* put VSID in 0x7fffff80 bits */
545 rlwimi r11,r4,10,26,31 /* put in API (abbrev page index) */ 516 rlwimi r11,r4,10,26,31 /* put in API (abbrev page index) */
546#else /* CONFIG_PPC64BRIDGE */
547 clrlwi r3,r3,8 /* reduce vsid to 24 bits */
548 sldi r11,r3,12 /* shift vsid into position */
549 rlwimi r11,r4,16,20,24 /* put in API (abbrev page index) */
550#endif /* CONFIG_PPC64BRIDGE */
551 SET_V(r11) /* set V (valid) bit */ 517 SET_V(r11) /* set V (valid) bit */
552 518
553#ifdef CONFIG_SMP 519#ifdef CONFIG_SMP
diff --git a/arch/ppc/mm/init.c b/arch/ppc/mm/init.c
index cb1c294fb932..386e000bcb73 100644
--- a/arch/ppc/mm/init.c
+++ b/arch/ppc/mm/init.c
@@ -412,14 +412,6 @@ void __init mem_init(void)
412 } 412 }
413#endif /* CONFIG_BLK_DEV_INITRD */ 413#endif /* CONFIG_BLK_DEV_INITRD */
414 414
415#ifdef CONFIG_PPC_OF
416 /* mark the RTAS pages as reserved */
417 if ( rtas_data )
418 for (addr = (ulong)__va(rtas_data);
419 addr < PAGE_ALIGN((ulong)__va(rtas_data)+rtas_size) ;
420 addr += PAGE_SIZE)
421 SetPageReserved(virt_to_page(addr));
422#endif
423 for (addr = PAGE_OFFSET; addr < (unsigned long)high_memory; 415 for (addr = PAGE_OFFSET; addr < (unsigned long)high_memory;
424 addr += PAGE_SIZE) { 416 addr += PAGE_SIZE) {
425 if (!PageReserved(virt_to_page(addr))) 417 if (!PageReserved(virt_to_page(addr)))
@@ -494,11 +486,6 @@ set_phys_avail(unsigned long total_memory)
494 initrd_end - initrd_start, 1); 486 initrd_end - initrd_start, 1);
495 } 487 }
496#endif /* CONFIG_BLK_DEV_INITRD */ 488#endif /* CONFIG_BLK_DEV_INITRD */
497#ifdef CONFIG_PPC_OF
498 /* remove the RTAS pages from the available memory */
499 if (rtas_data)
500 mem_pieces_remove(&phys_avail, rtas_data, rtas_size, 1);
501#endif
502} 489}
503 490
504/* Mark some memory as reserved by removing it from phys_avail. */ 491/* Mark some memory as reserved by removing it from phys_avail. */
diff --git a/arch/ppc/mm/mmu_context.c b/arch/ppc/mm/mmu_context.c
index a8816e0f6a86..b4a4b3f02a1c 100644
--- a/arch/ppc/mm/mmu_context.c
+++ b/arch/ppc/mm/mmu_context.c
@@ -2,7 +2,7 @@
2 * This file contains the routines for handling the MMU on those 2 * This file contains the routines for handling the MMU on those
3 * PowerPC implementations where the MMU substantially follows the 3 * PowerPC implementations where the MMU substantially follows the
4 * architecture specification. This includes the 6xx, 7xx, 7xxx, 4 * architecture specification. This includes the 6xx, 7xx, 7xxx,
5 * 8260, and POWER3 implementations but excludes the 8xx and 4xx. 5 * 8260, and 83xx implementations but excludes the 8xx and 4xx.
6 * -- paulus 6 * -- paulus
7 * 7 *
8 * Derived from arch/ppc/mm/init.c: 8 * Derived from arch/ppc/mm/init.c:
diff --git a/arch/ppc/mm/pgtable.c b/arch/ppc/mm/pgtable.c
index 6ea9185fd120..a1924876cad6 100644
--- a/arch/ppc/mm/pgtable.c
+++ b/arch/ppc/mm/pgtable.c
@@ -39,7 +39,7 @@ unsigned long ioremap_base;
39unsigned long ioremap_bot; 39unsigned long ioremap_bot;
40int io_bat_index; 40int io_bat_index;
41 41
42#if defined(CONFIG_6xx) || defined(CONFIG_POWER3) 42#if defined(CONFIG_6xx)
43#define HAVE_BATS 1 43#define HAVE_BATS 1
44#endif 44#endif
45 45
diff --git a/arch/ppc/mm/ppc_mmu.c b/arch/ppc/mm/ppc_mmu.c
index 9a381ed5eb21..25bb6f3347c1 100644
--- a/arch/ppc/mm/ppc_mmu.c
+++ b/arch/ppc/mm/ppc_mmu.c
@@ -2,7 +2,7 @@
2 * This file contains the routines for handling the MMU on those 2 * This file contains the routines for handling the MMU on those
3 * PowerPC implementations where the MMU substantially follows the 3 * PowerPC implementations where the MMU substantially follows the
4 * architecture specification. This includes the 6xx, 7xx, 7xxx, 4 * architecture specification. This includes the 6xx, 7xx, 7xxx,
5 * 8260, and POWER3 implementations but excludes the 8xx and 4xx. 5 * 8260, and 83xx implementations but excludes the 8xx and 4xx.
6 * -- paulus 6 * -- paulus
7 * 7 *
8 * Derived from arch/ppc/mm/init.c: 8 * Derived from arch/ppc/mm/init.c:
@@ -42,11 +42,7 @@ unsigned long _SDR1;
42 42
43union ubat { /* BAT register values to be loaded */ 43union ubat { /* BAT register values to be loaded */
44 BAT bat; 44 BAT bat;
45#ifdef CONFIG_PPC64BRIDGE
46 u64 word[2];
47#else
48 u32 word[2]; 45 u32 word[2];
49#endif
50} BATS[4][2]; /* 4 pairs of IBAT, DBAT */ 46} BATS[4][2]; /* 4 pairs of IBAT, DBAT */
51 47
52struct batrange { /* stores address ranges mapped by BATs */ 48struct batrange { /* stores address ranges mapped by BATs */
@@ -83,9 +79,6 @@ unsigned long p_mapped_by_bats(unsigned long pa)
83 79
84unsigned long __init mmu_mapin_ram(void) 80unsigned long __init mmu_mapin_ram(void)
85{ 81{
86#ifdef CONFIG_POWER4
87 return 0;
88#else
89 unsigned long tot, bl, done; 82 unsigned long tot, bl, done;
90 unsigned long max_size = (256<<20); 83 unsigned long max_size = (256<<20);
91 unsigned long align; 84 unsigned long align;
@@ -122,7 +115,6 @@ unsigned long __init mmu_mapin_ram(void)
122 } 115 }
123 116
124 return done; 117 return done;
125#endif
126} 118}
127 119
128/* 120/*
@@ -205,27 +197,10 @@ void __init MMU_init_hw(void)
205 197
206 if ( ppc_md.progress ) ppc_md.progress("hash:enter", 0x105); 198 if ( ppc_md.progress ) ppc_md.progress("hash:enter", 0x105);
207 199
208#ifdef CONFIG_PPC64BRIDGE
209#define LG_HPTEG_SIZE 7 /* 128 bytes per HPTEG */
210#define SDR1_LOW_BITS (lg_n_hpteg - 11)
211#define MIN_N_HPTEG 2048 /* min 256kB hash table */
212#else
213#define LG_HPTEG_SIZE 6 /* 64 bytes per HPTEG */ 200#define LG_HPTEG_SIZE 6 /* 64 bytes per HPTEG */
214#define SDR1_LOW_BITS ((n_hpteg - 1) >> 10) 201#define SDR1_LOW_BITS ((n_hpteg - 1) >> 10)
215#define MIN_N_HPTEG 1024 /* min 64kB hash table */ 202#define MIN_N_HPTEG 1024 /* min 64kB hash table */
216#endif
217
218#ifdef CONFIG_POWER4
219 /* The hash table has already been allocated and initialized
220 in prom.c */
221 n_hpteg = Hash_size >> LG_HPTEG_SIZE;
222 lg_n_hpteg = __ilog2(n_hpteg);
223
224 /* Remove the hash table from the available memory */
225 if (Hash)
226 reserve_phys_mem(__pa(Hash), Hash_size);
227 203
228#else /* CONFIG_POWER4 */
229 /* 204 /*
230 * Allow 1 HPTE (1/8 HPTEG) for each page of memory. 205 * Allow 1 HPTE (1/8 HPTEG) for each page of memory.
231 * This is less than the recommended amount, but then 206 * This is less than the recommended amount, but then
@@ -248,7 +223,6 @@ void __init MMU_init_hw(void)
248 Hash = mem_pieces_find(Hash_size, Hash_size); 223 Hash = mem_pieces_find(Hash_size, Hash_size);
249 cacheable_memzero(Hash, Hash_size); 224 cacheable_memzero(Hash, Hash_size);
250 _SDR1 = __pa(Hash) | SDR1_LOW_BITS; 225 _SDR1 = __pa(Hash) | SDR1_LOW_BITS;
251#endif /* CONFIG_POWER4 */
252 226
253 Hash_end = (PTE *) ((unsigned long)Hash + Hash_size); 227 Hash_end = (PTE *) ((unsigned long)Hash + Hash_size);
254 228
diff --git a/arch/ppc/platforms/Makefile b/arch/ppc/platforms/Makefile
index e8b91a33ce91..90c622294423 100644
--- a/arch/ppc/platforms/Makefile
+++ b/arch/ppc/platforms/Makefile
@@ -2,18 +2,10 @@
2# Makefile for the linux kernel. 2# Makefile for the linux kernel.
3# 3#
4 4
5# Extra CFLAGS so we don't have to do relative includes
6CFLAGS_chrp_setup.o += -Iarch/$(ARCH)/mm
7
8obj-$(CONFIG_APUS) += apus_setup.o 5obj-$(CONFIG_APUS) += apus_setup.o
9ifeq ($(CONFIG_APUS),y) 6ifeq ($(CONFIG_APUS),y)
10obj-$(CONFIG_PCI) += apus_pci.o 7obj-$(CONFIG_PCI) += apus_pci.o
11endif 8endif
12obj-$(CONFIG_PPC_CHRP) += chrp_setup.o chrp_time.o chrp_pci.o \
13 chrp_pegasos_eth.o
14ifeq ($(CONFIG_PPC_CHRP),y)
15obj-$(CONFIG_NVRAM) += chrp_nvram.o
16endif
17obj-$(CONFIG_PPC_PREP) += prep_pci.o prep_setup.o 9obj-$(CONFIG_PPC_PREP) += prep_pci.o prep_setup.o
18obj-$(CONFIG_PREP_RESIDUAL) += residual.o 10obj-$(CONFIG_PREP_RESIDUAL) += residual.o
19obj-$(CONFIG_PQ2ADS) += pq2ads.o 11obj-$(CONFIG_PQ2ADS) += pq2ads.o
@@ -40,7 +32,3 @@ obj-$(CONFIG_EV64360) += ev64360.o
40obj-$(CONFIG_MPC86XADS) += mpc866ads_setup.o 32obj-$(CONFIG_MPC86XADS) += mpc866ads_setup.o
41obj-$(CONFIG_MPC885ADS) += mpc885ads_setup.o 33obj-$(CONFIG_MPC885ADS) += mpc885ads_setup.o
42obj-$(CONFIG_ADS8272) += mpc8272ads_setup.o 34obj-$(CONFIG_ADS8272) += mpc8272ads_setup.o
43
44ifeq ($(CONFIG_SMP),y)
45obj-$(CONFIG_PPC_CHRP) += chrp_smp.o
46endif
diff --git a/arch/ppc/platforms/chrp_nvram.c b/arch/ppc/platforms/chrp_nvram.c
deleted file mode 100644
index 465ba9b090ef..000000000000
--- a/arch/ppc/platforms/chrp_nvram.c
+++ /dev/null
@@ -1,83 +0,0 @@
1/*
2 * c 2001 PPC 64 Team, IBM Corp
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
8 *
9 * /dev/nvram driver for PPC
10 *
11 */
12
13#include <linux/kernel.h>
14#include <linux/init.h>
15#include <linux/slab.h>
16#include <linux/spinlock.h>
17#include <asm/uaccess.h>
18#include <asm/prom.h>
19#include <asm/machdep.h>
20
21static unsigned int nvram_size;
22static unsigned char nvram_buf[4];
23static DEFINE_SPINLOCK(nvram_lock);
24
25static unsigned char chrp_nvram_read(int addr)
26{
27 unsigned long done, flags;
28 unsigned char ret;
29
30 if (addr >= nvram_size) {
31 printk(KERN_DEBUG "%s: read addr %d > nvram_size %u\n",
32 current->comm, addr, nvram_size);
33 return 0xff;
34 }
35 spin_lock_irqsave(&nvram_lock, flags);
36 if ((call_rtas("nvram-fetch", 3, 2, &done, addr, __pa(nvram_buf), 1) != 0) || 1 != done)
37 ret = 0xff;
38 else
39 ret = nvram_buf[0];
40 spin_unlock_irqrestore(&nvram_lock, flags);
41
42 return ret;
43}
44
45static void chrp_nvram_write(int addr, unsigned char val)
46{
47 unsigned long done, flags;
48
49 if (addr >= nvram_size) {
50 printk(KERN_DEBUG "%s: write addr %d > nvram_size %u\n",
51 current->comm, addr, nvram_size);
52 return;
53 }
54 spin_lock_irqsave(&nvram_lock, flags);
55 nvram_buf[0] = val;
56 if ((call_rtas("nvram-store", 3, 2, &done, addr, __pa(nvram_buf), 1) != 0) || 1 != done)
57 printk(KERN_DEBUG "rtas IO error storing 0x%02x at %d", val, addr);
58 spin_unlock_irqrestore(&nvram_lock, flags);
59}
60
61void __init chrp_nvram_init(void)
62{
63 struct device_node *nvram;
64 unsigned int *nbytes_p, proplen;
65
66 nvram = of_find_node_by_type(NULL, "nvram");
67 if (nvram == NULL)
68 return;
69
70 nbytes_p = (unsigned int *)get_property(nvram, "#bytes", &proplen);
71 if (nbytes_p == NULL || proplen != sizeof(unsigned int))
72 return;
73
74 nvram_size = *nbytes_p;
75
76 printk(KERN_INFO "CHRP nvram contains %u bytes\n", nvram_size);
77 of_node_put(nvram);
78
79 ppc_md.nvram_read_val = chrp_nvram_read;
80 ppc_md.nvram_write_val = chrp_nvram_write;
81
82 return;
83}
diff --git a/arch/ppc/platforms/chrp_pci.c b/arch/ppc/platforms/chrp_pci.c
deleted file mode 100644
index c7fe6182bb77..000000000000
--- a/arch/ppc/platforms/chrp_pci.c
+++ /dev/null
@@ -1,309 +0,0 @@
1/*
2 * CHRP pci routines.
3 */
4
5#include <linux/config.h>
6#include <linux/kernel.h>
7#include <linux/pci.h>
8#include <linux/delay.h>
9#include <linux/string.h>
10#include <linux/init.h>
11#include <linux/ide.h>
12
13#include <asm/io.h>
14#include <asm/pgtable.h>
15#include <asm/irq.h>
16#include <asm/hydra.h>
17#include <asm/prom.h>
18#include <asm/gg2.h>
19#include <asm/machdep.h>
20#include <asm/sections.h>
21#include <asm/pci-bridge.h>
22#include <asm/open_pic.h>
23
24/* LongTrail */
25void __iomem *gg2_pci_config_base;
26
27/*
28 * The VLSI Golden Gate II has only 512K of PCI configuration space, so we
29 * limit the bus number to 3 bits
30 */
31
32int gg2_read_config(struct pci_bus *bus, unsigned int devfn, int off,
33 int len, u32 *val)
34{
35 volatile void __iomem *cfg_data;
36 struct pci_controller *hose = bus->sysdata;
37
38 if (bus->number > 7)
39 return PCIBIOS_DEVICE_NOT_FOUND;
40 /*
41 * Note: the caller has already checked that off is
42 * suitably aligned and that len is 1, 2 or 4.
43 */
44 cfg_data = hose->cfg_data + ((bus->number<<16) | (devfn<<8) | off);
45 switch (len) {
46 case 1:
47 *val = in_8(cfg_data);
48 break;
49 case 2:
50 *val = in_le16(cfg_data);
51 break;
52 default:
53 *val = in_le32(cfg_data);
54 break;
55 }
56 return PCIBIOS_SUCCESSFUL;
57}
58
59int gg2_write_config(struct pci_bus *bus, unsigned int devfn, int off,
60 int len, u32 val)
61{
62 volatile void __iomem *cfg_data;
63 struct pci_controller *hose = bus->sysdata;
64
65 if (bus->number > 7)
66 return PCIBIOS_DEVICE_NOT_FOUND;
67 /*
68 * Note: the caller has already checked that off is
69 * suitably aligned and that len is 1, 2 or 4.
70 */
71 cfg_data = hose->cfg_data + ((bus->number<<16) | (devfn<<8) | off);
72 switch (len) {
73 case 1:
74 out_8(cfg_data, val);
75 break;
76 case 2:
77 out_le16(cfg_data, val);
78 break;
79 default:
80 out_le32(cfg_data, val);
81 break;
82 }
83 return PCIBIOS_SUCCESSFUL;
84}
85
86static struct pci_ops gg2_pci_ops =
87{
88 gg2_read_config,
89 gg2_write_config
90};
91
92/*
93 * Access functions for PCI config space using RTAS calls.
94 */
95int
96rtas_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
97 int len, u32 *val)
98{
99 struct pci_controller *hose = bus->sysdata;
100 unsigned long addr = (offset & 0xff) | ((devfn & 0xff) << 8)
101 | (((bus->number - hose->first_busno) & 0xff) << 16)
102 | (hose->index << 24);
103 unsigned long ret = ~0UL;
104 int rval;
105
106 rval = call_rtas("read-pci-config", 2, 2, &ret, addr, len);
107 *val = ret;
108 return rval? PCIBIOS_DEVICE_NOT_FOUND: PCIBIOS_SUCCESSFUL;
109}
110
111int
112rtas_write_config(struct pci_bus *bus, unsigned int devfn, int offset,
113 int len, u32 val)
114{
115 struct pci_controller *hose = bus->sysdata;
116 unsigned long addr = (offset & 0xff) | ((devfn & 0xff) << 8)
117 | (((bus->number - hose->first_busno) & 0xff) << 16)
118 | (hose->index << 24);
119 int rval;
120
121 rval = call_rtas("write-pci-config", 3, 1, NULL, addr, len, val);
122 return rval? PCIBIOS_DEVICE_NOT_FOUND: PCIBIOS_SUCCESSFUL;
123}
124
125static struct pci_ops rtas_pci_ops =
126{
127 rtas_read_config,
128 rtas_write_config
129};
130
131volatile struct Hydra __iomem *Hydra = NULL;
132
133int __init
134hydra_init(void)
135{
136 struct device_node *np;
137
138 np = find_devices("mac-io");
139 if (np == NULL || np->n_addrs == 0)
140 return 0;
141 Hydra = ioremap(np->addrs[0].address, np->addrs[0].size);
142 printk("Hydra Mac I/O at %x\n", np->addrs[0].address);
143 printk("Hydra Feature_Control was %x",
144 in_le32(&Hydra->Feature_Control));
145 out_le32(&Hydra->Feature_Control, (HYDRA_FC_SCC_CELL_EN |
146 HYDRA_FC_SCSI_CELL_EN |
147 HYDRA_FC_SCCA_ENABLE |
148 HYDRA_FC_SCCB_ENABLE |
149 HYDRA_FC_ARB_BYPASS |
150 HYDRA_FC_MPIC_ENABLE |
151 HYDRA_FC_SLOW_SCC_PCLK |
152 HYDRA_FC_MPIC_IS_MASTER));
153 printk(", now %x\n", in_le32(&Hydra->Feature_Control));
154 return 1;
155}
156
157void __init
158chrp_pcibios_fixup(void)
159{
160 struct pci_dev *dev = NULL;
161 struct device_node *np;
162
163 /* PCI interrupts are controlled by the OpenPIC */
164 for_each_pci_dev(dev) {
165 np = pci_device_to_OF_node(dev);
166 if ((np != 0) && (np->n_intrs > 0) && (np->intrs[0].line != 0))
167 dev->irq = np->intrs[0].line;
168 pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq);
169 }
170}
171
172#define PRG_CL_RESET_VALID 0x00010000
173
174static void __init
175setup_python(struct pci_controller *hose, struct device_node *dev)
176{
177 u32 __iomem *reg;
178 u32 val;
179 unsigned long addr = dev->addrs[0].address;
180
181 setup_indirect_pci(hose, addr + 0xf8000, addr + 0xf8010);
182
183 /* Clear the magic go-slow bit */
184 reg = ioremap(dev->addrs[0].address + 0xf6000, 0x40);
185 val = in_be32(&reg[12]);
186 if (val & PRG_CL_RESET_VALID) {
187 out_be32(&reg[12], val & ~PRG_CL_RESET_VALID);
188 in_be32(&reg[12]);
189 }
190 iounmap(reg);
191}
192
193/* Marvell Discovery II based Pegasos 2 */
194static void __init setup_peg2(struct pci_controller *hose, struct device_node *dev)
195{
196 struct device_node *root = find_path_device("/");
197 struct device_node *rtas;
198
199 rtas = of_find_node_by_name (root, "rtas");
200 if (rtas) {
201 hose->ops = &rtas_pci_ops;
202 } else {
203 printk ("RTAS supporting Pegasos OF not found, please upgrade"
204 " your firmware\n");
205 }
206 pci_assign_all_buses = 1;
207}
208
209void __init
210chrp_find_bridges(void)
211{
212 struct device_node *dev;
213 int *bus_range;
214 int len, index = -1;
215 struct pci_controller *hose;
216 unsigned int *dma;
217 char *model, *machine;
218 int is_longtrail = 0, is_mot = 0, is_pegasos = 0;
219 struct device_node *root = find_path_device("/");
220
221 /*
222 * The PCI host bridge nodes on some machines don't have
223 * properties to adequately identify them, so we have to
224 * look at what sort of machine this is as well.
225 */
226 machine = get_property(root, "model", NULL);
227 if (machine != NULL) {
228 is_longtrail = strncmp(machine, "IBM,LongTrail", 13) == 0;
229 is_mot = strncmp(machine, "MOT", 3) == 0;
230 if (strncmp(machine, "Pegasos2", 8) == 0)
231 is_pegasos = 2;
232 else if (strncmp(machine, "Pegasos", 7) == 0)
233 is_pegasos = 1;
234 }
235 for (dev = root->child; dev != NULL; dev = dev->sibling) {
236 if (dev->type == NULL || strcmp(dev->type, "pci") != 0)
237 continue;
238 ++index;
239 /* The GG2 bridge on the LongTrail doesn't have an address */
240 if (dev->n_addrs < 1 && !is_longtrail) {
241 printk(KERN_WARNING "Can't use %s: no address\n",
242 dev->full_name);
243 continue;
244 }
245 bus_range = (int *) get_property(dev, "bus-range", &len);
246 if (bus_range == NULL || len < 2 * sizeof(int)) {
247 printk(KERN_WARNING "Can't get bus-range for %s\n",
248 dev->full_name);
249 continue;
250 }
251 if (bus_range[1] == bus_range[0])
252 printk(KERN_INFO "PCI bus %d", bus_range[0]);
253 else
254 printk(KERN_INFO "PCI buses %d..%d",
255 bus_range[0], bus_range[1]);
256 printk(" controlled by %s", dev->type);
257 if (dev->n_addrs > 0)
258 printk(" at %x", dev->addrs[0].address);
259 printk("\n");
260
261 hose = pcibios_alloc_controller();
262 if (!hose) {
263 printk("Can't allocate PCI controller structure for %s\n",
264 dev->full_name);
265 continue;
266 }
267 hose->arch_data = dev;
268 hose->first_busno = bus_range[0];
269 hose->last_busno = bus_range[1];
270
271 model = get_property(dev, "model", NULL);
272 if (model == NULL)
273 model = "<none>";
274 if (device_is_compatible(dev, "IBM,python")) {
275 setup_python(hose, dev);
276 } else if (is_mot
277 || strncmp(model, "Motorola, Grackle", 17) == 0) {
278 setup_indirect_pci(hose, 0xfec00000, 0xfee00000);
279 } else if (is_longtrail) {
280 void __iomem *p = ioremap(GG2_PCI_CONFIG_BASE, 0x80000);
281 hose->ops = &gg2_pci_ops;
282 hose->cfg_data = p;
283 gg2_pci_config_base = p;
284 } else if (is_pegasos == 1) {
285 setup_indirect_pci(hose, 0xfec00cf8, 0xfee00cfc);
286 } else if (is_pegasos == 2) {
287 setup_peg2(hose, dev);
288 } else {
289 printk("No methods for %s (model %s), using RTAS\n",
290 dev->full_name, model);
291 hose->ops = &rtas_pci_ops;
292 }
293
294 pci_process_bridge_OF_ranges(hose, dev, index == 0);
295
296 /* check the first bridge for a property that we can
297 use to set pci_dram_offset */
298 dma = (unsigned int *)
299 get_property(dev, "ibm,dma-ranges", &len);
300 if (index == 0 && dma != NULL && len >= 6 * sizeof(*dma)) {
301 pci_dram_offset = dma[2] - dma[3];
302 printk("pci_dram_offset = %lx\n", pci_dram_offset);
303 }
304 }
305
306 /* Do not fixup interrupts from OF tree on pegasos */
307 if (is_pegasos == 0)
308 ppc_md.pcibios_fixup = chrp_pcibios_fixup;
309}
diff --git a/arch/ppc/platforms/chrp_pegasos_eth.c b/arch/ppc/platforms/chrp_pegasos_eth.c
deleted file mode 100644
index 9305c8aa1373..000000000000
--- a/arch/ppc/platforms/chrp_pegasos_eth.c
+++ /dev/null
@@ -1,211 +0,0 @@
1/*
2 * Copyright (C) 2005 Sven Luther <sl@bplan-gmbh.de>
3 * Thanks to :
4 * Dale Farnsworth <dale@farnsworth.org>
5 * Mark A. Greer <mgreer@mvista.com>
6 * Nicolas DET <nd@bplan-gmbh.de>
7 * Benjamin Herrenschmidt <benh@kernel.crashing.org>
8 * And anyone else who helped me on this.
9 */
10
11#include <linux/types.h>
12#include <linux/init.h>
13#include <linux/ioport.h>
14#include <linux/platform_device.h>
15#include <linux/mv643xx.h>
16#include <linux/pci.h>
17
18#define PEGASOS2_MARVELL_REGBASE (0xf1000000)
19#define PEGASOS2_MARVELL_REGSIZE (0x00004000)
20#define PEGASOS2_SRAM_BASE (0xf2000000)
21#define PEGASOS2_SRAM_SIZE (256*1024)
22
23#define PEGASOS2_SRAM_BASE_ETH0 (PEGASOS2_SRAM_BASE)
24#define PEGASOS2_SRAM_BASE_ETH1 (PEGASOS2_SRAM_BASE_ETH0 + (PEGASOS2_SRAM_SIZE / 2) )
25
26
27#define PEGASOS2_SRAM_RXRING_SIZE (PEGASOS2_SRAM_SIZE/4)
28#define PEGASOS2_SRAM_TXRING_SIZE (PEGASOS2_SRAM_SIZE/4)
29
30#undef BE_VERBOSE
31
32static struct resource mv643xx_eth_shared_resources[] = {
33 [0] = {
34 .name = "ethernet shared base",
35 .start = 0xf1000000 + MV643XX_ETH_SHARED_REGS,
36 .end = 0xf1000000 + MV643XX_ETH_SHARED_REGS +
37 MV643XX_ETH_SHARED_REGS_SIZE - 1,
38 .flags = IORESOURCE_MEM,
39 },
40};
41
42static struct platform_device mv643xx_eth_shared_device = {
43 .name = MV643XX_ETH_SHARED_NAME,
44 .id = 0,
45 .num_resources = ARRAY_SIZE(mv643xx_eth_shared_resources),
46 .resource = mv643xx_eth_shared_resources,
47};
48
49static struct resource mv643xx_eth0_resources[] = {
50 [0] = {
51 .name = "eth0 irq",
52 .start = 9,
53 .end = 9,
54 .flags = IORESOURCE_IRQ,
55 },
56};
57
58
59static struct mv643xx_eth_platform_data eth0_pd = {
60 .tx_sram_addr = PEGASOS2_SRAM_BASE_ETH0,
61 .tx_sram_size = PEGASOS2_SRAM_TXRING_SIZE,
62 .tx_queue_size = PEGASOS2_SRAM_TXRING_SIZE/16,
63
64 .rx_sram_addr = PEGASOS2_SRAM_BASE_ETH0 + PEGASOS2_SRAM_TXRING_SIZE,
65 .rx_sram_size = PEGASOS2_SRAM_RXRING_SIZE,
66 .rx_queue_size = PEGASOS2_SRAM_RXRING_SIZE/16,
67};
68
69static struct platform_device eth0_device = {
70 .name = MV643XX_ETH_NAME,
71 .id = 0,
72 .num_resources = ARRAY_SIZE(mv643xx_eth0_resources),
73 .resource = mv643xx_eth0_resources,
74 .dev = {
75 .platform_data = &eth0_pd,
76 },
77};
78
79static struct resource mv643xx_eth1_resources[] = {
80 [0] = {
81 .name = "eth1 irq",
82 .start = 9,
83 .end = 9,
84 .flags = IORESOURCE_IRQ,
85 },
86};
87
88static struct mv643xx_eth_platform_data eth1_pd = {
89 .tx_sram_addr = PEGASOS2_SRAM_BASE_ETH1,
90 .tx_sram_size = PEGASOS2_SRAM_TXRING_SIZE,
91 .tx_queue_size = PEGASOS2_SRAM_TXRING_SIZE/16,
92
93 .rx_sram_addr = PEGASOS2_SRAM_BASE_ETH1 + PEGASOS2_SRAM_TXRING_SIZE,
94 .rx_sram_size = PEGASOS2_SRAM_RXRING_SIZE,
95 .rx_queue_size = PEGASOS2_SRAM_RXRING_SIZE/16,
96};
97
98static struct platform_device eth1_device = {
99 .name = MV643XX_ETH_NAME,
100 .id = 1,
101 .num_resources = ARRAY_SIZE(mv643xx_eth1_resources),
102 .resource = mv643xx_eth1_resources,
103 .dev = {
104 .platform_data = &eth1_pd,
105 },
106};
107
108static struct platform_device *mv643xx_eth_pd_devs[] __initdata = {
109 &mv643xx_eth_shared_device,
110 &eth0_device,
111 &eth1_device,
112};
113
114/***********/
115/***********/
116#define MV_READ(offset,val) { val = readl(mv643xx_reg_base + offset); }
117#define MV_WRITE(offset,data) writel(data, mv643xx_reg_base + offset)
118
119static void __iomem *mv643xx_reg_base;
120
121static int Enable_SRAM(void)
122{
123 u32 ALong;
124
125 if (mv643xx_reg_base == NULL)
126 mv643xx_reg_base = ioremap(PEGASOS2_MARVELL_REGBASE,
127 PEGASOS2_MARVELL_REGSIZE);
128
129 if (mv643xx_reg_base == NULL)
130 return -ENOMEM;
131
132#ifdef BE_VERBOSE
133 printk("Pegasos II/Marvell MV64361: register remapped from %p to %p\n",
134 (void *)PEGASOS2_MARVELL_REGBASE, (void *)mv643xx_reg_base);
135#endif
136
137 MV_WRITE(MV64340_SRAM_CONFIG, 0);
138
139 MV_WRITE(MV64340_INTEGRATED_SRAM_BASE_ADDR, PEGASOS2_SRAM_BASE >> 16);
140
141 MV_READ(MV64340_BASE_ADDR_ENABLE, ALong);
142 ALong &= ~(1 << 19);
143 MV_WRITE(MV64340_BASE_ADDR_ENABLE, ALong);
144
145 ALong = 0x02;
146 ALong |= PEGASOS2_SRAM_BASE & 0xffff0000;
147 MV_WRITE(MV643XX_ETH_BAR_4, ALong);
148
149 MV_WRITE(MV643XX_ETH_SIZE_REG_4, (PEGASOS2_SRAM_SIZE-1) & 0xffff0000);
150
151 MV_READ(MV643XX_ETH_BASE_ADDR_ENABLE_REG, ALong);
152 ALong &= ~(1 << 4);
153 MV_WRITE(MV643XX_ETH_BASE_ADDR_ENABLE_REG, ALong);
154
155#ifdef BE_VERBOSE
156 printk("Pegasos II/Marvell MV64361: register unmapped\n");
157 printk("Pegasos II/Marvell MV64361: SRAM at %p, size=%x\n", (void*) PEGASOS2_SRAM_BASE, PEGASOS2_SRAM_SIZE);
158#endif
159
160 iounmap(mv643xx_reg_base);
161 mv643xx_reg_base = NULL;
162
163 return 1;
164}
165
166
167/***********/
168/***********/
169int mv643xx_eth_add_pds(void)
170{
171 int ret = 0;
172 static struct pci_device_id pci_marvell_mv64360[] = {
173 { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, PCI_DEVICE_ID_MARVELL_MV64360) },
174 { }
175 };
176
177#ifdef BE_VERBOSE
178 printk("Pegasos II/Marvell MV64361: init\n");
179#endif
180
181 if (pci_dev_present(pci_marvell_mv64360)) {
182 ret = platform_add_devices(mv643xx_eth_pd_devs,
183 ARRAY_SIZE(mv643xx_eth_pd_devs));
184
185 if ( Enable_SRAM() < 0)
186 {
187 eth0_pd.tx_sram_addr = 0;
188 eth0_pd.tx_sram_size = 0;
189 eth0_pd.rx_sram_addr = 0;
190 eth0_pd.rx_sram_size = 0;
191
192 eth1_pd.tx_sram_addr = 0;
193 eth1_pd.tx_sram_size = 0;
194 eth1_pd.rx_sram_addr = 0;
195 eth1_pd.rx_sram_size = 0;
196
197#ifdef BE_VERBOSE
198 printk("Pegasos II/Marvell MV64361: Can't enable the "
199 "SRAM\n");
200#endif
201 }
202 }
203
204#ifdef BE_VERBOSE
205 printk("Pegasos II/Marvell MV64361: init is over\n");
206#endif
207
208 return ret;
209}
210
211device_initcall(mv643xx_eth_add_pds);
diff --git a/arch/ppc/platforms/chrp_setup.c b/arch/ppc/platforms/chrp_setup.c
deleted file mode 100644
index f9fd3f4f8e2e..000000000000
--- a/arch/ppc/platforms/chrp_setup.c
+++ /dev/null
@@ -1,669 +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 */
6
7/*
8 * bootup setup stuff..
9 */
10
11#include <linux/config.h>
12#include <linux/errno.h>
13#include <linux/sched.h>
14#include <linux/kernel.h>
15#include <linux/mm.h>
16#include <linux/stddef.h>
17#include <linux/unistd.h>
18#include <linux/ptrace.h>
19#include <linux/slab.h>
20#include <linux/user.h>
21#include <linux/a.out.h>
22#include <linux/tty.h>
23#include <linux/major.h>
24#include <linux/interrupt.h>
25#include <linux/reboot.h>
26#include <linux/init.h>
27#include <linux/pci.h>
28#include <linux/version.h>
29#include <linux/adb.h>
30#include <linux/module.h>
31#include <linux/delay.h>
32#include <linux/ide.h>
33#include <linux/console.h>
34#include <linux/seq_file.h>
35#include <linux/root_dev.h>
36#include <linux/initrd.h>
37#include <linux/module.h>
38
39#include <asm/io.h>
40#include <asm/pgtable.h>
41#include <asm/prom.h>
42#include <asm/gg2.h>
43#include <asm/pci-bridge.h>
44#include <asm/dma.h>
45#include <asm/machdep.h>
46#include <asm/irq.h>
47#include <asm/hydra.h>
48#include <asm/sections.h>
49#include <asm/time.h>
50#include <asm/btext.h>
51#include <asm/i8259.h>
52#include <asm/open_pic.h>
53#include <asm/xmon.h>
54#include "mem_pieces.h"
55
56unsigned long chrp_get_rtc_time(void);
57int chrp_set_rtc_time(unsigned long nowtime);
58void chrp_calibrate_decr(void);
59long chrp_time_init(void);
60
61void chrp_find_bridges(void);
62void chrp_event_scan(void);
63void rtas_display_progress(char *, unsigned short);
64void rtas_indicator_progress(char *, unsigned short);
65void btext_progress(char *, unsigned short);
66
67extern int of_show_percpuinfo(struct seq_file *, int);
68
69int _chrp_type;
70EXPORT_SYMBOL(_chrp_type);
71
72/*
73 * XXX this should be in xmon.h, but putting it there means xmon.h
74 * has to include <linux/interrupt.h> (to get irqreturn_t), which
75 * causes all sorts of problems. -- paulus
76 */
77extern irqreturn_t xmon_irq(int, void *, struct pt_regs *);
78
79extern dev_t boot_dev;
80
81extern PTE *Hash, *Hash_end;
82extern unsigned long Hash_size, Hash_mask;
83extern int probingmem;
84extern unsigned long loops_per_jiffy;
85static int max_width;
86
87#ifdef CONFIG_SMP
88extern struct smp_ops_t chrp_smp_ops;
89#endif
90
91static const char *gg2_memtypes[4] = {
92 "FPM", "SDRAM", "EDO", "BEDO"
93};
94static const char *gg2_cachesizes[4] = {
95 "256 KB", "512 KB", "1 MB", "Reserved"
96};
97static const char *gg2_cachetypes[4] = {
98 "Asynchronous", "Reserved", "Flow-Through Synchronous",
99 "Pipelined Synchronous"
100};
101static const char *gg2_cachemodes[4] = {
102 "Disabled", "Write-Through", "Copy-Back", "Transparent Mode"
103};
104
105int
106chrp_show_cpuinfo(struct seq_file *m)
107{
108 int i, sdramen;
109 unsigned int t;
110 struct device_node *root;
111 const char *model = "";
112
113 root = find_path_device("/");
114 if (root)
115 model = get_property(root, "model", NULL);
116 seq_printf(m, "machine\t\t: CHRP %s\n", model);
117
118 /* longtrail (goldengate) stuff */
119 if (!strncmp(model, "IBM,LongTrail", 13)) {
120 /* VLSI VAS96011/12 `Golden Gate 2' */
121 /* Memory banks */
122 sdramen = (in_le32(gg2_pci_config_base + GG2_PCI_DRAM_CTRL)
123 >>31) & 1;
124 for (i = 0; i < (sdramen ? 4 : 6); i++) {
125 t = in_le32(gg2_pci_config_base+
126 GG2_PCI_DRAM_BANK0+
127 i*4);
128 if (!(t & 1))
129 continue;
130 switch ((t>>8) & 0x1f) {
131 case 0x1f:
132 model = "4 MB";
133 break;
134 case 0x1e:
135 model = "8 MB";
136 break;
137 case 0x1c:
138 model = "16 MB";
139 break;
140 case 0x18:
141 model = "32 MB";
142 break;
143 case 0x10:
144 model = "64 MB";
145 break;
146 case 0x00:
147 model = "128 MB";
148 break;
149 default:
150 model = "Reserved";
151 break;
152 }
153 seq_printf(m, "memory bank %d\t: %s %s\n", i, model,
154 gg2_memtypes[sdramen ? 1 : ((t>>1) & 3)]);
155 }
156 /* L2 cache */
157 t = in_le32(gg2_pci_config_base+GG2_PCI_CC_CTRL);
158 seq_printf(m, "board l2\t: %s %s (%s)\n",
159 gg2_cachesizes[(t>>7) & 3],
160 gg2_cachetypes[(t>>2) & 3],
161 gg2_cachemodes[t & 3]);
162 }
163 return 0;
164}
165
166/*
167 * Fixes for the National Semiconductor PC78308VUL SuperI/O
168 *
169 * Some versions of Open Firmware incorrectly initialize the IRQ settings
170 * for keyboard and mouse
171 */
172static inline void __init sio_write(u8 val, u8 index)
173{
174 outb(index, 0x15c);
175 outb(val, 0x15d);
176}
177
178static inline u8 __init sio_read(u8 index)
179{
180 outb(index, 0x15c);
181 return inb(0x15d);
182}
183
184static void __init sio_fixup_irq(const char *name, u8 device, u8 level,
185 u8 type)
186{
187 u8 level0, type0, active;
188
189 /* select logical device */
190 sio_write(device, 0x07);
191 active = sio_read(0x30);
192 level0 = sio_read(0x70);
193 type0 = sio_read(0x71);
194 if (level0 != level || type0 != type || !active) {
195 printk(KERN_WARNING "sio: %s irq level %d, type %d, %sactive: "
196 "remapping to level %d, type %d, active\n",
197 name, level0, type0, !active ? "in" : "", level, type);
198 sio_write(0x01, 0x30);
199 sio_write(level, 0x70);
200 sio_write(type, 0x71);
201 }
202}
203
204static void __init sio_init(void)
205{
206 struct device_node *root;
207
208 if ((root = find_path_device("/")) &&
209 !strncmp(get_property(root, "model", NULL), "IBM,LongTrail", 13)) {
210 /* logical device 0 (KBC/Keyboard) */
211 sio_fixup_irq("keyboard", 0, 1, 2);
212 /* select logical device 1 (KBC/Mouse) */
213 sio_fixup_irq("mouse", 1, 12, 2);
214 }
215}
216
217
218static void __init pegasos_set_l2cr(void)
219{
220 struct device_node *np;
221
222 /* On Pegasos, enable the l2 cache if needed, as the OF forgets it */
223 if (_chrp_type != _CHRP_Pegasos)
224 return;
225
226 /* Enable L2 cache if needed */
227 np = find_type_devices("cpu");
228 if (np != NULL) {
229 unsigned int *l2cr = (unsigned int *)
230 get_property (np, "l2cr", NULL);
231 if (l2cr == NULL) {
232 printk ("Pegasos l2cr : no cpu l2cr property found\n");
233 return;
234 }
235 if (!((*l2cr) & 0x80000000)) {
236 printk ("Pegasos l2cr : L2 cache was not active, "
237 "activating\n");
238 _set_L2CR(0);
239 _set_L2CR((*l2cr) | 0x80000000);
240 }
241 }
242}
243
244void __init chrp_setup_arch(void)
245{
246 struct device_node *device;
247
248 /* init to some ~sane value until calibrate_delay() runs */
249 loops_per_jiffy = 50000000/HZ;
250
251#ifdef CONFIG_BLK_DEV_INITRD
252 /* this is fine for chrp */
253 initrd_below_start_ok = 1;
254
255 if (initrd_start)
256 ROOT_DEV = Root_RAM0;
257 else
258#endif
259 ROOT_DEV = Root_SDA2; /* sda2 (sda1 is for the kernel) */
260
261 /* On pegasos, enable the L2 cache if not already done by OF */
262 pegasos_set_l2cr();
263
264 /* Lookup PCI host bridges */
265 chrp_find_bridges();
266
267#ifndef CONFIG_PPC64BRIDGE
268 /*
269 * Temporary fixes for PCI devices.
270 * -- Geert
271 */
272 hydra_init(); /* Mac I/O */
273
274#endif /* CONFIG_PPC64BRIDGE */
275
276 /*
277 * Fix the Super I/O configuration
278 */
279 sio_init();
280
281 /* Get the event scan rate for the rtas so we know how
282 * often it expects a heartbeat. -- Cort
283 */
284 if ( rtas_data ) {
285 struct property *p;
286 device = find_devices("rtas");
287 for ( p = device->properties;
288 p && strncmp(p->name, "rtas-event-scan-rate", 20);
289 p = p->next )
290 /* nothing */ ;
291 if ( p && *(unsigned long *)p->value ) {
292 ppc_md.heartbeat = chrp_event_scan;
293 ppc_md.heartbeat_reset = (HZ/(*(unsigned long *)p->value)*30)-1;
294 ppc_md.heartbeat_count = 1;
295 printk("RTAS Event Scan Rate: %lu (%lu jiffies)\n",
296 *(unsigned long *)p->value, ppc_md.heartbeat_reset );
297 }
298 }
299
300 pci_create_OF_bus_map();
301}
302
303void
304chrp_event_scan(void)
305{
306 unsigned char log[1024];
307 unsigned long ret = 0;
308 /* XXX: we should loop until the hardware says no more error logs -- Cort */
309 call_rtas( "event-scan", 4, 1, &ret, 0xffffffff, 0,
310 __pa(log), 1024 );
311 ppc_md.heartbeat_count = ppc_md.heartbeat_reset;
312}
313
314void
315chrp_restart(char *cmd)
316{
317 printk("RTAS system-reboot returned %d\n",
318 call_rtas("system-reboot", 0, 1, NULL));
319 for (;;);
320}
321
322void
323chrp_power_off(void)
324{
325 /* allow power on only with power button press */
326 printk("RTAS power-off returned %d\n",
327 call_rtas("power-off", 2, 1, NULL,0xffffffff,0xffffffff));
328 for (;;);
329}
330
331void
332chrp_halt(void)
333{
334 chrp_power_off();
335}
336
337/*
338 * Finds the open-pic node and sets OpenPIC_Addr based on its reg property.
339 * Then checks if it has an interrupt-ranges property. If it does then
340 * we have a distributed open-pic, so call openpic_set_sources to tell
341 * the openpic code where to find the interrupt source registers.
342 */
343static void __init chrp_find_openpic(void)
344{
345 struct device_node *np;
346 int len, i;
347 unsigned int *iranges;
348 void __iomem *isu;
349
350 np = find_type_devices("open-pic");
351 if (np == NULL || np->n_addrs == 0)
352 return;
353 printk(KERN_INFO "OpenPIC at %x (size %x)\n",
354 np->addrs[0].address, np->addrs[0].size);
355 OpenPIC_Addr = ioremap(np->addrs[0].address, 0x40000);
356 if (OpenPIC_Addr == NULL) {
357 printk(KERN_ERR "Failed to map OpenPIC!\n");
358 return;
359 }
360
361 iranges = (unsigned int *) get_property(np, "interrupt-ranges", &len);
362 if (iranges == NULL || len < 2 * sizeof(unsigned int))
363 return; /* not distributed */
364
365 /*
366 * The first pair of cells in interrupt-ranges refers to the
367 * IDU; subsequent pairs refer to the ISUs.
368 */
369 len /= 2 * sizeof(unsigned int);
370 if (np->n_addrs < len) {
371 printk(KERN_ERR "Insufficient addresses for distributed"
372 " OpenPIC (%d < %d)\n", np->n_addrs, len);
373 return;
374 }
375 if (iranges[1] != 0) {
376 printk(KERN_INFO "OpenPIC irqs %d..%d in IDU\n",
377 iranges[0], iranges[0] + iranges[1] - 1);
378 openpic_set_sources(iranges[0], iranges[1], NULL);
379 }
380 for (i = 1; i < len; ++i) {
381 iranges += 2;
382 printk(KERN_INFO "OpenPIC irqs %d..%d in ISU at %x (%x)\n",
383 iranges[0], iranges[0] + iranges[1] - 1,
384 np->addrs[i].address, np->addrs[i].size);
385 isu = ioremap(np->addrs[i].address, np->addrs[i].size);
386 if (isu != NULL)
387 openpic_set_sources(iranges[0], iranges[1], isu);
388 else
389 printk(KERN_ERR "Failed to map OpenPIC ISU at %x!\n",
390 np->addrs[i].address);
391 }
392}
393
394#if defined(CONFIG_VT) && defined(CONFIG_INPUT_ADBHID) && defined(XMON)
395static struct irqaction xmon_irqaction = {
396 .handler = xmon_irq,
397 .mask = CPU_MASK_NONE,
398 .name = "XMON break",
399};
400#endif
401
402void __init chrp_init_IRQ(void)
403{
404 struct device_node *np;
405 unsigned long chrp_int_ack = 0;
406 unsigned char init_senses[NR_IRQS - NUM_8259_INTERRUPTS];
407#if defined(CONFIG_VT) && defined(CONFIG_INPUT_ADBHID) && defined(XMON)
408 struct device_node *kbd;
409#endif
410
411 for (np = find_devices("pci"); np != NULL; np = np->next) {
412 unsigned int *addrp = (unsigned int *)
413 get_property(np, "8259-interrupt-acknowledge", NULL);
414
415 if (addrp == NULL)
416 continue;
417 chrp_int_ack = addrp[prom_n_addr_cells(np)-1];
418 break;
419 }
420 if (np == NULL)
421 printk(KERN_ERR "Cannot find PCI interrupt acknowledge address\n");
422
423 chrp_find_openpic();
424
425 if (OpenPIC_Addr) {
426 prom_get_irq_senses(init_senses, NUM_8259_INTERRUPTS, NR_IRQS);
427 OpenPIC_InitSenses = init_senses;
428 OpenPIC_NumInitSenses = NR_IRQS - NUM_8259_INTERRUPTS;
429
430 openpic_init(NUM_8259_INTERRUPTS);
431 /* We have a cascade on OpenPIC IRQ 0, Linux IRQ 16 */
432 openpic_hookup_cascade(NUM_8259_INTERRUPTS, "82c59 cascade",
433 i8259_irq);
434
435 }
436 i8259_init(chrp_int_ack, 0);
437
438#if defined(CONFIG_VT) && defined(CONFIG_INPUT_ADBHID) && defined(XMON)
439 /* see if there is a keyboard in the device tree
440 with a parent of type "adb" */
441 for (kbd = find_devices("keyboard"); kbd; kbd = kbd->next)
442 if (kbd->parent && kbd->parent->type
443 && strcmp(kbd->parent->type, "adb") == 0)
444 break;
445 if (kbd)
446 setup_irq(HYDRA_INT_ADB_NMI, &xmon_irqaction);
447#endif
448}
449
450void __init
451chrp_init2(void)
452{
453#ifdef CONFIG_NVRAM
454 chrp_nvram_init();
455#endif
456
457 request_region(0x20,0x20,"pic1");
458 request_region(0xa0,0x20,"pic2");
459 request_region(0x00,0x20,"dma1");
460 request_region(0x40,0x20,"timer");
461 request_region(0x80,0x10,"dma page reg");
462 request_region(0xc0,0x20,"dma2");
463
464 if (ppc_md.progress)
465 ppc_md.progress(" Have fun! ", 0x7777);
466}
467
468static struct device_node *memory_node;
469
470static int __init get_mem_prop(char *name, struct mem_pieces *mp)
471{
472 struct reg_property *rp;
473 int i, s;
474 unsigned int *ip;
475 int nac = prom_n_addr_cells(memory_node);
476 int nsc = prom_n_size_cells(memory_node);
477
478 ip = (unsigned int *) get_property(memory_node, name, &s);
479 if (ip == NULL) {
480 printk(KERN_ERR "error: couldn't get %s property on /memory\n",
481 name);
482 return 0;
483 }
484 s /= (nsc + nac) * 4;
485 rp = mp->regions;
486 for (i = 0; i < s; ++i, ip += nac+nsc) {
487 if (nac >= 2 && ip[nac-2] != 0)
488 continue;
489 rp->address = ip[nac-1];
490 if (nsc >= 2 && ip[nac+nsc-2] != 0)
491 rp->size = ~0U;
492 else
493 rp->size = ip[nac+nsc-1];
494 ++rp;
495 }
496 mp->n_regions = rp - mp->regions;
497
498 /* Make sure the pieces are sorted. */
499 mem_pieces_sort(mp);
500 mem_pieces_coalesce(mp);
501 return 1;
502}
503
504static unsigned long __init chrp_find_end_of_memory(void)
505{
506 unsigned long a, total;
507 struct mem_pieces phys_mem;
508
509 /*
510 * Find out where physical memory is, and check that it
511 * starts at 0 and is contiguous. It seems that RAM is
512 * always physically contiguous on Power Macintoshes.
513 *
514 * Supporting discontiguous physical memory isn't hard,
515 * it just makes the virtual <-> physical mapping functions
516 * more complicated (or else you end up wasting space
517 * in mem_map).
518 */
519 memory_node = find_devices("memory");
520 if (memory_node == NULL || !get_mem_prop("reg", &phys_mem)
521 || phys_mem.n_regions == 0)
522 panic("No RAM??");
523 a = phys_mem.regions[0].address;
524 if (a != 0)
525 panic("RAM doesn't start at physical address 0");
526 total = phys_mem.regions[0].size;
527
528 if (phys_mem.n_regions > 1) {
529 printk("RAM starting at 0x%x is not contiguous\n",
530 phys_mem.regions[1].address);
531 printk("Using RAM from 0 to 0x%lx\n", total-1);
532 }
533
534 return total;
535}
536
537void __init
538chrp_init(unsigned long r3, unsigned long r4, unsigned long r5,
539 unsigned long r6, unsigned long r7)
540{
541 struct device_node *root = find_path_device ("/");
542 char *machine = NULL;
543
544#ifdef CONFIG_BLK_DEV_INITRD
545 /* take care of initrd if we have one */
546 if ( r6 )
547 {
548 initrd_start = r6 + KERNELBASE;
549 initrd_end = r6 + r7 + KERNELBASE;
550 }
551#endif /* CONFIG_BLK_DEV_INITRD */
552
553 ISA_DMA_THRESHOLD = ~0L;
554 DMA_MODE_READ = 0x44;
555 DMA_MODE_WRITE = 0x48;
556 isa_io_base = CHRP_ISA_IO_BASE; /* default value */
557 ppc_do_canonicalize_irqs = 1;
558
559 if (root)
560 machine = get_property(root, "model", NULL);
561 if (machine && strncmp(machine, "Pegasos", 7) == 0) {
562 _chrp_type = _CHRP_Pegasos;
563 } else if (machine && strncmp(machine, "IBM", 3) == 0) {
564 _chrp_type = _CHRP_IBM;
565 } else if (machine && strncmp(machine, "MOT", 3) == 0) {
566 _chrp_type = _CHRP_Motorola;
567 } else {
568 /* Let's assume it is an IBM chrp if all else fails */
569 _chrp_type = _CHRP_IBM;
570 }
571
572 ppc_md.setup_arch = chrp_setup_arch;
573 ppc_md.show_percpuinfo = of_show_percpuinfo;
574 ppc_md.show_cpuinfo = chrp_show_cpuinfo;
575
576 ppc_md.init_IRQ = chrp_init_IRQ;
577 if (_chrp_type == _CHRP_Pegasos)
578 ppc_md.get_irq = i8259_irq;
579 else
580 ppc_md.get_irq = openpic_get_irq;
581
582 ppc_md.init = chrp_init2;
583
584 ppc_md.phys_mem_access_prot = pci_phys_mem_access_prot;
585
586 ppc_md.restart = chrp_restart;
587 ppc_md.power_off = chrp_power_off;
588 ppc_md.halt = chrp_halt;
589
590 ppc_md.time_init = chrp_time_init;
591 ppc_md.set_rtc_time = chrp_set_rtc_time;
592 ppc_md.get_rtc_time = chrp_get_rtc_time;
593 ppc_md.calibrate_decr = chrp_calibrate_decr;
594
595 ppc_md.find_end_of_memory = chrp_find_end_of_memory;
596
597 if (rtas_data) {
598 struct device_node *rtas;
599 unsigned int *p;
600
601 rtas = find_devices("rtas");
602 if (rtas != NULL) {
603 if (get_property(rtas, "display-character", NULL)) {
604 ppc_md.progress = rtas_display_progress;
605 p = (unsigned int *) get_property
606 (rtas, "ibm,display-line-length", NULL);
607 if (p)
608 max_width = *p;
609 } else if (get_property(rtas, "set-indicator", NULL))
610 ppc_md.progress = rtas_indicator_progress;
611 }
612 }
613#ifdef CONFIG_BOOTX_TEXT
614 if (ppc_md.progress == NULL && boot_text_mapped)
615 ppc_md.progress = btext_progress;
616#endif
617
618#ifdef CONFIG_SMP
619 smp_ops = &chrp_smp_ops;
620#endif /* CONFIG_SMP */
621
622 /*
623 * Print the banner, then scroll down so boot progress
624 * can be printed. -- Cort
625 */
626 if (ppc_md.progress) ppc_md.progress("Linux/PPC "UTS_RELEASE"\n", 0x0);
627}
628
629void
630rtas_display_progress(char *s, unsigned short hex)
631{
632 int width;
633 char *os = s;
634
635 if ( call_rtas( "display-character", 1, 1, NULL, '\r' ) )
636 return;
637
638 width = max_width;
639 while ( *os )
640 {
641 if ( (*os == '\n') || (*os == '\r') )
642 width = max_width;
643 else
644 width--;
645 call_rtas( "display-character", 1, 1, NULL, *os++ );
646 /* if we overwrite the screen length */
647 if ( width == 0 )
648 while ( (*os != 0) && (*os != '\n') && (*os != '\r') )
649 os++;
650 }
651
652 /*while ( width-- > 0 )*/
653 call_rtas( "display-character", 1, 1, NULL, ' ' );
654}
655
656void
657rtas_indicator_progress(char *s, unsigned short hex)
658{
659 call_rtas("set-indicator", 3, 1, NULL, 6, 0, hex);
660}
661
662#ifdef CONFIG_BOOTX_TEXT
663void
664btext_progress(char *s, unsigned short hex)
665{
666 prom_print(s);
667 prom_print("\n");
668}
669#endif /* CONFIG_BOOTX_TEXT */
diff --git a/arch/ppc/platforms/chrp_smp.c b/arch/ppc/platforms/chrp_smp.c
deleted file mode 100644
index 97e539557ecb..000000000000
--- a/arch/ppc/platforms/chrp_smp.c
+++ /dev/null
@@ -1,99 +0,0 @@
1/*
2 * Smp support for CHRP machines.
3 *
4 * Written by Cort Dougan (cort@cs.nmt.edu) borrowing a great
5 * deal of code from the sparc and intel versions.
6 *
7 * Copyright (C) 1999 Cort Dougan <cort@cs.nmt.edu>
8 *
9 */
10
11#include <linux/config.h>
12#include <linux/kernel.h>
13#include <linux/sched.h>
14#include <linux/smp.h>
15#include <linux/smp_lock.h>
16#include <linux/interrupt.h>
17#include <linux/kernel_stat.h>
18#include <linux/delay.h>
19#include <linux/init.h>
20#include <linux/spinlock.h>
21
22#include <asm/ptrace.h>
23#include <asm/atomic.h>
24#include <asm/irq.h>
25#include <asm/page.h>
26#include <asm/pgtable.h>
27#include <asm/sections.h>
28#include <asm/io.h>
29#include <asm/prom.h>
30#include <asm/smp.h>
31#include <asm/residual.h>
32#include <asm/time.h>
33#include <asm/open_pic.h>
34#include <asm/machdep.h>
35
36extern unsigned long smp_chrp_cpu_nr;
37
38static int __init
39smp_chrp_probe(void)
40{
41 if (smp_chrp_cpu_nr > 1)
42 openpic_request_IPIs();
43
44 return smp_chrp_cpu_nr;
45}
46
47static void __devinit
48smp_chrp_kick_cpu(int nr)
49{
50 *(unsigned long *)KERNELBASE = nr;
51 asm volatile("dcbf 0,%0"::"r"(KERNELBASE):"memory");
52}
53
54static void __devinit
55smp_chrp_setup_cpu(int cpu_nr)
56{
57 if (OpenPIC_Addr)
58 do_openpic_setup_cpu();
59}
60
61static DEFINE_SPINLOCK(timebase_lock);
62static unsigned int timebase_upper = 0, timebase_lower = 0;
63
64void __devinit
65smp_chrp_give_timebase(void)
66{
67 spin_lock(&timebase_lock);
68 call_rtas("freeze-time-base", 0, 1, NULL);
69 timebase_upper = get_tbu();
70 timebase_lower = get_tbl();
71 spin_unlock(&timebase_lock);
72
73 while (timebase_upper || timebase_lower)
74 barrier();
75 call_rtas("thaw-time-base", 0, 1, NULL);
76}
77
78void __devinit
79smp_chrp_take_timebase(void)
80{
81 while (!(timebase_upper || timebase_lower))
82 barrier();
83 spin_lock(&timebase_lock);
84 set_tb(timebase_upper, timebase_lower);
85 timebase_upper = 0;
86 timebase_lower = 0;
87 spin_unlock(&timebase_lock);
88 printk("CPU %i taken timebase\n", smp_processor_id());
89}
90
91/* CHRP with openpic */
92struct smp_ops_t chrp_smp_ops = {
93 .message_pass = smp_openpic_message_pass,
94 .probe = smp_chrp_probe,
95 .kick_cpu = smp_chrp_kick_cpu,
96 .setup_cpu = smp_chrp_setup_cpu,
97 .give_timebase = smp_chrp_give_timebase,
98 .take_timebase = smp_chrp_take_timebase,
99};
diff --git a/arch/ppc/platforms/chrp_time.c b/arch/ppc/platforms/chrp_time.c
deleted file mode 100644
index c8627770af13..000000000000
--- a/arch/ppc/platforms/chrp_time.c
+++ /dev/null
@@ -1,251 +0,0 @@
1/*
2 * Copyright (C) 1991, 1992, 1995 Linus Torvalds
3 *
4 * Adapted for PowerPC (PReP) by Gary Thomas
5 * Modified by Cort Dougan (cort@cs.nmt.edu).
6 * Copied and modified from arch/i386/kernel/time.c
7 *
8 */
9#include <linux/errno.h>
10#include <linux/sched.h>
11#include <linux/kernel.h>
12#include <linux/param.h>
13#include <linux/string.h>
14#include <linux/mm.h>
15#include <linux/interrupt.h>
16#include <linux/time.h>
17#include <linux/timex.h>
18#include <linux/kernel_stat.h>
19#include <linux/mc146818rtc.h>
20#include <linux/init.h>
21#include <linux/bcd.h>
22
23#include <asm/io.h>
24#include <asm/nvram.h>
25#include <asm/prom.h>
26#include <asm/sections.h>
27#include <asm/time.h>
28
29extern spinlock_t rtc_lock;
30
31static int nvram_as1 = NVRAM_AS1;
32static int nvram_as0 = NVRAM_AS0;
33static int nvram_data = NVRAM_DATA;
34
35long __init chrp_time_init(void)
36{
37 struct device_node *rtcs;
38 int base;
39
40 rtcs = find_compatible_devices("rtc", "pnpPNP,b00");
41 if (rtcs == NULL)
42 rtcs = find_compatible_devices("rtc", "ds1385-rtc");
43 if (rtcs == NULL || rtcs->addrs == NULL)
44 return 0;
45 base = rtcs->addrs[0].address;
46 nvram_as1 = 0;
47 nvram_as0 = base;
48 nvram_data = base + 1;
49
50 return 0;
51}
52
53int chrp_cmos_clock_read(int addr)
54{
55 if (nvram_as1 != 0)
56 outb(addr>>8, nvram_as1);
57 outb(addr, nvram_as0);
58 return (inb(nvram_data));
59}
60
61void chrp_cmos_clock_write(unsigned long val, int addr)
62{
63 if (nvram_as1 != 0)
64 outb(addr>>8, nvram_as1);
65 outb(addr, nvram_as0);
66 outb(val, nvram_data);
67 return;
68}
69
70/*
71 * Set the hardware clock. -- Cort
72 */
73int chrp_set_rtc_time(unsigned long nowtime)
74{
75 unsigned char save_control, save_freq_select;
76 struct rtc_time tm;
77
78 spin_lock(&rtc_lock);
79 to_tm(nowtime, &tm);
80
81 save_control = chrp_cmos_clock_read(RTC_CONTROL); /* tell the clock it's being set */
82
83 chrp_cmos_clock_write((save_control|RTC_SET), RTC_CONTROL);
84
85 save_freq_select = chrp_cmos_clock_read(RTC_FREQ_SELECT); /* stop and reset prescaler */
86
87 chrp_cmos_clock_write((save_freq_select|RTC_DIV_RESET2), RTC_FREQ_SELECT);
88
89 tm.tm_year -= 1900;
90 if (!(save_control & RTC_DM_BINARY) || RTC_ALWAYS_BCD) {
91 BIN_TO_BCD(tm.tm_sec);
92 BIN_TO_BCD(tm.tm_min);
93 BIN_TO_BCD(tm.tm_hour);
94 BIN_TO_BCD(tm.tm_mon);
95 BIN_TO_BCD(tm.tm_mday);
96 BIN_TO_BCD(tm.tm_year);
97 }
98 chrp_cmos_clock_write(tm.tm_sec,RTC_SECONDS);
99 chrp_cmos_clock_write(tm.tm_min,RTC_MINUTES);
100 chrp_cmos_clock_write(tm.tm_hour,RTC_HOURS);
101 chrp_cmos_clock_write(tm.tm_mon,RTC_MONTH);
102 chrp_cmos_clock_write(tm.tm_mday,RTC_DAY_OF_MONTH);
103 chrp_cmos_clock_write(tm.tm_year,RTC_YEAR);
104
105 /* The following flags have to be released exactly in this order,
106 * otherwise the DS12887 (popular MC146818A clone with integrated
107 * battery and quartz) will not reset the oscillator and will not
108 * update precisely 500 ms later. You won't find this mentioned in
109 * the Dallas Semiconductor data sheets, but who believes data
110 * sheets anyway ... -- Markus Kuhn
111 */
112 chrp_cmos_clock_write(save_control, RTC_CONTROL);
113 chrp_cmos_clock_write(save_freq_select, RTC_FREQ_SELECT);
114
115 spin_unlock(&rtc_lock);
116 return 0;
117}
118
119unsigned long chrp_get_rtc_time(void)
120{
121 unsigned int year, mon, day, hour, min, sec;
122 int uip, i;
123
124 /* The Linux interpretation of the CMOS clock register contents:
125 * When the Update-In-Progress (UIP) flag goes from 1 to 0, the
126 * RTC registers show the second which has precisely just started.
127 * Let's hope other operating systems interpret the RTC the same way.
128 */
129
130 /* Since the UIP flag is set for about 2.2 ms and the clock
131 * is typically written with a precision of 1 jiffy, trying
132 * to obtain a precision better than a few milliseconds is
133 * an illusion. Only consistency is interesting, this also
134 * allows to use the routine for /dev/rtc without a potential
135 * 1 second kernel busy loop triggered by any reader of /dev/rtc.
136 */
137
138 for ( i = 0; i<1000000; i++) {
139 uip = chrp_cmos_clock_read(RTC_FREQ_SELECT);
140 sec = chrp_cmos_clock_read(RTC_SECONDS);
141 min = chrp_cmos_clock_read(RTC_MINUTES);
142 hour = chrp_cmos_clock_read(RTC_HOURS);
143 day = chrp_cmos_clock_read(RTC_DAY_OF_MONTH);
144 mon = chrp_cmos_clock_read(RTC_MONTH);
145 year = chrp_cmos_clock_read(RTC_YEAR);
146 uip |= chrp_cmos_clock_read(RTC_FREQ_SELECT);
147 if ((uip & RTC_UIP)==0) break;
148 }
149
150 if (!(chrp_cmos_clock_read(RTC_CONTROL) & RTC_DM_BINARY) || RTC_ALWAYS_BCD)
151 {
152 BCD_TO_BIN(sec);
153 BCD_TO_BIN(min);
154 BCD_TO_BIN(hour);
155 BCD_TO_BIN(day);
156 BCD_TO_BIN(mon);
157 BCD_TO_BIN(year);
158 }
159 if ((year += 1900) < 1970)
160 year += 100;
161 return mktime(year, mon, day, hour, min, sec);
162}
163
164/*
165 * Calibrate the decrementer frequency with the VIA timer 1.
166 */
167#define VIA_TIMER_FREQ_6 4700000 /* time 1 frequency * 6 */
168
169/* VIA registers */
170#define RS 0x200 /* skip between registers */
171#define T1CL (4*RS) /* Timer 1 ctr/latch (low 8 bits) */
172#define T1CH (5*RS) /* Timer 1 counter (high 8 bits) */
173#define T1LL (6*RS) /* Timer 1 latch (low 8 bits) */
174#define T1LH (7*RS) /* Timer 1 latch (high 8 bits) */
175#define ACR (11*RS) /* Auxiliary control register */
176#define IFR (13*RS) /* Interrupt flag register */
177
178/* Bits in ACR */
179#define T1MODE 0xc0 /* Timer 1 mode */
180#define T1MODE_CONT 0x40 /* continuous interrupts */
181
182/* Bits in IFR and IER */
183#define T1_INT 0x40 /* Timer 1 interrupt */
184
185static int __init chrp_via_calibrate_decr(void)
186{
187 struct device_node *vias;
188 volatile unsigned char __iomem *via;
189 int count = VIA_TIMER_FREQ_6 / 100;
190 unsigned int dstart, dend;
191
192 vias = find_devices("via-cuda");
193 if (vias == 0)
194 vias = find_devices("via");
195 if (vias == 0 || vias->n_addrs == 0)
196 return 0;
197 via = ioremap(vias->addrs[0].address, vias->addrs[0].size);
198
199 /* set timer 1 for continuous interrupts */
200 out_8(&via[ACR], (via[ACR] & ~T1MODE) | T1MODE_CONT);
201 /* set the counter to a small value */
202 out_8(&via[T1CH], 2);
203 /* set the latch to `count' */
204 out_8(&via[T1LL], count);
205 out_8(&via[T1LH], count >> 8);
206 /* wait until it hits 0 */
207 while ((in_8(&via[IFR]) & T1_INT) == 0)
208 ;
209 dstart = get_dec();
210 /* clear the interrupt & wait until it hits 0 again */
211 in_8(&via[T1CL]);
212 while ((in_8(&via[IFR]) & T1_INT) == 0)
213 ;
214 dend = get_dec();
215
216 tb_ticks_per_jiffy = (dstart - dend) / ((6 * HZ)/100);
217 tb_to_us = mulhwu_scale_factor(dstart - dend, 60000);
218
219 printk(KERN_INFO "via_calibrate_decr: ticks per jiffy = %u (%u ticks)\n",
220 tb_ticks_per_jiffy, dstart - dend);
221
222 iounmap(via);
223
224 return 1;
225}
226
227void __init chrp_calibrate_decr(void)
228{
229 struct device_node *cpu;
230 unsigned int freq, *fp;
231
232 if (chrp_via_calibrate_decr())
233 return;
234
235 /*
236 * The cpu node should have a timebase-frequency property
237 * to tell us the rate at which the decrementer counts.
238 */
239 freq = 16666000; /* hardcoded default */
240 cpu = find_type_devices("cpu");
241 if (cpu != 0) {
242 fp = (unsigned int *)
243 get_property(cpu, "timebase-frequency", NULL);
244 if (fp != 0)
245 freq = *fp;
246 }
247 printk("time_init: decrementer frequency = %u.%.6u MHz\n",
248 freq/1000000, freq%1000000);
249 tb_ticks_per_jiffy = freq / HZ;
250 tb_to_us = mulhwu_scale_factor(freq, 1000000);
251}
diff --git a/arch/ppc/syslib/Makefile b/arch/ppc/syslib/Makefile
index 5cb62c6a51c8..490749ca88f9 100644
--- a/arch/ppc/syslib/Makefile
+++ b/arch/ppc/syslib/Makefile
@@ -38,8 +38,6 @@ endif
38obj-$(CONFIG_8xx) += m8xx_setup.o ppc8xx_pic.o $(wdt-mpc8xx-y) \ 38obj-$(CONFIG_8xx) += m8xx_setup.o ppc8xx_pic.o $(wdt-mpc8xx-y) \
39 ppc_sys.o mpc8xx_devices.o mpc8xx_sys.o 39 ppc_sys.o mpc8xx_devices.o mpc8xx_sys.o
40obj-$(CONFIG_PCI_QSPAN) += qspan_pci.o 40obj-$(CONFIG_PCI_QSPAN) += qspan_pci.o
41obj-$(CONFIG_PPC_OF) += prom_init.o prom.o
42obj-$(CONFIG_PPC_CHRP) += open_pic.o
43obj-$(CONFIG_PPC_PREP) += open_pic.o todc_time.o 41obj-$(CONFIG_PPC_PREP) += open_pic.o todc_time.o
44obj-$(CONFIG_BAMBOO) += pci_auto.o todc_time.o 42obj-$(CONFIG_BAMBOO) += pci_auto.o todc_time.o
45obj-$(CONFIG_CPCI690) += todc_time.o pci_auto.o 43obj-$(CONFIG_CPCI690) += todc_time.o pci_auto.o
diff --git a/arch/ppc/syslib/open_pic.c b/arch/ppc/syslib/open_pic.c
index 38e5b93fbe41..70456c8f998c 100644
--- a/arch/ppc/syslib/open_pic.c
+++ b/arch/ppc/syslib/open_pic.c
@@ -216,7 +216,7 @@ static void openpic_safe_writefield(volatile u_int __iomem *addr, u_int mask,
216u_int openpic_read_IPI(volatile u_int __iomem * addr) 216u_int openpic_read_IPI(volatile u_int __iomem * addr)
217{ 217{
218 u_int val = 0; 218 u_int val = 0;
219#if defined(OPENPIC_BIG_ENDIAN) || defined(CONFIG_POWER3) 219#if defined(OPENPIC_BIG_ENDIAN)
220 val = in_be32(addr); 220 val = in_be32(addr);
221#else 221#else
222 val = in_le32(addr); 222 val = in_le32(addr);
diff --git a/arch/ppc/syslib/prom.c b/arch/ppc/syslib/prom.c
deleted file mode 100644
index 482f837fd373..000000000000
--- a/arch/ppc/syslib/prom.c
+++ /dev/null
@@ -1,1429 +0,0 @@
1/*
2 * Procedures for interfacing to the Open Firmware PROM on
3 * Power Macintosh computers.
4 *
5 * In particular, we are interested in the device tree
6 * and in using some of its services (exit, write to stdout).
7 *
8 * Paul Mackerras August 1996.
9 * Copyright (C) 1996 Paul Mackerras.
10 */
11#include <stdarg.h>
12#include <linux/config.h>
13#include <linux/kernel.h>
14#include <linux/string.h>
15#include <linux/init.h>
16#include <linux/threads.h>
17#include <linux/spinlock.h>
18#include <linux/ioport.h>
19#include <linux/pci.h>
20#include <linux/slab.h>
21#include <linux/bitops.h>
22
23#include <asm/sections.h>
24#include <asm/prom.h>
25#include <asm/page.h>
26#include <asm/processor.h>
27#include <asm/irq.h>
28#include <asm/io.h>
29#include <asm/smp.h>
30#include <asm/bootx.h>
31#include <asm/system.h>
32#include <asm/mmu.h>
33#include <asm/pgtable.h>
34#include <asm/bootinfo.h>
35#include <asm/btext.h>
36#include <asm/pci-bridge.h>
37#include <asm/open_pic.h>
38
39
40struct pci_address {
41 unsigned a_hi;
42 unsigned a_mid;
43 unsigned a_lo;
44};
45
46struct pci_reg_property {
47 struct pci_address addr;
48 unsigned size_hi;
49 unsigned size_lo;
50};
51
52struct isa_reg_property {
53 unsigned space;
54 unsigned address;
55 unsigned size;
56};
57
58typedef unsigned long interpret_func(struct device_node *, unsigned long,
59 int, int);
60static interpret_func interpret_pci_props;
61static interpret_func interpret_dbdma_props;
62static interpret_func interpret_isa_props;
63static interpret_func interpret_macio_props;
64static interpret_func interpret_root_props;
65
66extern char *klimit;
67
68/* Set for a newworld or CHRP machine */
69int use_of_interrupt_tree;
70struct device_node *dflt_interrupt_controller;
71int num_interrupt_controllers;
72
73extern unsigned int rtas_entry; /* physical pointer */
74
75extern struct device_node *allnodes;
76
77static unsigned long finish_node(struct device_node *, unsigned long,
78 interpret_func *, int, int);
79static unsigned long finish_node_interrupts(struct device_node *, unsigned long);
80static struct device_node *find_phandle(phandle);
81
82extern void enter_rtas(void *);
83void phys_call_rtas(int, int, int, ...);
84
85extern char cmd_line[512]; /* XXX */
86extern boot_infos_t *boot_infos;
87unsigned long dev_tree_size;
88
89void
90phys_call_rtas(int service, int nargs, int nret, ...)
91{
92 va_list list;
93 union {
94 unsigned long words[16];
95 double align;
96 } u;
97 void (*rtas)(void *, unsigned long);
98 int i;
99
100 u.words[0] = service;
101 u.words[1] = nargs;
102 u.words[2] = nret;
103 va_start(list, nret);
104 for (i = 0; i < nargs; ++i)
105 u.words[i+3] = va_arg(list, unsigned long);
106 va_end(list);
107
108 rtas = (void (*)(void *, unsigned long)) rtas_entry;
109 rtas(&u, rtas_data);
110}
111
112/*
113 * finish_device_tree is called once things are running normally
114 * (i.e. with text and data mapped to the address they were linked at).
115 * It traverses the device tree and fills in the name, type,
116 * {n_}addrs and {n_}intrs fields of each node.
117 */
118void __init
119finish_device_tree(void)
120{
121 unsigned long mem = (unsigned long) klimit;
122 struct device_node *np;
123
124 /* All CHRPs now use the interrupt tree */
125 for (np = allnodes; np != NULL; np = np->allnext) {
126 if (get_property(np, "interrupt-parent", NULL)) {
127 use_of_interrupt_tree = 1;
128 break;
129 }
130 }
131
132 if (use_of_interrupt_tree) {
133 /*
134 * We want to find out here how many interrupt-controller
135 * nodes there are, and if we are booted from BootX,
136 * we need a pointer to the first (and hopefully only)
137 * such node. But we can't use find_devices here since
138 * np->name has not been set yet. -- paulus
139 */
140 int n = 0;
141 char *name, *ic;
142 int iclen;
143
144 for (np = allnodes; np != NULL; np = np->allnext) {
145 ic = get_property(np, "interrupt-controller", &iclen);
146 name = get_property(np, "name", NULL);
147 /* checking iclen makes sure we don't get a false
148 match on /chosen.interrupt_controller */
149 if ((name != NULL
150 && strcmp(name, "interrupt-controller") == 0)
151 || (ic != NULL && iclen == 0 && strcmp(name, "AppleKiwi"))) {
152 if (n == 0)
153 dflt_interrupt_controller = np;
154 ++n;
155 }
156 }
157 num_interrupt_controllers = n;
158 }
159
160 mem = finish_node(allnodes, mem, NULL, 1, 1);
161 dev_tree_size = mem - (unsigned long) allnodes;
162 klimit = (char *) mem;
163}
164
165static unsigned long __init
166finish_node(struct device_node *np, unsigned long mem_start,
167 interpret_func *ifunc, int naddrc, int nsizec)
168{
169 struct device_node *child;
170 int *ip;
171
172 np->name = get_property(np, "name", NULL);
173 np->type = get_property(np, "device_type", NULL);
174
175 if (!np->name)
176 np->name = "<NULL>";
177 if (!np->type)
178 np->type = "<NULL>";
179
180 /* get the device addresses and interrupts */
181 if (ifunc != NULL)
182 mem_start = ifunc(np, mem_start, naddrc, nsizec);
183
184 if (use_of_interrupt_tree)
185 mem_start = finish_node_interrupts(np, mem_start);
186
187 /* Look for #address-cells and #size-cells properties. */
188 ip = (int *) get_property(np, "#address-cells", NULL);
189 if (ip != NULL)
190 naddrc = *ip;
191 ip = (int *) get_property(np, "#size-cells", NULL);
192 if (ip != NULL)
193 nsizec = *ip;
194
195 if (np->parent == NULL)
196 ifunc = interpret_root_props;
197 else if (np->type == 0)
198 ifunc = NULL;
199 else if (!strcmp(np->type, "pci") || !strcmp(np->type, "vci"))
200 ifunc = interpret_pci_props;
201 else if (!strcmp(np->type, "dbdma"))
202 ifunc = interpret_dbdma_props;
203 else if (!strcmp(np->type, "mac-io")
204 || ifunc == interpret_macio_props)
205 ifunc = interpret_macio_props;
206 else if (!strcmp(np->type, "isa"))
207 ifunc = interpret_isa_props;
208 else if (!strcmp(np->name, "uni-n") || !strcmp(np->name, "u3"))
209 ifunc = interpret_root_props;
210 else if (!((ifunc == interpret_dbdma_props
211 || ifunc == interpret_macio_props)
212 && (!strcmp(np->type, "escc")
213 || !strcmp(np->type, "media-bay"))))
214 ifunc = NULL;
215
216 /* if we were booted from BootX, convert the full name */
217 if (boot_infos
218 && strncmp(np->full_name, "Devices:device-tree", 19) == 0) {
219 if (np->full_name[19] == 0) {
220 strcpy(np->full_name, "/");
221 } else if (np->full_name[19] == ':') {
222 char *p = np->full_name + 19;
223 np->full_name = p;
224 for (; *p; ++p)
225 if (*p == ':')
226 *p = '/';
227 }
228 }
229
230 for (child = np->child; child != NULL; child = child->sibling)
231 mem_start = finish_node(child, mem_start, ifunc,
232 naddrc, nsizec);
233
234 return mem_start;
235}
236
237/*
238 * Find the interrupt parent of a node.
239 */
240static struct device_node * __init
241intr_parent(struct device_node *p)
242{
243 phandle *parp;
244
245 parp = (phandle *) get_property(p, "interrupt-parent", NULL);
246 if (parp == NULL)
247 return p->parent;
248 p = find_phandle(*parp);
249 if (p != NULL)
250 return p;
251 /*
252 * On a powermac booted with BootX, we don't get to know the
253 * phandles for any nodes, so find_phandle will return NULL.
254 * Fortunately these machines only have one interrupt controller
255 * so there isn't in fact any ambiguity. -- paulus
256 */
257 if (num_interrupt_controllers == 1)
258 p = dflt_interrupt_controller;
259 return p;
260}
261
262/*
263 * Find out the size of each entry of the interrupts property
264 * for a node.
265 */
266static int __init
267prom_n_intr_cells(struct device_node *np)
268{
269 struct device_node *p;
270 unsigned int *icp;
271
272 for (p = np; (p = intr_parent(p)) != NULL; ) {
273 icp = (unsigned int *)
274 get_property(p, "#interrupt-cells", NULL);
275 if (icp != NULL)
276 return *icp;
277 if (get_property(p, "interrupt-controller", NULL) != NULL
278 || get_property(p, "interrupt-map", NULL) != NULL) {
279 printk("oops, node %s doesn't have #interrupt-cells\n",
280 p->full_name);
281 return 1;
282 }
283 }
284 printk("prom_n_intr_cells failed for %s\n", np->full_name);
285 return 1;
286}
287
288/*
289 * Map an interrupt from a device up to the platform interrupt
290 * descriptor.
291 */
292static int __init
293map_interrupt(unsigned int **irq, struct device_node **ictrler,
294 struct device_node *np, unsigned int *ints, int nintrc)
295{
296 struct device_node *p, *ipar;
297 unsigned int *imap, *imask, *ip;
298 int i, imaplen, match;
299 int newintrc = 1, newaddrc = 1;
300 unsigned int *reg;
301 int naddrc;
302
303 reg = (unsigned int *) get_property(np, "reg", NULL);
304 naddrc = prom_n_addr_cells(np);
305 p = intr_parent(np);
306 while (p != NULL) {
307 if (get_property(p, "interrupt-controller", NULL) != NULL)
308 /* this node is an interrupt controller, stop here */
309 break;
310 imap = (unsigned int *)
311 get_property(p, "interrupt-map", &imaplen);
312 if (imap == NULL) {
313 p = intr_parent(p);
314 continue;
315 }
316 imask = (unsigned int *)
317 get_property(p, "interrupt-map-mask", NULL);
318 if (imask == NULL) {
319 printk("oops, %s has interrupt-map but no mask\n",
320 p->full_name);
321 return 0;
322 }
323 imaplen /= sizeof(unsigned int);
324 match = 0;
325 ipar = NULL;
326 while (imaplen > 0 && !match) {
327 /* check the child-interrupt field */
328 match = 1;
329 for (i = 0; i < naddrc && match; ++i)
330 match = ((reg[i] ^ imap[i]) & imask[i]) == 0;
331 for (; i < naddrc + nintrc && match; ++i)
332 match = ((ints[i-naddrc] ^ imap[i]) & imask[i]) == 0;
333 imap += naddrc + nintrc;
334 imaplen -= naddrc + nintrc;
335 /* grab the interrupt parent */
336 ipar = find_phandle((phandle) *imap++);
337 --imaplen;
338 if (ipar == NULL && num_interrupt_controllers == 1)
339 /* cope with BootX not giving us phandles */
340 ipar = dflt_interrupt_controller;
341 if (ipar == NULL) {
342 printk("oops, no int parent %x in map of %s\n",
343 imap[-1], p->full_name);
344 return 0;
345 }
346 /* find the parent's # addr and intr cells */
347 ip = (unsigned int *)
348 get_property(ipar, "#interrupt-cells", NULL);
349 if (ip == NULL) {
350 printk("oops, no #interrupt-cells on %s\n",
351 ipar->full_name);
352 return 0;
353 }
354 newintrc = *ip;
355 ip = (unsigned int *)
356 get_property(ipar, "#address-cells", NULL);
357 newaddrc = (ip == NULL)? 0: *ip;
358 imap += newaddrc + newintrc;
359 imaplen -= newaddrc + newintrc;
360 }
361 if (imaplen < 0) {
362 printk("oops, error decoding int-map on %s, len=%d\n",
363 p->full_name, imaplen);
364 return 0;
365 }
366 if (!match) {
367 printk("oops, no match in %s int-map for %s\n",
368 p->full_name, np->full_name);
369 return 0;
370 }
371 p = ipar;
372 naddrc = newaddrc;
373 nintrc = newintrc;
374 ints = imap - nintrc;
375 reg = ints - naddrc;
376 }
377 if (p == NULL)
378 printk("hmmm, int tree for %s doesn't have ctrler\n",
379 np->full_name);
380 *irq = ints;
381 *ictrler = p;
382 return nintrc;
383}
384
385/*
386 * New version of finish_node_interrupts.
387 */
388static unsigned long __init
389finish_node_interrupts(struct device_node *np, unsigned long mem_start)
390{
391 unsigned int *ints;
392 int intlen, intrcells;
393 int i, j, n, offset;
394 unsigned int *irq;
395 struct device_node *ic;
396
397 ints = (unsigned int *) get_property(np, "interrupts", &intlen);
398 if (ints == NULL)
399 return mem_start;
400 intrcells = prom_n_intr_cells(np);
401 intlen /= intrcells * sizeof(unsigned int);
402 np->n_intrs = intlen;
403 np->intrs = (struct interrupt_info *) mem_start;
404 mem_start += intlen * sizeof(struct interrupt_info);
405
406 for (i = 0; i < intlen; ++i) {
407 np->intrs[i].line = 0;
408 np->intrs[i].sense = 1;
409 n = map_interrupt(&irq, &ic, np, ints, intrcells);
410 if (n <= 0)
411 continue;
412 offset = 0;
413 /*
414 * On a CHRP we have an 8259 which is subordinate to
415 * the openpic in the interrupt tree, but we want the
416 * openpic's interrupt numbers offsetted, not the 8259's.
417 * So we apply the offset if the controller is at the
418 * root of the interrupt tree, i.e. has no interrupt-parent.
419 * This doesn't cope with the general case of multiple
420 * cascaded interrupt controllers, but then neither will
421 * irq.c at the moment either. -- paulus
422 * The G5 triggers that code, I add a machine test. On
423 * those machines, we want to offset interrupts from the
424 * second openpic by 128 -- BenH
425 */
426 if (num_interrupt_controllers > 1
427 && ic != NULL
428 && get_property(ic, "interrupt-parent", NULL) == NULL)
429 offset = 16;
430
431 np->intrs[i].line = irq[0] + offset;
432 if (n > 1)
433 np->intrs[i].sense = irq[1];
434 if (n > 2) {
435 printk("hmmm, got %d intr cells for %s:", n,
436 np->full_name);
437 for (j = 0; j < n; ++j)
438 printk(" %d", irq[j]);
439 printk("\n");
440 }
441 ints += intrcells;
442 }
443
444 return mem_start;
445}
446
447/*
448 * When BootX makes a copy of the device tree from the MacOS
449 * Name Registry, it is in the format we use but all of the pointers
450 * are offsets from the start of the tree.
451 * This procedure updates the pointers.
452 */
453void __init
454relocate_nodes(void)
455{
456 unsigned long base;
457 struct device_node *np;
458 struct property *pp;
459
460#define ADDBASE(x) (x = (typeof (x))((x)? ((unsigned long)(x) + base): 0))
461
462 base = (unsigned long) boot_infos + boot_infos->deviceTreeOffset;
463 allnodes = (struct device_node *)(base + 4);
464 for (np = allnodes; np != 0; np = np->allnext) {
465 ADDBASE(np->full_name);
466 ADDBASE(np->properties);
467 ADDBASE(np->parent);
468 ADDBASE(np->child);
469 ADDBASE(np->sibling);
470 ADDBASE(np->allnext);
471 for (pp = np->properties; pp != 0; pp = pp->next) {
472 ADDBASE(pp->name);
473 ADDBASE(pp->value);
474 ADDBASE(pp->next);
475 }
476 }
477}
478
479int
480prom_n_addr_cells(struct device_node* np)
481{
482 int* ip;
483 do {
484 if (np->parent)
485 np = np->parent;
486 ip = (int *) get_property(np, "#address-cells", NULL);
487 if (ip != NULL)
488 return *ip;
489 } while (np->parent);
490 /* No #address-cells property for the root node, default to 1 */
491 return 1;
492}
493
494int
495prom_n_size_cells(struct device_node* np)
496{
497 int* ip;
498 do {
499 if (np->parent)
500 np = np->parent;
501 ip = (int *) get_property(np, "#size-cells", NULL);
502 if (ip != NULL)
503 return *ip;
504 } while (np->parent);
505 /* No #size-cells property for the root node, default to 1 */
506 return 1;
507}
508
509static unsigned long __init
510map_addr(struct device_node *np, unsigned long space, unsigned long addr)
511{
512 int na;
513 unsigned int *ranges;
514 int rlen = 0;
515 unsigned int type;
516
517 type = (space >> 24) & 3;
518 if (type == 0)
519 return addr;
520
521 while ((np = np->parent) != NULL) {
522 if (strcmp(np->type, "pci") != 0)
523 continue;
524 /* PCI bridge: map the address through the ranges property */
525 na = prom_n_addr_cells(np);
526 ranges = (unsigned int *) get_property(np, "ranges", &rlen);
527 while ((rlen -= (na + 5) * sizeof(unsigned int)) >= 0) {
528 if (((ranges[0] >> 24) & 3) == type
529 && ranges[2] <= addr
530 && addr - ranges[2] < ranges[na+4]) {
531 /* ok, this matches, translate it */
532 addr += ranges[na+2] - ranges[2];
533 break;
534 }
535 ranges += na + 5;
536 }
537 }
538 return addr;
539}
540
541static unsigned long __init
542interpret_pci_props(struct device_node *np, unsigned long mem_start,
543 int naddrc, int nsizec)
544{
545 struct address_range *adr;
546 struct pci_reg_property *pci_addrs;
547 int i, l, *ip;
548
549 pci_addrs = (struct pci_reg_property *)
550 get_property(np, "assigned-addresses", &l);
551 if (pci_addrs != 0 && l >= sizeof(struct pci_reg_property)) {
552 i = 0;
553 adr = (struct address_range *) mem_start;
554 while ((l -= sizeof(struct pci_reg_property)) >= 0) {
555 adr[i].space = pci_addrs[i].addr.a_hi;
556 adr[i].address = map_addr(np, pci_addrs[i].addr.a_hi,
557 pci_addrs[i].addr.a_lo);
558 adr[i].size = pci_addrs[i].size_lo;
559 ++i;
560 }
561 np->addrs = adr;
562 np->n_addrs = i;
563 mem_start += i * sizeof(struct address_range);
564 }
565
566 if (use_of_interrupt_tree)
567 return mem_start;
568
569 ip = (int *) get_property(np, "AAPL,interrupts", &l);
570 if (ip == 0 && np->parent)
571 ip = (int *) get_property(np->parent, "AAPL,interrupts", &l);
572 if (ip == 0)
573 ip = (int *) get_property(np, "interrupts", &l);
574 if (ip != 0) {
575 np->intrs = (struct interrupt_info *) mem_start;
576 np->n_intrs = l / sizeof(int);
577 mem_start += np->n_intrs * sizeof(struct interrupt_info);
578 for (i = 0; i < np->n_intrs; ++i) {
579 np->intrs[i].line = *ip++;
580 np->intrs[i].sense = 1;
581 }
582 }
583
584 return mem_start;
585}
586
587static unsigned long __init
588interpret_dbdma_props(struct device_node *np, unsigned long mem_start,
589 int naddrc, int nsizec)
590{
591 struct reg_property *rp;
592 struct address_range *adr;
593 unsigned long base_address;
594 int i, l, *ip;
595 struct device_node *db;
596
597 base_address = 0;
598 for (db = np->parent; db != NULL; db = db->parent) {
599 if (!strcmp(db->type, "dbdma") && db->n_addrs != 0) {
600 base_address = db->addrs[0].address;
601 break;
602 }
603 }
604
605 rp = (struct reg_property *) get_property(np, "reg", &l);
606 if (rp != 0 && l >= sizeof(struct reg_property)) {
607 i = 0;
608 adr = (struct address_range *) mem_start;
609 while ((l -= sizeof(struct reg_property)) >= 0) {
610 adr[i].space = 2;
611 adr[i].address = rp[i].address + base_address;
612 adr[i].size = rp[i].size;
613 ++i;
614 }
615 np->addrs = adr;
616 np->n_addrs = i;
617 mem_start += i * sizeof(struct address_range);
618 }
619
620 if (use_of_interrupt_tree)
621 return mem_start;
622
623 ip = (int *) get_property(np, "AAPL,interrupts", &l);
624 if (ip == 0)
625 ip = (int *) get_property(np, "interrupts", &l);
626 if (ip != 0) {
627 np->intrs = (struct interrupt_info *) mem_start;
628 np->n_intrs = l / sizeof(int);
629 mem_start += np->n_intrs * sizeof(struct interrupt_info);
630 for (i = 0; i < np->n_intrs; ++i) {
631 np->intrs[i].line = *ip++;
632 np->intrs[i].sense = 1;
633 }
634 }
635
636 return mem_start;
637}
638
639static unsigned long __init
640interpret_macio_props(struct device_node *np, unsigned long mem_start,
641 int naddrc, int nsizec)
642{
643 struct reg_property *rp;
644 struct address_range *adr;
645 unsigned long base_address;
646 int i, l, *ip;
647 struct device_node *db;
648
649 base_address = 0;
650 for (db = np->parent; db != NULL; db = db->parent) {
651 if (!strcmp(db->type, "mac-io") && db->n_addrs != 0) {
652 base_address = db->addrs[0].address;
653 break;
654 }
655 }
656
657 rp = (struct reg_property *) get_property(np, "reg", &l);
658 if (rp != 0 && l >= sizeof(struct reg_property)) {
659 i = 0;
660 adr = (struct address_range *) mem_start;
661 while ((l -= sizeof(struct reg_property)) >= 0) {
662 adr[i].space = 2;
663 adr[i].address = rp[i].address + base_address;
664 adr[i].size = rp[i].size;
665 ++i;
666 }
667 np->addrs = adr;
668 np->n_addrs = i;
669 mem_start += i * sizeof(struct address_range);
670 }
671
672 if (use_of_interrupt_tree)
673 return mem_start;
674
675 ip = (int *) get_property(np, "interrupts", &l);
676 if (ip == 0)
677 ip = (int *) get_property(np, "AAPL,interrupts", &l);
678 if (ip != 0) {
679 np->intrs = (struct interrupt_info *) mem_start;
680 np->n_intrs = l / sizeof(int);
681 for (i = 0; i < np->n_intrs; ++i) {
682 np->intrs[i].line = *ip++;
683 np->intrs[i].sense = 1;
684 }
685 mem_start += np->n_intrs * sizeof(struct interrupt_info);
686 }
687
688 return mem_start;
689}
690
691static unsigned long __init
692interpret_isa_props(struct device_node *np, unsigned long mem_start,
693 int naddrc, int nsizec)
694{
695 struct isa_reg_property *rp;
696 struct address_range *adr;
697 int i, l, *ip;
698
699 rp = (struct isa_reg_property *) get_property(np, "reg", &l);
700 if (rp != 0 && l >= sizeof(struct isa_reg_property)) {
701 i = 0;
702 adr = (struct address_range *) mem_start;
703 while ((l -= sizeof(struct reg_property)) >= 0) {
704 adr[i].space = rp[i].space;
705 adr[i].address = rp[i].address
706 + (adr[i].space? 0: _ISA_MEM_BASE);
707 adr[i].size = rp[i].size;
708 ++i;
709 }
710 np->addrs = adr;
711 np->n_addrs = i;
712 mem_start += i * sizeof(struct address_range);
713 }
714
715 if (use_of_interrupt_tree)
716 return mem_start;
717
718 ip = (int *) get_property(np, "interrupts", &l);
719 if (ip != 0) {
720 np->intrs = (struct interrupt_info *) mem_start;
721 np->n_intrs = l / (2 * sizeof(int));
722 mem_start += np->n_intrs * sizeof(struct interrupt_info);
723 for (i = 0; i < np->n_intrs; ++i) {
724 np->intrs[i].line = *ip++;
725 np->intrs[i].sense = *ip++;
726 }
727 }
728
729 return mem_start;
730}
731
732static unsigned long __init
733interpret_root_props(struct device_node *np, unsigned long mem_start,
734 int naddrc, int nsizec)
735{
736 struct address_range *adr;
737 int i, l, *ip;
738 unsigned int *rp;
739 int rpsize = (naddrc + nsizec) * sizeof(unsigned int);
740
741 rp = (unsigned int *) get_property(np, "reg", &l);
742 if (rp != 0 && l >= rpsize) {
743 i = 0;
744 adr = (struct address_range *) mem_start;
745 while ((l -= rpsize) >= 0) {
746 adr[i].space = (naddrc >= 2? rp[naddrc-2]: 2);
747 adr[i].address = rp[naddrc - 1];
748 adr[i].size = rp[naddrc + nsizec - 1];
749 ++i;
750 rp += naddrc + nsizec;
751 }
752 np->addrs = adr;
753 np->n_addrs = i;
754 mem_start += i * sizeof(struct address_range);
755 }
756
757 if (use_of_interrupt_tree)
758 return mem_start;
759
760 ip = (int *) get_property(np, "AAPL,interrupts", &l);
761 if (ip == 0)
762 ip = (int *) get_property(np, "interrupts", &l);
763 if (ip != 0) {
764 np->intrs = (struct interrupt_info *) mem_start;
765 np->n_intrs = l / sizeof(int);
766 mem_start += np->n_intrs * sizeof(struct interrupt_info);
767 for (i = 0; i < np->n_intrs; ++i) {
768 np->intrs[i].line = *ip++;
769 np->intrs[i].sense = 1;
770 }
771 }
772
773 return mem_start;
774}
775
776/*
777 * Work out the sense (active-low level / active-high edge)
778 * of each interrupt from the device tree.
779 */
780void __init
781prom_get_irq_senses(unsigned char *senses, int off, int max)
782{
783 struct device_node *np;
784 int i, j;
785
786 /* default to level-triggered */
787 memset(senses, 1, max - off);
788 if (!use_of_interrupt_tree)
789 return;
790
791 for (np = allnodes; np != 0; np = np->allnext) {
792 for (j = 0; j < np->n_intrs; j++) {
793 i = np->intrs[j].line;
794 if (i >= off && i < max) {
795 if (np->intrs[j].sense == 1)
796 senses[i-off] = (IRQ_SENSE_LEVEL
797 | IRQ_POLARITY_NEGATIVE);
798 else
799 senses[i-off] = (IRQ_SENSE_EDGE
800 | IRQ_POLARITY_POSITIVE);
801 }
802 }
803 }
804}
805
806/*
807 * Construct and return a list of the device_nodes with a given name.
808 */
809struct device_node *
810find_devices(const char *name)
811{
812 struct device_node *head, **prevp, *np;
813
814 prevp = &head;
815 for (np = allnodes; np != 0; np = np->allnext) {
816 if (np->name != 0 && strcasecmp(np->name, name) == 0) {
817 *prevp = np;
818 prevp = &np->next;
819 }
820 }
821 *prevp = NULL;
822 return head;
823}
824
825/*
826 * Construct and return a list of the device_nodes with a given type.
827 */
828struct device_node *
829find_type_devices(const char *type)
830{
831 struct device_node *head, **prevp, *np;
832
833 prevp = &head;
834 for (np = allnodes; np != 0; np = np->allnext) {
835 if (np->type != 0 && strcasecmp(np->type, type) == 0) {
836 *prevp = np;
837 prevp = &np->next;
838 }
839 }
840 *prevp = NULL;
841 return head;
842}
843
844/*
845 * Returns all nodes linked together
846 */
847struct device_node *
848find_all_nodes(void)
849{
850 struct device_node *head, **prevp, *np;
851
852 prevp = &head;
853 for (np = allnodes; np != 0; np = np->allnext) {
854 *prevp = np;
855 prevp = &np->next;
856 }
857 *prevp = NULL;
858 return head;
859}
860
861/* Checks if the given "compat" string matches one of the strings in
862 * the device's "compatible" property
863 */
864int
865device_is_compatible(struct device_node *device, const char *compat)
866{
867 const char* cp;
868 int cplen, l;
869
870 cp = (char *) get_property(device, "compatible", &cplen);
871 if (cp == NULL)
872 return 0;
873 while (cplen > 0) {
874 if (strncasecmp(cp, compat, strlen(compat)) == 0)
875 return 1;
876 l = strlen(cp) + 1;
877 cp += l;
878 cplen -= l;
879 }
880
881 return 0;
882}
883
884
885/*
886 * Indicates whether the root node has a given value in its
887 * compatible property.
888 */
889int
890machine_is_compatible(const char *compat)
891{
892 struct device_node *root;
893
894 root = find_path_device("/");
895 if (root == 0)
896 return 0;
897 return device_is_compatible(root, compat);
898}
899
900/*
901 * Construct and return a list of the device_nodes with a given type
902 * and compatible property.
903 */
904struct device_node *
905find_compatible_devices(const char *type, const char *compat)
906{
907 struct device_node *head, **prevp, *np;
908
909 prevp = &head;
910 for (np = allnodes; np != 0; np = np->allnext) {
911 if (type != NULL
912 && !(np->type != 0 && strcasecmp(np->type, type) == 0))
913 continue;
914 if (device_is_compatible(np, compat)) {
915 *prevp = np;
916 prevp = &np->next;
917 }
918 }
919 *prevp = NULL;
920 return head;
921}
922
923/*
924 * Find the device_node with a given full_name.
925 */
926struct device_node *
927find_path_device(const char *path)
928{
929 struct device_node *np;
930
931 for (np = allnodes; np != 0; np = np->allnext)
932 if (np->full_name != 0 && strcasecmp(np->full_name, path) == 0)
933 return np;
934 return NULL;
935}
936
937/*******
938 *
939 * New implementation of the OF "find" APIs, return a refcounted
940 * object, call of_node_put() when done. Currently, still lacks
941 * locking as old implementation, this is beeing done for ppc64.
942 *
943 * Note that property management will need some locking as well,
944 * this isn't dealt with yet
945 *
946 *******/
947
948/**
949 * of_find_node_by_name - Find a node by it's "name" property
950 * @from: The node to start searching from or NULL, the node
951 * you pass will not be searched, only the next one
952 * will; typically, you pass what the previous call
953 * returned. of_node_put() will be called on it
954 * @name: The name string to match against
955 *
956 * Returns a node pointer with refcount incremented, use
957 * of_node_put() on it when done.
958 */
959struct device_node *of_find_node_by_name(struct device_node *from,
960 const char *name)
961{
962 struct device_node *np = from ? from->allnext : allnodes;
963
964 for (; np != 0; np = np->allnext)
965 if (np->name != 0 && strcasecmp(np->name, name) == 0)
966 break;
967 if (from)
968 of_node_put(from);
969 return of_node_get(np);
970}
971
972/**
973 * of_find_node_by_type - Find a node by it's "device_type" property
974 * @from: The node to start searching from or NULL, the node
975 * you pass will not be searched, only the next one
976 * will; typically, you pass what the previous call
977 * returned. of_node_put() will be called on it
978 * @name: The type string to match against
979 *
980 * Returns a node pointer with refcount incremented, use
981 * of_node_put() on it when done.
982 */
983struct device_node *of_find_node_by_type(struct device_node *from,
984 const char *type)
985{
986 struct device_node *np = from ? from->allnext : allnodes;
987
988 for (; np != 0; np = np->allnext)
989 if (np->type != 0 && strcasecmp(np->type, type) == 0)
990 break;
991 if (from)
992 of_node_put(from);
993 return of_node_get(np);
994}
995
996/**
997 * of_find_compatible_node - Find a node based on type and one of the
998 * tokens in it's "compatible" property
999 * @from: The node to start searching from or NULL, the node
1000 * you pass will not be searched, only the next one
1001 * will; typically, you pass what the previous call
1002 * returned. of_node_put() will be called on it
1003 * @type: The type string to match "device_type" or NULL to ignore
1004 * @compatible: The string to match to one of the tokens in the device
1005 * "compatible" list.
1006 *
1007 * Returns a node pointer with refcount incremented, use
1008 * of_node_put() on it when done.
1009 */
1010struct device_node *of_find_compatible_node(struct device_node *from,
1011 const char *type, const char *compatible)
1012{
1013 struct device_node *np = from ? from->allnext : allnodes;
1014
1015 for (; np != 0; np = np->allnext) {
1016 if (type != NULL
1017 && !(np->type != 0 && strcasecmp(np->type, type) == 0))
1018 continue;
1019 if (device_is_compatible(np, compatible))
1020 break;
1021 }
1022 if (from)
1023 of_node_put(from);
1024 return of_node_get(np);
1025}
1026
1027/**
1028 * of_find_node_by_path - Find a node matching a full OF path
1029 * @path: The full path to match
1030 *
1031 * Returns a node pointer with refcount incremented, use
1032 * of_node_put() on it when done.
1033 */
1034struct device_node *of_find_node_by_path(const char *path)
1035{
1036 struct device_node *np = allnodes;
1037
1038 for (; np != 0; np = np->allnext)
1039 if (np->full_name != 0 && strcasecmp(np->full_name, path) == 0)
1040 break;
1041 return of_node_get(np);
1042}
1043
1044/**
1045 * of_find_all_nodes - Get next node in global list
1046 * @prev: Previous node or NULL to start iteration
1047 * of_node_put() will be called on it
1048 *
1049 * Returns a node pointer with refcount incremented, use
1050 * of_node_put() on it when done.
1051 */
1052struct device_node *of_find_all_nodes(struct device_node *prev)
1053{
1054 return of_node_get(prev ? prev->allnext : allnodes);
1055}
1056
1057/**
1058 * of_get_parent - Get a node's parent if any
1059 * @node: Node to get parent
1060 *
1061 * Returns a node pointer with refcount incremented, use
1062 * of_node_put() on it when done.
1063 */
1064struct device_node *of_get_parent(const struct device_node *node)
1065{
1066 return node ? of_node_get(node->parent) : NULL;
1067}
1068
1069/**
1070 * of_get_next_child - Iterate a node childs
1071 * @node: parent node
1072 * @prev: previous child of the parent node, or NULL to get first
1073 *
1074 * Returns a node pointer with refcount incremented, use
1075 * of_node_put() on it when done.
1076 */
1077struct device_node *of_get_next_child(const struct device_node *node,
1078 struct device_node *prev)
1079{
1080 struct device_node *next = prev ? prev->sibling : node->child;
1081
1082 for (; next != 0; next = next->sibling)
1083 if (of_node_get(next))
1084 break;
1085 if (prev)
1086 of_node_put(prev);
1087 return next;
1088}
1089
1090/**
1091 * of_node_get - Increment refcount of a node
1092 * @node: Node to inc refcount, NULL is supported to
1093 * simplify writing of callers
1094 *
1095 * Returns the node itself or NULL if gone. Current implementation
1096 * does nothing as we don't yet do dynamic node allocation on ppc32
1097 */
1098struct device_node *of_node_get(struct device_node *node)
1099{
1100 return node;
1101}
1102
1103/**
1104 * of_node_put - Decrement refcount of a node
1105 * @node: Node to dec refcount, NULL is supported to
1106 * simplify writing of callers
1107 *
1108 * Current implementation does nothing as we don't yet do dynamic node
1109 * allocation on ppc32
1110 */
1111void of_node_put(struct device_node *node)
1112{
1113}
1114
1115/*
1116 * Find the device_node with a given phandle.
1117 */
1118static struct device_node * __init
1119find_phandle(phandle ph)
1120{
1121 struct device_node *np;
1122
1123 for (np = allnodes; np != 0; np = np->allnext)
1124 if (np->node == ph)
1125 return np;
1126 return NULL;
1127}
1128
1129/*
1130 * Find a property with a given name for a given node
1131 * and return the value.
1132 */
1133unsigned char *
1134get_property(struct device_node *np, const char *name, int *lenp)
1135{
1136 struct property *pp;
1137
1138 for (pp = np->properties; pp != 0; pp = pp->next)
1139 if (pp->name != NULL && strcmp(pp->name, name) == 0) {
1140 if (lenp != 0)
1141 *lenp = pp->length;
1142 return pp->value;
1143 }
1144 return NULL;
1145}
1146
1147/*
1148 * Add a property to a node
1149 */
1150int
1151prom_add_property(struct device_node* np, struct property* prop)
1152{
1153 struct property **next = &np->properties;
1154
1155 prop->next = NULL;
1156 while (*next)
1157 next = &(*next)->next;
1158 *next = prop;
1159
1160 return 0;
1161}
1162
1163/* I quickly hacked that one, check against spec ! */
1164static inline unsigned long
1165bus_space_to_resource_flags(unsigned int bus_space)
1166{
1167 u8 space = (bus_space >> 24) & 0xf;
1168 if (space == 0)
1169 space = 0x02;
1170 if (space == 0x02)
1171 return IORESOURCE_MEM;
1172 else if (space == 0x01)
1173 return IORESOURCE_IO;
1174 else {
1175 printk(KERN_WARNING "prom.c: bus_space_to_resource_flags(), space: %x\n",
1176 bus_space);
1177 return 0;
1178 }
1179}
1180
1181static struct resource*
1182find_parent_pci_resource(struct pci_dev* pdev, struct address_range *range)
1183{
1184 unsigned long mask;
1185 int i;
1186
1187 /* Check this one */
1188 mask = bus_space_to_resource_flags(range->space);
1189 for (i=0; i<DEVICE_COUNT_RESOURCE; i++) {
1190 if ((pdev->resource[i].flags & mask) == mask &&
1191 pdev->resource[i].start <= range->address &&
1192 pdev->resource[i].end > range->address) {
1193 if ((range->address + range->size - 1) > pdev->resource[i].end) {
1194 /* Add better message */
1195 printk(KERN_WARNING "PCI/OF resource overlap !\n");
1196 return NULL;
1197 }
1198 break;
1199 }
1200 }
1201 if (i == DEVICE_COUNT_RESOURCE)
1202 return NULL;
1203 return &pdev->resource[i];
1204}
1205
1206/*
1207 * Request an OF device resource. Currently handles child of PCI devices,
1208 * or other nodes attached to the root node. Ultimately, put some
1209 * link to resources in the OF node.
1210 */
1211struct resource*
1212request_OF_resource(struct device_node* node, int index, const char* name_postfix)
1213{
1214 struct pci_dev* pcidev;
1215 u8 pci_bus, pci_devfn;
1216 unsigned long iomask;
1217 struct device_node* nd;
1218 struct resource* parent;
1219 struct resource *res = NULL;
1220 int nlen, plen;
1221
1222 if (index >= node->n_addrs)
1223 goto fail;
1224
1225 /* Sanity check on bus space */
1226 iomask = bus_space_to_resource_flags(node->addrs[index].space);
1227 if (iomask & IORESOURCE_MEM)
1228 parent = &iomem_resource;
1229 else if (iomask & IORESOURCE_IO)
1230 parent = &ioport_resource;
1231 else
1232 goto fail;
1233
1234 /* Find a PCI parent if any */
1235 nd = node;
1236 pcidev = NULL;
1237 while(nd) {
1238 if (!pci_device_from_OF_node(nd, &pci_bus, &pci_devfn))
1239 pcidev = pci_find_slot(pci_bus, pci_devfn);
1240 if (pcidev) break;
1241 nd = nd->parent;
1242 }
1243 if (pcidev)
1244 parent = find_parent_pci_resource(pcidev, &node->addrs[index]);
1245 if (!parent) {
1246 printk(KERN_WARNING "request_OF_resource(%s), parent not found\n",
1247 node->name);
1248 goto fail;
1249 }
1250
1251 res = __request_region(parent, node->addrs[index].address, node->addrs[index].size, NULL);
1252 if (!res)
1253 goto fail;
1254 nlen = strlen(node->name);
1255 plen = name_postfix ? strlen(name_postfix) : 0;
1256 res->name = (const char *)kmalloc(nlen+plen+1, GFP_KERNEL);
1257 if (res->name) {
1258 strcpy((char *)res->name, node->name);
1259 if (plen)
1260 strcpy((char *)res->name+nlen, name_postfix);
1261 }
1262 return res;
1263fail:
1264 return NULL;
1265}
1266
1267int
1268release_OF_resource(struct device_node* node, int index)
1269{
1270 struct pci_dev* pcidev;
1271 u8 pci_bus, pci_devfn;
1272 unsigned long iomask, start, end;
1273 struct device_node* nd;
1274 struct resource* parent;
1275 struct resource *res = NULL;
1276
1277 if (index >= node->n_addrs)
1278 return -EINVAL;
1279
1280 /* Sanity check on bus space */
1281 iomask = bus_space_to_resource_flags(node->addrs[index].space);
1282 if (iomask & IORESOURCE_MEM)
1283 parent = &iomem_resource;
1284 else if (iomask & IORESOURCE_IO)
1285 parent = &ioport_resource;
1286 else
1287 return -EINVAL;
1288
1289 /* Find a PCI parent if any */
1290 nd = node;
1291 pcidev = NULL;
1292 while(nd) {
1293 if (!pci_device_from_OF_node(nd, &pci_bus, &pci_devfn))
1294 pcidev = pci_find_slot(pci_bus, pci_devfn);
1295 if (pcidev) break;
1296 nd = nd->parent;
1297 }
1298 if (pcidev)
1299 parent = find_parent_pci_resource(pcidev, &node->addrs[index]);
1300 if (!parent) {
1301 printk(KERN_WARNING "release_OF_resource(%s), parent not found\n",
1302 node->name);
1303 return -ENODEV;
1304 }
1305
1306 /* Find us in the parent and its childs */
1307 res = parent->child;
1308 start = node->addrs[index].address;
1309 end = start + node->addrs[index].size - 1;
1310 while (res) {
1311 if (res->start == start && res->end == end &&
1312 (res->flags & IORESOURCE_BUSY))
1313 break;
1314 if (res->start <= start && res->end >= end)
1315 res = res->child;
1316 else
1317 res = res->sibling;
1318 }
1319 if (!res)
1320 return -ENODEV;
1321
1322 kfree(res->name);
1323 res->name = NULL;
1324 release_resource(res);
1325 kfree(res);
1326
1327 return 0;
1328}
1329
1330#if 0
1331void
1332print_properties(struct device_node *np)
1333{
1334 struct property *pp;
1335 char *cp;
1336 int i, n;
1337
1338 for (pp = np->properties; pp != 0; pp = pp->next) {
1339 printk(KERN_INFO "%s", pp->name);
1340 for (i = strlen(pp->name); i < 16; ++i)
1341 printk(" ");
1342 cp = (char *) pp->value;
1343 for (i = pp->length; i > 0; --i, ++cp)
1344 if ((i > 1 && (*cp < 0x20 || *cp > 0x7e))
1345 || (i == 1 && *cp != 0))
1346 break;
1347 if (i == 0 && pp->length > 1) {
1348 /* looks like a string */
1349 printk(" %s\n", (char *) pp->value);
1350 } else {
1351 /* dump it in hex */
1352 n = pp->length;
1353 if (n > 64)
1354 n = 64;
1355 if (pp->length % 4 == 0) {
1356 unsigned int *p = (unsigned int *) pp->value;
1357
1358 n /= 4;
1359 for (i = 0; i < n; ++i) {
1360 if (i != 0 && (i % 4) == 0)
1361 printk("\n ");
1362 printk(" %08x", *p++);
1363 }
1364 } else {
1365 unsigned char *bp = pp->value;
1366
1367 for (i = 0; i < n; ++i) {
1368 if (i != 0 && (i % 16) == 0)
1369 printk("\n ");
1370 printk(" %02x", *bp++);
1371 }
1372 }
1373 printk("\n");
1374 if (pp->length > 64)
1375 printk(" ... (length = %d)\n",
1376 pp->length);
1377 }
1378 }
1379}
1380#endif
1381
1382static DEFINE_SPINLOCK(rtas_lock);
1383
1384/* this can be called after setup -- Cort */
1385int
1386call_rtas(const char *service, int nargs, int nret,
1387 unsigned long *outputs, ...)
1388{
1389 va_list list;
1390 int i;
1391 unsigned long s;
1392 struct device_node *rtas;
1393 int *tokp;
1394 union {
1395 unsigned long words[16];
1396 double align;
1397 } u;
1398
1399 rtas = find_devices("rtas");
1400 if (rtas == NULL)
1401 return -1;
1402 tokp = (int *) get_property(rtas, service, NULL);
1403 if (tokp == NULL) {
1404 printk(KERN_ERR "No RTAS service called %s\n", service);
1405 return -1;
1406 }
1407 u.words[0] = *tokp;
1408 u.words[1] = nargs;
1409 u.words[2] = nret;
1410 va_start(list, outputs);
1411 for (i = 0; i < nargs; ++i)
1412 u.words[i+3] = va_arg(list, unsigned long);
1413 va_end(list);
1414
1415 /*
1416 * RTAS doesn't use floating point.
1417 * Or at least, according to the CHRP spec we enter RTAS
1418 * with FP disabled, and it doesn't change the FP registers.
1419 * -- paulus.
1420 */
1421 spin_lock_irqsave(&rtas_lock, s);
1422 enter_rtas((void *)__pa(&u));
1423 spin_unlock_irqrestore(&rtas_lock, s);
1424
1425 if (nret > 1 && outputs != NULL)
1426 for (i = 0; i < nret-1; ++i)
1427 outputs[i] = u.words[i+nargs+4];
1428 return u.words[nargs+3];
1429}
diff --git a/arch/ppc/syslib/prom_init.c b/arch/ppc/syslib/prom_init.c
deleted file mode 100644
index df14422ae1c6..000000000000
--- a/arch/ppc/syslib/prom_init.c
+++ /dev/null
@@ -1,1011 +0,0 @@
1/*
2 * Note that prom_init() and anything called from prom_init()
3 * may be running at an address that is different from the address
4 * that it was linked at. References to static data items are
5 * handled by compiling this file with -mrelocatable-lib.
6 */
7
8#include <linux/config.h>
9#include <linux/kernel.h>
10#include <linux/string.h>
11#include <linux/init.h>
12#include <linux/threads.h>
13#include <linux/spinlock.h>
14#include <linux/ioport.h>
15#include <linux/pci.h>
16#include <linux/slab.h>
17#include <linux/bitops.h>
18
19#include <asm/sections.h>
20#include <asm/prom.h>
21#include <asm/page.h>
22#include <asm/irq.h>
23#include <asm/io.h>
24#include <asm/smp.h>
25#include <asm/bootx.h>
26#include <asm/system.h>
27#include <asm/mmu.h>
28#include <asm/pgtable.h>
29#include <asm/bootinfo.h>
30#include <asm/btext.h>
31#include <asm/pci-bridge.h>
32#include <asm/open_pic.h>
33#include <asm/cacheflush.h>
34
35#ifdef CONFIG_LOGO_LINUX_CLUT224
36#include <linux/linux_logo.h>
37extern const struct linux_logo logo_linux_clut224;
38#endif
39
40/*
41 * Properties whose value is longer than this get excluded from our
42 * copy of the device tree. This way we don't waste space storing
43 * things like "driver,AAPL,MacOS,PowerPC" properties. But this value
44 * does need to be big enough to ensure that we don't lose things
45 * like the interrupt-map property on a PCI-PCI bridge.
46 */
47#define MAX_PROPERTY_LENGTH 4096
48
49#ifndef FB_MAX /* avoid pulling in all of the fb stuff */
50#define FB_MAX 8
51#endif
52
53#define ALIGNUL(x) (((x) + sizeof(unsigned long)-1) & -sizeof(unsigned long))
54
55typedef u32 prom_arg_t;
56
57struct prom_args {
58 const char *service;
59 int nargs;
60 int nret;
61 prom_arg_t args[10];
62};
63
64struct pci_address {
65 unsigned a_hi;
66 unsigned a_mid;
67 unsigned a_lo;
68};
69
70struct pci_reg_property {
71 struct pci_address addr;
72 unsigned size_hi;
73 unsigned size_lo;
74};
75
76struct pci_range {
77 struct pci_address addr;
78 unsigned phys;
79 unsigned size_hi;
80 unsigned size_lo;
81};
82
83struct isa_reg_property {
84 unsigned space;
85 unsigned address;
86 unsigned size;
87};
88
89struct pci_intr_map {
90 struct pci_address addr;
91 unsigned dunno;
92 phandle int_ctrler;
93 unsigned intr;
94};
95
96static void prom_exit(void);
97static int call_prom(const char *service, int nargs, int nret, ...);
98static int call_prom_ret(const char *service, int nargs, int nret,
99 prom_arg_t *rets, ...);
100static void prom_print_hex(unsigned int v);
101static int prom_set_color(ihandle ih, int i, int r, int g, int b);
102static int prom_next_node(phandle *nodep);
103static unsigned long check_display(unsigned long mem);
104static void setup_disp_fake_bi(ihandle dp);
105static unsigned long copy_device_tree(unsigned long mem_start,
106 unsigned long mem_end);
107static unsigned long inspect_node(phandle node, struct device_node *dad,
108 unsigned long mem_start, unsigned long mem_end,
109 struct device_node ***allnextpp);
110static void prom_hold_cpus(unsigned long mem);
111static void prom_instantiate_rtas(void);
112static void * early_get_property(unsigned long base, unsigned long node,
113 char *prop);
114
115prom_entry prom __initdata;
116ihandle prom_chosen __initdata;
117ihandle prom_stdout __initdata;
118
119static char *prom_display_paths[FB_MAX] __initdata;
120static phandle prom_display_nodes[FB_MAX] __initdata;
121static unsigned int prom_num_displays __initdata;
122static ihandle prom_disp_node __initdata;
123char *of_stdout_device __initdata;
124
125unsigned int rtas_data; /* physical pointer */
126unsigned int rtas_entry; /* physical pointer */
127unsigned int rtas_size;
128unsigned int old_rtas;
129
130boot_infos_t *boot_infos;
131char *bootpath;
132char *bootdevice;
133struct device_node *allnodes;
134
135extern char *klimit;
136
137static void __init
138prom_exit(void)
139{
140 struct prom_args args;
141
142 args.service = "exit";
143 args.nargs = 0;
144 args.nret = 0;
145 prom(&args);
146 for (;;) /* should never get here */
147 ;
148}
149
150static int __init
151call_prom(const char *service, int nargs, int nret, ...)
152{
153 va_list list;
154 int i;
155 struct prom_args prom_args;
156
157 prom_args.service = service;
158 prom_args.nargs = nargs;
159 prom_args.nret = nret;
160 va_start(list, nret);
161 for (i = 0; i < nargs; ++i)
162 prom_args.args[i] = va_arg(list, prom_arg_t);
163 va_end(list);
164 for (i = 0; i < nret; ++i)
165 prom_args.args[i + nargs] = 0;
166 prom(&prom_args);
167 return prom_args.args[nargs];
168}
169
170static int __init
171call_prom_ret(const char *service, int nargs, int nret, prom_arg_t *rets, ...)
172{
173 va_list list;
174 int i;
175 struct prom_args prom_args;
176
177 prom_args.service = service;
178 prom_args.nargs = nargs;
179 prom_args.nret = nret;
180 va_start(list, rets);
181 for (i = 0; i < nargs; ++i)
182 prom_args.args[i] = va_arg(list, int);
183 va_end(list);
184 for (i = 0; i < nret; ++i)
185 prom_args.args[i + nargs] = 0;
186 prom(&prom_args);
187 for (i = 1; i < nret; ++i)
188 rets[i-1] = prom_args.args[nargs + i];
189 return prom_args.args[nargs];
190}
191
192void __init
193prom_print(const char *msg)
194{
195 const char *p, *q;
196
197 if (prom_stdout == 0)
198 return;
199
200 for (p = msg; *p != 0; p = q) {
201 for (q = p; *q != 0 && *q != '\n'; ++q)
202 ;
203 if (q > p)
204 call_prom("write", 3, 1, prom_stdout, p, q - p);
205 if (*q != 0) {
206 ++q;
207 call_prom("write", 3, 1, prom_stdout, "\r\n", 2);
208 }
209 }
210}
211
212static void __init
213prom_print_hex(unsigned int v)
214{
215 char buf[16];
216 int i, c;
217
218 for (i = 0; i < 8; ++i) {
219 c = (v >> ((7-i)*4)) & 0xf;
220 c += (c >= 10)? ('a' - 10): '0';
221 buf[i] = c;
222 }
223 buf[i] = ' ';
224 buf[i+1] = 0;
225 prom_print(buf);
226}
227
228static int __init
229prom_set_color(ihandle ih, int i, int r, int g, int b)
230{
231 return call_prom("call-method", 6, 1, "color!", ih, i, b, g, r);
232}
233
234static int __init
235prom_next_node(phandle *nodep)
236{
237 phandle node;
238
239 if ((node = *nodep) != 0
240 && (*nodep = call_prom("child", 1, 1, node)) != 0)
241 return 1;
242 if ((*nodep = call_prom("peer", 1, 1, node)) != 0)
243 return 1;
244 for (;;) {
245 if ((node = call_prom("parent", 1, 1, node)) == 0)
246 return 0;
247 if ((*nodep = call_prom("peer", 1, 1, node)) != 0)
248 return 1;
249 }
250}
251
252#ifdef CONFIG_POWER4
253/*
254 * Set up a hash table with a set of entries in it to map the
255 * first 64MB of RAM. This is used on 64-bit machines since
256 * some of them don't have BATs.
257 */
258
259static inline void make_pte(unsigned long htab, unsigned int hsize,
260 unsigned int va, unsigned int pa, int mode)
261{
262 unsigned int *pteg;
263 unsigned int hash, i, vsid;
264
265 vsid = ((va >> 28) * 0x111) << 12;
266 hash = ((va ^ vsid) >> 5) & 0x7fff80;
267 pteg = (unsigned int *)(htab + (hash & (hsize - 1)));
268 for (i = 0; i < 8; ++i, pteg += 4) {
269 if ((pteg[1] & 1) == 0) {
270 pteg[1] = vsid | ((va >> 16) & 0xf80) | 1;
271 pteg[3] = pa | mode;
272 break;
273 }
274 }
275}
276
277extern unsigned long _SDR1;
278extern PTE *Hash;
279extern unsigned long Hash_size;
280
281static void __init
282prom_alloc_htab(void)
283{
284 unsigned int hsize;
285 unsigned long htab;
286 unsigned int addr;
287
288 /*
289 * Because of OF bugs we can't use the "claim" client
290 * interface to allocate memory for the hash table.
291 * This code is only used on 64-bit PPCs, and the only
292 * 64-bit PPCs at the moment are RS/6000s, and their
293 * OF is based at 0xc00000 (the 12M point), so we just
294 * arbitrarily use the 0x800000 - 0xc00000 region for the
295 * hash table.
296 * -- paulus.
297 */
298 hsize = 4 << 20; /* POWER4 has no BATs */
299 htab = (8 << 20);
300 call_prom("claim", 3, 1, htab, hsize, 0);
301 Hash = (void *)(htab + KERNELBASE);
302 Hash_size = hsize;
303 _SDR1 = htab + __ilog2(hsize) - 18;
304
305 /*
306 * Put in PTEs for the first 64MB of RAM
307 */
308 memset((void *)htab, 0, hsize);
309 for (addr = 0; addr < 0x4000000; addr += 0x1000)
310 make_pte(htab, hsize, addr + KERNELBASE, addr,
311 _PAGE_ACCESSED | _PAGE_COHERENT | PP_RWXX);
312#if 0 /* DEBUG stuff mapping the SCC */
313 make_pte(htab, hsize, 0x80013000, 0x80013000,
314 _PAGE_ACCESSED | _PAGE_NO_CACHE | _PAGE_GUARDED | PP_RWXX);
315#endif
316}
317#endif /* CONFIG_POWER4 */
318
319
320/*
321 * If we have a display that we don't know how to drive,
322 * we will want to try to execute OF's open method for it
323 * later. However, OF will probably fall over if we do that
324 * we've taken over the MMU.
325 * So we check whether we will need to open the display,
326 * and if so, open it now.
327 */
328static unsigned long __init
329check_display(unsigned long mem)
330{
331 phandle node;
332 ihandle ih;
333 int i, j;
334 char type[16], *path;
335 static unsigned char default_colors[] = {
336 0x00, 0x00, 0x00,
337 0x00, 0x00, 0xaa,
338 0x00, 0xaa, 0x00,
339 0x00, 0xaa, 0xaa,
340 0xaa, 0x00, 0x00,
341 0xaa, 0x00, 0xaa,
342 0xaa, 0xaa, 0x00,
343 0xaa, 0xaa, 0xaa,
344 0x55, 0x55, 0x55,
345 0x55, 0x55, 0xff,
346 0x55, 0xff, 0x55,
347 0x55, 0xff, 0xff,
348 0xff, 0x55, 0x55,
349 0xff, 0x55, 0xff,
350 0xff, 0xff, 0x55,
351 0xff, 0xff, 0xff
352 };
353 const unsigned char *clut;
354
355 prom_disp_node = 0;
356
357 for (node = 0; prom_next_node(&node); ) {
358 type[0] = 0;
359 call_prom("getprop", 4, 1, node, "device_type",
360 type, sizeof(type));
361 if (strcmp(type, "display") != 0)
362 continue;
363 /* It seems OF doesn't null-terminate the path :-( */
364 path = (char *) mem;
365 memset(path, 0, 256);
366 if (call_prom("package-to-path", 3, 1, node, path, 255) < 0)
367 continue;
368
369 /*
370 * If this display is the device that OF is using for stdout,
371 * move it to the front of the list.
372 */
373 mem += strlen(path) + 1;
374 i = prom_num_displays++;
375 if (of_stdout_device != 0 && i > 0
376 && strcmp(of_stdout_device, path) == 0) {
377 for (; i > 0; --i) {
378 prom_display_paths[i]
379 = prom_display_paths[i-1];
380 prom_display_nodes[i]
381 = prom_display_nodes[i-1];
382 }
383 }
384 prom_display_paths[i] = path;
385 prom_display_nodes[i] = node;
386 if (i == 0)
387 prom_disp_node = node;
388 if (prom_num_displays >= FB_MAX)
389 break;
390 }
391
392 for (j=0; j<prom_num_displays; j++) {
393 path = prom_display_paths[j];
394 node = prom_display_nodes[j];
395 prom_print("opening display ");
396 prom_print(path);
397 ih = call_prom("open", 1, 1, path);
398 if (ih == 0 || ih == (ihandle) -1) {
399 prom_print("... failed\n");
400 for (i=j+1; i<prom_num_displays; i++) {
401 prom_display_paths[i-1] = prom_display_paths[i];
402 prom_display_nodes[i-1] = prom_display_nodes[i];
403 }
404 if (--prom_num_displays > 0) {
405 prom_disp_node = prom_display_nodes[j];
406 j--;
407 } else
408 prom_disp_node = 0;
409 continue;
410 } else {
411 prom_print("... ok\n");
412 call_prom("setprop", 4, 1, node, "linux,opened", 0, 0);
413
414 /*
415 * Setup a usable color table when the appropriate
416 * method is available.
417 * Should update this to use set-colors.
418 */
419 clut = default_colors;
420 for (i = 0; i < 32; i++, clut += 3)
421 if (prom_set_color(ih, i, clut[0], clut[1],
422 clut[2]) != 0)
423 break;
424
425#ifdef CONFIG_LOGO_LINUX_CLUT224
426 clut = PTRRELOC(logo_linux_clut224.clut);
427 for (i = 0; i < logo_linux_clut224.clutsize;
428 i++, clut += 3)
429 if (prom_set_color(ih, i + 32, clut[0],
430 clut[1], clut[2]) != 0)
431 break;
432#endif /* CONFIG_LOGO_LINUX_CLUT224 */
433 }
434 }
435
436 if (prom_stdout) {
437 phandle p;
438 p = call_prom("instance-to-package", 1, 1, prom_stdout);
439 if (p && p != -1) {
440 type[0] = 0;
441 call_prom("getprop", 4, 1, p, "device_type",
442 type, sizeof(type));
443 if (strcmp(type, "display") == 0)
444 call_prom("setprop", 4, 1, p, "linux,boot-display",
445 0, 0);
446 }
447 }
448
449 return ALIGNUL(mem);
450}
451
452/* This function will enable the early boot text when doing OF booting. This
453 * way, xmon output should work too
454 */
455static void __init
456setup_disp_fake_bi(ihandle dp)
457{
458#ifdef CONFIG_BOOTX_TEXT
459 int width = 640, height = 480, depth = 8, pitch;
460 unsigned address;
461 struct pci_reg_property addrs[8];
462 int i, naddrs;
463 char name[32];
464 char *getprop = "getprop";
465
466 prom_print("Initializing fake screen: ");
467
468 memset(name, 0, sizeof(name));
469 call_prom(getprop, 4, 1, dp, "name", name, sizeof(name));
470 name[sizeof(name)-1] = 0;
471 prom_print(name);
472 prom_print("\n");
473 call_prom(getprop, 4, 1, dp, "width", &width, sizeof(width));
474 call_prom(getprop, 4, 1, dp, "height", &height, sizeof(height));
475 call_prom(getprop, 4, 1, dp, "depth", &depth, sizeof(depth));
476 pitch = width * ((depth + 7) / 8);
477 call_prom(getprop, 4, 1, dp, "linebytes",
478 &pitch, sizeof(pitch));
479 if (pitch == 1)
480 pitch = 0x1000; /* for strange IBM display */
481 address = 0;
482 call_prom(getprop, 4, 1, dp, "address",
483 &address, sizeof(address));
484 if (address == 0) {
485 /* look for an assigned address with a size of >= 1MB */
486 naddrs = call_prom(getprop, 4, 1, dp, "assigned-addresses",
487 addrs, sizeof(addrs));
488 naddrs /= sizeof(struct pci_reg_property);
489 for (i = 0; i < naddrs; ++i) {
490 if (addrs[i].size_lo >= (1 << 20)) {
491 address = addrs[i].addr.a_lo;
492 /* use the BE aperture if possible */
493 if (addrs[i].size_lo >= (16 << 20))
494 address += (8 << 20);
495 break;
496 }
497 }
498 if (address == 0) {
499 prom_print("Failed to get address\n");
500 return;
501 }
502 }
503 /* kludge for valkyrie */
504 if (strcmp(name, "valkyrie") == 0)
505 address += 0x1000;
506
507#ifdef CONFIG_POWER4
508#if CONFIG_TASK_SIZE > 0x80000000
509#error CONFIG_TASK_SIZE cannot be above 0x80000000 with BOOTX_TEXT on G5
510#endif
511 {
512 extern boot_infos_t disp_bi;
513 unsigned long va, pa, i, offset;
514 va = 0x90000000;
515 pa = address & 0xfffff000ul;
516 offset = address & 0x00000fff;
517
518 for (i=0; i<0x4000; i++) {
519 make_pte((unsigned long)Hash - KERNELBASE, Hash_size, va, pa,
520 _PAGE_ACCESSED | _PAGE_NO_CACHE |
521 _PAGE_GUARDED | PP_RWXX);
522 va += 0x1000;
523 pa += 0x1000;
524 }
525 btext_setup_display(width, height, depth, pitch, 0x90000000 | offset);
526 disp_bi.dispDeviceBase = (u8 *)address;
527 }
528#else /* CONFIG_POWER4 */
529 btext_setup_display(width, height, depth, pitch, address);
530 btext_prepare_BAT();
531#endif /* CONFIG_POWER4 */
532#endif /* CONFIG_BOOTX_TEXT */
533}
534
535/*
536 * Make a copy of the device tree from the PROM.
537 */
538static unsigned long __init
539copy_device_tree(unsigned long mem_start, unsigned long mem_end)
540{
541 phandle root;
542 unsigned long new_start;
543 struct device_node **allnextp;
544
545 root = call_prom("peer", 1, 1, (phandle)0);
546 if (root == (phandle)0) {
547 prom_print("couldn't get device tree root\n");
548 prom_exit();
549 }
550 allnextp = &allnodes;
551 mem_start = ALIGNUL(mem_start);
552 new_start = inspect_node(root, NULL, mem_start, mem_end, &allnextp);
553 *allnextp = NULL;
554 return new_start;
555}
556
557static unsigned long __init
558inspect_node(phandle node, struct device_node *dad,
559 unsigned long mem_start, unsigned long mem_end,
560 struct device_node ***allnextpp)
561{
562 int l;
563 phandle child;
564 struct device_node *np;
565 struct property *pp, **prev_propp;
566 char *prev_name, *namep;
567 unsigned char *valp;
568
569 np = (struct device_node *) mem_start;
570 mem_start += sizeof(struct device_node);
571 memset(np, 0, sizeof(*np));
572 np->node = node;
573 **allnextpp = PTRUNRELOC(np);
574 *allnextpp = &np->allnext;
575 if (dad != 0) {
576 np->parent = PTRUNRELOC(dad);
577 /* we temporarily use the `next' field as `last_child'. */
578 if (dad->next == 0)
579 dad->child = PTRUNRELOC(np);
580 else
581 dad->next->sibling = PTRUNRELOC(np);
582 dad->next = np;
583 }
584
585 /* get and store all properties */
586 prev_propp = &np->properties;
587 prev_name = "";
588 for (;;) {
589 pp = (struct property *) mem_start;
590 namep = (char *) (pp + 1);
591 pp->name = PTRUNRELOC(namep);
592 if (call_prom("nextprop", 3, 1, node, prev_name, namep) <= 0)
593 break;
594 mem_start = ALIGNUL((unsigned long)namep + strlen(namep) + 1);
595 prev_name = namep;
596 valp = (unsigned char *) mem_start;
597 pp->value = PTRUNRELOC(valp);
598 pp->length = call_prom("getprop", 4, 1, node, namep,
599 valp, mem_end - mem_start);
600 if (pp->length < 0)
601 continue;
602#ifdef MAX_PROPERTY_LENGTH
603 if (pp->length > MAX_PROPERTY_LENGTH)
604 continue; /* ignore this property */
605#endif
606 mem_start = ALIGNUL(mem_start + pp->length);
607 *prev_propp = PTRUNRELOC(pp);
608 prev_propp = &pp->next;
609 }
610 if (np->node != 0) {
611 /* Add a "linux,phandle" property" */
612 pp = (struct property *) mem_start;
613 *prev_propp = PTRUNRELOC(pp);
614 prev_propp = &pp->next;
615 namep = (char *) (pp + 1);
616 pp->name = PTRUNRELOC(namep);
617 strcpy(namep, "linux,phandle");
618 mem_start = ALIGNUL((unsigned long)namep + strlen(namep) + 1);
619 pp->value = (unsigned char *) PTRUNRELOC(&np->node);
620 pp->length = sizeof(np->node);
621 }
622 *prev_propp = NULL;
623
624 /* get the node's full name */
625 l = call_prom("package-to-path", 3, 1, node,
626 mem_start, mem_end - mem_start);
627 if (l >= 0) {
628 char *p, *ep;
629
630 np->full_name = PTRUNRELOC((char *) mem_start);
631 *(char *)(mem_start + l) = 0;
632 /* Fixup an Apple bug where they have bogus \0 chars in the
633 * middle of the path in some properties
634 */
635 for (p = (char *)mem_start, ep = p + l; p < ep; p++)
636 if ((*p) == '\0') {
637 memmove(p, p+1, ep - p);
638 ep--;
639 }
640 mem_start = ALIGNUL(mem_start + l + 1);
641 }
642
643 /* do all our children */
644 child = call_prom("child", 1, 1, node);
645 while (child != 0) {
646 mem_start = inspect_node(child, np, mem_start, mem_end,
647 allnextpp);
648 child = call_prom("peer", 1, 1, child);
649 }
650
651 return mem_start;
652}
653
654unsigned long smp_chrp_cpu_nr __initdata = 0;
655
656/*
657 * With CHRP SMP we need to use the OF to start the other
658 * processors so we can't wait until smp_boot_cpus (the OF is
659 * trashed by then) so we have to put the processors into
660 * a holding pattern controlled by the kernel (not OF) before
661 * we destroy the OF.
662 *
663 * This uses a chunk of high memory, puts some holding pattern
664 * code there and sends the other processors off to there until
665 * smp_boot_cpus tells them to do something. We do that by using
666 * physical address 0x0. The holding pattern checks that address
667 * until its cpu # is there, when it is that cpu jumps to
668 * __secondary_start(). smp_boot_cpus() takes care of setting those
669 * values.
670 *
671 * We also use physical address 0x4 here to tell when a cpu
672 * is in its holding pattern code.
673 *
674 * -- Cort
675 *
676 * Note that we have to do this if we have more than one CPU,
677 * even if this is a UP kernel. Otherwise when we trash OF
678 * the other CPUs will start executing some random instructions
679 * and crash the system. -- paulus
680 */
681static void __init
682prom_hold_cpus(unsigned long mem)
683{
684 extern void __secondary_hold(void);
685 unsigned long i;
686 int cpu;
687 phandle node;
688 char type[16], *path;
689 unsigned int reg;
690
691 /*
692 * XXX: hack to make sure we're chrp, assume that if we're
693 * chrp we have a device_type property -- Cort
694 */
695 node = call_prom("finddevice", 1, 1, "/");
696 if (call_prom("getprop", 4, 1, node,
697 "device_type", type, sizeof(type)) <= 0)
698 return;
699
700 /* copy the holding pattern code to someplace safe (0) */
701 /* the holding pattern is now within the first 0x100
702 bytes of the kernel image -- paulus */
703 memcpy((void *)0, _stext, 0x100);
704 flush_icache_range(0, 0x100);
705
706 /* look for cpus */
707 *(unsigned long *)(0x0) = 0;
708 asm volatile("dcbf 0,%0": : "r" (0) : "memory");
709 for (node = 0; prom_next_node(&node); ) {
710 type[0] = 0;
711 call_prom("getprop", 4, 1, node, "device_type",
712 type, sizeof(type));
713 if (strcmp(type, "cpu") != 0)
714 continue;
715 path = (char *) mem;
716 memset(path, 0, 256);
717 if (call_prom("package-to-path", 3, 1, node, path, 255) < 0)
718 continue;
719 reg = -1;
720 call_prom("getprop", 4, 1, node, "reg", &reg, sizeof(reg));
721 cpu = smp_chrp_cpu_nr++;
722#ifdef CONFIG_SMP
723 smp_hw_index[cpu] = reg;
724#endif /* CONFIG_SMP */
725 /* XXX: hack - don't start cpu 0, this cpu -- Cort */
726 if (cpu == 0)
727 continue;
728 prom_print("starting cpu ");
729 prom_print(path);
730 *(ulong *)(0x4) = 0;
731 call_prom("start-cpu", 3, 0, node,
732 (char *)__secondary_hold - _stext, cpu);
733 prom_print("...");
734 for ( i = 0 ; (i < 10000) && (*(ulong *)(0x4) == 0); i++ )
735 ;
736 if (*(ulong *)(0x4) == cpu)
737 prom_print("ok\n");
738 else {
739 prom_print("failed: ");
740 prom_print_hex(*(ulong *)0x4);
741 prom_print("\n");
742 }
743 }
744}
745
746static void __init
747prom_instantiate_rtas(void)
748{
749 ihandle prom_rtas;
750 prom_arg_t result;
751
752 prom_rtas = call_prom("finddevice", 1, 1, "/rtas");
753 if (prom_rtas == -1)
754 return;
755
756 rtas_size = 0;
757 call_prom("getprop", 4, 1, prom_rtas,
758 "rtas-size", &rtas_size, sizeof(rtas_size));
759 prom_print("instantiating rtas");
760 if (rtas_size == 0) {
761 rtas_data = 0;
762 } else {
763 /*
764 * Ask OF for some space for RTAS.
765 * Actually OF has bugs so we just arbitrarily
766 * use memory at the 6MB point.
767 */
768 rtas_data = 6 << 20;
769 prom_print(" at ");
770 prom_print_hex(rtas_data);
771 }
772
773 prom_rtas = call_prom("open", 1, 1, "/rtas");
774 prom_print("...");
775 rtas_entry = 0;
776 if (call_prom_ret("call-method", 3, 2, &result,
777 "instantiate-rtas", prom_rtas, rtas_data) == 0)
778 rtas_entry = result;
779 if ((rtas_entry == -1) || (rtas_entry == 0))
780 prom_print(" failed\n");
781 else
782 prom_print(" done\n");
783}
784
785/*
786 * We enter here early on, when the Open Firmware prom is still
787 * handling exceptions and the MMU hash table for us.
788 */
789unsigned long __init
790prom_init(int r3, int r4, prom_entry pp)
791{
792 unsigned long mem;
793 ihandle prom_mmu;
794 unsigned long offset = reloc_offset();
795 int i, l;
796 char *p, *d;
797 unsigned long phys;
798 prom_arg_t result[3];
799 char model[32];
800 phandle node;
801 int rc;
802
803 /* Default */
804 phys = (unsigned long) &_stext;
805
806 /* First get a handle for the stdout device */
807 prom = pp;
808 prom_chosen = call_prom("finddevice", 1, 1, "/chosen");
809 if (prom_chosen == -1)
810 prom_exit();
811 if (call_prom("getprop", 4, 1, prom_chosen, "stdout",
812 &prom_stdout, sizeof(prom_stdout)) <= 0)
813 prom_exit();
814
815 /* Get the full OF pathname of the stdout device */
816 mem = (unsigned long) klimit + offset;
817 p = (char *) mem;
818 memset(p, 0, 256);
819 call_prom("instance-to-path", 3, 1, prom_stdout, p, 255);
820 of_stdout_device = p;
821 mem += strlen(p) + 1;
822
823 /* Get the boot device and translate it to a full OF pathname. */
824 p = (char *) mem;
825 l = call_prom("getprop", 4, 1, prom_chosen, "bootpath", p, 1<<20);
826 if (l > 0) {
827 p[l] = 0; /* should already be null-terminated */
828 bootpath = PTRUNRELOC(p);
829 mem += l + 1;
830 d = (char *) mem;
831 *d = 0;
832 call_prom("canon", 3, 1, p, d, 1<<20);
833 bootdevice = PTRUNRELOC(d);
834 mem = ALIGNUL(mem + strlen(d) + 1);
835 }
836
837 prom_instantiate_rtas();
838
839#ifdef CONFIG_POWER4
840 /*
841 * Find out how much memory we have and allocate a
842 * suitably-sized hash table.
843 */
844 prom_alloc_htab();
845#endif
846 mem = check_display(mem);
847
848 prom_print("copying OF device tree...");
849 mem = copy_device_tree(mem, mem + (1<<20));
850 prom_print("done\n");
851
852 prom_hold_cpus(mem);
853
854 klimit = (char *) (mem - offset);
855
856 node = call_prom("finddevice", 1, 1, "/");
857 rc = call_prom("getprop", 4, 1, node, "model", model, sizeof(model));
858 if (rc > 0 && !strncmp (model, "Pegasos", 7)
859 && strncmp (model, "Pegasos2", 8)) {
860 /* Pegasos 1 has a broken translate method in the OF,
861 * and furthermore the BATs are mapped 1:1 so the phys
862 * address calculated above is correct, so let's use
863 * it directly.
864 */
865 } else if (offset == 0) {
866 /* If we are already running at 0xc0000000, we assume we were
867 * loaded by an OF bootloader which did set a BAT for us.
868 * This breaks OF translate so we force phys to be 0.
869 */
870 prom_print("(already at 0xc0000000) phys=0\n");
871 phys = 0;
872 } else if (call_prom("getprop", 4, 1, prom_chosen, "mmu",
873 &prom_mmu, sizeof(prom_mmu)) <= 0) {
874 prom_print(" no MMU found\n");
875 } else if (call_prom_ret("call-method", 4, 4, result, "translate",
876 prom_mmu, &_stext, 1) != 0) {
877 prom_print(" (translate failed)\n");
878 } else {
879 /* We assume the phys. address size is 3 cells */
880 phys = result[2];
881 }
882
883 if (prom_disp_node != 0)
884 setup_disp_fake_bi(prom_disp_node);
885
886 /* Use quiesce call to get OF to shut down any devices it's using */
887 prom_print("Calling quiesce ...\n");
888 call_prom("quiesce", 0, 0);
889
890 /* Relocate various pointers which will be used once the
891 kernel is running at the address it was linked at. */
892 for (i = 0; i < prom_num_displays; ++i)
893 prom_display_paths[i] = PTRUNRELOC(prom_display_paths[i]);
894
895#ifdef CONFIG_SERIAL_CORE_CONSOLE
896 /* Relocate the of stdout for console autodetection */
897 of_stdout_device = PTRUNRELOC(of_stdout_device);
898#endif
899
900 prom_print("returning 0x");
901 prom_print_hex(phys);
902 prom_print("from prom_init\n");
903 prom_stdout = 0;
904
905 return phys;
906}
907
908/*
909 * early_get_property is used to access the device tree image prepared
910 * by BootX very early on, before the pointers in it have been relocated.
911 */
912static void * __init
913early_get_property(unsigned long base, unsigned long node, char *prop)
914{
915 struct device_node *np = (struct device_node *)(base + node);
916 struct property *pp;
917
918 for (pp = np->properties; pp != 0; pp = pp->next) {
919 pp = (struct property *) (base + (unsigned long)pp);
920 if (strcmp((char *)((unsigned long)pp->name + base),
921 prop) == 0) {
922 return (void *)((unsigned long)pp->value + base);
923 }
924 }
925 return NULL;
926}
927
928/* Is boot-info compatible ? */
929#define BOOT_INFO_IS_COMPATIBLE(bi) ((bi)->compatible_version <= BOOT_INFO_VERSION)
930#define BOOT_INFO_IS_V2_COMPATIBLE(bi) ((bi)->version >= 2)
931#define BOOT_INFO_IS_V4_COMPATIBLE(bi) ((bi)->version >= 4)
932
933void __init
934bootx_init(unsigned long r4, unsigned long phys)
935{
936 boot_infos_t *bi = (boot_infos_t *) r4;
937 unsigned long space;
938 unsigned long ptr, x;
939 char *model;
940
941 boot_infos = PTRUNRELOC(bi);
942 if (!BOOT_INFO_IS_V2_COMPATIBLE(bi))
943 bi->logicalDisplayBase = NULL;
944
945#ifdef CONFIG_BOOTX_TEXT
946 btext_init(bi);
947
948 /*
949 * Test if boot-info is compatible. Done only in config
950 * CONFIG_BOOTX_TEXT since there is nothing much we can do
951 * with an incompatible version, except display a message
952 * and eventually hang the processor...
953 *
954 * I'll try to keep enough of boot-info compatible in the
955 * future to always allow display of this message;
956 */
957 if (!BOOT_INFO_IS_COMPATIBLE(bi)) {
958 btext_drawstring(" !!! WARNING - Incompatible version of BootX !!!\n\n\n");
959 btext_flushscreen();
960 }
961#endif /* CONFIG_BOOTX_TEXT */
962
963 /* New BootX enters kernel with MMU off, i/os are not allowed
964 here. This hack will have been done by the boostrap anyway.
965 */
966 if (bi->version < 4) {
967 /*
968 * XXX If this is an iMac, turn off the USB controller.
969 */
970 model = (char *) early_get_property
971 (r4 + bi->deviceTreeOffset, 4, "model");
972 if (model
973 && (strcmp(model, "iMac,1") == 0
974 || strcmp(model, "PowerMac1,1") == 0)) {
975 out_le32((unsigned *)0x80880008, 1); /* XXX */
976 }
977 }
978
979 /* Move klimit to enclose device tree, args, ramdisk, etc... */
980 if (bi->version < 5) {
981 space = bi->deviceTreeOffset + bi->deviceTreeSize;
982 if (bi->ramDisk)
983 space = bi->ramDisk + bi->ramDiskSize;
984 } else
985 space = bi->totalParamsSize;
986 klimit = PTRUNRELOC((char *) bi + space);
987
988 /* New BootX will have flushed all TLBs and enters kernel with
989 MMU switched OFF, so this should not be useful anymore.
990 */
991 if (bi->version < 4) {
992 /*
993 * Touch each page to make sure the PTEs for them
994 * are in the hash table - the aim is to try to avoid
995 * getting DSI exceptions while copying the kernel image.
996 */
997 for (ptr = ((unsigned long) &_stext) & PAGE_MASK;
998 ptr < (unsigned long)bi + space; ptr += PAGE_SIZE)
999 x = *(volatile unsigned long *)ptr;
1000 }
1001
1002#ifdef CONFIG_BOOTX_TEXT
1003 /*
1004 * Note that after we call btext_prepare_BAT, we can't do
1005 * prom_draw*, flushscreen or clearscreen until we turn the MMU
1006 * on, since btext_prepare_BAT sets disp_bi.logicalDisplayBase
1007 * to a virtual address.
1008 */
1009 btext_prepare_BAT();
1010#endif
1011}
diff --git a/arch/ppc/xmon/start.c b/arch/ppc/xmon/start.c
index ff86b2d814cb..cfc2d6ad464d 100644
--- a/arch/ppc/xmon/start.c
+++ b/arch/ppc/xmon/start.c
@@ -58,7 +58,7 @@ static struct sysrq_key_op sysrq_xmon_op =
58void 58void
59xmon_map_scc(void) 59xmon_map_scc(void)
60{ 60{
61#ifdef CONFIG_PPC_MULTIPLATFORM 61#ifdef CONFIG_PPC_PREP
62 volatile unsigned char *base; 62 volatile unsigned char *base;
63 63
64#elif defined(CONFIG_GEMINI) 64#elif defined(CONFIG_GEMINI)