aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2008-06-09 00:01:46 -0400
committerPaul Mackerras <paulus@samba.org>2008-06-10 07:40:22 -0400
commit917f0af9e5a9ceecf9e72537fabb501254ba321d (patch)
tree1ef207755c6d83ce4af93ef2b5e4645eebd65886 /arch
parent0f3d6bcd391b058c619fc30e8022e8a29fbf4bef (diff)
powerpc: Remove arch/ppc and include/asm-ppc
All the maintained platforms are now in arch/powerpc, so the old arch/ppc stuff can now go away. Acked-by: Adrian Bunk <bunk@kernel.org> Acked-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Becky Bruce <becky.bruce@freescale.com> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Acked-by: Grant Likely <grant.likely@secretlab.ca> Acked-by: Jochen Friedrich <jochen@scram.de> Acked-by: John Linn <john.linn@xilinx.com> Acked-by: Jon Loeliger <jdl@freescale.com> Acked-by: Josh Boyer <jwboyer@linux.vnet.ibm.com> Acked-by: Kumar Gala <galak@kernel.crashing.org> Acked-by: Olof Johansson <olof@lixom.net> Acked-by: Peter Korsgaard <jacmet@sunsite.dk> Acked-by: Scott Wood <scottwood@freescale.com> Acked-by: Sean MacLennan <smaclennan@pikatech.com> Acked-by: Segher Boessenkool <segher@kernel.crashing.org> Acked-by: Stefan Roese <sr@denx.de> Acked-by: Stephen Neuendorffer <stephen.neuendorffer@xilinx.com> Acked-by: Wolfgang Denk <wd@denx.de> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/ppc/.gitignore1
-rw-r--r--arch/ppc/4xx_io/Makefile6
-rw-r--r--arch/ppc/4xx_io/serial_sicc.c2005
-rw-r--r--arch/ppc/8260_io/Kconfig65
-rw-r--r--arch/ppc/8260_io/Makefile6
-rw-r--r--arch/ppc/8260_io/enet.c865
-rw-r--r--arch/ppc/8260_io/fcc_enet.c2379
-rw-r--r--arch/ppc/8xx_io/Kconfig134
-rw-r--r--arch/ppc/8xx_io/Makefile9
-rw-r--r--arch/ppc/8xx_io/commproc.c432
-rw-r--r--arch/ppc/8xx_io/enet.c982
-rw-r--r--arch/ppc/8xx_io/fec.c1983
-rw-r--r--arch/ppc/8xx_io/micropatch.c743
-rw-r--r--arch/ppc/Kconfig1186
-rw-r--r--arch/ppc/Kconfig.debug66
-rw-r--r--arch/ppc/Makefile135
-rw-r--r--arch/ppc/boot/Makefile37
-rw-r--r--arch/ppc/boot/common/Makefile10
-rw-r--r--arch/ppc/boot/common/bootinfo.c68
-rw-r--r--arch/ppc/boot/common/crt0.S80
-rw-r--r--arch/ppc/boot/common/misc-common.c555
-rw-r--r--arch/ppc/boot/common/ns16550.c103
-rw-r--r--arch/ppc/boot/common/serial_stub.c21
-rw-r--r--arch/ppc/boot/common/string.S150
-rw-r--r--arch/ppc/boot/common/util.S293
-rw-r--r--arch/ppc/boot/images/.gitignore6
-rw-r--r--arch/ppc/boot/images/Makefile34
-rw-r--r--arch/ppc/boot/include/cpc700.h26
-rw-r--r--arch/ppc/boot/include/iso_font.h257
-rw-r--r--arch/ppc/boot/include/mpc10x.h63
-rw-r--r--arch/ppc/boot/include/mpsc_defs.h146
-rw-r--r--arch/ppc/boot/include/nonstdio.h34
-rw-r--r--arch/ppc/boot/include/of1275.h42
-rw-r--r--arch/ppc/boot/include/rs6000.h243
-rw-r--r--arch/ppc/boot/include/serial.h46
-rw-r--r--arch/ppc/boot/ld.script85
-rw-r--r--arch/ppc/boot/lib/.gitignore3
-rw-r--r--arch/ppc/boot/lib/Makefile23
-rw-r--r--arch/ppc/boot/lib/div64.S58
-rw-r--r--arch/ppc/boot/lib/kbd.c248
-rw-r--r--arch/ppc/boot/lib/vreset.c805
-rw-r--r--arch/ppc/boot/of1275/Makefile6
-rw-r--r--arch/ppc/boot/of1275/call_prom.c74
-rw-r--r--arch/ppc/boot/of1275/claim.c92
-rw-r--r--arch/ppc/boot/of1275/enter.c22
-rw-r--r--arch/ppc/boot/of1275/exit.c24
-rw-r--r--arch/ppc/boot/of1275/finddevice.c16
-rw-r--r--arch/ppc/boot/of1275/getprop.c37
-rw-r--r--arch/ppc/boot/of1275/map.c48
-rw-r--r--arch/ppc/boot/of1275/ofinit.c27
-rw-r--r--arch/ppc/boot/of1275/ofstdio.c32
-rw-r--r--arch/ppc/boot/of1275/read.c35
-rw-r--r--arch/ppc/boot/of1275/release.c30
-rw-r--r--arch/ppc/boot/of1275/write.c35
-rw-r--r--arch/ppc/boot/simple/Makefile277
-rw-r--r--arch/ppc/boot/simple/chrpmap.c12
-rw-r--r--arch/ppc/boot/simple/clear.S19
-rw-r--r--arch/ppc/boot/simple/cpc700_memory.c34
-rw-r--r--arch/ppc/boot/simple/dummy.c4
-rw-r--r--arch/ppc/boot/simple/embed_config.c938
-rw-r--r--arch/ppc/boot/simple/head.S137
-rw-r--r--arch/ppc/boot/simple/iic.c214
-rw-r--r--arch/ppc/boot/simple/m8260_tty.c325
-rw-r--r--arch/ppc/boot/simple/m8xx_tty.c289
-rw-r--r--arch/ppc/boot/simple/misc-chestnut.c32
-rw-r--r--arch/ppc/boot/simple/misc-cpci690.c65
-rw-r--r--arch/ppc/boot/simple/misc-embedded.c276
-rw-r--r--arch/ppc/boot/simple/misc-ev64260.c54
-rw-r--r--arch/ppc/boot/simple/misc-ev64360.c42
-rw-r--r--arch/ppc/boot/simple/misc-katana.c42
-rw-r--r--arch/ppc/boot/simple/misc-mv64x60.c85
-rw-r--r--arch/ppc/boot/simple/misc-prep.c209
-rw-r--r--arch/ppc/boot/simple/misc-radstone_ppc7d.c24
-rw-r--r--arch/ppc/boot/simple/misc-spruce.c271
-rw-r--r--arch/ppc/boot/simple/misc.c278
-rw-r--r--arch/ppc/boot/simple/mpc10x_memory.c109
-rw-r--r--arch/ppc/boot/simple/mpc52xx_tty.c137
-rw-r--r--arch/ppc/boot/simple/mv64x60_tty.c364
-rw-r--r--arch/ppc/boot/simple/openbios.c128
-rw-r--r--arch/ppc/boot/simple/pci.c274
-rw-r--r--arch/ppc/boot/simple/pibs.c104
-rw-r--r--arch/ppc/boot/simple/prepmap.c12
-rw-r--r--arch/ppc/boot/simple/qspan_pci.c269
-rw-r--r--arch/ppc/boot/simple/relocate.S213
-rw-r--r--arch/ppc/boot/simple/rw4/ppc_40x.h664
-rw-r--r--arch/ppc/boot/simple/rw4/rw4_init.S78
-rw-r--r--arch/ppc/boot/simple/rw4/rw4_init_brd.S1125
-rw-r--r--arch/ppc/boot/simple/rw4/stb.h239
-rw-r--r--arch/ppc/boot/simple/uartlite_tty.c45
-rw-r--r--arch/ppc/boot/utils/.gitignore3
-rw-r--r--arch/ppc/boot/utils/elf.pl33
-rw-r--r--arch/ppc/boot/utils/mkbugboot.c147
-rw-r--r--arch/ppc/boot/utils/mkprep.c241
-rw-r--r--arch/ppc/boot/utils/mktree.c152
-rw-r--r--arch/ppc/configs/FADS_defconfig520
-rw-r--r--arch/ppc/configs/IVMS8_defconfig548
-rw-r--r--arch/ppc/configs/TQM823L_defconfig521
-rw-r--r--arch/ppc/configs/TQM8260_defconfig499
-rw-r--r--arch/ppc/configs/TQM850L_defconfig521
-rw-r--r--arch/ppc/configs/TQM860L_defconfig549
-rw-r--r--arch/ppc/configs/bamboo_defconfig944
-rw-r--r--arch/ppc/configs/bseip_defconfig517
-rw-r--r--arch/ppc/configs/bubinga_defconfig592
-rw-r--r--arch/ppc/configs/chestnut_defconfig794
-rw-r--r--arch/ppc/configs/cpci405_defconfig631
-rw-r--r--arch/ppc/configs/cpci690_defconfig798
-rw-r--r--arch/ppc/configs/ebony_defconfig585
-rw-r--r--arch/ppc/configs/ep405_defconfig572
-rw-r--r--arch/ppc/configs/est8260_defconfig491
-rw-r--r--arch/ppc/configs/ev64260_defconfig758
-rw-r--r--arch/ppc/configs/ev64360_defconfig817
-rw-r--r--arch/ppc/configs/hdpu_defconfig890
-rw-r--r--arch/ppc/configs/katana_defconfig948
-rw-r--r--arch/ppc/configs/lite5200_defconfig436
-rw-r--r--arch/ppc/configs/lopec_defconfig814
-rw-r--r--arch/ppc/configs/luan_defconfig668
-rw-r--r--arch/ppc/configs/mbx_defconfig512
-rw-r--r--arch/ppc/configs/ml300_defconfig739
-rw-r--r--arch/ppc/configs/ml403_defconfig740
-rw-r--r--arch/ppc/configs/mvme5100_defconfig746
-rw-r--r--arch/ppc/configs/ocotea_defconfig599
-rw-r--r--arch/ppc/configs/pplus_defconfig720
-rw-r--r--arch/ppc/configs/prep_defconfig1679
-rw-r--r--arch/ppc/configs/prpmc750_defconfig594
-rw-r--r--arch/ppc/configs/prpmc800_defconfig656
-rw-r--r--arch/ppc/configs/radstone_ppc7d_defconfig991
-rw-r--r--arch/ppc/configs/redwood5_defconfig557
-rw-r--r--arch/ppc/configs/redwood6_defconfig535
-rw-r--r--arch/ppc/configs/rpx8260_defconfig555
-rw-r--r--arch/ppc/configs/rpxcllf_defconfig582
-rw-r--r--arch/ppc/configs/rpxlite_defconfig581
-rw-r--r--arch/ppc/configs/sandpoint_defconfig737
-rw-r--r--arch/ppc/configs/spruce_defconfig577
-rw-r--r--arch/ppc/configs/sycamore_defconfig663
-rw-r--r--arch/ppc/configs/taishan_defconfig1077
-rw-r--r--arch/ppc/configs/walnut_defconfig578
-rw-r--r--arch/ppc/kernel/Makefile21
-rw-r--r--arch/ppc/kernel/asm-offsets.c164
-rw-r--r--arch/ppc/kernel/cpu_setup_power4.S197
-rw-r--r--arch/ppc/kernel/entry.S960
-rw-r--r--arch/ppc/kernel/head.S1220
-rw-r--r--arch/ppc/kernel/head_44x.S769
-rw-r--r--arch/ppc/kernel/head_4xx.S1021
-rw-r--r--arch/ppc/kernel/head_8xx.S959
-rw-r--r--arch/ppc/kernel/head_booke.h308
-rw-r--r--arch/ppc/kernel/machine_kexec.c118
-rw-r--r--arch/ppc/kernel/misc.S868
-rw-r--r--arch/ppc/kernel/pci.c1233
-rw-r--r--arch/ppc/kernel/ppc-stub.c866
-rw-r--r--arch/ppc/kernel/ppc_htab.c464
-rw-r--r--arch/ppc/kernel/ppc_ksyms.c258
-rw-r--r--arch/ppc/kernel/relocate_kernel.S123
-rw-r--r--arch/ppc/kernel/setup.c572
-rw-r--r--arch/ppc/kernel/smp-tbsync.c180
-rw-r--r--arch/ppc/kernel/smp.c414
-rw-r--r--arch/ppc/kernel/softemu8xx.c147
-rw-r--r--arch/ppc/kernel/time.c445
-rw-r--r--arch/ppc/kernel/traps.c826
-rw-r--r--arch/ppc/kernel/vmlinux.lds.S164
-rw-r--r--arch/ppc/lib/Makefile5
-rw-r--r--arch/ppc/lib/checksum.S225
-rw-r--r--arch/ppc/lib/div64.S58
-rw-r--r--arch/ppc/lib/locks.c189
-rw-r--r--arch/ppc/lib/string.S732
-rw-r--r--arch/ppc/mm/44x_mmu.c101
-rw-r--r--arch/ppc/mm/4xx_mmu.c135
-rw-r--r--arch/ppc/mm/Makefile10
-rw-r--r--arch/ppc/mm/fault.c436
-rw-r--r--arch/ppc/mm/hashtable.S617
-rw-r--r--arch/ppc/mm/init.c603
-rw-r--r--arch/ppc/mm/mem_pieces.c162
-rw-r--r--arch/ppc/mm/mem_pieces.h48
-rw-r--r--arch/ppc/mm/mmu_context.c85
-rw-r--r--arch/ppc/mm/mmu_decl.h79
-rw-r--r--arch/ppc/mm/pgtable.c403
-rw-r--r--arch/ppc/mm/ppc_mmu.c269
-rw-r--r--arch/ppc/mm/tlb.c183
-rw-r--r--arch/ppc/platforms/4xx/Kconfig285
-rw-r--r--arch/ppc/platforms/4xx/Makefile31
-rw-r--r--arch/ppc/platforms/4xx/bamboo.c442
-rw-r--r--arch/ppc/platforms/4xx/bamboo.h133
-rw-r--r--arch/ppc/platforms/4xx/bubinga.c265
-rw-r--r--arch/ppc/platforms/4xx/bubinga.h54
-rw-r--r--arch/ppc/platforms/4xx/cpci405.c201
-rw-r--r--arch/ppc/platforms/4xx/cpci405.h28
-rw-r--r--arch/ppc/platforms/4xx/ebony.c334
-rw-r--r--arch/ppc/platforms/4xx/ebony.h97
-rw-r--r--arch/ppc/platforms/4xx/ep405.c196
-rw-r--r--arch/ppc/platforms/4xx/ep405.h52
-rw-r--r--arch/ppc/platforms/4xx/ibm405ep.c141
-rw-r--r--arch/ppc/platforms/4xx/ibm405ep.h145
-rw-r--r--arch/ppc/platforms/4xx/ibm405gp.c120
-rw-r--r--arch/ppc/platforms/4xx/ibm405gp.h148
-rw-r--r--arch/ppc/platforms/4xx/ibm405gpr.c115
-rw-r--r--arch/ppc/platforms/4xx/ibm405gpr.h148
-rw-r--r--arch/ppc/platforms/4xx/ibm440ep.c220
-rw-r--r--arch/ppc/platforms/4xx/ibm440ep.h73
-rw-r--r--arch/ppc/platforms/4xx/ibm440gp.c163
-rw-r--r--arch/ppc/platforms/4xx/ibm440gp.h63
-rw-r--r--arch/ppc/platforms/4xx/ibm440gx.c231
-rw-r--r--arch/ppc/platforms/4xx/ibm440gx.h71
-rw-r--r--arch/ppc/platforms/4xx/ibm440sp.c129
-rw-r--r--arch/ppc/platforms/4xx/ibm440sp.h61
-rw-r--r--arch/ppc/platforms/4xx/ibmnp405h.c170
-rw-r--r--arch/ppc/platforms/4xx/ibmnp405h.h154
-rw-r--r--arch/ppc/platforms/4xx/ibmstb4.c122
-rw-r--r--arch/ppc/platforms/4xx/ibmstb4.h235
-rw-r--r--arch/ppc/platforms/4xx/ibmstbx25.c66
-rw-r--r--arch/ppc/platforms/4xx/ibmstbx25.h258
-rw-r--r--arch/ppc/platforms/4xx/luan.c371
-rw-r--r--arch/ppc/platforms/4xx/luan.h77
-rw-r--r--arch/ppc/platforms/4xx/ocotea.c350
-rw-r--r--arch/ppc/platforms/4xx/ocotea.h94
-rw-r--r--arch/ppc/platforms/4xx/ppc440spe.c146
-rw-r--r--arch/ppc/platforms/4xx/ppc440spe.h63
-rw-r--r--arch/ppc/platforms/4xx/redwood5.c120
-rw-r--r--arch/ppc/platforms/4xx/redwood5.h52
-rw-r--r--arch/ppc/platforms/4xx/redwood6.c156
-rw-r--r--arch/ppc/platforms/4xx/redwood6.h53
-rw-r--r--arch/ppc/platforms/4xx/sycamore.c272
-rw-r--r--arch/ppc/platforms/4xx/sycamore.h49
-rw-r--r--arch/ppc/platforms/4xx/taishan.c395
-rw-r--r--arch/ppc/platforms/4xx/taishan.h67
-rw-r--r--arch/ppc/platforms/4xx/virtex.h35
-rw-r--r--arch/ppc/platforms/4xx/walnut.c246
-rw-r--r--arch/ppc/platforms/4xx/walnut.h52
-rw-r--r--arch/ppc/platforms/4xx/xilinx_ml300.c118
-rw-r--r--arch/ppc/platforms/4xx/xilinx_ml403.c120
-rw-r--r--arch/ppc/platforms/4xx/xparameters/xparameters.h104
-rw-r--r--arch/ppc/platforms/4xx/xparameters/xparameters_ml300.h310
-rw-r--r--arch/ppc/platforms/4xx/xparameters/xparameters_ml403.h243
-rw-r--r--arch/ppc/platforms/4xx/yucca.c393
-rw-r--r--arch/ppc/platforms/4xx/yucca.h108
-rw-r--r--arch/ppc/platforms/Makefile25
-rw-r--r--arch/ppc/platforms/bseip.h38
-rw-r--r--arch/ppc/platforms/ccm.h27
-rw-r--r--arch/ppc/platforms/chestnut.c574
-rw-r--r--arch/ppc/platforms/chestnut.h127
-rw-r--r--arch/ppc/platforms/cpci690.c453
-rw-r--r--arch/ppc/platforms/cpci690.h74
-rw-r--r--arch/ppc/platforms/est8260.h35
-rw-r--r--arch/ppc/platforms/ev64260.c649
-rw-r--r--arch/ppc/platforms/ev64260.h126
-rw-r--r--arch/ppc/platforms/ev64360.c517
-rw-r--r--arch/ppc/platforms/ev64360.h114
-rw-r--r--arch/ppc/platforms/fads.h130
-rw-r--r--arch/ppc/platforms/hdpu.c1015
-rw-r--r--arch/ppc/platforms/hdpu.h80
-rw-r--r--arch/ppc/platforms/hermes.h26
-rw-r--r--arch/ppc/platforms/ip860.h35
-rw-r--r--arch/ppc/platforms/ivms8.h55
-rw-r--r--arch/ppc/platforms/katana.c902
-rw-r--r--arch/ppc/platforms/katana.h253
-rw-r--r--arch/ppc/platforms/lantec.h20
-rw-r--r--arch/ppc/platforms/lite5200.c245
-rw-r--r--arch/ppc/platforms/lite5200.h21
-rw-r--r--arch/ppc/platforms/lopec.c310
-rw-r--r--arch/ppc/platforms/lopec.h39
-rw-r--r--arch/ppc/platforms/lwmon.h59
-rw-r--r--arch/ppc/platforms/mbx.h117
-rw-r--r--arch/ppc/platforms/mpc866ads_setup.c413
-rw-r--r--arch/ppc/platforms/mvme5100.c340
-rw-r--r--arch/ppc/platforms/mvme5100.h91
-rw-r--r--arch/ppc/platforms/pal4.h40
-rw-r--r--arch/ppc/platforms/pal4_pci.c75
-rw-r--r--arch/ppc/platforms/pal4_serial.h37
-rw-r--r--arch/ppc/platforms/pal4_setup.c173
-rw-r--r--arch/ppc/platforms/pcu_e.h27
-rw-r--r--arch/ppc/platforms/powerpmc250.c378
-rw-r--r--arch/ppc/platforms/powerpmc250.h52
-rw-r--r--arch/ppc/platforms/pplus.c844
-rw-r--r--arch/ppc/platforms/pplus.h65
-rw-r--r--arch/ppc/platforms/prep_pci.c1339
-rw-r--r--arch/ppc/platforms/prep_setup.c1043
-rw-r--r--arch/ppc/platforms/prpmc750.c360
-rw-r--r--arch/ppc/platforms/prpmc750.h95
-rw-r--r--arch/ppc/platforms/prpmc800.c472
-rw-r--r--arch/ppc/platforms/prpmc800.h82
-rw-r--r--arch/ppc/platforms/radstone_ppc7d.c1492
-rw-r--r--arch/ppc/platforms/radstone_ppc7d.h433
-rw-r--r--arch/ppc/platforms/residual.c1034
-rw-r--r--arch/ppc/platforms/rpx8260.h81
-rw-r--r--arch/ppc/platforms/rpxclassic.h114
-rw-r--r--arch/ppc/platforms/rpxlite.h91
-rw-r--r--arch/ppc/platforms/sandpoint.c651
-rw-r--r--arch/ppc/platforms/sandpoint.h75
-rw-r--r--arch/ppc/platforms/sbc82xx.c256
-rw-r--r--arch/ppc/platforms/sbc82xx.h36
-rw-r--r--arch/ppc/platforms/sbs8260.h28
-rw-r--r--arch/ppc/platforms/spruce.c322
-rw-r--r--arch/ppc/platforms/spruce.h71
-rw-r--r--arch/ppc/platforms/tqm8260.h22
-rw-r--r--arch/ppc/platforms/tqm8260_setup.c42
-rw-r--r--arch/ppc/platforms/tqm8xx.h155
-rw-r--r--arch/ppc/syslib/Makefile96
-rw-r--r--arch/ppc/syslib/btext.c860
-rw-r--r--arch/ppc/syslib/cpc700.h96
-rw-r--r--arch/ppc/syslib/cpc700_pic.c181
-rw-r--r--arch/ppc/syslib/cpm2_common.c196
-rw-r--r--arch/ppc/syslib/cpm2_pic.c177
-rw-r--r--arch/ppc/syslib/cpm2_pic.h8
-rw-r--r--arch/ppc/syslib/gen550.h14
-rw-r--r--arch/ppc/syslib/gen550_dbg.c179
-rw-r--r--arch/ppc/syslib/gen550_kgdb.c83
-rw-r--r--arch/ppc/syslib/gt64260_pic.c323
-rw-r--r--arch/ppc/syslib/harrier.c300
-rw-r--r--arch/ppc/syslib/hawk_common.c317
-rw-r--r--arch/ppc/syslib/i8259.c213
-rw-r--r--arch/ppc/syslib/ibm440gp_common.c73
-rw-r--r--arch/ppc/syslib/ibm440gp_common.h32
-rw-r--r--arch/ppc/syslib/ibm440gx_common.c294
-rw-r--r--arch/ppc/syslib/ibm440gx_common.h58
-rw-r--r--arch/ppc/syslib/ibm440sp_common.c68
-rw-r--r--arch/ppc/syslib/ibm440sp_common.h23
-rw-r--r--arch/ppc/syslib/ibm44x_common.c235
-rw-r--r--arch/ppc/syslib/ibm44x_common.h45
-rw-r--r--arch/ppc/syslib/ibm_ocp.c10
-rw-r--r--arch/ppc/syslib/indirect_pci.c134
-rw-r--r--arch/ppc/syslib/m8260_pci_erratum9.c455
-rw-r--r--arch/ppc/syslib/m8260_setup.c266
-rw-r--r--arch/ppc/syslib/m82xx_pci.c346
-rw-r--r--arch/ppc/syslib/m82xx_pci.h92
-rw-r--r--arch/ppc/syslib/m8xx_setup.c465
-rw-r--r--arch/ppc/syslib/m8xx_wdt.c148
-rw-r--r--arch/ppc/syslib/m8xx_wdt.h20
-rw-r--r--arch/ppc/syslib/mpc10x_common.c654
-rw-r--r--arch/ppc/syslib/mpc52xx_devices.c317
-rw-r--r--arch/ppc/syslib/mpc52xx_pci.c289
-rw-r--r--arch/ppc/syslib/mpc52xx_pci.h137
-rw-r--r--arch/ppc/syslib/mpc52xx_pic.c254
-rw-r--r--arch/ppc/syslib/mpc52xx_setup.c313
-rw-r--r--arch/ppc/syslib/mpc52xx_sys.c36
-rw-r--r--arch/ppc/syslib/mpc8xx_devices.c243
-rw-r--r--arch/ppc/syslib/mpc8xx_sys.c61
-rw-r--r--arch/ppc/syslib/mv64360_pic.c423
-rw-r--r--arch/ppc/syslib/mv64x60.c2485
-rw-r--r--arch/ppc/syslib/mv64x60_dbg.c121
-rw-r--r--arch/ppc/syslib/mv64x60_win.c1165
-rw-r--r--arch/ppc/syslib/ocp.c482
-rw-r--r--arch/ppc/syslib/open_pic.c1087
-rw-r--r--arch/ppc/syslib/open_pic2.c710
-rw-r--r--arch/ppc/syslib/open_pic_defs.h287
-rw-r--r--arch/ppc/syslib/pci_auto.c515
-rw-r--r--arch/ppc/syslib/ppc403_pic.c125
-rw-r--r--arch/ppc/syslib/ppc405_pci.c170
-rw-r--r--arch/ppc/syslib/ppc440spe_pcie.c441
-rw-r--r--arch/ppc/syslib/ppc440spe_pcie.h149
-rw-r--r--arch/ppc/syslib/ppc4xx_dma.c710
-rw-r--r--arch/ppc/syslib/ppc4xx_pic.c284
-rw-r--r--arch/ppc/syslib/ppc4xx_setup.c271
-rw-r--r--arch/ppc/syslib/ppc4xx_sgdma.c464
-rw-r--r--arch/ppc/syslib/ppc8xx_pic.c126
-rw-r--r--arch/ppc/syslib/ppc8xx_pic.h19
-rw-r--r--arch/ppc/syslib/ppc_sys.c329
-rw-r--r--arch/ppc/syslib/pq2_devices.c393
-rw-r--r--arch/ppc/syslib/pq2_sys.c203
-rw-r--r--arch/ppc/syslib/prep_nvram.c135
-rw-r--r--arch/ppc/syslib/qspan_pci.c380
-rw-r--r--arch/ppc/syslib/todc_time.c511
-rw-r--r--arch/ppc/syslib/virtex_devices.c276
-rw-r--r--arch/ppc/syslib/virtex_devices.h35
-rw-r--r--arch/ppc/syslib/xilinx_pic.c153
-rw-r--r--arch/ppc/xmon/Makefile8
-rw-r--r--arch/ppc/xmon/ansidecl.h141
-rw-r--r--arch/ppc/xmon/nonstdio.h22
-rw-r--r--arch/ppc/xmon/ppc-dis.c190
-rw-r--r--arch/ppc/xmon/ppc-opc.c2720
-rw-r--r--arch/ppc/xmon/ppc.h240
-rw-r--r--arch/ppc/xmon/privinst.h90
-rw-r--r--arch/ppc/xmon/setjmp.c29
-rw-r--r--arch/ppc/xmon/start.c342
-rw-r--r--arch/ppc/xmon/start_8xx.c287
-rw-r--r--arch/ppc/xmon/subr_prf.c55
-rw-r--r--arch/ppc/xmon/xmon.c1780
374 files changed, 0 insertions, 120647 deletions
diff --git a/arch/ppc/.gitignore b/arch/ppc/.gitignore
deleted file mode 100644
index 1e79a0ae4473..000000000000
--- a/arch/ppc/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
1/include
diff --git a/arch/ppc/4xx_io/Makefile b/arch/ppc/4xx_io/Makefile
deleted file mode 100644
index 6a8cd575f382..000000000000
--- a/arch/ppc/4xx_io/Makefile
+++ /dev/null
@@ -1,6 +0,0 @@
1#
2# Makefile for the linux MPC4xx ppc-specific parts
3#
4
5
6obj-$(CONFIG_SERIAL_SICC) += serial_sicc.o
diff --git a/arch/ppc/4xx_io/serial_sicc.c b/arch/ppc/4xx_io/serial_sicc.c
deleted file mode 100644
index efa0a56e230b..000000000000
--- a/arch/ppc/4xx_io/serial_sicc.c
+++ /dev/null
@@ -1,2005 +0,0 @@
1/*
2 * Driver for IBM STB3xxx SICC serial port
3 *
4 * Based on drivers/char/serial_amba.c, by ARM Ltd.
5 *
6 * Copyright 2001 IBM Corp.
7 * Author: IBM China Research Lab
8 * Yudong Yang <yangyud@cn.ibm.com>
9 * Yi Ge <geyi@cn.ibm.com>
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 *
25 *
26 * This is a driver for SICC serial port on IBM Redwood 4 evaluation board.
27 * The driver support both as a console device and normal serial device and
28 * is compatible with normal ttyS* devices.
29 */
30
31#include <linux/module.h>
32#include <linux/kernel.h>
33#include <linux/errno.h>
34#include <linux/signal.h>
35#include <linux/sched.h>
36#include <linux/interrupt.h>
37#include <linux/tty.h>
38#include <linux/tty_flip.h>
39#include <linux/major.h>
40#include <linux/string.h>
41#include <linux/fcntl.h>
42#include <linux/ptrace.h>
43#include <linux/ioport.h>
44#include <linux/mm.h>
45#include <linux/slab.h>
46#include <linux/init.h>
47#include <linux/capability.h>
48#include <linux/circ_buf.h>
49#include <linux/serial.h>
50#include <linux/console.h>
51#include <linux/sysrq.h>
52#include <linux/bitops.h>
53
54#include <asm/system.h>
55#include <asm/io.h>
56#include <asm/irq.h>
57#include <asm/uaccess.h>
58#include <asm/serial.h>
59
60
61#include <linux/serialP.h>
62
63
64/* -----------------------------------------------------------------------------
65 * From STB03xxx SICC UART Specification
66 * -----------------------------------------------------------------------------
67 * UART Register Offsets.
68 */
69
70#define BL_SICC_LSR 0x0000000 /* line status register read/clear */
71#define BL_SICC_LSRS 0x0000001 /* set line status register read/set */
72#define BL_SICC_HSR 0x0000002 /* handshake status register r/clear */
73#define BL_SICC_HSRS 0x0000003 /* set handshake status register r/set */
74#define BL_SICC_BRDH 0x0000004 /* baudrate divisor high reg r/w */
75#define BL_SICC_BRDL 0x0000005 /* baudrate divisor low reg r/w */
76#define BL_SICC_LCR 0x0000006 /* control register r/w */
77#define BL_SICC_RCR 0x0000007 /* receiver command register r/w */
78#define BL_SICC_TxCR 0x0000008 /* transmitter command register r/w */
79#define BL_SICC_RBR 0x0000009 /* receive buffer r */
80#define BL_SICC_TBR 0x0000009 /* transmit buffer w */
81#define BL_SICC_CTL2 0x000000A /* added for Vesta */
82#define BL_SICC_IrCR 0x000000B /* added for Vesta IR */
83
84/* masks and definitions for serial port control register */
85
86#define _LCR_LM_MASK 0xc0 /* loop back modes */
87#define _LCR_DTR_MASK 0x20 /* data terminal ready 0-inactive */
88#define _LCR_RTS_MASK 0x10 /* request to send 0-inactive */
89#define _LCR_DB_MASK 0x08 /* data bits mask */
90#define _LCR_PE_MASK 0x04 /* parity enable */
91#define _LCR_PTY_MASK 0x02 /* parity */
92#define _LCR_SB_MASK 0x01 /* stop bit mask */
93
94#define _LCR_LM_NORM 0x00 /* normal operation */
95#define _LCR_LM_LOOP 0x40 /* internal loopback mode */
96#define _LCR_LM_ECHO 0x80 /* automatic echo mode */
97#define _LCR_LM_RES 0xc0 /* reserved */
98
99#define _LCR_DTR_ACTIVE _LCR_DTR_MASK /* DTR is active */
100#define _LCR_RTS_ACTIVE _LCR_RTS_MASK /* RTS is active */
101#define _LCR_DB_8_BITS _LCR_DB_MASK /* 8 data bits */
102#define _LCR_DB_7_BITS 0x00 /* 7 data bits */
103#define _LCR_PE_ENABLE _LCR_PE_MASK /* parity enabled */
104#define _LCR_PE_DISABLE 0x00 /* parity disabled */
105#define _LCR_PTY_EVEN 0x00 /* even parity */
106#define _LCR_PTY_ODD _LCR_PTY_MASK /* odd parity */
107#define _LCR_SB_1_BIT 0x00 /* one stop bit */
108#define _LCR_SB_2_BIT _LCR_SB_MASK /* two stop bit */
109
110/* serial port handshake register */
111
112#define _HSR_DIS_MASK 0x80 /* DSR input inactive error mask */
113#define _HSR_CS_MASK 0x40 /* CTS input inactive error mask */
114#define _HSR_DIS_ACT 0x00 /* dsr input is active */
115#define _HSR_DIS_INACT _HSR_DIS_MASK /* dsr input is inactive */
116#define _HSR_CS_ACT 0x00 /* cts input is active */
117#define _HSR_CS_INACT _HSR_CS_MASK /* cts input is active */
118
119/* serial port line status register */
120
121#define _LSR_RBR_MASK 0x80 /* receive buffer ready mask */
122#define _LSR_FE_MASK 0x40 /* framing error */
123#define _LSR_OE_MASK 0x20 /* overrun error */
124#define _LSR_PE_MASK 0x10 /* parity error */
125#define _LSR_LB_MASK 0x08 /* line break */
126#define _LSR_TBR_MASK 0x04 /* transmit buffer ready */
127#define _LSR_TSR_MASK 0x02 /* transmit shift register ready */
128
129#define _LSR_RBR_FULL _LSR_RBR_MASK /* receive buffer is full */
130#define _LSR_FE_ERROR _LSR_FE_MASK /* framing error detected */
131#define _LSR_OE_ERROR _LSR_OE_MASK /* overrun error detected */
132#define _LSR_PE_ERROR _LSR_PE_MASK /* parity error detected */
133#define _LSR_LB_BREAK _LSR_LB_MASK /* line break detected */
134#define _LSR_TBR_EMPTY _LSR_TBR_MASK /* transmit buffer is ready */
135#define _LSR_TSR_EMPTY _LSR_TSR_MASK /* transmit shift register is empty */
136#define _LSR_TX_ALL 0x06 /* all physical transmit is done */
137
138#define _LSR_RX_ERR (_LSR_LB_BREAK | _LSR_FE_MASK | _LSR_OE_MASK | \
139 _LSR_PE_MASK )
140
141/* serial port receiver command register */
142
143#define _RCR_ER_MASK 0x80 /* enable receiver mask */
144#define _RCR_DME_MASK 0x60 /* dma mode */
145#define _RCR_EIE_MASK 0x10 /* error interrupt enable mask */
146#define _RCR_PME_MASK 0x08 /* pause mode mask */
147
148#define _RCR_ER_ENABLE _RCR_ER_MASK /* receiver enabled */
149#define _RCR_DME_DISABLE 0x00 /* dma disabled */
150#define _RCR_DME_RXRDY 0x20 /* dma disabled, RxRDY interrupt enabled*/
151#define _RCR_DME_ENABLE2 0x40 /* dma enabled,receiver src channel 2 */
152#define _RCR_DME_ENABLE3 0x60 /* dma enabled,receiver src channel 3 */
153#define _RCR_PME_HARD _RCR_PME_MASK /* RTS controlled by hardware */
154#define _RCR_PME_SOFT 0x00 /* RTS controlled by software */
155
156/* serial port transmit command register */
157
158#define _TxCR_ET_MASK 0x80 /* transmitter enable mask */
159#define _TxCR_DME_MASK 0x60 /* dma mode mask */
160#define _TxCR_TIE_MASK 0x10 /* empty interrupt enable mask */
161#define _TxCR_EIE_MASK 0x08 /* error interrupt enable mask */
162#define _TxCR_SPE_MASK 0x04 /* stop/pause mask */
163#define _TxCR_TB_MASK 0x02 /* transmit break mask */
164
165#define _TxCR_ET_ENABLE _TxCR_ET_MASK /* transmitter enabled */
166#define _TxCR_DME_DISABLE 0x00 /* transmitter disabled, TBR intr disabled */
167#define _TxCR_DME_TBR 0x20 /* transmitter disabled, TBR intr enabled */
168#define _TxCR_DME_CHAN_2 0x40 /* dma enabled, destination chann 2 */
169#define _TxCR_DME_CHAN_3 0x60 /* dma enabled, destination chann 3 */
170
171/* serial ctl reg 2 - added for Vesta */
172
173#define _CTL2_EXTERN 0x80 /* */
174#define _CTL2_USEFIFO 0x40 /* */
175#define _CTL2_RESETRF 0x08 /* */
176#define _CTL2_RESETTF 0x04 /* */
177
178
179
180#define SERIAL_SICC_NAME "ttySICC"
181#define SERIAL_SICC_MAJOR 150
182#define SERIAL_SICC_MINOR 1
183#define SERIAL_SICC_NR 1
184
185#ifndef TRUE
186#define TRUE 1
187#endif
188#ifndef FALSE
189#define FALSE 0
190#endif
191
192/*
193 * Things needed by tty driver
194 */
195static struct tty_driver *siccnormal_driver;
196
197#if defined(CONFIG_SERIAL_SICC_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
198#define SUPPORT_SYSRQ
199#endif
200
201/*
202 * Things needed internally to this driver
203 */
204
205/*
206 * tmp_buf is used as a temporary buffer by serial_write. We need to
207 * lock it in case the copy_from_user blocks while swapping in a page,
208 * and some other program tries to do a serial write at the same time.
209 * Since the lock will only come under contention when the system is
210 * swapping and available memory is low, it makes sense to share one
211 * buffer across all the serial ports, since it significantly saves
212 * memory if large numbers of serial ports are open.
213 */
214static u_char *tmp_buf;
215
216#define HIGH_BITS_OFFSET ((sizeof(long)-sizeof(int))*8)
217
218/* number of characters left in xmit buffer before we ask for more */
219#define WAKEUP_CHARS 256
220#define SICC_ISR_PASS_LIMIT 256
221
222#define EVT_WRITE_WAKEUP 0
223
224struct SICC_icount {
225 __u32 cts;
226 __u32 dsr;
227 __u32 rng;
228 __u32 dcd;
229 __u32 rx;
230 __u32 tx;
231 __u32 frame;
232 __u32 overrun;
233 __u32 parity;
234 __u32 brk;
235 __u32 buf_overrun;
236};
237
238/*
239 * Static information about the port
240 */
241struct SICC_port {
242 unsigned int uart_base;
243 unsigned int uart_base_phys;
244 unsigned int irqrx;
245 unsigned int irqtx;
246 unsigned int uartclk;
247 unsigned int fifosize;
248 unsigned int tiocm_support;
249 void (*set_mctrl)(struct SICC_port *, u_int mctrl);
250};
251
252/*
253 * This is the state information which is persistent across opens
254 */
255struct SICC_state {
256 struct SICC_icount icount;
257 unsigned int line;
258 unsigned int close_delay;
259 unsigned int closing_wait;
260 unsigned int custom_divisor;
261 unsigned int flags;
262 int count;
263 struct SICC_info *info;
264 spinlock_t sicc_lock;
265};
266
267#define SICC_XMIT_SIZE 1024
268/*
269 * This is the state information which is only valid when the port is open.
270 */
271struct SICC_info {
272 struct SICC_port *port;
273 struct SICC_state *state;
274 struct tty_struct *tty;
275 unsigned char x_char;
276 unsigned char old_status;
277 unsigned char read_status_mask;
278 unsigned char ignore_status_mask;
279 struct circ_buf xmit;
280 unsigned int flags;
281#ifdef SUPPORT_SYSRQ
282 unsigned long sysrq;
283#endif
284
285 unsigned int event;
286 unsigned int timeout;
287 unsigned int lcr_h;
288 unsigned int mctrl;
289 int blocked_open;
290
291 struct tasklet_struct tlet;
292
293 wait_queue_head_t open_wait;
294 wait_queue_head_t close_wait;
295 wait_queue_head_t delta_msr_wait;
296};
297
298#ifdef CONFIG_SERIAL_SICC_CONSOLE
299static struct console siccuart_cons;
300#endif
301static void siccuart_change_speed(struct SICC_info *info, struct termios *old_termios);
302static void siccuart_wait_until_sent(struct tty_struct *tty, int timeout);
303
304
305
306static void powerpcMtcic_cr(unsigned long value)
307{
308 mtdcr(DCRN_CICCR, value);
309}
310
311static unsigned long powerpcMfcic_cr(void)
312{
313 return mfdcr(DCRN_CICCR);
314}
315
316static unsigned long powerpcMfclkgpcr(void)
317{
318 return mfdcr(DCRN_SCCR);
319}
320
321static void sicc_set_mctrl_null(struct SICC_port *port, u_int mctrl)
322{
323}
324
325static struct SICC_port sicc_ports[SERIAL_SICC_NR] = {
326 {
327 .uart_base = 0,
328 .uart_base_phys = SICC0_IO_BASE,
329 .irqrx = SICC0_INTRX,
330 .irqtx = SICC0_INTTX,
331// .uartclk = 0,
332 .fifosize = 1,
333 .set_mctrl = sicc_set_mctrl_null,
334 }
335};
336
337static struct SICC_state sicc_state[SERIAL_SICC_NR];
338
339static void siccuart_enable_rx_interrupt(struct SICC_info *info)
340{
341 unsigned char cr;
342
343 cr = readb(info->port->uart_base+BL_SICC_RCR);
344 cr &= ~_RCR_DME_MASK;
345 cr |= _RCR_DME_RXRDY;
346 writeb(cr, info->port->uart_base+BL_SICC_RCR);
347}
348
349static void siccuart_disable_rx_interrupt(struct SICC_info *info)
350{
351 unsigned char cr;
352
353 cr = readb(info->port->uart_base+BL_SICC_RCR);
354 cr &= ~_RCR_DME_MASK;
355 cr |= _RCR_DME_DISABLE;
356 writeb(cr, info->port->uart_base+BL_SICC_RCR);
357}
358
359
360static void siccuart_enable_tx_interrupt(struct SICC_info *info)
361{
362 unsigned char cr;
363
364 cr = readb(info->port->uart_base+BL_SICC_TxCR);
365 cr &= ~_TxCR_DME_MASK;
366 cr |= _TxCR_DME_TBR;
367 writeb(cr, info->port->uart_base+BL_SICC_TxCR);
368}
369
370static void siccuart_disable_tx_interrupt(struct SICC_info *info)
371{
372 unsigned char cr;
373
374 cr = readb(info->port->uart_base+BL_SICC_TxCR);
375 cr &= ~_TxCR_DME_MASK;
376 cr |= _TxCR_DME_DISABLE;
377 writeb(cr, info->port->uart_base+BL_SICC_TxCR);
378}
379
380
381static void siccuart_stop(struct tty_struct *tty)
382{
383 struct SICC_info *info = tty->driver_data;
384 unsigned long flags;
385
386 /* disable interrupts while stopping serial port interrupts */
387 spin_lock_irqsave(&info->state->sicc_lock,flags);
388 siccuart_disable_tx_interrupt(info);
389 spin_unlock_irqrestore(&info->state->sicc_lock,flags);
390}
391
392static void siccuart_start(struct tty_struct *tty)
393{
394 struct SICC_info *info = tty->driver_data;
395 unsigned long flags;
396
397 /* disable interrupts while starting serial port interrupts */
398 spin_lock_irqsave(&info->state->sicc_lock,flags);
399 if (info->xmit.head != info->xmit.tail
400 && info->xmit.buf)
401 siccuart_enable_tx_interrupt(info);
402 spin_unlock_irqrestore(&info->state->sicc_lock,flags);
403}
404
405
406/*
407 * This routine is used by the interrupt handler to schedule
408 * processing in the software interrupt portion of the driver.
409 */
410static void siccuart_event(struct SICC_info *info, int event)
411{
412 info->event |= 1 << event;
413 tasklet_schedule(&info->tlet);
414}
415
416static void
417siccuart_rx_chars(struct SICC_info *info)
418{
419 struct tty_struct *tty = info->tty;
420 unsigned int status, ch, rsr, flg, ignored = 0;
421 struct SICC_icount *icount = &info->state->icount;
422 struct SICC_port *port = info->port;
423
424 status = readb(port->uart_base+BL_SICC_LSR );
425 while (status & _LSR_RBR_FULL) {
426 ch = readb(port->uart_base+BL_SICC_RBR);
427
428 if (tty->flip.count >= TTY_FLIPBUF_SIZE)
429 goto ignore_char;
430 icount->rx++;
431
432 flg = TTY_NORMAL;
433
434 /*
435 * Note that the error handling code is
436 * out of the main execution path
437 */
438 rsr = readb(port->uart_base+BL_SICC_LSR);
439 if (rsr & _LSR_RX_ERR)
440 goto handle_error;
441#ifdef SUPPORT_SYSRQ
442 if (info->sysrq) {
443 if (ch && time_before(jiffies, info->sysrq)) {
444 handle_sysrq(ch, NULL);
445 info->sysrq = 0;
446 goto ignore_char;
447 }
448 info->sysrq = 0;
449 }
450#endif
451 error_return:
452 *tty->flip.flag_buf_ptr++ = flg;
453 *tty->flip.char_buf_ptr++ = ch;
454 tty->flip.count++;
455 ignore_char:
456 status = readb(port->uart_base+BL_SICC_LSR );
457 }
458out:
459 tty_flip_buffer_push(tty);
460 return;
461
462handle_error:
463 if (rsr & _LSR_LB_BREAK) {
464 rsr &= ~(_LSR_FE_MASK | _LSR_PE_MASK);
465 icount->brk++;
466
467#ifdef SUPPORT_SYSRQ
468 if (info->state->line == siccuart_cons.index) {
469 if (!info->sysrq) {
470 info->sysrq = jiffies + HZ*5;
471 goto ignore_char;
472 }
473 }
474#endif
475 } else if (rsr & _LSR_PE_MASK)
476 icount->parity++;
477 else if (rsr & _LSR_FE_MASK)
478 icount->frame++;
479 if (rsr & _LSR_OE_MASK)
480 icount->overrun++;
481
482 if (rsr & info->ignore_status_mask) {
483 if (++ignored > 100)
484 goto out;
485 goto ignore_char;
486 }
487 rsr &= info->read_status_mask;
488
489 if (rsr & _LSR_LB_BREAK)
490 flg = TTY_BREAK;
491 else if (rsr & _LSR_PE_MASK)
492 flg = TTY_PARITY;
493 else if (rsr & _LSR_FE_MASK)
494 flg = TTY_FRAME;
495
496 if (rsr & _LSR_OE_MASK) {
497 /*
498 * CHECK: does overrun affect the current character?
499 * ASSUMPTION: it does not.
500 */
501 *tty->flip.flag_buf_ptr++ = flg;
502 *tty->flip.char_buf_ptr++ = ch;
503 tty->flip.count++;
504 if (tty->flip.count >= TTY_FLIPBUF_SIZE)
505 goto ignore_char;
506 ch = 0;
507 flg = TTY_OVERRUN;
508 }
509#ifdef SUPPORT_SYSRQ
510 info->sysrq = 0;
511#endif
512 goto error_return;
513}
514
515static void siccuart_tx_chars(struct SICC_info *info)
516{
517 struct SICC_port *port = info->port;
518 int count;
519 unsigned char status;
520
521
522 if (info->x_char) {
523 writeb(info->x_char, port->uart_base+ BL_SICC_TBR);
524 info->state->icount.tx++;
525 info->x_char = 0;
526 return;
527 }
528 if (info->xmit.head == info->xmit.tail
529 || info->tty->stopped
530 || info->tty->hw_stopped) {
531 siccuart_disable_tx_interrupt(info);
532 writeb(status&(~_LSR_RBR_MASK),port->uart_base+BL_SICC_LSR);
533 return;
534 }
535
536 count = port->fifosize;
537 do {
538 writeb(info->xmit.buf[info->xmit.tail], port->uart_base+ BL_SICC_TBR);
539 info->xmit.tail = (info->xmit.tail + 1) & (SICC_XMIT_SIZE - 1);
540 info->state->icount.tx++;
541 if (info->xmit.head == info->xmit.tail)
542 break;
543 } while (--count > 0);
544
545 if (CIRC_CNT(info->xmit.head,
546 info->xmit.tail,
547 SICC_XMIT_SIZE) < WAKEUP_CHARS)
548 siccuart_event(info, EVT_WRITE_WAKEUP);
549
550 if (info->xmit.head == info->xmit.tail) {
551 siccuart_disable_tx_interrupt(info);
552 }
553}
554
555
556static irqreturn_t siccuart_int_rx(int irq, void *dev_id)
557{
558 struct SICC_info *info = dev_id;
559 siccuart_rx_chars(info)
560 return IRQ_HANDLED;
561}
562
563
564static irqreturn_t siccuart_int_tx(int irq, void *dev_id)
565{
566 struct SICC_info *info = dev_id;
567 siccuart_tx_chars(info);
568 return IRQ_HANDLED;
569}
570
571static void siccuart_tasklet_action(unsigned long data)
572{
573 struct SICC_info *info = (struct SICC_info *)data;
574 struct tty_struct *tty;
575
576 tty = info->tty;
577 if (!tty || !test_and_clear_bit(EVT_WRITE_WAKEUP, &info->event))
578 return;
579
580 if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
581 tty->ldisc.write_wakeup)
582 (tty->ldisc.write_wakeup)(tty);
583 wake_up_interruptible(&tty->write_wait);
584}
585
586static int siccuart_startup(struct SICC_info *info)
587{
588 unsigned long flags;
589 unsigned long page;
590 int retval = 0;
591
592 if (info->flags & ASYNC_INITIALIZED) {
593 return 0;
594 }
595
596 page = get_zeroed_page(GFP_KERNEL);
597 if (!page)
598 return -ENOMEM;
599
600 if (info->port->uart_base == 0)
601 info->port->uart_base = (int)ioremap(info->port->uart_base_phys, PAGE_SIZE);
602 if (info->port->uart_base == 0) {
603 free_page(page);
604 return -ENOMEM;
605 }
606
607 /* lock access to info while doing setup */
608 spin_lock_irqsave(&info->state->sicc_lock,flags);
609
610 if (info->xmit.buf)
611 free_page(page);
612 else
613 info->xmit.buf = (unsigned char *) page;
614
615
616 info->mctrl = 0;
617 if (info->tty->termios->c_cflag & CBAUD)
618 info->mctrl = TIOCM_RTS | TIOCM_DTR;
619 info->port->set_mctrl(info->port, info->mctrl);
620
621 /*
622 * initialise the old status of the modem signals
623 */
624 info->old_status = 0; // UART_GET_FR(info->port) & AMBA_UARTFR_MODEM_ANY;
625
626
627 if (info->tty)
628 clear_bit(TTY_IO_ERROR, &info->tty->flags);
629 info->xmit.head = info->xmit.tail = 0;
630
631 /*
632 * Set up the tty->alt_speed kludge
633 */
634 if (info->tty) {
635 if ((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI)
636 info->tty->alt_speed = 57600;
637 if ((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_VHI)
638 info->tty->alt_speed = 115200;
639 if ((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_SHI)
640 info->tty->alt_speed = 230400;
641 if ((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_WARP)
642 info->tty->alt_speed = 460800;
643 }
644
645
646 writeb( 0x00, info->port->uart_base + BL_SICC_IrCR ); // disable IrDA
647
648
649 /*
650 * and set the speed of the serial port
651 */
652 siccuart_change_speed(info, 0);
653
654 // enable rx/tx ports
655 writeb(_RCR_ER_ENABLE /*| _RCR_PME_HARD*/, info->port->uart_base + BL_SICC_RCR);
656 writeb(_TxCR_ET_ENABLE , info->port->uart_base + BL_SICC_TxCR);
657
658 readb(info->port->uart_base + BL_SICC_RBR); // clear rx port
659
660 writeb(0xf8, info->port->uart_base + BL_SICC_LSR); /* reset bits 0-4 of LSR */
661
662 /*
663 * Finally, enable interrupts
664 */
665
666 /*
667 * Allocate the IRQ
668 */
669 retval = request_irq(info->port->irqrx, siccuart_int_rx, 0, "SICC rx", info);
670 if (retval) {
671 if (capable(CAP_SYS_ADMIN)) {
672 if (info->tty)
673 set_bit(TTY_IO_ERROR, &info->tty->flags);
674 retval = 0;
675 }
676 goto errout;
677 }
678 retval = request_irq(info->port->irqtx, siccuart_int_tx, 0, "SICC tx", info);
679 if (retval) {
680 if (capable(CAP_SYS_ADMIN)) {
681 if (info->tty)
682 set_bit(TTY_IO_ERROR, &info->tty->flags);
683 retval = 0;
684 }
685 free_irq(info->port->irqrx, info);
686 goto errout;
687 }
688
689 siccuart_enable_rx_interrupt(info);
690
691 info->flags |= ASYNC_INITIALIZED;
692 spin_unlock_irqrestore(&info->state->sicc_lock,flags);
693 return 0;
694
695
696errout:
697 spin_unlock_irqrestore(&info->state->sicc_lock,flags);
698 return retval;
699}
700
701/*
702 * This routine will shutdown a serial port; interrupts are disabled, and
703 * DTR is dropped if the hangup on close termio flag is on.
704 */
705static void siccuart_shutdown(struct SICC_info *info)
706{
707 unsigned long flags;
708
709 if (!(info->flags & ASYNC_INITIALIZED))
710 return;
711
712 /* lock while shutting down port */
713 spin_lock_irqsave(&info->state->sicc_lock,flags); /* Disable interrupts */
714
715 /*
716 * clear delta_msr_wait queue to avoid mem leaks: we may free the irq
717 * here so the queue might never be woken up
718 */
719 wake_up_interruptible(&info->delta_msr_wait);
720
721 /*
722 * disable all interrupts, disable the port
723 */
724 siccuart_disable_rx_interrupt(info);
725 siccuart_disable_tx_interrupt(info);
726
727 /*
728 * Free the IRQ
729 */
730 free_irq(info->port->irqtx, info);
731 free_irq(info->port->irqrx, info);
732
733 if (info->xmit.buf) {
734 unsigned long pg = (unsigned long) info->xmit.buf;
735 info->xmit.buf = NULL;
736 free_page(pg);
737 }
738
739
740 if (!info->tty || (info->tty->termios->c_cflag & HUPCL))
741 info->mctrl &= ~(TIOCM_DTR|TIOCM_RTS);
742 info->port->set_mctrl(info->port, info->mctrl);
743
744 /* kill off our tasklet */
745 tasklet_kill(&info->tlet);
746 if (info->tty)
747 set_bit(TTY_IO_ERROR, &info->tty->flags);
748
749 info->flags &= ~ASYNC_INITIALIZED;
750
751 spin_unlock_irqrestore(&info->state->sicc_lock,flags);
752}
753
754
755static void siccuart_change_speed(struct SICC_info *info, struct termios *old_termios)
756{
757 unsigned int lcr_h, baud, quot, cflag, old_rcr, old_tcr, bits;
758 unsigned long flags;
759
760 if (!info->tty || !info->tty->termios)
761 return;
762
763 cflag = info->tty->termios->c_cflag;
764
765 pr_debug("siccuart_set_cflag(0x%x) called\n", cflag);
766 /* byte size and parity */
767 switch (cflag & CSIZE) {
768 case CS7: lcr_h = _LCR_PE_DISABLE | _LCR_DB_7_BITS | _LCR_SB_1_BIT; bits = 9; break;
769 default: lcr_h = _LCR_PE_DISABLE | _LCR_DB_8_BITS | _LCR_SB_1_BIT; bits = 10; break; // CS8
770 }
771 if (cflag & CSTOPB) {
772 lcr_h |= _LCR_SB_2_BIT;
773 bits ++;
774 }
775 if (cflag & PARENB) {
776 lcr_h |= _LCR_PE_ENABLE;
777 bits++;
778 if (!(cflag & PARODD))
779 lcr_h |= _LCR_PTY_ODD;
780 else
781 lcr_h |= _LCR_PTY_EVEN;
782 }
783
784 do {
785 /* Determine divisor based on baud rate */
786 baud = tty_get_baud_rate(info->tty);
787 if (!baud)
788 baud = 9600;
789
790
791 {
792 // here is ppc403SetBaud(com_port, baud);
793 unsigned long divisor, clockSource, temp;
794
795 /* Ensure CICCR[7] is 0 to select Internal Baud Clock */
796 powerpcMtcic_cr((unsigned long)(powerpcMfcic_cr() & 0xFEFFFFFF));
797
798 /* Determine Internal Baud Clock Frequency */
799 /* powerpcMfclkgpcr() reads DCR 0x120 - the*/
800 /* SCCR (Serial Clock Control Register) on Vesta */
801 temp = powerpcMfclkgpcr();
802
803 if(temp & 0x00000080) {
804 clockSource = 324000000;
805 }
806 else {
807 clockSource = 216000000;
808 }
809 clockSource = clockSource/(unsigned long)((temp&0x00FC0000)>>18);
810 divisor = clockSource/(16*baud) - 1;
811 /* divisor has only 12 bits of resolution */
812 if(divisor>0x00000FFF){
813 divisor=0x00000FFF;
814 }
815
816 quot = divisor;
817 }
818
819 if (baud == 38400 &&
820 ((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_CUST))
821 quot = info->state->custom_divisor;
822
823 if (!quot && old_termios) {
824 info->tty->termios->c_cflag &= ~CBAUD;
825 info->tty->termios->c_cflag |= (old_termios->c_cflag & CBAUD);
826 old_termios = NULL;
827 }
828 } while (quot == 0 && old_termios);
829
830 /* As a last resort, if the quotient is zero, default to 9600 bps */
831 if (!quot)
832 quot = (info->port->uartclk / (16 * 9600)) - 1;
833
834 info->timeout = info->port->fifosize * HZ * bits / baud;
835 info->timeout += HZ/50; /* Add .02 seconds of slop */
836
837 if (cflag & CRTSCTS)
838 info->flags |= ASYNC_CTS_FLOW;
839 else
840 info->flags &= ~ASYNC_CTS_FLOW;
841 if (cflag & CLOCAL)
842 info->flags &= ~ASYNC_CHECK_CD;
843 else
844 info->flags |= ASYNC_CHECK_CD;
845
846 /*
847 * Set up parity check flag
848 */
849#define RELEVENT_IFLAG(iflag) ((iflag) & (IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK))
850
851 info->read_status_mask = _LSR_OE_MASK;
852 if (I_INPCK(info->tty))
853 info->read_status_mask |= _LSR_FE_MASK | _LSR_PE_MASK;
854 if (I_BRKINT(info->tty) || I_PARMRK(info->tty))
855 info->read_status_mask |= _LSR_LB_MASK;
856
857 /*
858 * Characters to ignore
859 */
860 info->ignore_status_mask = 0;
861 if (I_IGNPAR(info->tty))
862 info->ignore_status_mask |= _LSR_FE_MASK | _LSR_PE_MASK;
863 if (I_IGNBRK(info->tty)) {
864 info->ignore_status_mask |= _LSR_LB_MASK;
865 /*
866 * If we're ignoring parity and break indicators,
867 * ignore overruns to (for real raw support).
868 */
869 if (I_IGNPAR(info->tty))
870 info->ignore_status_mask |= _LSR_OE_MASK;
871 }
872
873 /* disable interrupts while reading and clearing registers */
874 spin_lock_irqsave(&info->state->sicc_lock,flags);
875
876 old_rcr = readb(info->port->uart_base + BL_SICC_RCR);
877 old_tcr = readb(info->port->uart_base + BL_SICC_TxCR);
878
879
880 writeb(0, info->port->uart_base + BL_SICC_RCR);
881 writeb(0, info->port->uart_base + BL_SICC_TxCR);
882
883 /*RLBtrace (&ppc403Chan0, 0x2000000c, 0, 0);*/
884
885
886 spin_unlock_irqrestore(&info->state->sicc_lock,flags);
887
888
889 /* Set baud rate */
890 writeb((quot & 0x00000F00)>>8, info->port->uart_base + BL_SICC_BRDH );
891 writeb( quot & 0x00000FF, info->port->uart_base + BL_SICC_BRDL );
892
893 /* Set CTL2 reg to use external clock (ExtClk) and enable FIFOs. */
894 /* For now, do NOT use FIFOs since 403 UART did not have this */
895 /* capability and this driver was inherited from 403UART. */
896 writeb(_CTL2_EXTERN, info->port->uart_base + BL_SICC_CTL2);
897
898 writeb(lcr_h, info->port->uart_base + BL_SICC_LCR);
899
900 writeb(old_rcr, info->port->uart_base + BL_SICC_RCR); // restore rcr
901 writeb(old_tcr, info->port->uart_base + BL_SICC_TxCR); // restore txcr
902
903}
904
905
906static void siccuart_put_char(struct tty_struct *tty, u_char ch)
907{
908 struct SICC_info *info = tty->driver_data;
909 unsigned long flags;
910
911 if (!tty || !info->xmit.buf)
912 return;
913
914 /* lock info->xmit while adding character to tx buffer */
915 spin_lock_irqsave(&info->state->sicc_lock,flags);
916 if (CIRC_SPACE(info->xmit.head, info->xmit.tail, SICC_XMIT_SIZE) != 0) {
917 info->xmit.buf[info->xmit.head] = ch;
918 info->xmit.head = (info->xmit.head + 1) & (SICC_XMIT_SIZE - 1);
919 }
920 spin_unlock_irqrestore(&info->state->sicc_lock,flags);
921}
922
923static void siccuart_flush_chars(struct tty_struct *tty)
924{
925 struct SICC_info *info = tty->driver_data;
926 unsigned long flags;
927
928 if (info->xmit.head == info->xmit.tail
929 || tty->stopped
930 || tty->hw_stopped
931 || !info->xmit.buf)
932 return;
933
934 /* disable interrupts while transmitting characters */
935 spin_lock_irqsave(&info->state->sicc_lock,flags);
936 siccuart_enable_tx_interrupt(info);
937 spin_unlock_irqrestore(&info->state->sicc_lock,flags);
938}
939
940static int siccuart_write(struct tty_struct *tty,
941 const u_char * buf, int count)
942{
943 struct SICC_info *info = tty->driver_data;
944 unsigned long flags;
945 int c, ret = 0;
946
947 if (!tty || !info->xmit.buf || !tmp_buf)
948 return 0;
949
950 /* lock info->xmit while removing characters from buffer */
951 spin_lock_irqsave(&info->state->sicc_lock,flags);
952 while (1) {
953 c = CIRC_SPACE_TO_END(info->xmit.head,
954 info->xmit.tail,
955 SICC_XMIT_SIZE);
956 if (count < c)
957 c = count;
958 if (c <= 0)
959 break;
960 memcpy(info->xmit.buf + info->xmit.head, buf, c);
961 info->xmit.head = (info->xmit.head + c) &
962 (SICC_XMIT_SIZE - 1);
963 buf += c;
964 count -= c;
965 ret += c;
966 }
967 if (info->xmit.head != info->xmit.tail
968 && !tty->stopped
969 && !tty->hw_stopped)
970 siccuart_enable_tx_interrupt(info);
971 spin_unlock_irqrestore(&info->state->sicc_lock,flags);
972 return ret;
973}
974
975static int siccuart_write_room(struct tty_struct *tty)
976{
977 struct SICC_info *info = tty->driver_data;
978
979 return CIRC_SPACE(info->xmit.head, info->xmit.tail, SICC_XMIT_SIZE);
980}
981
982static int siccuart_chars_in_buffer(struct tty_struct *tty)
983{
984 struct SICC_info *info = tty->driver_data;
985
986 return CIRC_CNT(info->xmit.head, info->xmit.tail, SICC_XMIT_SIZE);
987}
988
989static void siccuart_flush_buffer(struct tty_struct *tty)
990{
991 struct SICC_info *info = tty->driver_data;
992 unsigned long flags;
993
994 pr_debug("siccuart_flush_buffer(%d) called\n", tty->index);
995 /* lock info->xmit while zeroing buffer counts */
996 spin_lock_irqsave(&info->state->sicc_lock,flags);
997 info->xmit.head = info->xmit.tail = 0;
998 spin_unlock_irqrestore(&info->state->sicc_lock,flags);
999 wake_up_interruptible(&tty->write_wait);
1000 if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
1001 tty->ldisc.write_wakeup)
1002 (tty->ldisc.write_wakeup)(tty);
1003}
1004
1005/*
1006 * This function is used to send a high-priority XON/XOFF character to
1007 * the device
1008 */
1009static void siccuart_send_xchar(struct tty_struct *tty, char ch)
1010{
1011 struct SICC_info *info = tty->driver_data;
1012
1013 info->x_char = ch;
1014 if (ch)
1015 siccuart_enable_tx_interrupt(info);
1016}
1017
1018static void siccuart_throttle(struct tty_struct *tty)
1019{
1020 struct SICC_info *info = tty->driver_data;
1021 unsigned long flags;
1022
1023 if (I_IXOFF(tty))
1024 siccuart_send_xchar(tty, STOP_CHAR(tty));
1025
1026 if (tty->termios->c_cflag & CRTSCTS) {
1027 /* disable interrupts while setting modem control lines */
1028 spin_lock_irqsave(&info->state->sicc_lock,flags);
1029 info->mctrl &= ~TIOCM_RTS;
1030 info->port->set_mctrl(info->port, info->mctrl);
1031 spin_unlock_irqrestore(&info->state->sicc_lock,flags);
1032 }
1033}
1034
1035static void siccuart_unthrottle(struct tty_struct *tty)
1036{
1037 struct SICC_info *info = (struct SICC_info *) tty->driver_data;
1038 unsigned long flags;
1039
1040 if (I_IXOFF(tty)) {
1041 if (info->x_char)
1042 info->x_char = 0;
1043 else
1044 siccuart_send_xchar(tty, START_CHAR(tty));
1045 }
1046
1047 if (tty->termios->c_cflag & CRTSCTS) {
1048 /* disable interrupts while setting modem control lines */
1049 spin_lock_irqsave(&info->state->sicc_lock,flags);
1050 info->mctrl |= TIOCM_RTS;
1051 info->port->set_mctrl(info->port, info->mctrl);
1052 spin_unlock_irqrestore(&info->state->sicc_lock,flags);
1053 }
1054}
1055
1056static int get_serial_info(struct SICC_info *info, struct serial_struct *retinfo)
1057{
1058 struct SICC_state *state = info->state;
1059 struct SICC_port *port = info->port;
1060 struct serial_struct tmp;
1061
1062 memset(&tmp, 0, sizeof(tmp));
1063 tmp.type = 0;
1064 tmp.line = state->line;
1065 tmp.port = port->uart_base;
1066 if (HIGH_BITS_OFFSET)
1067 tmp.port_high = port->uart_base >> HIGH_BITS_OFFSET;
1068 tmp.irq = port->irqrx;
1069 tmp.flags = 0;
1070 tmp.xmit_fifo_size = port->fifosize;
1071 tmp.baud_base = port->uartclk / 16;
1072 tmp.close_delay = state->close_delay;
1073 tmp.closing_wait = state->closing_wait;
1074 tmp.custom_divisor = state->custom_divisor;
1075
1076 if (copy_to_user(retinfo, &tmp, sizeof(*retinfo)))
1077 return -EFAULT;
1078 return 0;
1079}
1080
1081static int set_serial_info(struct SICC_info *info,
1082 struct serial_struct *newinfo)
1083{
1084 struct serial_struct new_serial;
1085 struct SICC_state *state, old_state;
1086 struct SICC_port *port;
1087 unsigned long new_port;
1088 unsigned int i, change_irq, change_port;
1089 int retval = 0;
1090
1091 if (copy_from_user(&new_serial, newinfo, sizeof(new_serial)))
1092 return -EFAULT;
1093
1094 state = info->state;
1095 old_state = *state;
1096 port = info->port;
1097
1098 new_port = new_serial.port;
1099 if (HIGH_BITS_OFFSET)
1100 new_port += (unsigned long) new_serial.port_high << HIGH_BITS_OFFSET;
1101
1102 change_irq = new_serial.irq != port->irqrx;
1103 change_port = new_port != port->uart_base;
1104
1105 if (!capable(CAP_SYS_ADMIN)) {
1106 if (change_irq || change_port ||
1107 (new_serial.baud_base != port->uartclk / 16) ||
1108 (new_serial.close_delay != state->close_delay) ||
1109 (new_serial.xmit_fifo_size != port->fifosize) ||
1110 ((new_serial.flags & ~ASYNC_USR_MASK) !=
1111 (state->flags & ~ASYNC_USR_MASK)))
1112 return -EPERM;
1113 state->flags = ((state->flags & ~ASYNC_USR_MASK) |
1114 (new_serial.flags & ASYNC_USR_MASK));
1115 info->flags = ((info->flags & ~ASYNC_USR_MASK) |
1116 (new_serial.flags & ASYNC_USR_MASK));
1117 state->custom_divisor = new_serial.custom_divisor;
1118 goto check_and_exit;
1119 }
1120
1121 if ((new_serial.irq >= NR_IRQS) || (new_serial.irq < 0) ||
1122 (new_serial.baud_base < 9600))
1123 return -EINVAL;
1124
1125 if (new_serial.type && change_port) {
1126 for (i = 0; i < SERIAL_SICC_NR; i++)
1127 if ((port != sicc_ports + i) &&
1128 sicc_ports[i].uart_base != new_port)
1129 return -EADDRINUSE;
1130 }
1131
1132 if ((change_port || change_irq) && (state->count > 1))
1133 return -EBUSY;
1134
1135 /*
1136 * OK, past this point, all the error checking has been done.
1137 * At this point, we start making changes.....
1138 */
1139 port->uartclk = new_serial.baud_base * 16;
1140 state->flags = ((state->flags & ~ASYNC_FLAGS) |
1141 (new_serial.flags & ASYNC_FLAGS));
1142 info->flags = ((state->flags & ~ASYNC_INTERNAL_FLAGS) |
1143 (info->flags & ASYNC_INTERNAL_FLAGS));
1144 state->custom_divisor = new_serial.custom_divisor;
1145 state->close_delay = msecs_to_jiffies(10 * new_serial.close_delay);
1146 state->closing_wait = msecs_to_jiffies(10 * new_serial.closing_wait);
1147 info->tty->low_latency = (info->flags & ASYNC_LOW_LATENCY) ? 1 : 0;
1148 port->fifosize = new_serial.xmit_fifo_size;
1149
1150 if (change_port || change_irq) {
1151 /*
1152 * We need to shutdown the serial port at the old
1153 * port/irq combination.
1154 */
1155 siccuart_shutdown(info);
1156 port->irqrx = new_serial.irq;
1157 port->uart_base = new_port;
1158 }
1159
1160check_and_exit:
1161 if (!port->uart_base)
1162 return 0;
1163 if (info->flags & ASYNC_INITIALIZED) {
1164 if ((old_state.flags & ASYNC_SPD_MASK) !=
1165 (state->flags & ASYNC_SPD_MASK) ||
1166 (old_state.custom_divisor != state->custom_divisor)) {
1167 if ((state->flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI)
1168 info->tty->alt_speed = 57600;
1169 if ((state->flags & ASYNC_SPD_MASK) == ASYNC_SPD_VHI)
1170 info->tty->alt_speed = 115200;
1171 if ((state->flags & ASYNC_SPD_MASK) == ASYNC_SPD_SHI)
1172 info->tty->alt_speed = 230400;
1173 if ((state->flags & ASYNC_SPD_MASK) == ASYNC_SPD_WARP)
1174 info->tty->alt_speed = 460800;
1175 siccuart_change_speed(info, NULL);
1176 }
1177 } else
1178 retval = siccuart_startup(info);
1179 return retval;
1180}
1181
1182
1183/*
1184 * get_lsr_info - get line status register info
1185 */
1186static int get_lsr_info(struct SICC_info *info, unsigned int *value)
1187{
1188 unsigned int result, status;
1189 unsigned long flags;
1190
1191 /* disable interrupts while reading status from port */
1192 spin_lock_irqsave(&info->state->sicc_lock,flags);
1193 status = readb(info->port->uart_base + BL_SICC_LSR);
1194 spin_unlock_irqrestore(&info->state->sicc_lock,flags);
1195 result = status & _LSR_TSR_EMPTY ? TIOCSER_TEMT : 0;
1196
1197 /*
1198 * If we're about to load something into the transmit
1199 * register, we'll pretend the transmitter isn't empty to
1200 * avoid a race condition (depending on when the transmit
1201 * interrupt happens).
1202 */
1203 if (info->x_char ||
1204 ((CIRC_CNT(info->xmit.head, info->xmit.tail,
1205 SICC_XMIT_SIZE) > 0) &&
1206 !info->tty->stopped && !info->tty->hw_stopped))
1207 result &= TIOCSER_TEMT;
1208
1209 return put_user(result, value);
1210}
1211
1212static int get_modem_info(struct SICC_info *info, unsigned int *value)
1213{
1214 unsigned int result = info->mctrl;
1215
1216 return put_user(result, value);
1217}
1218
1219static int set_modem_info(struct SICC_info *info, unsigned int cmd,
1220 unsigned int *value)
1221{
1222 unsigned int arg, old;
1223 unsigned long flags;
1224
1225 if (get_user(arg, value))
1226 return -EFAULT;
1227
1228 old = info->mctrl;
1229 switch (cmd) {
1230 case TIOCMBIS:
1231 info->mctrl |= arg;
1232 break;
1233
1234 case TIOCMBIC:
1235 info->mctrl &= ~arg;
1236 break;
1237
1238 case TIOCMSET:
1239 info->mctrl = arg;
1240 break;
1241
1242 default:
1243 return -EINVAL;
1244 }
1245 /* disable interrupts while setting modem control lines */
1246 spin_lock_irqsave(&info->state->sicc_lock,flags);
1247 if (old != info->mctrl)
1248 info->port->set_mctrl(info->port, info->mctrl);
1249 spin_unlock_irqrestore(&info->state->sicc_lock,flags);
1250 return 0;
1251}
1252
1253static void siccuart_break_ctl(struct tty_struct *tty, int break_state)
1254{
1255 struct SICC_info *info = tty->driver_data;
1256 unsigned long flags;
1257 unsigned int lcr_h;
1258
1259
1260 /* disable interrupts while setting break state */
1261 spin_lock_irqsave(&info->state->sicc_lock,flags);
1262 lcr_h = readb(info->port + BL_SICC_LSR);
1263 if (break_state == -1)
1264 lcr_h |= _LSR_LB_MASK;
1265 else
1266 lcr_h &= ~_LSR_LB_MASK;
1267 writeb(lcr_h, info->port + BL_SICC_LSRS);
1268 spin_unlock_irqrestore(&info->state->sicc_lock,flags);
1269}
1270
1271static int siccuart_ioctl(struct tty_struct *tty, struct file *file,
1272 unsigned int cmd, unsigned long arg)
1273{
1274 struct SICC_info *info = tty->driver_data;
1275 struct SICC_icount cnow;
1276 struct serial_icounter_struct icount;
1277 unsigned long flags;
1278
1279 if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) &&
1280 (cmd != TIOCSERCONFIG) && (cmd != TIOCSERGSTRUCT) &&
1281 (cmd != TIOCMIWAIT) && (cmd != TIOCGICOUNT)) {
1282 if (tty->flags & (1 << TTY_IO_ERROR))
1283 return -EIO;
1284 }
1285
1286 switch (cmd) {
1287 case TIOCMGET:
1288 return get_modem_info(info, (unsigned int *)arg);
1289 case TIOCMBIS:
1290 case TIOCMBIC:
1291 case TIOCMSET:
1292 return set_modem_info(info, cmd, (unsigned int *)arg);
1293 case TIOCGSERIAL:
1294 return get_serial_info(info,
1295 (struct serial_struct *)arg);
1296 case TIOCSSERIAL:
1297 return set_serial_info(info,
1298 (struct serial_struct *)arg);
1299 case TIOCSERGETLSR: /* Get line status register */
1300 return get_lsr_info(info, (unsigned int *)arg);
1301 /*
1302 * Wait for any of the 4 modem inputs (DCD,RI,DSR,CTS) to change
1303 * - mask passed in arg for lines of interest
1304 * (use |'ed TIOCM_RNG/DSR/CD/CTS for masking)
1305 * Caller should use TIOCGICOUNT to see which one it was
1306 */
1307 case TIOCMIWAIT:
1308 return 0;
1309 /*
1310 * Get counter of input serial line interrupts (DCD,RI,DSR,CTS)
1311 * Return: write counters to the user passed counter struct
1312 * NB: both 1->0 and 0->1 transitions are counted except for
1313 * RI where only 0->1 is counted.
1314 */
1315 case TIOCGICOUNT:
1316 /* disable interrupts while getting interrupt count */
1317 spin_lock_irqsave(&info->state->sicc_lock,flags);
1318 cnow = info->state->icount;
1319 spin_unlock_irqrestore(&info->state->sicc_lock,flags);
1320 icount.cts = cnow.cts;
1321 icount.dsr = cnow.dsr;
1322 icount.rng = cnow.rng;
1323 icount.dcd = cnow.dcd;
1324 icount.rx = cnow.rx;
1325 icount.tx = cnow.tx;
1326 icount.frame = cnow.frame;
1327 icount.overrun = cnow.overrun;
1328 icount.parity = cnow.parity;
1329 icount.brk = cnow.brk;
1330 icount.buf_overrun = cnow.buf_overrun;
1331
1332 return copy_to_user((void *)arg, &icount, sizeof(icount))
1333 ? -EFAULT : 0;
1334
1335 default:
1336 return -ENOIOCTLCMD;
1337 }
1338 return 0;
1339}
1340
1341static void siccuart_set_termios(struct tty_struct *tty, struct termios *old_termios)
1342{
1343 struct SICC_info *info = tty->driver_data;
1344 unsigned long flags;
1345 unsigned int cflag = tty->termios->c_cflag;
1346
1347 if ((cflag ^ old_termios->c_cflag) == 0 &&
1348 RELEVENT_IFLAG(tty->termios->c_iflag ^ old_termios->c_iflag) == 0)
1349 return;
1350
1351 siccuart_change_speed(info, old_termios);
1352
1353 /* Handle transition to B0 status */
1354 if ((old_termios->c_cflag & CBAUD) &&
1355 !(cflag & CBAUD)) {
1356 /* disable interrupts while setting break state */
1357 spin_lock_irqsave(&info->state->sicc_lock,flags);
1358 info->mctrl &= ~(TIOCM_RTS | TIOCM_DTR);
1359 info->port->set_mctrl(info->port, info->mctrl);
1360 spin_unlock_irqrestore(&info->state->sicc_lock,flags);
1361 }
1362
1363 /* Handle transition away from B0 status */
1364 if (!(old_termios->c_cflag & CBAUD) &&
1365 (cflag & CBAUD)) {
1366 /* disable interrupts while setting break state */
1367 spin_lock_irqsave(&info->state->sicc_lock,flags);
1368 info->mctrl |= TIOCM_DTR;
1369 if (!(cflag & CRTSCTS) ||
1370 !test_bit(TTY_THROTTLED, &tty->flags))
1371 info->mctrl |= TIOCM_RTS;
1372 info->port->set_mctrl(info->port, info->mctrl);
1373 spin_unlock_irqrestore(&info->state->sicc_lock,flags);
1374 }
1375
1376 /* Handle turning off CRTSCTS */
1377 if ((old_termios->c_cflag & CRTSCTS) &&
1378 !(cflag & CRTSCTS)) {
1379 tty->hw_stopped = 0;
1380 siccuart_start(tty);
1381 }
1382
1383#if 0
1384 /*
1385 * No need to wake up processes in open wait, since they
1386 * sample the CLOCAL flag once, and don't recheck it.
1387 * XXX It's not clear whether the current behavior is correct
1388 * or not. Hence, this may change.....
1389 */
1390 if (!(old_termios->c_cflag & CLOCAL) &&
1391 (tty->termios->c_cflag & CLOCAL))
1392 wake_up_interruptible(&info->open_wait);
1393#endif
1394}
1395
1396static void siccuart_close(struct tty_struct *tty, struct file *filp)
1397{
1398 struct SICC_info *info = tty->driver_data;
1399 struct SICC_state *state;
1400 unsigned long flags;
1401
1402 if (!info)
1403 return;
1404
1405 state = info->state;
1406
1407 //pr_debug("siccuart_close() called\n");
1408
1409 /* lock tty->driver_data while closing port */
1410 spin_lock_irqsave(&info->state->sicc_lock,flags);
1411
1412 if (tty_hung_up_p(filp)) {
1413 goto quick_close;
1414 }
1415
1416 if ((tty->count == 1) && (state->count != 1)) {
1417 /*
1418 * Uh, oh. tty->count is 1, which means that the tty
1419 * structure will be freed. state->count should always
1420 * be one in these conditions. If it's greater than
1421 * one, we've got real problems, since it means the
1422 * serial port won't be shutdown.
1423 */
1424 printk("siccuart_close: bad serial port count; tty->count is 1, state->count is %d\n", state->count);
1425 state->count = 1;
1426 }
1427 if (--state->count < 0) {
1428 printk("rs_close: bad serial port count for %s: %d\n", tty->name, state->count);
1429 state->count = 0;
1430 }
1431 if (state->count) {
1432 goto quick_close;
1433 }
1434 info->flags |= ASYNC_CLOSING;
1435 spin_unlock_irqrestore(&info->state->sicc_lock,flags);
1436 /*
1437 * Now we wait for the transmit buffer to clear; and we notify
1438 * the line discipline to only process XON/XOFF characters.
1439 */
1440 tty->closing = 1;
1441 if (info->state->closing_wait != ASYNC_CLOSING_WAIT_NONE)
1442 tty_wait_until_sent(tty, info->state->closing_wait);
1443 /*
1444 * At this point, we stop accepting input. To do this, we
1445 * disable the receive line status interrupts.
1446 */
1447 if (info->flags & ASYNC_INITIALIZED) {
1448 siccuart_disable_rx_interrupt(info);
1449 /*
1450 * Before we drop DTR, make sure the UART transmitter
1451 * has completely drained; this is especially
1452 * important if there is a transmit FIFO!
1453 */
1454 siccuart_wait_until_sent(tty, info->timeout);
1455 }
1456 siccuart_shutdown(info);
1457 if (tty->driver->flush_buffer)
1458 tty->driver->flush_buffer(tty);
1459 if (tty->ldisc.flush_buffer)
1460 tty->ldisc.flush_buffer(tty);
1461 tty->closing = 0;
1462 info->event = 0;
1463 info->tty = NULL;
1464 if (info->blocked_open) {
1465 if (info->state->close_delay)
1466 schedule_timeout_interruptible(info->state->close_delay);
1467 wake_up_interruptible(&info->open_wait);
1468 }
1469 info->flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CLOSING);
1470 wake_up_interruptible(&info->close_wait);
1471 return;
1472
1473quick_close:
1474 spin_unlock_irqrestore(&info->state->sicc_lock,flags);
1475 return;
1476}
1477
1478static void siccuart_wait_until_sent(struct tty_struct *tty, int timeout)
1479{
1480 struct SICC_info *info = (struct SICC_info *) tty->driver_data;
1481 unsigned long char_time, expire;
1482
1483 if (info->port->fifosize == 0)
1484 return;
1485
1486 /*
1487 * Set the check interval to be 1/5 of the estimated time to
1488 * send a single character, and make it at least 1. The check
1489 * interval should also be less than the timeout.
1490 *
1491 * Note: we have to use pretty tight timings here to satisfy
1492 * the NIST-PCTS.
1493 */
1494 char_time = (info->timeout - msecs_to_jiffies(20)) / info->port->fifosize;
1495 char_time = char_time / 5;
1496 if (char_time == 0)
1497 char_time = 1;
1498
1499 // Crazy!! sometimes the input arg 'timeout' can be negtive numbers :-(
1500 if (timeout >= 0 && timeout < char_time)
1501 char_time = timeout;
1502 /*
1503 * If the transmitter hasn't cleared in twice the approximate
1504 * amount of time to send the entire FIFO, it probably won't
1505 * ever clear. This assumes the UART isn't doing flow
1506 * control, which is currently the case. Hence, if it ever
1507 * takes longer than info->timeout, this is probably due to a
1508 * UART bug of some kind. So, we clamp the timeout parameter at
1509 * 2*info->timeout.
1510 */
1511 if (!timeout || timeout > 2 * info->timeout)
1512 timeout = 2 * info->timeout;
1513
1514 expire = jiffies + timeout;
1515 pr_debug("siccuart_wait_until_sent(%d), jiff=%lu, expire=%lu char_time=%lu...\n",
1516 tty->index, jiffies,
1517 expire, char_time);
1518 while ((readb(info->port->uart_base + BL_SICC_LSR) & _LSR_TX_ALL) != _LSR_TX_ALL) {
1519 schedule_timeout_interruptible(char_time);
1520 if (signal_pending(current))
1521 break;
1522 if (timeout && time_after(jiffies, expire))
1523 break;
1524 }
1525 set_current_state(TASK_RUNNING);
1526}
1527
1528static void siccuart_hangup(struct tty_struct *tty)
1529{
1530 struct SICC_info *info = tty->driver_data;
1531 struct SICC_state *state = info->state;
1532
1533 siccuart_flush_buffer(tty);
1534 if (info->flags & ASYNC_CLOSING)
1535 return;
1536 siccuart_shutdown(info);
1537 info->event = 0;
1538 state->count = 0;
1539 info->flags &= ~ASYNC_NORMAL_ACTIVE;
1540 info->tty = NULL;
1541 wake_up_interruptible(&info->open_wait);
1542}
1543
1544static int block_til_ready(struct tty_struct *tty, struct file *filp,
1545 struct SICC_info *info)
1546{
1547 DECLARE_WAITQUEUE(wait, current);
1548 struct SICC_state *state = info->state;
1549 unsigned long flags;
1550 int do_clocal = 0, extra_count = 0, retval;
1551
1552 /*
1553 * If the device is in the middle of being closed, then block
1554 * until it's done, and then try again.
1555 */
1556 if (tty_hung_up_p(filp) ||
1557 (info->flags & ASYNC_CLOSING)) {
1558 if (info->flags & ASYNC_CLOSING)
1559 interruptible_sleep_on(&info->close_wait);
1560 return (info->flags & ASYNC_HUP_NOTIFY) ?
1561 -EAGAIN : -ERESTARTSYS;
1562 }
1563
1564 /*
1565 * If non-blocking mode is set, or the port is not enabled,
1566 * then make the check up front and then exit.
1567 */
1568 if ((filp->f_flags & O_NONBLOCK) ||
1569 (tty->flags & (1 << TTY_IO_ERROR))) {
1570 info->flags |= ASYNC_NORMAL_ACTIVE;
1571 return 0;
1572 }
1573
1574 if (tty->termios->c_cflag & CLOCAL)
1575 do_clocal = 1;
1576
1577 /*
1578 * Block waiting for the carrier detect and the line to become
1579 * free (i.e., not in use by the callout). While we are in
1580 * this loop, state->count is dropped by one, so that
1581 * rs_close() knows when to free things. We restore it upon
1582 * exit, either normal or abnormal.
1583 */
1584 retval = 0;
1585 add_wait_queue(&info->open_wait, &wait);
1586 /* lock while decrementing state->count */
1587 spin_lock_irqsave(&info->state->sicc_lock,flags);
1588 if (!tty_hung_up_p(filp)) {
1589 extra_count = 1;
1590 state->count--;
1591 }
1592 spin_unlock_irqrestore(&info->state->sicc_lock,flags);
1593 info->blocked_open++;
1594 while (1) {
1595 /* disable interrupts while setting modem control lines */
1596 spin_lock_irqsave(&info->state->sicc_lock,flags);
1597 if (tty->termios->c_cflag & CBAUD) {
1598 info->mctrl = TIOCM_DTR | TIOCM_RTS;
1599 info->port->set_mctrl(info->port, info->mctrl);
1600 }
1601 spin_unlock_irqrestore(&info->state->sicc_lock,flags);
1602 set_current_state(TASK_INTERRUPTIBLE);
1603 if (tty_hung_up_p(filp) ||
1604 !(info->flags & ASYNC_INITIALIZED)) {
1605 if (info->flags & ASYNC_HUP_NOTIFY)
1606 retval = -EAGAIN;
1607 else
1608 retval = -ERESTARTSYS;
1609 break;
1610 }
1611 if (!(info->flags & ASYNC_CLOSING) &&
1612 (do_clocal /*|| (UART_GET_FR(info->port) & SICC_UARTFR_DCD)*/))
1613 break;
1614 if (signal_pending(current)) {
1615 retval = -ERESTARTSYS;
1616 break;
1617 }
1618 schedule();
1619 }
1620 set_current_state(TASK_RUNNING);
1621 remove_wait_queue(&info->open_wait, &wait);
1622 if (extra_count)
1623 state->count++;
1624 info->blocked_open--;
1625 if (retval)
1626 return retval;
1627 info->flags |= ASYNC_NORMAL_ACTIVE;
1628 return 0;
1629}
1630
1631static struct SICC_info *siccuart_get(int line)
1632{
1633 struct SICC_info *info;
1634 struct SICC_state *state = sicc_state + line;
1635
1636 state->count++;
1637 if (state->info)
1638 return state->info;
1639 info = kzalloc(sizeof(struct SICC_info), GFP_KERNEL);
1640 if (info) {
1641 init_waitqueue_head(&info->open_wait);
1642 init_waitqueue_head(&info->close_wait);
1643 init_waitqueue_head(&info->delta_msr_wait);
1644 info->flags = state->flags;
1645 info->state = state;
1646 info->port = sicc_ports + line;
1647 tasklet_init(&info->tlet, siccuart_tasklet_action,
1648 (unsigned long)info);
1649 }
1650 if (state->info) {
1651 kfree(info);
1652 return state->info;
1653 }
1654 state->info = info;
1655 return info;
1656}
1657
1658static int siccuart_open(struct tty_struct *tty, struct file *filp)
1659{
1660 struct SICC_info *info;
1661 int retval, line = tty->index;
1662
1663
1664 // is this a line that we've got?
1665 if (line >= SERIAL_SICC_NR) {
1666 return -ENODEV;
1667 }
1668
1669 info = siccuart_get(line);
1670 if (!info)
1671 return -ENOMEM;
1672
1673 tty->driver_data = info;
1674 info->tty = tty;
1675 info->tty->low_latency = (info->flags & ASYNC_LOW_LATENCY) ? 1 : 0;
1676
1677 /*
1678 * Make sure we have the temporary buffer allocated
1679 */
1680 if (!tmp_buf) {
1681 unsigned long page = get_zeroed_page(GFP_KERNEL);
1682 if (tmp_buf)
1683 free_page(page);
1684 else if (!page) {
1685 return -ENOMEM;
1686 }
1687 tmp_buf = (u_char *)page;
1688 }
1689
1690 /*
1691 * If the port is in the middle of closing, bail out now.
1692 */
1693 if (tty_hung_up_p(filp) ||
1694 (info->flags & ASYNC_CLOSING)) {
1695 if (info->flags & ASYNC_CLOSING)
1696 interruptible_sleep_on(&info->close_wait);
1697 return -EAGAIN;
1698 }
1699
1700 /*
1701 * Start up the serial port
1702 */
1703 retval = siccuart_startup(info);
1704 if (retval) {
1705 return retval;
1706 }
1707
1708 retval = block_til_ready(tty, filp, info);
1709 if (retval) {
1710 return retval;
1711 }
1712
1713#ifdef CONFIG_SERIAL_SICC_CONSOLE
1714 if (siccuart_cons.cflag && siccuart_cons.index == line) {
1715 tty->termios->c_cflag = siccuart_cons.cflag;
1716 siccuart_cons.cflag = 0;
1717 siccuart_change_speed(info, NULL);
1718 }
1719#endif
1720 return 0;
1721}
1722
1723static const struct tty_operations sicc_ops = {
1724 .open = siccuart_open,
1725 .close = siccuart_close,
1726 .write = siccuart_write,
1727 .put_char = siccuart_put_char,
1728 .flush_chars = siccuart_flush_chars,
1729 .write_room = siccuart_write_room,
1730 .chars_in_buffer = siccuart_chars_in_buffer,
1731 .flush_buffer = siccuart_flush_buffer,
1732 .ioctl = siccuart_ioctl,
1733 .throttle = siccuart_throttle,
1734 .unthrottle = siccuart_unthrottle,
1735 .send_xchar = siccuart_send_xchar,
1736 .set_termios = siccuart_set_termios,
1737 .stop = siccuart_stop,
1738 .start = siccuart_start,
1739 .hangup = siccuart_hangup,
1740 .break_ctl = siccuart_break_ctl,
1741 .wait_until_sent = siccuart_wait_until_sent,
1742};
1743
1744int __init siccuart_init(void)
1745{
1746 int i;
1747 siccnormal_driver = alloc_tty_driver(SERIAL_SICC_NR);
1748 if (!siccnormal_driver)
1749 return -ENOMEM;
1750 printk("IBM Vesta SICC serial port driver V 0.1 by Yudong Yang and Yi Ge / IBM CRL .\n");
1751 siccnormal_driver->driver_name = "serial_sicc";
1752 siccnormal_driver->owner = THIS_MODULE;
1753 siccnormal_driver->name = SERIAL_SICC_NAME;
1754 siccnormal_driver->major = SERIAL_SICC_MAJOR;
1755 siccnormal_driver->minor_start = SERIAL_SICC_MINOR;
1756 siccnormal_driver->type = TTY_DRIVER_TYPE_SERIAL;
1757 siccnormal_driver->subtype = SERIAL_TYPE_NORMAL;
1758 siccnormal_driver->init_termios = tty_std_termios;
1759 siccnormal_driver->init_termios.c_cflag = B9600 | CS8 | CREAD | HUPCL | CLOCAL;
1760 siccnormal_driver->flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_DYNAMIC_DEV;
1761 tty_set_operations(siccnormal_driver, &sicc_ops);
1762
1763 if (tty_register_driver(siccnormal_driver))
1764 panic("Couldn't register SICC serial driver\n");
1765
1766 for (i = 0; i < SERIAL_SICC_NR; i++) {
1767 struct SICC_state *state = sicc_state + i;
1768 state->line = i;
1769 state->close_delay = msecs_to_jiffies(500);
1770 state->closing_wait = 30 * HZ;
1771 spin_lock_init(&state->sicc_lock);
1772 }
1773
1774
1775 return 0;
1776}
1777
1778__initcall(siccuart_init);
1779
1780#ifdef CONFIG_SERIAL_SICC_CONSOLE
1781/************** console driver *****************/
1782
1783/*
1784 * This code is currently never used; console->read is never called.
1785 * Therefore, although we have an implementation, we don't use it.
1786 * FIXME: the "const char *s" should be fixed to "char *s" some day.
1787 * (when the definition in include/linux/console.h is also fixed)
1788 */
1789#ifdef used_and_not_const_char_pointer
1790static int siccuart_console_read(struct console *co, const char *s, u_int count)
1791{
1792 struct SICC_port *port = &sicc_ports[co->index];
1793 unsigned int status;
1794 char *w;
1795 int c;
1796
1797 pr_debug("siccuart_console_read() called\n");
1798
1799 c = 0;
1800 w = s;
1801 while (c < count) {
1802 if(readb(port->uart_base + BL_SICC_LSR) & _LSR_RBR_FULL) {
1803 *w++ = readb(port->uart_base + BL_SICC_RBR);
1804 c++;
1805 } else {
1806 // nothing more to get, return
1807 return c;
1808 }
1809 }
1810 // return the count
1811 return c;
1812}
1813#endif
1814
1815/*
1816 * Print a string to the serial port trying not to disturb
1817 * any possible real use of the port...
1818 *
1819 * The console_lock must be held when we get here.
1820 */
1821static void siccuart_console_write(struct console *co, const char *s, u_int count)
1822{
1823 struct SICC_port *port = &sicc_ports[co->index];
1824 unsigned int old_cr;
1825 int i;
1826
1827 /*
1828 * First save the CR then disable the interrupts
1829 */
1830 old_cr = readb(port->uart_base + BL_SICC_TxCR);
1831 writeb(old_cr & ~_TxCR_DME_MASK, port->uart_base + BL_SICC_TxCR);
1832
1833 /*
1834 * Now, do each character
1835 */
1836 for (i = 0; i < count; i++) {
1837 while ((readb(port->uart_base + BL_SICC_LSR)&_LSR_TX_ALL) != _LSR_TX_ALL);
1838 writeb(s[i], port->uart_base + BL_SICC_TBR);
1839 if (s[i] == '\n') {
1840 while ((readb(port->uart_base + BL_SICC_LSR)&_LSR_TX_ALL) != _LSR_TX_ALL);
1841 writeb('\r', port->uart_base + BL_SICC_TBR);
1842 }
1843 }
1844
1845 /*
1846 * Finally, wait for transmitter to become empty
1847 * and restore the TCR
1848 */
1849 while ((readb(port->uart_base + BL_SICC_LSR)&_LSR_TX_ALL) != _LSR_TX_ALL);
1850 writeb(old_cr, port->uart_base + BL_SICC_TxCR);
1851}
1852
1853/*
1854 * Receive character from the serial port
1855 */
1856static int siccuart_console_wait_key(struct console *co)
1857{
1858 struct SICC_port *port = &sicc_ports[co->index];
1859 int c;
1860
1861 while(!(readb(port->uart_base + BL_SICC_LSR) & _LSR_RBR_FULL));
1862 c = readb(port->uart_base + BL_SICC_RBR);
1863 return c;
1864}
1865
1866static struct tty_driver *siccuart_console_device(struct console *c, int *index)
1867{
1868 *index = c->index;
1869 return siccnormal_driver;
1870}
1871
1872static int __init siccuart_console_setup(struct console *co, char *options)
1873{
1874 struct SICC_port *port;
1875 int baud = 9600;
1876 int bits = 8;
1877 int parity = 'n';
1878 u_int cflag = CREAD | HUPCL | CLOCAL;
1879 u_int lcr_h, quot;
1880
1881
1882 if (co->index >= SERIAL_SICC_NR)
1883 co->index = 0;
1884
1885 port = &sicc_ports[co->index];
1886
1887 if (port->uart_base == 0)
1888 port->uart_base = (int)ioremap(port->uart_base_phys, PAGE_SIZE);
1889
1890 if (options) {
1891 char *s = options;
1892 baud = simple_strtoul(s, NULL, 10);
1893 while (*s >= '0' && *s <= '9')
1894 s++;
1895 if (*s) parity = *s++;
1896 if (*s) bits = *s - '0';
1897 }
1898
1899 /*
1900 * Now construct a cflag setting.
1901 */
1902 switch (baud) {
1903 case 1200: cflag |= B1200; break;
1904 case 2400: cflag |= B2400; break;
1905 case 4800: cflag |= B4800; break;
1906 default: cflag |= B9600; baud = 9600; break;
1907 case 19200: cflag |= B19200; break;
1908 case 38400: cflag |= B38400; break;
1909 case 57600: cflag |= B57600; break;
1910 case 115200: cflag |= B115200; break;
1911 }
1912 switch (bits) {
1913 case 7: cflag |= CS7; lcr_h = _LCR_PE_DISABLE | _LCR_DB_7_BITS | _LCR_SB_1_BIT; break;
1914 default: cflag |= CS8; lcr_h = _LCR_PE_DISABLE | _LCR_DB_8_BITS | _LCR_SB_1_BIT; break;
1915 }
1916 switch (parity) {
1917 case 'o':
1918 case 'O': cflag |= PARODD; lcr_h |= _LCR_PTY_ODD; break;
1919 case 'e':
1920 case 'E': cflag |= PARENB; lcr_h |= _LCR_PE_ENABLE | _LCR_PTY_ODD; break;
1921 }
1922
1923 co->cflag = cflag;
1924
1925
1926 {
1927 // a copy of is inserted here ppc403SetBaud(com_port, (int)9600);
1928 unsigned long divisor, clockSource, temp;
1929 unsigned int rate = baud;
1930
1931 /* Ensure CICCR[7] is 0 to select Internal Baud Clock */
1932 powerpcMtcic_cr((unsigned long)(powerpcMfcic_cr() & 0xFEFFFFFF));
1933
1934 /* Determine Internal Baud Clock Frequency */
1935 /* powerpcMfclkgpcr() reads DCR 0x120 - the*/
1936 /* SCCR (Serial Clock Control Register) on Vesta */
1937 temp = powerpcMfclkgpcr();
1938
1939 if(temp & 0x00000080) {
1940 clockSource = 324000000;
1941 }
1942 else {
1943 clockSource = 216000000;
1944 }
1945 clockSource = clockSource/(unsigned long)((temp&0x00FC0000)>>18);
1946 divisor = clockSource/(16*rate) - 1;
1947 /* divisor has only 12 bits of resolution */
1948 if(divisor>0x00000FFF){
1949 divisor=0x00000FFF;
1950 }
1951
1952 quot = divisor;
1953 }
1954
1955 writeb((quot & 0x00000F00)>>8, port->uart_base + BL_SICC_BRDH );
1956 writeb( quot & 0x00000FF, port->uart_base + BL_SICC_BRDL );
1957
1958 /* Set CTL2 reg to use external clock (ExtClk) and enable FIFOs. */
1959 /* For now, do NOT use FIFOs since 403 UART did not have this */
1960 /* capability and this driver was inherited from 403UART. */
1961 writeb(_CTL2_EXTERN, port->uart_base + BL_SICC_CTL2);
1962
1963 writeb(lcr_h, port->uart_base + BL_SICC_LCR);
1964 writeb(_RCR_ER_ENABLE | _RCR_PME_HARD, port->uart_base + BL_SICC_RCR);
1965 writeb( _TxCR_ET_ENABLE , port->uart_base + BL_SICC_TxCR);
1966
1967 // writeb(, info->port->uart_base + BL_SICC_RCR );
1968 /*
1969 * Transmitter Command Register: Transmitter enabled & DMA + TBR interrupt
1970 * + Transmitter Empty interrupt + Transmitter error interrupt disabled &
1971 * Stop mode when CTS active enabled & Transmit Break + Pattern Generation
1972 * mode disabled.
1973 */
1974
1975 writeb( 0x00, port->uart_base + BL_SICC_IrCR ); // disable IrDA
1976
1977 readb(port->uart_base + BL_SICC_RBR);
1978
1979 writeb(0xf8, port->uart_base + BL_SICC_LSR); /* reset bits 0-4 of LSR */
1980
1981 /* we will enable the port as we need it */
1982
1983 return 0;
1984}
1985
1986static struct console siccuart_cons =
1987{
1988 .name = SERIAL_SICC_NAME,
1989 .write = siccuart_console_write,
1990#ifdef used_and_not_const_char_pointer
1991 .read = siccuart_console_read,
1992#endif
1993 .device = siccuart_console_device,
1994 .wait_key = siccuart_console_wait_key,
1995 .setup = siccuart_console_setup,
1996 .flags = CON_PRINTBUFFER,
1997 .index = -1,
1998};
1999
2000void __init sicc_console_init(void)
2001{
2002 register_console(&siccuart_cons);
2003}
2004
2005#endif /* CONFIG_SERIAL_SICC_CONSOLE */
diff --git a/arch/ppc/8260_io/Kconfig b/arch/ppc/8260_io/Kconfig
deleted file mode 100644
index ea9651e2dd6a..000000000000
--- a/arch/ppc/8260_io/Kconfig
+++ /dev/null
@@ -1,65 +0,0 @@
1#
2# CPM2 Communication options
3#
4
5menu "CPM2 Options"
6 depends on CPM2
7
8config SCC_ENET
9 bool "CPM SCC Ethernet"
10 depends on NET_ETHERNET
11
12#
13# CONFIG_FEC_ENET is only used to get netdevices to call our init
14# function. Any combination of FCC1,2,3 are supported.
15#
16config FEC_ENET
17 bool "FCC Ethernet"
18 depends on NET_ETHERNET
19
20config FCC1_ENET
21 bool "Ethernet on FCC1"
22 depends on FEC_ENET
23 help
24 Use CPM2 fast Ethernet controller 1 to drive Ethernet (default).
25
26config FCC2_ENET
27 bool "Ethernet on FCC2"
28 depends on FEC_ENET
29 help
30 Use CPM2 fast Ethernet controller 2 to drive Ethernet.
31
32config FCC3_ENET
33 bool "Ethernet on FCC3"
34 depends on FEC_ENET
35 help
36 Use CPM2 fast Ethernet controller 3 to drive Ethernet.
37
38config USE_MDIO
39 bool "Use MDIO for PHY configuration"
40 depends on FEC_ENET
41
42choice
43 prompt "Type of PHY"
44 depends on 8260 && USE_MDIO
45 default FCC_GENERIC_PHY
46
47config FCC_LXT970
48 bool "LXT970"
49
50config FCC_LXT971
51 bool "LXT971"
52
53config FCC_QS6612
54 bool "QS6612"
55
56config FCC_DM9131
57 bool "DM9131"
58
59config FCC_DM9161
60 bool "DM9161"
61
62config FCC_GENERIC_PHY
63 bool "Generic"
64endchoice
65endmenu
diff --git a/arch/ppc/8260_io/Makefile b/arch/ppc/8260_io/Makefile
deleted file mode 100644
index 971f292c5d48..000000000000
--- a/arch/ppc/8260_io/Makefile
+++ /dev/null
@@ -1,6 +0,0 @@
1#
2# Makefile for the linux ppc-specific parts of comm processor (v2)
3#
4
5obj-$(CONFIG_FEC_ENET) += fcc_enet.o
6obj-$(CONFIG_SCC_ENET) += enet.o
diff --git a/arch/ppc/8260_io/enet.c b/arch/ppc/8260_io/enet.c
deleted file mode 100644
index ec1defea9c1e..000000000000
--- a/arch/ppc/8260_io/enet.c
+++ /dev/null
@@ -1,865 +0,0 @@
1/*
2 * Ethernet driver for Motorola MPC8260.
3 * Copyright (c) 1999 Dan Malek (dmalek@jlc.net)
4 * Copyright (c) 2000 MontaVista Software Inc. (source@mvista.com)
5 * 2.3.99 Updates
6 *
7 * I copied this from the 8xx CPM Ethernet driver, so follow the
8 * credits back through that.
9 *
10 * This version of the driver is somewhat selectable for the different
11 * processor/board combinations. It works for the boards I know about
12 * now, and should be easily modified to include others. Some of the
13 * configuration information is contained in <asm/cpm1.h> and the
14 * remainder is here.
15 *
16 * Buffer descriptors are kept in the CPM dual port RAM, and the frame
17 * buffers are in the host memory.
18 *
19 * Right now, I am very watseful with the buffers. I allocate memory
20 * pages and then divide them into 2K frame buffers. This way I know I
21 * have buffers large enough to hold one frame within one buffer descriptor.
22 * Once I get this working, I will use 64 or 128 byte CPM buffers, which
23 * will be much more memory efficient and will easily handle lots of
24 * small packets.
25 *
26 */
27#include <linux/kernel.h>
28#include <linux/sched.h>
29#include <linux/string.h>
30#include <linux/ptrace.h>
31#include <linux/errno.h>
32#include <linux/ioport.h>
33#include <linux/slab.h>
34#include <linux/interrupt.h>
35#include <linux/init.h>
36#include <linux/delay.h>
37#include <linux/netdevice.h>
38#include <linux/etherdevice.h>
39#include <linux/skbuff.h>
40#include <linux/spinlock.h>
41#include <linux/bitops.h>
42
43#include <asm/immap_cpm2.h>
44#include <asm/pgtable.h>
45#include <asm/mpc8260.h>
46#include <asm/uaccess.h>
47#include <asm/cpm2.h>
48#include <asm/irq.h>
49
50/*
51 * Theory of Operation
52 *
53 * The MPC8260 CPM performs the Ethernet processing on an SCC. It can use
54 * an aribtrary number of buffers on byte boundaries, but must have at
55 * least two receive buffers to prevent constant overrun conditions.
56 *
57 * The buffer descriptors are allocated from the CPM dual port memory
58 * with the data buffers allocated from host memory, just like all other
59 * serial communication protocols. The host memory buffers are allocated
60 * from the free page pool, and then divided into smaller receive and
61 * transmit buffers. The size of the buffers should be a power of two,
62 * since that nicely divides the page. This creates a ring buffer
63 * structure similar to the LANCE and other controllers.
64 *
65 * Like the LANCE driver:
66 * The driver runs as two independent, single-threaded flows of control. One
67 * is the send-packet routine, which enforces single-threaded use by the
68 * cep->tx_busy flag. The other thread is the interrupt handler, which is
69 * single threaded by the hardware and other software.
70 */
71
72/* The transmitter timeout
73 */
74#define TX_TIMEOUT (2*HZ)
75
76/* The number of Tx and Rx buffers. These are allocated from the page
77 * pool. The code may assume these are power of two, so it is best
78 * to keep them that size.
79 * We don't need to allocate pages for the transmitter. We just use
80 * the skbuffer directly.
81 */
82#define CPM_ENET_RX_PAGES 4
83#define CPM_ENET_RX_FRSIZE 2048
84#define CPM_ENET_RX_FRPPG (PAGE_SIZE / CPM_ENET_RX_FRSIZE)
85#define RX_RING_SIZE (CPM_ENET_RX_FRPPG * CPM_ENET_RX_PAGES)
86#define TX_RING_SIZE 8 /* Must be power of two */
87#define TX_RING_MOD_MASK 7 /* for this to work */
88
89/* The CPM stores dest/src/type, data, and checksum for receive packets.
90 */
91#define PKT_MAXBUF_SIZE 1518
92#define PKT_MINBUF_SIZE 64
93#define PKT_MAXBLR_SIZE 1520
94
95/* The CPM buffer descriptors track the ring buffers. The rx_bd_base and
96 * tx_bd_base always point to the base of the buffer descriptors. The
97 * cur_rx and cur_tx point to the currently available buffer.
98 * The dirty_tx tracks the current buffer that is being sent by the
99 * controller. The cur_tx and dirty_tx are equal under both completely
100 * empty and completely full conditions. The empty/ready indicator in
101 * the buffer descriptor determines the actual condition.
102 */
103struct scc_enet_private {
104 /* The saved address of a sent-in-place packet/buffer, for skfree(). */
105 struct sk_buff* tx_skbuff[TX_RING_SIZE];
106 ushort skb_cur;
107 ushort skb_dirty;
108
109 /* CPM dual port RAM relative addresses.
110 */
111 cbd_t *rx_bd_base; /* Address of Rx and Tx buffers. */
112 cbd_t *tx_bd_base;
113 cbd_t *cur_rx, *cur_tx; /* The next free ring entry */
114 cbd_t *dirty_tx; /* The ring entries to be free()ed. */
115 scc_t *sccp;
116 struct net_device_stats stats;
117 uint tx_full;
118 spinlock_t lock;
119};
120
121static int scc_enet_open(struct net_device *dev);
122static int scc_enet_start_xmit(struct sk_buff *skb, struct net_device *dev);
123static int scc_enet_rx(struct net_device *dev);
124static irqreturn_t scc_enet_interrupt(int irq, void *dev_id);
125static int scc_enet_close(struct net_device *dev);
126static struct net_device_stats *scc_enet_get_stats(struct net_device *dev);
127static void set_multicast_list(struct net_device *dev);
128
129/* These will be configurable for the SCC choice.
130*/
131#define CPM_ENET_BLOCK CPM_CR_SCC1_SBLOCK
132#define CPM_ENET_PAGE CPM_CR_SCC1_PAGE
133#define PROFF_ENET PROFF_SCC1
134#define SCC_ENET 0
135#define SIU_INT_ENET SIU_INT_SCC1
136
137/* These are both board and SCC dependent....
138*/
139#define PD_ENET_RXD ((uint)0x00000001)
140#define PD_ENET_TXD ((uint)0x00000002)
141#define PD_ENET_TENA ((uint)0x00000004)
142#define PC_ENET_RENA ((uint)0x00020000)
143#define PC_ENET_CLSN ((uint)0x00000004)
144#define PC_ENET_TXCLK ((uint)0x00000800)
145#define PC_ENET_RXCLK ((uint)0x00000400)
146#define CMX_CLK_ROUTE ((uint)0x25000000)
147#define CMX_CLK_MASK ((uint)0xff000000)
148
149/* Specific to a board.
150*/
151#define PC_EST8260_ENET_LOOPBACK ((uint)0x80000000)
152#define PC_EST8260_ENET_SQE ((uint)0x40000000)
153#define PC_EST8260_ENET_NOTFD ((uint)0x20000000)
154
155static int
156scc_enet_open(struct net_device *dev)
157{
158
159 /* I should reset the ring buffers here, but I don't yet know
160 * a simple way to do that.
161 */
162 netif_start_queue(dev);
163 return 0; /* Always succeed */
164}
165
166static int
167scc_enet_start_xmit(struct sk_buff *skb, struct net_device *dev)
168{
169 struct scc_enet_private *cep = (struct scc_enet_private *)dev->priv;
170 volatile cbd_t *bdp;
171
172
173 /* Fill in a Tx ring entry */
174 bdp = cep->cur_tx;
175
176#ifndef final_version
177 if (bdp->cbd_sc & BD_ENET_TX_READY) {
178 /* Ooops. All transmit buffers are full. Bail out.
179 * This should not happen, since cep->tx_full should be set.
180 */
181 printk("%s: tx queue full!.\n", dev->name);
182 return 1;
183 }
184#endif
185
186 /* Clear all of the status flags.
187 */
188 bdp->cbd_sc &= ~BD_ENET_TX_STATS;
189
190 /* If the frame is short, tell CPM to pad it.
191 */
192 if (skb->len <= ETH_ZLEN)
193 bdp->cbd_sc |= BD_ENET_TX_PAD;
194 else
195 bdp->cbd_sc &= ~BD_ENET_TX_PAD;
196
197 /* Set buffer length and buffer pointer.
198 */
199 bdp->cbd_datlen = skb->len;
200 bdp->cbd_bufaddr = __pa(skb->data);
201
202 /* Save skb pointer.
203 */
204 cep->tx_skbuff[cep->skb_cur] = skb;
205
206 cep->stats.tx_bytes += skb->len;
207 cep->skb_cur = (cep->skb_cur+1) & TX_RING_MOD_MASK;
208
209 spin_lock_irq(&cep->lock);
210
211 /* Send it on its way. Tell CPM its ready, interrupt when done,
212 * its the last BD of the frame, and to put the CRC on the end.
213 */
214 bdp->cbd_sc |= (BD_ENET_TX_READY | BD_ENET_TX_INTR | BD_ENET_TX_LAST | BD_ENET_TX_TC);
215
216 dev->trans_start = jiffies;
217
218 /* If this was the last BD in the ring, start at the beginning again.
219 */
220 if (bdp->cbd_sc & BD_ENET_TX_WRAP)
221 bdp = cep->tx_bd_base;
222 else
223 bdp++;
224
225 if (bdp->cbd_sc & BD_ENET_TX_READY) {
226 netif_stop_queue(dev);
227 cep->tx_full = 1;
228 }
229
230 cep->cur_tx = (cbd_t *)bdp;
231
232 spin_unlock_irq(&cep->lock);
233
234 return 0;
235}
236
237static void
238scc_enet_timeout(struct net_device *dev)
239{
240 struct scc_enet_private *cep = (struct scc_enet_private *)dev->priv;
241
242 printk("%s: transmit timed out.\n", dev->name);
243 cep->stats.tx_errors++;
244#ifndef final_version
245 {
246 int i;
247 cbd_t *bdp;
248 printk(" Ring data dump: cur_tx %p%s cur_rx %p.\n",
249 cep->cur_tx, cep->tx_full ? " (full)" : "",
250 cep->cur_rx);
251 bdp = cep->tx_bd_base;
252 printk(" Tx @base %p :\n", bdp);
253 for (i = 0 ; i < TX_RING_SIZE; i++, bdp++)
254 printk("%04x %04x %08x\n",
255 bdp->cbd_sc,
256 bdp->cbd_datlen,
257 bdp->cbd_bufaddr);
258 bdp = cep->rx_bd_base;
259 printk(" Rx @base %p :\n", bdp);
260 for (i = 0 ; i < RX_RING_SIZE; i++, bdp++)
261 printk("%04x %04x %08x\n",
262 bdp->cbd_sc,
263 bdp->cbd_datlen,
264 bdp->cbd_bufaddr);
265 }
266#endif
267 if (!cep->tx_full)
268 netif_wake_queue(dev);
269}
270
271/* The interrupt handler.
272 * This is called from the CPM handler, not the MPC core interrupt.
273 */
274static irqreturn_t
275scc_enet_interrupt(int irq, void *dev_id)
276{
277 struct net_device *dev = dev_id;
278 volatile struct scc_enet_private *cep;
279 volatile cbd_t *bdp;
280 ushort int_events;
281 int must_restart;
282
283 cep = dev->priv;
284
285 /* Get the interrupt events that caused us to be here.
286 */
287 int_events = cep->sccp->scc_scce;
288 cep->sccp->scc_scce = int_events;
289 must_restart = 0;
290
291 /* Handle receive event in its own function.
292 */
293 if (int_events & SCCE_ENET_RXF)
294 scc_enet_rx(dev_id);
295
296 /* Check for a transmit error. The manual is a little unclear
297 * about this, so the debug code until I get it figured out. It
298 * appears that if TXE is set, then TXB is not set. However,
299 * if carrier sense is lost during frame transmission, the TXE
300 * bit is set, "and continues the buffer transmission normally."
301 * I don't know if "normally" implies TXB is set when the buffer
302 * descriptor is closed.....trial and error :-).
303 */
304
305 /* Transmit OK, or non-fatal error. Update the buffer descriptors.
306 */
307 if (int_events & (SCCE_ENET_TXE | SCCE_ENET_TXB)) {
308 spin_lock(&cep->lock);
309 bdp = cep->dirty_tx;
310 while ((bdp->cbd_sc&BD_ENET_TX_READY)==0) {
311 if ((bdp==cep->cur_tx) && (cep->tx_full == 0))
312 break;
313
314 if (bdp->cbd_sc & BD_ENET_TX_HB) /* No heartbeat */
315 cep->stats.tx_heartbeat_errors++;
316 if (bdp->cbd_sc & BD_ENET_TX_LC) /* Late collision */
317 cep->stats.tx_window_errors++;
318 if (bdp->cbd_sc & BD_ENET_TX_RL) /* Retrans limit */
319 cep->stats.tx_aborted_errors++;
320 if (bdp->cbd_sc & BD_ENET_TX_UN) /* Underrun */
321 cep->stats.tx_fifo_errors++;
322 if (bdp->cbd_sc & BD_ENET_TX_CSL) /* Carrier lost */
323 cep->stats.tx_carrier_errors++;
324
325
326 /* No heartbeat or Lost carrier are not really bad errors.
327 * The others require a restart transmit command.
328 */
329 if (bdp->cbd_sc &
330 (BD_ENET_TX_LC | BD_ENET_TX_RL | BD_ENET_TX_UN)) {
331 must_restart = 1;
332 cep->stats.tx_errors++;
333 }
334
335 cep->stats.tx_packets++;
336
337 /* Deferred means some collisions occurred during transmit,
338 * but we eventually sent the packet OK.
339 */
340 if (bdp->cbd_sc & BD_ENET_TX_DEF)
341 cep->stats.collisions++;
342
343 /* Free the sk buffer associated with this last transmit.
344 */
345 dev_kfree_skb_irq(cep->tx_skbuff[cep->skb_dirty]);
346 cep->skb_dirty = (cep->skb_dirty + 1) & TX_RING_MOD_MASK;
347
348 /* Update pointer to next buffer descriptor to be transmitted.
349 */
350 if (bdp->cbd_sc & BD_ENET_TX_WRAP)
351 bdp = cep->tx_bd_base;
352 else
353 bdp++;
354
355 /* I don't know if we can be held off from processing these
356 * interrupts for more than one frame time. I really hope
357 * not. In such a case, we would now want to check the
358 * currently available BD (cur_tx) and determine if any
359 * buffers between the dirty_tx and cur_tx have also been
360 * sent. We would want to process anything in between that
361 * does not have BD_ENET_TX_READY set.
362 */
363
364 /* Since we have freed up a buffer, the ring is no longer
365 * full.
366 */
367 if (cep->tx_full) {
368 cep->tx_full = 0;
369 if (netif_queue_stopped(dev)) {
370 netif_wake_queue(dev);
371 }
372 }
373
374 cep->dirty_tx = (cbd_t *)bdp;
375 }
376
377 if (must_restart) {
378 volatile cpm_cpm2_t *cp;
379
380 /* Some transmit errors cause the transmitter to shut
381 * down. We now issue a restart transmit. Since the
382 * errors close the BD and update the pointers, the restart
383 * _should_ pick up without having to reset any of our
384 * pointers either.
385 */
386
387 cp = cpmp;
388 cp->cp_cpcr =
389 mk_cr_cmd(CPM_ENET_PAGE, CPM_ENET_BLOCK, 0,
390 CPM_CR_RESTART_TX) | CPM_CR_FLG;
391 while (cp->cp_cpcr & CPM_CR_FLG);
392 }
393 spin_unlock(&cep->lock);
394 }
395
396 /* Check for receive busy, i.e. packets coming but no place to
397 * put them. This "can't happen" because the receive interrupt
398 * is tossing previous frames.
399 */
400 if (int_events & SCCE_ENET_BSY) {
401 cep->stats.rx_dropped++;
402 printk("SCC ENET: BSY can't happen.\n");
403 }
404
405 return IRQ_HANDLED;
406}
407
408/* During a receive, the cur_rx points to the current incoming buffer.
409 * When we update through the ring, if the next incoming buffer has
410 * not been given to the system, we just set the empty indicator,
411 * effectively tossing the packet.
412 */
413static int
414scc_enet_rx(struct net_device *dev)
415{
416 struct scc_enet_private *cep;
417 volatile cbd_t *bdp;
418 struct sk_buff *skb;
419 ushort pkt_len;
420
421 cep = dev->priv;
422
423 /* First, grab all of the stats for the incoming packet.
424 * These get messed up if we get called due to a busy condition.
425 */
426 bdp = cep->cur_rx;
427
428for (;;) {
429 if (bdp->cbd_sc & BD_ENET_RX_EMPTY)
430 break;
431
432#ifndef final_version
433 /* Since we have allocated space to hold a complete frame, both
434 * the first and last indicators should be set.
435 */
436 if ((bdp->cbd_sc & (BD_ENET_RX_FIRST | BD_ENET_RX_LAST)) !=
437 (BD_ENET_RX_FIRST | BD_ENET_RX_LAST))
438 printk("CPM ENET: rcv is not first+last\n");
439#endif
440
441 /* Frame too long or too short.
442 */
443 if (bdp->cbd_sc & (BD_ENET_RX_LG | BD_ENET_RX_SH))
444 cep->stats.rx_length_errors++;
445 if (bdp->cbd_sc & BD_ENET_RX_NO) /* Frame alignment */
446 cep->stats.rx_frame_errors++;
447 if (bdp->cbd_sc & BD_ENET_RX_CR) /* CRC Error */
448 cep->stats.rx_crc_errors++;
449 if (bdp->cbd_sc & BD_ENET_RX_OV) /* FIFO overrun */
450 cep->stats.rx_crc_errors++;
451
452 /* Report late collisions as a frame error.
453 * On this error, the BD is closed, but we don't know what we
454 * have in the buffer. So, just drop this frame on the floor.
455 */
456 if (bdp->cbd_sc & BD_ENET_RX_CL) {
457 cep->stats.rx_frame_errors++;
458 }
459 else {
460
461 /* Process the incoming frame.
462 */
463 cep->stats.rx_packets++;
464 pkt_len = bdp->cbd_datlen;
465 cep->stats.rx_bytes += pkt_len;
466
467 /* This does 16 byte alignment, much more than we need.
468 * The packet length includes FCS, but we don't want to
469 * include that when passing upstream as it messes up
470 * bridging applications.
471 */
472 skb = dev_alloc_skb(pkt_len-4);
473
474 if (skb == NULL) {
475 printk("%s: Memory squeeze, dropping packet.\n", dev->name);
476 cep->stats.rx_dropped++;
477 }
478 else {
479 skb_put(skb,pkt_len-4); /* Make room */
480 skb_copy_to_linear_data(skb,
481 (unsigned char *)__va(bdp->cbd_bufaddr),
482 pkt_len-4);
483 skb->protocol=eth_type_trans(skb,dev);
484 netif_rx(skb);
485 }
486 }
487
488 /* Clear the status flags for this buffer.
489 */
490 bdp->cbd_sc &= ~BD_ENET_RX_STATS;
491
492 /* Mark the buffer empty.
493 */
494 bdp->cbd_sc |= BD_ENET_RX_EMPTY;
495
496 /* Update BD pointer to next entry.
497 */
498 if (bdp->cbd_sc & BD_ENET_RX_WRAP)
499 bdp = cep->rx_bd_base;
500 else
501 bdp++;
502
503 }
504 cep->cur_rx = (cbd_t *)bdp;
505
506 return 0;
507}
508
509static int
510scc_enet_close(struct net_device *dev)
511{
512 /* Don't know what to do yet.
513 */
514 netif_stop_queue(dev);
515
516 return 0;
517}
518
519static struct net_device_stats *scc_enet_get_stats(struct net_device *dev)
520{
521 struct scc_enet_private *cep = (struct scc_enet_private *)dev->priv;
522
523 return &cep->stats;
524}
525
526/* Set or clear the multicast filter for this adaptor.
527 * Skeleton taken from sunlance driver.
528 * The CPM Ethernet implementation allows Multicast as well as individual
529 * MAC address filtering. Some of the drivers check to make sure it is
530 * a group multicast address, and discard those that are not. I guess I
531 * will do the same for now, but just remove the test if you want
532 * individual filtering as well (do the upper net layers want or support
533 * this kind of feature?).
534 */
535
536static void set_multicast_list(struct net_device *dev)
537{
538 struct scc_enet_private *cep;
539 struct dev_mc_list *dmi;
540 u_char *mcptr, *tdptr;
541 volatile scc_enet_t *ep;
542 int i, j;
543 cep = (struct scc_enet_private *)dev->priv;
544
545 /* Get pointer to SCC area in parameter RAM.
546 */
547 ep = (scc_enet_t *)dev->base_addr;
548
549 if (dev->flags&IFF_PROMISC) {
550
551 /* Log any net taps. */
552 printk("%s: Promiscuous mode enabled.\n", dev->name);
553 cep->sccp->scc_psmr |= SCC_PSMR_PRO;
554 } else {
555
556 cep->sccp->scc_psmr &= ~SCC_PSMR_PRO;
557
558 if (dev->flags & IFF_ALLMULTI) {
559 /* Catch all multicast addresses, so set the
560 * filter to all 1's.
561 */
562 ep->sen_gaddr1 = 0xffff;
563 ep->sen_gaddr2 = 0xffff;
564 ep->sen_gaddr3 = 0xffff;
565 ep->sen_gaddr4 = 0xffff;
566 }
567 else {
568 /* Clear filter and add the addresses in the list.
569 */
570 ep->sen_gaddr1 = 0;
571 ep->sen_gaddr2 = 0;
572 ep->sen_gaddr3 = 0;
573 ep->sen_gaddr4 = 0;
574
575 dmi = dev->mc_list;
576
577 for (i=0; i<dev->mc_count; i++) {
578
579 /* Only support group multicast for now.
580 */
581 if (!(dmi->dmi_addr[0] & 1))
582 continue;
583
584 /* The address in dmi_addr is LSB first,
585 * and taddr is MSB first. We have to
586 * copy bytes MSB first from dmi_addr.
587 */
588 mcptr = (u_char *)dmi->dmi_addr + 5;
589 tdptr = (u_char *)&ep->sen_taddrh;
590 for (j=0; j<6; j++)
591 *tdptr++ = *mcptr--;
592
593 /* Ask CPM to run CRC and set bit in
594 * filter mask.
595 */
596 cpmp->cp_cpcr = mk_cr_cmd(CPM_ENET_PAGE,
597 CPM_ENET_BLOCK, 0,
598 CPM_CR_SET_GADDR) | CPM_CR_FLG;
599 /* this delay is necessary here -- Cort */
600 udelay(10);
601 while (cpmp->cp_cpcr & CPM_CR_FLG);
602 }
603 }
604 }
605}
606
607/* Initialize the CPM Ethernet on SCC.
608 */
609static int __init scc_enet_init(void)
610{
611 struct net_device *dev;
612 struct scc_enet_private *cep;
613 int i, j, err;
614 uint dp_offset;
615 unsigned char *eap;
616 unsigned long mem_addr;
617 bd_t *bd;
618 volatile cbd_t *bdp;
619 volatile cpm_cpm2_t *cp;
620 volatile scc_t *sccp;
621 volatile scc_enet_t *ep;
622 volatile cpm2_map_t *immap;
623 volatile iop_cpm2_t *io;
624
625 cp = cpmp; /* Get pointer to Communication Processor */
626
627 immap = (cpm2_map_t *)CPM_MAP_ADDR; /* and to internal registers */
628 io = &immap->im_ioport;
629
630 bd = (bd_t *)__res;
631
632 /* Create an Ethernet device instance.
633 */
634 dev = alloc_etherdev(sizeof(*cep));
635 if (!dev)
636 return -ENOMEM;
637
638 cep = dev->priv;
639 spin_lock_init(&cep->lock);
640
641 /* Get pointer to SCC area in parameter RAM.
642 */
643 ep = (scc_enet_t *)(&immap->im_dprambase[PROFF_ENET]);
644
645 /* And another to the SCC register area.
646 */
647 sccp = (volatile scc_t *)(&immap->im_scc[SCC_ENET]);
648 cep->sccp = (scc_t *)sccp; /* Keep the pointer handy */
649
650 /* Disable receive and transmit in case someone left it running.
651 */
652 sccp->scc_gsmrl &= ~(SCC_GSMRL_ENR | SCC_GSMRL_ENT);
653
654 /* Configure port C and D pins for SCC Ethernet. This
655 * won't work for all SCC possibilities....it will be
656 * board/port specific.
657 */
658 io->iop_pparc |=
659 (PC_ENET_RENA | PC_ENET_CLSN | PC_ENET_TXCLK | PC_ENET_RXCLK);
660 io->iop_pdirc &=
661 ~(PC_ENET_RENA | PC_ENET_CLSN | PC_ENET_TXCLK | PC_ENET_RXCLK);
662 io->iop_psorc &=
663 ~(PC_ENET_RENA | PC_ENET_TXCLK | PC_ENET_RXCLK);
664 io->iop_psorc |= PC_ENET_CLSN;
665
666 io->iop_ppard |= (PD_ENET_RXD | PD_ENET_TXD | PD_ENET_TENA);
667 io->iop_pdird |= (PD_ENET_TXD | PD_ENET_TENA);
668 io->iop_pdird &= ~PD_ENET_RXD;
669 io->iop_psord |= PD_ENET_TXD;
670 io->iop_psord &= ~(PD_ENET_RXD | PD_ENET_TENA);
671
672 /* Configure Serial Interface clock routing.
673 * First, clear all SCC bits to zero, then set the ones we want.
674 */
675 immap->im_cpmux.cmx_scr &= ~CMX_CLK_MASK;
676 immap->im_cpmux.cmx_scr |= CMX_CLK_ROUTE;
677
678 /* Allocate space for the buffer descriptors in the DP ram.
679 * These are relative offsets in the DP ram address space.
680 * Initialize base addresses for the buffer descriptors.
681 */
682 dp_offset = cpm_dpalloc(sizeof(cbd_t) * RX_RING_SIZE, 8);
683 ep->sen_genscc.scc_rbase = dp_offset;
684 cep->rx_bd_base = (cbd_t *)cpm_dpram_addr(dp_offset);
685
686 dp_offset = cpm_dpalloc(sizeof(cbd_t) * TX_RING_SIZE, 8);
687 ep->sen_genscc.scc_tbase = dp_offset;
688 cep->tx_bd_base = (cbd_t *)cpm_dpram_addr(dp_offset);
689
690 cep->dirty_tx = cep->cur_tx = cep->tx_bd_base;
691 cep->cur_rx = cep->rx_bd_base;
692
693 ep->sen_genscc.scc_rfcr = CPMFCR_GBL | CPMFCR_EB;
694 ep->sen_genscc.scc_tfcr = CPMFCR_GBL | CPMFCR_EB;
695
696 /* Set maximum bytes per receive buffer.
697 * This appears to be an Ethernet frame size, not the buffer
698 * fragment size. It must be a multiple of four.
699 */
700 ep->sen_genscc.scc_mrblr = PKT_MAXBLR_SIZE;
701
702 /* Set CRC preset and mask.
703 */
704 ep->sen_cpres = 0xffffffff;
705 ep->sen_cmask = 0xdebb20e3;
706
707 ep->sen_crcec = 0; /* CRC Error counter */
708 ep->sen_alec = 0; /* alignment error counter */
709 ep->sen_disfc = 0; /* discard frame counter */
710
711 ep->sen_pads = 0x8888; /* Tx short frame pad character */
712 ep->sen_retlim = 15; /* Retry limit threshold */
713
714 ep->sen_maxflr = PKT_MAXBUF_SIZE; /* maximum frame length register */
715 ep->sen_minflr = PKT_MINBUF_SIZE; /* minimum frame length register */
716
717 ep->sen_maxd1 = PKT_MAXBLR_SIZE; /* maximum DMA1 length */
718 ep->sen_maxd2 = PKT_MAXBLR_SIZE; /* maximum DMA2 length */
719
720 /* Clear hash tables.
721 */
722 ep->sen_gaddr1 = 0;
723 ep->sen_gaddr2 = 0;
724 ep->sen_gaddr3 = 0;
725 ep->sen_gaddr4 = 0;
726 ep->sen_iaddr1 = 0;
727 ep->sen_iaddr2 = 0;
728 ep->sen_iaddr3 = 0;
729 ep->sen_iaddr4 = 0;
730
731 /* Set Ethernet station address.
732 *
733 * This is supplied in the board information structure, so we
734 * copy that into the controller.
735 */
736 eap = (unsigned char *)&(ep->sen_paddrh);
737 for (i=5; i>=0; i--)
738 *eap++ = dev->dev_addr[i] = bd->bi_enetaddr[i];
739
740 ep->sen_pper = 0; /* 'cause the book says so */
741 ep->sen_taddrl = 0; /* temp address (LSB) */
742 ep->sen_taddrm = 0;
743 ep->sen_taddrh = 0; /* temp address (MSB) */
744
745 /* Now allocate the host memory pages and initialize the
746 * buffer descriptors.
747 */
748 bdp = cep->tx_bd_base;
749 for (i=0; i<TX_RING_SIZE; i++) {
750
751 /* Initialize the BD for every fragment in the page.
752 */
753 bdp->cbd_sc = 0;
754 bdp->cbd_bufaddr = 0;
755 bdp++;
756 }
757
758 /* Set the last buffer to wrap.
759 */
760 bdp--;
761 bdp->cbd_sc |= BD_SC_WRAP;
762
763 bdp = cep->rx_bd_base;
764 for (i=0; i<CPM_ENET_RX_PAGES; i++) {
765
766 /* Allocate a page.
767 */
768 mem_addr = __get_free_page(GFP_KERNEL);
769 /* BUG: no check for failure */
770
771 /* Initialize the BD for every fragment in the page.
772 */
773 for (j=0; j<CPM_ENET_RX_FRPPG; j++) {
774 bdp->cbd_sc = BD_ENET_RX_EMPTY | BD_ENET_RX_INTR;
775 bdp->cbd_bufaddr = __pa(mem_addr);
776 mem_addr += CPM_ENET_RX_FRSIZE;
777 bdp++;
778 }
779 }
780
781 /* Set the last buffer to wrap.
782 */
783 bdp--;
784 bdp->cbd_sc |= BD_SC_WRAP;
785
786 /* Let's re-initialize the channel now. We have to do it later
787 * than the manual describes because we have just now finished
788 * the BD initialization.
789 */
790 cpmp->cp_cpcr = mk_cr_cmd(CPM_ENET_PAGE, CPM_ENET_BLOCK, 0,
791 CPM_CR_INIT_TRX) | CPM_CR_FLG;
792 while (cp->cp_cpcr & CPM_CR_FLG);
793
794 cep->skb_cur = cep->skb_dirty = 0;
795
796 sccp->scc_scce = 0xffff; /* Clear any pending events */
797
798 /* Enable interrupts for transmit error, complete frame
799 * received, and any transmit buffer we have also set the
800 * interrupt flag.
801 */
802 sccp->scc_sccm = (SCCE_ENET_TXE | SCCE_ENET_RXF | SCCE_ENET_TXB);
803
804 /* Install our interrupt handler.
805 */
806 request_irq(SIU_INT_ENET, scc_enet_interrupt, 0, "enet", dev);
807 /* BUG: no check for failure */
808
809 /* Set GSMR_H to enable all normal operating modes.
810 * Set GSMR_L to enable Ethernet to MC68160.
811 */
812 sccp->scc_gsmrh = 0;
813 sccp->scc_gsmrl = (SCC_GSMRL_TCI | SCC_GSMRL_TPL_48 | SCC_GSMRL_TPP_10 | SCC_GSMRL_MODE_ENET);
814
815 /* Set sync/delimiters.
816 */
817 sccp->scc_dsr = 0xd555;
818
819 /* Set processing mode. Use Ethernet CRC, catch broadcast, and
820 * start frame search 22 bit times after RENA.
821 */
822 sccp->scc_psmr = (SCC_PSMR_ENCRC | SCC_PSMR_NIB22);
823
824 /* It is now OK to enable the Ethernet transmitter.
825 * Unfortunately, there are board implementation differences here.
826 */
827 io->iop_pparc &= ~(PC_EST8260_ENET_LOOPBACK |
828 PC_EST8260_ENET_SQE | PC_EST8260_ENET_NOTFD);
829 io->iop_psorc &= ~(PC_EST8260_ENET_LOOPBACK |
830 PC_EST8260_ENET_SQE | PC_EST8260_ENET_NOTFD);
831 io->iop_pdirc |= (PC_EST8260_ENET_LOOPBACK |
832 PC_EST8260_ENET_SQE | PC_EST8260_ENET_NOTFD);
833 io->iop_pdatc &= ~(PC_EST8260_ENET_LOOPBACK | PC_EST8260_ENET_SQE);
834 io->iop_pdatc |= PC_EST8260_ENET_NOTFD;
835
836 dev->base_addr = (unsigned long)ep;
837
838 /* The CPM Ethernet specific entries in the device structure. */
839 dev->open = scc_enet_open;
840 dev->hard_start_xmit = scc_enet_start_xmit;
841 dev->tx_timeout = scc_enet_timeout;
842 dev->watchdog_timeo = TX_TIMEOUT;
843 dev->stop = scc_enet_close;
844 dev->get_stats = scc_enet_get_stats;
845 dev->set_multicast_list = set_multicast_list;
846
847 /* And last, enable the transmit and receive processing.
848 */
849 sccp->scc_gsmrl |= (SCC_GSMRL_ENR | SCC_GSMRL_ENT);
850
851 err = register_netdev(dev);
852 if (err) {
853 free_netdev(dev);
854 return err;
855 }
856
857 printk("%s: SCC ENET Version 0.1, ", dev->name);
858 for (i=0; i<5; i++)
859 printk("%02x:", dev->dev_addr[i]);
860 printk("%02x\n", dev->dev_addr[5]);
861
862 return 0;
863}
864
865module_init(scc_enet_init);
diff --git a/arch/ppc/8260_io/fcc_enet.c b/arch/ppc/8260_io/fcc_enet.c
deleted file mode 100644
index d38b57e24cee..000000000000
--- a/arch/ppc/8260_io/fcc_enet.c
+++ /dev/null
@@ -1,2379 +0,0 @@
1/*
2 * Fast Ethernet Controller (FCC) driver for Motorola MPC8260.
3 * Copyright (c) 2000 MontaVista Software, Inc. Dan Malek (dmalek@jlc.net)
4 *
5 * This version of the driver is a combination of the 8xx fec and
6 * 8260 SCC Ethernet drivers. This version has some additional
7 * configuration options, which should probably be moved out of
8 * here. This driver currently works for the EST SBC8260,
9 * SBS Diablo/BCM, Embedded Planet RPX6, TQM8260, and others.
10 *
11 * Right now, I am very watseful with the buffers. I allocate memory
12 * pages and then divide them into 2K frame buffers. This way I know I
13 * have buffers large enough to hold one frame within one buffer descriptor.
14 * Once I get this working, I will use 64 or 128 byte CPM buffers, which
15 * will be much more memory efficient and will easily handle lots of
16 * small packets. Since this is a cache coherent processor and CPM,
17 * I could also preallocate SKB's and use them directly on the interface.
18 *
19 * 2004-12 Leo Li (leoli@freescale.com)
20 * - Rework the FCC clock configuration part, make it easier to configure.
21 *
22 */
23
24#include <linux/kernel.h>
25#include <linux/sched.h>
26#include <linux/string.h>
27#include <linux/ptrace.h>
28#include <linux/errno.h>
29#include <linux/ioport.h>
30#include <linux/slab.h>
31#include <linux/interrupt.h>
32#include <linux/init.h>
33#include <linux/delay.h>
34#include <linux/netdevice.h>
35#include <linux/etherdevice.h>
36#include <linux/skbuff.h>
37#include <linux/spinlock.h>
38#include <linux/mii.h>
39#include <linux/workqueue.h>
40#include <linux/bitops.h>
41
42#include <asm/immap_cpm2.h>
43#include <asm/pgtable.h>
44#include <asm/mpc8260.h>
45#include <asm/irq.h>
46#include <asm/uaccess.h>
47#include <asm/signal.h>
48
49/* We can't use the PHY interrupt if we aren't using MDIO. */
50#if !defined(CONFIG_USE_MDIO)
51#undef PHY_INTERRUPT
52#endif
53
54/* If we have a PHY interrupt, we will advertise both full-duplex and half-
55 * duplex capabilities. If we don't have a PHY interrupt, then we will only
56 * advertise half-duplex capabilities.
57 */
58#define MII_ADVERTISE_HALF (ADVERTISE_100HALF | ADVERTISE_10HALF | \
59 ADVERTISE_CSMA)
60#define MII_ADVERTISE_ALL (ADVERTISE_100FULL | ADVERTISE_10FULL | \
61 MII_ADVERTISE_HALF)
62#ifdef PHY_INTERRUPT
63#define MII_ADVERTISE_DEFAULT MII_ADVERTISE_ALL
64#else
65#define MII_ADVERTISE_DEFAULT MII_ADVERTISE_HALF
66#endif
67#include <asm/cpm2.h>
68
69/* The transmitter timeout
70 */
71#define TX_TIMEOUT (2*HZ)
72
73#ifdef CONFIG_USE_MDIO
74/* Forward declarations of some structures to support different PHYs */
75
76typedef struct {
77 uint mii_data;
78 void (*funct)(uint mii_reg, struct net_device *dev);
79} phy_cmd_t;
80
81typedef struct {
82 uint id;
83 char *name;
84
85 const phy_cmd_t *config;
86 const phy_cmd_t *startup;
87 const phy_cmd_t *ack_int;
88 const phy_cmd_t *shutdown;
89} phy_info_t;
90
91/* values for phy_status */
92
93#define PHY_CONF_ANE 0x0001 /* 1 auto-negotiation enabled */
94#define PHY_CONF_LOOP 0x0002 /* 1 loopback mode enabled */
95#define PHY_CONF_SPMASK 0x00f0 /* mask for speed */
96#define PHY_CONF_10HDX 0x0010 /* 10 Mbit half duplex supported */
97#define PHY_CONF_10FDX 0x0020 /* 10 Mbit full duplex supported */
98#define PHY_CONF_100HDX 0x0040 /* 100 Mbit half duplex supported */
99#define PHY_CONF_100FDX 0x0080 /* 100 Mbit full duplex supported */
100
101#define PHY_STAT_LINK 0x0100 /* 1 up - 0 down */
102#define PHY_STAT_FAULT 0x0200 /* 1 remote fault */
103#define PHY_STAT_ANC 0x0400 /* 1 auto-negotiation complete */
104#define PHY_STAT_SPMASK 0xf000 /* mask for speed */
105#define PHY_STAT_10HDX 0x1000 /* 10 Mbit half duplex selected */
106#define PHY_STAT_10FDX 0x2000 /* 10 Mbit full duplex selected */
107#define PHY_STAT_100HDX 0x4000 /* 100 Mbit half duplex selected */
108#define PHY_STAT_100FDX 0x8000 /* 100 Mbit full duplex selected */
109#endif /* CONFIG_USE_MDIO */
110
111/* The number of Tx and Rx buffers. These are allocated from the page
112 * pool. The code may assume these are power of two, so it is best
113 * to keep them that size.
114 * We don't need to allocate pages for the transmitter. We just use
115 * the skbuffer directly.
116 */
117#define FCC_ENET_RX_PAGES 16
118#define FCC_ENET_RX_FRSIZE 2048
119#define FCC_ENET_RX_FRPPG (PAGE_SIZE / FCC_ENET_RX_FRSIZE)
120#define RX_RING_SIZE (FCC_ENET_RX_FRPPG * FCC_ENET_RX_PAGES)
121#define TX_RING_SIZE 16 /* Must be power of two */
122#define TX_RING_MOD_MASK 15 /* for this to work */
123
124/* The FCC stores dest/src/type, data, and checksum for receive packets.
125 * size includes support for VLAN
126 */
127#define PKT_MAXBUF_SIZE 1522
128#define PKT_MINBUF_SIZE 64
129
130/* Maximum input DMA size. Must be a should(?) be a multiple of 4.
131 * size includes support for VLAN
132 */
133#define PKT_MAXDMA_SIZE 1524
134
135/* Maximum input buffer size. Must be a multiple of 32.
136*/
137#define PKT_MAXBLR_SIZE 1536
138
139static int fcc_enet_open(struct net_device *dev);
140static int fcc_enet_start_xmit(struct sk_buff *skb, struct net_device *dev);
141static int fcc_enet_rx(struct net_device *dev);
142static irqreturn_t fcc_enet_interrupt(int irq, void *dev_id);
143static int fcc_enet_close(struct net_device *dev);
144static struct net_device_stats *fcc_enet_get_stats(struct net_device *dev);
145/* static void set_multicast_list(struct net_device *dev); */
146static void fcc_restart(struct net_device *dev, int duplex);
147static void fcc_stop(struct net_device *dev);
148static int fcc_enet_set_mac_address(struct net_device *dev, void *addr);
149
150/* These will be configurable for the FCC choice.
151 * Multiple ports can be configured. There is little choice among the
152 * I/O pins to the PHY, except the clocks. We will need some board
153 * dependent clock selection.
154 * Why in the hell did I put these inside #ifdef's? I dunno, maybe to
155 * help show what pins are used for each device.
156 */
157
158/* Since the CLK setting changes greatly from board to board, I changed
159 * it to a easy way. You just need to specify which CLK number to use.
160 * Note that only limited choices can be make on each port.
161 */
162
163/* FCC1 Clock Source Configuration. There are board specific.
164 Can only choose from CLK9-12 */
165#ifdef CONFIG_SBC82xx
166#define F1_RXCLK 9
167#define F1_TXCLK 10
168#else
169#define F1_RXCLK 12
170#define F1_TXCLK 11
171#endif
172
173/* FCC2 Clock Source Configuration. There are board specific.
174 Can only choose from CLK13-16 */
175#define F2_RXCLK 13
176#define F2_TXCLK 14
177
178/* FCC3 Clock Source Configuration. There are board specific.
179 Can only choose from CLK13-16 */
180#define F3_RXCLK 15
181#define F3_TXCLK 16
182
183/* Automatically generates register configurations */
184#define PC_CLK(x) ((uint)(1<<(x-1))) /* FCC CLK I/O ports */
185
186#define CMXFCR_RF1CS(x) ((uint)((x-5)<<27)) /* FCC1 Receive Clock Source */
187#define CMXFCR_TF1CS(x) ((uint)((x-5)<<24)) /* FCC1 Transmit Clock Source */
188#define CMXFCR_RF2CS(x) ((uint)((x-9)<<19)) /* FCC2 Receive Clock Source */
189#define CMXFCR_TF2CS(x) ((uint)((x-9)<<16)) /* FCC2 Transmit Clock Source */
190#define CMXFCR_RF3CS(x) ((uint)((x-9)<<11)) /* FCC3 Receive Clock Source */
191#define CMXFCR_TF3CS(x) ((uint)((x-9)<<8)) /* FCC3 Transmit Clock Source */
192
193#define PC_F1RXCLK PC_CLK(F1_RXCLK)
194#define PC_F1TXCLK PC_CLK(F1_TXCLK)
195#define CMX1_CLK_ROUTE (CMXFCR_RF1CS(F1_RXCLK) | CMXFCR_TF1CS(F1_TXCLK))
196#define CMX1_CLK_MASK ((uint)0xff000000)
197
198#define PC_F2RXCLK PC_CLK(F2_RXCLK)
199#define PC_F2TXCLK PC_CLK(F2_TXCLK)
200#define CMX2_CLK_ROUTE (CMXFCR_RF2CS(F2_RXCLK) | CMXFCR_TF2CS(F2_TXCLK))
201#define CMX2_CLK_MASK ((uint)0x00ff0000)
202
203#define PC_F3RXCLK PC_CLK(F3_RXCLK)
204#define PC_F3TXCLK PC_CLK(F3_TXCLK)
205#define CMX3_CLK_ROUTE (CMXFCR_RF3CS(F3_RXCLK) | CMXFCR_TF3CS(F3_TXCLK))
206#define CMX3_CLK_MASK ((uint)0x0000ff00)
207
208
209/* I/O Pin assignment for FCC1. I don't yet know the best way to do this,
210 * but there is little variation among the choices.
211 */
212#define PA1_COL ((uint)0x00000001)
213#define PA1_CRS ((uint)0x00000002)
214#define PA1_TXER ((uint)0x00000004)
215#define PA1_TXEN ((uint)0x00000008)
216#define PA1_RXDV ((uint)0x00000010)
217#define PA1_RXER ((uint)0x00000020)
218#define PA1_TXDAT ((uint)0x00003c00)
219#define PA1_RXDAT ((uint)0x0003c000)
220#define PA1_PSORA_BOUT (PA1_RXDAT | PA1_TXDAT)
221#define PA1_PSORA_BIN (PA1_COL | PA1_CRS | PA1_TXER | PA1_TXEN | \
222 PA1_RXDV | PA1_RXER)
223#define PA1_DIRA_BOUT (PA1_RXDAT | PA1_CRS | PA1_COL | PA1_RXER | PA1_RXDV)
224#define PA1_DIRA_BIN (PA1_TXDAT | PA1_TXEN | PA1_TXER)
225
226
227/* I/O Pin assignment for FCC2. I don't yet know the best way to do this,
228 * but there is little variation among the choices.
229 */
230#define PB2_TXER ((uint)0x00000001)
231#define PB2_RXDV ((uint)0x00000002)
232#define PB2_TXEN ((uint)0x00000004)
233#define PB2_RXER ((uint)0x00000008)
234#define PB2_COL ((uint)0x00000010)
235#define PB2_CRS ((uint)0x00000020)
236#define PB2_TXDAT ((uint)0x000003c0)
237#define PB2_RXDAT ((uint)0x00003c00)
238#define PB2_PSORB_BOUT (PB2_RXDAT | PB2_TXDAT | PB2_CRS | PB2_COL | \
239 PB2_RXER | PB2_RXDV | PB2_TXER)
240#define PB2_PSORB_BIN (PB2_TXEN)
241#define PB2_DIRB_BOUT (PB2_RXDAT | PB2_CRS | PB2_COL | PB2_RXER | PB2_RXDV)
242#define PB2_DIRB_BIN (PB2_TXDAT | PB2_TXEN | PB2_TXER)
243
244
245/* I/O Pin assignment for FCC3. I don't yet know the best way to do this,
246 * but there is little variation among the choices.
247 */
248#define PB3_RXDV ((uint)0x00004000)
249#define PB3_RXER ((uint)0x00008000)
250#define PB3_TXER ((uint)0x00010000)
251#define PB3_TXEN ((uint)0x00020000)
252#define PB3_COL ((uint)0x00040000)
253#define PB3_CRS ((uint)0x00080000)
254#ifndef CONFIG_RPX8260
255#define PB3_TXDAT ((uint)0x0f000000)
256#define PC3_TXDAT ((uint)0x00000000)
257#else
258#define PB3_TXDAT ((uint)0x0f000000)
259#define PC3_TXDAT 0
260#endif
261#define PB3_RXDAT ((uint)0x00f00000)
262#define PB3_PSORB_BOUT (PB3_RXDAT | PB3_TXDAT | PB3_CRS | PB3_COL | \
263 PB3_RXER | PB3_RXDV | PB3_TXER | PB3_TXEN)
264#define PB3_PSORB_BIN (0)
265#define PB3_DIRB_BOUT (PB3_RXDAT | PB3_CRS | PB3_COL | PB3_RXER | PB3_RXDV)
266#define PB3_DIRB_BIN (PB3_TXDAT | PB3_TXEN | PB3_TXER)
267
268#define PC3_PSORC_BOUT (PC3_TXDAT)
269#define PC3_PSORC_BIN (0)
270#define PC3_DIRC_BOUT (0)
271#define PC3_DIRC_BIN (PC3_TXDAT)
272
273
274/* MII status/control serial interface.
275*/
276#if defined(CONFIG_RPX8260)
277/* The EP8260 doesn't use Port C for MDIO */
278#define PC_MDIO ((uint)0x00000000)
279#define PC_MDCK ((uint)0x00000000)
280#elif defined(CONFIG_TQM8260)
281/* TQM8260 has MDIO and MDCK on PC30 and PC31 respectively */
282#define PC_MDIO ((uint)0x00000002)
283#define PC_MDCK ((uint)0x00000001)
284#elif defined(CONFIG_EST8260) || defined(CONFIG_ADS8260)
285#define PC_MDIO ((uint)0x00400000)
286#define PC_MDCK ((uint)0x00200000)
287#else
288#define PC_MDIO ((uint)0x00000004)
289#define PC_MDCK ((uint)0x00000020)
290#endif
291
292#if defined(CONFIG_USE_MDIO) && (!defined(PC_MDIO) || !defined(PC_MDCK))
293#error "Must define PC_MDIO and PC_MDCK if using MDIO"
294#endif
295
296/* PHY addresses */
297/* default to dynamic config of phy addresses */
298#define FCC1_PHY_ADDR 0
299#ifdef CONFIG_PQ2FADS
300#define FCC2_PHY_ADDR 0
301#else
302#define FCC2_PHY_ADDR 2
303#endif
304#define FCC3_PHY_ADDR 3
305
306/* A table of information for supporting FCCs. This does two things.
307 * First, we know how many FCCs we have and they are always externally
308 * numbered from zero. Second, it holds control register and I/O
309 * information that could be different among board designs.
310 */
311typedef struct fcc_info {
312 uint fc_fccnum;
313 uint fc_phyaddr;
314 uint fc_cpmblock;
315 uint fc_cpmpage;
316 uint fc_proff;
317 uint fc_interrupt;
318 uint fc_trxclocks;
319 uint fc_clockroute;
320 uint fc_clockmask;
321 uint fc_mdio;
322 uint fc_mdck;
323} fcc_info_t;
324
325static fcc_info_t fcc_ports[] = {
326#ifdef CONFIG_FCC1_ENET
327 { 0, FCC1_PHY_ADDR, CPM_CR_FCC1_SBLOCK, CPM_CR_FCC1_PAGE, PROFF_FCC1, SIU_INT_FCC1,
328 (PC_F1RXCLK | PC_F1TXCLK), CMX1_CLK_ROUTE, CMX1_CLK_MASK,
329 PC_MDIO, PC_MDCK },
330#endif
331#ifdef CONFIG_FCC2_ENET
332 { 1, FCC2_PHY_ADDR, CPM_CR_FCC2_SBLOCK, CPM_CR_FCC2_PAGE, PROFF_FCC2, SIU_INT_FCC2,
333 (PC_F2RXCLK | PC_F2TXCLK), CMX2_CLK_ROUTE, CMX2_CLK_MASK,
334 PC_MDIO, PC_MDCK },
335#endif
336#ifdef CONFIG_FCC3_ENET
337 { 2, FCC3_PHY_ADDR, CPM_CR_FCC3_SBLOCK, CPM_CR_FCC3_PAGE, PROFF_FCC3, SIU_INT_FCC3,
338 (PC_F3RXCLK | PC_F3TXCLK), CMX3_CLK_ROUTE, CMX3_CLK_MASK,
339 PC_MDIO, PC_MDCK },
340#endif
341};
342
343/* The FCC buffer descriptors track the ring buffers. The rx_bd_base and
344 * tx_bd_base always point to the base of the buffer descriptors. The
345 * cur_rx and cur_tx point to the currently available buffer.
346 * The dirty_tx tracks the current buffer that is being sent by the
347 * controller. The cur_tx and dirty_tx are equal under both completely
348 * empty and completely full conditions. The empty/ready indicator in
349 * the buffer descriptor determines the actual condition.
350 */
351struct fcc_enet_private {
352 /* The saved address of a sent-in-place packet/buffer, for skfree(). */
353 struct sk_buff* tx_skbuff[TX_RING_SIZE];
354 ushort skb_cur;
355 ushort skb_dirty;
356
357 /* CPM dual port RAM relative addresses.
358 */
359 cbd_t *rx_bd_base; /* Address of Rx and Tx buffers. */
360 cbd_t *tx_bd_base;
361 cbd_t *cur_rx, *cur_tx; /* The next free ring entry */
362 cbd_t *dirty_tx; /* The ring entries to be free()ed. */
363 volatile fcc_t *fccp;
364 volatile fcc_enet_t *ep;
365 struct net_device_stats stats;
366 uint tx_free;
367 spinlock_t lock;
368
369#ifdef CONFIG_USE_MDIO
370 uint phy_id;
371 uint phy_id_done;
372 uint phy_status;
373 phy_info_t *phy;
374 struct work_struct phy_relink;
375 struct work_struct phy_display_config;
376 struct net_device *dev;
377
378 uint sequence_done;
379
380 uint phy_addr;
381#endif /* CONFIG_USE_MDIO */
382
383 int link;
384 int old_link;
385 int full_duplex;
386
387 fcc_info_t *fip;
388};
389
390static void init_fcc_shutdown(fcc_info_t *fip, struct fcc_enet_private *cep,
391 volatile cpm2_map_t *immap);
392static void init_fcc_startup(fcc_info_t *fip, struct net_device *dev);
393static void init_fcc_ioports(fcc_info_t *fip, volatile iop_cpm2_t *io,
394 volatile cpm2_map_t *immap);
395static void init_fcc_param(fcc_info_t *fip, struct net_device *dev,
396 volatile cpm2_map_t *immap);
397
398#ifdef CONFIG_USE_MDIO
399static int mii_queue(struct net_device *dev, int request, void (*func)(uint, struct net_device *));
400static uint mii_send_receive(fcc_info_t *fip, uint cmd);
401static void mii_do_cmd(struct net_device *dev, const phy_cmd_t *c);
402
403/* Make MII read/write commands for the FCC.
404*/
405#define mk_mii_read(REG) (0x60020000 | (((REG) & 0x1f) << 18))
406#define mk_mii_write(REG, VAL) (0x50020000 | (((REG) & 0x1f) << 18) | \
407 ((VAL) & 0xffff))
408#define mk_mii_end 0
409#endif /* CONFIG_USE_MDIO */
410
411
412static int
413fcc_enet_start_xmit(struct sk_buff *skb, struct net_device *dev)
414{
415 struct fcc_enet_private *cep = (struct fcc_enet_private *)dev->priv;
416 volatile cbd_t *bdp;
417
418 /* Fill in a Tx ring entry */
419 bdp = cep->cur_tx;
420
421#ifndef final_version
422 if (!cep->tx_free || (bdp->cbd_sc & BD_ENET_TX_READY)) {
423 /* Ooops. All transmit buffers are full. Bail out.
424 * This should not happen, since the tx queue should be stopped.
425 */
426 printk("%s: tx queue full!.\n", dev->name);
427 return 1;
428 }
429#endif
430
431 /* Clear all of the status flags. */
432 bdp->cbd_sc &= ~BD_ENET_TX_STATS;
433
434 /* If the frame is short, tell CPM to pad it. */
435 if (skb->len <= ETH_ZLEN)
436 bdp->cbd_sc |= BD_ENET_TX_PAD;
437 else
438 bdp->cbd_sc &= ~BD_ENET_TX_PAD;
439
440 /* Set buffer length and buffer pointer. */
441 bdp->cbd_datlen = skb->len;
442 bdp->cbd_bufaddr = __pa(skb->data);
443
444 spin_lock_irq(&cep->lock);
445
446 /* Save skb pointer. */
447 cep->tx_skbuff[cep->skb_cur] = skb;
448
449 cep->stats.tx_bytes += skb->len;
450 cep->skb_cur = (cep->skb_cur+1) & TX_RING_MOD_MASK;
451
452 /* Send it on its way. Tell CPM its ready, interrupt when done,
453 * its the last BD of the frame, and to put the CRC on the end.
454 */
455 bdp->cbd_sc |= (BD_ENET_TX_READY | BD_ENET_TX_INTR | BD_ENET_TX_LAST | BD_ENET_TX_TC);
456
457#if 0
458 /* Errata says don't do this. */
459 cep->fccp->fcc_ftodr = 0x8000;
460#endif
461 dev->trans_start = jiffies;
462
463 /* If this was the last BD in the ring, start at the beginning again. */
464 if (bdp->cbd_sc & BD_ENET_TX_WRAP)
465 bdp = cep->tx_bd_base;
466 else
467 bdp++;
468
469 if (!--cep->tx_free)
470 netif_stop_queue(dev);
471
472 cep->cur_tx = (cbd_t *)bdp;
473
474 spin_unlock_irq(&cep->lock);
475
476 return 0;
477}
478
479
480static void
481fcc_enet_timeout(struct net_device *dev)
482{
483 struct fcc_enet_private *cep = (struct fcc_enet_private *)dev->priv;
484
485 printk("%s: transmit timed out.\n", dev->name);
486 cep->stats.tx_errors++;
487#ifndef final_version
488 {
489 int i;
490 cbd_t *bdp;
491 printk(" Ring data dump: cur_tx %p tx_free %d cur_rx %p.\n",
492 cep->cur_tx, cep->tx_free,
493 cep->cur_rx);
494 bdp = cep->tx_bd_base;
495 printk(" Tx @base %p :\n", bdp);
496 for (i = 0 ; i < TX_RING_SIZE; i++, bdp++)
497 printk("%04x %04x %08x\n",
498 bdp->cbd_sc,
499 bdp->cbd_datlen,
500 bdp->cbd_bufaddr);
501 bdp = cep->rx_bd_base;
502 printk(" Rx @base %p :\n", bdp);
503 for (i = 0 ; i < RX_RING_SIZE; i++, bdp++)
504 printk("%04x %04x %08x\n",
505 bdp->cbd_sc,
506 bdp->cbd_datlen,
507 bdp->cbd_bufaddr);
508 }
509#endif
510 if (cep->tx_free)
511 netif_wake_queue(dev);
512}
513
514/* The interrupt handler. */
515static irqreturn_t
516fcc_enet_interrupt(int irq, void *dev_id)
517{
518 struct net_device *dev = dev_id;
519 volatile struct fcc_enet_private *cep;
520 volatile cbd_t *bdp;
521 ushort int_events;
522 int must_restart;
523
524 cep = dev->priv;
525
526 /* Get the interrupt events that caused us to be here.
527 */
528 int_events = cep->fccp->fcc_fcce;
529 cep->fccp->fcc_fcce = (int_events & cep->fccp->fcc_fccm);
530 must_restart = 0;
531
532#ifdef PHY_INTERRUPT
533 /* We have to be careful here to make sure that we aren't
534 * interrupted by a PHY interrupt.
535 */
536 disable_irq_nosync(PHY_INTERRUPT);
537#endif
538
539 /* Handle receive event in its own function.
540 */
541 if (int_events & FCC_ENET_RXF)
542 fcc_enet_rx(dev_id);
543
544 /* Check for a transmit error. The manual is a little unclear
545 * about this, so the debug code until I get it figured out. It
546 * appears that if TXE is set, then TXB is not set. However,
547 * if carrier sense is lost during frame transmission, the TXE
548 * bit is set, "and continues the buffer transmission normally."
549 * I don't know if "normally" implies TXB is set when the buffer
550 * descriptor is closed.....trial and error :-).
551 */
552
553 /* Transmit OK, or non-fatal error. Update the buffer descriptors.
554 */
555 if (int_events & (FCC_ENET_TXE | FCC_ENET_TXB)) {
556 spin_lock(&cep->lock);
557 bdp = cep->dirty_tx;
558 while ((bdp->cbd_sc&BD_ENET_TX_READY)==0) {
559 if (cep->tx_free == TX_RING_SIZE)
560 break;
561
562 if (bdp->cbd_sc & BD_ENET_TX_HB) /* No heartbeat */
563 cep->stats.tx_heartbeat_errors++;
564 if (bdp->cbd_sc & BD_ENET_TX_LC) /* Late collision */
565 cep->stats.tx_window_errors++;
566 if (bdp->cbd_sc & BD_ENET_TX_RL) /* Retrans limit */
567 cep->stats.tx_aborted_errors++;
568 if (bdp->cbd_sc & BD_ENET_TX_UN) /* Underrun */
569 cep->stats.tx_fifo_errors++;
570 if (bdp->cbd_sc & BD_ENET_TX_CSL) /* Carrier lost */
571 cep->stats.tx_carrier_errors++;
572
573
574 /* No heartbeat or Lost carrier are not really bad errors.
575 * The others require a restart transmit command.
576 */
577 if (bdp->cbd_sc &
578 (BD_ENET_TX_LC | BD_ENET_TX_RL | BD_ENET_TX_UN)) {
579 must_restart = 1;
580 cep->stats.tx_errors++;
581 }
582
583 cep->stats.tx_packets++;
584
585 /* Deferred means some collisions occurred during transmit,
586 * but we eventually sent the packet OK.
587 */
588 if (bdp->cbd_sc & BD_ENET_TX_DEF)
589 cep->stats.collisions++;
590
591 /* Free the sk buffer associated with this last transmit. */
592 dev_kfree_skb_irq(cep->tx_skbuff[cep->skb_dirty]);
593 cep->tx_skbuff[cep->skb_dirty] = NULL;
594 cep->skb_dirty = (cep->skb_dirty + 1) & TX_RING_MOD_MASK;
595
596 /* Update pointer to next buffer descriptor to be transmitted. */
597 if (bdp->cbd_sc & BD_ENET_TX_WRAP)
598 bdp = cep->tx_bd_base;
599 else
600 bdp++;
601
602 /* I don't know if we can be held off from processing these
603 * interrupts for more than one frame time. I really hope
604 * not. In such a case, we would now want to check the
605 * currently available BD (cur_tx) and determine if any
606 * buffers between the dirty_tx and cur_tx have also been
607 * sent. We would want to process anything in between that
608 * does not have BD_ENET_TX_READY set.
609 */
610
611 /* Since we have freed up a buffer, the ring is no longer
612 * full.
613 */
614 if (!cep->tx_free++) {
615 if (netif_queue_stopped(dev)) {
616 netif_wake_queue(dev);
617 }
618 }
619
620 cep->dirty_tx = (cbd_t *)bdp;
621 }
622
623 if (must_restart) {
624 volatile cpm_cpm2_t *cp;
625
626 /* Some transmit errors cause the transmitter to shut
627 * down. We now issue a restart transmit. Since the
628 * errors close the BD and update the pointers, the restart
629 * _should_ pick up without having to reset any of our
630 * pointers either. Also, To workaround 8260 device erratum
631 * CPM37, we must disable and then re-enable the transmitter
632 * following a Late Collision, Underrun, or Retry Limit error.
633 */
634 cep->fccp->fcc_gfmr &= ~FCC_GFMR_ENT;
635 udelay(10); /* wait a few microseconds just on principle */
636 cep->fccp->fcc_gfmr |= FCC_GFMR_ENT;
637
638 cp = cpmp;
639 cp->cp_cpcr =
640 mk_cr_cmd(cep->fip->fc_cpmpage, cep->fip->fc_cpmblock,
641 0x0c, CPM_CR_RESTART_TX) | CPM_CR_FLG;
642 while (cp->cp_cpcr & CPM_CR_FLG);
643 }
644 spin_unlock(&cep->lock);
645 }
646
647 /* Check for receive busy, i.e. packets coming but no place to
648 * put them.
649 */
650 if (int_events & FCC_ENET_BSY) {
651 cep->fccp->fcc_fcce = FCC_ENET_BSY;
652 cep->stats.rx_dropped++;
653 }
654
655#ifdef PHY_INTERRUPT
656 enable_irq(PHY_INTERRUPT);
657#endif
658 return IRQ_HANDLED;
659}
660
661/* During a receive, the cur_rx points to the current incoming buffer.
662 * When we update through the ring, if the next incoming buffer has
663 * not been given to the system, we just set the empty indicator,
664 * effectively tossing the packet.
665 */
666static int
667fcc_enet_rx(struct net_device *dev)
668{
669 struct fcc_enet_private *cep;
670 volatile cbd_t *bdp;
671 struct sk_buff *skb;
672 ushort pkt_len;
673
674 cep = dev->priv;
675
676 /* First, grab all of the stats for the incoming packet.
677 * These get messed up if we get called due to a busy condition.
678 */
679 bdp = cep->cur_rx;
680
681for (;;) {
682 if (bdp->cbd_sc & BD_ENET_RX_EMPTY)
683 break;
684
685#ifndef final_version
686 /* Since we have allocated space to hold a complete frame, both
687 * the first and last indicators should be set.
688 */
689 if ((bdp->cbd_sc & (BD_ENET_RX_FIRST | BD_ENET_RX_LAST)) !=
690 (BD_ENET_RX_FIRST | BD_ENET_RX_LAST))
691 printk("CPM ENET: rcv is not first+last\n");
692#endif
693
694 /* Frame too long or too short. */
695 if (bdp->cbd_sc & (BD_ENET_RX_LG | BD_ENET_RX_SH))
696 cep->stats.rx_length_errors++;
697 if (bdp->cbd_sc & BD_ENET_RX_NO) /* Frame alignment */
698 cep->stats.rx_frame_errors++;
699 if (bdp->cbd_sc & BD_ENET_RX_CR) /* CRC Error */
700 cep->stats.rx_crc_errors++;
701 if (bdp->cbd_sc & BD_ENET_RX_OV) /* FIFO overrun */
702 cep->stats.rx_crc_errors++;
703 if (bdp->cbd_sc & BD_ENET_RX_CL) /* Late Collision */
704 cep->stats.rx_frame_errors++;
705
706 if (!(bdp->cbd_sc &
707 (BD_ENET_RX_LG | BD_ENET_RX_SH | BD_ENET_RX_NO | BD_ENET_RX_CR
708 | BD_ENET_RX_OV | BD_ENET_RX_CL)))
709 {
710 /* Process the incoming frame. */
711 cep->stats.rx_packets++;
712
713 /* Remove the FCS from the packet length. */
714 pkt_len = bdp->cbd_datlen - 4;
715 cep->stats.rx_bytes += pkt_len;
716
717 /* This does 16 byte alignment, much more than we need. */
718 skb = dev_alloc_skb(pkt_len);
719
720 if (skb == NULL) {
721 printk("%s: Memory squeeze, dropping packet.\n", dev->name);
722 cep->stats.rx_dropped++;
723 }
724 else {
725 skb_put(skb,pkt_len); /* Make room */
726 skb_copy_to_linear_data(skb,
727 (unsigned char *)__va(bdp->cbd_bufaddr),
728 pkt_len);
729 skb->protocol=eth_type_trans(skb,dev);
730 netif_rx(skb);
731 }
732 }
733
734 /* Clear the status flags for this buffer. */
735 bdp->cbd_sc &= ~BD_ENET_RX_STATS;
736
737 /* Mark the buffer empty. */
738 bdp->cbd_sc |= BD_ENET_RX_EMPTY;
739
740 /* Update BD pointer to next entry. */
741 if (bdp->cbd_sc & BD_ENET_RX_WRAP)
742 bdp = cep->rx_bd_base;
743 else
744 bdp++;
745
746 }
747 cep->cur_rx = (cbd_t *)bdp;
748
749 return 0;
750}
751
752static int
753fcc_enet_close(struct net_device *dev)
754{
755#ifdef CONFIG_USE_MDIO
756 struct fcc_enet_private *fep = dev->priv;
757#endif
758
759 netif_stop_queue(dev);
760 fcc_stop(dev);
761#ifdef CONFIG_USE_MDIO
762 if (fep->phy)
763 mii_do_cmd(dev, fep->phy->shutdown);
764#endif
765
766 return 0;
767}
768
769static struct net_device_stats *fcc_enet_get_stats(struct net_device *dev)
770{
771 struct fcc_enet_private *cep = (struct fcc_enet_private *)dev->priv;
772
773 return &cep->stats;
774}
775
776#ifdef CONFIG_USE_MDIO
777
778/* NOTE: Most of the following comes from the FEC driver for 860. The
779 * overall structure of MII code has been retained (as it's proved stable
780 * and well-tested), but actual transfer requests are processed "at once"
781 * instead of being queued (there's no interrupt-driven MII transfer
782 * mechanism, one has to toggle the data/clock bits manually).
783 */
784static int
785mii_queue(struct net_device *dev, int regval, void (*func)(uint, struct net_device *))
786{
787 struct fcc_enet_private *fep;
788 int retval, tmp;
789
790 /* Add PHY address to register command. */
791 fep = dev->priv;
792 regval |= fep->phy_addr << 23;
793
794 retval = 0;
795
796 tmp = mii_send_receive(fep->fip, regval);
797 if (func)
798 func(tmp, dev);
799
800 return retval;
801}
802
803static void mii_do_cmd(struct net_device *dev, const phy_cmd_t *c)
804{
805 int k;
806
807 if(!c)
808 return;
809
810 for(k = 0; (c+k)->mii_data != mk_mii_end; k++)
811 mii_queue(dev, (c+k)->mii_data, (c+k)->funct);
812}
813
814static void mii_parse_sr(uint mii_reg, struct net_device *dev)
815{
816 volatile struct fcc_enet_private *fep = dev->priv;
817 uint s = fep->phy_status;
818
819 s &= ~(PHY_STAT_LINK | PHY_STAT_FAULT | PHY_STAT_ANC);
820
821 if (mii_reg & BMSR_LSTATUS)
822 s |= PHY_STAT_LINK;
823 if (mii_reg & BMSR_RFAULT)
824 s |= PHY_STAT_FAULT;
825 if (mii_reg & BMSR_ANEGCOMPLETE)
826 s |= PHY_STAT_ANC;
827
828 fep->phy_status = s;
829}
830
831static void mii_parse_cr(uint mii_reg, struct net_device *dev)
832{
833 volatile struct fcc_enet_private *fep = dev->priv;
834 uint s = fep->phy_status;
835
836 s &= ~(PHY_CONF_ANE | PHY_CONF_LOOP);
837
838 if (mii_reg & BMCR_ANENABLE)
839 s |= PHY_CONF_ANE;
840 if (mii_reg & BMCR_LOOPBACK)
841 s |= PHY_CONF_LOOP;
842
843 fep->phy_status = s;
844}
845
846static void mii_parse_anar(uint mii_reg, struct net_device *dev)
847{
848 volatile struct fcc_enet_private *fep = dev->priv;
849 uint s = fep->phy_status;
850
851 s &= ~(PHY_CONF_SPMASK);
852
853 if (mii_reg & ADVERTISE_10HALF)
854 s |= PHY_CONF_10HDX;
855 if (mii_reg & ADVERTISE_10FULL)
856 s |= PHY_CONF_10FDX;
857 if (mii_reg & ADVERTISE_100HALF)
858 s |= PHY_CONF_100HDX;
859 if (mii_reg & ADVERTISE_100FULL)
860 s |= PHY_CONF_100FDX;
861
862 fep->phy_status = s;
863}
864
865/* ------------------------------------------------------------------------- */
866/* Generic PHY support. Should work for all PHYs, but does not support link
867 * change interrupts.
868 */
869#ifdef CONFIG_FCC_GENERIC_PHY
870
871static phy_info_t phy_info_generic = {
872 0x00000000, /* 0-->match any PHY */
873 "GENERIC",
874
875 (const phy_cmd_t []) { /* config */
876 /* advertise only half-duplex capabilities */
877 { mk_mii_write(MII_ADVERTISE, MII_ADVERTISE_HALF),
878 mii_parse_anar },
879
880 /* enable auto-negotiation */
881 { mk_mii_write(MII_BMCR, BMCR_ANENABLE), mii_parse_cr },
882 { mk_mii_end, }
883 },
884 (const phy_cmd_t []) { /* startup */
885 /* restart auto-negotiation */
886 { mk_mii_write(MII_BMCR, BMCR_ANENABLE | BMCR_ANRESTART),
887 NULL },
888 { mk_mii_end, }
889 },
890 (const phy_cmd_t []) { /* ack_int */
891 /* We don't actually use the ack_int table with a generic
892 * PHY, but putting a reference to mii_parse_sr here keeps
893 * us from getting a compiler warning about unused static
894 * functions in the case where we only compile in generic
895 * PHY support.
896 */
897 { mk_mii_read(MII_BMSR), mii_parse_sr },
898 { mk_mii_end, }
899 },
900 (const phy_cmd_t []) { /* shutdown */
901 { mk_mii_end, }
902 },
903};
904#endif /* ifdef CONFIG_FCC_GENERIC_PHY */
905
906/* ------------------------------------------------------------------------- */
907/* The Level one LXT970 is used by many boards */
908
909#ifdef CONFIG_FCC_LXT970
910
911#define MII_LXT970_MIRROR 16 /* Mirror register */
912#define MII_LXT970_IER 17 /* Interrupt Enable Register */
913#define MII_LXT970_ISR 18 /* Interrupt Status Register */
914#define MII_LXT970_CONFIG 19 /* Configuration Register */
915#define MII_LXT970_CSR 20 /* Chip Status Register */
916
917static void mii_parse_lxt970_csr(uint mii_reg, struct net_device *dev)
918{
919 volatile struct fcc_enet_private *fep = dev->priv;
920 uint s = fep->phy_status;
921
922 s &= ~(PHY_STAT_SPMASK);
923
924 if (mii_reg & 0x0800) {
925 if (mii_reg & 0x1000)
926 s |= PHY_STAT_100FDX;
927 else
928 s |= PHY_STAT_100HDX;
929 } else {
930 if (mii_reg & 0x1000)
931 s |= PHY_STAT_10FDX;
932 else
933 s |= PHY_STAT_10HDX;
934 }
935
936 fep->phy_status = s;
937}
938
939static phy_info_t phy_info_lxt970 = {
940 0x07810000,
941 "LXT970",
942
943 (const phy_cmd_t []) { /* config */
944#if 0
945// { mk_mii_write(MII_ADVERTISE, 0x0021), NULL },
946
947 /* Set default operation of 100-TX....for some reason
948 * some of these bits are set on power up, which is wrong.
949 */
950 { mk_mii_write(MII_LXT970_CONFIG, 0), NULL },
951#endif
952 { mk_mii_read(MII_BMCR), mii_parse_cr },
953 { mk_mii_read(MII_ADVERTISE), mii_parse_anar },
954 { mk_mii_end, }
955 },
956 (const phy_cmd_t []) { /* startup - enable interrupts */
957 { mk_mii_write(MII_LXT970_IER, 0x0002), NULL },
958 { mk_mii_write(MII_BMCR, 0x1200), NULL }, /* autonegotiate */
959 { mk_mii_end, }
960 },
961 (const phy_cmd_t []) { /* ack_int */
962 /* read SR and ISR to acknowledge */
963
964 { mk_mii_read(MII_BMSR), mii_parse_sr },
965 { mk_mii_read(MII_LXT970_ISR), NULL },
966
967 /* find out the current status */
968
969 { mk_mii_read(MII_LXT970_CSR), mii_parse_lxt970_csr },
970 { mk_mii_end, }
971 },
972 (const phy_cmd_t []) { /* shutdown - disable interrupts */
973 { mk_mii_write(MII_LXT970_IER, 0x0000), NULL },
974 { mk_mii_end, }
975 },
976};
977
978#endif /* CONFIG_FEC_LXT970 */
979
980/* ------------------------------------------------------------------------- */
981/* The Level one LXT971 is used on some of my custom boards */
982
983#ifdef CONFIG_FCC_LXT971
984
985/* register definitions for the 971 */
986
987#define MII_LXT971_PCR 16 /* Port Control Register */
988#define MII_LXT971_SR2 17 /* Status Register 2 */
989#define MII_LXT971_IER 18 /* Interrupt Enable Register */
990#define MII_LXT971_ISR 19 /* Interrupt Status Register */
991#define MII_LXT971_LCR 20 /* LED Control Register */
992#define MII_LXT971_TCR 30 /* Transmit Control Register */
993
994/*
995 * I had some nice ideas of running the MDIO faster...
996 * The 971 should support 8MHz and I tried it, but things acted really
997 * weird, so 2.5 MHz ought to be enough for anyone...
998 */
999
1000static void mii_parse_lxt971_sr2(uint mii_reg, struct net_device *dev)
1001{
1002 volatile struct fcc_enet_private *fep = dev->priv;
1003 uint s = fep->phy_status;
1004
1005 s &= ~(PHY_STAT_SPMASK);
1006
1007 if (mii_reg & 0x4000) {
1008 if (mii_reg & 0x0200)
1009 s |= PHY_STAT_100FDX;
1010 else
1011 s |= PHY_STAT_100HDX;
1012 } else {
1013 if (mii_reg & 0x0200)
1014 s |= PHY_STAT_10FDX;
1015 else
1016 s |= PHY_STAT_10HDX;
1017 }
1018 if (mii_reg & 0x0008)
1019 s |= PHY_STAT_FAULT;
1020
1021 fep->phy_status = s;
1022}
1023
1024static phy_info_t phy_info_lxt971 = {
1025 0x0001378e,
1026 "LXT971",
1027
1028 (const phy_cmd_t []) { /* config */
1029 /* configure link capabilities to advertise */
1030 { mk_mii_write(MII_ADVERTISE, MII_ADVERTISE_DEFAULT),
1031 mii_parse_anar },
1032
1033 /* enable auto-negotiation */
1034 { mk_mii_write(MII_BMCR, BMCR_ANENABLE), mii_parse_cr },
1035 { mk_mii_end, }
1036 },
1037 (const phy_cmd_t []) { /* startup - enable interrupts */
1038 { mk_mii_write(MII_LXT971_IER, 0x00f2), NULL },
1039
1040 /* restart auto-negotiation */
1041 { mk_mii_write(MII_BMCR, BMCR_ANENABLE | BMCR_ANRESTART),
1042 NULL },
1043 { mk_mii_end, }
1044 },
1045 (const phy_cmd_t []) { /* ack_int */
1046 /* find out the current status */
1047 { mk_mii_read(MII_BMSR), NULL },
1048 { mk_mii_read(MII_BMSR), mii_parse_sr },
1049 { mk_mii_read(MII_LXT971_SR2), mii_parse_lxt971_sr2 },
1050
1051 /* we only need to read ISR to acknowledge */
1052 { mk_mii_read(MII_LXT971_ISR), NULL },
1053 { mk_mii_end, }
1054 },
1055 (const phy_cmd_t []) { /* shutdown - disable interrupts */
1056 { mk_mii_write(MII_LXT971_IER, 0x0000), NULL },
1057 { mk_mii_end, }
1058 },
1059};
1060
1061#endif /* CONFIG_FCC_LXT971 */
1062
1063/* ------------------------------------------------------------------------- */
1064/* The Quality Semiconductor QS6612 is used on the RPX CLLF */
1065
1066#ifdef CONFIG_FCC_QS6612
1067
1068/* register definitions */
1069
1070#define MII_QS6612_MCR 17 /* Mode Control Register */
1071#define MII_QS6612_FTR 27 /* Factory Test Register */
1072#define MII_QS6612_MCO 28 /* Misc. Control Register */
1073#define MII_QS6612_ISR 29 /* Interrupt Source Register */
1074#define MII_QS6612_IMR 30 /* Interrupt Mask Register */
1075#define MII_QS6612_PCR 31 /* 100BaseTx PHY Control Reg. */
1076
1077static void mii_parse_qs6612_pcr(uint mii_reg, struct net_device *dev)
1078{
1079 volatile struct fcc_enet_private *fep = dev->priv;
1080 uint s = fep->phy_status;
1081
1082 s &= ~(PHY_STAT_SPMASK);
1083
1084 switch((mii_reg >> 2) & 7) {
1085 case 1: s |= PHY_STAT_10HDX; break;
1086 case 2: s |= PHY_STAT_100HDX; break;
1087 case 5: s |= PHY_STAT_10FDX; break;
1088 case 6: s |= PHY_STAT_100FDX; break;
1089 }
1090
1091 fep->phy_status = s;
1092}
1093
1094static phy_info_t phy_info_qs6612 = {
1095 0x00181440,
1096 "QS6612",
1097
1098 (const phy_cmd_t []) { /* config */
1099// { mk_mii_write(MII_ADVERTISE, 0x061), NULL }, /* 10 Mbps */
1100
1101 /* The PHY powers up isolated on the RPX,
1102 * so send a command to allow operation.
1103 */
1104
1105 { mk_mii_write(MII_QS6612_PCR, 0x0dc0), NULL },
1106
1107 /* parse cr and anar to get some info */
1108
1109 { mk_mii_read(MII_BMCR), mii_parse_cr },
1110 { mk_mii_read(MII_ADVERTISE), mii_parse_anar },
1111 { mk_mii_end, }
1112 },
1113 (const phy_cmd_t []) { /* startup - enable interrupts */
1114 { mk_mii_write(MII_QS6612_IMR, 0x003a), NULL },
1115 { mk_mii_write(MII_BMCR, 0x1200), NULL }, /* autonegotiate */
1116 { mk_mii_end, }
1117 },
1118 (const phy_cmd_t []) { /* ack_int */
1119
1120 /* we need to read ISR, SR and ANER to acknowledge */
1121
1122 { mk_mii_read(MII_QS6612_ISR), NULL },
1123 { mk_mii_read(MII_BMSR), mii_parse_sr },
1124 { mk_mii_read(MII_EXPANSION), NULL },
1125
1126 /* read pcr to get info */
1127
1128 { mk_mii_read(MII_QS6612_PCR), mii_parse_qs6612_pcr },
1129 { mk_mii_end, }
1130 },
1131 (const phy_cmd_t []) { /* shutdown - disable interrupts */
1132 { mk_mii_write(MII_QS6612_IMR, 0x0000), NULL },
1133 { mk_mii_end, }
1134 },
1135};
1136
1137
1138#endif /* CONFIG_FEC_QS6612 */
1139
1140
1141/* ------------------------------------------------------------------------- */
1142/* The Davicom DM9131 is used on the HYMOD board */
1143
1144#ifdef CONFIG_FCC_DM9131
1145
1146/* register definitions */
1147
1148#define MII_DM9131_ACR 16 /* Aux. Config Register */
1149#define MII_DM9131_ACSR 17 /* Aux. Config/Status Register */
1150#define MII_DM9131_10TCSR 18 /* 10BaseT Config/Status Reg. */
1151#define MII_DM9131_INTR 21 /* Interrupt Register */
1152#define MII_DM9131_RECR 22 /* Receive Error Counter Reg. */
1153#define MII_DM9131_DISCR 23 /* Disconnect Counter Register */
1154
1155static void mii_parse_dm9131_acsr(uint mii_reg, struct net_device *dev)
1156{
1157 volatile struct fcc_enet_private *fep = dev->priv;
1158 uint s = fep->phy_status;
1159
1160 s &= ~(PHY_STAT_SPMASK);
1161
1162 switch ((mii_reg >> 12) & 0xf) {
1163 case 1: s |= PHY_STAT_10HDX; break;
1164 case 2: s |= PHY_STAT_10FDX; break;
1165 case 4: s |= PHY_STAT_100HDX; break;
1166 case 8: s |= PHY_STAT_100FDX; break;
1167 }
1168
1169 fep->phy_status = s;
1170}
1171
1172static phy_info_t phy_info_dm9131 = {
1173 0x00181b80,
1174 "DM9131",
1175
1176 (const phy_cmd_t []) { /* config */
1177 /* parse cr and anar to get some info */
1178 { mk_mii_read(MII_BMCR), mii_parse_cr },
1179 { mk_mii_read(MII_ADVERTISE), mii_parse_anar },
1180 { mk_mii_end, }
1181 },
1182 (const phy_cmd_t []) { /* startup - enable interrupts */
1183 { mk_mii_write(MII_DM9131_INTR, 0x0002), NULL },
1184 { mk_mii_write(MII_BMCR, 0x1200), NULL }, /* autonegotiate */
1185 { mk_mii_end, }
1186 },
1187 (const phy_cmd_t []) { /* ack_int */
1188
1189 /* we need to read INTR, SR and ANER to acknowledge */
1190
1191 { mk_mii_read(MII_DM9131_INTR), NULL },
1192 { mk_mii_read(MII_BMSR), mii_parse_sr },
1193 { mk_mii_read(MII_EXPANSION), NULL },
1194
1195 /* read acsr to get info */
1196
1197 { mk_mii_read(MII_DM9131_ACSR), mii_parse_dm9131_acsr },
1198 { mk_mii_end, }
1199 },
1200 (const phy_cmd_t []) { /* shutdown - disable interrupts */
1201 { mk_mii_write(MII_DM9131_INTR, 0x0f00), NULL },
1202 { mk_mii_end, }
1203 },
1204};
1205
1206
1207#endif /* CONFIG_FEC_DM9131 */
1208#ifdef CONFIG_FCC_DM9161
1209/* ------------------------------------------------------------------------- */
1210/* DM9161 Control register values */
1211#define MIIM_DM9161_CR_STOP 0x0400
1212#define MIIM_DM9161_CR_RSTAN 0x1200
1213
1214#define MIIM_DM9161_SCR 0x10
1215#define MIIM_DM9161_SCR_INIT 0x0610
1216
1217/* DM9161 Specified Configuration and Status Register */
1218#define MIIM_DM9161_SCSR 0x11
1219#define MIIM_DM9161_SCSR_100F 0x8000
1220#define MIIM_DM9161_SCSR_100H 0x4000
1221#define MIIM_DM9161_SCSR_10F 0x2000
1222#define MIIM_DM9161_SCSR_10H 0x1000
1223/* DM9161 10BT register */
1224#define MIIM_DM9161_10BTCSR 0x12
1225#define MIIM_DM9161_10BTCSR_INIT 0x7800
1226/* DM9161 Interrupt Register */
1227#define MIIM_DM9161_INTR 0x15
1228#define MIIM_DM9161_INTR_PEND 0x8000
1229#define MIIM_DM9161_INTR_DPLX_MASK 0x0800
1230#define MIIM_DM9161_INTR_SPD_MASK 0x0400
1231#define MIIM_DM9161_INTR_LINK_MASK 0x0200
1232#define MIIM_DM9161_INTR_MASK 0x0100
1233#define MIIM_DM9161_INTR_DPLX_CHANGE 0x0010
1234#define MIIM_DM9161_INTR_SPD_CHANGE 0x0008
1235#define MIIM_DM9161_INTR_LINK_CHANGE 0x0004
1236#define MIIM_DM9161_INTR_INIT 0x0000
1237#define MIIM_DM9161_INTR_STOP \
1238(MIIM_DM9161_INTR_DPLX_MASK | MIIM_DM9161_INTR_SPD_MASK \
1239 | MIIM_DM9161_INTR_LINK_MASK | MIIM_DM9161_INTR_MASK)
1240
1241static void mii_parse_dm9161_sr(uint mii_reg, struct net_device * dev)
1242{
1243 volatile struct fcc_enet_private *fep = dev->priv;
1244 uint regstat, timeout=0xffff;
1245
1246 while(!(mii_reg & 0x0020) && timeout--)
1247 {
1248 regstat=mk_mii_read(MII_BMSR);
1249 regstat |= fep->phy_addr <<23;
1250 mii_reg = mii_send_receive(fep->fip,regstat);
1251 }
1252
1253 mii_parse_sr(mii_reg, dev);
1254}
1255
1256static void mii_parse_dm9161_scsr(uint mii_reg, struct net_device * dev)
1257{
1258 volatile struct fcc_enet_private *fep = dev->priv;
1259 uint s = fep->phy_status;
1260
1261 s &= ~(PHY_STAT_SPMASK);
1262 switch((mii_reg >>12) & 0xf) {
1263 case 1:
1264 {
1265 s |= PHY_STAT_10HDX;
1266 printk("10BaseT Half Duplex\n");
1267 break;
1268 }
1269 case 2:
1270 {
1271 s |= PHY_STAT_10FDX;
1272 printk("10BaseT Full Duplex\n");
1273 break;
1274 }
1275 case 4:
1276 {
1277 s |= PHY_STAT_100HDX;
1278 printk("100BaseT Half Duplex\n");
1279 break;
1280 }
1281 case 8:
1282 {
1283 s |= PHY_STAT_100FDX;
1284 printk("100BaseT Full Duplex\n");
1285 break;
1286 }
1287 }
1288
1289 fep->phy_status = s;
1290
1291}
1292
1293static void mii_dm9161_wait(uint mii_reg, struct net_device *dev)
1294{
1295 int timeout = HZ;
1296
1297 /* Davicom takes a bit to come up after a reset,
1298 * so wait here for a bit */
1299 schedule_timeout_uninterruptible(timeout);
1300}
1301
1302static phy_info_t phy_info_dm9161 = {
1303 0x00181b88,
1304 "Davicom DM9161E",
1305 (const phy_cmd_t[]) { /* config */
1306 { mk_mii_write(MII_BMCR, MIIM_DM9161_CR_STOP), NULL},
1307 /* Do not bypass the scrambler/descrambler */
1308 { mk_mii_write(MIIM_DM9161_SCR, MIIM_DM9161_SCR_INIT), NULL},
1309 /* Configure 10BTCSR register */
1310 { mk_mii_write(MIIM_DM9161_10BTCSR, MIIM_DM9161_10BTCSR_INIT),NULL},
1311 /* Configure some basic stuff */
1312 { mk_mii_write(MII_BMCR, 0x1000), NULL},
1313 { mk_mii_read(MII_BMCR), mii_parse_cr },
1314 { mk_mii_read(MII_ADVERTISE), mii_parse_anar },
1315 { mk_mii_end,}
1316 },
1317 (const phy_cmd_t[]) { /* startup */
1318 /* Restart Auto Negotiation */
1319 { mk_mii_write(MII_BMCR, MIIM_DM9161_CR_RSTAN), NULL},
1320 /* Status is read once to clear old link state */
1321 { mk_mii_read(MII_BMSR), mii_dm9161_wait},
1322 /* Auto-negotiate */
1323 { mk_mii_read(MII_BMSR), mii_parse_dm9161_sr},
1324 /* Read the status */
1325 { mk_mii_read(MIIM_DM9161_SCSR), mii_parse_dm9161_scsr},
1326 /* Clear any pending interrupts */
1327 { mk_mii_read(MIIM_DM9161_INTR), NULL},
1328 /* Enable Interrupts */
1329 { mk_mii_write(MIIM_DM9161_INTR, MIIM_DM9161_INTR_INIT), NULL},
1330 { mk_mii_end,}
1331 },
1332 (const phy_cmd_t[]) { /* ack_int */
1333 { mk_mii_read(MIIM_DM9161_INTR), NULL},
1334#if 0
1335 { mk_mii_read(MII_BMSR), NULL},
1336 { mk_mii_read(MII_BMSR), mii_parse_dm9161_sr},
1337 { mk_mii_read(MIIM_DM9161_SCSR), mii_parse_dm9161_scsr},
1338#endif
1339 { mk_mii_end,}
1340 },
1341 (const phy_cmd_t[]) { /* shutdown */
1342 { mk_mii_read(MIIM_DM9161_INTR),NULL},
1343 { mk_mii_write(MIIM_DM9161_INTR, MIIM_DM9161_INTR_STOP), NULL},
1344 { mk_mii_end,}
1345 },
1346};
1347#endif /* CONFIG_FCC_DM9161 */
1348
1349static phy_info_t *phy_info[] = {
1350
1351#ifdef CONFIG_FCC_LXT970
1352 &phy_info_lxt970,
1353#endif /* CONFIG_FEC_LXT970 */
1354
1355#ifdef CONFIG_FCC_LXT971
1356 &phy_info_lxt971,
1357#endif /* CONFIG_FEC_LXT971 */
1358
1359#ifdef CONFIG_FCC_QS6612
1360 &phy_info_qs6612,
1361#endif /* CONFIG_FEC_QS6612 */
1362
1363#ifdef CONFIG_FCC_DM9131
1364 &phy_info_dm9131,
1365#endif /* CONFIG_FEC_DM9131 */
1366
1367#ifdef CONFIG_FCC_DM9161
1368 &phy_info_dm9161,
1369#endif /* CONFIG_FCC_DM9161 */
1370
1371#ifdef CONFIG_FCC_GENERIC_PHY
1372 /* Generic PHY support. This must be the last PHY in the table.
1373 * It will be used to support any PHY that doesn't match a previous
1374 * entry in the table.
1375 */
1376 &phy_info_generic,
1377#endif /* CONFIG_FCC_GENERIC_PHY */
1378
1379 NULL
1380};
1381
1382static void mii_display_status(struct work_struct *work)
1383{
1384 volatile struct fcc_enet_private *fep =
1385 container_of(work, struct fcc_enet_private, phy_relink);
1386 struct net_device *dev = fep->dev;
1387 uint s = fep->phy_status;
1388
1389 if (!fep->link && !fep->old_link) {
1390 /* Link is still down - don't print anything */
1391 return;
1392 }
1393
1394 printk("%s: status: ", dev->name);
1395
1396 if (!fep->link) {
1397 printk("link down");
1398 } else {
1399 printk("link up");
1400
1401 switch(s & PHY_STAT_SPMASK) {
1402 case PHY_STAT_100FDX: printk(", 100 Mbps Full Duplex"); break;
1403 case PHY_STAT_100HDX: printk(", 100 Mbps Half Duplex"); break;
1404 case PHY_STAT_10FDX: printk(", 10 Mbps Full Duplex"); break;
1405 case PHY_STAT_10HDX: printk(", 10 Mbps Half Duplex"); break;
1406 default:
1407 printk(", Unknown speed/duplex");
1408 }
1409
1410 if (s & PHY_STAT_ANC)
1411 printk(", auto-negotiation complete");
1412 }
1413
1414 if (s & PHY_STAT_FAULT)
1415 printk(", remote fault");
1416
1417 printk(".\n");
1418}
1419
1420static void mii_display_config(struct work_struct *work)
1421{
1422 volatile struct fcc_enet_private *fep =
1423 container_of(work, struct fcc_enet_private,
1424 phy_display_config);
1425 struct net_device *dev = fep->dev;
1426 uint s = fep->phy_status;
1427
1428 printk("%s: config: auto-negotiation ", dev->name);
1429
1430 if (s & PHY_CONF_ANE)
1431 printk("on");
1432 else
1433 printk("off");
1434
1435 if (s & PHY_CONF_100FDX)
1436 printk(", 100FDX");
1437 if (s & PHY_CONF_100HDX)
1438 printk(", 100HDX");
1439 if (s & PHY_CONF_10FDX)
1440 printk(", 10FDX");
1441 if (s & PHY_CONF_10HDX)
1442 printk(", 10HDX");
1443 if (!(s & PHY_CONF_SPMASK))
1444 printk(", No speed/duplex selected?");
1445
1446 if (s & PHY_CONF_LOOP)
1447 printk(", loopback enabled");
1448
1449 printk(".\n");
1450
1451 fep->sequence_done = 1;
1452}
1453
1454static void mii_relink(struct net_device *dev)
1455{
1456 struct fcc_enet_private *fep = dev->priv;
1457 int duplex = 0;
1458
1459 fep->old_link = fep->link;
1460 fep->link = (fep->phy_status & PHY_STAT_LINK) ? 1 : 0;
1461
1462#ifdef MDIO_DEBUG
1463 printk(" mii_relink: link=%d\n", fep->link);
1464#endif
1465
1466 if (fep->link) {
1467 if (fep->phy_status
1468 & (PHY_STAT_100FDX | PHY_STAT_10FDX))
1469 duplex = 1;
1470 fcc_restart(dev, duplex);
1471#ifdef MDIO_DEBUG
1472 printk(" mii_relink: duplex=%d\n", duplex);
1473#endif
1474 }
1475}
1476
1477static void mii_queue_relink(uint mii_reg, struct net_device *dev)
1478{
1479 struct fcc_enet_private *fep = dev->priv;
1480
1481 mii_relink(dev);
1482
1483 schedule_work(&fep->phy_relink);
1484}
1485
1486static void mii_queue_config(uint mii_reg, struct net_device *dev)
1487{
1488 struct fcc_enet_private *fep = dev->priv;
1489
1490 schedule_work(&fep->phy_display_config);
1491}
1492
1493phy_cmd_t phy_cmd_relink[] = { { mk_mii_read(MII_BMCR), mii_queue_relink },
1494 { mk_mii_end, } };
1495phy_cmd_t phy_cmd_config[] = { { mk_mii_read(MII_BMCR), mii_queue_config },
1496 { mk_mii_end, } };
1497
1498
1499/* Read remainder of PHY ID.
1500*/
1501static void
1502mii_discover_phy3(uint mii_reg, struct net_device *dev)
1503{
1504 struct fcc_enet_private *fep;
1505 int i;
1506
1507 fep = dev->priv;
1508 printk("mii_reg: %08x\n", mii_reg);
1509 fep->phy_id |= (mii_reg & 0xffff);
1510
1511 for(i = 0; phy_info[i]; i++)
1512 if((phy_info[i]->id == (fep->phy_id >> 4)) || !phy_info[i]->id)
1513 break;
1514
1515 if(!phy_info[i])
1516 panic("%s: PHY id 0x%08x is not supported!\n",
1517 dev->name, fep->phy_id);
1518
1519 fep->phy = phy_info[i];
1520 fep->phy_id_done = 1;
1521
1522 printk("%s: Phy @ 0x%x, type %s (0x%08x)\n",
1523 dev->name, fep->phy_addr, fep->phy->name, fep->phy_id);
1524}
1525
1526/* Scan all of the MII PHY addresses looking for someone to respond
1527 * with a valid ID. This usually happens quickly.
1528 */
1529static void
1530mii_discover_phy(uint mii_reg, struct net_device *dev)
1531{
1532 struct fcc_enet_private *fep;
1533 uint phytype;
1534
1535 fep = dev->priv;
1536
1537 if ((phytype = (mii_reg & 0xffff)) != 0xffff) {
1538
1539 /* Got first part of ID, now get remainder. */
1540 fep->phy_id = phytype << 16;
1541 mii_queue(dev, mk_mii_read(MII_PHYSID2), mii_discover_phy3);
1542 } else {
1543 fep->phy_addr++;
1544 if (fep->phy_addr < 32) {
1545 mii_queue(dev, mk_mii_read(MII_PHYSID1),
1546 mii_discover_phy);
1547 } else {
1548 printk("fec: No PHY device found.\n");
1549 }
1550 }
1551}
1552#endif /* CONFIG_USE_MDIO */
1553
1554#ifdef PHY_INTERRUPT
1555/* This interrupt occurs when the PHY detects a link change. */
1556static irqreturn_t
1557mii_link_interrupt(int irq, void * dev_id)
1558{
1559 struct net_device *dev = dev_id;
1560 struct fcc_enet_private *fep = dev->priv;
1561 fcc_info_t *fip = fep->fip;
1562
1563 if (fep->phy) {
1564 /* We don't want to be interrupted by an FCC
1565 * interrupt here.
1566 */
1567 disable_irq_nosync(fip->fc_interrupt);
1568
1569 mii_do_cmd(dev, fep->phy->ack_int);
1570 /* restart and display status */
1571 mii_do_cmd(dev, phy_cmd_relink);
1572
1573 enable_irq(fip->fc_interrupt);
1574 }
1575 return IRQ_HANDLED;
1576}
1577#endif /* ifdef PHY_INTERRUPT */
1578
1579#if 0 /* This should be fixed someday */
1580/* Set or clear the multicast filter for this adaptor.
1581 * Skeleton taken from sunlance driver.
1582 * The CPM Ethernet implementation allows Multicast as well as individual
1583 * MAC address filtering. Some of the drivers check to make sure it is
1584 * a group multicast address, and discard those that are not. I guess I
1585 * will do the same for now, but just remove the test if you want
1586 * individual filtering as well (do the upper net layers want or support
1587 * this kind of feature?).
1588 */
1589static void
1590set_multicast_list(struct net_device *dev)
1591{
1592 struct fcc_enet_private *cep;
1593 struct dev_mc_list *dmi;
1594 u_char *mcptr, *tdptr;
1595 volatile fcc_enet_t *ep;
1596 int i, j;
1597
1598 cep = (struct fcc_enet_private *)dev->priv;
1599
1600return;
1601 /* Get pointer to FCC area in parameter RAM.
1602 */
1603 ep = (fcc_enet_t *)dev->base_addr;
1604
1605 if (dev->flags&IFF_PROMISC) {
1606
1607 /* Log any net taps. */
1608 printk("%s: Promiscuous mode enabled.\n", dev->name);
1609 cep->fccp->fcc_fpsmr |= FCC_PSMR_PRO;
1610 } else {
1611
1612 cep->fccp->fcc_fpsmr &= ~FCC_PSMR_PRO;
1613
1614 if (dev->flags & IFF_ALLMULTI) {
1615 /* Catch all multicast addresses, so set the
1616 * filter to all 1's.
1617 */
1618 ep->fen_gaddrh = 0xffffffff;
1619 ep->fen_gaddrl = 0xffffffff;
1620 }
1621 else {
1622 /* Clear filter and add the addresses in the list.
1623 */
1624 ep->fen_gaddrh = 0;
1625 ep->fen_gaddrl = 0;
1626
1627 dmi = dev->mc_list;
1628
1629 for (i=0; i<dev->mc_count; i++, dmi = dmi->next) {
1630
1631 /* Only support group multicast for now.
1632 */
1633 if (!(dmi->dmi_addr[0] & 1))
1634 continue;
1635
1636 /* The address in dmi_addr is LSB first,
1637 * and taddr is MSB first. We have to
1638 * copy bytes MSB first from dmi_addr.
1639 */
1640 mcptr = (u_char *)dmi->dmi_addr + 5;
1641 tdptr = (u_char *)&ep->fen_taddrh;
1642 for (j=0; j<6; j++)
1643 *tdptr++ = *mcptr--;
1644
1645 /* Ask CPM to run CRC and set bit in
1646 * filter mask.
1647 */
1648 cpmp->cp_cpcr = mk_cr_cmd(cep->fip->fc_cpmpage,
1649 cep->fip->fc_cpmblock, 0x0c,
1650 CPM_CR_SET_GADDR) | CPM_CR_FLG;
1651 udelay(10);
1652 while (cpmp->cp_cpcr & CPM_CR_FLG);
1653 }
1654 }
1655 }
1656}
1657#endif /* if 0 */
1658
1659
1660/* Set the individual MAC address.
1661 */
1662int fcc_enet_set_mac_address(struct net_device *dev, void *p)
1663{
1664 struct sockaddr *addr= (struct sockaddr *) p;
1665 struct fcc_enet_private *cep;
1666 volatile fcc_enet_t *ep;
1667 unsigned char *eap;
1668 int i;
1669
1670 cep = (struct fcc_enet_private *)(dev->priv);
1671 ep = cep->ep;
1672
1673 if (netif_running(dev))
1674 return -EBUSY;
1675
1676 memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
1677
1678 eap = (unsigned char *) &(ep->fen_paddrh);
1679 for (i=5; i>=0; i--)
1680 *eap++ = addr->sa_data[i];
1681
1682 return 0;
1683}
1684
1685
1686/* Initialize the CPM Ethernet on FCC.
1687 */
1688static int __init fec_enet_init(void)
1689{
1690 struct net_device *dev;
1691 struct fcc_enet_private *cep;
1692 fcc_info_t *fip;
1693 int i, np, err;
1694 volatile cpm2_map_t *immap;
1695 volatile iop_cpm2_t *io;
1696
1697 immap = (cpm2_map_t *)CPM_MAP_ADDR; /* and to internal registers */
1698 io = &immap->im_ioport;
1699
1700 np = sizeof(fcc_ports) / sizeof(fcc_info_t);
1701 fip = fcc_ports;
1702
1703 while (np-- > 0) {
1704 /* Create an Ethernet device instance.
1705 */
1706 dev = alloc_etherdev(sizeof(*cep));
1707 if (!dev)
1708 return -ENOMEM;
1709
1710 cep = dev->priv;
1711 spin_lock_init(&cep->lock);
1712 cep->fip = fip;
1713
1714 init_fcc_shutdown(fip, cep, immap);
1715 init_fcc_ioports(fip, io, immap);
1716 init_fcc_param(fip, dev, immap);
1717
1718 dev->base_addr = (unsigned long)(cep->ep);
1719
1720 /* The CPM Ethernet specific entries in the device
1721 * structure.
1722 */
1723 dev->open = fcc_enet_open;
1724 dev->hard_start_xmit = fcc_enet_start_xmit;
1725 dev->tx_timeout = fcc_enet_timeout;
1726 dev->watchdog_timeo = TX_TIMEOUT;
1727 dev->stop = fcc_enet_close;
1728 dev->get_stats = fcc_enet_get_stats;
1729 /* dev->set_multicast_list = set_multicast_list; */
1730 dev->set_mac_address = fcc_enet_set_mac_address;
1731
1732 init_fcc_startup(fip, dev);
1733
1734 err = register_netdev(dev);
1735 if (err) {
1736 free_netdev(dev);
1737 return err;
1738 }
1739
1740 printk("%s: FCC ENET Version 0.3, ", dev->name);
1741 for (i=0; i<5; i++)
1742 printk("%02x:", dev->dev_addr[i]);
1743 printk("%02x\n", dev->dev_addr[5]);
1744
1745#ifdef CONFIG_USE_MDIO
1746 /* Queue up command to detect the PHY and initialize the
1747 * remainder of the interface.
1748 */
1749 cep->phy_id_done = 0;
1750 cep->phy_addr = fip->fc_phyaddr;
1751 mii_queue(dev, mk_mii_read(MII_PHYSID1), mii_discover_phy);
1752 INIT_WORK(&cep->phy_relink, mii_display_status);
1753 INIT_WORK(&cep->phy_display_config, mii_display_config);
1754 cep->dev = dev;
1755#endif /* CONFIG_USE_MDIO */
1756
1757 fip++;
1758 }
1759
1760 return 0;
1761}
1762module_init(fec_enet_init);
1763
1764/* Make sure the device is shut down during initialization.
1765*/
1766static void __init
1767init_fcc_shutdown(fcc_info_t *fip, struct fcc_enet_private *cep,
1768 volatile cpm2_map_t *immap)
1769{
1770 volatile fcc_enet_t *ep;
1771 volatile fcc_t *fccp;
1772
1773 /* Get pointer to FCC area in parameter RAM.
1774 */
1775 ep = (fcc_enet_t *)(&immap->im_dprambase[fip->fc_proff]);
1776
1777 /* And another to the FCC register area.
1778 */
1779 fccp = (volatile fcc_t *)(&immap->im_fcc[fip->fc_fccnum]);
1780 cep->fccp = fccp; /* Keep the pointers handy */
1781 cep->ep = ep;
1782
1783 /* Disable receive and transmit in case someone left it running.
1784 */
1785 fccp->fcc_gfmr &= ~(FCC_GFMR_ENR | FCC_GFMR_ENT);
1786}
1787
1788/* Initialize the I/O pins for the FCC Ethernet.
1789*/
1790static void __init
1791init_fcc_ioports(fcc_info_t *fip, volatile iop_cpm2_t *io,
1792 volatile cpm2_map_t *immap)
1793{
1794
1795 /* FCC1 pins are on port A/C. FCC2/3 are port B/C.
1796 */
1797 if (fip->fc_proff == PROFF_FCC1) {
1798 /* Configure port A and C pins for FCC1 Ethernet.
1799 */
1800 io->iop_pdira &= ~PA1_DIRA_BOUT;
1801 io->iop_pdira |= PA1_DIRA_BIN;
1802 io->iop_psora &= ~PA1_PSORA_BOUT;
1803 io->iop_psora |= PA1_PSORA_BIN;
1804 io->iop_ppara |= (PA1_DIRA_BOUT | PA1_DIRA_BIN);
1805 }
1806 if (fip->fc_proff == PROFF_FCC2) {
1807 /* Configure port B and C pins for FCC Ethernet.
1808 */
1809 io->iop_pdirb &= ~PB2_DIRB_BOUT;
1810 io->iop_pdirb |= PB2_DIRB_BIN;
1811 io->iop_psorb &= ~PB2_PSORB_BOUT;
1812 io->iop_psorb |= PB2_PSORB_BIN;
1813 io->iop_pparb |= (PB2_DIRB_BOUT | PB2_DIRB_BIN);
1814 }
1815 if (fip->fc_proff == PROFF_FCC3) {
1816 /* Configure port B and C pins for FCC Ethernet.
1817 */
1818 io->iop_pdirb &= ~PB3_DIRB_BOUT;
1819 io->iop_pdirb |= PB3_DIRB_BIN;
1820 io->iop_psorb &= ~PB3_PSORB_BOUT;
1821 io->iop_psorb |= PB3_PSORB_BIN;
1822 io->iop_pparb |= (PB3_DIRB_BOUT | PB3_DIRB_BIN);
1823
1824 io->iop_pdirc &= ~PC3_DIRC_BOUT;
1825 io->iop_pdirc |= PC3_DIRC_BIN;
1826 io->iop_psorc &= ~PC3_PSORC_BOUT;
1827 io->iop_psorc |= PC3_PSORC_BIN;
1828 io->iop_pparc |= (PC3_DIRC_BOUT | PC3_DIRC_BIN);
1829
1830 }
1831
1832 /* Port C has clocks......
1833 */
1834 io->iop_psorc &= ~(fip->fc_trxclocks);
1835 io->iop_pdirc &= ~(fip->fc_trxclocks);
1836 io->iop_pparc |= fip->fc_trxclocks;
1837
1838#ifdef CONFIG_USE_MDIO
1839 /* ....and the MII serial clock/data.
1840 */
1841 io->iop_pdatc |= (fip->fc_mdio | fip->fc_mdck);
1842 io->iop_podrc &= ~(fip->fc_mdio | fip->fc_mdck);
1843 io->iop_pdirc |= (fip->fc_mdio | fip->fc_mdck);
1844 io->iop_pparc &= ~(fip->fc_mdio | fip->fc_mdck);
1845#endif /* CONFIG_USE_MDIO */
1846
1847 /* Configure Serial Interface clock routing.
1848 * First, clear all FCC bits to zero,
1849 * then set the ones we want.
1850 */
1851 immap->im_cpmux.cmx_fcr &= ~(fip->fc_clockmask);
1852 immap->im_cpmux.cmx_fcr |= fip->fc_clockroute;
1853}
1854
1855static void __init
1856init_fcc_param(fcc_info_t *fip, struct net_device *dev,
1857 volatile cpm2_map_t *immap)
1858{
1859 unsigned char *eap;
1860 unsigned long mem_addr;
1861 bd_t *bd;
1862 int i, j;
1863 struct fcc_enet_private *cep;
1864 volatile fcc_enet_t *ep;
1865 volatile cbd_t *bdp;
1866 volatile cpm_cpm2_t *cp;
1867
1868 cep = (struct fcc_enet_private *)(dev->priv);
1869 ep = cep->ep;
1870 cp = cpmp;
1871
1872 bd = (bd_t *)__res;
1873
1874 /* Zero the whole thing.....I must have missed some individually.
1875 * It works when I do this.
1876 */
1877 memset((char *)ep, 0, sizeof(fcc_enet_t));
1878
1879 /* Allocate space for the buffer descriptors from regular memory.
1880 * Initialize base addresses for the buffer descriptors.
1881 */
1882 cep->rx_bd_base = kmalloc(sizeof(cbd_t) * RX_RING_SIZE,
1883 GFP_KERNEL | GFP_DMA);
1884 ep->fen_genfcc.fcc_rbase = __pa(cep->rx_bd_base);
1885 cep->tx_bd_base = kmalloc(sizeof(cbd_t) * TX_RING_SIZE,
1886 GFP_KERNEL | GFP_DMA);
1887 ep->fen_genfcc.fcc_tbase = __pa(cep->tx_bd_base);
1888
1889 cep->dirty_tx = cep->cur_tx = cep->tx_bd_base;
1890 cep->cur_rx = cep->rx_bd_base;
1891
1892 ep->fen_genfcc.fcc_rstate = (CPMFCR_GBL | CPMFCR_EB) << 24;
1893 ep->fen_genfcc.fcc_tstate = (CPMFCR_GBL | CPMFCR_EB) << 24;
1894
1895 /* Set maximum bytes per receive buffer.
1896 * It must be a multiple of 32.
1897 */
1898 ep->fen_genfcc.fcc_mrblr = PKT_MAXBLR_SIZE;
1899
1900 /* Allocate space in the reserved FCC area of DPRAM for the
1901 * internal buffers. No one uses this space (yet), so we
1902 * can do this. Later, we will add resource management for
1903 * this area.
1904 */
1905 mem_addr = CPM_FCC_SPECIAL_BASE + (fip->fc_fccnum * 128);
1906 ep->fen_genfcc.fcc_riptr = mem_addr;
1907 ep->fen_genfcc.fcc_tiptr = mem_addr+32;
1908 ep->fen_padptr = mem_addr+64;
1909 memset((char *)(&(immap->im_dprambase[(mem_addr+64)])), 0x88, 32);
1910
1911 ep->fen_genfcc.fcc_rbptr = 0;
1912 ep->fen_genfcc.fcc_tbptr = 0;
1913 ep->fen_genfcc.fcc_rcrc = 0;
1914 ep->fen_genfcc.fcc_tcrc = 0;
1915 ep->fen_genfcc.fcc_res1 = 0;
1916 ep->fen_genfcc.fcc_res2 = 0;
1917
1918 ep->fen_camptr = 0; /* CAM isn't used in this driver */
1919
1920 /* Set CRC preset and mask.
1921 */
1922 ep->fen_cmask = 0xdebb20e3;
1923 ep->fen_cpres = 0xffffffff;
1924
1925 ep->fen_crcec = 0; /* CRC Error counter */
1926 ep->fen_alec = 0; /* alignment error counter */
1927 ep->fen_disfc = 0; /* discard frame counter */
1928 ep->fen_retlim = 15; /* Retry limit threshold */
1929 ep->fen_pper = 0; /* Normal persistence */
1930
1931 /* Clear hash filter tables.
1932 */
1933 ep->fen_gaddrh = 0;
1934 ep->fen_gaddrl = 0;
1935 ep->fen_iaddrh = 0;
1936 ep->fen_iaddrl = 0;
1937
1938 /* Clear the Out-of-sequence TxBD.
1939 */
1940 ep->fen_tfcstat = 0;
1941 ep->fen_tfclen = 0;
1942 ep->fen_tfcptr = 0;
1943
1944 ep->fen_mflr = PKT_MAXBUF_SIZE; /* maximum frame length register */
1945 ep->fen_minflr = PKT_MINBUF_SIZE; /* minimum frame length register */
1946
1947 /* Set Ethernet station address.
1948 *
1949 * This is supplied in the board information structure, so we
1950 * copy that into the controller.
1951 * So, far we have only been given one Ethernet address. We make
1952 * it unique by setting a few bits in the upper byte of the
1953 * non-static part of the address.
1954 */
1955 eap = (unsigned char *)&(ep->fen_paddrh);
1956 for (i=5; i>=0; i--) {
1957
1958/*
1959 * The EP8260 only uses FCC3, so we can safely give it the real
1960 * MAC address.
1961 */
1962#ifdef CONFIG_SBC82xx
1963 if (i == 5) {
1964 /* bd->bi_enetaddr holds the SCC0 address; the FCC
1965 devices count up from there */
1966 dev->dev_addr[i] = bd->bi_enetaddr[i] & ~3;
1967 dev->dev_addr[i] += 1 + fip->fc_fccnum;
1968 *eap++ = dev->dev_addr[i];
1969 }
1970#else
1971#ifndef CONFIG_RPX8260
1972 if (i == 3) {
1973 dev->dev_addr[i] = bd->bi_enetaddr[i];
1974 dev->dev_addr[i] |= (1 << (7 - fip->fc_fccnum));
1975 *eap++ = dev->dev_addr[i];
1976 } else
1977#endif
1978 {
1979 *eap++ = dev->dev_addr[i] = bd->bi_enetaddr[i];
1980 }
1981#endif
1982 }
1983
1984 ep->fen_taddrh = 0;
1985 ep->fen_taddrm = 0;
1986 ep->fen_taddrl = 0;
1987
1988 ep->fen_maxd1 = PKT_MAXDMA_SIZE; /* maximum DMA1 length */
1989 ep->fen_maxd2 = PKT_MAXDMA_SIZE; /* maximum DMA2 length */
1990
1991 /* Clear stat counters, in case we ever enable RMON.
1992 */
1993 ep->fen_octc = 0;
1994 ep->fen_colc = 0;
1995 ep->fen_broc = 0;
1996 ep->fen_mulc = 0;
1997 ep->fen_uspc = 0;
1998 ep->fen_frgc = 0;
1999 ep->fen_ospc = 0;
2000 ep->fen_jbrc = 0;
2001 ep->fen_p64c = 0;
2002 ep->fen_p65c = 0;
2003 ep->fen_p128c = 0;
2004 ep->fen_p256c = 0;
2005 ep->fen_p512c = 0;
2006 ep->fen_p1024c = 0;
2007
2008 ep->fen_rfthr = 0; /* Suggested by manual */
2009 ep->fen_rfcnt = 0;
2010 ep->fen_cftype = 0;
2011
2012 /* Now allocate the host memory pages and initialize the
2013 * buffer descriptors.
2014 */
2015 bdp = cep->tx_bd_base;
2016 for (i=0; i<TX_RING_SIZE; i++) {
2017
2018 /* Initialize the BD for every fragment in the page.
2019 */
2020 bdp->cbd_sc = 0;
2021 bdp->cbd_datlen = 0;
2022 bdp->cbd_bufaddr = 0;
2023 bdp++;
2024 }
2025
2026 /* Set the last buffer to wrap.
2027 */
2028 bdp--;
2029 bdp->cbd_sc |= BD_SC_WRAP;
2030
2031 bdp = cep->rx_bd_base;
2032 for (i=0; i<FCC_ENET_RX_PAGES; i++) {
2033
2034 /* Allocate a page.
2035 */
2036 mem_addr = __get_free_page(GFP_KERNEL);
2037
2038 /* Initialize the BD for every fragment in the page.
2039 */
2040 for (j=0; j<FCC_ENET_RX_FRPPG; j++) {
2041 bdp->cbd_sc = BD_ENET_RX_EMPTY | BD_ENET_RX_INTR;
2042 bdp->cbd_datlen = 0;
2043 bdp->cbd_bufaddr = __pa(mem_addr);
2044 mem_addr += FCC_ENET_RX_FRSIZE;
2045 bdp++;
2046 }
2047 }
2048
2049 /* Set the last buffer to wrap.
2050 */
2051 bdp--;
2052 bdp->cbd_sc |= BD_SC_WRAP;
2053
2054 /* Let's re-initialize the channel now. We have to do it later
2055 * than the manual describes because we have just now finished
2056 * the BD initialization.
2057 */
2058 cp->cp_cpcr = mk_cr_cmd(fip->fc_cpmpage, fip->fc_cpmblock, 0x0c,
2059 CPM_CR_INIT_TRX) | CPM_CR_FLG;
2060 while (cp->cp_cpcr & CPM_CR_FLG);
2061
2062 cep->skb_cur = cep->skb_dirty = 0;
2063}
2064
2065/* Let 'er rip.
2066*/
2067static void __init
2068init_fcc_startup(fcc_info_t *fip, struct net_device *dev)
2069{
2070 volatile fcc_t *fccp;
2071 struct fcc_enet_private *cep;
2072
2073 cep = (struct fcc_enet_private *)(dev->priv);
2074 fccp = cep->fccp;
2075
2076#ifdef CONFIG_RPX8260
2077#ifdef PHY_INTERRUPT
2078 /* Route PHY interrupt to IRQ. The following code only works for
2079 * IRQ1 - IRQ7. It does not work for Port C interrupts.
2080 */
2081 *((volatile u_char *) (RPX_CSR_ADDR + 13)) &= ~BCSR13_FETH_IRQMASK;
2082 *((volatile u_char *) (RPX_CSR_ADDR + 13)) |=
2083 ((PHY_INTERRUPT - SIU_INT_IRQ1 + 1) << 4);
2084#endif
2085 /* Initialize MDIO pins. */
2086 *((volatile u_char *) (RPX_CSR_ADDR + 4)) &= ~BCSR4_MII_MDC;
2087 *((volatile u_char *) (RPX_CSR_ADDR + 4)) |=
2088 BCSR4_MII_READ | BCSR4_MII_MDIO;
2089 /* Enable external LXT971 PHY. */
2090 *((volatile u_char *) (RPX_CSR_ADDR + 4)) |= BCSR4_EN_PHY;
2091 udelay(1000);
2092 *((volatile u_char *) (RPX_CSR_ADDR+ 4)) |= BCSR4_EN_MII;
2093 udelay(1000);
2094#endif /* ifdef CONFIG_RPX8260 */
2095
2096 fccp->fcc_fcce = 0xffff; /* Clear any pending events */
2097
2098 /* Leave FCC interrupts masked for now. Will be unmasked by
2099 * fcc_restart().
2100 */
2101 fccp->fcc_fccm = 0;
2102
2103 /* Install our interrupt handler.
2104 */
2105 if (request_irq(fip->fc_interrupt, fcc_enet_interrupt, 0, "fenet",
2106 dev) < 0)
2107 printk("Can't get FCC IRQ %d\n", fip->fc_interrupt);
2108
2109#ifdef PHY_INTERRUPT
2110 /* Make IRQn edge triggered. This does not work if PHY_INTERRUPT is
2111 * on Port C.
2112 */
2113 ((volatile cpm2_map_t *) CPM_MAP_ADDR)->im_intctl.ic_siexr |=
2114 (1 << (14 - (PHY_INTERRUPT - SIU_INT_IRQ1)));
2115
2116 if (request_irq(PHY_INTERRUPT, mii_link_interrupt, 0,
2117 "mii", dev) < 0)
2118 printk(KERN_CRIT "Can't get MII IRQ %d\n", PHY_INTERRUPT);
2119#endif /* PHY_INTERRUPT */
2120
2121 /* Set GFMR to enable Ethernet operating mode.
2122 */
2123 fccp->fcc_gfmr = (FCC_GFMR_TCI | FCC_GFMR_MODE_ENET);
2124
2125 /* Set sync/delimiters.
2126 */
2127 fccp->fcc_fdsr = 0xd555;
2128
2129 /* Set protocol specific processing mode for Ethernet.
2130 * This has to be adjusted for Full Duplex operation after we can
2131 * determine how to detect that.
2132 */
2133 fccp->fcc_fpsmr = FCC_PSMR_ENCRC;
2134
2135#ifdef CONFIG_PQ2ADS
2136 /* Enable the PHY. */
2137 *(volatile uint *)(BCSR_ADDR + 4) &= ~BCSR1_FETHIEN;
2138 *(volatile uint *)(BCSR_ADDR + 4) |= BCSR1_FETH_RST;
2139#endif
2140#if defined(CONFIG_PQ2ADS) || defined(CONFIG_PQ2FADS)
2141 /* Enable the 2nd PHY. */
2142 *(volatile uint *)(BCSR_ADDR + 12) &= ~BCSR3_FETHIEN2;
2143 *(volatile uint *)(BCSR_ADDR + 12) |= BCSR3_FETH2_RST;
2144#endif
2145
2146#if defined(CONFIG_USE_MDIO) || defined(CONFIG_TQM8260)
2147 /* start in full duplex mode, and negotiate speed
2148 */
2149 fcc_restart (dev, 1);
2150#else
2151 /* start in half duplex mode
2152 */
2153 fcc_restart (dev, 0);
2154#endif
2155}
2156
2157#ifdef CONFIG_USE_MDIO
2158/* MII command/status interface.
2159 * I'm not going to describe all of the details. You can find the
2160 * protocol definition in many other places, including the data sheet
2161 * of most PHY parts.
2162 * I wonder what "they" were thinking (maybe weren't) when they leave
2163 * the I2C in the CPM but I have to toggle these bits......
2164 */
2165#ifdef CONFIG_RPX8260
2166 /* The EP8260 has the MDIO pins in a BCSR instead of on Port C
2167 * like most other boards.
2168 */
2169#define MDIO_ADDR ((volatile u_char *)(RPX_CSR_ADDR + 4))
2170#define MAKE_MDIO_OUTPUT *MDIO_ADDR &= ~BCSR4_MII_READ
2171#define MAKE_MDIO_INPUT *MDIO_ADDR |= BCSR4_MII_READ | BCSR4_MII_MDIO
2172#define OUT_MDIO(bit) \
2173 if (bit) \
2174 *MDIO_ADDR |= BCSR4_MII_MDIO; \
2175 else \
2176 *MDIO_ADDR &= ~BCSR4_MII_MDIO;
2177#define IN_MDIO (*MDIO_ADDR & BCSR4_MII_MDIO)
2178#define OUT_MDC(bit) \
2179 if (bit) \
2180 *MDIO_ADDR |= BCSR4_MII_MDC; \
2181 else \
2182 *MDIO_ADDR &= ~BCSR4_MII_MDC;
2183#else /* ifdef CONFIG_RPX8260 */
2184 /* This is for the usual case where the MDIO pins are on Port C.
2185 */
2186#define MDIO_ADDR (((volatile cpm2_map_t *)CPM_MAP_ADDR)->im_ioport)
2187#define MAKE_MDIO_OUTPUT MDIO_ADDR.iop_pdirc |= fip->fc_mdio
2188#define MAKE_MDIO_INPUT MDIO_ADDR.iop_pdirc &= ~fip->fc_mdio
2189#define OUT_MDIO(bit) \
2190 if (bit) \
2191 MDIO_ADDR.iop_pdatc |= fip->fc_mdio; \
2192 else \
2193 MDIO_ADDR.iop_pdatc &= ~fip->fc_mdio;
2194#define IN_MDIO ((MDIO_ADDR.iop_pdatc) & fip->fc_mdio)
2195#define OUT_MDC(bit) \
2196 if (bit) \
2197 MDIO_ADDR.iop_pdatc |= fip->fc_mdck; \
2198 else \
2199 MDIO_ADDR.iop_pdatc &= ~fip->fc_mdck;
2200#endif /* ifdef CONFIG_RPX8260 */
2201
2202static uint
2203mii_send_receive(fcc_info_t *fip, uint cmd)
2204{
2205 uint retval;
2206 int read_op, i, off;
2207 const int us = 1;
2208
2209 read_op = ((cmd & 0xf0000000) == 0x60000000);
2210
2211 /* Write preamble
2212 */
2213 OUT_MDIO(1);
2214 MAKE_MDIO_OUTPUT;
2215 OUT_MDIO(1);
2216 for (i = 0; i < 32; i++)
2217 {
2218 udelay(us);
2219 OUT_MDC(1);
2220 udelay(us);
2221 OUT_MDC(0);
2222 }
2223
2224 /* Write data
2225 */
2226 for (i = 0, off = 31; i < (read_op ? 14 : 32); i++, --off)
2227 {
2228 OUT_MDIO((cmd >> off) & 0x00000001);
2229 udelay(us);
2230 OUT_MDC(1);
2231 udelay(us);
2232 OUT_MDC(0);
2233 }
2234
2235 retval = cmd;
2236
2237 if (read_op)
2238 {
2239 retval >>= 16;
2240
2241 MAKE_MDIO_INPUT;
2242 udelay(us);
2243 OUT_MDC(1);
2244 udelay(us);
2245 OUT_MDC(0);
2246
2247 for (i = 0; i < 16; i++)
2248 {
2249 udelay(us);
2250 OUT_MDC(1);
2251 udelay(us);
2252 retval <<= 1;
2253 if (IN_MDIO)
2254 retval++;
2255 OUT_MDC(0);
2256 }
2257 }
2258
2259 MAKE_MDIO_INPUT;
2260 udelay(us);
2261 OUT_MDC(1);
2262 udelay(us);
2263 OUT_MDC(0);
2264
2265 return retval;
2266}
2267#endif /* CONFIG_USE_MDIO */
2268
2269static void
2270fcc_stop(struct net_device *dev)
2271{
2272 struct fcc_enet_private *fep= (struct fcc_enet_private *)(dev->priv);
2273 volatile fcc_t *fccp = fep->fccp;
2274 fcc_info_t *fip = fep->fip;
2275 volatile fcc_enet_t *ep = fep->ep;
2276 volatile cpm_cpm2_t *cp = cpmp;
2277 volatile cbd_t *bdp;
2278 int i;
2279
2280 if ((fccp->fcc_gfmr & (FCC_GFMR_ENR | FCC_GFMR_ENT)) == 0)
2281 return; /* already down */
2282
2283 fccp->fcc_fccm = 0;
2284
2285 /* issue the graceful stop tx command */
2286 while (cp->cp_cpcr & CPM_CR_FLG);
2287 cp->cp_cpcr = mk_cr_cmd(fip->fc_cpmpage, fip->fc_cpmblock,
2288 0x0c, CPM_CR_GRA_STOP_TX) | CPM_CR_FLG;
2289 while (cp->cp_cpcr & CPM_CR_FLG);
2290
2291 /* Disable transmit/receive */
2292 fccp->fcc_gfmr &= ~(FCC_GFMR_ENR | FCC_GFMR_ENT);
2293
2294 /* issue the restart tx command */
2295 fccp->fcc_fcce = FCC_ENET_GRA;
2296 while (cp->cp_cpcr & CPM_CR_FLG);
2297 cp->cp_cpcr = mk_cr_cmd(fip->fc_cpmpage, fip->fc_cpmblock,
2298 0x0c, CPM_CR_RESTART_TX) | CPM_CR_FLG;
2299 while (cp->cp_cpcr & CPM_CR_FLG);
2300
2301 /* free tx buffers */
2302 fep->skb_cur = fep->skb_dirty = 0;
2303 for (i=0; i<=TX_RING_MOD_MASK; i++) {
2304 if (fep->tx_skbuff[i] != NULL) {
2305 dev_kfree_skb(fep->tx_skbuff[i]);
2306 fep->tx_skbuff[i] = NULL;
2307 }
2308 }
2309 fep->dirty_tx = fep->cur_tx = fep->tx_bd_base;
2310 fep->tx_free = TX_RING_SIZE;
2311 ep->fen_genfcc.fcc_tbptr = ep->fen_genfcc.fcc_tbase;
2312
2313 /* Initialize the tx buffer descriptors. */
2314 bdp = fep->tx_bd_base;
2315 for (i=0; i<TX_RING_SIZE; i++) {
2316 bdp->cbd_sc = 0;
2317 bdp->cbd_datlen = 0;
2318 bdp->cbd_bufaddr = 0;
2319 bdp++;
2320 }
2321 /* Set the last buffer to wrap. */
2322 bdp--;
2323 bdp->cbd_sc |= BD_SC_WRAP;
2324}
2325
2326static void
2327fcc_restart(struct net_device *dev, int duplex)
2328{
2329 struct fcc_enet_private *fep = (struct fcc_enet_private *)(dev->priv);
2330 volatile fcc_t *fccp = fep->fccp;
2331
2332 /* stop any transmissions in progress */
2333 fcc_stop(dev);
2334
2335 if (duplex)
2336 fccp->fcc_fpsmr |= FCC_PSMR_FDE | FCC_PSMR_LPB;
2337 else
2338 fccp->fcc_fpsmr &= ~(FCC_PSMR_FDE | FCC_PSMR_LPB);
2339
2340 /* Enable interrupts for transmit error, complete frame
2341 * received, and any transmit buffer we have also set the
2342 * interrupt flag.
2343 */
2344 fccp->fcc_fccm = (FCC_ENET_TXE | FCC_ENET_RXF | FCC_ENET_TXB);
2345
2346 /* Enable transmit/receive */
2347 fccp->fcc_gfmr |= FCC_GFMR_ENR | FCC_GFMR_ENT;
2348}
2349
2350static int
2351fcc_enet_open(struct net_device *dev)
2352{
2353 struct fcc_enet_private *fep = dev->priv;
2354
2355#ifdef CONFIG_USE_MDIO
2356 fep->sequence_done = 0;
2357 fep->link = 0;
2358
2359 if (fep->phy) {
2360 fcc_restart(dev, 0); /* always start in half-duplex */
2361 mii_do_cmd(dev, fep->phy->ack_int);
2362 mii_do_cmd(dev, fep->phy->config);
2363 mii_do_cmd(dev, phy_cmd_config); /* display configuration */
2364 while(!fep->sequence_done)
2365 schedule();
2366
2367 mii_do_cmd(dev, fep->phy->startup);
2368 netif_start_queue(dev);
2369 return 0; /* Success */
2370 }
2371 return -ENODEV; /* No PHY we understand */
2372#else
2373 fep->link = 1;
2374 fcc_restart(dev, 0); /* always start in half-duplex */
2375 netif_start_queue(dev);
2376 return 0; /* Always succeed */
2377#endif /* CONFIG_USE_MDIO */
2378}
2379
diff --git a/arch/ppc/8xx_io/Kconfig b/arch/ppc/8xx_io/Kconfig
deleted file mode 100644
index c623e44f01ad..000000000000
--- a/arch/ppc/8xx_io/Kconfig
+++ /dev/null
@@ -1,134 +0,0 @@
1#
2# MPC8xx Communication options
3#
4
5menu "MPC8xx CPM Options"
6 depends on 8xx
7
8config SCC_ENET
9 bool "CPM SCC Ethernet"
10 depends on NET_ETHERNET
11 help
12 Enable Ethernet support via the Motorola MPC8xx serial
13 communications controller.
14
15choice
16 prompt "SCC used for Ethernet"
17 depends on SCC_ENET
18 default SCC1_ENET
19
20config SCC1_ENET
21 bool "SCC1"
22 help
23 Use MPC8xx serial communications controller 1 to drive Ethernet
24 (default).
25
26config SCC2_ENET
27 bool "SCC2"
28 help
29 Use MPC8xx serial communications controller 2 to drive Ethernet.
30
31config SCC3_ENET
32 bool "SCC3"
33 help
34 Use MPC8xx serial communications controller 3 to drive Ethernet.
35
36endchoice
37
38config FEC_ENET
39 bool "860T FEC Ethernet"
40 depends on NET_ETHERNET
41 help
42 Enable Ethernet support via the Fast Ethernet Controller (FCC) on
43 the Motorola MPC8260.
44
45config USE_MDIO
46 bool "Use MDIO for PHY configuration"
47 depends on FEC_ENET
48 help
49 On some boards the hardware configuration of the ethernet PHY can be
50 used without any software interaction over the MDIO interface, so
51 all MII code can be omitted. Say N here if unsure or if you don't
52 need link status reports.
53
54config FEC_AM79C874
55 bool "Support AMD79C874 PHY"
56 depends on USE_MDIO
57
58config FEC_LXT970
59 bool "Support LXT970 PHY"
60 depends on USE_MDIO
61
62config FEC_LXT971
63 bool "Support LXT971 PHY"
64 depends on USE_MDIO
65
66config FEC_QS6612
67 bool "Support QS6612 PHY"
68 depends on USE_MDIO
69
70config ENET_BIG_BUFFERS
71 bool "Use Big CPM Ethernet Buffers"
72 depends on SCC_ENET || FEC_ENET
73 help
74 Allocate large buffers for MPC8xx Ethernet. Increases throughput
75 and decreases the likelihood of dropped packets, but costs memory.
76
77# This doesn't really belong here, but it is convenient to ask
78# 8xx specific questions.
79comment "Generic MPC8xx Options"
80
81config 8xx_COPYBACK
82 bool "Copy-Back Data Cache (else Writethrough)"
83 help
84 Saying Y here will cause the cache on an MPC8xx processor to be used
85 in Copy-Back mode. If you say N here, it is used in Writethrough
86 mode.
87
88 If in doubt, say Y here.
89
90config 8xx_CPU6
91 bool "CPU6 Silicon Errata (860 Pre Rev. C)"
92 help
93 MPC860 CPUs, prior to Rev C have some bugs in the silicon, which
94 require workarounds for Linux (and most other OSes to work). If you
95 get a BUG() very early in boot, this might fix the problem. For
96 more details read the document entitled "MPC860 Family Device Errata
97 Reference" on Motorola's website. This option also incurs a
98 performance hit.
99
100 If in doubt, say N here.
101
102choice
103 prompt "Microcode patch selection"
104 default NO_UCODE_PATCH
105 help
106 Help not implemented yet, coming soon.
107
108config NO_UCODE_PATCH
109 bool "None"
110
111config USB_SOF_UCODE_PATCH
112 bool "USB SOF patch"
113 help
114 Help not implemented yet, coming soon.
115
116config I2C_SPI_UCODE_PATCH
117 bool "I2C/SPI relocation patch"
118 help
119 Help not implemented yet, coming soon.
120
121config I2C_SPI_SMC1_UCODE_PATCH
122 bool "I2C/SPI/SMC1 relocation patch"
123 help
124 Help not implemented yet, coming soon.
125
126endchoice
127
128config UCODE_PATCH
129 bool
130 default y
131 depends on !NO_UCODE_PATCH
132
133endmenu
134
diff --git a/arch/ppc/8xx_io/Makefile b/arch/ppc/8xx_io/Makefile
deleted file mode 100644
index 1051a06df7e0..000000000000
--- a/arch/ppc/8xx_io/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
1#
2# Makefile for the linux MPC8xx ppc-specific parts of comm processor
3#
4
5obj-y := commproc.o
6
7obj-$(CONFIG_FEC_ENET) += fec.o
8obj-$(CONFIG_SCC_ENET) += enet.o
9obj-$(CONFIG_UCODE_PATCH) += micropatch.o
diff --git a/arch/ppc/8xx_io/commproc.c b/arch/ppc/8xx_io/commproc.c
deleted file mode 100644
index 752443df5ecf..000000000000
--- a/arch/ppc/8xx_io/commproc.c
+++ /dev/null
@@ -1,432 +0,0 @@
1/*
2 * General Purpose functions for the global management of the
3 * Communication Processor Module.
4 * Copyright (c) 1997 Dan Malek (dmalek@jlc.net)
5 *
6 * In addition to the individual control of the communication
7 * channels, there are a few functions that globally affect the
8 * communication processor.
9 *
10 * Buffer descriptors must be allocated from the dual ported memory
11 * space. The allocator for that is here. When the communication
12 * process is reset, we reclaim the memory available. There is
13 * currently no deallocator for this memory.
14 * The amount of space available is platform dependent. On the
15 * MBX, the EPPC software loads additional microcode into the
16 * communication processor, and uses some of the DP ram for this
17 * purpose. Current, the first 512 bytes and the last 256 bytes of
18 * memory are used. Right now I am conservative and only use the
19 * memory that can never be used for microcode. If there are
20 * applications that require more DP ram, we can expand the boundaries
21 * but then we have to be careful of any downloaded microcode.
22 */
23#include <linux/errno.h>
24#include <linux/sched.h>
25#include <linux/kernel.h>
26#include <linux/dma-mapping.h>
27#include <linux/param.h>
28#include <linux/string.h>
29#include <linux/mm.h>
30#include <linux/interrupt.h>
31#include <linux/irq.h>
32#include <linux/module.h>
33#include <asm/mpc8xx.h>
34#include <asm/page.h>
35#include <asm/pgtable.h>
36#include <asm/8xx_immap.h>
37#include <asm/cpm1.h>
38#include <asm/io.h>
39#include <asm/tlbflush.h>
40#include <asm/rheap.h>
41
42#define immr_map(member) \
43({ \
44 u32 offset = offsetof(immap_t, member); \
45 void *addr = ioremap (IMAP_ADDR + offset, \
46 FIELD_SIZEOF(immap_t, member)); \
47 addr; \
48})
49
50#define immr_map_size(member, size) \
51({ \
52 u32 offset = offsetof(immap_t, member); \
53 void *addr = ioremap (IMAP_ADDR + offset, size); \
54 addr; \
55})
56
57static void m8xx_cpm_dpinit(void);
58cpm8xx_t *cpmp; /* Pointer to comm processor space */
59
60/* CPM interrupt vector functions.
61*/
62struct cpm_action {
63 void (*handler)(void *);
64 void *dev_id;
65};
66static struct cpm_action cpm_vecs[CPMVEC_NR];
67static irqreturn_t cpm_interrupt(int irq, void * dev);
68static irqreturn_t cpm_error_interrupt(int irq, void *dev);
69/* Define a table of names to identify CPM interrupt handlers in
70 * /proc/interrupts.
71 */
72const char *cpm_int_name[] =
73 { "error", "PC4", "PC5", "SMC2",
74 "SMC1", "SPI", "PC6", "Timer 4",
75 "", "PC7", "PC8", "PC9",
76 "Timer 3", "", "PC10", "PC11",
77 "I2C", "RISC Timer", "Timer 2", "",
78 "IDMA2", "IDMA1", "SDMA error", "PC12",
79 "PC13", "Timer 1", "PC14", "SCC4",
80 "SCC3", "SCC2", "SCC1", "PC15"
81 };
82
83static void
84cpm_mask_irq(unsigned int irq)
85{
86 int cpm_vec = irq - CPM_IRQ_OFFSET;
87
88 clrbits32(&((immap_t *)IMAP_ADDR)->im_cpic.cpic_cimr, (1 << cpm_vec));
89}
90
91static void
92cpm_unmask_irq(unsigned int irq)
93{
94 int cpm_vec = irq - CPM_IRQ_OFFSET;
95
96 setbits32(&((immap_t *)IMAP_ADDR)->im_cpic.cpic_cimr, (1 << cpm_vec));
97}
98
99static void
100cpm_ack(unsigned int irq)
101{
102 /* We do not need to do anything here. */
103}
104
105static void
106cpm_eoi(unsigned int irq)
107{
108 int cpm_vec = irq - CPM_IRQ_OFFSET;
109
110 out_be32(&((immap_t *)IMAP_ADDR)->im_cpic.cpic_cisr, (1 << cpm_vec));
111}
112
113struct hw_interrupt_type cpm_pic = {
114 .typename = " CPM ",
115 .enable = cpm_unmask_irq,
116 .disable = cpm_mask_irq,
117 .ack = cpm_ack,
118 .end = cpm_eoi,
119};
120
121void
122m8xx_cpm_reset(void)
123{
124 volatile immap_t *imp;
125 volatile cpm8xx_t *commproc;
126
127 imp = (immap_t *)IMAP_ADDR;
128 commproc = (cpm8xx_t *)&imp->im_cpm;
129
130#ifdef CONFIG_UCODE_PATCH
131 /* Perform a reset.
132 */
133 commproc->cp_cpcr = (CPM_CR_RST | CPM_CR_FLG);
134
135 /* Wait for it.
136 */
137 while (commproc->cp_cpcr & CPM_CR_FLG);
138
139 cpm_load_patch(imp);
140#endif
141
142 /* Set SDMA Bus Request priority 5.
143 * On 860T, this also enables FEC priority 6. I am not sure
144 * this is what we really want for some applications, but the
145 * manual recommends it.
146 * Bit 25, FAM can also be set to use FEC aggressive mode (860T).
147 */
148 out_be32(&imp->im_siu_conf.sc_sdcr, 1),
149
150 /* Reclaim the DP memory for our use. */
151 m8xx_cpm_dpinit();
152
153 /* Tell everyone where the comm processor resides.
154 */
155 cpmp = (cpm8xx_t *)commproc;
156}
157
158/* This is called during init_IRQ. We used to do it above, but this
159 * was too early since init_IRQ was not yet called.
160 */
161static struct irqaction cpm_error_irqaction = {
162 .handler = cpm_error_interrupt,
163 .mask = CPU_MASK_NONE,
164};
165static struct irqaction cpm_interrupt_irqaction = {
166 .handler = cpm_interrupt,
167 .mask = CPU_MASK_NONE,
168 .name = "CPM cascade",
169};
170
171void
172cpm_interrupt_init(void)
173{
174 int i;
175
176 /* Initialize the CPM interrupt controller.
177 */
178 out_be32(&((immap_t *)IMAP_ADDR)->im_cpic.cpic_cicr,
179 (CICR_SCD_SCC4 | CICR_SCC_SCC3 | CICR_SCB_SCC2 | CICR_SCA_SCC1) |
180 ((CPM_INTERRUPT/2) << 13) | CICR_HP_MASK);
181 out_be32(&((immap_t *)IMAP_ADDR)->im_cpic.cpic_cimr, 0);
182
183 /* install the CPM interrupt controller routines for the CPM
184 * interrupt vectors
185 */
186 for ( i = CPM_IRQ_OFFSET ; i < CPM_IRQ_OFFSET + NR_CPM_INTS ; i++ )
187 irq_desc[i].chip = &cpm_pic;
188
189 /* Set our interrupt handler with the core CPU. */
190 if (setup_irq(CPM_INTERRUPT, &cpm_interrupt_irqaction))
191 panic("Could not allocate CPM IRQ!");
192
193 /* Install our own error handler. */
194 cpm_error_irqaction.name = cpm_int_name[CPMVEC_ERROR];
195 if (setup_irq(CPM_IRQ_OFFSET + CPMVEC_ERROR, &cpm_error_irqaction))
196 panic("Could not allocate CPM error IRQ!");
197
198 setbits32(&((immap_t *)IMAP_ADDR)->im_cpic.cpic_cicr, CICR_IEN);
199}
200
201/*
202 * Get the CPM interrupt vector.
203 */
204int
205cpm_get_irq(void)
206{
207 int cpm_vec;
208
209 /* Get the vector by setting the ACK bit and then reading
210 * the register.
211 */
212 out_be16(&((volatile immap_t *)IMAP_ADDR)->im_cpic.cpic_civr, 1);
213 cpm_vec = in_be16(&((volatile immap_t *)IMAP_ADDR)->im_cpic.cpic_civr);
214 cpm_vec >>= 11;
215
216 return cpm_vec;
217}
218
219/* CPM interrupt controller cascade interrupt.
220*/
221static irqreturn_t
222cpm_interrupt(int irq, void * dev)
223{
224 /* This interrupt handler never actually gets called. It is
225 * installed only to unmask the CPM cascade interrupt in the SIU
226 * and to make the CPM cascade interrupt visible in /proc/interrupts.
227 */
228 return IRQ_HANDLED;
229}
230
231/* The CPM can generate the error interrupt when there is a race condition
232 * between generating and masking interrupts. All we have to do is ACK it
233 * and return. This is a no-op function so we don't need any special
234 * tests in the interrupt handler.
235 */
236static irqreturn_t
237cpm_error_interrupt(int irq, void *dev)
238{
239 return IRQ_HANDLED;
240}
241
242/* A helper function to translate the handler prototype required by
243 * request_irq() to the handler prototype required by cpm_install_handler().
244 */
245static irqreturn_t
246cpm_handler_helper(int irq, void *dev_id)
247{
248 int cpm_vec = irq - CPM_IRQ_OFFSET;
249
250 (*cpm_vecs[cpm_vec].handler)(dev_id);
251
252 return IRQ_HANDLED;
253}
254
255/* Install a CPM interrupt handler.
256 * This routine accepts a CPM interrupt vector in the range 0 to 31.
257 * This routine is retained for backward compatibility. Rather than using
258 * this routine to install a CPM interrupt handler, you can now use
259 * request_irq() with an IRQ in the range CPM_IRQ_OFFSET to
260 * CPM_IRQ_OFFSET + NR_CPM_INTS - 1 (16 to 47).
261 *
262 * Notice that the prototype of the interrupt handler function must be
263 * different depending on whether you install the handler with
264 * request_irq() or cpm_install_handler().
265 */
266void
267cpm_install_handler(int cpm_vec, void (*handler)(void *), void *dev_id)
268{
269 int err;
270
271 /* If null handler, assume we are trying to free the IRQ.
272 */
273 if (!handler) {
274 free_irq(CPM_IRQ_OFFSET + cpm_vec, dev_id);
275 return;
276 }
277
278 if (cpm_vecs[cpm_vec].handler != 0)
279 printk(KERN_INFO "CPM interrupt %x replacing %x\n",
280 (uint)handler, (uint)cpm_vecs[cpm_vec].handler);
281 cpm_vecs[cpm_vec].handler = handler;
282 cpm_vecs[cpm_vec].dev_id = dev_id;
283
284 if ((err = request_irq(CPM_IRQ_OFFSET + cpm_vec, cpm_handler_helper,
285 0, cpm_int_name[cpm_vec], dev_id)))
286 printk(KERN_ERR "request_irq() returned %d for CPM vector %d\n",
287 err, cpm_vec);
288}
289
290/* Free a CPM interrupt handler.
291 * This routine accepts a CPM interrupt vector in the range 0 to 31.
292 * This routine is retained for backward compatibility.
293 */
294void
295cpm_free_handler(int cpm_vec)
296{
297 request_irq(CPM_IRQ_OFFSET + cpm_vec, NULL, 0, 0,
298 cpm_vecs[cpm_vec].dev_id);
299
300 cpm_vecs[cpm_vec].handler = NULL;
301 cpm_vecs[cpm_vec].dev_id = NULL;
302}
303
304/* Set a baud rate generator. This needs lots of work. There are
305 * four BRGs, any of which can be wired to any channel.
306 * The internal baud rate clock is the system clock divided by 16.
307 * This assumes the baudrate is 16x oversampled by the uart.
308 */
309#define BRG_INT_CLK (((bd_t *)__res)->bi_intfreq)
310#define BRG_UART_CLK (BRG_INT_CLK/16)
311#define BRG_UART_CLK_DIV16 (BRG_UART_CLK/16)
312
313void
314cpm_setbrg(uint brg, uint rate)
315{
316 volatile uint *bp;
317
318 /* This is good enough to get SMCs running.....
319 */
320 bp = (uint *)&cpmp->cp_brgc1;
321 bp += brg;
322 /* The BRG has a 12-bit counter. For really slow baud rates (or
323 * really fast processors), we may have to further divide by 16.
324 */
325 if (((BRG_UART_CLK / rate) - 1) < 4096)
326 *bp = (((BRG_UART_CLK / rate) - 1) << 1) | CPM_BRG_EN;
327 else
328 *bp = (((BRG_UART_CLK_DIV16 / rate) - 1) << 1) |
329 CPM_BRG_EN | CPM_BRG_DIV16;
330}
331
332/*
333 * dpalloc / dpfree bits.
334 */
335static spinlock_t cpm_dpmem_lock;
336/*
337 * 16 blocks should be enough to satisfy all requests
338 * until the memory subsystem goes up...
339 */
340static rh_block_t cpm_boot_dpmem_rh_block[16];
341static rh_info_t cpm_dpmem_info;
342
343#define CPM_DPMEM_ALIGNMENT 8
344static u8* dpram_vbase;
345static uint dpram_pbase;
346
347void m8xx_cpm_dpinit(void)
348{
349 spin_lock_init(&cpm_dpmem_lock);
350
351 dpram_vbase = immr_map_size(im_cpm.cp_dpmem, CPM_DATAONLY_BASE + CPM_DATAONLY_SIZE);
352 dpram_pbase = (uint)&((immap_t *)IMAP_ADDR)->im_cpm.cp_dpmem;
353
354 /* Initialize the info header */
355 rh_init(&cpm_dpmem_info, CPM_DPMEM_ALIGNMENT,
356 sizeof(cpm_boot_dpmem_rh_block) /
357 sizeof(cpm_boot_dpmem_rh_block[0]),
358 cpm_boot_dpmem_rh_block);
359
360 /*
361 * Attach the usable dpmem area.
362 * XXX: This is actually crap. CPM_DATAONLY_BASE and
363 * CPM_DATAONLY_SIZE are a subset of the available dparm. It varies
364 * with the processor and the microcode patches applied / activated.
365 * But the following should be at least safe.
366 */
367 rh_attach_region(&cpm_dpmem_info, CPM_DATAONLY_BASE, CPM_DATAONLY_SIZE);
368}
369
370/*
371 * Allocate the requested size worth of DP memory.
372 * This function returns an offset into the DPRAM area.
373 * Use cpm_dpram_addr() to get the virtual address of the area.
374 */
375unsigned long cpm_dpalloc(uint size, uint align)
376{
377 unsigned long start;
378 unsigned long flags;
379
380 spin_lock_irqsave(&cpm_dpmem_lock, flags);
381 cpm_dpmem_info.alignment = align;
382 start = rh_alloc(&cpm_dpmem_info, size, "commproc");
383 spin_unlock_irqrestore(&cpm_dpmem_lock, flags);
384
385 return start;
386}
387EXPORT_SYMBOL(cpm_dpalloc);
388
389int cpm_dpfree(unsigned long offset)
390{
391 int ret;
392 unsigned long flags;
393
394 spin_lock_irqsave(&cpm_dpmem_lock, flags);
395 ret = rh_free(&cpm_dpmem_info, offset);
396 spin_unlock_irqrestore(&cpm_dpmem_lock, flags);
397
398 return ret;
399}
400EXPORT_SYMBOL(cpm_dpfree);
401
402unsigned long cpm_dpalloc_fixed(unsigned long offset, uint size, uint align)
403{
404 unsigned long start;
405 unsigned long flags;
406
407 spin_lock_irqsave(&cpm_dpmem_lock, flags);
408 cpm_dpmem_info.alignment = align;
409 start = rh_alloc_fixed(&cpm_dpmem_info, offset, size, "commproc");
410 spin_unlock_irqrestore(&cpm_dpmem_lock, flags);
411
412 return start;
413}
414EXPORT_SYMBOL(cpm_dpalloc_fixed);
415
416void cpm_dpdump(void)
417{
418 rh_dump(&cpm_dpmem_info);
419}
420EXPORT_SYMBOL(cpm_dpdump);
421
422void *cpm_dpram_addr(unsigned long offset)
423{
424 return (void *)(dpram_vbase + offset);
425}
426EXPORT_SYMBOL(cpm_dpram_addr);
427
428uint cpm_dpram_phys(u8* addr)
429{
430 return (dpram_pbase + (uint)(addr - dpram_vbase));
431}
432EXPORT_SYMBOL(cpm_dpram_phys);
diff --git a/arch/ppc/8xx_io/enet.c b/arch/ppc/8xx_io/enet.c
deleted file mode 100644
index 5899aea1644b..000000000000
--- a/arch/ppc/8xx_io/enet.c
+++ /dev/null
@@ -1,982 +0,0 @@
1/*
2 * Ethernet driver for Motorola MPC8xx.
3 * Copyright (c) 1997 Dan Malek (dmalek@jlc.net)
4 *
5 * I copied the basic skeleton from the lance driver, because I did not
6 * know how to write the Linux driver, but I did know how the LANCE worked.
7 *
8 * This version of the driver is somewhat selectable for the different
9 * processor/board combinations. It works for the boards I know about
10 * now, and should be easily modified to include others. Some of the
11 * configuration information is contained in <asm/cpm1.h> and the
12 * remainder is here.
13 *
14 * Buffer descriptors are kept in the CPM dual port RAM, and the frame
15 * buffers are in the host memory.
16 *
17 * Right now, I am very watseful with the buffers. I allocate memory
18 * pages and then divide them into 2K frame buffers. This way I know I
19 * have buffers large enough to hold one frame within one buffer descriptor.
20 * Once I get this working, I will use 64 or 128 byte CPM buffers, which
21 * will be much more memory efficient and will easily handle lots of
22 * small packets.
23 *
24 */
25#include <linux/kernel.h>
26#include <linux/sched.h>
27#include <linux/string.h>
28#include <linux/ptrace.h>
29#include <linux/errno.h>
30#include <linux/ioport.h>
31#include <linux/slab.h>
32#include <linux/interrupt.h>
33#include <linux/init.h>
34#include <linux/delay.h>
35#include <linux/netdevice.h>
36#include <linux/etherdevice.h>
37#include <linux/skbuff.h>
38#include <linux/spinlock.h>
39#include <linux/dma-mapping.h>
40#include <linux/bitops.h>
41
42#include <asm/8xx_immap.h>
43#include <asm/pgtable.h>
44#include <asm/mpc8xx.h>
45#include <asm/uaccess.h>
46#include <asm/cpm1.h>
47#include <asm/cacheflush.h>
48
49/*
50 * Theory of Operation
51 *
52 * The MPC8xx CPM performs the Ethernet processing on SCC1. It can use
53 * an aribtrary number of buffers on byte boundaries, but must have at
54 * least two receive buffers to prevent constant overrun conditions.
55 *
56 * The buffer descriptors are allocated from the CPM dual port memory
57 * with the data buffers allocated from host memory, just like all other
58 * serial communication protocols. The host memory buffers are allocated
59 * from the free page pool, and then divided into smaller receive and
60 * transmit buffers. The size of the buffers should be a power of two,
61 * since that nicely divides the page. This creates a ring buffer
62 * structure similar to the LANCE and other controllers.
63 *
64 * Like the LANCE driver:
65 * The driver runs as two independent, single-threaded flows of control. One
66 * is the send-packet routine, which enforces single-threaded use by the
67 * cep->tx_busy flag. The other thread is the interrupt handler, which is
68 * single threaded by the hardware and other software.
69 *
70 * The send packet thread has partial control over the Tx ring and the
71 * 'cep->tx_busy' flag. It sets the tx_busy flag whenever it's queuing a Tx
72 * packet. If the next queue slot is empty, it clears the tx_busy flag when
73 * finished otherwise it sets the 'lp->tx_full' flag.
74 *
75 * The MBX has a control register external to the MPC8xx that has some
76 * control of the Ethernet interface. Information is in the manual for
77 * your board.
78 *
79 * The RPX boards have an external control/status register. Consult the
80 * programming documents for details unique to your board.
81 *
82 * For the TQM8xx(L) modules, there is no control register interface.
83 * All functions are directly controlled using I/O pins. See <asm/cpm1.h>.
84 */
85
86/* The transmitter timeout
87 */
88#define TX_TIMEOUT (2*HZ)
89
90/* The number of Tx and Rx buffers. These are allocated from the page
91 * pool. The code may assume these are power of two, so it is best
92 * to keep them that size.
93 * We don't need to allocate pages for the transmitter. We just use
94 * the skbuffer directly.
95 */
96#ifdef CONFIG_ENET_BIG_BUFFERS
97#define CPM_ENET_RX_PAGES 32
98#define CPM_ENET_RX_FRSIZE 2048
99#define CPM_ENET_RX_FRPPG (PAGE_SIZE / CPM_ENET_RX_FRSIZE)
100#define RX_RING_SIZE (CPM_ENET_RX_FRPPG * CPM_ENET_RX_PAGES)
101#define TX_RING_SIZE 64 /* Must be power of two */
102#define TX_RING_MOD_MASK 63 /* for this to work */
103#else
104#define CPM_ENET_RX_PAGES 4
105#define CPM_ENET_RX_FRSIZE 2048
106#define CPM_ENET_RX_FRPPG (PAGE_SIZE / CPM_ENET_RX_FRSIZE)
107#define RX_RING_SIZE (CPM_ENET_RX_FRPPG * CPM_ENET_RX_PAGES)
108#define TX_RING_SIZE 8 /* Must be power of two */
109#define TX_RING_MOD_MASK 7 /* for this to work */
110#endif
111
112/* The CPM stores dest/src/type, data, and checksum for receive packets.
113 */
114#define PKT_MAXBUF_SIZE 1518
115#define PKT_MINBUF_SIZE 64
116#define PKT_MAXBLR_SIZE 1520
117
118/* The CPM buffer descriptors track the ring buffers. The rx_bd_base and
119 * tx_bd_base always point to the base of the buffer descriptors. The
120 * cur_rx and cur_tx point to the currently available buffer.
121 * The dirty_tx tracks the current buffer that is being sent by the
122 * controller. The cur_tx and dirty_tx are equal under both completely
123 * empty and completely full conditions. The empty/ready indicator in
124 * the buffer descriptor determines the actual condition.
125 */
126struct scc_enet_private {
127 /* The saved address of a sent-in-place packet/buffer, for skfree(). */
128 struct sk_buff* tx_skbuff[TX_RING_SIZE];
129 ushort skb_cur;
130 ushort skb_dirty;
131
132 /* CPM dual port RAM relative addresses.
133 */
134 cbd_t *rx_bd_base; /* Address of Rx and Tx buffers. */
135 cbd_t *tx_bd_base;
136 cbd_t *cur_rx, *cur_tx; /* The next free ring entry */
137 cbd_t *dirty_tx; /* The ring entries to be free()ed. */
138 scc_t *sccp;
139
140 /* Virtual addresses for the receive buffers because we can't
141 * do a __va() on them anymore.
142 */
143 unsigned char *rx_vaddr[RX_RING_SIZE];
144 struct net_device_stats stats;
145 uint tx_full;
146 spinlock_t lock;
147};
148
149static int scc_enet_open(struct net_device *dev);
150static int scc_enet_start_xmit(struct sk_buff *skb, struct net_device *dev);
151static int scc_enet_rx(struct net_device *dev);
152static void scc_enet_interrupt(void *dev_id);
153static int scc_enet_close(struct net_device *dev);
154static struct net_device_stats *scc_enet_get_stats(struct net_device *dev);
155static void set_multicast_list(struct net_device *dev);
156
157/* Get this from various configuration locations (depends on board).
158*/
159/*static ushort my_enet_addr[] = { 0x0800, 0x3e26, 0x1559 };*/
160
161/* Typically, 860(T) boards use SCC1 for Ethernet, and other 8xx boards
162 * use SCC2. Some even may use SCC3.
163 * This is easily extended if necessary.
164 */
165#if defined(CONFIG_SCC3_ENET)
166#define CPM_CR_ENET CPM_CR_CH_SCC3
167#define PROFF_ENET PROFF_SCC3
168#define SCC_ENET 2 /* Index, not number! */
169#define CPMVEC_ENET CPMVEC_SCC3
170#elif defined(CONFIG_SCC2_ENET)
171#define CPM_CR_ENET CPM_CR_CH_SCC2
172#define PROFF_ENET PROFF_SCC2
173#define SCC_ENET 1 /* Index, not number! */
174#define CPMVEC_ENET CPMVEC_SCC2
175#elif defined(CONFIG_SCC1_ENET)
176#define CPM_CR_ENET CPM_CR_CH_SCC1
177#define PROFF_ENET PROFF_SCC1
178#define SCC_ENET 0 /* Index, not number! */
179#define CPMVEC_ENET CPMVEC_SCC1
180#else
181#error CONFIG_SCCx_ENET not defined
182#endif
183
184static int
185scc_enet_open(struct net_device *dev)
186{
187
188 /* I should reset the ring buffers here, but I don't yet know
189 * a simple way to do that.
190 */
191
192 netif_start_queue(dev);
193 return 0; /* Always succeed */
194}
195
196static int
197scc_enet_start_xmit(struct sk_buff *skb, struct net_device *dev)
198{
199 struct scc_enet_private *cep = (struct scc_enet_private *)dev->priv;
200 volatile cbd_t *bdp;
201
202 /* Fill in a Tx ring entry */
203 bdp = cep->cur_tx;
204
205#ifndef final_version
206 if (bdp->cbd_sc & BD_ENET_TX_READY) {
207 /* Ooops. All transmit buffers are full. Bail out.
208 * This should not happen, since cep->tx_busy should be set.
209 */
210 printk("%s: tx queue full!.\n", dev->name);
211 return 1;
212 }
213#endif
214
215 /* Clear all of the status flags.
216 */
217 bdp->cbd_sc &= ~BD_ENET_TX_STATS;
218
219 /* If the frame is short, tell CPM to pad it.
220 */
221 if (skb->len <= ETH_ZLEN)
222 bdp->cbd_sc |= BD_ENET_TX_PAD;
223 else
224 bdp->cbd_sc &= ~BD_ENET_TX_PAD;
225
226 /* Set buffer length and buffer pointer.
227 */
228 bdp->cbd_datlen = skb->len;
229 bdp->cbd_bufaddr = __pa(skb->data);
230
231 /* Save skb pointer.
232 */
233 cep->tx_skbuff[cep->skb_cur] = skb;
234
235 cep->stats.tx_bytes += skb->len;
236 cep->skb_cur = (cep->skb_cur+1) & TX_RING_MOD_MASK;
237
238 /* Push the data cache so the CPM does not get stale memory
239 * data.
240 */
241 flush_dcache_range((unsigned long)(skb->data),
242 (unsigned long)(skb->data + skb->len));
243
244 spin_lock_irq(&cep->lock);
245
246 /* Send it on its way. Tell CPM its ready, interrupt when done,
247 * its the last BD of the frame, and to put the CRC on the end.
248 */
249 bdp->cbd_sc |= (BD_ENET_TX_READY | BD_ENET_TX_INTR | BD_ENET_TX_LAST | BD_ENET_TX_TC);
250
251 dev->trans_start = jiffies;
252
253 /* If this was the last BD in the ring, start at the beginning again.
254 */
255 if (bdp->cbd_sc & BD_ENET_TX_WRAP)
256 bdp = cep->tx_bd_base;
257 else
258 bdp++;
259
260 if (bdp->cbd_sc & BD_ENET_TX_READY) {
261 netif_stop_queue(dev);
262 cep->tx_full = 1;
263 }
264
265 cep->cur_tx = (cbd_t *)bdp;
266
267 spin_unlock_irq(&cep->lock);
268
269 return 0;
270}
271
272static void
273scc_enet_timeout(struct net_device *dev)
274{
275 struct scc_enet_private *cep = (struct scc_enet_private *)dev->priv;
276
277 printk("%s: transmit timed out.\n", dev->name);
278 cep->stats.tx_errors++;
279#ifndef final_version
280 {
281 int i;
282 cbd_t *bdp;
283 printk(" Ring data dump: cur_tx %p%s cur_rx %p.\n",
284 cep->cur_tx, cep->tx_full ? " (full)" : "",
285 cep->cur_rx);
286 bdp = cep->tx_bd_base;
287 for (i = 0 ; i < TX_RING_SIZE; i++, bdp++)
288 printk("%04x %04x %08x\n",
289 bdp->cbd_sc,
290 bdp->cbd_datlen,
291 bdp->cbd_bufaddr);
292 bdp = cep->rx_bd_base;
293 for (i = 0 ; i < RX_RING_SIZE; i++, bdp++)
294 printk("%04x %04x %08x\n",
295 bdp->cbd_sc,
296 bdp->cbd_datlen,
297 bdp->cbd_bufaddr);
298 }
299#endif
300 if (!cep->tx_full)
301 netif_wake_queue(dev);
302}
303
304/* The interrupt handler.
305 * This is called from the CPM handler, not the MPC core interrupt.
306 */
307static void
308scc_enet_interrupt(void *dev_id)
309{
310 struct net_device *dev = dev_id;
311 volatile struct scc_enet_private *cep;
312 volatile cbd_t *bdp;
313 ushort int_events;
314 int must_restart;
315
316 cep = (struct scc_enet_private *)dev->priv;
317
318 /* Get the interrupt events that caused us to be here.
319 */
320 int_events = cep->sccp->scc_scce;
321 cep->sccp->scc_scce = int_events;
322 must_restart = 0;
323
324 /* Handle receive event in its own function.
325 */
326 if (int_events & SCCE_ENET_RXF)
327 scc_enet_rx(dev_id);
328
329 /* Check for a transmit error. The manual is a little unclear
330 * about this, so the debug code until I get it figured out. It
331 * appears that if TXE is set, then TXB is not set. However,
332 * if carrier sense is lost during frame transmission, the TXE
333 * bit is set, "and continues the buffer transmission normally."
334 * I don't know if "normally" implies TXB is set when the buffer
335 * descriptor is closed.....trial and error :-).
336 */
337
338 /* Transmit OK, or non-fatal error. Update the buffer descriptors.
339 */
340 if (int_events & (SCCE_ENET_TXE | SCCE_ENET_TXB)) {
341 spin_lock(&cep->lock);
342 bdp = cep->dirty_tx;
343 while ((bdp->cbd_sc&BD_ENET_TX_READY)==0) {
344 if ((bdp==cep->cur_tx) && (cep->tx_full == 0))
345 break;
346
347 if (bdp->cbd_sc & BD_ENET_TX_HB) /* No heartbeat */
348 cep->stats.tx_heartbeat_errors++;
349 if (bdp->cbd_sc & BD_ENET_TX_LC) /* Late collision */
350 cep->stats.tx_window_errors++;
351 if (bdp->cbd_sc & BD_ENET_TX_RL) /* Retrans limit */
352 cep->stats.tx_aborted_errors++;
353 if (bdp->cbd_sc & BD_ENET_TX_UN) /* Underrun */
354 cep->stats.tx_fifo_errors++;
355 if (bdp->cbd_sc & BD_ENET_TX_CSL) /* Carrier lost */
356 cep->stats.tx_carrier_errors++;
357
358
359 /* No heartbeat or Lost carrier are not really bad errors.
360 * The others require a restart transmit command.
361 */
362 if (bdp->cbd_sc &
363 (BD_ENET_TX_LC | BD_ENET_TX_RL | BD_ENET_TX_UN)) {
364 must_restart = 1;
365 cep->stats.tx_errors++;
366 }
367
368 cep->stats.tx_packets++;
369
370 /* Deferred means some collisions occurred during transmit,
371 * but we eventually sent the packet OK.
372 */
373 if (bdp->cbd_sc & BD_ENET_TX_DEF)
374 cep->stats.collisions++;
375
376 /* Free the sk buffer associated with this last transmit.
377 */
378 dev_kfree_skb_irq(cep->tx_skbuff[cep->skb_dirty]);
379 cep->skb_dirty = (cep->skb_dirty + 1) & TX_RING_MOD_MASK;
380
381 /* Update pointer to next buffer descriptor to be transmitted.
382 */
383 if (bdp->cbd_sc & BD_ENET_TX_WRAP)
384 bdp = cep->tx_bd_base;
385 else
386 bdp++;
387
388 /* I don't know if we can be held off from processing these
389 * interrupts for more than one frame time. I really hope
390 * not. In such a case, we would now want to check the
391 * currently available BD (cur_tx) and determine if any
392 * buffers between the dirty_tx and cur_tx have also been
393 * sent. We would want to process anything in between that
394 * does not have BD_ENET_TX_READY set.
395 */
396
397 /* Since we have freed up a buffer, the ring is no longer
398 * full.
399 */
400 if (cep->tx_full) {
401 cep->tx_full = 0;
402 if (netif_queue_stopped(dev))
403 netif_wake_queue(dev);
404 }
405
406 cep->dirty_tx = (cbd_t *)bdp;
407 }
408
409 if (must_restart) {
410 volatile cpm8xx_t *cp;
411
412 /* Some transmit errors cause the transmitter to shut
413 * down. We now issue a restart transmit. Since the
414 * errors close the BD and update the pointers, the restart
415 * _should_ pick up without having to reset any of our
416 * pointers either.
417 */
418 cp = cpmp;
419 cp->cp_cpcr =
420 mk_cr_cmd(CPM_CR_ENET, CPM_CR_RESTART_TX) | CPM_CR_FLG;
421 while (cp->cp_cpcr & CPM_CR_FLG);
422 }
423 spin_unlock(&cep->lock);
424 }
425
426 /* Check for receive busy, i.e. packets coming but no place to
427 * put them. This "can't happen" because the receive interrupt
428 * is tossing previous frames.
429 */
430 if (int_events & SCCE_ENET_BSY) {
431 cep->stats.rx_dropped++;
432 printk("CPM ENET: BSY can't happen.\n");
433 }
434
435 return;
436}
437
438/* During a receive, the cur_rx points to the current incoming buffer.
439 * When we update through the ring, if the next incoming buffer has
440 * not been given to the system, we just set the empty indicator,
441 * effectively tossing the packet.
442 */
443static int
444scc_enet_rx(struct net_device *dev)
445{
446 struct scc_enet_private *cep;
447 volatile cbd_t *bdp;
448 struct sk_buff *skb;
449 ushort pkt_len;
450
451 cep = (struct scc_enet_private *)dev->priv;
452
453 /* First, grab all of the stats for the incoming packet.
454 * These get messed up if we get called due to a busy condition.
455 */
456 bdp = cep->cur_rx;
457
458for (;;) {
459 if (bdp->cbd_sc & BD_ENET_RX_EMPTY)
460 break;
461
462#ifndef final_version
463 /* Since we have allocated space to hold a complete frame, both
464 * the first and last indicators should be set.
465 */
466 if ((bdp->cbd_sc & (BD_ENET_RX_FIRST | BD_ENET_RX_LAST)) !=
467 (BD_ENET_RX_FIRST | BD_ENET_RX_LAST))
468 printk("CPM ENET: rcv is not first+last\n");
469#endif
470
471 /* Frame too long or too short.
472 */
473 if (bdp->cbd_sc & (BD_ENET_RX_LG | BD_ENET_RX_SH))
474 cep->stats.rx_length_errors++;
475 if (bdp->cbd_sc & BD_ENET_RX_NO) /* Frame alignment */
476 cep->stats.rx_frame_errors++;
477 if (bdp->cbd_sc & BD_ENET_RX_CR) /* CRC Error */
478 cep->stats.rx_crc_errors++;
479 if (bdp->cbd_sc & BD_ENET_RX_OV) /* FIFO overrun */
480 cep->stats.rx_crc_errors++;
481
482 /* Report late collisions as a frame error.
483 * On this error, the BD is closed, but we don't know what we
484 * have in the buffer. So, just drop this frame on the floor.
485 */
486 if (bdp->cbd_sc & BD_ENET_RX_CL) {
487 cep->stats.rx_frame_errors++;
488 }
489 else {
490
491 /* Process the incoming frame.
492 */
493 cep->stats.rx_packets++;
494 pkt_len = bdp->cbd_datlen;
495 cep->stats.rx_bytes += pkt_len;
496
497 /* This does 16 byte alignment, much more than we need.
498 * The packet length includes FCS, but we don't want to
499 * include that when passing upstream as it messes up
500 * bridging applications.
501 */
502 skb = dev_alloc_skb(pkt_len-4);
503
504 if (skb == NULL) {
505 printk("%s: Memory squeeze, dropping packet.\n", dev->name);
506 cep->stats.rx_dropped++;
507 }
508 else {
509 skb_put(skb,pkt_len-4); /* Make room */
510 skb_copy_to_linear_data(skb,
511 cep->rx_vaddr[bdp - cep->rx_bd_base],
512 pkt_len-4);
513 skb->protocol=eth_type_trans(skb,dev);
514 netif_rx(skb);
515 }
516 }
517
518 /* Clear the status flags for this buffer.
519 */
520 bdp->cbd_sc &= ~BD_ENET_RX_STATS;
521
522 /* Mark the buffer empty.
523 */
524 bdp->cbd_sc |= BD_ENET_RX_EMPTY;
525
526 /* Update BD pointer to next entry.
527 */
528 if (bdp->cbd_sc & BD_ENET_RX_WRAP)
529 bdp = cep->rx_bd_base;
530 else
531 bdp++;
532
533 }
534 cep->cur_rx = (cbd_t *)bdp;
535
536 return 0;
537}
538
539static int
540scc_enet_close(struct net_device *dev)
541{
542 /* Don't know what to do yet.
543 */
544 netif_stop_queue(dev);
545
546 return 0;
547}
548
549static struct net_device_stats *scc_enet_get_stats(struct net_device *dev)
550{
551 struct scc_enet_private *cep = (struct scc_enet_private *)dev->priv;
552
553 return &cep->stats;
554}
555
556/* Set or clear the multicast filter for this adaptor.
557 * Skeleton taken from sunlance driver.
558 * The CPM Ethernet implementation allows Multicast as well as individual
559 * MAC address filtering. Some of the drivers check to make sure it is
560 * a group multicast address, and discard those that are not. I guess I
561 * will do the same for now, but just remove the test if you want
562 * individual filtering as well (do the upper net layers want or support
563 * this kind of feature?).
564 */
565
566static void set_multicast_list(struct net_device *dev)
567{
568 struct scc_enet_private *cep;
569 struct dev_mc_list *dmi;
570 u_char *mcptr, *tdptr;
571 volatile scc_enet_t *ep;
572 int i, j;
573 cep = (struct scc_enet_private *)dev->priv;
574
575 /* Get pointer to SCC area in parameter RAM.
576 */
577 ep = (scc_enet_t *)dev->base_addr;
578
579 if (dev->flags&IFF_PROMISC) {
580
581 /* Log any net taps. */
582 printk("%s: Promiscuous mode enabled.\n", dev->name);
583 cep->sccp->scc_psmr |= SCC_PSMR_PRO;
584 } else {
585
586 cep->sccp->scc_psmr &= ~SCC_PSMR_PRO;
587
588 if (dev->flags & IFF_ALLMULTI) {
589 /* Catch all multicast addresses, so set the
590 * filter to all 1's.
591 */
592 ep->sen_gaddr1 = 0xffff;
593 ep->sen_gaddr2 = 0xffff;
594 ep->sen_gaddr3 = 0xffff;
595 ep->sen_gaddr4 = 0xffff;
596 }
597 else {
598 /* Clear filter and add the addresses in the list.
599 */
600 ep->sen_gaddr1 = 0;
601 ep->sen_gaddr2 = 0;
602 ep->sen_gaddr3 = 0;
603 ep->sen_gaddr4 = 0;
604
605 dmi = dev->mc_list;
606
607 for (i=0; i<dev->mc_count; i++) {
608
609 /* Only support group multicast for now.
610 */
611 if (!(dmi->dmi_addr[0] & 1))
612 continue;
613
614 /* The address in dmi_addr is LSB first,
615 * and taddr is MSB first. We have to
616 * copy bytes MSB first from dmi_addr.
617 */
618 mcptr = (u_char *)dmi->dmi_addr + 5;
619 tdptr = (u_char *)&ep->sen_taddrh;
620 for (j=0; j<6; j++)
621 *tdptr++ = *mcptr--;
622
623 /* Ask CPM to run CRC and set bit in
624 * filter mask.
625 */
626 cpmp->cp_cpcr = mk_cr_cmd(CPM_CR_ENET, CPM_CR_SET_GADDR) | CPM_CR_FLG;
627 /* this delay is necessary here -- Cort */
628 udelay(10);
629 while (cpmp->cp_cpcr & CPM_CR_FLG);
630 }
631 }
632 }
633}
634
635/* Initialize the CPM Ethernet on SCC. If EPPC-Bug loaded us, or performed
636 * some other network I/O, a whole bunch of this has already been set up.
637 * It is no big deal if we do it again, we just have to disable the
638 * transmit and receive to make sure we don't catch the CPM with some
639 * inconsistent control information.
640 */
641static int __init scc_enet_init(void)
642{
643 struct net_device *dev;
644 struct scc_enet_private *cep;
645 int i, j, k, err;
646 uint dp_offset;
647 unsigned char *eap, *ba;
648 dma_addr_t mem_addr;
649 bd_t *bd;
650 volatile cbd_t *bdp;
651 volatile cpm8xx_t *cp;
652 volatile scc_t *sccp;
653 volatile scc_enet_t *ep;
654 volatile immap_t *immap;
655
656 cp = cpmp; /* Get pointer to Communication Processor */
657
658 immap = (immap_t *)(mfspr(SPRN_IMMR) & 0xFFFF0000); /* and to internal registers */
659
660 bd = (bd_t *)__res;
661
662 dev = alloc_etherdev(sizeof(*cep));
663 if (!dev)
664 return -ENOMEM;
665
666 cep = dev->priv;
667 spin_lock_init(&cep->lock);
668
669 /* Get pointer to SCC area in parameter RAM.
670 */
671 ep = (scc_enet_t *)(&cp->cp_dparam[PROFF_ENET]);
672
673 /* And another to the SCC register area.
674 */
675 sccp = (volatile scc_t *)(&cp->cp_scc[SCC_ENET]);
676 cep->sccp = (scc_t *)sccp; /* Keep the pointer handy */
677
678 /* Disable receive and transmit in case EPPC-Bug started it.
679 */
680 sccp->scc_gsmrl &= ~(SCC_GSMRL_ENR | SCC_GSMRL_ENT);
681
682 /* Cookbook style from the MPC860 manual.....
683 * Not all of this is necessary if EPPC-Bug has initialized
684 * the network.
685 * So far we are lucky, all board configurations use the same
686 * pins, or at least the same I/O Port for these functions.....
687 * It can't last though......
688 */
689
690#if (defined(PA_ENET_RXD) && defined(PA_ENET_TXD))
691 /* Configure port A pins for Txd and Rxd.
692 */
693 immap->im_ioport.iop_papar |= (PA_ENET_RXD | PA_ENET_TXD);
694 immap->im_ioport.iop_padir &= ~(PA_ENET_RXD | PA_ENET_TXD);
695 immap->im_ioport.iop_paodr &= ~PA_ENET_TXD;
696#elif (defined(PB_ENET_RXD) && defined(PB_ENET_TXD))
697 /* Configure port B pins for Txd and Rxd.
698 */
699 immap->im_cpm.cp_pbpar |= (PB_ENET_RXD | PB_ENET_TXD);
700 immap->im_cpm.cp_pbdir &= ~(PB_ENET_RXD | PB_ENET_TXD);
701 immap->im_cpm.cp_pbodr &= ~PB_ENET_TXD;
702#else
703#error Exactly ONE pair of PA_ENET_[RT]XD, PB_ENET_[RT]XD must be defined
704#endif
705
706#if defined(PC_ENET_LBK)
707 /* Configure port C pins to disable External Loopback
708 */
709 immap->im_ioport.iop_pcpar &= ~PC_ENET_LBK;
710 immap->im_ioport.iop_pcdir |= PC_ENET_LBK;
711 immap->im_ioport.iop_pcso &= ~PC_ENET_LBK;
712 immap->im_ioport.iop_pcdat &= ~PC_ENET_LBK; /* Disable Loopback */
713#endif /* PC_ENET_LBK */
714
715#ifdef PE_ENET_TCLK
716 /* Configure port E for TCLK and RCLK.
717 */
718 cp->cp_pepar |= (PE_ENET_TCLK | PE_ENET_RCLK);
719 cp->cp_pedir &= ~(PE_ENET_TCLK | PE_ENET_RCLK);
720 cp->cp_peso &= ~(PE_ENET_TCLK | PE_ENET_RCLK);
721#else
722 /* Configure port A for TCLK and RCLK.
723 */
724 immap->im_ioport.iop_papar |= (PA_ENET_TCLK | PA_ENET_RCLK);
725 immap->im_ioport.iop_padir &= ~(PA_ENET_TCLK | PA_ENET_RCLK);
726#endif
727
728 /* Configure port C pins to enable CLSN and RENA.
729 */
730 immap->im_ioport.iop_pcpar &= ~(PC_ENET_CLSN | PC_ENET_RENA);
731 immap->im_ioport.iop_pcdir &= ~(PC_ENET_CLSN | PC_ENET_RENA);
732 immap->im_ioport.iop_pcso |= (PC_ENET_CLSN | PC_ENET_RENA);
733
734 /* Configure Serial Interface clock routing.
735 * First, clear all SCC bits to zero, then set the ones we want.
736 */
737 cp->cp_sicr &= ~SICR_ENET_MASK;
738 cp->cp_sicr |= SICR_ENET_CLKRT;
739
740 /* Manual says set SDDR, but I can't find anything with that
741 * name. I think it is a misprint, and should be SDCR. This
742 * has already been set by the communication processor initialization.
743 */
744
745 /* Allocate space for the buffer descriptors in the DP ram.
746 * These are relative offsets in the DP ram address space.
747 * Initialize base addresses for the buffer descriptors.
748 */
749 dp_offset = cpm_dpalloc(sizeof(cbd_t) * RX_RING_SIZE, 8);
750 ep->sen_genscc.scc_rbase = dp_offset;
751 cep->rx_bd_base = cpm_dpram_addr(dp_offset);
752
753 dp_offset = cpm_dpalloc(sizeof(cbd_t) * TX_RING_SIZE, 8);
754 ep->sen_genscc.scc_tbase = dp_offset;
755 cep->tx_bd_base = cpm_dpram_addr(dp_offset);
756
757 cep->dirty_tx = cep->cur_tx = cep->tx_bd_base;
758 cep->cur_rx = cep->rx_bd_base;
759
760 /* Issue init Rx BD command for SCC.
761 * Manual says to perform an Init Rx parameters here. We have
762 * to perform both Rx and Tx because the SCC may have been
763 * already running.
764 * In addition, we have to do it later because we don't yet have
765 * all of the BD control/status set properly.
766 cp->cp_cpcr = mk_cr_cmd(CPM_CR_ENET, CPM_CR_INIT_RX) | CPM_CR_FLG;
767 while (cp->cp_cpcr & CPM_CR_FLG);
768 */
769
770 /* Initialize function code registers for big-endian.
771 */
772 ep->sen_genscc.scc_rfcr = SCC_EB;
773 ep->sen_genscc.scc_tfcr = SCC_EB;
774
775 /* Set maximum bytes per receive buffer.
776 * This appears to be an Ethernet frame size, not the buffer
777 * fragment size. It must be a multiple of four.
778 */
779 ep->sen_genscc.scc_mrblr = PKT_MAXBLR_SIZE;
780
781 /* Set CRC preset and mask.
782 */
783 ep->sen_cpres = 0xffffffff;
784 ep->sen_cmask = 0xdebb20e3;
785
786 ep->sen_crcec = 0; /* CRC Error counter */
787 ep->sen_alec = 0; /* alignment error counter */
788 ep->sen_disfc = 0; /* discard frame counter */
789
790 ep->sen_pads = 0x8888; /* Tx short frame pad character */
791 ep->sen_retlim = 15; /* Retry limit threshold */
792
793 ep->sen_maxflr = PKT_MAXBUF_SIZE; /* maximum frame length register */
794 ep->sen_minflr = PKT_MINBUF_SIZE; /* minimum frame length register */
795
796 ep->sen_maxd1 = PKT_MAXBLR_SIZE; /* maximum DMA1 length */
797 ep->sen_maxd2 = PKT_MAXBLR_SIZE; /* maximum DMA2 length */
798
799 /* Clear hash tables.
800 */
801 ep->sen_gaddr1 = 0;
802 ep->sen_gaddr2 = 0;
803 ep->sen_gaddr3 = 0;
804 ep->sen_gaddr4 = 0;
805 ep->sen_iaddr1 = 0;
806 ep->sen_iaddr2 = 0;
807 ep->sen_iaddr3 = 0;
808 ep->sen_iaddr4 = 0;
809
810 /* Set Ethernet station address.
811 */
812 eap = (unsigned char *)&(ep->sen_paddrh);
813 for (i=5; i>=0; i--)
814 *eap++ = dev->dev_addr[i] = bd->bi_enetaddr[i];
815
816 ep->sen_pper = 0; /* 'cause the book says so */
817 ep->sen_taddrl = 0; /* temp address (LSB) */
818 ep->sen_taddrm = 0;
819 ep->sen_taddrh = 0; /* temp address (MSB) */
820
821 /* Now allocate the host memory pages and initialize the
822 * buffer descriptors.
823 */
824 bdp = cep->tx_bd_base;
825 for (i=0; i<TX_RING_SIZE; i++) {
826
827 /* Initialize the BD for every fragment in the page.
828 */
829 bdp->cbd_sc = 0;
830 bdp->cbd_bufaddr = 0;
831 bdp++;
832 }
833
834 /* Set the last buffer to wrap.
835 */
836 bdp--;
837 bdp->cbd_sc |= BD_SC_WRAP;
838
839 bdp = cep->rx_bd_base;
840 k = 0;
841 for (i=0; i<CPM_ENET_RX_PAGES; i++) {
842
843 /* Allocate a page.
844 */
845 ba = (unsigned char *)dma_alloc_coherent(NULL, PAGE_SIZE,
846 &mem_addr, GFP_KERNEL);
847 /* BUG: no check for failure */
848
849 /* Initialize the BD for every fragment in the page.
850 */
851 for (j=0; j<CPM_ENET_RX_FRPPG; j++) {
852 bdp->cbd_sc = BD_ENET_RX_EMPTY | BD_ENET_RX_INTR;
853 bdp->cbd_bufaddr = mem_addr;
854 cep->rx_vaddr[k++] = ba;
855 mem_addr += CPM_ENET_RX_FRSIZE;
856 ba += CPM_ENET_RX_FRSIZE;
857 bdp++;
858 }
859 }
860
861 /* Set the last buffer to wrap.
862 */
863 bdp--;
864 bdp->cbd_sc |= BD_SC_WRAP;
865
866 /* Let's re-initialize the channel now. We have to do it later
867 * than the manual describes because we have just now finished
868 * the BD initialization.
869 */
870 cp->cp_cpcr = mk_cr_cmd(CPM_CR_ENET, CPM_CR_INIT_TRX) | CPM_CR_FLG;
871 while (cp->cp_cpcr & CPM_CR_FLG);
872
873 cep->skb_cur = cep->skb_dirty = 0;
874
875 sccp->scc_scce = 0xffff; /* Clear any pending events */
876
877 /* Enable interrupts for transmit error, complete frame
878 * received, and any transmit buffer we have also set the
879 * interrupt flag.
880 */
881 sccp->scc_sccm = (SCCE_ENET_TXE | SCCE_ENET_RXF | SCCE_ENET_TXB);
882
883 /* Install our interrupt handler.
884 */
885 cpm_install_handler(CPMVEC_ENET, scc_enet_interrupt, dev);
886
887 /* Set GSMR_H to enable all normal operating modes.
888 * Set GSMR_L to enable Ethernet to MC68160.
889 */
890 sccp->scc_gsmrh = 0;
891 sccp->scc_gsmrl = (SCC_GSMRL_TCI | SCC_GSMRL_TPL_48 | SCC_GSMRL_TPP_10 | SCC_GSMRL_MODE_ENET);
892
893 /* Set sync/delimiters.
894 */
895 sccp->scc_dsr = 0xd555;
896
897 /* Set processing mode. Use Ethernet CRC, catch broadcast, and
898 * start frame search 22 bit times after RENA.
899 */
900 sccp->scc_psmr = (SCC_PSMR_ENCRC | SCC_PSMR_NIB22);
901
902 /* It is now OK to enable the Ethernet transmitter.
903 * Unfortunately, there are board implementation differences here.
904 */
905#if (!defined (PB_ENET_TENA) && defined (PC_ENET_TENA) && !defined (PE_ENET_TENA))
906 immap->im_ioport.iop_pcpar |= PC_ENET_TENA;
907 immap->im_ioport.iop_pcdir &= ~PC_ENET_TENA;
908#elif ( defined (PB_ENET_TENA) && !defined (PC_ENET_TENA) && !defined (PE_ENET_TENA))
909 cp->cp_pbpar |= PB_ENET_TENA;
910 cp->cp_pbdir |= PB_ENET_TENA;
911#elif ( !defined (PB_ENET_TENA) && !defined (PC_ENET_TENA) && defined (PE_ENET_TENA))
912 cp->cp_pepar |= PE_ENET_TENA;
913 cp->cp_pedir &= ~PE_ENET_TENA;
914 cp->cp_peso |= PE_ENET_TENA;
915#else
916#error Configuration Error: define exactly ONE of PB_ENET_TENA, PC_ENET_TENA, PE_ENET_TENA
917#endif
918
919#if defined(CONFIG_RPXLITE) || defined(CONFIG_RPXCLASSIC)
920 /* And while we are here, set the configuration to enable ethernet.
921 */
922 *((volatile uint *)RPX_CSR_ADDR) &= ~BCSR0_ETHLPBK;
923 *((volatile uint *)RPX_CSR_ADDR) |=
924 (BCSR0_ETHEN | BCSR0_COLTESTDIS | BCSR0_FULLDPLXDIS);
925#endif
926
927#ifdef CONFIG_BSEIP
928 /* BSE uses port B and C for PHY control.
929 */
930 cp->cp_pbpar &= ~(PB_BSE_POWERUP | PB_BSE_FDXDIS);
931 cp->cp_pbdir |= (PB_BSE_POWERUP | PB_BSE_FDXDIS);
932 cp->cp_pbdat |= (PB_BSE_POWERUP | PB_BSE_FDXDIS);
933
934 immap->im_ioport.iop_pcpar &= ~PC_BSE_LOOPBACK;
935 immap->im_ioport.iop_pcdir |= PC_BSE_LOOPBACK;
936 immap->im_ioport.iop_pcso &= ~PC_BSE_LOOPBACK;
937 immap->im_ioport.iop_pcdat &= ~PC_BSE_LOOPBACK;
938#endif
939
940#ifdef CONFIG_FADS
941 cp->cp_pbpar |= PB_ENET_TENA;
942 cp->cp_pbdir |= PB_ENET_TENA;
943
944 /* Enable the EEST PHY.
945 */
946 *((volatile uint *)BCSR1) &= ~BCSR1_ETHEN;
947#endif
948
949 dev->base_addr = (unsigned long)ep;
950#if 0
951 dev->name = "CPM_ENET";
952#endif
953
954 /* The CPM Ethernet specific entries in the device structure. */
955 dev->open = scc_enet_open;
956 dev->hard_start_xmit = scc_enet_start_xmit;
957 dev->tx_timeout = scc_enet_timeout;
958 dev->watchdog_timeo = TX_TIMEOUT;
959 dev->stop = scc_enet_close;
960 dev->get_stats = scc_enet_get_stats;
961 dev->set_multicast_list = set_multicast_list;
962
963 err = register_netdev(dev);
964 if (err) {
965 free_netdev(dev);
966 return err;
967 }
968
969 /* And last, enable the transmit and receive processing.
970 */
971 sccp->scc_gsmrl |= (SCC_GSMRL_ENR | SCC_GSMRL_ENT);
972
973 printk("%s: CPM ENET Version 0.2 on SCC%d, ", dev->name, SCC_ENET+1);
974 for (i=0; i<5; i++)
975 printk("%02x:", dev->dev_addr[i]);
976 printk("%02x\n", dev->dev_addr[5]);
977
978 return 0;
979}
980
981module_init(scc_enet_init);
982
diff --git a/arch/ppc/8xx_io/fec.c b/arch/ppc/8xx_io/fec.c
deleted file mode 100644
index 2c604d4f6e8b..000000000000
--- a/arch/ppc/8xx_io/fec.c
+++ /dev/null
@@ -1,1983 +0,0 @@
1/*
2 * Fast Ethernet Controller (FEC) driver for Motorola MPC8xx.
3 * Copyright (c) 1997 Dan Malek (dmalek@jlc.net)
4 *
5 * This version of the driver is specific to the FADS implementation,
6 * since the board contains control registers external to the processor
7 * for the control of the LevelOne LXT970 transceiver. The MPC860T manual
8 * describes connections using the internal parallel port I/O, which
9 * is basically all of Port D.
10 *
11 * Includes support for the following PHYs: QS6612, LXT970, LXT971/2.
12 *
13 * Right now, I am very wasteful with the buffers. I allocate memory
14 * pages and then divide them into 2K frame buffers. This way I know I
15 * have buffers large enough to hold one frame within one buffer descriptor.
16 * Once I get this working, I will use 64 or 128 byte CPM buffers, which
17 * will be much more memory efficient and will easily handle lots of
18 * small packets.
19 *
20 * Much better multiple PHY support by Magnus Damm.
21 * Copyright (c) 2000 Ericsson Radio Systems AB.
22 *
23 * Make use of MII for PHY control configurable.
24 * Some fixes.
25 * Copyright (c) 2000-2002 Wolfgang Denk, DENX Software Engineering.
26 *
27 * Support for AMD AM79C874 added.
28 * Thomas Lange, thomas@corelatus.com
29 */
30
31#include <linux/kernel.h>
32#include <linux/sched.h>
33#include <linux/string.h>
34#include <linux/ptrace.h>
35#include <linux/errno.h>
36#include <linux/ioport.h>
37#include <linux/slab.h>
38#include <linux/interrupt.h>
39#include <linux/pci.h>
40#include <linux/init.h>
41#include <linux/delay.h>
42#include <linux/netdevice.h>
43#include <linux/etherdevice.h>
44#include <linux/skbuff.h>
45#include <linux/spinlock.h>
46#include <linux/bitops.h>
47#ifdef CONFIG_FEC_PACKETHOOK
48#include <linux/pkthook.h>
49#endif
50
51#include <asm/8xx_immap.h>
52#include <asm/pgtable.h>
53#include <asm/mpc8xx.h>
54#include <asm/irq.h>
55#include <asm/uaccess.h>
56#include <asm/cpm1.h>
57
58#ifdef CONFIG_USE_MDIO
59/* Forward declarations of some structures to support different PHYs
60*/
61
62typedef struct {
63 uint mii_data;
64 void (*funct)(uint mii_reg, struct net_device *dev);
65} phy_cmd_t;
66
67typedef struct {
68 uint id;
69 char *name;
70
71 const phy_cmd_t *config;
72 const phy_cmd_t *startup;
73 const phy_cmd_t *ack_int;
74 const phy_cmd_t *shutdown;
75} phy_info_t;
76#endif /* CONFIG_USE_MDIO */
77
78/* The number of Tx and Rx buffers. These are allocated from the page
79 * pool. The code may assume these are power of two, so it is best
80 * to keep them that size.
81 * We don't need to allocate pages for the transmitter. We just use
82 * the skbuffer directly.
83 */
84#ifdef CONFIG_ENET_BIG_BUFFERS
85#define FEC_ENET_RX_PAGES 16
86#define FEC_ENET_RX_FRSIZE 2048
87#define FEC_ENET_RX_FRPPG (PAGE_SIZE / FEC_ENET_RX_FRSIZE)
88#define RX_RING_SIZE (FEC_ENET_RX_FRPPG * FEC_ENET_RX_PAGES)
89#define TX_RING_SIZE 16 /* Must be power of two */
90#define TX_RING_MOD_MASK 15 /* for this to work */
91#else
92#define FEC_ENET_RX_PAGES 4
93#define FEC_ENET_RX_FRSIZE 2048
94#define FEC_ENET_RX_FRPPG (PAGE_SIZE / FEC_ENET_RX_FRSIZE)
95#define RX_RING_SIZE (FEC_ENET_RX_FRPPG * FEC_ENET_RX_PAGES)
96#define TX_RING_SIZE 8 /* Must be power of two */
97#define TX_RING_MOD_MASK 7 /* for this to work */
98#endif
99
100/* Interrupt events/masks.
101*/
102#define FEC_ENET_HBERR ((uint)0x80000000) /* Heartbeat error */
103#define FEC_ENET_BABR ((uint)0x40000000) /* Babbling receiver */
104#define FEC_ENET_BABT ((uint)0x20000000) /* Babbling transmitter */
105#define FEC_ENET_GRA ((uint)0x10000000) /* Graceful stop complete */
106#define FEC_ENET_TXF ((uint)0x08000000) /* Full frame transmitted */
107#define FEC_ENET_TXB ((uint)0x04000000) /* A buffer was transmitted */
108#define FEC_ENET_RXF ((uint)0x02000000) /* Full frame received */
109#define FEC_ENET_RXB ((uint)0x01000000) /* A buffer was received */
110#define FEC_ENET_MII ((uint)0x00800000) /* MII interrupt */
111#define FEC_ENET_EBERR ((uint)0x00400000) /* SDMA bus error */
112
113/*
114*/
115#define FEC_ECNTRL_PINMUX 0x00000004
116#define FEC_ECNTRL_ETHER_EN 0x00000002
117#define FEC_ECNTRL_RESET 0x00000001
118
119#define FEC_RCNTRL_BC_REJ 0x00000010
120#define FEC_RCNTRL_PROM 0x00000008
121#define FEC_RCNTRL_MII_MODE 0x00000004
122#define FEC_RCNTRL_DRT 0x00000002
123#define FEC_RCNTRL_LOOP 0x00000001
124
125#define FEC_TCNTRL_FDEN 0x00000004
126#define FEC_TCNTRL_HBC 0x00000002
127#define FEC_TCNTRL_GTS 0x00000001
128
129/* Delay to wait for FEC reset command to complete (in us)
130*/
131#define FEC_RESET_DELAY 50
132
133/* The FEC stores dest/src/type, data, and checksum for receive packets.
134 */
135#define PKT_MAXBUF_SIZE 1518
136#define PKT_MINBUF_SIZE 64
137#define PKT_MAXBLR_SIZE 1520
138
139/* The FEC buffer descriptors track the ring buffers. The rx_bd_base and
140 * tx_bd_base always point to the base of the buffer descriptors. The
141 * cur_rx and cur_tx point to the currently available buffer.
142 * The dirty_tx tracks the current buffer that is being sent by the
143 * controller. The cur_tx and dirty_tx are equal under both completely
144 * empty and completely full conditions. The empty/ready indicator in
145 * the buffer descriptor determines the actual condition.
146 */
147struct fec_enet_private {
148 /* The saved address of a sent-in-place packet/buffer, for skfree(). */
149 struct sk_buff* tx_skbuff[TX_RING_SIZE];
150 ushort skb_cur;
151 ushort skb_dirty;
152
153 /* CPM dual port RAM relative addresses.
154 */
155 cbd_t *rx_bd_base; /* Address of Rx and Tx buffers. */
156 cbd_t *tx_bd_base;
157 cbd_t *cur_rx, *cur_tx; /* The next free ring entry */
158 cbd_t *dirty_tx; /* The ring entries to be free()ed. */
159
160 /* Virtual addresses for the receive buffers because we can't
161 * do a __va() on them anymore.
162 */
163 unsigned char *rx_vaddr[RX_RING_SIZE];
164
165 struct net_device_stats stats;
166 uint tx_full;
167 spinlock_t lock;
168
169#ifdef CONFIG_USE_MDIO
170 uint phy_id;
171 uint phy_id_done;
172 uint phy_status;
173 uint phy_speed;
174 phy_info_t *phy;
175 struct work_struct phy_task;
176 struct net_device *dev;
177
178 uint sequence_done;
179
180 uint phy_addr;
181#endif /* CONFIG_USE_MDIO */
182
183 int link;
184 int old_link;
185 int full_duplex;
186
187#ifdef CONFIG_FEC_PACKETHOOK
188 unsigned long ph_lock;
189 fec_ph_func *ph_rxhandler;
190 fec_ph_func *ph_txhandler;
191 __u16 ph_proto;
192 volatile __u32 *ph_regaddr;
193 void *ph_priv;
194#endif
195};
196
197static int fec_enet_open(struct net_device *dev);
198static int fec_enet_start_xmit(struct sk_buff *skb, struct net_device *dev);
199#ifdef CONFIG_USE_MDIO
200static void fec_enet_mii(struct net_device *dev);
201#endif /* CONFIG_USE_MDIO */
202#ifdef CONFIG_FEC_PACKETHOOK
203static void fec_enet_tx(struct net_device *dev, __u32 regval);
204static void fec_enet_rx(struct net_device *dev, __u32 regval);
205#else
206static void fec_enet_tx(struct net_device *dev);
207static void fec_enet_rx(struct net_device *dev);
208#endif
209static int fec_enet_close(struct net_device *dev);
210static struct net_device_stats *fec_enet_get_stats(struct net_device *dev);
211static void set_multicast_list(struct net_device *dev);
212static void fec_restart(struct net_device *dev, int duplex);
213static void fec_stop(struct net_device *dev);
214static ushort my_enet_addr[3];
215
216#ifdef CONFIG_USE_MDIO
217/* MII processing. We keep this as simple as possible. Requests are
218 * placed on the list (if there is room). When the request is finished
219 * by the MII, an optional function may be called.
220 */
221typedef struct mii_list {
222 uint mii_regval;
223 void (*mii_func)(uint val, struct net_device *dev);
224 struct mii_list *mii_next;
225} mii_list_t;
226
227#define NMII 20
228mii_list_t mii_cmds[NMII];
229mii_list_t *mii_free;
230mii_list_t *mii_head;
231mii_list_t *mii_tail;
232
233static int mii_queue(struct net_device *dev, int request,
234 void (*func)(uint, struct net_device *));
235
236/* Make MII read/write commands for the FEC.
237*/
238#define mk_mii_read(REG) (0x60020000 | ((REG & 0x1f) << 18))
239#define mk_mii_write(REG, VAL) (0x50020000 | ((REG & 0x1f) << 18) | \
240 (VAL & 0xffff))
241#define mk_mii_end 0
242#endif /* CONFIG_USE_MDIO */
243
244/* Transmitter timeout.
245*/
246#define TX_TIMEOUT (2*HZ)
247
248#ifdef CONFIG_USE_MDIO
249/* Register definitions for the PHY.
250*/
251
252#define MII_REG_CR 0 /* Control Register */
253#define MII_REG_SR 1 /* Status Register */
254#define MII_REG_PHYIR1 2 /* PHY Identification Register 1 */
255#define MII_REG_PHYIR2 3 /* PHY Identification Register 2 */
256#define MII_REG_ANAR 4 /* A-N Advertisement Register */
257#define MII_REG_ANLPAR 5 /* A-N Link Partner Ability Register */
258#define MII_REG_ANER 6 /* A-N Expansion Register */
259#define MII_REG_ANNPTR 7 /* A-N Next Page Transmit Register */
260#define MII_REG_ANLPRNPR 8 /* A-N Link Partner Received Next Page Reg. */
261
262/* values for phy_status */
263
264#define PHY_CONF_ANE 0x0001 /* 1 auto-negotiation enabled */
265#define PHY_CONF_LOOP 0x0002 /* 1 loopback mode enabled */
266#define PHY_CONF_SPMASK 0x00f0 /* mask for speed */
267#define PHY_CONF_10HDX 0x0010 /* 10 Mbit half duplex supported */
268#define PHY_CONF_10FDX 0x0020 /* 10 Mbit full duplex supported */
269#define PHY_CONF_100HDX 0x0040 /* 100 Mbit half duplex supported */
270#define PHY_CONF_100FDX 0x0080 /* 100 Mbit full duplex supported */
271
272#define PHY_STAT_LINK 0x0100 /* 1 up - 0 down */
273#define PHY_STAT_FAULT 0x0200 /* 1 remote fault */
274#define PHY_STAT_ANC 0x0400 /* 1 auto-negotiation complete */
275#define PHY_STAT_SPMASK 0xf000 /* mask for speed */
276#define PHY_STAT_10HDX 0x1000 /* 10 Mbit half duplex selected */
277#define PHY_STAT_10FDX 0x2000 /* 10 Mbit full duplex selected */
278#define PHY_STAT_100HDX 0x4000 /* 100 Mbit half duplex selected */
279#define PHY_STAT_100FDX 0x8000 /* 100 Mbit full duplex selected */
280#endif /* CONFIG_USE_MDIO */
281
282#ifdef CONFIG_FEC_PACKETHOOK
283int
284fec_register_ph(struct net_device *dev, fec_ph_func *rxfun, fec_ph_func *txfun,
285 __u16 proto, volatile __u32 *regaddr, void *priv)
286{
287 struct fec_enet_private *fep;
288 int retval = 0;
289
290 fep = dev->priv;
291
292 if (test_and_set_bit(0, (void*)&fep->ph_lock) != 0) {
293 /* Someone is messing with the packet hook */
294 return -EAGAIN;
295 }
296 if (fep->ph_rxhandler != NULL || fep->ph_txhandler != NULL) {
297 retval = -EBUSY;
298 goto out;
299 }
300 fep->ph_rxhandler = rxfun;
301 fep->ph_txhandler = txfun;
302 fep->ph_proto = proto;
303 fep->ph_regaddr = regaddr;
304 fep->ph_priv = priv;
305
306 out:
307 fep->ph_lock = 0;
308
309 return retval;
310}
311
312
313int
314fec_unregister_ph(struct net_device *dev)
315{
316 struct fec_enet_private *fep;
317 int retval = 0;
318
319 fep = dev->priv;
320
321 if (test_and_set_bit(0, (void*)&fep->ph_lock) != 0) {
322 /* Someone is messing with the packet hook */
323 return -EAGAIN;
324 }
325
326 fep->ph_rxhandler = fep->ph_txhandler = NULL;
327 fep->ph_proto = 0;
328 fep->ph_regaddr = NULL;
329 fep->ph_priv = NULL;
330
331 fep->ph_lock = 0;
332
333 return retval;
334}
335
336EXPORT_SYMBOL(fec_register_ph);
337EXPORT_SYMBOL(fec_unregister_ph);
338
339#endif /* CONFIG_FEC_PACKETHOOK */
340
341static int
342fec_enet_start_xmit(struct sk_buff *skb, struct net_device *dev)
343{
344 struct fec_enet_private *fep;
345 volatile fec_t *fecp;
346 volatile cbd_t *bdp;
347
348 fep = dev->priv;
349 fecp = (volatile fec_t*)dev->base_addr;
350
351 if (!fep->link) {
352 /* Link is down or autonegotiation is in progress. */
353 return 1;
354 }
355
356 /* Fill in a Tx ring entry */
357 bdp = fep->cur_tx;
358
359#ifndef final_version
360 if (bdp->cbd_sc & BD_ENET_TX_READY) {
361 /* Ooops. All transmit buffers are full. Bail out.
362 * This should not happen, since dev->tbusy should be set.
363 */
364 printk("%s: tx queue full!.\n", dev->name);
365 return 1;
366 }
367#endif
368
369 /* Clear all of the status flags.
370 */
371 bdp->cbd_sc &= ~BD_ENET_TX_STATS;
372
373 /* Set buffer length and buffer pointer.
374 */
375 bdp->cbd_bufaddr = __pa(skb->data);
376 bdp->cbd_datlen = skb->len;
377
378 /* Save skb pointer.
379 */
380 fep->tx_skbuff[fep->skb_cur] = skb;
381
382 fep->stats.tx_bytes += skb->len;
383 fep->skb_cur = (fep->skb_cur+1) & TX_RING_MOD_MASK;
384
385 /* Push the data cache so the CPM does not get stale memory
386 * data.
387 */
388 flush_dcache_range((unsigned long)skb->data,
389 (unsigned long)skb->data + skb->len);
390
391 /* disable interrupts while triggering transmit */
392 spin_lock_irq(&fep->lock);
393
394 /* Send it on its way. Tell FEC its ready, interrupt when done,
395 * its the last BD of the frame, and to put the CRC on the end.
396 */
397
398 bdp->cbd_sc |= (BD_ENET_TX_READY | BD_ENET_TX_INTR
399 | BD_ENET_TX_LAST | BD_ENET_TX_TC);
400
401 dev->trans_start = jiffies;
402
403 /* Trigger transmission start */
404 fecp->fec_x_des_active = 0x01000000;
405
406 /* If this was the last BD in the ring, start at the beginning again.
407 */
408 if (bdp->cbd_sc & BD_ENET_TX_WRAP) {
409 bdp = fep->tx_bd_base;
410 } else {
411 bdp++;
412 }
413
414 if (bdp->cbd_sc & BD_ENET_TX_READY) {
415 netif_stop_queue(dev);
416 fep->tx_full = 1;
417 }
418
419 fep->cur_tx = (cbd_t *)bdp;
420
421 spin_unlock_irq(&fep->lock);
422
423 return 0;
424}
425
426static void
427fec_timeout(struct net_device *dev)
428{
429 struct fec_enet_private *fep = dev->priv;
430
431 printk("%s: transmit timed out.\n", dev->name);
432 fep->stats.tx_errors++;
433#ifndef final_version
434 {
435 int i;
436 cbd_t *bdp;
437
438 printk("Ring data dump: cur_tx %lx%s, dirty_tx %lx cur_rx: %lx\n",
439 (unsigned long)fep->cur_tx, fep->tx_full ? " (full)" : "",
440 (unsigned long)fep->dirty_tx,
441 (unsigned long)fep->cur_rx);
442
443 bdp = fep->tx_bd_base;
444 printk(" tx: %u buffers\n", TX_RING_SIZE);
445 for (i = 0 ; i < TX_RING_SIZE; i++) {
446 printk(" %08x: %04x %04x %08x\n",
447 (uint) bdp,
448 bdp->cbd_sc,
449 bdp->cbd_datlen,
450 bdp->cbd_bufaddr);
451 bdp++;
452 }
453
454 bdp = fep->rx_bd_base;
455 printk(" rx: %lu buffers\n", RX_RING_SIZE);
456 for (i = 0 ; i < RX_RING_SIZE; i++) {
457 printk(" %08x: %04x %04x %08x\n",
458 (uint) bdp,
459 bdp->cbd_sc,
460 bdp->cbd_datlen,
461 bdp->cbd_bufaddr);
462 bdp++;
463 }
464 }
465#endif
466 if (!fep->tx_full)
467 netif_wake_queue(dev);
468}
469
470/* The interrupt handler.
471 * This is called from the MPC core interrupt.
472 */
473static irqreturn_t
474fec_enet_interrupt(int irq, void *dev_id)
475{
476 struct net_device *dev = dev_id;
477 volatile fec_t *fecp;
478 uint int_events;
479#ifdef CONFIG_FEC_PACKETHOOK
480 struct fec_enet_private *fep = dev->priv;
481 __u32 regval;
482
483 if (fep->ph_regaddr) regval = *fep->ph_regaddr;
484#endif
485 fecp = (volatile fec_t*)dev->base_addr;
486
487 /* Get the interrupt events that caused us to be here.
488 */
489 while ((int_events = fecp->fec_ievent) != 0) {
490 fecp->fec_ievent = int_events;
491 if ((int_events & (FEC_ENET_HBERR | FEC_ENET_BABR |
492 FEC_ENET_BABT | FEC_ENET_EBERR)) != 0) {
493 printk("FEC ERROR %x\n", int_events);
494 }
495
496 /* Handle receive event in its own function.
497 */
498 if (int_events & FEC_ENET_RXF) {
499#ifdef CONFIG_FEC_PACKETHOOK
500 fec_enet_rx(dev, regval);
501#else
502 fec_enet_rx(dev);
503#endif
504 }
505
506 /* Transmit OK, or non-fatal error. Update the buffer
507 descriptors. FEC handles all errors, we just discover
508 them as part of the transmit process.
509 */
510 if (int_events & FEC_ENET_TXF) {
511#ifdef CONFIG_FEC_PACKETHOOK
512 fec_enet_tx(dev, regval);
513#else
514 fec_enet_tx(dev);
515#endif
516 }
517
518 if (int_events & FEC_ENET_MII) {
519#ifdef CONFIG_USE_MDIO
520 fec_enet_mii(dev);
521#else
522printk("%s[%d] %s: unexpected FEC_ENET_MII event\n", __FILE__, __LINE__, __func__);
523#endif /* CONFIG_USE_MDIO */
524 }
525
526 }
527 return IRQ_RETVAL(IRQ_HANDLED);
528}
529
530
531static void
532#ifdef CONFIG_FEC_PACKETHOOK
533fec_enet_tx(struct net_device *dev, __u32 regval)
534#else
535fec_enet_tx(struct net_device *dev)
536#endif
537{
538 struct fec_enet_private *fep;
539 volatile cbd_t *bdp;
540 struct sk_buff *skb;
541
542 fep = dev->priv;
543 /* lock while transmitting */
544 spin_lock(&fep->lock);
545 bdp = fep->dirty_tx;
546
547 while ((bdp->cbd_sc&BD_ENET_TX_READY) == 0) {
548 if (bdp == fep->cur_tx && fep->tx_full == 0) break;
549
550 skb = fep->tx_skbuff[fep->skb_dirty];
551 /* Check for errors. */
552 if (bdp->cbd_sc & (BD_ENET_TX_HB | BD_ENET_TX_LC |
553 BD_ENET_TX_RL | BD_ENET_TX_UN |
554 BD_ENET_TX_CSL)) {
555 fep->stats.tx_errors++;
556 if (bdp->cbd_sc & BD_ENET_TX_HB) /* No heartbeat */
557 fep->stats.tx_heartbeat_errors++;
558 if (bdp->cbd_sc & BD_ENET_TX_LC) /* Late collision */
559 fep->stats.tx_window_errors++;
560 if (bdp->cbd_sc & BD_ENET_TX_RL) /* Retrans limit */
561 fep->stats.tx_aborted_errors++;
562 if (bdp->cbd_sc & BD_ENET_TX_UN) /* Underrun */
563 fep->stats.tx_fifo_errors++;
564 if (bdp->cbd_sc & BD_ENET_TX_CSL) /* Carrier lost */
565 fep->stats.tx_carrier_errors++;
566 } else {
567#ifdef CONFIG_FEC_PACKETHOOK
568 /* Packet hook ... */
569 if (fep->ph_txhandler &&
570 ((struct ethhdr *)skb->data)->h_proto
571 == fep->ph_proto) {
572 fep->ph_txhandler((__u8*)skb->data, skb->len,
573 regval, fep->ph_priv);
574 }
575#endif
576 fep->stats.tx_packets++;
577 }
578
579#ifndef final_version
580 if (bdp->cbd_sc & BD_ENET_TX_READY)
581 printk("HEY! Enet xmit interrupt and TX_READY.\n");
582#endif
583 /* Deferred means some collisions occurred during transmit,
584 * but we eventually sent the packet OK.
585 */
586 if (bdp->cbd_sc & BD_ENET_TX_DEF)
587 fep->stats.collisions++;
588
589 /* Free the sk buffer associated with this last transmit.
590 */
591#if 0
592printk("TXI: %x %x %x\n", bdp, skb, fep->skb_dirty);
593#endif
594 dev_kfree_skb_irq (skb/*, FREE_WRITE*/);
595 fep->tx_skbuff[fep->skb_dirty] = NULL;
596 fep->skb_dirty = (fep->skb_dirty + 1) & TX_RING_MOD_MASK;
597
598 /* Update pointer to next buffer descriptor to be transmitted.
599 */
600 if (bdp->cbd_sc & BD_ENET_TX_WRAP)
601 bdp = fep->tx_bd_base;
602 else
603 bdp++;
604
605 /* Since we have freed up a buffer, the ring is no longer
606 * full.
607 */
608 if (fep->tx_full) {
609 fep->tx_full = 0;
610 if (netif_queue_stopped(dev))
611 netif_wake_queue(dev);
612 }
613#ifdef CONFIG_FEC_PACKETHOOK
614 /* Re-read register. Not exactly guaranteed to be correct,
615 but... */
616 if (fep->ph_regaddr) regval = *fep->ph_regaddr;
617#endif
618 }
619 fep->dirty_tx = (cbd_t *)bdp;
620 spin_unlock(&fep->lock);
621}
622
623
624/* During a receive, the cur_rx points to the current incoming buffer.
625 * When we update through the ring, if the next incoming buffer has
626 * not been given to the system, we just set the empty indicator,
627 * effectively tossing the packet.
628 */
629static void
630#ifdef CONFIG_FEC_PACKETHOOK
631fec_enet_rx(struct net_device *dev, __u32 regval)
632#else
633fec_enet_rx(struct net_device *dev)
634#endif
635{
636 struct fec_enet_private *fep;
637 volatile fec_t *fecp;
638 volatile cbd_t *bdp;
639 struct sk_buff *skb;
640 ushort pkt_len;
641 __u8 *data;
642
643 fep = dev->priv;
644 fecp = (volatile fec_t*)dev->base_addr;
645
646 /* First, grab all of the stats for the incoming packet.
647 * These get messed up if we get called due to a busy condition.
648 */
649 bdp = fep->cur_rx;
650
651while (!(bdp->cbd_sc & BD_ENET_RX_EMPTY)) {
652
653#ifndef final_version
654 /* Since we have allocated space to hold a complete frame,
655 * the last indicator should be set.
656 */
657 if ((bdp->cbd_sc & BD_ENET_RX_LAST) == 0)
658 printk("FEC ENET: rcv is not +last\n");
659#endif
660
661 /* Check for errors. */
662 if (bdp->cbd_sc & (BD_ENET_RX_LG | BD_ENET_RX_SH | BD_ENET_RX_NO |
663 BD_ENET_RX_CR | BD_ENET_RX_OV)) {
664 fep->stats.rx_errors++;
665 if (bdp->cbd_sc & (BD_ENET_RX_LG | BD_ENET_RX_SH)) {
666 /* Frame too long or too short. */
667 fep->stats.rx_length_errors++;
668 }
669 if (bdp->cbd_sc & BD_ENET_RX_NO) /* Frame alignment */
670 fep->stats.rx_frame_errors++;
671 if (bdp->cbd_sc & BD_ENET_RX_CR) /* CRC Error */
672 fep->stats.rx_crc_errors++;
673 if (bdp->cbd_sc & BD_ENET_RX_OV) /* FIFO overrun */
674 fep->stats.rx_crc_errors++;
675 }
676
677 /* Report late collisions as a frame error.
678 * On this error, the BD is closed, but we don't know what we
679 * have in the buffer. So, just drop this frame on the floor.
680 */
681 if (bdp->cbd_sc & BD_ENET_RX_CL) {
682 fep->stats.rx_errors++;
683 fep->stats.rx_frame_errors++;
684 goto rx_processing_done;
685 }
686
687 /* Process the incoming frame.
688 */
689 fep->stats.rx_packets++;
690 pkt_len = bdp->cbd_datlen;
691 fep->stats.rx_bytes += pkt_len;
692 data = fep->rx_vaddr[bdp - fep->rx_bd_base];
693
694#ifdef CONFIG_FEC_PACKETHOOK
695 /* Packet hook ... */
696 if (fep->ph_rxhandler) {
697 if (((struct ethhdr *)data)->h_proto == fep->ph_proto) {
698 switch (fep->ph_rxhandler(data, pkt_len, regval,
699 fep->ph_priv)) {
700 case 1:
701 goto rx_processing_done;
702 break;
703 case 0:
704 break;
705 default:
706 fep->stats.rx_errors++;
707 goto rx_processing_done;
708 }
709 }
710 }
711
712 /* If it wasn't filtered - copy it to an sk buffer. */
713#endif
714
715 /* This does 16 byte alignment, exactly what we need.
716 * The packet length includes FCS, but we don't want to
717 * include that when passing upstream as it messes up
718 * bridging applications.
719 */
720 skb = dev_alloc_skb(pkt_len-4);
721
722 if (skb == NULL) {
723 printk("%s: Memory squeeze, dropping packet.\n", dev->name);
724 fep->stats.rx_dropped++;
725 } else {
726 skb_put(skb,pkt_len-4); /* Make room */
727 skb_copy_to_linear_data(skb, data, pkt_len-4);
728 skb->protocol=eth_type_trans(skb,dev);
729 netif_rx(skb);
730 }
731 rx_processing_done:
732
733 /* Clear the status flags for this buffer.
734 */
735 bdp->cbd_sc &= ~BD_ENET_RX_STATS;
736
737 /* Mark the buffer empty.
738 */
739 bdp->cbd_sc |= BD_ENET_RX_EMPTY;
740
741 /* Update BD pointer to next entry.
742 */
743 if (bdp->cbd_sc & BD_ENET_RX_WRAP)
744 bdp = fep->rx_bd_base;
745 else
746 bdp++;
747
748#if 1
749 /* Doing this here will keep the FEC running while we process
750 * incoming frames. On a heavily loaded network, we should be
751 * able to keep up at the expense of system resources.
752 */
753 fecp->fec_r_des_active = 0x01000000;
754#endif
755#ifdef CONFIG_FEC_PACKETHOOK
756 /* Re-read register. Not exactly guaranteed to be correct,
757 but... */
758 if (fep->ph_regaddr) regval = *fep->ph_regaddr;
759#endif
760 } /* while (!(bdp->cbd_sc & BD_ENET_RX_EMPTY)) */
761 fep->cur_rx = (cbd_t *)bdp;
762
763#if 0
764 /* Doing this here will allow us to process all frames in the
765 * ring before the FEC is allowed to put more there. On a heavily
766 * loaded network, some frames may be lost. Unfortunately, this
767 * increases the interrupt overhead since we can potentially work
768 * our way back to the interrupt return only to come right back
769 * here.
770 */
771 fecp->fec_r_des_active = 0x01000000;
772#endif
773}
774
775
776#ifdef CONFIG_USE_MDIO
777static void
778fec_enet_mii(struct net_device *dev)
779{
780 struct fec_enet_private *fep;
781 volatile fec_t *ep;
782 mii_list_t *mip;
783 uint mii_reg;
784
785 fep = (struct fec_enet_private *)dev->priv;
786 ep = &(((immap_t *)IMAP_ADDR)->im_cpm.cp_fec);
787 mii_reg = ep->fec_mii_data;
788
789 if ((mip = mii_head) == NULL) {
790 printk("MII and no head!\n");
791 return;
792 }
793
794 if (mip->mii_func != NULL)
795 (*(mip->mii_func))(mii_reg, dev);
796
797 mii_head = mip->mii_next;
798 mip->mii_next = mii_free;
799 mii_free = mip;
800
801 if ((mip = mii_head) != NULL) {
802 ep->fec_mii_data = mip->mii_regval;
803
804 }
805}
806
807static int
808mii_queue(struct net_device *dev, int regval, void (*func)(uint, struct net_device *))
809{
810 struct fec_enet_private *fep;
811 unsigned long flags;
812 mii_list_t *mip;
813 int retval;
814
815 /* Add PHY address to register command.
816 */
817 fep = dev->priv;
818 regval |= fep->phy_addr << 23;
819
820 retval = 0;
821
822 /* lock while modifying mii_list */
823 spin_lock_irqsave(&fep->lock, flags);
824
825 if ((mip = mii_free) != NULL) {
826 mii_free = mip->mii_next;
827 mip->mii_regval = regval;
828 mip->mii_func = func;
829 mip->mii_next = NULL;
830 if (mii_head) {
831 mii_tail->mii_next = mip;
832 mii_tail = mip;
833 } else {
834 mii_head = mii_tail = mip;
835 (&(((immap_t *)IMAP_ADDR)->im_cpm.cp_fec))->fec_mii_data = regval;
836 }
837 } else {
838 retval = 1;
839 }
840
841 spin_unlock_irqrestore(&fep->lock, flags);
842
843 return(retval);
844}
845
846static void mii_do_cmd(struct net_device *dev, const phy_cmd_t *c)
847{
848 int k;
849
850 if(!c)
851 return;
852
853 for(k = 0; (c+k)->mii_data != mk_mii_end; k++)
854 mii_queue(dev, (c+k)->mii_data, (c+k)->funct);
855}
856
857static void mii_parse_sr(uint mii_reg, struct net_device *dev)
858{
859 struct fec_enet_private *fep = dev->priv;
860 volatile uint *s = &(fep->phy_status);
861
862 *s &= ~(PHY_STAT_LINK | PHY_STAT_FAULT | PHY_STAT_ANC);
863
864 if (mii_reg & 0x0004)
865 *s |= PHY_STAT_LINK;
866 if (mii_reg & 0x0010)
867 *s |= PHY_STAT_FAULT;
868 if (mii_reg & 0x0020)
869 *s |= PHY_STAT_ANC;
870
871 fep->link = (*s & PHY_STAT_LINK) ? 1 : 0;
872}
873
874static void mii_parse_cr(uint mii_reg, struct net_device *dev)
875{
876 struct fec_enet_private *fep = dev->priv;
877 volatile uint *s = &(fep->phy_status);
878
879 *s &= ~(PHY_CONF_ANE | PHY_CONF_LOOP);
880
881 if (mii_reg & 0x1000)
882 *s |= PHY_CONF_ANE;
883 if (mii_reg & 0x4000)
884 *s |= PHY_CONF_LOOP;
885}
886
887static void mii_parse_anar(uint mii_reg, struct net_device *dev)
888{
889 struct fec_enet_private *fep = dev->priv;
890 volatile uint *s = &(fep->phy_status);
891
892 *s &= ~(PHY_CONF_SPMASK);
893
894 if (mii_reg & 0x0020)
895 *s |= PHY_CONF_10HDX;
896 if (mii_reg & 0x0040)
897 *s |= PHY_CONF_10FDX;
898 if (mii_reg & 0x0080)
899 *s |= PHY_CONF_100HDX;
900 if (mii_reg & 0x00100)
901 *s |= PHY_CONF_100FDX;
902}
903#if 0
904static void mii_disp_reg(uint mii_reg, struct net_device *dev)
905{
906 printk("reg %u = 0x%04x\n", (mii_reg >> 18) & 0x1f, mii_reg & 0xffff);
907}
908#endif
909
910/* ------------------------------------------------------------------------- */
911/* The Level one LXT970 is used by many boards */
912
913#ifdef CONFIG_FEC_LXT970
914
915#define MII_LXT970_MIRROR 16 /* Mirror register */
916#define MII_LXT970_IER 17 /* Interrupt Enable Register */
917#define MII_LXT970_ISR 18 /* Interrupt Status Register */
918#define MII_LXT970_CONFIG 19 /* Configuration Register */
919#define MII_LXT970_CSR 20 /* Chip Status Register */
920
921static void mii_parse_lxt970_csr(uint mii_reg, struct net_device *dev)
922{
923 struct fec_enet_private *fep = dev->priv;
924 volatile uint *s = &(fep->phy_status);
925
926 *s &= ~(PHY_STAT_SPMASK);
927
928 if (mii_reg & 0x0800) {
929 if (mii_reg & 0x1000)
930 *s |= PHY_STAT_100FDX;
931 else
932 *s |= PHY_STAT_100HDX;
933 }
934 else {
935 if (mii_reg & 0x1000)
936 *s |= PHY_STAT_10FDX;
937 else
938 *s |= PHY_STAT_10HDX;
939 }
940}
941
942static phy_info_t phy_info_lxt970 = {
943 0x07810000,
944 "LXT970",
945
946 (const phy_cmd_t []) { /* config */
947#if 0
948// { mk_mii_write(MII_REG_ANAR, 0x0021), NULL },
949
950 /* Set default operation of 100-TX....for some reason
951 * some of these bits are set on power up, which is wrong.
952 */
953 { mk_mii_write(MII_LXT970_CONFIG, 0), NULL },
954#endif
955 { mk_mii_read(MII_REG_CR), mii_parse_cr },
956 { mk_mii_read(MII_REG_ANAR), mii_parse_anar },
957 { mk_mii_end, }
958 },
959 (const phy_cmd_t []) { /* startup - enable interrupts */
960 { mk_mii_write(MII_LXT970_IER, 0x0002), NULL },
961 { mk_mii_write(MII_REG_CR, 0x1200), NULL }, /* autonegotiate */
962 { mk_mii_end, }
963 },
964 (const phy_cmd_t []) { /* ack_int */
965 /* read SR and ISR to acknowledge */
966
967 { mk_mii_read(MII_REG_SR), mii_parse_sr },
968 { mk_mii_read(MII_LXT970_ISR), NULL },
969
970 /* find out the current status */
971
972 { mk_mii_read(MII_LXT970_CSR), mii_parse_lxt970_csr },
973 { mk_mii_end, }
974 },
975 (const phy_cmd_t []) { /* shutdown - disable interrupts */
976 { mk_mii_write(MII_LXT970_IER, 0x0000), NULL },
977 { mk_mii_end, }
978 },
979};
980
981#endif /* CONFIG_FEC_LXT970 */
982
983/* ------------------------------------------------------------------------- */
984/* The Level one LXT971 is used on some of my custom boards */
985
986#ifdef CONFIG_FEC_LXT971
987
988/* register definitions for the 971 */
989
990#define MII_LXT971_PCR 16 /* Port Control Register */
991#define MII_LXT971_SR2 17 /* Status Register 2 */
992#define MII_LXT971_IER 18 /* Interrupt Enable Register */
993#define MII_LXT971_ISR 19 /* Interrupt Status Register */
994#define MII_LXT971_LCR 20 /* LED Control Register */
995#define MII_LXT971_TCR 30 /* Transmit Control Register */
996
997/*
998 * I had some nice ideas of running the MDIO faster...
999 * The 971 should support 8MHz and I tried it, but things acted really
1000 * weird, so 2.5 MHz ought to be enough for anyone...
1001 */
1002
1003static void mii_parse_lxt971_sr2(uint mii_reg, struct net_device *dev)
1004{
1005 struct fec_enet_private *fep = dev->priv;
1006 volatile uint *s = &(fep->phy_status);
1007
1008 *s &= ~(PHY_STAT_SPMASK);
1009
1010 if (mii_reg & 0x4000) {
1011 if (mii_reg & 0x0200)
1012 *s |= PHY_STAT_100FDX;
1013 else
1014 *s |= PHY_STAT_100HDX;
1015 }
1016 else {
1017 if (mii_reg & 0x0200)
1018 *s |= PHY_STAT_10FDX;
1019 else
1020 *s |= PHY_STAT_10HDX;
1021 }
1022 if (mii_reg & 0x0008)
1023 *s |= PHY_STAT_FAULT;
1024}
1025
1026static phy_info_t phy_info_lxt971 = {
1027 0x0001378e,
1028 "LXT971",
1029
1030 (const phy_cmd_t []) { /* config */
1031// { mk_mii_write(MII_REG_ANAR, 0x021), NULL }, /* 10 Mbps, HD */
1032 { mk_mii_read(MII_REG_CR), mii_parse_cr },
1033 { mk_mii_read(MII_REG_ANAR), mii_parse_anar },
1034 { mk_mii_end, }
1035 },
1036 (const phy_cmd_t []) { /* startup - enable interrupts */
1037 { mk_mii_write(MII_LXT971_IER, 0x00f2), NULL },
1038 { mk_mii_write(MII_REG_CR, 0x1200), NULL }, /* autonegotiate */
1039
1040 /* Somehow does the 971 tell me that the link is down
1041 * the first read after power-up.
1042 * read here to get a valid value in ack_int */
1043
1044 { mk_mii_read(MII_REG_SR), mii_parse_sr },
1045 { mk_mii_end, }
1046 },
1047 (const phy_cmd_t []) { /* ack_int */
1048 /* find out the current status */
1049
1050 { mk_mii_read(MII_REG_SR), mii_parse_sr },
1051 { mk_mii_read(MII_LXT971_SR2), mii_parse_lxt971_sr2 },
1052
1053 /* we only need to read ISR to acknowledge */
1054
1055 { mk_mii_read(MII_LXT971_ISR), NULL },
1056 { mk_mii_end, }
1057 },
1058 (const phy_cmd_t []) { /* shutdown - disable interrupts */
1059 { mk_mii_write(MII_LXT971_IER, 0x0000), NULL },
1060 { mk_mii_end, }
1061 },
1062};
1063
1064#endif /* CONFIG_FEC_LXT970 */
1065
1066
1067/* ------------------------------------------------------------------------- */
1068/* The Quality Semiconductor QS6612 is used on the RPX CLLF */
1069
1070#ifdef CONFIG_FEC_QS6612
1071
1072/* register definitions */
1073
1074#define MII_QS6612_MCR 17 /* Mode Control Register */
1075#define MII_QS6612_FTR 27 /* Factory Test Register */
1076#define MII_QS6612_MCO 28 /* Misc. Control Register */
1077#define MII_QS6612_ISR 29 /* Interrupt Source Register */
1078#define MII_QS6612_IMR 30 /* Interrupt Mask Register */
1079#define MII_QS6612_PCR 31 /* 100BaseTx PHY Control Reg. */
1080
1081static void mii_parse_qs6612_pcr(uint mii_reg, struct net_device *dev)
1082{
1083 struct fec_enet_private *fep = dev->priv;
1084 volatile uint *s = &(fep->phy_status);
1085
1086 *s &= ~(PHY_STAT_SPMASK);
1087
1088 switch((mii_reg >> 2) & 7) {
1089 case 1: *s |= PHY_STAT_10HDX; break;
1090 case 2: *s |= PHY_STAT_100HDX; break;
1091 case 5: *s |= PHY_STAT_10FDX; break;
1092 case 6: *s |= PHY_STAT_100FDX; break;
1093 }
1094}
1095
1096static phy_info_t phy_info_qs6612 = {
1097 0x00181440,
1098 "QS6612",
1099
1100 (const phy_cmd_t []) { /* config */
1101// { mk_mii_write(MII_REG_ANAR, 0x061), NULL }, /* 10 Mbps */
1102
1103 /* The PHY powers up isolated on the RPX,
1104 * so send a command to allow operation.
1105 */
1106
1107 { mk_mii_write(MII_QS6612_PCR, 0x0dc0), NULL },
1108
1109 /* parse cr and anar to get some info */
1110
1111 { mk_mii_read(MII_REG_CR), mii_parse_cr },
1112 { mk_mii_read(MII_REG_ANAR), mii_parse_anar },
1113 { mk_mii_end, }
1114 },
1115 (const phy_cmd_t []) { /* startup - enable interrupts */
1116 { mk_mii_write(MII_QS6612_IMR, 0x003a), NULL },
1117 { mk_mii_write(MII_REG_CR, 0x1200), NULL }, /* autonegotiate */
1118 { mk_mii_end, }
1119 },
1120 (const phy_cmd_t []) { /* ack_int */
1121
1122 /* we need to read ISR, SR and ANER to acknowledge */
1123
1124 { mk_mii_read(MII_QS6612_ISR), NULL },
1125 { mk_mii_read(MII_REG_SR), mii_parse_sr },
1126 { mk_mii_read(MII_REG_ANER), NULL },
1127
1128 /* read pcr to get info */
1129
1130 { mk_mii_read(MII_QS6612_PCR), mii_parse_qs6612_pcr },
1131 { mk_mii_end, }
1132 },
1133 (const phy_cmd_t []) { /* shutdown - disable interrupts */
1134 { mk_mii_write(MII_QS6612_IMR, 0x0000), NULL },
1135 { mk_mii_end, }
1136 },
1137};
1138
1139#endif /* CONFIG_FEC_QS6612 */
1140
1141/* ------------------------------------------------------------------------- */
1142/* The Advanced Micro Devices AM79C874 is used on the ICU862 */
1143
1144#ifdef CONFIG_FEC_AM79C874
1145
1146/* register definitions for the 79C874 */
1147
1148#define MII_AM79C874_MFR 16 /* Miscellaneous Features Register */
1149#define MII_AM79C874_ICSR 17 /* Interrupt Control/Status Register */
1150#define MII_AM79C874_DR 18 /* Diagnostic Register */
1151#define MII_AM79C874_PMLR 19 /* Power Management & Loopback Register */
1152#define MII_AM79C874_MCR 21 /* Mode Control Register */
1153#define MII_AM79C874_DC 23 /* Disconnect Counter */
1154#define MII_AM79C874_REC 24 /* Receiver Error Counter */
1155
1156static void mii_parse_amd79c874_dr(uint mii_reg, struct net_device *dev, uint data)
1157{
1158 volatile struct fec_enet_private *fep = dev->priv;
1159 uint s = fep->phy_status;
1160
1161 s &= ~(PHY_STAT_SPMASK);
1162
1163 /* Register 18: Bit 10 is data rate, 11 is Duplex */
1164 switch ((mii_reg >> 10) & 3) {
1165 case 0: s |= PHY_STAT_10HDX; break;
1166 case 1: s |= PHY_STAT_100HDX; break;
1167 case 2: s |= PHY_STAT_10FDX; break;
1168 case 3: s |= PHY_STAT_100FDX; break;
1169 }
1170
1171 fep->phy_status = s;
1172}
1173
1174static phy_info_t phy_info_amd79c874 = {
1175 0x00022561,
1176 "AM79C874",
1177
1178 (const phy_cmd_t []) { /* config */
1179// { mk_mii_write(MII_REG_ANAR, 0x021), NULL }, /* 10 Mbps, HD */
1180 { mk_mii_read(MII_REG_CR), mii_parse_cr },
1181 { mk_mii_read(MII_REG_ANAR), mii_parse_anar },
1182 { mk_mii_end, }
1183 },
1184 (const phy_cmd_t []) { /* startup - enable interrupts */
1185 { mk_mii_write(MII_AM79C874_ICSR, 0xff00), NULL },
1186 { mk_mii_write(MII_REG_CR, 0x1200), NULL }, /* autonegotiate */
1187 { mk_mii_end, }
1188 },
1189 (const phy_cmd_t []) { /* ack_int */
1190 /* find out the current status */
1191
1192 { mk_mii_read(MII_REG_SR), mii_parse_sr },
1193 { mk_mii_read(MII_AM79C874_DR), mii_parse_amd79c874_dr },
1194
1195 /* we only need to read ICSR to acknowledge */
1196
1197 { mk_mii_read(MII_AM79C874_ICSR), NULL },
1198 { mk_mii_end, }
1199 },
1200 (const phy_cmd_t []) { /* shutdown - disable interrupts */
1201 { mk_mii_write(MII_AM79C874_ICSR, 0x0000), NULL },
1202 { mk_mii_end, }
1203 },
1204};
1205
1206#endif /* CONFIG_FEC_AM79C874 */
1207
1208static phy_info_t *phy_info[] = {
1209
1210#ifdef CONFIG_FEC_LXT970
1211 &phy_info_lxt970,
1212#endif /* CONFIG_FEC_LXT970 */
1213
1214#ifdef CONFIG_FEC_LXT971
1215 &phy_info_lxt971,
1216#endif /* CONFIG_FEC_LXT971 */
1217
1218#ifdef CONFIG_FEC_QS6612
1219 &phy_info_qs6612,
1220#endif /* CONFIG_FEC_QS6612 */
1221
1222#ifdef CONFIG_FEC_AM79C874
1223 &phy_info_amd79c874,
1224#endif /* CONFIG_FEC_AM79C874 */
1225
1226 NULL
1227};
1228
1229static void mii_display_status(struct net_device *dev)
1230{
1231 struct fec_enet_private *fep = dev->priv;
1232 volatile uint *s = &(fep->phy_status);
1233
1234 if (!fep->link && !fep->old_link) {
1235 /* Link is still down - don't print anything */
1236 return;
1237 }
1238
1239 printk("%s: status: ", dev->name);
1240
1241 if (!fep->link) {
1242 printk("link down");
1243 } else {
1244 printk("link up");
1245
1246 switch(*s & PHY_STAT_SPMASK) {
1247 case PHY_STAT_100FDX: printk(", 100 Mbps Full Duplex"); break;
1248 case PHY_STAT_100HDX: printk(", 100 Mbps Half Duplex"); break;
1249 case PHY_STAT_10FDX: printk(", 10 Mbps Full Duplex"); break;
1250 case PHY_STAT_10HDX: printk(", 10 Mbps Half Duplex"); break;
1251 default:
1252 printk(", Unknown speed/duplex");
1253 }
1254
1255 if (*s & PHY_STAT_ANC)
1256 printk(", auto-negotiation complete");
1257 }
1258
1259 if (*s & PHY_STAT_FAULT)
1260 printk(", remote fault");
1261
1262 printk(".\n");
1263}
1264
1265static void mii_display_config(struct work_struct *work)
1266{
1267 struct fec_enet_private *fep =
1268 container_of(work, struct fec_enet_private, phy_task);
1269 struct net_device *dev = fep->dev;
1270 volatile uint *s = &(fep->phy_status);
1271
1272 printk("%s: config: auto-negotiation ", dev->name);
1273
1274 if (*s & PHY_CONF_ANE)
1275 printk("on");
1276 else
1277 printk("off");
1278
1279 if (*s & PHY_CONF_100FDX)
1280 printk(", 100FDX");
1281 if (*s & PHY_CONF_100HDX)
1282 printk(", 100HDX");
1283 if (*s & PHY_CONF_10FDX)
1284 printk(", 10FDX");
1285 if (*s & PHY_CONF_10HDX)
1286 printk(", 10HDX");
1287 if (!(*s & PHY_CONF_SPMASK))
1288 printk(", No speed/duplex selected?");
1289
1290 if (*s & PHY_CONF_LOOP)
1291 printk(", loopback enabled");
1292
1293 printk(".\n");
1294
1295 fep->sequence_done = 1;
1296}
1297
1298static void mii_relink(struct work_struct *work)
1299{
1300 struct fec_enet_private *fep =
1301 container_of(work, struct fec_enet_private, phy_task);
1302 struct net_device *dev = fep->dev;
1303 int duplex;
1304
1305 fep->link = (fep->phy_status & PHY_STAT_LINK) ? 1 : 0;
1306 mii_display_status(dev);
1307 fep->old_link = fep->link;
1308
1309 if (fep->link) {
1310 duplex = 0;
1311 if (fep->phy_status
1312 & (PHY_STAT_100FDX | PHY_STAT_10FDX))
1313 duplex = 1;
1314 fec_restart(dev, duplex);
1315 }
1316 else
1317 fec_stop(dev);
1318
1319#if 0
1320 enable_irq(fep->mii_irq);
1321#endif
1322
1323}
1324
1325static void mii_queue_relink(uint mii_reg, struct net_device *dev)
1326{
1327 struct fec_enet_private *fep = dev->priv;
1328
1329 fep->dev = dev;
1330 INIT_WORK(&fep->phy_task, mii_relink);
1331 schedule_work(&fep->phy_task);
1332}
1333
1334static void mii_queue_config(uint mii_reg, struct net_device *dev)
1335{
1336 struct fec_enet_private *fep = dev->priv;
1337
1338 fep->dev = dev;
1339 INIT_WORK(&fep->phy_task, mii_display_config);
1340 schedule_work(&fep->phy_task);
1341}
1342
1343
1344
1345phy_cmd_t phy_cmd_relink[] = { { mk_mii_read(MII_REG_CR), mii_queue_relink },
1346 { mk_mii_end, } };
1347phy_cmd_t phy_cmd_config[] = { { mk_mii_read(MII_REG_CR), mii_queue_config },
1348 { mk_mii_end, } };
1349
1350
1351
1352/* Read remainder of PHY ID.
1353*/
1354static void
1355mii_discover_phy3(uint mii_reg, struct net_device *dev)
1356{
1357 struct fec_enet_private *fep;
1358 int i;
1359
1360 fep = dev->priv;
1361 fep->phy_id |= (mii_reg & 0xffff);
1362
1363 for(i = 0; phy_info[i]; i++)
1364 if(phy_info[i]->id == (fep->phy_id >> 4))
1365 break;
1366
1367 if(!phy_info[i])
1368 panic("%s: PHY id 0x%08x is not supported!\n",
1369 dev->name, fep->phy_id);
1370
1371 fep->phy = phy_info[i];
1372 fep->phy_id_done = 1;
1373
1374 printk("%s: Phy @ 0x%x, type %s (0x%08x)\n",
1375 dev->name, fep->phy_addr, fep->phy->name, fep->phy_id);
1376}
1377
1378/* Scan all of the MII PHY addresses looking for someone to respond
1379 * with a valid ID. This usually happens quickly.
1380 */
1381static void
1382mii_discover_phy(uint mii_reg, struct net_device *dev)
1383{
1384 struct fec_enet_private *fep;
1385 uint phytype;
1386
1387 fep = dev->priv;
1388
1389 if ((phytype = (mii_reg & 0xffff)) != 0xffff) {
1390
1391 /* Got first part of ID, now get remainder.
1392 */
1393 fep->phy_id = phytype << 16;
1394 mii_queue(dev, mk_mii_read(MII_REG_PHYIR2), mii_discover_phy3);
1395 } else {
1396 fep->phy_addr++;
1397 if (fep->phy_addr < 32) {
1398 mii_queue(dev, mk_mii_read(MII_REG_PHYIR1),
1399 mii_discover_phy);
1400 } else {
1401 printk("fec: No PHY device found.\n");
1402 }
1403 }
1404}
1405#endif /* CONFIG_USE_MDIO */
1406
1407/* This interrupt occurs when the PHY detects a link change.
1408*/
1409static
1410#ifdef CONFIG_RPXCLASSIC
1411void mii_link_interrupt(void *dev_id)
1412#else
1413irqreturn_t mii_link_interrupt(int irq, void * dev_id)
1414#endif
1415{
1416#ifdef CONFIG_USE_MDIO
1417 struct net_device *dev = dev_id;
1418 struct fec_enet_private *fep = dev->priv;
1419 volatile immap_t *immap = (immap_t *)IMAP_ADDR;
1420 volatile fec_t *fecp = &(immap->im_cpm.cp_fec);
1421 unsigned int ecntrl = fecp->fec_ecntrl;
1422
1423 /* We need the FEC enabled to access the MII
1424 */
1425 if ((ecntrl & FEC_ECNTRL_ETHER_EN) == 0) {
1426 fecp->fec_ecntrl |= FEC_ECNTRL_ETHER_EN;
1427 }
1428#endif /* CONFIG_USE_MDIO */
1429
1430#if 0
1431 disable_irq(fep->mii_irq); /* disable now, enable later */
1432#endif
1433
1434
1435#ifdef CONFIG_USE_MDIO
1436 mii_do_cmd(dev, fep->phy->ack_int);
1437 mii_do_cmd(dev, phy_cmd_relink); /* restart and display status */
1438
1439 if ((ecntrl & FEC_ECNTRL_ETHER_EN) == 0) {
1440 fecp->fec_ecntrl = ecntrl; /* restore old settings */
1441 }
1442#else
1443printk("%s[%d] %s: unexpected Link interrupt\n", __FILE__, __LINE__, __func__);
1444#endif /* CONFIG_USE_MDIO */
1445
1446#ifndef CONFIG_RPXCLASSIC
1447 return IRQ_RETVAL(IRQ_HANDLED);
1448#endif /* CONFIG_RPXCLASSIC */
1449}
1450
1451static int
1452fec_enet_open(struct net_device *dev)
1453{
1454 struct fec_enet_private *fep = dev->priv;
1455
1456 /* I should reset the ring buffers here, but I don't yet know
1457 * a simple way to do that.
1458 */
1459
1460#ifdef CONFIG_USE_MDIO
1461 fep->sequence_done = 0;
1462 fep->link = 0;
1463
1464 if (fep->phy) {
1465 mii_do_cmd(dev, fep->phy->ack_int);
1466 mii_do_cmd(dev, fep->phy->config);
1467 mii_do_cmd(dev, phy_cmd_config); /* display configuration */
1468 while(!fep->sequence_done)
1469 schedule();
1470
1471 mii_do_cmd(dev, fep->phy->startup);
1472 netif_start_queue(dev);
1473 return 0; /* Success */
1474 }
1475 return -ENODEV; /* No PHY we understand */
1476#else
1477 fep->link = 1;
1478 netif_start_queue(dev);
1479 return 0; /* Success */
1480#endif /* CONFIG_USE_MDIO */
1481
1482}
1483
1484static int
1485fec_enet_close(struct net_device *dev)
1486{
1487 /* Don't know what to do yet.
1488 */
1489 netif_stop_queue(dev);
1490 fec_stop(dev);
1491
1492 return 0;
1493}
1494
1495static struct net_device_stats *fec_enet_get_stats(struct net_device *dev)
1496{
1497 struct fec_enet_private *fep = (struct fec_enet_private *)dev->priv;
1498
1499 return &fep->stats;
1500}
1501
1502/* Set or clear the multicast filter for this adaptor.
1503 * Skeleton taken from sunlance driver.
1504 * The CPM Ethernet implementation allows Multicast as well as individual
1505 * MAC address filtering. Some of the drivers check to make sure it is
1506 * a group multicast address, and discard those that are not. I guess I
1507 * will do the same for now, but just remove the test if you want
1508 * individual filtering as well (do the upper net layers want or support
1509 * this kind of feature?).
1510 */
1511
1512static void set_multicast_list(struct net_device *dev)
1513{
1514 struct fec_enet_private *fep;
1515 volatile fec_t *ep;
1516
1517 fep = (struct fec_enet_private *)dev->priv;
1518 ep = &(((immap_t *)IMAP_ADDR)->im_cpm.cp_fec);
1519
1520 if (dev->flags&IFF_PROMISC) {
1521
1522 /* Log any net taps. */
1523 printk("%s: Promiscuous mode enabled.\n", dev->name);
1524 ep->fec_r_cntrl |= FEC_RCNTRL_PROM;
1525 } else {
1526
1527 ep->fec_r_cntrl &= ~FEC_RCNTRL_PROM;
1528
1529 if (dev->flags & IFF_ALLMULTI) {
1530 /* Catch all multicast addresses, so set the
1531 * filter to all 1's.
1532 */
1533 ep->fec_hash_table_high = 0xffffffff;
1534 ep->fec_hash_table_low = 0xffffffff;
1535 }
1536#if 0
1537 else {
1538 /* Clear filter and add the addresses in the list.
1539 */
1540 ep->sen_gaddr1 = 0;
1541 ep->sen_gaddr2 = 0;
1542 ep->sen_gaddr3 = 0;
1543 ep->sen_gaddr4 = 0;
1544
1545 dmi = dev->mc_list;
1546
1547 for (i=0; i<dev->mc_count; i++) {
1548
1549 /* Only support group multicast for now.
1550 */
1551 if (!(dmi->dmi_addr[0] & 1))
1552 continue;
1553
1554 /* The address in dmi_addr is LSB first,
1555 * and taddr is MSB first. We have to
1556 * copy bytes MSB first from dmi_addr.
1557 */
1558 mcptr = (u_char *)dmi->dmi_addr + 5;
1559 tdptr = (u_char *)&ep->sen_taddrh;
1560 for (j=0; j<6; j++)
1561 *tdptr++ = *mcptr--;
1562
1563 /* Ask CPM to run CRC and set bit in
1564 * filter mask.
1565 */
1566 cpmp->cp_cpcr = mk_cr_cmd(CPM_CR_CH_SCC1, CPM_CR_SET_GADDR) | CPM_CR_FLG;
1567 /* this delay is necessary here -- Cort */
1568 udelay(10);
1569 while (cpmp->cp_cpcr & CPM_CR_FLG);
1570 }
1571 }
1572#endif
1573 }
1574}
1575
1576/* Initialize the FEC Ethernet on 860T.
1577 */
1578static int __init fec_enet_init(void)
1579{
1580 struct net_device *dev;
1581 struct fec_enet_private *fep;
1582 int i, j, k, err;
1583 unsigned char *eap, *iap, *ba;
1584 dma_addr_t mem_addr;
1585 volatile cbd_t *bdp;
1586 cbd_t *cbd_base;
1587 volatile immap_t *immap;
1588 volatile fec_t *fecp;
1589 bd_t *bd;
1590#ifdef CONFIG_SCC_ENET
1591 unsigned char tmpaddr[6];
1592#endif
1593
1594 immap = (immap_t *)IMAP_ADDR; /* pointer to internal registers */
1595
1596 bd = (bd_t *)__res;
1597
1598 dev = alloc_etherdev(sizeof(*fep));
1599 if (!dev)
1600 return -ENOMEM;
1601
1602 fep = dev->priv;
1603
1604 fecp = &(immap->im_cpm.cp_fec);
1605
1606 /* Whack a reset. We should wait for this.
1607 */
1608 fecp->fec_ecntrl = FEC_ECNTRL_PINMUX | FEC_ECNTRL_RESET;
1609 for (i = 0;
1610 (fecp->fec_ecntrl & FEC_ECNTRL_RESET) && (i < FEC_RESET_DELAY);
1611 ++i) {
1612 udelay(1);
1613 }
1614 if (i == FEC_RESET_DELAY) {
1615 printk ("FEC Reset timeout!\n");
1616 }
1617
1618 /* Set the Ethernet address. If using multiple Enets on the 8xx,
1619 * this needs some work to get unique addresses.
1620 */
1621 eap = (unsigned char *)my_enet_addr;
1622 iap = bd->bi_enetaddr;
1623
1624#ifdef CONFIG_SCC_ENET
1625 /*
1626 * If a board has Ethernet configured both on a SCC and the
1627 * FEC, it needs (at least) 2 MAC addresses (we know that Sun
1628 * disagrees, but anyway). For the FEC port, we create
1629 * another address by setting one of the address bits above
1630 * something that would have (up to now) been allocated.
1631 */
1632 for (i=0; i<6; i++)
1633 tmpaddr[i] = *iap++;
1634 tmpaddr[3] |= 0x80;
1635 iap = tmpaddr;
1636#endif
1637
1638 for (i=0; i<6; i++) {
1639 dev->dev_addr[i] = *eap++ = *iap++;
1640 }
1641
1642 /* Allocate memory for buffer descriptors.
1643 */
1644 if (((RX_RING_SIZE + TX_RING_SIZE) * sizeof(cbd_t)) > PAGE_SIZE) {
1645 printk("FEC init error. Need more space.\n");
1646 printk("FEC initialization failed.\n");
1647 return 1;
1648 }
1649 cbd_base = (cbd_t *)dma_alloc_coherent(dev->class_dev.dev, PAGE_SIZE,
1650 &mem_addr, GFP_KERNEL);
1651
1652 /* Set receive and transmit descriptor base.
1653 */
1654 fep->rx_bd_base = cbd_base;
1655 fep->tx_bd_base = cbd_base + RX_RING_SIZE;
1656
1657 fep->skb_cur = fep->skb_dirty = 0;
1658
1659 /* Initialize the receive buffer descriptors.
1660 */
1661 bdp = fep->rx_bd_base;
1662 k = 0;
1663 for (i=0; i<FEC_ENET_RX_PAGES; i++) {
1664
1665 /* Allocate a page.
1666 */
1667 ba = (unsigned char *)dma_alloc_coherent(dev->class_dev.dev,
1668 PAGE_SIZE,
1669 &mem_addr,
1670 GFP_KERNEL);
1671 /* BUG: no check for failure */
1672
1673 /* Initialize the BD for every fragment in the page.
1674 */
1675 for (j=0; j<FEC_ENET_RX_FRPPG; j++) {
1676 bdp->cbd_sc = BD_ENET_RX_EMPTY;
1677 bdp->cbd_bufaddr = mem_addr;
1678 fep->rx_vaddr[k++] = ba;
1679 mem_addr += FEC_ENET_RX_FRSIZE;
1680 ba += FEC_ENET_RX_FRSIZE;
1681 bdp++;
1682 }
1683 }
1684
1685 /* Set the last buffer to wrap.
1686 */
1687 bdp--;
1688 bdp->cbd_sc |= BD_SC_WRAP;
1689
1690#ifdef CONFIG_FEC_PACKETHOOK
1691 fep->ph_lock = 0;
1692 fep->ph_rxhandler = fep->ph_txhandler = NULL;
1693 fep->ph_proto = 0;
1694 fep->ph_regaddr = NULL;
1695 fep->ph_priv = NULL;
1696#endif
1697
1698 /* Install our interrupt handler.
1699 */
1700 if (request_irq(FEC_INTERRUPT, fec_enet_interrupt, 0, "fec", dev) != 0)
1701 panic("Could not allocate FEC IRQ!");
1702
1703#ifdef CONFIG_RPXCLASSIC
1704 /* Make Port C, bit 15 an input that causes interrupts.
1705 */
1706 immap->im_ioport.iop_pcpar &= ~0x0001;
1707 immap->im_ioport.iop_pcdir &= ~0x0001;
1708 immap->im_ioport.iop_pcso &= ~0x0001;
1709 immap->im_ioport.iop_pcint |= 0x0001;
1710 cpm_install_handler(CPMVEC_PIO_PC15, mii_link_interrupt, dev);
1711
1712 /* Make LEDS reflect Link status.
1713 */
1714 *((uint *) RPX_CSR_ADDR) &= ~BCSR2_FETHLEDMODE;
1715#endif
1716
1717#ifdef PHY_INTERRUPT
1718 ((immap_t *)IMAP_ADDR)->im_siu_conf.sc_siel |=
1719 (0x80000000 >> PHY_INTERRUPT);
1720
1721 if (request_irq(PHY_INTERRUPT, mii_link_interrupt, 0, "mii", dev) != 0)
1722 panic("Could not allocate MII IRQ!");
1723#endif
1724
1725 dev->base_addr = (unsigned long)fecp;
1726
1727 /* The FEC Ethernet specific entries in the device structure. */
1728 dev->open = fec_enet_open;
1729 dev->hard_start_xmit = fec_enet_start_xmit;
1730 dev->tx_timeout = fec_timeout;
1731 dev->watchdog_timeo = TX_TIMEOUT;
1732 dev->stop = fec_enet_close;
1733 dev->get_stats = fec_enet_get_stats;
1734 dev->set_multicast_list = set_multicast_list;
1735
1736#ifdef CONFIG_USE_MDIO
1737 for (i=0; i<NMII-1; i++)
1738 mii_cmds[i].mii_next = &mii_cmds[i+1];
1739 mii_free = mii_cmds;
1740#endif /* CONFIG_USE_MDIO */
1741
1742 /* Configure all of port D for MII.
1743 */
1744 immap->im_ioport.iop_pdpar = 0x1fff;
1745
1746 /* Bits moved from Rev. D onward.
1747 */
1748 if ((mfspr(SPRN_IMMR) & 0xffff) < 0x0501)
1749 immap->im_ioport.iop_pddir = 0x1c58; /* Pre rev. D */
1750 else
1751 immap->im_ioport.iop_pddir = 0x1fff; /* Rev. D and later */
1752
1753#ifdef CONFIG_USE_MDIO
1754 /* Set MII speed to 2.5 MHz
1755 */
1756 fecp->fec_mii_speed = fep->phy_speed =
1757 (( (bd->bi_intfreq + 500000) / 2500000 / 2 ) & 0x3F ) << 1;
1758#else
1759 fecp->fec_mii_speed = 0; /* turn off MDIO */
1760#endif /* CONFIG_USE_MDIO */
1761
1762 err = register_netdev(dev);
1763 if (err) {
1764 free_netdev(dev);
1765 return err;
1766 }
1767
1768 printk ("%s: FEC ENET Version 0.2, FEC irq %d"
1769#ifdef PHY_INTERRUPT
1770 ", MII irq %d"
1771#endif
1772 ", addr ",
1773 dev->name, FEC_INTERRUPT
1774#ifdef PHY_INTERRUPT
1775 , PHY_INTERRUPT
1776#endif
1777 );
1778 for (i=0; i<6; i++)
1779 printk("%02x%c", dev->dev_addr[i], (i==5) ? '\n' : ':');
1780
1781#ifdef CONFIG_USE_MDIO /* start in full duplex mode, and negotiate speed */
1782 fec_restart (dev, 1);
1783#else /* always use half duplex mode only */
1784 fec_restart (dev, 0);
1785#endif
1786
1787#ifdef CONFIG_USE_MDIO
1788 /* Queue up command to detect the PHY and initialize the
1789 * remainder of the interface.
1790 */
1791 fep->phy_id_done = 0;
1792 fep->phy_addr = 0;
1793 mii_queue(dev, mk_mii_read(MII_REG_PHYIR1), mii_discover_phy);
1794#endif /* CONFIG_USE_MDIO */
1795
1796 return 0;
1797}
1798module_init(fec_enet_init);
1799
1800/* This function is called to start or restart the FEC during a link
1801 * change. This only happens when switching between half and full
1802 * duplex.
1803 */
1804static void
1805fec_restart(struct net_device *dev, int duplex)
1806{
1807 struct fec_enet_private *fep;
1808 int i;
1809 volatile cbd_t *bdp;
1810 volatile immap_t *immap;
1811 volatile fec_t *fecp;
1812
1813 immap = (immap_t *)IMAP_ADDR; /* pointer to internal registers */
1814
1815 fecp = &(immap->im_cpm.cp_fec);
1816
1817 fep = dev->priv;
1818
1819 /* Whack a reset. We should wait for this.
1820 */
1821 fecp->fec_ecntrl = FEC_ECNTRL_PINMUX | FEC_ECNTRL_RESET;
1822 for (i = 0;
1823 (fecp->fec_ecntrl & FEC_ECNTRL_RESET) && (i < FEC_RESET_DELAY);
1824 ++i) {
1825 udelay(1);
1826 }
1827 if (i == FEC_RESET_DELAY) {
1828 printk ("FEC Reset timeout!\n");
1829 }
1830
1831 /* Set station address.
1832 */
1833 fecp->fec_addr_low = (my_enet_addr[0] << 16) | my_enet_addr[1];
1834 fecp->fec_addr_high = my_enet_addr[2];
1835
1836 /* Reset all multicast.
1837 */
1838 fecp->fec_hash_table_high = 0;
1839 fecp->fec_hash_table_low = 0;
1840
1841 /* Set maximum receive buffer size.
1842 */
1843 fecp->fec_r_buff_size = PKT_MAXBLR_SIZE;
1844 fecp->fec_r_hash = PKT_MAXBUF_SIZE;
1845
1846 /* Set receive and transmit descriptor base.
1847 */
1848 fecp->fec_r_des_start = iopa((uint)(fep->rx_bd_base));
1849 fecp->fec_x_des_start = iopa((uint)(fep->tx_bd_base));
1850
1851 fep->dirty_tx = fep->cur_tx = fep->tx_bd_base;
1852 fep->cur_rx = fep->rx_bd_base;
1853
1854 /* Reset SKB transmit buffers.
1855 */
1856 fep->skb_cur = fep->skb_dirty = 0;
1857 for (i=0; i<=TX_RING_MOD_MASK; i++) {
1858 if (fep->tx_skbuff[i] != NULL) {
1859 dev_kfree_skb(fep->tx_skbuff[i]);
1860 fep->tx_skbuff[i] = NULL;
1861 }
1862 }
1863
1864 /* Initialize the receive buffer descriptors.
1865 */
1866 bdp = fep->rx_bd_base;
1867 for (i=0; i<RX_RING_SIZE; i++) {
1868
1869 /* Initialize the BD for every fragment in the page.
1870 */
1871 bdp->cbd_sc = BD_ENET_RX_EMPTY;
1872 bdp++;
1873 }
1874
1875 /* Set the last buffer to wrap.
1876 */
1877 bdp--;
1878 bdp->cbd_sc |= BD_SC_WRAP;
1879
1880 /* ...and the same for transmit.
1881 */
1882 bdp = fep->tx_bd_base;
1883 for (i=0; i<TX_RING_SIZE; i++) {
1884
1885 /* Initialize the BD for every fragment in the page.
1886 */
1887 bdp->cbd_sc = 0;
1888 bdp->cbd_bufaddr = 0;
1889 bdp++;
1890 }
1891
1892 /* Set the last buffer to wrap.
1893 */
1894 bdp--;
1895 bdp->cbd_sc |= BD_SC_WRAP;
1896
1897 /* Enable MII mode.
1898 */
1899 if (duplex) {
1900 fecp->fec_r_cntrl = FEC_RCNTRL_MII_MODE; /* MII enable */
1901 fecp->fec_x_cntrl = FEC_TCNTRL_FDEN; /* FD enable */
1902 }
1903 else {
1904 fecp->fec_r_cntrl = FEC_RCNTRL_MII_MODE | FEC_RCNTRL_DRT;
1905 fecp->fec_x_cntrl = 0;
1906 }
1907 fep->full_duplex = duplex;
1908
1909 /* Enable big endian and don't care about SDMA FC.
1910 */
1911 fecp->fec_fun_code = 0x78000000;
1912
1913#ifdef CONFIG_USE_MDIO
1914 /* Set MII speed.
1915 */
1916 fecp->fec_mii_speed = fep->phy_speed;
1917#endif /* CONFIG_USE_MDIO */
1918
1919 /* Clear any outstanding interrupt.
1920 */
1921 fecp->fec_ievent = 0xffc0;
1922
1923 fecp->fec_ivec = (FEC_INTERRUPT/2) << 29;
1924
1925 /* Enable interrupts we wish to service.
1926 */
1927 fecp->fec_imask = ( FEC_ENET_TXF | FEC_ENET_TXB |
1928 FEC_ENET_RXF | FEC_ENET_RXB | FEC_ENET_MII );
1929
1930 /* And last, enable the transmit and receive processing.
1931 */
1932 fecp->fec_ecntrl = FEC_ECNTRL_PINMUX | FEC_ECNTRL_ETHER_EN;
1933 fecp->fec_r_des_active = 0x01000000;
1934}
1935
1936static void
1937fec_stop(struct net_device *dev)
1938{
1939 volatile immap_t *immap;
1940 volatile fec_t *fecp;
1941 struct fec_enet_private *fep;
1942 int i;
1943
1944 immap = (immap_t *)IMAP_ADDR; /* pointer to internal registers */
1945
1946 fecp = &(immap->im_cpm.cp_fec);
1947
1948 if ((fecp->fec_ecntrl & FEC_ECNTRL_ETHER_EN) == 0)
1949 return; /* already down */
1950
1951 fep = dev->priv;
1952
1953
1954 fecp->fec_x_cntrl = 0x01; /* Graceful transmit stop */
1955
1956 for (i = 0;
1957 ((fecp->fec_ievent & 0x10000000) == 0) && (i < FEC_RESET_DELAY);
1958 ++i) {
1959 udelay(1);
1960 }
1961 if (i == FEC_RESET_DELAY) {
1962 printk ("FEC timeout on graceful transmit stop\n");
1963 }
1964
1965 /* Clear outstanding MII command interrupts.
1966 */
1967 fecp->fec_ievent = FEC_ENET_MII;
1968
1969 /* Enable MII command finished interrupt
1970 */
1971 fecp->fec_ivec = (FEC_INTERRUPT/2) << 29;
1972 fecp->fec_imask = FEC_ENET_MII;
1973
1974#ifdef CONFIG_USE_MDIO
1975 /* Set MII speed.
1976 */
1977 fecp->fec_mii_speed = fep->phy_speed;
1978#endif /* CONFIG_USE_MDIO */
1979
1980 /* Disable FEC
1981 */
1982 fecp->fec_ecntrl &= ~(FEC_ECNTRL_ETHER_EN);
1983}
diff --git a/arch/ppc/8xx_io/micropatch.c b/arch/ppc/8xx_io/micropatch.c
deleted file mode 100644
index 9a5d95da7c28..000000000000
--- a/arch/ppc/8xx_io/micropatch.c
+++ /dev/null
@@ -1,743 +0,0 @@
1
2/* Microcode patches for the CPM as supplied by Motorola.
3 * This is the one for IIC/SPI. There is a newer one that
4 * also relocates SMC2, but this would require additional changes
5 * to uart.c, so I am holding off on that for a moment.
6 */
7#include <linux/errno.h>
8#include <linux/sched.h>
9#include <linux/kernel.h>
10#include <linux/param.h>
11#include <linux/string.h>
12#include <linux/mm.h>
13#include <linux/interrupt.h>
14#include <asm/irq.h>
15#include <asm/mpc8xx.h>
16#include <asm/page.h>
17#include <asm/pgtable.h>
18#include <asm/8xx_immap.h>
19#include <asm/cpm1.h>
20
21/*
22 * I2C/SPI relocation patch arrays.
23 */
24
25#ifdef CONFIG_I2C_SPI_UCODE_PATCH
26
27uint patch_2000[] = {
28 0x7FFFEFD9,
29 0x3FFD0000,
30 0x7FFB49F7,
31 0x7FF90000,
32 0x5FEFADF7,
33 0x5F89ADF7,
34 0x5FEFAFF7,
35 0x5F89AFF7,
36 0x3A9CFBC8,
37 0xE7C0EDF0,
38 0x77C1E1BB,
39 0xF4DC7F1D,
40 0xABAD932F,
41 0x4E08FDCF,
42 0x6E0FAFF8,
43 0x7CCF76CF,
44 0xFD1FF9CF,
45 0xABF88DC6,
46 0xAB5679F7,
47 0xB0937383,
48 0xDFCE79F7,
49 0xB091E6BB,
50 0xE5BBE74F,
51 0xB3FA6F0F,
52 0x6FFB76CE,
53 0xEE0DF9CF,
54 0x2BFBEFEF,
55 0xCFEEF9CF,
56 0x76CEAD24,
57 0x90B2DF9A,
58 0x7FDDD0BF,
59 0x4BF847FD,
60 0x7CCF76CE,
61 0xCFEF7E1F,
62 0x7F1D7DFD,
63 0xF0B6EF71,
64 0x7FC177C1,
65 0xFBC86079,
66 0xE722FBC8,
67 0x5FFFDFFF,
68 0x5FB2FFFB,
69 0xFBC8F3C8,
70 0x94A67F01,
71 0x7F1D5F39,
72 0xAFE85F5E,
73 0xFFDFDF96,
74 0xCB9FAF7D,
75 0x5FC1AFED,
76 0x8C1C5FC1,
77 0xAFDD5FC3,
78 0xDF9A7EFD,
79 0xB0B25FB2,
80 0xFFFEABAD,
81 0x5FB2FFFE,
82 0x5FCE600B,
83 0xE6BB600B,
84 0x5FCEDFC6,
85 0x27FBEFDF,
86 0x5FC8CFDE,
87 0x3A9CE7C0,
88 0xEDF0F3C8,
89 0x7F0154CD,
90 0x7F1D2D3D,
91 0x363A7570,
92 0x7E0AF1CE,
93 0x37EF2E68,
94 0x7FEE10EC,
95 0xADF8EFDE,
96 0xCFEAE52F,
97 0x7D0FE12B,
98 0xF1CE5F65,
99 0x7E0A4DF8,
100 0xCFEA5F72,
101 0x7D0BEFEE,
102 0xCFEA5F74,
103 0xE522EFDE,
104 0x5F74CFDA,
105 0x0B627385,
106 0xDF627E0A,
107 0x30D8145B,
108 0xBFFFF3C8,
109 0x5FFFDFFF,
110 0xA7F85F5E,
111 0xBFFE7F7D,
112 0x10D31450,
113 0x5F36BFFF,
114 0xAF785F5E,
115 0xBFFDA7F8,
116 0x5F36BFFE,
117 0x77FD30C0,
118 0x4E08FDCF,
119 0xE5FF6E0F,
120 0xAFF87E1F,
121 0x7E0FFD1F,
122 0xF1CF5F1B,
123 0xABF80D5E,
124 0x5F5EFFEF,
125 0x79F730A2,
126 0xAFDD5F34,
127 0x47F85F34,
128 0xAFED7FDD,
129 0x50B24978,
130 0x47FD7F1D,
131 0x7DFD70AD,
132 0xEF717EC1,
133 0x6BA47F01,
134 0x2D267EFD,
135 0x30DE5F5E,
136 0xFFFD5F5E,
137 0xFFEF5F5E,
138 0xFFDF0CA0,
139 0xAFED0A9E,
140 0xAFDD0C3A,
141 0x5F3AAFBD,
142 0x7FBDB082,
143 0x5F8247F8
144};
145
146uint patch_2f00[] = {
147 0x3E303430,
148 0x34343737,
149 0xABF7BF9B,
150 0x994B4FBD,
151 0xBD599493,
152 0x349FFF37,
153 0xFB9B177D,
154 0xD9936956,
155 0xBBFDD697,
156 0xBDD2FD11,
157 0x31DB9BB3,
158 0x63139637,
159 0x93733693,
160 0x193137F7,
161 0x331737AF,
162 0x7BB9B999,
163 0xBB197957,
164 0x7FDFD3D5,
165 0x73B773F7,
166 0x37933B99,
167 0x1D115316,
168 0x99315315,
169 0x31694BF4,
170 0xFBDBD359,
171 0x31497353,
172 0x76956D69,
173 0x7B9D9693,
174 0x13131979,
175 0x79376935
176};
177#endif
178
179/*
180 * I2C/SPI/SMC1 relocation patch arrays.
181 */
182
183#ifdef CONFIG_I2C_SPI_SMC1_UCODE_PATCH
184
185uint patch_2000[] = {
186 0x3fff0000,
187 0x3ffd0000,
188 0x3ffb0000,
189 0x3ff90000,
190 0x5f13eff8,
191 0x5eb5eff8,
192 0x5f88adf7,
193 0x5fefadf7,
194 0x3a9cfbc8,
195 0x77cae1bb,
196 0xf4de7fad,
197 0xabae9330,
198 0x4e08fdcf,
199 0x6e0faff8,
200 0x7ccf76cf,
201 0xfdaff9cf,
202 0xabf88dc8,
203 0xab5879f7,
204 0xb0925d8d,
205 0xdfd079f7,
206 0xb090e6bb,
207 0xe5bbe74f,
208 0x9e046f0f,
209 0x6ffb76ce,
210 0xee0cf9cf,
211 0x2bfbefef,
212 0xcfeef9cf,
213 0x76cead23,
214 0x90b3df99,
215 0x7fddd0c1,
216 0x4bf847fd,
217 0x7ccf76ce,
218 0xcfef77ca,
219 0x7eaf7fad,
220 0x7dfdf0b7,
221 0xef7a7fca,
222 0x77cafbc8,
223 0x6079e722,
224 0xfbc85fff,
225 0xdfff5fb3,
226 0xfffbfbc8,
227 0xf3c894a5,
228 0xe7c9edf9,
229 0x7f9a7fad,
230 0x5f36afe8,
231 0x5f5bffdf,
232 0xdf95cb9e,
233 0xaf7d5fc3,
234 0xafed8c1b,
235 0x5fc3afdd,
236 0x5fc5df99,
237 0x7efdb0b3,
238 0x5fb3fffe,
239 0xabae5fb3,
240 0xfffe5fd0,
241 0x600be6bb,
242 0x600b5fd0,
243 0xdfc827fb,
244 0xefdf5fca,
245 0xcfde3a9c,
246 0xe7c9edf9,
247 0xf3c87f9e,
248 0x54ca7fed,
249 0x2d3a3637,
250 0x756f7e9a,
251 0xf1ce37ef,
252 0x2e677fee,
253 0x10ebadf8,
254 0xefdecfea,
255 0xe52f7d9f,
256 0xe12bf1ce,
257 0x5f647e9a,
258 0x4df8cfea,
259 0x5f717d9b,
260 0xefeecfea,
261 0x5f73e522,
262 0xefde5f73,
263 0xcfda0b61,
264 0x5d8fdf61,
265 0xe7c9edf9,
266 0x7e9a30d5,
267 0x1458bfff,
268 0xf3c85fff,
269 0xdfffa7f8,
270 0x5f5bbffe,
271 0x7f7d10d0,
272 0x144d5f33,
273 0xbfffaf78,
274 0x5f5bbffd,
275 0xa7f85f33,
276 0xbffe77fd,
277 0x30bd4e08,
278 0xfdcfe5ff,
279 0x6e0faff8,
280 0x7eef7e9f,
281 0xfdeff1cf,
282 0x5f17abf8,
283 0x0d5b5f5b,
284 0xffef79f7,
285 0x309eafdd,
286 0x5f3147f8,
287 0x5f31afed,
288 0x7fdd50af,
289 0x497847fd,
290 0x7f9e7fed,
291 0x7dfd70a9,
292 0xef7e7ece,
293 0x6ba07f9e,
294 0x2d227efd,
295 0x30db5f5b,
296 0xfffd5f5b,
297 0xffef5f5b,
298 0xffdf0c9c,
299 0xafed0a9a,
300 0xafdd0c37,
301 0x5f37afbd,
302 0x7fbdb081,
303 0x5f8147f8,
304 0x3a11e710,
305 0xedf0ccdd,
306 0xf3186d0a,
307 0x7f0e5f06,
308 0x7fedbb38,
309 0x3afe7468,
310 0x7fedf4fc,
311 0x8ffbb951,
312 0xb85f77fd,
313 0xb0df5ddd,
314 0xdefe7fed,
315 0x90e1e74d,
316 0x6f0dcbf7,
317 0xe7decfed,
318 0xcb74cfed,
319 0xcfeddf6d,
320 0x91714f74,
321 0x5dd2deef,
322 0x9e04e7df,
323 0xefbb6ffb,
324 0xe7ef7f0e,
325 0x9e097fed,
326 0xebdbeffa,
327 0xeb54affb,
328 0x7fea90d7,
329 0x7e0cf0c3,
330 0xbffff318,
331 0x5fffdfff,
332 0xac59efea,
333 0x7fce1ee5,
334 0xe2ff5ee1,
335 0xaffbe2ff,
336 0x5ee3affb,
337 0xf9cc7d0f,
338 0xaef8770f,
339 0x7d0fb0c6,
340 0xeffbbfff,
341 0xcfef5ede,
342 0x7d0fbfff,
343 0x5ede4cf8,
344 0x7fddd0bf,
345 0x49f847fd,
346 0x7efdf0bb,
347 0x7fedfffd,
348 0x7dfdf0b7,
349 0xef7e7e1e,
350 0x5ede7f0e,
351 0x3a11e710,
352 0xedf0ccab,
353 0xfb18ad2e,
354 0x1ea9bbb8,
355 0x74283b7e,
356 0x73c2e4bb,
357 0x2ada4fb8,
358 0xdc21e4bb,
359 0xb2a1ffbf,
360 0x5e2c43f8,
361 0xfc87e1bb,
362 0xe74ffd91,
363 0x6f0f4fe8,
364 0xc7ba32e2,
365 0xf396efeb,
366 0x600b4f78,
367 0xe5bb760b,
368 0x53acaef8,
369 0x4ef88b0e,
370 0xcfef9e09,
371 0xabf8751f,
372 0xefef5bac,
373 0x741f4fe8,
374 0x751e760d,
375 0x7fdbf081,
376 0x741cafce,
377 0xefcc7fce,
378 0x751e70ac,
379 0x741ce7bb,
380 0x3372cfed,
381 0xafdbefeb,
382 0xe5bb760b,
383 0x53f2aef8,
384 0xafe8e7eb,
385 0x4bf8771e,
386 0x7e247fed,
387 0x4fcbe2cc,
388 0x7fbc30a9,
389 0x7b0f7a0f,
390 0x34d577fd,
391 0x308b5db7,
392 0xde553e5f,
393 0xaf78741f,
394 0x741f30f0,
395 0xcfef5e2c,
396 0x741f3eac,
397 0xafb8771e,
398 0x5e677fed,
399 0x0bd3e2cc,
400 0x741ccfec,
401 0xe5ca53cd,
402 0x6fcb4f74,
403 0x5dadde4b,
404 0x2ab63d38,
405 0x4bb3de30,
406 0x751f741c,
407 0x6c42effa,
408 0xefea7fce,
409 0x6ffc30be,
410 0xefec3fca,
411 0x30b3de2e,
412 0xadf85d9e,
413 0xaf7daefd,
414 0x5d9ede2e,
415 0x5d9eafdd,
416 0x761f10ac,
417 0x1da07efd,
418 0x30adfffe,
419 0x4908fb18,
420 0x5fffdfff,
421 0xafbb709b,
422 0x4ef85e67,
423 0xadf814ad,
424 0x7a0f70ad,
425 0xcfef50ad,
426 0x7a0fde30,
427 0x5da0afed,
428 0x3c12780f,
429 0xefef780f,
430 0xefef790f,
431 0xa7f85e0f,
432 0xffef790f,
433 0xefef790f,
434 0x14adde2e,
435 0x5d9eadfd,
436 0x5e2dfffb,
437 0xe79addfd,
438 0xeff96079,
439 0x607ae79a,
440 0xddfceff9,
441 0x60795dff,
442 0x607acfef,
443 0xefefefdf,
444 0xefbfef7f,
445 0xeeffedff,
446 0xebffe7ff,
447 0xafefafdf,
448 0xafbfaf7f,
449 0xaeffadff,
450 0xabffa7ff,
451 0x6fef6fdf,
452 0x6fbf6f7f,
453 0x6eff6dff,
454 0x6bff67ff,
455 0x2fef2fdf,
456 0x2fbf2f7f,
457 0x2eff2dff,
458 0x2bff27ff,
459 0x4e08fd1f,
460 0xe5ff6e0f,
461 0xaff87eef,
462 0x7e0ffdef,
463 0xf11f6079,
464 0xabf8f542,
465 0x7e0af11c,
466 0x37cfae3a,
467 0x7fec90be,
468 0xadf8efdc,
469 0xcfeae52f,
470 0x7d0fe12b,
471 0xf11c6079,
472 0x7e0a4df8,
473 0xcfea5dc4,
474 0x7d0befec,
475 0xcfea5dc6,
476 0xe522efdc,
477 0x5dc6cfda,
478 0x4e08fd1f,
479 0x6e0faff8,
480 0x7c1f761f,
481 0xfdeff91f,
482 0x6079abf8,
483 0x761cee24,
484 0xf91f2bfb,
485 0xefefcfec,
486 0xf91f6079,
487 0x761c27fb,
488 0xefdf5da7,
489 0xcfdc7fdd,
490 0xd09c4bf8,
491 0x47fd7c1f,
492 0x761ccfcf,
493 0x7eef7fed,
494 0x7dfdf093,
495 0xef7e7f1e,
496 0x771efb18,
497 0x6079e722,
498 0xe6bbe5bb,
499 0xae0ae5bb,
500 0x600bae85,
501 0xe2bbe2bb,
502 0xe2bbe2bb,
503 0xaf02e2bb,
504 0xe2bb2ff9,
505 0x6079e2bb
506};
507
508uint patch_2f00[] = {
509 0x30303030,
510 0x3e3e3434,
511 0xabbf9b99,
512 0x4b4fbdbd,
513 0x59949334,
514 0x9fff37fb,
515 0x9b177dd9,
516 0x936956bb,
517 0xfbdd697b,
518 0xdd2fd113,
519 0x1db9f7bb,
520 0x36313963,
521 0x79373369,
522 0x3193137f,
523 0x7331737a,
524 0xf7bb9b99,
525 0x9bb19795,
526 0x77fdfd3d,
527 0x573b773f,
528 0x737933f7,
529 0xb991d115,
530 0x31699315,
531 0x31531694,
532 0xbf4fbdbd,
533 0x35931497,
534 0x35376956,
535 0xbd697b9d,
536 0x96931313,
537 0x19797937,
538 0x6935af78,
539 0xb9b3baa3,
540 0xb8788683,
541 0x368f78f7,
542 0x87778733,
543 0x3ffffb3b,
544 0x8e8f78b8,
545 0x1d118e13,
546 0xf3ff3f8b,
547 0x6bd8e173,
548 0xd1366856,
549 0x68d1687b,
550 0x3daf78b8,
551 0x3a3a3f87,
552 0x8f81378f,
553 0xf876f887,
554 0x77fd8778,
555 0x737de8d6,
556 0xbbf8bfff,
557 0xd8df87f7,
558 0xfd876f7b,
559 0x8bfff8bd,
560 0x8683387d,
561 0xb873d87b,
562 0x3b8fd7f8,
563 0xf7338883,
564 0xbb8ee1f8,
565 0xef837377,
566 0x3337b836,
567 0x817d11f8,
568 0x7378b878,
569 0xd3368b7d,
570 0xed731b7d,
571 0x833731f3,
572 0xf22f3f23
573};
574
575uint patch_2e00[] = {
576 0x27eeeeee,
577 0xeeeeeeee,
578 0xeeeeeeee,
579 0xeeeeeeee,
580 0xee4bf4fb,
581 0xdbd259bb,
582 0x1979577f,
583 0xdfd2d573,
584 0xb773f737,
585 0x4b4fbdbd,
586 0x25b9b177,
587 0xd2d17376,
588 0x956bbfdd,
589 0x697bdd2f,
590 0xff9f79ff,
591 0xff9ff22f
592};
593#endif
594
595/*
596 * USB SOF patch arrays.
597 */
598
599#ifdef CONFIG_USB_SOF_UCODE_PATCH
600
601uint patch_2000[] = {
602 0x7fff0000,
603 0x7ffd0000,
604 0x7ffb0000,
605 0x49f7ba5b,
606 0xba383ffb,
607 0xf9b8b46d,
608 0xe5ab4e07,
609 0xaf77bffe,
610 0x3f7bbf79,
611 0xba5bba38,
612 0xe7676076,
613 0x60750000
614};
615
616uint patch_2f00[] = {
617 0x3030304c,
618 0xcab9e441,
619 0xa1aaf220
620};
621#endif
622
623void
624cpm_load_patch(volatile immap_t *immr)
625{
626 volatile uint *dp; /* Dual-ported RAM. */
627 volatile cpm8xx_t *commproc;
628 volatile iic_t *iip;
629 volatile spi_t *spp;
630 volatile smc_uart_t *smp;
631 int i;
632
633 commproc = (cpm8xx_t *)&immr->im_cpm;
634
635#ifdef CONFIG_USB_SOF_UCODE_PATCH
636 commproc->cp_rccr = 0;
637
638 dp = (uint *)(commproc->cp_dpmem);
639 for (i=0; i<(sizeof(patch_2000)/4); i++)
640 *dp++ = patch_2000[i];
641
642 dp = (uint *)&(commproc->cp_dpmem[0x0f00]);
643 for (i=0; i<(sizeof(patch_2f00)/4); i++)
644 *dp++ = patch_2f00[i];
645
646 commproc->cp_rccr = 0x0009;
647
648 printk("USB SOF microcode patch installed\n");
649#endif /* CONFIG_USB_SOF_UCODE_PATCH */
650
651#if defined(CONFIG_I2C_SPI_UCODE_PATCH) || \
652 defined(CONFIG_I2C_SPI_SMC1_UCODE_PATCH)
653
654 commproc->cp_rccr = 0;
655
656 dp = (uint *)(commproc->cp_dpmem);
657 for (i=0; i<(sizeof(patch_2000)/4); i++)
658 *dp++ = patch_2000[i];
659
660 dp = (uint *)&(commproc->cp_dpmem[0x0f00]);
661 for (i=0; i<(sizeof(patch_2f00)/4); i++)
662 *dp++ = patch_2f00[i];
663
664 iip = (iic_t *)&commproc->cp_dparam[PROFF_IIC];
665# define RPBASE 0x0500
666 iip->iic_rpbase = RPBASE;
667
668 /* Put SPI above the IIC, also 32-byte aligned.
669 */
670 i = (RPBASE + sizeof(iic_t) + 31) & ~31;
671 spp = (spi_t *)&commproc->cp_dparam[PROFF_SPI];
672 spp->spi_rpbase = i;
673
674# if defined(CONFIG_I2C_SPI_UCODE_PATCH)
675 commproc->cp_cpmcr1 = 0x802a;
676 commproc->cp_cpmcr2 = 0x8028;
677 commproc->cp_cpmcr3 = 0x802e;
678 commproc->cp_cpmcr4 = 0x802c;
679 commproc->cp_rccr = 1;
680
681 printk("I2C/SPI microcode patch installed.\n");
682# endif /* CONFIG_I2C_SPI_UCODE_PATCH */
683
684# if defined(CONFIG_I2C_SPI_SMC1_UCODE_PATCH)
685
686 dp = (uint *)&(commproc->cp_dpmem[0x0e00]);
687 for (i=0; i<(sizeof(patch_2e00)/4); i++)
688 *dp++ = patch_2e00[i];
689
690 commproc->cp_cpmcr1 = 0x8080;
691 commproc->cp_cpmcr2 = 0x808a;
692 commproc->cp_cpmcr3 = 0x8028;
693 commproc->cp_cpmcr4 = 0x802a;
694 commproc->cp_rccr = 3;
695
696 smp = (smc_uart_t *)&commproc->cp_dparam[PROFF_SMC1];
697 smp->smc_rpbase = 0x1FC0;
698
699 printk("I2C/SPI/SMC1 microcode patch installed.\n");
700# endif /* CONFIG_I2C_SPI_SMC1_UCODE_PATCH) */
701
702#endif /* some variation of the I2C/SPI patch was selected */
703}
704
705/*
706 * Take this entire routine out, since no one calls it and its
707 * logic is suspect.
708 */
709
710#if 0
711void
712verify_patch(volatile immap_t *immr)
713{
714 volatile uint *dp;
715 volatile cpm8xx_t *commproc;
716 int i;
717
718 commproc = (cpm8xx_t *)&immr->im_cpm;
719
720 printk("cp_rccr %x\n", commproc->cp_rccr);
721 commproc->cp_rccr = 0;
722
723 dp = (uint *)(commproc->cp_dpmem);
724 for (i=0; i<(sizeof(patch_2000)/4); i++)
725 if (*dp++ != patch_2000[i]) {
726 printk("patch_2000 bad at %d\n", i);
727 dp--;
728 printk("found 0x%X, wanted 0x%X\n", *dp, patch_2000[i]);
729 break;
730 }
731
732 dp = (uint *)&(commproc->cp_dpmem[0x0f00]);
733 for (i=0; i<(sizeof(patch_2f00)/4); i++)
734 if (*dp++ != patch_2f00[i]) {
735 printk("patch_2f00 bad at %d\n", i);
736 dp--;
737 printk("found 0x%X, wanted 0x%X\n", *dp, patch_2f00[i]);
738 break;
739 }
740
741 commproc->cp_rccr = 0x0009;
742}
743#endif
diff --git a/arch/ppc/Kconfig b/arch/ppc/Kconfig
deleted file mode 100644
index 0f1863ed9c1c..000000000000
--- a/arch/ppc/Kconfig
+++ /dev/null
@@ -1,1186 +0,0 @@
1# For a description of the syntax of this configuration file,
2# see Documentation/kbuild/kconfig-language.txt.
3#
4
5mainmenu "Linux/PowerPC Kernel Configuration"
6
7config WORD_SIZE
8 int
9 default 32
10
11config MMU
12 bool
13 default y
14
15config GENERIC_HARDIRQS
16 bool
17 default y
18
19config RWSEM_GENERIC_SPINLOCK
20 bool
21
22config RWSEM_XCHGADD_ALGORITHM
23 bool
24 default y
25
26config ARCH_HAS_ILOG2_U32
27 bool
28 default y
29
30config ARCH_HAS_ILOG2_U64
31 bool
32 default n
33
34config GENERIC_HWEIGHT
35 bool
36 default y
37
38config GENERIC_CALIBRATE_DELAY
39 bool
40 default y
41
42config PPC
43 bool
44 default y
45 select HAVE_IDE
46 select HAVE_OPROFILE
47 select HAVE_KPROBES
48
49config PPC32
50 bool
51 default y
52
53# All PPCs use generic nvram driver through ppc_md
54config GENERIC_NVRAM
55 bool
56 default y
57
58config GENERIC_FIND_NEXT_BIT
59 bool
60 default y
61
62config SCHED_NO_NO_OMIT_FRAME_POINTER
63 bool
64 default y
65
66config ARCH_MAY_HAVE_PC_FDC
67 bool
68 default y
69
70config GENERIC_BUG
71 bool
72 default y
73 depends on BUG
74
75source "init/Kconfig"
76
77menu "Processor"
78
79choice
80 prompt "Processor Type"
81 default 6xx
82
83config 6xx
84 bool "6xx/7xx/74xx/52xx/82xx"
85 select PPC_FPU
86 help
87 There are four types of PowerPC chips supported. The more common
88 types (601, 603, 604, 740, 750, 7400), the older Freescale
89 (formerly Motorola) embedded versions (821, 823, 850, 855, 860,
90 52xx, 82xx), the IBM embedded versions (403 and 405) and
91 the Book E embedded processors from IBM (44x) and Freescale (85xx).
92 For support for 64-bit processors, set ARCH=powerpc.
93 Unless you are building a kernel for one of the embedded processor
94 systems, choose 6xx.
95 Also note that because the 52xx, 82xx family have a 603e
96 core, specific support for that chipset is asked later on.
97
98config 40x
99 bool "40x"
100 select PPC_DCR_NATIVE
101
102config 44x
103 bool "44x"
104 select PPC_DCR_NATIVE
105
106config 8xx
107 bool "8xx"
108 select PPC_LIB_RHEAP
109
110endchoice
111
112config PPC_FPU
113 bool
114
115config PPC_DCR_NATIVE
116 bool
117 default n
118
119config PPC_DCR
120 bool
121 depends on PPC_DCR_NATIVE
122 default y
123
124config PTE_64BIT
125 bool
126 depends on 44x
127 default y if 44x
128
129config PHYS_64BIT
130 bool
131 depends on 44x
132 default y if 44x
133 ---help---
134 This option enables kernel support for larger than 32-bit physical
135 addresses. This features is not be available on all e500 cores.
136
137 If in doubt, say N here.
138
139config ALTIVEC
140 bool "AltiVec Support"
141 depends on 6xx
142 depends on !8260
143 ---help---
144 This option enables kernel support for the Altivec extensions to the
145 PowerPC processor. The kernel currently supports saving and restoring
146 altivec registers, and turning on the 'altivec enable' bit so user
147 processes can execute altivec instructions.
148
149 This option is only usefully if you have a processor that supports
150 altivec (G4, otherwise known as 74xx series), but does not have
151 any affect on a non-altivec cpu (it does, however add code to the
152 kernel).
153
154 If in doubt, say Y here.
155
156config TAU
157 bool "Thermal Management Support"
158 depends on 6xx && !8260
159 help
160 G3 and G4 processors have an on-chip temperature sensor called the
161 'Thermal Assist Unit (TAU)', which, in theory, can measure the on-die
162 temperature within 2-4 degrees Celsius. This option shows the current
163 on-die temperature in /proc/cpuinfo if the cpu supports it.
164
165 Unfortunately, on some chip revisions, this sensor is very inaccurate
166 and in some cases, does not work at all, so don't assume the cpu
167 temp is actually what /proc/cpuinfo says it is.
168
169config TAU_INT
170 bool "Interrupt driven TAU driver (DANGEROUS)"
171 depends on TAU
172 ---help---
173 The TAU supports an interrupt driven mode which causes an interrupt
174 whenever the temperature goes out of range. This is the fastest way
175 to get notified the temp has exceeded a range. With this option off,
176 a timer is used to re-check the temperature periodically.
177
178 However, on some cpus it appears that the TAU interrupt hardware
179 is buggy and can cause a situation which would lead unexplained hard
180 lockups.
181
182 Unless you are extending the TAU driver, or enjoy kernel/hardware
183 debugging, leave this option off.
184
185config TAU_AVERAGE
186 bool "Average high and low temp"
187 depends on TAU
188 ---help---
189 The TAU hardware can compare the temperature to an upper and lower
190 bound. The default behavior is to show both the upper and lower
191 bound in /proc/cpuinfo. If the range is large, the temperature is
192 either changing a lot, or the TAU hardware is broken (likely on some
193 G4's). If the range is small (around 4 degrees), the temperature is
194 relatively stable. If you say Y here, a single temperature value,
195 halfway between the upper and lower bounds, will be reported in
196 /proc/cpuinfo.
197
198 If in doubt, say N here.
199
200config MATH_EMULATION
201 bool "Math emulation"
202 depends on 4xx || 8xx
203 ---help---
204 Some PowerPC chips designed for embedded applications do not have
205 a floating-point unit and therefore do not implement the
206 floating-point instructions in the PowerPC instruction set. If you
207 say Y here, the kernel will include code to emulate a floating-point
208 unit, which will allow programs that use floating-point
209 instructions to run.
210
211 If you have an Apple machine or an IBM RS/6000 or pSeries machine,
212 or any machine with a 6xx, 7xx or 7xxx series processor, say N
213 here. Saying Y here will not hurt performance (on any machine) but
214 will increase the size of the kernel.
215
216config KEXEC
217 bool "kexec system call (EXPERIMENTAL)"
218 depends on EXPERIMENTAL
219 help
220 kexec is a system call that implements the ability to shutdown your
221 current kernel, and to start another kernel. It is like a reboot
222 but it is independent of the system firmware. And like a reboot
223 you can start any kernel with it, not just Linux.
224
225 The name comes from the similarity to the exec system call.
226
227 It is an ongoing process to be certain the hardware in a machine
228 is properly shutdown, so do not be surprised if this code does not
229 initially work for you. It may help to enable device hotplugging
230 support. As of this writing the exact hardware interface is
231 strongly in flux, so no good recommendation can be made.
232
233 In the GameCube implementation, kexec allows you to load and
234 run DOL files, including kernel and homebrew DOLs.
235
236source "drivers/cpufreq/Kconfig"
237
238config PPC601_SYNC_FIX
239 bool "Workarounds for PPC601 bugs"
240 depends on 6xx && PPC_PREP
241 help
242 Some versions of the PPC601 (the first PowerPC chip) have bugs which
243 mean that extra synchronization instructions are required near
244 certain instructions, typically those that make major changes to the
245 CPU state. These extra instructions reduce performance slightly.
246 If you say N here, these extra instructions will not be included,
247 resulting in a kernel which will run faster but may not run at all
248 on some systems with the PPC601 chip.
249
250 If in doubt, say Y here.
251
252source arch/ppc/platforms/4xx/Kconfig
253
254config PPC_STD_MMU
255 bool
256 depends on 6xx
257 default y
258
259config NOT_COHERENT_CACHE
260 bool
261 depends on 4xx || 8xx
262 default y
263
264endmenu
265
266menu "Platform options"
267
268config FADS
269 bool
270
271choice
272 prompt "8xx Machine Type"
273 depends on 8xx
274 default RPXLITE
275
276config RPXLITE
277 bool "RPX-Lite"
278 ---help---
279 Single-board computers based around the PowerPC MPC8xx chips and
280 intended for embedded applications. The following types are
281 supported:
282
283 RPX-Lite:
284 Embedded Planet RPX Lite. PC104 form-factor SBC based on the MPC823.
285
286 RPX-Classic:
287 Embedded Planet RPX Classic Low-fat. Credit-card-size SBC based on
288 the MPC 860
289
290 BSE-IP:
291 Bright Star Engineering ip-Engine.
292
293 TQM823L:
294 TQM850L:
295 TQM855L:
296 TQM860L:
297 MPC8xx based family of mini modules, half credit card size,
298 up to 64 MB of RAM, 8 MB Flash, (Fast) Ethernet, 2 x serial ports,
299 2 x CAN bus interface, ...
300 Manufacturer: TQ Components, www.tq-group.de
301 Date of Release: October (?) 1999
302 End of Life: not yet :-)
303 URL:
304 - module: <http://www.denx.de/PDF/TQM8xxLHWM201.pdf>
305 - starter kit: <http://www.denx.de/PDF/STK8xxLHWM201.pdf>
306 - images: <http://www.denx.de/embedded-ppc-en.html>
307
308 FPS850L:
309 FingerPrint Sensor System (based on TQM850L)
310 Manufacturer: IKENDI AG, <http://www.ikendi.com/>
311 Date of Release: November 1999
312 End of life: end 2000 ?
313 URL: see TQM850L
314
315 IVMS8:
316 MPC860 based board used in the "Integrated Voice Mail System",
317 Small Version (8 voice channels)
318 Manufacturer: Speech Design, <http://www.speech-design.de/>
319 Date of Release: December 2000 (?)
320 End of life: -
321 URL: <http://www.speech-design.de/>
322
323 IVML24:
324 MPC860 based board used in the "Integrated Voice Mail System",
325 Large Version (24 voice channels)
326 Manufacturer: Speech Design, <http://www.speech-design.de/>
327 Date of Release: March 2001 (?)
328 End of life: -
329 URL: <http://www.speech-design.de/>
330
331 HERMES:
332 Hermes-Pro ISDN/LAN router with integrated 8 x hub
333 Manufacturer: Multidata Gesellschaft fur Datentechnik und Informatik
334 <http://www.multidata.de/>
335 Date of Release: 2000 (?)
336 End of life: -
337 URL: <http://www.multidata.de/english/products/hpro.htm>
338
339 IP860:
340 VMEBus IP (Industry Pack) carrier board with MPC860
341 Manufacturer: MicroSys GmbH, <http://www.microsys.de/>
342 Date of Release: ?
343 End of life: -
344 URL: <http://www.microsys.de/html/ip860.html>
345
346 PCU_E:
347 PCU = Peripheral Controller Unit, Extended
348 Manufacturer: Siemens AG, ICN (Information and Communication Networks)
349 <http://www.siemens.de/page/1,3771,224315-1-999_2_226207-0,00.html>
350 Date of Release: April 2001
351 End of life: August 2001
352 URL: n. a.
353
354config RPXCLASSIC
355 bool "RPX-Classic"
356 help
357 The RPX-Classic is a single-board computer based on the Motorola
358 MPC860. It features 16MB of DRAM and a variable amount of flash,
359 I2C EEPROM, thermal monitoring, a PCMCIA slot, a DIP switch and two
360 LEDs. Variants with Ethernet ports exist. Say Y here to support it
361 directly.
362
363config BSEIP
364 bool "BSE-IP"
365 help
366 Say Y here to support the Bright Star Engineering ipEngine SBC.
367 This is a credit-card-sized device featuring a MPC823 processor,
368 26MB DRAM, 4MB flash, Ethernet, a 16K-gate FPGA, USB, an LCD/video
369 controller, and two RS232 ports.
370
371config MPC8XXFADS
372 bool "FADS"
373 select FADS
374
375config TQM823L
376 bool "TQM823L"
377 help
378 Say Y here to support the TQM823L, one of an MPC8xx-based family of
379 mini SBCs (half credit-card size) from TQ Components first released
380 in late 1999. Technical references are at
381 <http://www.denx.de/PDF/TQM8xxLHWM201.pdf>, and
382 <http://www.denx.de/PDF/STK8xxLHWM201.pdf>, and an image at
383 <http://www.denx.de/embedded-ppc-en.html>.
384
385config TQM850L
386 bool "TQM850L"
387 help
388 Say Y here to support the TQM850L, one of an MPC8xx-based family of
389 mini SBCs (half credit-card size) from TQ Components first released
390 in late 1999. Technical references are at
391 <http://www.denx.de/PDF/TQM8xxLHWM201.pdf>, and
392 <http://www.denx.de/PDF/STK8xxLHWM201.pdf>, and an image at
393 <http://www.denx.de/embedded-ppc-en.html>.
394
395config TQM855L
396 bool "TQM855L"
397 help
398 Say Y here to support the TQM855L, one of an MPC8xx-based family of
399 mini SBCs (half credit-card size) from TQ Components first released
400 in late 1999. Technical references are at
401 <http://www.denx.de/PDF/TQM8xxLHWM201.pdf>, and
402 <http://www.denx.de/PDF/STK8xxLHWM201.pdf>, and an image at
403 <http://www.denx.de/embedded-ppc-en.html>.
404
405config TQM860L
406 bool "TQM860L"
407 help
408 Say Y here to support the TQM860L, one of an MPC8xx-based family of
409 mini SBCs (half credit-card size) from TQ Components first released
410 in late 1999. Technical references are at
411 <http://www.denx.de/PDF/TQM8xxLHWM201.pdf>, and
412 <http://www.denx.de/PDF/STK8xxLHWM201.pdf>, and an image at
413 <http://www.denx.de/embedded-ppc-en.html>.
414
415config FPS850L
416 bool "FPS850L"
417
418config IVMS8
419 bool "IVMS8"
420 help
421 Say Y here to support the Integrated Voice-Mail Small 8-channel SBC
422 from Speech Design, released March 2001. The manufacturer's website
423 is at <http://www.speech-design.de/>.
424
425config IVML24
426 bool "IVML24"
427 help
428 Say Y here to support the Integrated Voice-Mail Large 24-channel SBC
429 from Speech Design, released March 2001. The manufacturer's website
430 is at <http://www.speech-design.de/>.
431
432config HERMES_PRO
433 bool "HERMES"
434
435config IP860
436 bool "IP860"
437
438config LWMON
439 bool "LWMON"
440
441config PCU_E
442 bool "PCU_E"
443
444config CCM
445 bool "CCM"
446
447config LANTEC
448 bool "LANTEC"
449
450config MBX
451 bool "MBX"
452 help
453 MBX is a line of Motorola single-board computer based around the
454 MPC821 and MPC860 processors, and intended for embedded-controller
455 applications. Say Y here to support these boards directly.
456
457config WINCEPT
458 bool "WinCept"
459 help
460 The Wincept 100/110 is a Motorola single-board computer based on the
461 MPC821 PowerPC, introduced in 1998 and designed to be used in
462 thin-client machines. Say Y to support it directly.
463
464endchoice
465
466choice
467 prompt "Machine Type"
468 depends on 6xx
469 default PPC_PREP
470 ---help---
471 Linux currently supports several different kinds of PowerPC-based
472 machines: Apple Power Macintoshes and clones (such as the Motorola
473 Starmax series), PReP (PowerPC Reference Platform) machines (such
474 as the Motorola PowerStacks, Motorola cPCI/VME embedded systems,
475 and some IBM RS/6000 systems), CHRP (Common Hardware Reference
476 Platform) machines (including all of the recent IBM RS/6000 and
477 pSeries machines), and several embedded PowerPC systems containing
478 4xx, 6xx, 7xx, 8xx, 74xx, and 82xx processors. Currently, the
479 default option is to build a kernel which works on PReP.
480
481 Note that support for Apple and CHRP machines is now only available
482 with ARCH=powerpc, and has been removed from this menu. If you
483 wish to build a kernel for an Apple or CHRP machine, exit this
484 configuration process and re-run it with ARCH=powerpc.
485
486 Select PReP if configuring for a PReP machine.
487
488config PPC_PREP
489 bool "PReP"
490
491config KATANA
492 bool "Artesyn-Katana"
493 help
494 Select KATANA if configuring an Artesyn KATANA 750i or 3750
495 cPCI board.
496
497config WILLOW
498 bool "Cogent-Willow"
499
500config CPCI690
501 bool "Force-CPCI690"
502 help
503 Select CPCI690 if configuring a Force CPCI690 cPCI board.
504
505config POWERPMC250
506 bool "Force-PowerPMC250"
507
508config CHESTNUT
509 bool "IBM 750FX Eval board or 750GX Eval board"
510 help
511 Select CHESTNUT if configuring an IBM 750FX Eval Board or a
512 IBM 750GX Eval board.
513
514config SPRUCE
515 bool "IBM-Spruce"
516 select PPC_INDIRECT_PCI
517
518config HDPU
519 bool "Sky-HDPU"
520 help
521 Select HDPU if configuring a Sky Computers Compute Blade.
522
523config HDPU_FEATURES
524 depends on HDPU
525 tristate "HDPU-Features"
526 help
527 Select to enable HDPU enhanced features.
528
529config EV64260
530 bool "Marvell-EV64260BP"
531 help
532 Select EV64260 if configuring a Marvell (formerly Galileo)
533 EV64260BP Evaluation platform.
534
535config LOPEC
536 bool "Motorola-LoPEC"
537 select PPC_I8259
538
539config MVME5100
540 bool "Motorola-MVME5100"
541 select PPC_INDIRECT_PCI
542
543config PPLUS
544 bool "Motorola-PowerPlus"
545 select PPC_I8259
546 select PPC_INDIRECT_PCI
547
548config PRPMC750
549 bool "Motorola-PrPMC750"
550 select PPC_INDIRECT_PCI
551
552config PRPMC800
553 bool "Motorola-PrPMC800"
554 select PPC_INDIRECT_PCI
555
556config SANDPOINT
557 bool "Motorola-Sandpoint"
558 select PPC_I8259
559 help
560 Select SANDPOINT if configuring for a Motorola Sandpoint X3
561 (any flavor).
562
563config RADSTONE_PPC7D
564 bool "Radstone Technology PPC7D board"
565 select PPC_I8259
566
567config PAL4
568 bool "SBS-Palomar4"
569
570config EST8260
571 bool "EST8260"
572 ---help---
573 The EST8260 is a single-board computer manufactured by Wind River
574 Systems, Inc. (formerly Embedded Support Tools Corp.) and based on
575 the MPC8260. Wind River Systems has a website at
576 <http://www.windriver.com/>, but the EST8260 cannot be found on it
577 and has probably been discontinued or rebadged.
578
579config SBC82xx
580 bool "SBC82xx"
581 ---help---
582 SBC PowerQUICC II, single-board computer with MPC82xx CPU
583 Manufacturer: Wind River Systems, Inc.
584 Date of Release: May 2003
585 End of Life: -
586 URL: <http://www.windriver.com/>
587
588config SBS8260
589 bool "SBS8260"
590
591config RPX8260
592 bool "RPXSUPER"
593
594config TQM8260
595 bool "TQM8260"
596 ---help---
597 MPC8260 based module, little larger than credit card,
598 up to 128 MB global + 64 MB local RAM, 32 MB Flash,
599 32 kB EEPROM, 256 kB L@ Cache, 10baseT + 100baseT Ethernet,
600 2 x serial ports, ...
601 Manufacturer: TQ Components, www.tq-group.de
602 Date of Release: June 2001
603 End of Life: not yet :-)
604 URL: <http://www.denx.de/PDF/TQM82xx_SPEC_Rev005.pdf>
605
606config PQ2FADS
607 bool "Freescale-PQ2FADS"
608 help
609 Select PQ2FADS if you wish to configure for a Freescale
610 PQ2FADS board (-VR or -ZU).
611
612config LITE5200
613 bool "Freescale LITE5200 / (IceCube)"
614 select PPC_MPC52xx
615 help
616 Support for the LITE5200 dev board for the MPC5200 from Freescale.
617 This is for the LITE5200 version 2.0 board. Don't know if it changes
618 much but it's only been tested on this board version. I think this
619 board is also known as IceCube.
620
621config LITE5200B
622 bool "Freescale LITE5200B"
623 depends on LITE5200
624 help
625 Support for the LITE5200B dev board for the MPC5200 from Freescale.
626 This is the new board with 2 PCI slots.
627
628config EV64360
629 bool "Marvell-EV64360BP"
630 help
631 Select EV64360 if configuring a Marvell EV64360BP Evaluation
632 platform.
633endchoice
634
635config TQM8xxL
636 bool
637 depends on 8xx && (TQM823L || TQM850L || FPS850L || TQM855L || TQM860L)
638 default y
639
640config EMBEDDEDBOOT
641 bool
642 depends on 8xx || 8260
643 default y
644
645config PPC_MPC52xx
646 bool
647
648config 8260
649 bool "CPM2 Support" if WILLOW
650 depends on 6xx
651 default y if TQM8260 || RPX8260 || EST8260 || SBS8260 || SBC82xx || PQ2FADS
652 help
653 The MPC8260 is a typical embedded CPU made by Motorola. Selecting
654 this option means that you wish to build a kernel for a machine with
655 an 8260 class CPU.
656
657config CPM1
658 bool
659 depends on 8xx
660 default y
661 help
662 The CPM1 (Communications Processor Module) is a coprocessor on
663 embedded CPUs made by Motorola. Selecting this option means that
664 you wish to build a kernel for a machine with a CPM1 coprocessor
665 on it (8xx, 827x, 8560).
666
667config CPM2
668 bool
669 depends on 8260 || MPC8560 || MPC8555
670 select PPC_LIB_RHEAP
671 default y
672 help
673 The CPM2 (Communications Processor Module) is a coprocessor on
674 embedded CPUs made by Motorola. Selecting this option means that
675 you wish to build a kernel for a machine with a CPM2 coprocessor
676 on it (826x, 827x, 8560).
677
678config PPC_GEN550
679 bool
680 depends on SANDPOINT || SPRUCE || PPLUS || \
681 PRPMC750 || PRPMC800 || LOPEC || \
682 (EV64260 && !SERIAL_MPSC) || CHESTNUT || RADSTONE_PPC7D
683 default y
684
685config FORCE
686 bool
687 depends on 6xx && POWERPMC250
688 default y
689
690config GT64260
691 bool
692 depends on EV64260 || CPCI690
693 default y
694
695config MV64360 # Really MV64360 & MV64460
696 bool
697 depends on CHESTNUT || KATANA || RADSTONE_PPC7D || HDPU || EV64360
698 default y
699
700config MV64X60
701 bool
702 depends on (GT64260 || MV64360)
703 select PPC_INDIRECT_PCI
704 default y
705
706config MV643XX_ETH_0
707 bool
708 depends on MV643XX_ETH && (KATANA || RADSTONE_PPC7D || EV64360 || HDPU)
709 default y
710
711config MV643XX_ETH_1
712 bool
713 depends on MV643XX_ETH && (KATANA || RADSTONE_PPC7D || EV64360)
714 default y
715
716config MV643XX_ETH_2
717 bool
718 depends on MV643XX_ETH && (KATANA || RADSTONE_PPC7D || EV64360)
719 default y
720
721menu "Set bridge options"
722 depends on MV64X60
723
724config NOT_COHERENT_CACHE
725 bool "Turn off Cache Coherency"
726 default n
727 help
728 Some 64x60 bridges lock up when trying to enforce cache coherency.
729 When this option is selected, cache coherency will be turned off.
730 Note that this can cause other problems (e.g., stale data being
731 speculatively loaded via a cached mapping). Use at your own risk.
732
733config MV64X60_BASE
734 hex "Set bridge base used by firmware"
735 default "0xf1000000"
736 help
737 A firmware can leave the base address of the bridge's registers at
738 a non-standard location. If so, set this value to reflect the
739 address of that non-standard location.
740
741config MV64X60_NEW_BASE
742 hex "Set bridge base used by kernel"
743 default "0xf1000000"
744 help
745 If the current base address of the bridge's registers is not where
746 you want it, set this value to the address that you want it moved to.
747
748endmenu
749
750config NONMONARCH_SUPPORT
751 bool "Enable Non-Monarch Support"
752 depends on PRPMC800
753
754config HARRIER
755 bool
756 depends on PRPMC800
757 default y
758
759config EPIC_SERIAL_MODE
760 bool
761 depends on 6xx && (LOPEC || SANDPOINT)
762 default y
763
764config MPC10X_BRIDGE
765 bool
766 depends on POWERPMC250 || LOPEC || SANDPOINT
767 select PPC_INDIRECT_PCI
768 default y
769
770config MPC10X_OPENPIC
771 bool
772 depends on POWERPMC250 || LOPEC || SANDPOINT
773 default y
774
775config MPC10X_STORE_GATHERING
776 bool "Enable MPC10x store gathering"
777 depends on MPC10X_BRIDGE
778
779config SANDPOINT_ENABLE_UART1
780 bool "Enable DUART mode on Sandpoint"
781 depends on SANDPOINT
782 help
783 If this option is enabled then the MPC824x processor will run
784 in DUART mode instead of UART mode.
785
786config HARRIER_STORE_GATHERING
787 bool "Enable Harrier store gathering"
788 depends on HARRIER
789
790config MVME5100_IPMC761_PRESENT
791 bool "MVME5100 configured with an IPMC761"
792 depends on MVME5100
793 select PPC_I8259
794
795config SPRUCE_BAUD_33M
796 bool "Spruce baud clock support"
797 depends on SPRUCE
798
799config PC_KEYBOARD
800 bool "PC PS/2 style Keyboard"
801 depends on 4xx || CPM2
802
803config PPCBUG_NVRAM
804 bool "Enable reading PPCBUG NVRAM during boot" if PPLUS || LOPEC
805 default y if PPC_PREP
806
807config SMP
808 depends on PPC_STD_MMU
809 bool "Symmetric multi-processing support"
810 ---help---
811 This enables support for systems with more than one CPU. If you have
812 a system with only one CPU, say N. If you have a system with more
813 than one CPU, say Y. Note that the kernel does not currently
814 support SMP machines with 603/603e/603ev or PPC750 ("G3") processors
815 since they have inadequate hardware support for multiprocessor
816 operation.
817
818 If you say N here, the kernel will run on single and multiprocessor
819 machines, but will use only one CPU of a multiprocessor machine. If
820 you say Y here, the kernel will run on single-processor machines.
821 On a single-processor machine, the kernel will run faster if you say
822 N here.
823
824 If you don't know what to do here, say N.
825
826config IRQ_ALL_CPUS
827 bool "Distribute interrupts on all CPUs by default"
828 depends on SMP && !MV64360
829 help
830 This option gives the kernel permission to distribute IRQs across
831 multiple CPUs. Saying N here will route all IRQs to the first
832 CPU. Generally saying Y is safe, although some problems have been
833 reported with SMP Power Macintoshes with this option enabled.
834
835config NR_CPUS
836 int "Maximum number of CPUs (2-32)"
837 range 2 32
838 depends on SMP
839 default "4"
840
841config HIGHMEM
842 bool "High memory support"
843
844config ARCH_POPULATES_NODE_MAP
845 def_bool y
846
847source kernel/Kconfig.hz
848source kernel/Kconfig.preempt
849source "mm/Kconfig"
850
851source "fs/Kconfig.binfmt"
852
853config PREP_RESIDUAL
854 bool "Support for PReP Residual Data"
855 depends on PPC_PREP
856 help
857 Some PReP systems have residual data passed to the kernel by the
858 firmware. This allows detection of memory size, devices present and
859 other useful pieces of information. Sometimes this information is
860 not present or incorrect, in which case it could lead to the machine
861 behaving incorrectly. If this happens, either disable PREP_RESIDUAL
862 or pass the 'noresidual' option to the kernel.
863
864 If you are running a PReP system, say Y here, otherwise say N.
865
866config PROC_PREPRESIDUAL
867 bool "Support for reading of PReP Residual Data in /proc"
868 depends on PREP_RESIDUAL && PROC_FS
869 help
870 Enabling this option will create a /proc/residual file which allows
871 you to get at the residual data on PReP systems. You will need a tool
872 (lsresidual) to parse it. If you aren't on a PReP system, you don't
873 want this.
874
875config CMDLINE_BOOL
876 bool "Default bootloader kernel arguments"
877
878config CMDLINE
879 string "Initial kernel command string"
880 depends on CMDLINE_BOOL
881 default "console=ttyS0,9600 console=tty0 root=/dev/sda2"
882 help
883 On some platforms, there is currently no way for the boot loader to
884 pass arguments to the kernel. For these platforms, you can supply
885 some command-line options at build time by entering them here. In
886 most cases you will need to specify the root device here.
887
888if BROKEN
889source kernel/power/Kconfig
890endif
891
892config SECCOMP
893 bool "Enable seccomp to safely compute untrusted bytecode"
894 depends on PROC_FS
895 default y
896 help
897 This kernel feature is useful for number crunching applications
898 that may need to compute untrusted bytecode during their
899 execution. By using pipes or other transports made available to
900 the process as file descriptors supporting the read/write
901 syscalls, it's possible to isolate those applications in
902 their own address space using seccomp. Once seccomp is
903 enabled via /proc/<pid>/seccomp, it cannot be disabled
904 and the task is only allowed to execute a few safe syscalls
905 defined by each seccomp mode.
906
907 If unsure, say Y. Only embedded should say N here.
908
909endmenu
910
911config ISA_DMA_API
912 bool
913 default y
914
915menu "Bus options"
916
917config ISA
918 bool "Support for ISA-bus hardware"
919 depends on PPC_PREP
920 help
921 Find out whether you have ISA slots on your motherboard. ISA is the
922 name of a bus system, i.e. the way the CPU talks to the other stuff
923 inside your box. If you have an Apple machine, say N here; if you
924 have an IBM RS/6000 or pSeries machine or a PReP machine, say Y. If
925 you have an embedded board, consult your board documentation.
926
927config ZONE_DMA
928 bool
929 default y
930
931config GENERIC_ISA_DMA
932 bool
933 depends on 6xx && !CPM2
934 default y
935
936config PPC_I8259
937 bool
938 default y if PPC_PREP
939 default n
940
941config PPC_INDIRECT_PCI
942 bool
943 depends on PCI
944 default y if 40x || 44x || PPC_PREP
945 default n
946
947config EISA
948 bool
949 help
950 The Extended Industry Standard Architecture (EISA) bus is a bus
951 architecture used on some older intel-based PCs.
952
953config SBUS
954 bool
955
956# Yes MCA RS/6000s exist but Linux-PPC does not currently support any
957config MCA
958 bool
959
960config PCI
961 bool "PCI support" if 40x || CPM2 || PPC_MPC52xx
962 default y if !40x && !CPM2 && !8xx
963 default PCI_QSPAN if !4xx && !CPM2 && 8xx
964 help
965 Find out whether your system includes a PCI bus. PCI is the name of
966 a bus system, i.e. the way the CPU talks to the other stuff inside
967 your box. If you say Y here, the kernel will include drivers and
968 infrastructure code to support PCI bus devices.
969
970config PCI_DOMAINS
971 def_bool PCI
972
973config PCI_SYSCALL
974 def_bool PCI
975
976config PCI_QSPAN
977 bool "QSpan PCI"
978 depends on !4xx && !CPM2 && 8xx
979 select PPC_I8259
980 help
981 Say Y here if you have a system based on a Motorola 8xx-series
982 embedded processor with a QSPAN PCI interface, otherwise say N.
983
984config PCI_8260
985 bool
986 depends on PCI && 8260
987 select PPC_INDIRECT_PCI
988 default y
989
990config 8260_PCI9
991 bool "Enable workaround for MPC826x erratum PCI 9"
992 depends on PCI_8260
993 default y
994
995choice
996 prompt "IDMA channel for PCI 9 workaround"
997 depends on 8260_PCI9
998
999config 8260_PCI9_IDMA1
1000 bool "IDMA1"
1001
1002config 8260_PCI9_IDMA2
1003 bool "IDMA2"
1004
1005config 8260_PCI9_IDMA3
1006 bool "IDMA3"
1007
1008config 8260_PCI9_IDMA4
1009 bool "IDMA4"
1010
1011endchoice
1012
1013source "drivers/pci/Kconfig"
1014
1015source "drivers/pcmcia/Kconfig"
1016
1017config RAPIDIO
1018 bool "RapidIO support" if MPC8540 || MPC8560
1019 help
1020 If you say Y here, the kernel will include drivers and
1021 infrastructure code to support RapidIO interconnect devices.
1022
1023source "drivers/rapidio/Kconfig"
1024
1025endmenu
1026
1027menu "Advanced setup"
1028
1029config ADVANCED_OPTIONS
1030 bool "Prompt for advanced kernel configuration options"
1031 help
1032 This option will enable prompting for a variety of advanced kernel
1033 configuration options. These options can cause the kernel to not
1034 work if they are set incorrectly, but can be used to optimize certain
1035 aspects of kernel memory management.
1036
1037 Unless you know what you are doing, say N here.
1038
1039comment "Default settings for advanced configuration options are used"
1040 depends on !ADVANCED_OPTIONS
1041
1042config HIGHMEM_START_BOOL
1043 bool "Set high memory pool address"
1044 depends on ADVANCED_OPTIONS && HIGHMEM
1045 help
1046 This option allows you to set the base address of the kernel virtual
1047 area used to map high memory pages. This can be useful in
1048 optimizing the layout of kernel virtual memory.
1049
1050 Say N here unless you know what you are doing.
1051
1052config HIGHMEM_START
1053 hex "Virtual start address of high memory pool" if HIGHMEM_START_BOOL
1054 default "0xfe000000"
1055
1056config LOWMEM_SIZE_BOOL
1057 bool "Set maximum low memory"
1058 depends on ADVANCED_OPTIONS
1059 help
1060 This option allows you to set the maximum amount of memory which
1061 will be used as "low memory", that is, memory which the kernel can
1062 access directly, without having to set up a kernel virtual mapping.
1063 This can be useful in optimizing the layout of kernel virtual
1064 memory.
1065
1066 Say N here unless you know what you are doing.
1067
1068config LOWMEM_SIZE
1069 hex "Maximum low memory size (in bytes)" if LOWMEM_SIZE_BOOL
1070 default "0x30000000"
1071
1072config KERNEL_START_BOOL
1073 bool "Set custom kernel base address"
1074 depends on ADVANCED_OPTIONS
1075 help
1076 This option allows you to set the kernel virtual address at which
1077 the kernel will map low memory (the kernel image will be linked at
1078 this address). This can be useful in optimizing the virtual memory
1079 layout of the system.
1080
1081 Say N here unless you know what you are doing.
1082
1083config KERNEL_START
1084 hex "Virtual address of kernel base" if KERNEL_START_BOOL
1085 default "0xc0000000"
1086
1087config TASK_SIZE_BOOL
1088 bool "Set custom user task size"
1089 depends on ADVANCED_OPTIONS
1090 help
1091 This option allows you to set the amount of virtual address space
1092 allocated to user tasks. This can be useful in optimizing the
1093 virtual memory layout of the system.
1094
1095 Say N here unless you know what you are doing.
1096
1097config TASK_SIZE
1098 hex "Size of user task space" if TASK_SIZE_BOOL
1099 default "0x80000000"
1100
1101config CONSISTENT_START_BOOL
1102 bool "Set custom consistent memory pool address"
1103 depends on ADVANCED_OPTIONS && NOT_COHERENT_CACHE
1104 help
1105 This option allows you to set the base virtual address
1106 of the consistent memory pool. This pool of virtual
1107 memory is used to make consistent memory allocations.
1108
1109config CONSISTENT_START
1110 hex "Base virtual address of consistent memory pool" if CONSISTENT_START_BOOL
1111 default "0xff100000" if NOT_COHERENT_CACHE
1112
1113config CONSISTENT_SIZE_BOOL
1114 bool "Set custom consistent memory pool size"
1115 depends on ADVANCED_OPTIONS && NOT_COHERENT_CACHE
1116 help
1117 This option allows you to set the size of the
1118 consistent memory pool. This pool of virtual memory
1119 is used to make consistent memory allocations.
1120
1121config CONSISTENT_SIZE
1122 hex "Size of consistent memory pool" if CONSISTENT_SIZE_BOOL
1123 default "0x00200000" if NOT_COHERENT_CACHE
1124
1125config BOOT_LOAD_BOOL
1126 bool "Set the boot link/load address"
1127 depends on ADVANCED_OPTIONS && !PPC_PREP
1128 help
1129 This option allows you to set the initial load address of the zImage
1130 or zImage.initrd file. This can be useful if you are on a board
1131 which has a small amount of memory.
1132
1133 Say N here unless you know what you are doing.
1134
1135config BOOT_LOAD
1136 hex "Link/load address for booting" if BOOT_LOAD_BOOL
1137 default "0x00400000" if 40x || 8xx || 8260
1138 default "0x01000000" if 44x
1139 default "0x00800000"
1140
1141config PIN_TLB
1142 bool "Pinned Kernel TLBs (860 ONLY)"
1143 depends on ADVANCED_OPTIONS && 8xx
1144
1145config PPC_LIB_RHEAP
1146 bool
1147
1148endmenu
1149
1150source "net/Kconfig"
1151
1152source "drivers/Kconfig"
1153
1154source "fs/Kconfig"
1155
1156source "arch/ppc/8xx_io/Kconfig"
1157
1158source "arch/ppc/8260_io/Kconfig"
1159
1160
1161menu "IBM 40x options"
1162 depends on 40x
1163
1164config SERIAL_SICC
1165 bool "SICC Serial port"
1166 depends on STB03xxx
1167
1168config UART1_DFLT_CONSOLE
1169 bool
1170 depends on SERIAL_SICC && UART0_TTYS1
1171 default y
1172
1173config SERIAL_SICC_CONSOLE
1174 bool
1175 depends on SERIAL_SICC && UART0_TTYS1
1176 default y
1177
1178endmenu
1179
1180source "lib/Kconfig"
1181
1182source "arch/ppc/Kconfig.debug"
1183
1184source "security/Kconfig"
1185
1186source "crypto/Kconfig"
diff --git a/arch/ppc/Kconfig.debug b/arch/ppc/Kconfig.debug
deleted file mode 100644
index f94b87740973..000000000000
--- a/arch/ppc/Kconfig.debug
+++ /dev/null
@@ -1,66 +0,0 @@
1menu "Kernel hacking"
2
3source "lib/Kconfig.debug"
4
5config KGDB
6 bool "Include kgdb kernel debugger"
7 depends on DEBUG_KERNEL && (BROKEN || PPC_GEN550 || 4xx)
8 select DEBUG_INFO
9 help
10 Include in-kernel hooks for kgdb, the Linux kernel source level
11 debugger. See <http://kgdb.sourceforge.net/> for more information.
12 Unless you are intending to debug the kernel, say N here.
13
14choice
15 prompt "Serial Port"
16 depends on KGDB
17 default KGDB_TTYS1
18
19config KGDB_TTYS0
20 bool "ttyS0"
21
22config KGDB_TTYS1
23 bool "ttyS1"
24
25config KGDB_TTYS2
26 bool "ttyS2"
27
28config KGDB_TTYS3
29 bool "ttyS3"
30
31endchoice
32
33config KGDB_CONSOLE
34 bool "Enable serial console thru kgdb port"
35 depends on KGDB && 8xx || CPM2
36 help
37 If you enable this, all serial console messages will be sent
38 over the gdb stub.
39 If unsure, say N.
40
41config XMON
42 bool "Include xmon kernel debugger"
43 depends on DEBUG_KERNEL
44 help
45 Include in-kernel hooks for the xmon kernel monitor/debugger.
46 Unless you are intending to debug the kernel, say N here.
47
48config BDI_SWITCH
49 bool "Include BDI-2000 user context switcher"
50 depends on DEBUG_KERNEL
51 help
52 Include in-kernel support for the Abatron BDI2000 debugger.
53 Unless you are intending to debug the kernel with one of these
54 machines, say N here.
55
56config SERIAL_TEXT_DEBUG
57 bool "Support for early boot texts over serial port"
58 depends on 4xx || LOPEC || MV64X60 || PPLUS || PRPMC800 || \
59 PPC_GEN550 || PPC_MPC52xx
60
61config PPC_OCP
62 bool
63 depends on IBM_OCP
64 default y
65
66endmenu
diff --git a/arch/ppc/Makefile b/arch/ppc/Makefile
deleted file mode 100644
index 2352d139b262..000000000000
--- a/arch/ppc/Makefile
+++ /dev/null
@@ -1,135 +0,0 @@
1# This file is included by the global makefile so that you can add your own
2# architecture-specific flags and dependencies.
3#
4# This file is subject to the terms and conditions of the GNU General Public
5# License. See the file "COPYING" in the main directory of this archive
6# for more details.
7#
8# Copyright (C) 1994 by Linus Torvalds
9# Changes for PPC by Gary Thomas
10# Rewritten by Cort Dougan and Paul Mackerras
11#
12
13# This must match PAGE_OFFSET in include/asm-ppc/page.h.
14KERNELLOAD := $(CONFIG_KERNEL_START)
15
16HAS_BIARCH := $(call cc-option-yn, -m32)
17ifeq ($(HAS_BIARCH),y)
18AS := $(AS) -a32
19LD := $(LD) -m elf32ppc
20CC := $(CC) -m32
21endif
22
23LDFLAGS_vmlinux := -Ttext $(KERNELLOAD) -Bstatic
24# The -Iarch/$(ARCH)/include is temporary while we are merging
25KBUILD_CPPFLAGS += -Iarch/$(ARCH) -Iarch/$(ARCH)/include
26KBUILD_AFLAGS += -Iarch/$(ARCH)
27KBUILD_CFLAGS += -Iarch/$(ARCH) -msoft-float -pipe \
28 -ffixed-r2 -mmultiple
29
30# No AltiVec instruction when building kernel
31KBUILD_CFLAGS += $(call cc-option, -mno-altivec)
32
33CPP = $(CC) -E $(KBUILD_CFLAGS)
34# Temporary hack until we have migrated to asm-powerpc
35LINUXINCLUDE += -Iarch/$(ARCH)/include
36
37CHECKFLAGS += -D__powerpc__
38
39cpu-as-$(CONFIG_4xx) += -Wa,-m405
40cpu-as-$(CONFIG_6xx) += -Wa,-maltivec
41
42KBUILD_AFLAGS += $(cpu-as-y)
43KBUILD_CFLAGS += $(cpu-as-y)
44
45# Default to the common case.
46KBUILD_DEFCONFIG := ebony_defconfig
47
48head-y := arch/ppc/kernel/head.o
49head-$(CONFIG_8xx) := arch/ppc/kernel/head_8xx.o
50head-$(CONFIG_4xx) := arch/ppc/kernel/head_4xx.o
51head-$(CONFIG_44x) := arch/ppc/kernel/head_44x.o
52
53head-$(CONFIG_PPC_FPU) += arch/powerpc/kernel/fpu.o
54
55core-y += arch/ppc/kernel/ arch/powerpc/kernel/ \
56 arch/ppc/platforms/ \
57 arch/ppc/mm/ arch/ppc/lib/ \
58 arch/ppc/syslib/ arch/powerpc/sysdev/ \
59 arch/powerpc/lib/
60core-$(CONFIG_4xx) += arch/ppc/platforms/4xx/
61core-$(CONFIG_MATH_EMULATION) += arch/powerpc/math-emu/
62core-$(CONFIG_XMON) += arch/ppc/xmon/
63drivers-$(CONFIG_8xx) += arch/ppc/8xx_io/
64drivers-$(CONFIG_4xx) += arch/ppc/4xx_io/
65drivers-$(CONFIG_CPM2) += arch/ppc/8260_io/
66
67drivers-$(CONFIG_OPROFILE) += arch/powerpc/oprofile/
68
69BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd vmlinux.sm
70
71PHONY += $(BOOT_TARGETS)
72
73all: uImage zImage
74
75CPPFLAGS_vmlinux.lds := -Upowerpc
76
77# All the instructions talk about "make bzImage".
78bzImage: zImage
79
80boot := arch/$(ARCH)/boot
81
82$(BOOT_TARGETS): vmlinux
83 $(Q)$(MAKE) $(build)=$(boot) $@
84
85uImage: vmlinux
86 $(Q)$(MAKE) $(build)=$(boot)/images $(boot)/images/$@
87
88define archhelp
89 @echo '* zImage - Compressed kernel image (arch/$(ARCH)/boot/images/zImage.*)'
90 @echo ' uImage - Create a bootable image for U-Boot / PPCBoot'
91 @echo ' install - Install kernel using'
92 @echo ' (your) ~/bin/installkernel or'
93 @echo ' (distribution) /sbin/installkernel or'
94 @echo ' install to $$(INSTALL_PATH) and run lilo'
95 @echo ' *_defconfig - Select default config from arch/$(ARCH)/ppc/configs'
96endef
97
98archclean:
99 $(Q)$(MAKE) $(clean)=arch/ppc/boot
100 # Temporary hack until we have migrated to asm-powerpc
101 $(Q)rm -rf arch/$(ARCH)/include
102
103archprepare: checkbin
104
105# Temporary hack until we have migrated to asm-powerpc
106include/asm: arch/$(ARCH)/include/asm
107arch/$(ARCH)/include/asm:
108 $(Q)if [ ! -d arch/$(ARCH)/include ]; then mkdir -p arch/$(ARCH)/include; fi
109 $(Q)ln -fsn $(srctree)/include/asm-powerpc arch/$(ARCH)/include/asm
110
111# Use the file '.tmp_gas_check' for binutils tests, as gas won't output
112# to stdout and these checks are run even on install targets.
113TOUT := .tmp_gas_check
114# Ensure this is binutils 2.12.1 (or 2.12.90.0.7) or later for altivec
115# instructions.
116# gcc-3.4 and binutils-2.14 are a fatal combination.
117
118checkbin:
119 @if test "$(call cc-version)" = "0304" ; then \
120 if ! /bin/echo mftb 5 | $(AS) -v -mppc -many -o $(TOUT) >/dev/null 2>&1 ; then \
121 echo -n '*** ${VERSION}.${PATCHLEVEL} kernels no longer build '; \
122 echo 'correctly with gcc-3.4 and your version of binutils.'; \
123 echo '*** Please upgrade your binutils or downgrade your gcc'; \
124 false; \
125 fi ; \
126 fi
127 @if ! /bin/echo dssall | $(AS) -many -o $(TOUT) >/dev/null 2>&1 ; then \
128 echo -n '*** ${VERSION}.${PATCHLEVEL} kernels no longer build ' ; \
129 echo 'correctly with old versions of binutils.' ; \
130 echo '*** Please upgrade your binutils to 2.12.1 or newer' ; \
131 false ; \
132 fi
133
134CLEAN_FILES += $(TOUT)
135
diff --git a/arch/ppc/boot/Makefile b/arch/ppc/boot/Makefile
deleted file mode 100644
index 500497e3c72d..000000000000
--- a/arch/ppc/boot/Makefile
+++ /dev/null
@@ -1,37 +0,0 @@
1#
2# arch/ppc/boot/Makefile
3#
4# This file is included by the global makefile so that you can add your own
5# architecture-specific flags and dependencies.
6#
7# This file is subject to the terms and conditions of the GNU General Public
8# License. See the file "COPYING" in the main directory of this archive
9# for more details.
10#
11# Copyright (C) 1994 by Linus Torvalds
12# Adapted for PowerPC by Gary Thomas
13# modified by Cort (cort@cs.nmt.edu)
14#
15
16# KBUILD_CFLAGS used when building rest of boot (takes effect recursively)
17KBUILD_CFLAGS += -fno-builtin -D__BOOTER__ -Iarch/$(ARCH)/boot/include
18HOSTCFLAGS += -Iarch/$(ARCH)/boot/include
19
20BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd
21
22bootdir-y := simple
23subdir-y := lib common images
24subdir-$(CONFIG_PPC_PREP) += of1275
25
26# for cleaning
27subdir- += simple
28
29hostprogs-y := $(addprefix utils/, mkprep mkbugboot mktree)
30
31PHONY += $(BOOT_TARGETS) $(bootdir-y)
32
33$(BOOT_TARGETS): $(bootdir-y)
34
35$(bootdir-y): $(addprefix $(obj)/,$(subdir-y)) \
36 $(addprefix $(obj)/,$(hostprogs-y))
37 $(Q)$(MAKE) $(build)=$(obj)/$@ $(MAKECMDGOALS)
diff --git a/arch/ppc/boot/common/Makefile b/arch/ppc/boot/common/Makefile
deleted file mode 100644
index a2e85e3beb88..000000000000
--- a/arch/ppc/boot/common/Makefile
+++ /dev/null
@@ -1,10 +0,0 @@
1# This file is subject to the terms and conditions of the GNU General Public
2# License. See the file "COPYING" in the main directory of this archive
3# for more details.
4#
5# Tom Rini January 2001
6#
7
8lib-y := string.o util.o misc-common.o \
9 serial_stub.o bootinfo.o
10lib-$(CONFIG_SERIAL_8250_CONSOLE) += ns16550.o
diff --git a/arch/ppc/boot/common/bootinfo.c b/arch/ppc/boot/common/bootinfo.c
deleted file mode 100644
index f4dc9b9fab9c..000000000000
--- a/arch/ppc/boot/common/bootinfo.c
+++ /dev/null
@@ -1,68 +0,0 @@
1/*
2 * General bootinfo record utilities
3 * Author: Randy Vinson <rvinson@mvista.com>
4 *
5 * 2002 (c) MontaVista Software, Inc. This file is licensed under the terms
6 * of the GNU General Public License version 2. This program is licensed
7 * "as is" without any warranty of any kind, whether express or implied.
8 */
9
10#include <linux/types.h>
11#include <linux/string.h>
12#include <asm/bootinfo.h>
13
14#include "nonstdio.h"
15
16static struct bi_record * birec = NULL;
17
18static struct bi_record *
19__bootinfo_build(struct bi_record *rec, unsigned long tag, unsigned long size,
20 void *data)
21{
22 /* set the tag */
23 rec->tag = tag;
24
25 /* if the caller has any data, copy it */
26 if (size)
27 memcpy(rec->data, (char *)data, size);
28
29 /* set the record size */
30 rec->size = sizeof(struct bi_record) + size;
31
32 /* advance to the next available space */
33 rec = (struct bi_record *)((unsigned long)rec + rec->size);
34
35 return rec;
36}
37
38void
39bootinfo_init(struct bi_record *rec)
40{
41
42 /* save start of birec area */
43 birec = rec;
44
45 /* create an empty list */
46 rec = __bootinfo_build(rec, BI_FIRST, 0, NULL);
47 (void) __bootinfo_build(rec, BI_LAST, 0, NULL);
48
49}
50
51void
52bootinfo_append(unsigned long tag, unsigned long size, void * data)
53{
54
55 struct bi_record *rec = birec;
56
57 /* paranoia */
58 if ((rec == NULL) || (rec->tag != BI_FIRST))
59 return;
60
61 /* find the last entry in the list */
62 while (rec->tag != BI_LAST)
63 rec = (struct bi_record *)((ulong)rec + rec->size);
64
65 /* overlay BI_LAST record with new one and tag on a new BI_LAST */
66 rec = __bootinfo_build(rec, tag, size, data);
67 (void) __bootinfo_build(rec, BI_LAST, 0, NULL);
68}
diff --git a/arch/ppc/boot/common/crt0.S b/arch/ppc/boot/common/crt0.S
deleted file mode 100644
index 8f0ef04b8de5..000000000000
--- a/arch/ppc/boot/common/crt0.S
+++ /dev/null
@@ -1,80 +0,0 @@
1/* Copyright (c) 1997 Paul Mackerras <paulus@cs.anu.edu.au>
2 * Initial Power Macintosh COFF version.
3 * Copyright (c) 1999 Grant Erickson <grant@lcse.umn.edu>
4 * Modifications for IBM PowerPC 400-class processor evaluation
5 * boards.
6 *
7 * Module name: crt0.S
8 *
9 * Description:
10 * Boot loader execution entry point. Clears out .bss section as per
11 * ANSI C requirements. Invalidates and flushes the caches over the
12 * range covered by the boot loader's .text section. Sets up a stack
13 * below the .text section entry point.
14 *
15 * This program is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public License
17 * as published by the Free Software Foundation; either version
18 * 2 of the License, or (at your option) any later version.
19 */
20
21#include <asm/ppc_asm.h>
22
23 .text
24
25 .globl _start
26_start:
27#ifdef XCOFF
28 .long __start,0,0
29
30 .globl __start
31__start:
32#endif
33
34 ## Flush and invalidate the caches for the range in memory covering
35 ## the .text section of the boot loader
36
37 lis r9,_start@h # r9 = &_start
38 lis r8,_etext@ha #
39 addi r8,r8,_etext@l # r8 = &_etext
403: dcbf r0,r9 # Flush the data cache
41 icbi r0,r9 # Invalidate the instruction cache
42 addi r9,r9,0x10 # Increment by one cache line
43 cmplw cr0,r9,r8 # Are we at the end yet?
44 blt 3b # No, keep flushing and invalidating
45 sync # sync ; isync after flushing the icache
46 isync
47
48 ## Clear out the BSS as per ANSI C requirements
49
50 lis r7,_end@ha
51 addi r7,r7,_end@l # r7 = &_end
52 lis r8,__bss_start@ha #
53 addi r8,r8,__bss_start@l # r8 = &_bss_start
54
55 ## Determine how large an area, in number of words, to clear
56
57 subf r7,r8,r7 # r7 = &_end - &_bss_start + 1
58 addi r7,r7,3 # r7 += 3
59 srwi. r7,r7,2 # r7 = size in words.
60 beq 2f # If the size is zero, do not bother
61 addi r8,r8,-4 # r8 -= 4
62 mtctr r7 # SPRN_CTR = number of words to clear
63 li r0,0 # r0 = 0
641: stwu r0,4(r8) # Clear out a word
65 bdnz 1b # If we are not done yet, keep clearing
662:
67
68#ifdef CONFIG_40x
69 ## Set up the stack
70
71 lis r9,_start@h # r9 = &_start (text section entry)
72 ori r9,r9,_start@l
73 subi r1,r9,64 # Start the stack 64 bytes below _start
74 clrrwi r1,r1,4 # Make sure it is aligned on 16 bytes.
75 li r0,0
76 stwu r0,-16(r1)
77 mtlr r9
78#endif
79
80 b start # All done, start the real work.
diff --git a/arch/ppc/boot/common/misc-common.c b/arch/ppc/boot/common/misc-common.c
deleted file mode 100644
index 9589969cec72..000000000000
--- a/arch/ppc/boot/common/misc-common.c
+++ /dev/null
@@ -1,555 +0,0 @@
1/*
2 * Misc. bootloader code (almost) all platforms can use
3 *
4 * Author: Johnnie Peters <jpeters@mvista.com>
5 * Editor: Tom Rini <trini@mvista.com>
6 *
7 * Derived from arch/ppc/boot/prep/misc.c
8 *
9 * 2000-2001 (c) MontaVista, Software, Inc. This file is licensed under
10 * the terms of the GNU General Public License version 2. This program
11 * is licensed "as is" without any warranty of any kind, whether express
12 * or implied.
13 */
14
15#include <stdarg.h> /* for va_ bits */
16#include <linux/string.h>
17#include <linux/zlib.h>
18#include "nonstdio.h"
19
20/* If we're on a PReP, assume we have a keyboard controller
21 * Also note, if we're not PReP, we assume you are a serial
22 * console - Tom */
23#if defined(CONFIG_PPC_PREP) && defined(CONFIG_VGA_CONSOLE)
24extern void cursor(int x, int y);
25extern void scroll(void);
26extern char *vidmem;
27extern int lines, cols;
28extern int orig_x, orig_y;
29extern int keyb_present;
30extern int CRT_tstc(void);
31extern int CRT_getc(void);
32#else
33int cursor(int x, int y) {return 0;}
34void scroll(void) {}
35char vidmem[1];
36#define lines 0
37#define cols 0
38int orig_x = 0;
39int orig_y = 0;
40#define keyb_present 0
41int CRT_tstc(void) {return 0;}
42int CRT_getc(void) {return 0;}
43#endif
44
45extern char *avail_ram;
46extern char *end_avail;
47extern char _end[];
48
49void puts(const char *);
50void putc(const char c);
51void puthex(unsigned long val);
52void gunzip(void *, int, unsigned char *, int *);
53static int _cvt(unsigned long val, char *buf, long radix, char *digits);
54
55void _vprintk(void(*putc)(const char), const char *fmt0, va_list ap);
56unsigned char *ISA_io = NULL;
57
58#if defined(CONFIG_SERIAL_CPM_CONSOLE) || defined(CONFIG_SERIAL_8250_CONSOLE) \
59 || defined(CONFIG_SERIAL_MPC52xx_CONSOLE) \
60 || defined(CONFIG_SERIAL_MPSC_CONSOLE) \
61 || defined(CONFIG_SERIAL_UARTLITE_CONSOLE)
62extern unsigned long com_port;
63
64extern int serial_tstc(unsigned long com_port);
65extern unsigned char serial_getc(unsigned long com_port);
66extern void serial_putc(unsigned long com_port, unsigned char c);
67#endif
68
69void pause(void)
70{
71 puts("pause\n");
72}
73
74void exit(void)
75{
76 puts("exit\n");
77 while(1);
78}
79
80int tstc(void)
81{
82#if defined(CONFIG_SERIAL_CPM_CONSOLE) || defined(CONFIG_SERIAL_8250_CONSOLE) \
83 || defined(CONFIG_SERIAL_MPC52xx_CONSOLE) \
84 || defined(CONFIG_SERIAL_MPSC_CONSOLE) \
85 || defined(CONFIG_SERIAL_UARTLITE_CONSOLE)
86 if(keyb_present)
87 return (CRT_tstc() || serial_tstc(com_port));
88 else
89 return (serial_tstc(com_port));
90#else
91 return CRT_tstc();
92#endif
93}
94
95int getc(void)
96{
97 while (1) {
98#if defined(CONFIG_SERIAL_CPM_CONSOLE) || defined(CONFIG_SERIAL_8250_CONSOLE) \
99 || defined(CONFIG_SERIAL_MPC52xx_CONSOLE) \
100 || defined(CONFIG_SERIAL_MPSC_CONSOLE) \
101 || defined(CONFIG_SERIAL_UARTLITE_CONSOLE)
102 if (serial_tstc(com_port))
103 return (serial_getc(com_port));
104#endif /* serial console */
105 if (keyb_present)
106 if(CRT_tstc())
107 return (CRT_getc());
108 }
109}
110
111void
112putc(const char c)
113{
114 int x,y;
115
116#if defined(CONFIG_SERIAL_CPM_CONSOLE) || defined(CONFIG_SERIAL_8250_CONSOLE) \
117 || defined(CONFIG_SERIAL_MPC52xx_CONSOLE) \
118 || defined(CONFIG_SERIAL_MPSC_CONSOLE) \
119 || defined(CONFIG_SERIAL_UARTLITE_CONSOLE)
120 serial_putc(com_port, c);
121 if ( c == '\n' )
122 serial_putc(com_port, '\r');
123#endif /* serial console */
124
125 x = orig_x;
126 y = orig_y;
127
128 if ( c == '\n' ) {
129 x = 0;
130 if ( ++y >= lines ) {
131 scroll();
132 y--;
133 }
134 } else if (c == '\r') {
135 x = 0;
136 } else if (c == '\b') {
137 if (x > 0) {
138 x--;
139 }
140 } else {
141 vidmem [ ( x + cols * y ) * 2 ] = c;
142 if ( ++x >= cols ) {
143 x = 0;
144 if ( ++y >= lines ) {
145 scroll();
146 y--;
147 }
148 }
149 }
150
151 cursor(x, y);
152
153 orig_x = x;
154 orig_y = y;
155}
156
157void puts(const char *s)
158{
159 int x,y;
160 char c;
161
162 x = orig_x;
163 y = orig_y;
164
165 while ( ( c = *s++ ) != '\0' ) {
166#if defined(CONFIG_SERIAL_CPM_CONSOLE) || defined(CONFIG_SERIAL_8250_CONSOLE) \
167 || defined(CONFIG_SERIAL_MPC52xx_CONSOLE) \
168 || defined(CONFIG_SERIAL_MPSC_CONSOLE) \
169 || defined(CONFIG_SERIAL_UARTLITE_CONSOLE)
170 serial_putc(com_port, c);
171 if ( c == '\n' ) serial_putc(com_port, '\r');
172#endif /* serial console */
173
174 if ( c == '\n' ) {
175 x = 0;
176 if ( ++y >= lines ) {
177 scroll();
178 y--;
179 }
180 } else if (c == '\b') {
181 if (x > 0) {
182 x--;
183 }
184 } else {
185 vidmem [ ( x + cols * y ) * 2 ] = c;
186 if ( ++x >= cols ) {
187 x = 0;
188 if ( ++y >= lines ) {
189 scroll();
190 y--;
191 }
192 }
193 }
194 }
195
196 cursor(x, y);
197
198 orig_x = x;
199 orig_y = y;
200}
201
202void error(char *x)
203{
204 puts("\n\n");
205 puts(x);
206 puts("\n\n -- System halted");
207
208 while(1); /* Halt */
209}
210
211static void *zalloc(unsigned size)
212{
213 void *p = avail_ram;
214
215 size = (size + 7) & -8;
216 avail_ram += size;
217 if (avail_ram > end_avail) {
218 puts("oops... out of memory\n");
219 pause();
220 }
221 return p;
222}
223
224#define HEAD_CRC 2
225#define EXTRA_FIELD 4
226#define ORIG_NAME 8
227#define COMMENT 0x10
228#define RESERVED 0xe0
229
230void gunzip(void *dst, int dstlen, unsigned char *src, int *lenp)
231{
232 z_stream s;
233 int r, i, flags;
234
235 /* skip header */
236 i = 10;
237 flags = src[3];
238 if (src[2] != Z_DEFLATED || (flags & RESERVED) != 0) {
239 puts("bad gzipped data\n");
240 exit();
241 }
242 if ((flags & EXTRA_FIELD) != 0)
243 i = 12 + src[10] + (src[11] << 8);
244 if ((flags & ORIG_NAME) != 0)
245 while (src[i++] != 0)
246 ;
247 if ((flags & COMMENT) != 0)
248 while (src[i++] != 0)
249 ;
250 if ((flags & HEAD_CRC) != 0)
251 i += 2;
252 if (i >= *lenp) {
253 puts("gunzip: ran out of data in header\n");
254 exit();
255 }
256
257 /* Initialize ourself. */
258 s.workspace = zalloc(zlib_inflate_workspacesize());
259 r = zlib_inflateInit2(&s, -MAX_WBITS);
260 if (r != Z_OK) {
261 puts("zlib_inflateInit2 returned "); puthex(r); puts("\n");
262 exit();
263 }
264 s.next_in = src + i;
265 s.avail_in = *lenp - i;
266 s.next_out = dst;
267 s.avail_out = dstlen;
268 r = zlib_inflate(&s, Z_FINISH);
269 if (r != Z_OK && r != Z_STREAM_END) {
270 puts("inflate returned "); puthex(r); puts("\n");
271 exit();
272 }
273 *lenp = s.next_out - (unsigned char *) dst;
274 zlib_inflateEnd(&s);
275}
276
277void
278puthex(unsigned long val)
279{
280
281 unsigned char buf[10];
282 int i;
283 for (i = 7; i >= 0; i--)
284 {
285 buf[i] = "0123456789ABCDEF"[val & 0x0F];
286 val >>= 4;
287 }
288 buf[8] = '\0';
289 puts(buf);
290}
291
292#define FALSE 0
293#define TRUE 1
294
295void
296_printk(char const *fmt, ...)
297{
298 va_list ap;
299
300 va_start(ap, fmt);
301 _vprintk(putc, fmt, ap);
302 va_end(ap);
303 return;
304}
305
306#define is_digit(c) ((c >= '0') && (c <= '9'))
307
308void
309_vprintk(void(*putc)(const char), const char *fmt0, va_list ap)
310{
311 char c, sign, *cp = 0;
312 int left_prec, right_prec, zero_fill, length = 0, pad, pad_on_right;
313 char buf[32];
314 long val;
315 while ((c = *fmt0++))
316 {
317 if (c == '%')
318 {
319 c = *fmt0++;
320 left_prec = right_prec = pad_on_right = 0;
321 if (c == '-')
322 {
323 c = *fmt0++;
324 pad_on_right++;
325 }
326 if (c == '0')
327 {
328 zero_fill = TRUE;
329 c = *fmt0++;
330 } else
331 {
332 zero_fill = FALSE;
333 }
334 while (is_digit(c))
335 {
336 left_prec = (left_prec * 10) + (c - '0');
337 c = *fmt0++;
338 }
339 if (c == '.')
340 {
341 c = *fmt0++;
342 zero_fill++;
343 while (is_digit(c))
344 {
345 right_prec = (right_prec * 10) + (c - '0');
346 c = *fmt0++;
347 }
348 } else
349 {
350 right_prec = left_prec;
351 }
352 sign = '\0';
353 switch (c)
354 {
355 case 'd':
356 case 'x':
357 case 'X':
358 val = va_arg(ap, long);
359 switch (c)
360 {
361 case 'd':
362 if (val < 0)
363 {
364 sign = '-';
365 val = -val;
366 }
367 length = _cvt(val, buf, 10, "0123456789");
368 break;
369 case 'x':
370 length = _cvt(val, buf, 16, "0123456789abcdef");
371 break;
372 case 'X':
373 length = _cvt(val, buf, 16, "0123456789ABCDEF");
374 break;
375 }
376 cp = buf;
377 break;
378 case 's':
379 cp = va_arg(ap, char *);
380 length = strlen(cp);
381 break;
382 case 'c':
383 c = va_arg(ap, long /*char*/);
384 (*putc)(c);
385 continue;
386 default:
387 (*putc)('?');
388 }
389 pad = left_prec - length;
390 if (sign != '\0')
391 {
392 pad--;
393 }
394 if (zero_fill)
395 {
396 c = '0';
397 if (sign != '\0')
398 {
399 (*putc)(sign);
400 sign = '\0';
401 }
402 } else
403 {
404 c = ' ';
405 }
406 if (!pad_on_right)
407 {
408 while (pad-- > 0)
409 {
410 (*putc)(c);
411 }
412 }
413 if (sign != '\0')
414 {
415 (*putc)(sign);
416 }
417 while (length-- > 0)
418 {
419 (*putc)(c = *cp++);
420 if (c == '\n')
421 {
422 (*putc)('\r');
423 }
424 }
425 if (pad_on_right)
426 {
427 while (pad-- > 0)
428 {
429 (*putc)(c);
430 }
431 }
432 } else
433 {
434 (*putc)(c);
435 if (c == '\n')
436 {
437 (*putc)('\r');
438 }
439 }
440 }
441}
442
443int
444_cvt(unsigned long val, char *buf, long radix, char *digits)
445{
446 char temp[80];
447 char *cp = temp;
448 int length = 0;
449 if (val == 0)
450 { /* Special case */
451 *cp++ = '0';
452 } else
453 while (val)
454 {
455 *cp++ = digits[val % radix];
456 val /= radix;
457 }
458 while (cp != temp)
459 {
460 *buf++ = *--cp;
461 length++;
462 }
463 *buf = '\0';
464 return (length);
465}
466
467void
468_dump_buf_with_offset(unsigned char *p, int s, unsigned char *base)
469{
470 int i, c;
471 if ((unsigned int)s > (unsigned int)p)
472 {
473 s = (unsigned int)s - (unsigned int)p;
474 }
475 while (s > 0)
476 {
477 if (base)
478 {
479 _printk("%06X: ", (int)p - (int)base);
480 } else
481 {
482 _printk("%06X: ", p);
483 }
484 for (i = 0; i < 16; i++)
485 {
486 if (i < s)
487 {
488 _printk("%02X", p[i] & 0xFF);
489 } else
490 {
491 _printk(" ");
492 }
493 if ((i % 2) == 1) _printk(" ");
494 if ((i % 8) == 7) _printk(" ");
495 }
496 _printk(" |");
497 for (i = 0; i < 16; i++)
498 {
499 if (i < s)
500 {
501 c = p[i] & 0xFF;
502 if ((c < 0x20) || (c >= 0x7F)) c = '.';
503 } else
504 {
505 c = ' ';
506 }
507 _printk("%c", c);
508 }
509 _printk("|\n");
510 s -= 16;
511 p += 16;
512 }
513}
514
515void
516_dump_buf(unsigned char *p, int s)
517{
518 _printk("\n");
519 _dump_buf_with_offset(p, s, 0);
520}
521
522/* Very simple inb/outb routines. We declare ISA_io to be 0 above, and
523 * then modify it on platforms which need to. We do it like this
524 * because on some platforms we give inb/outb an exact location, and
525 * on others it's an offset from a given location. -- Tom
526 */
527
528void ISA_init(unsigned long base)
529{
530 ISA_io = (unsigned char *)base;
531}
532
533void
534outb(int port, unsigned char val)
535{
536 /* Ensure I/O operations complete */
537 __asm__ volatile("eieio");
538 ISA_io[port] = val;
539}
540
541unsigned char
542inb(int port)
543{
544 /* Ensure I/O operations complete */
545 __asm__ volatile("eieio");
546 return (ISA_io[port]);
547}
548
549/*
550 * Local variables:
551 * c-indent-level: 8
552 * c-basic-offset: 8
553 * tab-width: 8
554 * End:
555 */
diff --git a/arch/ppc/boot/common/ns16550.c b/arch/ppc/boot/common/ns16550.c
deleted file mode 100644
index fc5b72041948..000000000000
--- a/arch/ppc/boot/common/ns16550.c
+++ /dev/null
@@ -1,103 +0,0 @@
1/*
2 * COM1 NS16550 support
3 */
4
5#include <linux/types.h>
6#include <linux/serial.h>
7#include <linux/serial_reg.h>
8#include <asm/serial.h>
9
10#if defined(CONFIG_XILINX_VIRTEX)
11#include <platforms/4xx/xparameters/xparameters.h>
12#endif
13#include "nonstdio.h"
14#include "serial.h"
15
16#define SERIAL_BAUD 9600
17
18extern unsigned long ISA_io;
19
20static struct serial_state rs_table[RS_TABLE_SIZE] = {
21 SERIAL_PORT_DFNS /* Defined in <asm/serial.h> */
22};
23
24static int shift;
25
26unsigned long serial_init(int chan, void *ignored)
27{
28 unsigned long com_port, base_baud;
29 unsigned char lcr, dlm;
30
31 /* We need to find out which type io we're expecting. If it's
32 * 'SERIAL_IO_PORT', we get an offset from the isa_io_base.
33 * If it's 'SERIAL_IO_MEM', we can the exact location. -- Tom */
34 switch (rs_table[chan].io_type) {
35 case SERIAL_IO_PORT:
36 com_port = rs_table[chan].port;
37 break;
38 case SERIAL_IO_MEM:
39 com_port = (unsigned long)rs_table[chan].iomem_base;
40 break;
41 default:
42 /* We can't deal with it. */
43 return -1;
44 }
45
46 /* How far apart the registers are. */
47 shift = rs_table[chan].iomem_reg_shift;
48 /* Base baud.. */
49 base_baud = rs_table[chan].baud_base;
50
51 /* save the LCR */
52 lcr = inb(com_port + (UART_LCR << shift));
53 /* Access baud rate */
54 outb(com_port + (UART_LCR << shift), 0x80);
55 dlm = inb(com_port + (UART_DLM << shift));
56 /*
57 * Test if serial port is unconfigured.
58 * We assume that no-one uses less than 110 baud or
59 * less than 7 bits per character these days.
60 * -- paulus.
61 */
62
63 if ((dlm <= 4) && (lcr & 2))
64 /* port is configured, put the old LCR back */
65 outb(com_port + (UART_LCR << shift), lcr);
66 else {
67 /* Input clock. */
68 outb(com_port + (UART_DLL << shift),
69 (base_baud / SERIAL_BAUD) & 0xFF);
70 outb(com_port + (UART_DLM << shift),
71 (base_baud / SERIAL_BAUD) >> 8);
72 /* 8 data, 1 stop, no parity */
73 outb(com_port + (UART_LCR << shift), 0x03);
74 /* RTS/DTR */
75 outb(com_port + (UART_MCR << shift), 0x03);
76 }
77 /* Clear & enable FIFOs */
78 outb(com_port + (UART_FCR << shift), 0x07);
79
80 return (com_port);
81}
82
83void
84serial_putc(unsigned long com_port, unsigned char c)
85{
86 while ((inb(com_port + (UART_LSR << shift)) & UART_LSR_THRE) == 0)
87 ;
88 outb(com_port, c);
89}
90
91unsigned char
92serial_getc(unsigned long com_port)
93{
94 while ((inb(com_port + (UART_LSR << shift)) & UART_LSR_DR) == 0)
95 ;
96 return inb(com_port);
97}
98
99int
100serial_tstc(unsigned long com_port)
101{
102 return ((inb(com_port + (UART_LSR << shift)) & UART_LSR_DR) != 0);
103}
diff --git a/arch/ppc/boot/common/serial_stub.c b/arch/ppc/boot/common/serial_stub.c
deleted file mode 100644
index 5cc9ae66a8ba..000000000000
--- a/arch/ppc/boot/common/serial_stub.c
+++ /dev/null
@@ -1,21 +0,0 @@
1/*
2 * This is a few stub routines to make the boot code cleaner looking when
3 * there is no serial port support doesn't need to be closed, for example.
4 *
5 * Author: Tom Rini <trini@mvista.com>
6 *
7 * 2003 (c) MontaVista, Software, Inc. This file is licensed under the terms
8 * of the GNU General Public License version 2. This program is licensed "as
9 * is" without any warranty of any kind, whether express or implied.
10 */
11
12unsigned long __attribute__ ((weak))
13serial_init(int chan, void *ignored)
14{
15 return 0;
16}
17
18void __attribute__ ((weak))
19serial_close(unsigned long com_port)
20{
21}
diff --git a/arch/ppc/boot/common/string.S b/arch/ppc/boot/common/string.S
deleted file mode 100644
index 8016e43c4771..000000000000
--- a/arch/ppc/boot/common/string.S
+++ /dev/null
@@ -1,150 +0,0 @@
1/*
2 * String handling functions for PowerPC.
3 *
4 * Copyright (C) 1996 Paul Mackerras.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 */
11#define r0 0
12#define r3 3
13#define r4 4
14#define r5 5
15#define r6 6
16#define r7 7
17#define r8 8
18
19 .globl strlen
20strlen:
21 addi r4,r3,-1
221: lbzu r0,1(r4)
23 cmpwi 0,r0,0
24 bne 1b
25 subf r3,r3,r4
26 blr
27
28 .globl memset
29memset:
30 rlwimi r4,r4,8,16,23
31 rlwimi r4,r4,16,0,15
32 addi r6,r3,-4
33 cmplwi 0,r5,4
34 blt 7f
35 stwu r4,4(r6)
36 beqlr
37 andi. r0,r6,3
38 add r5,r0,r5
39 subf r6,r0,r6
40 rlwinm r0,r5,32-2,2,31
41 mtctr r0
42 bdz 6f
431: stwu r4,4(r6)
44 bdnz 1b
456: andi. r5,r5,3
467: cmpwi 0,r5,0
47 beqlr
48 mtctr r5
49 addi r6,r6,3
508: stbu r4,1(r6)
51 bdnz 8b
52 blr
53
54 .globl memmove
55memmove:
56 cmplw 0,r3,r4
57 bgt backwards_memcpy
58 /* fall through */
59
60 .globl memcpy
61memcpy:
62 rlwinm. r7,r5,32-3,3,31 /* r0 = r5 >> 3 */
63 addi r6,r3,-4
64 addi r4,r4,-4
65 beq 2f /* if less than 8 bytes to do */
66 andi. r0,r6,3 /* get dest word aligned */
67 mtctr r7
68 bne 5f
691: lwz r7,4(r4)
70 lwzu r8,8(r4)
71 stw r7,4(r6)
72 stwu r8,8(r6)
73 bdnz 1b
74 andi. r5,r5,7
752: cmplwi 0,r5,4
76 blt 3f
77 lwzu r0,4(r4)
78 addi r5,r5,-4
79 stwu r0,4(r6)
803: cmpwi 0,r5,0
81 beqlr
82 mtctr r5
83 addi r4,r4,3
84 addi r6,r6,3
854: lbzu r0,1(r4)
86 stbu r0,1(r6)
87 bdnz 4b
88 blr
895: subfic r0,r0,4
90 mtctr r0
916: lbz r7,4(r4)
92 addi r4,r4,1
93 stb r7,4(r6)
94 addi r6,r6,1
95 bdnz 6b
96 subf r5,r0,r5
97 rlwinm. r7,r5,32-3,3,31
98 beq 2b
99 mtctr r7
100 b 1b
101
102 .globl backwards_memcpy
103backwards_memcpy:
104 rlwinm. r7,r5,32-3,3,31 /* r0 = r5 >> 3 */
105 add r6,r3,r5
106 add r4,r4,r5
107 beq 2f
108 andi. r0,r6,3
109 mtctr r7
110 bne 5f
1111: lwz r7,-4(r4)
112 lwzu r8,-8(r4)
113 stw r7,-4(r6)
114 stwu r8,-8(r6)
115 bdnz 1b
116 andi. r5,r5,7
1172: cmplwi 0,r5,4
118 blt 3f
119 lwzu r0,-4(r4)
120 subi r5,r5,4
121 stwu r0,-4(r6)
1223: cmpwi 0,r5,0
123 beqlr
124 mtctr r5
1254: lbzu r0,-1(r4)
126 stbu r0,-1(r6)
127 bdnz 4b
128 blr
1295: mtctr r0
1306: lbzu r7,-1(r4)
131 stbu r7,-1(r6)
132 bdnz 6b
133 subf r5,r0,r5
134 rlwinm. r7,r5,32-3,3,31
135 beq 2b
136 mtctr r7
137 b 1b
138
139 .globl memcmp
140memcmp:
141 cmpwi 0,r5,0
142 blelr
143 mtctr r5
144 addi r6,r3,-1
145 addi r4,r4,-1
1461: lbzu r3,1(r6)
147 lbzu r0,1(r4)
148 subf. r3,r0,r3
149 bdnzt 2,1b
150 blr
diff --git a/arch/ppc/boot/common/util.S b/arch/ppc/boot/common/util.S
deleted file mode 100644
index 0c5e43c4ae06..000000000000
--- a/arch/ppc/boot/common/util.S
+++ /dev/null
@@ -1,293 +0,0 @@
1/*
2 * Useful bootup functions, which are more easily done in asm than C.
3 *
4 * NOTE: Be very very careful about the registers you use here.
5 * We don't follow any ABI calling convention among the
6 * assembler functions that call each other, especially early
7 * in the initialization. Please preserve at least r3 and r4
8 * for these early functions, as they often contain information
9 * passed from boot roms into the C decompress function.
10 *
11 * Author: Tom Rini
12 * trini@mvista.com
13 * Derived from arch/ppc/boot/prep/head.S (Cort Dougan, many others).
14 *
15 * 2001-2004 (c) MontaVista, Software, Inc. This file is licensed under
16 * the terms of the GNU General Public License version 2. This program
17 * is licensed "as is" without any warranty of any kind, whether express
18 * or implied.
19 */
20
21#include <asm/processor.h>
22#include <asm/cache.h>
23#include <asm/ppc_asm.h>
24
25
26 .text
27
28#ifdef CONFIG_6xx
29 .globl disable_6xx_mmu
30disable_6xx_mmu:
31 /* Establish default MSR value, exception prefix 0xFFF.
32 * If necessary, this function must fix up the LR if we
33 * return to a different address space once the MMU is
34 * disabled.
35 */
36 li r8,MSR_IP|MSR_FP
37 mtmsr r8
38 isync
39
40 /* Test for a 601 */
41 mfpvr r10
42 srwi r10,r10,16
43 cmpwi 0,r10,1 /* 601 ? */
44 beq .clearbats_601
45
46 /* Clear BATs */
47 li r8,0
48 mtspr SPRN_DBAT0U,r8
49 mtspr SPRN_DBAT0L,r8
50 mtspr SPRN_DBAT1U,r8
51 mtspr SPRN_DBAT1L,r8
52 mtspr SPRN_DBAT2U,r8
53 mtspr SPRN_DBAT2L,r8
54 mtspr SPRN_DBAT3U,r8
55 mtspr SPRN_DBAT3L,r8
56.clearbats_601:
57 mtspr SPRN_IBAT0U,r8
58 mtspr SPRN_IBAT0L,r8
59 mtspr SPRN_IBAT1U,r8
60 mtspr SPRN_IBAT1L,r8
61 mtspr SPRN_IBAT2U,r8
62 mtspr SPRN_IBAT2L,r8
63 mtspr SPRN_IBAT3U,r8
64 mtspr SPRN_IBAT3L,r8
65 isync
66 sync
67 sync
68
69 /* Set segment registers */
70 li r8,16 /* load up segment register values */
71 mtctr r8 /* for context 0 */
72 lis r8,0x2000 /* Ku = 1, VSID = 0 */
73 li r10,0
743: mtsrin r8,r10
75 addi r8,r8,0x111 /* increment VSID */
76 addis r10,r10,0x1000 /* address of next segment */
77 bdnz 3b
78 blr
79
80 .globl disable_6xx_l1cache
81disable_6xx_l1cache:
82 /* Enable, invalidate and then disable the L1 icache/dcache. */
83 li r8,0
84 ori r8,r8,(HID0_ICE|HID0_DCE|HID0_ICFI|HID0_DCI)
85 mfspr r11,SPRN_HID0
86 or r11,r11,r8
87 andc r10,r11,r8
88 isync
89 mtspr SPRN_HID0,r8
90 sync
91 isync
92 mtspr SPRN_HID0,r10
93 sync
94 isync
95 blr
96#endif
97
98 .globl _setup_L2CR
99_setup_L2CR:
100/*
101 * We should be skipping this section on CPUs where this results in an
102 * illegal instruction. If not, please send trini@kernel.crashing.org
103 * the PVR of your CPU.
104 */
105 /* Invalidate/disable L2 cache */
106 sync
107 isync
108 mfspr r8,SPRN_L2CR
109 rlwinm r8,r8,0,1,31
110 oris r8,r8,L2CR_L2I@h
111 sync
112 isync
113 mtspr SPRN_L2CR,r8
114 sync
115 isync
116
117 /* Wait for the invalidation to complete */
118 mfspr r8,SPRN_PVR
119 srwi r8,r8,16
120 cmplwi cr0,r8,0x8000 /* 7450 */
121 cmplwi cr1,r8,0x8001 /* 7455 */
122 cmplwi cr2,r8,0x8002 /* 7457 */
123 cror 4*cr0+eq,4*cr0+eq,4*cr1+eq /* Now test if any are true. */
124 cror 4*cr0+eq,4*cr0+eq,4*cr2+eq
125 bne 2f
126
1271: mfspr r8,SPRN_L2CR /* On 745x, poll L2I bit (bit 10) */
128 rlwinm. r9,r8,0,10,10
129 bne 1b
130 b 3f
131
1322: mfspr r8,SPRN_L2CR /* On 75x & 74[01]0, poll L2IP bit (bit 31) */
133 rlwinm. r9,r8,0,31,31
134 bne 2b
135
1363: rlwinm r8,r8,0,11,9 /* Turn off L2I bit */
137 sync
138 isync
139 mtspr SPRN_L2CR,r8
140 sync
141 isync
142 blr
143
144 .globl _setup_L3CR
145_setup_L3CR:
146 /* Invalidate/disable L3 cache */
147 sync
148 isync
149 mfspr r8,SPRN_L3CR
150 rlwinm r8,r8,0,1,31
151 ori r8,r8,L3CR_L3I@l
152 sync
153 isync
154 mtspr SPRN_L3CR,r8
155 sync
156 isync
157
158 /* Wait for the invalidation to complete */
1591: mfspr r8,SPRN_L3CR
160 rlwinm. r9,r8,0,21,21
161 bne 1b
162
163 rlwinm r8,r8,0,22,20 /* Turn off L3I bit */
164 sync
165 isync
166 mtspr SPRN_L3CR,r8
167 sync
168 isync
169 blr
170
171
172/* udelay (on non-601 processors) needs to know the period of the
173 * timebase in nanoseconds. This used to be hardcoded to be 60ns
174 * (period of 66MHz/4). Now a variable is used that is initialized to
175 * 60 for backward compatibility, but it can be overridden as necessary
176 * with code something like this:
177 * extern unsigned long timebase_period_ns;
178 * timebase_period_ns = 1000000000 / bd->bi_tbfreq;
179 */
180 .data
181 .globl timebase_period_ns
182timebase_period_ns:
183 .long 60
184
185 .text
186/*
187 * Delay for a number of microseconds
188 */
189 .globl udelay
190udelay:
191 mfspr r4,SPRN_PVR
192 srwi r4,r4,16
193 cmpwi 0,r4,1 /* 601 ? */
194 bne .udelay_not_601
19500: li r0,86 /* Instructions / microsecond? */
196 mtctr r0
19710: addi r0,r0,0 /* NOP */
198 bdnz 10b
199 subic. r3,r3,1
200 bne 00b
201 blr
202
203.udelay_not_601:
204 mulli r4,r3,1000 /* nanoseconds */
205 /* Change r4 to be the number of ticks using:
206 * (nanoseconds + (timebase_period_ns - 1 )) / timebase_period_ns
207 * timebase_period_ns defaults to 60 (16.6MHz) */
208 lis r5,timebase_period_ns@ha
209 lwz r5,timebase_period_ns@l(r5)
210 add r4,r4,r5
211 addi r4,r4,-1
212 divw r4,r4,r5 /* BUS ticks */
2131: mftbu r5
214 mftb r6
215 mftbu r7
216 cmpw 0,r5,r7
217 bne 1b /* Get [synced] base time */
218 addc r9,r6,r4 /* Compute end time */
219 addze r8,r5
2202: mftbu r5
221 cmpw 0,r5,r8
222 blt 2b
223 bgt 3f
224 mftb r6
225 cmpw 0,r6,r9
226 blt 2b
2273: blr
228
229 .section ".relocate_code","xa"
230/*
231 * Flush and enable instruction cache
232 * First, flush the data cache in case it was enabled and may be
233 * holding instructions for copy back.
234 */
235 .globl flush_instruction_cache
236flush_instruction_cache:
237 mflr r6
238 bl flush_data_cache
239
240#ifdef CONFIG_8xx
241 lis r3, IDC_INVALL@h
242 mtspr SPRN_IC_CST, r3
243 lis r3, IDC_ENABLE@h
244 mtspr SPRN_IC_CST, r3
245 lis r3, IDC_DISABLE@h
246 mtspr SPRN_DC_CST, r3
247#elif CONFIG_4xx
248 lis r3,start@h # r9 = &_start
249 lis r4,_etext@ha
250 addi r4,r4,_etext@l # r8 = &_etext
2511: dcbf r0,r3 # Flush the data cache
252 icbi r0,r3 # Invalidate the instruction cache
253 addi r3,r3,0x10 # Increment by one cache line
254 cmplw cr0,r3,r4 # Are we at the end yet?
255 blt 1b # No, keep flushing and invalidating
256#else
257 /* Enable, invalidate and then disable the L1 icache/dcache. */
258 li r3,0
259 ori r3,r3,(HID0_ICE|HID0_DCE|HID0_ICFI|HID0_DCI)
260 mfspr r4,SPRN_HID0
261 or r5,r4,r3
262 isync
263 mtspr SPRN_HID0,r5
264 sync
265 isync
266 ori r5,r4,HID0_ICE /* Enable cache */
267 mtspr SPRN_HID0,r5
268 sync
269 isync
270#endif
271 mtlr r6
272 blr
273
274#define NUM_CACHE_LINES 128*8
275#define cache_flush_buffer 0x1000
276
277/*
278 * Flush data cache
279 * Do this by just reading lots of stuff into the cache.
280 */
281 .globl flush_data_cache
282flush_data_cache:
283 lis r3,cache_flush_buffer@h
284 ori r3,r3,cache_flush_buffer@l
285 li r4,NUM_CACHE_LINES
286 mtctr r4
28700: lwz r4,0(r3)
288 addi r3,r3,L1_CACHE_BYTES /* Next line, please */
289 bdnz 00b
29010: blr
291
292 .previous
293
diff --git a/arch/ppc/boot/images/.gitignore b/arch/ppc/boot/images/.gitignore
deleted file mode 100644
index 21c2dc5b6b78..000000000000
--- a/arch/ppc/boot/images/.gitignore
+++ /dev/null
@@ -1,6 +0,0 @@
1sImage
2vmapus
3vmlinux*
4miboot*
5zImage*
6uImage
diff --git a/arch/ppc/boot/images/Makefile b/arch/ppc/boot/images/Makefile
deleted file mode 100644
index 58415d5718e3..000000000000
--- a/arch/ppc/boot/images/Makefile
+++ /dev/null
@@ -1,34 +0,0 @@
1#
2# This dir holds all of the images for PPC machines.
3# Tom Rini January 2001
4
5MKIMAGE := $(srctree)/scripts/mkuboot.sh
6
7extra-y := vmlinux.bin vmlinux.gz
8
9# two make processes may write to vmlinux.gz at the same time with make -j
10quiet_cmd_mygzip = GZIP $@
11cmd_mygzip = gzip -f -9 < $< > $@.$$$$ && mv $@.$$$$ $@
12
13
14OBJCOPYFLAGS_vmlinux.bin := -O binary
15$(obj)/vmlinux.bin: vmlinux FORCE
16 $(call if_changed,objcopy)
17
18$(obj)/vmlinux.gz: $(obj)/vmlinux.bin FORCE
19 $(call if_changed,mygzip)
20
21quiet_cmd_uimage = UIMAGE $@
22 cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A ppc -O linux -T kernel \
23 -C gzip -a 00000000 -e 00000000 -n 'Linux-$(KERNELRELEASE)' \
24 -d $< $@
25
26targets += uImage
27$(obj)/uImage: $(obj)/vmlinux.gz
28 $(Q)rm -f $@
29 $(call cmd,uimage)
30 @echo -n ' Image: $@ '
31 @if [ -f $@ ]; then echo 'is ready' ; else echo 'not made'; fi
32
33# Files generated that shall be removed upon make clean
34clean-files := sImage vmapus vmlinux* miboot* zImage* uImage
diff --git a/arch/ppc/boot/include/cpc700.h b/arch/ppc/boot/include/cpc700.h
deleted file mode 100644
index 28cfcde44909..000000000000
--- a/arch/ppc/boot/include/cpc700.h
+++ /dev/null
@@ -1,26 +0,0 @@
1
2#ifndef __PPC_BOOT_CPC700_H
3#define __PPC_BOOT_CPC700_H
4
5#define CPC700_MEM_CFGADDR 0xff500008
6#define CPC700_MEM_CFGDATA 0xff50000c
7
8#define CPC700_MB0SA 0x38
9#define CPC700_MB0EA 0x58
10#define CPC700_MB1SA 0x3c
11#define CPC700_MB1EA 0x5c
12#define CPC700_MB2SA 0x40
13#define CPC700_MB2EA 0x60
14#define CPC700_MB3SA 0x44
15#define CPC700_MB3EA 0x64
16#define CPC700_MB4SA 0x48
17#define CPC700_MB4EA 0x68
18
19static inline long
20cpc700_read_memreg(int reg)
21{
22 out_be32((volatile unsigned int *) CPC700_MEM_CFGADDR, reg);
23 return in_be32((volatile unsigned int *) CPC700_MEM_CFGDATA);
24}
25
26#endif
diff --git a/arch/ppc/boot/include/iso_font.h b/arch/ppc/boot/include/iso_font.h
deleted file mode 100644
index bff050e002b7..000000000000
--- a/arch/ppc/boot/include/iso_font.h
+++ /dev/null
@@ -1,257 +0,0 @@
1static const unsigned char font[] = {
2/* 0x00 */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
3/* 0x01 */ 0x00,0x00,0x7E,0x81,0xA5,0x81,0x81,0xBD,0x99,0x81,0x81,0x7E,0x00,0x00,0x00,0x00,
4/* 0x02 */ 0x00,0x00,0x7E,0xFF,0xDB,0xFF,0xFF,0xC3,0xC3,0xE7,0xFF,0x7E,0x00,0x00,0x00,0x00,
5/* 0x03 */ 0x00,0x00,0x00,0x00,0x6C,0xFE,0xFE,0xFE,0xFE,0x7C,0x38,0x10,0x00,0x00,0x00,0x00,
6/* 0x04 */ 0x00,0x00,0x00,0x00,0x10,0x38,0x7C,0xFE,0x7C,0x38,0x10,0x00,0x00,0x00,0x00,0x00,
7/* 0x05 */ 0x00,0x00,0x00,0x18,0x3C,0x3C,0xE7,0xE7,0xE7,0x18,0x18,0x3C,0x00,0x00,0x00,0x00,
8/* 0x06 */ 0x00,0x00,0x00,0x18,0x3C,0x7E,0xFF,0xFF,0x7E,0x18,0x18,0x3C,0x00,0x00,0x00,0x00,
9/* 0x07 */ 0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x3C,0x3C,0x18,0x00,0x00,0x00,0x00,0x00,0x00,
10/* 0x08 */ 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xE7,0xC3,0xC3,0xE7,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
11/* 0x09 */ 0x00,0x00,0x00,0x00,0x00,0x3C,0x66,0x42,0x42,0x66,0x3C,0x00,0x00,0x00,0x00,0x00,
12/* 0x0A */ 0xFF,0xFF,0xFF,0xFF,0xFF,0xC3,0x99,0xBD,0xBD,0x99,0xC3,0xFF,0xFF,0xFF,0xFF,0xFF,
13/* 0x0B */ 0x00,0x00,0x3E,0x0E,0x1A,0x32,0x78,0xCC,0xCC,0xCC,0xCC,0x78,0x00,0x00,0x00,0x00,
14/* 0x0C */ 0x00,0x00,0x3C,0x66,0x66,0x66,0x66,0x3C,0x18,0x7E,0x18,0x18,0x00,0x00,0x00,0x00,
15/* 0x0D */ 0x00,0x00,0x30,0x38,0x3C,0x36,0x33,0x30,0x30,0x70,0xF0,0xE0,0x00,0x00,0x00,0x00,
16/* 0x0E */ 0x00,0x00,0x7F,0x63,0x7F,0x63,0x63,0x63,0x63,0x67,0xE7,0xE6,0xC0,0x00,0x00,0x00,
17/* 0x0F */ 0x00,0x00,0x00,0x18,0x18,0xDB,0x3C,0xE7,0x3C,0xDB,0x18,0x18,0x00,0x00,0x00,0x00,
18/* 0x10 */ 0x00,0x80,0xC0,0xE0,0xF0,0xF8,0xFE,0xF8,0xF0,0xE0,0xC0,0x80,0x00,0x00,0x00,0x00,
19/* 0x11 */ 0x00,0x02,0x06,0x0E,0x1E,0x3E,0xFE,0x3E,0x1E,0x0E,0x06,0x02,0x00,0x00,0x00,0x00,
20/* 0x12 */ 0x00,0x00,0x18,0x3C,0x7E,0x18,0x18,0x18,0x7E,0x3C,0x18,0x00,0x00,0x00,0x00,0x00,
21/* 0x13 */ 0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x66,0x66,0x00,0x00,0x00,0x00,
22/* 0x14 */ 0x00,0x00,0x7F,0xDB,0xDB,0xDB,0x7B,0x1B,0x1B,0x1B,0x1B,0x1B,0x00,0x00,0x00,0x00,
23/* 0x15 */ 0x00,0x7C,0xC6,0x60,0x38,0x6C,0xC6,0xC6,0x6C,0x38,0x0C,0xC6,0x7C,0x00,0x00,0x00,
24/* 0x16 */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0xFE,0xFE,0xFE,0x00,0x00,0x00,0x00,
25/* 0x17 */ 0x00,0x00,0x18,0x3C,0x7E,0x18,0x18,0x18,0x7E,0x3C,0x18,0x7E,0x00,0x00,0x00,0x00,
26/* 0x18 */ 0x00,0x00,0x18,0x3C,0x7E,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00,
27/* 0x19 */ 0x00,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x7E,0x3C,0x18,0x00,0x00,0x00,0x00,
28/* 0x1A */ 0x00,0x00,0x00,0x00,0x00,0x18,0x0C,0xFE,0x0C,0x18,0x00,0x00,0x00,0x00,0x00,0x00,
29/* 0x1B */ 0x00,0x00,0x00,0x00,0x00,0x30,0x60,0xFE,0x60,0x30,0x00,0x00,0x00,0x00,0x00,0x00,
30/* 0x1C */ 0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xC0,0xC0,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,
31/* 0x1D */ 0x00,0x00,0x00,0x00,0x00,0x28,0x6C,0xFE,0x6C,0x28,0x00,0x00,0x00,0x00,0x00,0x00,
32/* 0x1E */ 0x00,0x00,0x00,0x00,0x10,0x38,0x38,0x7C,0x7C,0xFE,0xFE,0x00,0x00,0x00,0x00,0x00,
33/* 0x1F */ 0x00,0x00,0x00,0x00,0xFE,0xFE,0x7C,0x7C,0x38,0x38,0x10,0x00,0x00,0x00,0x00,0x00,
34/* 0x20 */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
35/* 0x21 */ 0x00,0x00,0x18,0x3C,0x3C,0x3C,0x18,0x18,0x18,0x00,0x18,0x18,0x00,0x00,0x00,0x00,
36/* 0x22 */ 0x00,0x66,0x66,0x66,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
37/* 0x23 */ 0x00,0x00,0x00,0x6C,0x6C,0xFE,0x6C,0x6C,0x6C,0xFE,0x6C,0x6C,0x00,0x00,0x00,0x00,
38/* 0x24 */ 0x18,0x18,0x7C,0xC6,0xC2,0xC0,0x7C,0x06,0x06,0x86,0xC6,0x7C,0x18,0x18,0x00,0x00,
39/* 0x25 */ 0x00,0x00,0x00,0x00,0xC2,0xC6,0x0C,0x18,0x30,0x60,0xC6,0x86,0x00,0x00,0x00,0x00,
40/* 0x26 */ 0x00,0x00,0x38,0x6C,0x6C,0x38,0x76,0xDC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00,
41/* 0x27 */ 0x00,0x30,0x30,0x30,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
42/* 0x28 */ 0x00,0x00,0x0C,0x18,0x30,0x30,0x30,0x30,0x30,0x30,0x18,0x0C,0x00,0x00,0x00,0x00,
43/* 0x29 */ 0x00,0x00,0x30,0x18,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x18,0x30,0x00,0x00,0x00,0x00,
44/* 0x2A */ 0x00,0x00,0x00,0x00,0x00,0x66,0x3C,0xFF,0x3C,0x66,0x00,0x00,0x00,0x00,0x00,0x00,
45/* 0x2B */ 0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x7E,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,
46/* 0x2C */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x18,0x30,0x00,0x00,0x00,
47/* 0x2D */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
48/* 0x2E */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,
49/* 0x2F */ 0x00,0x00,0x00,0x00,0x02,0x06,0x0C,0x18,0x30,0x60,0xC0,0x80,0x00,0x00,0x00,0x00,
50/* 0x30 */ 0x00,0x00,0x38,0x6C,0xC6,0xC6,0xD6,0xD6,0xC6,0xC6,0x6C,0x38,0x00,0x00,0x00,0x00,
51/* 0x31 */ 0x00,0x00,0x18,0x38,0x78,0x18,0x18,0x18,0x18,0x18,0x18,0x7E,0x00,0x00,0x00,0x00,
52/* 0x32 */ 0x00,0x00,0x7C,0xC6,0x06,0x0C,0x18,0x30,0x60,0xC0,0xC6,0xFE,0x00,0x00,0x00,0x00,
53/* 0x33 */ 0x00,0x00,0x7C,0xC6,0x06,0x06,0x3C,0x06,0x06,0x06,0xC6,0x7C,0x00,0x00,0x00,0x00,
54/* 0x34 */ 0x00,0x00,0x0C,0x1C,0x3C,0x6C,0xCC,0xFE,0x0C,0x0C,0x0C,0x1E,0x00,0x00,0x00,0x00,
55/* 0x35 */ 0x00,0x00,0xFE,0xC0,0xC0,0xC0,0xFC,0x06,0x06,0x06,0xC6,0x7C,0x00,0x00,0x00,0x00,
56/* 0x36 */ 0x00,0x00,0x38,0x60,0xC0,0xC0,0xFC,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00,
57/* 0x37 */ 0x00,0x00,0xFE,0xC6,0x06,0x06,0x0C,0x18,0x30,0x30,0x30,0x30,0x00,0x00,0x00,0x00,
58/* 0x38 */ 0x00,0x00,0x7C,0xC6,0xC6,0xC6,0x7C,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00,
59/* 0x39 */ 0x00,0x00,0x7C,0xC6,0xC6,0xC6,0x7E,0x06,0x06,0x06,0x0C,0x78,0x00,0x00,0x00,0x00,
60/* 0x3A */ 0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00,
61/* 0x3B */ 0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x18,0x18,0x30,0x00,0x00,0x00,0x00,
62/* 0x3C */ 0x00,0x00,0x00,0x06,0x0C,0x18,0x30,0x60,0x30,0x18,0x0C,0x06,0x00,0x00,0x00,0x00,
63/* 0x3D */ 0x00,0x00,0x00,0x00,0x00,0x7E,0x00,0x00,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
64/* 0x3E */ 0x00,0x00,0x00,0x60,0x30,0x18,0x0C,0x06,0x0C,0x18,0x30,0x60,0x00,0x00,0x00,0x00,
65/* 0x3F */ 0x00,0x00,0x7C,0xC6,0xC6,0x0C,0x18,0x18,0x18,0x00,0x18,0x18,0x00,0x00,0x00,0x00,
66/* 0x40 */ 0x00,0x00,0x00,0x7C,0xC6,0xC6,0xDE,0xDE,0xDE,0xDC,0xC0,0x7C,0x00,0x00,0x00,0x00,
67/* 0x41 */ 0x00,0x00,0x10,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00,
68/* 0x42 */ 0x00,0x00,0xFC,0x66,0x66,0x66,0x7C,0x66,0x66,0x66,0x66,0xFC,0x00,0x00,0x00,0x00,
69/* 0x43 */ 0x00,0x00,0x3C,0x66,0xC2,0xC0,0xC0,0xC0,0xC0,0xC2,0x66,0x3C,0x00,0x00,0x00,0x00,
70/* 0x44 */ 0x00,0x00,0xF8,0x6C,0x66,0x66,0x66,0x66,0x66,0x66,0x6C,0xF8,0x00,0x00,0x00,0x00,
71/* 0x45 */ 0x00,0x00,0xFE,0x66,0x62,0x68,0x78,0x68,0x60,0x62,0x66,0xFE,0x00,0x00,0x00,0x00,
72/* 0x46 */ 0x00,0x00,0xFE,0x66,0x62,0x68,0x78,0x68,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00,
73/* 0x47 */ 0x00,0x00,0x3C,0x66,0xC2,0xC0,0xC0,0xDE,0xC6,0xC6,0x66,0x3A,0x00,0x00,0x00,0x00,
74/* 0x48 */ 0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00,
75/* 0x49 */ 0x00,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00,
76/* 0x4A */ 0x00,0x00,0x1E,0x0C,0x0C,0x0C,0x0C,0x0C,0xCC,0xCC,0xCC,0x78,0x00,0x00,0x00,0x00,
77/* 0x4B */ 0x00,0x00,0xE6,0x66,0x66,0x6C,0x78,0x78,0x6C,0x66,0x66,0xE6,0x00,0x00,0x00,0x00,
78/* 0x4C */ 0x00,0x00,0xF0,0x60,0x60,0x60,0x60,0x60,0x60,0x62,0x66,0xFE,0x00,0x00,0x00,0x00,
79/* 0x4D */ 0x00,0x00,0xC6,0xEE,0xFE,0xFE,0xD6,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00,
80/* 0x4E */ 0x00,0x00,0xC6,0xE6,0xF6,0xFE,0xDE,0xCE,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00,
81/* 0x4F */ 0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00,
82/* 0x50 */ 0x00,0x00,0xFC,0x66,0x66,0x66,0x7C,0x60,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00,
83/* 0x51 */ 0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xD6,0xDE,0x7C,0x0C,0x0E,0x00,0x00,
84/* 0x52 */ 0x00,0x00,0xFC,0x66,0x66,0x66,0x7C,0x6C,0x66,0x66,0x66,0xE6,0x00,0x00,0x00,0x00,
85/* 0x53 */ 0x00,0x00,0x7C,0xC6,0xC6,0x60,0x38,0x0C,0x06,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00,
86/* 0x54 */ 0x00,0x00,0x7E,0x7E,0x5A,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00,
87/* 0x55 */ 0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00,
88/* 0x56 */ 0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x6C,0x38,0x10,0x00,0x00,0x00,0x00,
89/* 0x57 */ 0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xD6,0xD6,0xD6,0xFE,0xEE,0x6C,0x00,0x00,0x00,0x00,
90/* 0x58 */ 0x00,0x00,0xC6,0xC6,0x6C,0x7C,0x38,0x38,0x7C,0x6C,0xC6,0xC6,0x00,0x00,0x00,0x00,
91/* 0x59 */ 0x00,0x00,0x66,0x66,0x66,0x66,0x3C,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00,
92/* 0x5A */ 0x00,0x00,0xFE,0xC6,0x86,0x0C,0x18,0x30,0x60,0xC2,0xC6,0xFE,0x00,0x00,0x00,0x00,
93/* 0x5B */ 0x00,0x00,0x3C,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x3C,0x00,0x00,0x00,0x00,
94/* 0x5C */ 0x00,0x00,0x00,0x80,0xC0,0xE0,0x70,0x38,0x1C,0x0E,0x06,0x02,0x00,0x00,0x00,0x00,
95/* 0x5D */ 0x00,0x00,0x3C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x3C,0x00,0x00,0x00,0x00,
96/* 0x5E */ 0x10,0x38,0x6C,0xC6,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
97/* 0x5F */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,
98/* 0x60 */ 0x30,0x30,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
99/* 0x61 */ 0x00,0x00,0x00,0x00,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00,
100/* 0x62 */ 0x00,0x00,0xE0,0x60,0x60,0x78,0x6C,0x66,0x66,0x66,0x66,0x7C,0x00,0x00,0x00,0x00,
101/* 0x63 */ 0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC0,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00,
102/* 0x64 */ 0x00,0x00,0x1C,0x0C,0x0C,0x3C,0x6C,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00,
103/* 0x65 */ 0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00,
104/* 0x66 */ 0x00,0x00,0x38,0x6C,0x64,0x60,0xF0,0x60,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00,
105/* 0x67 */ 0x00,0x00,0x00,0x00,0x00,0x3E,0x66,0x66,0x66,0x66,0x66,0x3E,0x06,0x66,0x3C,0x00,
106/* 0x68 */ 0x00,0x00,0xE0,0x60,0x60,0x6C,0x76,0x66,0x66,0x66,0x66,0xE6,0x00,0x00,0x00,0x00,
107/* 0x69 */ 0x00,0x00,0x18,0x18,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00,
108/* 0x6A */ 0x00,0x00,0x06,0x06,0x00,0x0E,0x06,0x06,0x06,0x06,0x06,0x06,0x66,0x66,0x3C,0x00,
109/* 0x6B */ 0x00,0x00,0xE0,0x60,0x60,0x66,0x6C,0x78,0x78,0x6C,0x66,0xE6,0x00,0x00,0x00,0x00,
110/* 0x6C */ 0x00,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00,
111/* 0x6D */ 0x00,0x00,0x00,0x00,0x00,0x6C,0xFE,0xD6,0xD6,0xD6,0xC6,0xC6,0x00,0x00,0x00,0x00,
112/* 0x6E */ 0x00,0x00,0x00,0x00,0x00,0xDC,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x00,0x00,0x00,
113/* 0x6F */ 0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00,
114/* 0x70 */ 0x00,0x00,0x00,0x00,0x00,0xFC,0x66,0x66,0x66,0x66,0x66,0x7C,0x60,0x60,0xF0,0x00,
115/* 0x71 */ 0x00,0x00,0x00,0x00,0x00,0x7E,0xCC,0xCC,0xCC,0xCC,0xCC,0x7C,0x0C,0x0C,0x1E,0x00,
116/* 0x72 */ 0x00,0x00,0x00,0x00,0x00,0xDC,0x76,0x66,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00,
117/* 0x73 */ 0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0x60,0x38,0x0C,0xC6,0x7C,0x00,0x00,0x00,0x00,
118/* 0x74 */ 0x00,0x00,0x10,0x30,0x30,0xFC,0x30,0x30,0x30,0x30,0x36,0x1C,0x00,0x00,0x00,0x00,
119/* 0x75 */ 0x00,0x00,0x00,0x00,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00,
120/* 0x76 */ 0x00,0x00,0x00,0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x3C,0x18,0x00,0x00,0x00,0x00,
121/* 0x77 */ 0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xD6,0xD6,0xD6,0xFE,0x6C,0x00,0x00,0x00,0x00,
122/* 0x78 */ 0x00,0x00,0x00,0x00,0x00,0xC6,0x6C,0x38,0x38,0x38,0x6C,0xC6,0x00,0x00,0x00,0x00,
123/* 0x79 */ 0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x0C,0xF8,0x00,
124/* 0x7A */ 0x00,0x00,0x00,0x00,0x00,0xFE,0xCC,0x18,0x30,0x60,0xC6,0xFE,0x00,0x00,0x00,0x00,
125/* 0x7B */ 0x00,0x00,0x0E,0x18,0x18,0x18,0x70,0x18,0x18,0x18,0x18,0x0E,0x00,0x00,0x00,0x00,
126/* 0x7C */ 0x00,0x00,0x18,0x18,0x18,0x18,0x00,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00,
127/* 0x7D */ 0x00,0x00,0x70,0x18,0x18,0x18,0x0E,0x18,0x18,0x18,0x18,0x70,0x00,0x00,0x00,0x00,
128/* 0x7E */ 0x00,0x00,0x76,0xDC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
129/* 0x7F */ 0x00,0x00,0x00,0x00,0x10,0x38,0x6C,0xC6,0xC6,0xC6,0xFE,0x00,0x00,0x00,0x00,0x00,
130/* 0x80 */ 0x00,0x00,0x3C,0x66,0xC2,0xC0,0xC0,0xC0,0xC2,0x66,0x3C,0x0C,0x06,0x7C,0x00,0x00,
131/* 0x81 */ 0x00,0x00,0xCC,0x00,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00,
132/* 0x82 */ 0x00,0x0C,0x18,0x30,0x00,0x7C,0xC6,0xC6,0xFE,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00,
133/* 0x83 */ 0x00,0x10,0x38,0x6C,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00,
134/* 0x84 */ 0x00,0x00,0xCC,0x00,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00,
135/* 0x85 */ 0x00,0x60,0x30,0x18,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00,
136/* 0x86 */ 0x00,0x38,0x6C,0x38,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00,
137/* 0x87 */ 0x00,0x00,0x00,0x00,0x3C,0x66,0x60,0x60,0x66,0x3C,0x0C,0x06,0x3C,0x00,0x00,0x00,
138/* 0x88 */ 0x00,0x10,0x38,0x6C,0x00,0x7C,0xC6,0xC6,0xFE,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00,
139/* 0x89 */ 0x00,0x00,0xC6,0x00,0x00,0x7C,0xC6,0xC6,0xFE,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00,
140/* 0x8A */ 0x00,0x60,0x30,0x18,0x00,0x7C,0xC6,0xC6,0xFE,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00,
141/* 0x8B */ 0x00,0x00,0x66,0x00,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00,
142/* 0x8C */ 0x00,0x18,0x3C,0x66,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00,
143/* 0x8D */ 0x00,0x60,0x30,0x18,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00,
144/* 0x8E */ 0x00,0xC6,0x00,0x10,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00,
145/* 0x8F */ 0x38,0x6C,0x38,0x00,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00,
146/* 0x90 */ 0x18,0x30,0x60,0x00,0xFE,0x66,0x60,0x7C,0x60,0x60,0x66,0xFE,0x00,0x00,0x00,0x00,
147/* 0x91 */ 0x00,0x00,0x00,0x00,0x00,0xCC,0x76,0x36,0x7E,0xD8,0xD8,0x6E,0x00,0x00,0x00,0x00,
148/* 0x92 */ 0x00,0x00,0x3E,0x6C,0xCC,0xCC,0xFE,0xCC,0xCC,0xCC,0xCC,0xCE,0x00,0x00,0x00,0x00,
149/* 0x93 */ 0x00,0x10,0x38,0x6C,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00,
150/* 0x94 */ 0x00,0x00,0xC6,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00,
151/* 0x95 */ 0x00,0x60,0x30,0x18,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00,
152/* 0x96 */ 0x00,0x30,0x78,0xCC,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00,
153/* 0x97 */ 0x00,0x60,0x30,0x18,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00,
154/* 0x98 */ 0x00,0x00,0xC6,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x0C,0x78,0x00,
155/* 0x99 */ 0x00,0xC6,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00,
156/* 0x9A */ 0x00,0xC6,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00,
157/* 0x9B */ 0x00,0x18,0x18,0x3C,0x66,0x60,0x60,0x60,0x66,0x3C,0x18,0x18,0x00,0x00,0x00,0x00,
158/* 0x9C */ 0x00,0x38,0x6C,0x64,0x60,0xF8,0x60,0x60,0x60,0x60,0xE6,0xFC,0x00,0x00,0x00,0x00,
159/* 0x9D */ 0x00,0x00,0x66,0x66,0x3C,0x18,0x7E,0x18,0x7E,0x18,0x18,0x18,0x00,0x00,0x00,0x00,
160/* 0x9E */ 0x00,0xF8,0xCC,0xCC,0xF8,0xC4,0xCC,0xDE,0xCC,0xCC,0xCC,0xC6,0x00,0x00,0x00,0x00,
161/* 0x9F */ 0x00,0x0E,0x1B,0x18,0x18,0x18,0x7E,0x18,0x18,0x18,0x18,0x18,0xD8,0x70,0x00,0x00,
162/* 0xA0 */ 0x00,0x18,0x30,0x60,0x00,0x78,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00,
163/* 0xA1 */ 0x00,0x0C,0x18,0x30,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00,
164/* 0xA2 */ 0x00,0x18,0x30,0x60,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00,
165/* 0xA3 */ 0x00,0x18,0x30,0x60,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00,
166/* 0xA4 */ 0x00,0x00,0x76,0xDC,0x00,0xDC,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x00,0x00,0x00,
167/* 0xA5 */ 0x76,0xDC,0x00,0xC6,0xE6,0xF6,0xFE,0xDE,0xCE,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00,
168/* 0xA6 */ 0x00,0x3C,0x6C,0x6C,0x3E,0x00,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
169/* 0xA7 */ 0x00,0x38,0x6C,0x6C,0x38,0x00,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
170/* 0xA8 */ 0x00,0x00,0x30,0x30,0x00,0x30,0x30,0x60,0xC0,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00,
171/* 0xA9 */ 0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0xC0,0xC0,0xC0,0xC0,0x00,0x00,0x00,0x00,0x00,
172/* 0xAA */ 0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x06,0x06,0x06,0x06,0x00,0x00,0x00,0x00,0x00,
173/* 0xAB */ 0x00,0xC0,0xC0,0xC2,0xC6,0xCC,0x18,0x30,0x60,0xDC,0x86,0x0C,0x18,0x3E,0x00,0x00,
174/* 0xAC */ 0x00,0xC0,0xC0,0xC2,0xC6,0xCC,0x18,0x30,0x66,0xCE,0x9E,0x3E,0x06,0x06,0x00,0x00,
175/* 0xAD */ 0x00,0x00,0x18,0x18,0x00,0x18,0x18,0x18,0x3C,0x3C,0x3C,0x18,0x00,0x00,0x00,0x00,
176/* 0xAE */ 0x00,0x00,0x00,0x00,0x00,0x36,0x6C,0xD8,0x6C,0x36,0x00,0x00,0x00,0x00,0x00,0x00,
177/* 0xAF */ 0x00,0x00,0x00,0x00,0x00,0xD8,0x6C,0x36,0x6C,0xD8,0x00,0x00,0x00,0x00,0x00,0x00,
178/* 0xB0 */ 0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,
179/* 0xB1 */ 0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,
180/* 0xB2 */ 0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,
181/* 0xB3 */ 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
182/* 0xB4 */ 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xF8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
183/* 0xB5 */ 0x18,0x18,0x18,0x18,0x18,0xF8,0x18,0xF8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
184/* 0xB6 */ 0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xF6,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
185/* 0xB7 */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
186/* 0xB8 */ 0x00,0x00,0x00,0x00,0x00,0xF8,0x18,0xF8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
187/* 0xB9 */ 0x36,0x36,0x36,0x36,0x36,0xF6,0x06,0xF6,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
188/* 0xBA */ 0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
189/* 0xBB */ 0x00,0x00,0x00,0x00,0x00,0xFE,0x06,0xF6,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
190/* 0xBC */ 0x36,0x36,0x36,0x36,0x36,0xF6,0x06,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
191/* 0xBD */ 0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
192/* 0xBE */ 0x18,0x18,0x18,0x18,0x18,0xF8,0x18,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
193/* 0xBF */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
194/* 0xC0 */ 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
195/* 0xC1 */ 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
196/* 0xC2 */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
197/* 0xC3 */ 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1F,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
198/* 0xC4 */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
199/* 0xC5 */ 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xFF,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
200/* 0xC6 */ 0x18,0x18,0x18,0x18,0x18,0x1F,0x18,0x1F,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
201/* 0xC7 */ 0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x37,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
202/* 0xC8 */ 0x36,0x36,0x36,0x36,0x36,0x37,0x30,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
203/* 0xC9 */ 0x00,0x00,0x00,0x00,0x00,0x3F,0x30,0x37,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
204/* 0xCA */ 0x36,0x36,0x36,0x36,0x36,0xF7,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
205/* 0xCB */ 0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xF7,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
206/* 0xCC */ 0x36,0x36,0x36,0x36,0x36,0x37,0x30,0x37,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
207/* 0xCD */ 0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
208/* 0xCE */ 0x36,0x36,0x36,0x36,0x36,0xF7,0x00,0xF7,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
209/* 0xCF */ 0x18,0x18,0x18,0x18,0x18,0xFF,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
210/* 0xD0 */ 0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
211/* 0xD1 */ 0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xFF,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
212/* 0xD2 */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
213/* 0xD3 */ 0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
214/* 0xD4 */ 0x18,0x18,0x18,0x18,0x18,0x1F,0x18,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
215/* 0xD5 */ 0x00,0x00,0x00,0x00,0x00,0x1F,0x18,0x1F,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
216/* 0xD6 */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
217/* 0xD7 */ 0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xFF,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
218/* 0xD8 */ 0x18,0x18,0x18,0x18,0x18,0xFF,0x18,0xFF,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
219/* 0xD9 */ 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
220/* 0xDA */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
221/* 0xDB */ 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
222/* 0xDC */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
223/* 0xDD */ 0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,
224/* 0xDE */ 0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,
225/* 0xDF */ 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
226/* 0xE0 */ 0x00,0x00,0x00,0x00,0x00,0x76,0xDC,0xD8,0xD8,0xD8,0xDC,0x76,0x00,0x00,0x00,0x00,
227/* 0xE1 */ 0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xFC,0xC6,0xC6,0xC6,0xC6,0xDC,0xC0,0xC0,0x00,0x00,
228/* 0xE2 */ 0x00,0x00,0xFE,0xC6,0xC6,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0x00,0x00,0x00,0x00,
229/* 0xE3 */ 0x00,0x00,0x00,0x00,0x00,0xFE,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x00,0x00,0x00,0x00,
230/* 0xE4 */ 0x00,0x00,0xFE,0xC6,0x60,0x30,0x18,0x18,0x30,0x60,0xC6,0xFE,0x00,0x00,0x00,0x00,
231/* 0xE5 */ 0x00,0x00,0x00,0x00,0x00,0x7E,0xD8,0xD8,0xD8,0xD8,0xD8,0x70,0x00,0x00,0x00,0x00,
232/* 0xE6 */ 0x00,0x00,0x00,0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x7C,0x60,0xC0,0x00,0x00,0x00,
233/* 0xE7 */ 0x00,0x00,0x00,0x00,0x00,0x76,0xDC,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00,
234/* 0xE8 */ 0x00,0x00,0x7E,0x18,0x3C,0x66,0x66,0x66,0x66,0x3C,0x18,0x7E,0x00,0x00,0x00,0x00,
235/* 0xE9 */ 0x00,0x00,0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0x6C,0x38,0x00,0x00,0x00,0x00,
236/* 0xEA */ 0x00,0x00,0x38,0x6C,0xC6,0xC6,0xC6,0x6C,0x6C,0x6C,0x6C,0xEE,0x00,0x00,0x00,0x00,
237/* 0xEB */ 0x00,0x00,0x1E,0x30,0x18,0x0C,0x3E,0x66,0x66,0x66,0x66,0x3C,0x00,0x00,0x00,0x00,
238/* 0xEC */ 0x00,0x00,0x00,0x00,0x00,0x7E,0xDB,0xDB,0xDB,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,
239/* 0xED */ 0x00,0x00,0x00,0x03,0x06,0x7E,0xDB,0xDB,0xF3,0x7E,0x60,0xC0,0x00,0x00,0x00,0x00,
240/* 0xEE */ 0x00,0x00,0x1C,0x30,0x60,0x60,0x7C,0x60,0x60,0x60,0x30,0x1C,0x00,0x00,0x00,0x00,
241/* 0xEF */ 0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00,
242/* 0xF0 */ 0x00,0x00,0x00,0x00,0xFE,0x00,0x00,0xFE,0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,
243/* 0xF1 */ 0x00,0x00,0x00,0x00,0x18,0x18,0x7E,0x18,0x18,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,
244/* 0xF2 */ 0x00,0x00,0x00,0x30,0x18,0x0C,0x06,0x0C,0x18,0x30,0x00,0x7E,0x00,0x00,0x00,0x00,
245/* 0xF3 */ 0x00,0x00,0x00,0x0C,0x18,0x30,0x60,0x30,0x18,0x0C,0x00,0x7E,0x00,0x00,0x00,0x00,
246/* 0xF4 */ 0x00,0x0E,0x1B,0x1B,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
247/* 0xF5 */ 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xD8,0xD8,0xD8,0x70,0x00,0x00,0x00,0x00,
248/* 0xF6 */ 0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x7E,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00,
249/* 0xF7 */ 0x00,0x00,0x00,0x00,0x00,0x76,0xDC,0x00,0x76,0xDC,0x00,0x00,0x00,0x00,0x00,0x00,
250/* 0xF8 */ 0x00,0x38,0x6C,0x6C,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
251/* 0xF9 */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
252/* 0xFA */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
253/* 0xFB */ 0x00,0x0F,0x0C,0x0C,0x0C,0x0C,0x0C,0xEC,0x6C,0x6C,0x3C,0x1C,0x00,0x00,0x00,0x00,
254/* 0xFC */ 0x00,0xD8,0x6C,0x6C,0x6C,0x6C,0x6C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
255/* 0xFD */ 0x00,0x70,0xD8,0x30,0x60,0xC8,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
256/* 0xFE */ 0x00,0x00,0x00,0x00,0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,0x00,0x00,0x00,0x00,0x00,
257};
diff --git a/arch/ppc/boot/include/mpc10x.h b/arch/ppc/boot/include/mpc10x.h
deleted file mode 100644
index 6e5d540d8d3e..000000000000
--- a/arch/ppc/boot/include/mpc10x.h
+++ /dev/null
@@ -1,63 +0,0 @@
1/*
2 * Common defines for the Motorola SPS MPC106/8240/107 Host bridge/Mem
3 * ctrl/EPIC/etc.
4 *
5 * Author: Tom Rini <trini@mvista.com>
6 *
7 * This is a heavily stripped down version of:
8 * include/asm-ppc/mpc10x.h
9 *
10 * Author: Mark A. Greer
11 * mgreer@mvista.com
12 *
13 * 2001-2002 (c) MontaVista, Software, Inc. This file is licensed under
14 * the terms of the GNU General Public License version 2. This program
15 * is licensed "as is" without any warranty of any kind, whether express
16 * or implied.
17 */
18#ifndef __BOOT_MPC10X_H__
19#define __BOOT_MPC10X_H__
20
21/*
22 * The values here don't completely map everything but should work in most
23 * cases.
24 *
25 * MAP A (PReP Map)
26 * Processor: 0x80000000 - 0x807fffff -> PCI I/O: 0x00000000 - 0x007fffff
27 * Processor: 0xc0000000 - 0xdfffffff -> PCI MEM: 0x00000000 - 0x1fffffff
28 * PCI MEM: 0x80000000 -> Processor System Memory: 0x00000000
29 * EUMB mapped to: ioremap_base - 0x00100000 (ioremap_base - 1 MB)
30 *
31 * MAP B (CHRP Map)
32 * Processor: 0xfe000000 - 0xfebfffff -> PCI I/O: 0x00000000 - 0x00bfffff
33 * Processor: 0x80000000 - 0xbfffffff -> PCI MEM: 0x80000000 - 0xbfffffff
34 * PCI MEM: 0x00000000 -> Processor System Memory: 0x00000000
35 * EUMB mapped to: ioremap_base - 0x00100000 (ioremap_base - 1 MB)
36 */
37
38/* Define the type of map to use */
39#define MPC10X_MEM_MAP_A 1
40#define MPC10X_MEM_MAP_B 2
41
42/* Map A (PReP Map) Defines */
43#define MPC10X_MAPA_CNFG_ADDR 0x80000cf8
44#define MPC10X_MAPA_CNFG_DATA 0x80000cfc
45
46/* Map B (CHRP Map) Defines */
47#define MPC10X_MAPB_CNFG_ADDR 0xfec00000
48#define MPC10X_MAPB_CNFG_DATA 0xfee00000
49
50/* Define offsets for the memory controller registers in the config space */
51#define MPC10X_MCTLR_MEM_START_1 0x80 /* Banks 0-3 */
52#define MPC10X_MCTLR_MEM_START_2 0x84 /* Banks 4-7 */
53#define MPC10X_MCTLR_EXT_MEM_START_1 0x88 /* Banks 0-3 */
54#define MPC10X_MCTLR_EXT_MEM_START_2 0x8c /* Banks 4-7 */
55
56#define MPC10X_MCTLR_MEM_END_1 0x90 /* Banks 0-3 */
57#define MPC10X_MCTLR_MEM_END_2 0x94 /* Banks 4-7 */
58#define MPC10X_MCTLR_EXT_MEM_END_1 0x98 /* Banks 0-3 */
59#define MPC10X_MCTLR_EXT_MEM_END_2 0x9c /* Banks 4-7 */
60
61#define MPC10X_MCTLR_MEM_BANK_ENABLES 0xa0
62
63#endif /* __BOOT_MPC10X_H__ */
diff --git a/arch/ppc/boot/include/mpsc_defs.h b/arch/ppc/boot/include/mpsc_defs.h
deleted file mode 100644
index 9f37e1355b17..000000000000
--- a/arch/ppc/boot/include/mpsc_defs.h
+++ /dev/null
@@ -1,146 +0,0 @@
1/*
2 * arch/ppc/boot/include/mpsc_defs.h
3 *
4 * Register definitions for the Marvell Multi-Protocol Serial Controller (MPSC),
5 * Serial DMA Controller (SDMA), and Baud Rate Generator (BRG).
6 *
7 * Author: Mark A. Greer <mgreer@mvista.com>
8 *
9 * 2004 (c) MontaVista, Software, Inc. This file is licensed under
10 * the terms of the GNU General Public License version 2. This program
11 * is licensed "as is" without any warranty of any kind, whether express
12 * or implied.
13 */
14#ifndef _PPC_BOOT_MPSC_DEFS_H__
15#define _PPC_BOOT_MPSC_DEFS_H__
16
17#define MPSC_NUM_CTLRS 2
18
19/*
20 *****************************************************************************
21 *
22 * Multi-Protocol Serial Controller Interface Registers
23 *
24 *****************************************************************************
25 */
26
27/* Main Configuratino Register Offsets */
28#define MPSC_MMCRL 0x0000
29#define MPSC_MMCRH 0x0004
30#define MPSC_MPCR 0x0008
31#define MPSC_CHR_1 0x000c
32#define MPSC_CHR_2 0x0010
33#define MPSC_CHR_3 0x0014
34#define MPSC_CHR_4 0x0018
35#define MPSC_CHR_5 0x001c
36#define MPSC_CHR_6 0x0020
37#define MPSC_CHR_7 0x0024
38#define MPSC_CHR_8 0x0028
39#define MPSC_CHR_9 0x002c
40#define MPSC_CHR_10 0x0030
41#define MPSC_CHR_11 0x0034
42
43#define MPSC_MPCR_CL_5 0
44#define MPSC_MPCR_CL_6 1
45#define MPSC_MPCR_CL_7 2
46#define MPSC_MPCR_CL_8 3
47#define MPSC_MPCR_SBL_1 0
48#define MPSC_MPCR_SBL_2 3
49
50#define MPSC_CHR_2_TEV (1<<1)
51#define MPSC_CHR_2_TA (1<<7)
52#define MPSC_CHR_2_TTCS (1<<9)
53#define MPSC_CHR_2_REV (1<<17)
54#define MPSC_CHR_2_RA (1<<23)
55#define MPSC_CHR_2_CRD (1<<25)
56#define MPSC_CHR_2_EH (1<<31)
57#define MPSC_CHR_2_PAR_ODD 0
58#define MPSC_CHR_2_PAR_SPACE 1
59#define MPSC_CHR_2_PAR_EVEN 2
60#define MPSC_CHR_2_PAR_MARK 3
61
62/* MPSC Signal Routing */
63#define MPSC_MRR 0x0000
64#define MPSC_RCRR 0x0004
65#define MPSC_TCRR 0x0008
66
67/*
68 *****************************************************************************
69 *
70 * Serial DMA Controller Interface Registers
71 *
72 *****************************************************************************
73 */
74
75#define SDMA_SDC 0x0000
76#define SDMA_SDCM 0x0008
77#define SDMA_RX_DESC 0x0800
78#define SDMA_RX_BUF_PTR 0x0808
79#define SDMA_SCRDP 0x0810
80#define SDMA_TX_DESC 0x0c00
81#define SDMA_SCTDP 0x0c10
82#define SDMA_SFTDP 0x0c14
83
84#define SDMA_DESC_CMDSTAT_PE (1<<0)
85#define SDMA_DESC_CMDSTAT_CDL (1<<1)
86#define SDMA_DESC_CMDSTAT_FR (1<<3)
87#define SDMA_DESC_CMDSTAT_OR (1<<6)
88#define SDMA_DESC_CMDSTAT_BR (1<<9)
89#define SDMA_DESC_CMDSTAT_MI (1<<10)
90#define SDMA_DESC_CMDSTAT_A (1<<11)
91#define SDMA_DESC_CMDSTAT_AM (1<<12)
92#define SDMA_DESC_CMDSTAT_CT (1<<13)
93#define SDMA_DESC_CMDSTAT_C (1<<14)
94#define SDMA_DESC_CMDSTAT_ES (1<<15)
95#define SDMA_DESC_CMDSTAT_L (1<<16)
96#define SDMA_DESC_CMDSTAT_F (1<<17)
97#define SDMA_DESC_CMDSTAT_P (1<<18)
98#define SDMA_DESC_CMDSTAT_EI (1<<23)
99#define SDMA_DESC_CMDSTAT_O (1<<31)
100
101#define SDMA_DESC_DFLT (SDMA_DESC_CMDSTAT_O | \
102 SDMA_DESC_CMDSTAT_EI)
103
104#define SDMA_SDC_RFT (1<<0)
105#define SDMA_SDC_SFM (1<<1)
106#define SDMA_SDC_BLMR (1<<6)
107#define SDMA_SDC_BLMT (1<<7)
108#define SDMA_SDC_POVR (1<<8)
109#define SDMA_SDC_RIFB (1<<9)
110
111#define SDMA_SDCM_ERD (1<<7)
112#define SDMA_SDCM_AR (1<<15)
113#define SDMA_SDCM_STD (1<<16)
114#define SDMA_SDCM_TXD (1<<23)
115#define SDMA_SDCM_AT (1<<31)
116
117#define SDMA_0_CAUSE_RXBUF (1<<0)
118#define SDMA_0_CAUSE_RXERR (1<<1)
119#define SDMA_0_CAUSE_TXBUF (1<<2)
120#define SDMA_0_CAUSE_TXEND (1<<3)
121#define SDMA_1_CAUSE_RXBUF (1<<8)
122#define SDMA_1_CAUSE_RXERR (1<<9)
123#define SDMA_1_CAUSE_TXBUF (1<<10)
124#define SDMA_1_CAUSE_TXEND (1<<11)
125
126#define SDMA_CAUSE_RX_MASK (SDMA_0_CAUSE_RXBUF | SDMA_0_CAUSE_RXERR | \
127 SDMA_1_CAUSE_RXBUF | SDMA_1_CAUSE_RXERR)
128#define SDMA_CAUSE_TX_MASK (SDMA_0_CAUSE_TXBUF | SDMA_0_CAUSE_TXEND | \
129 SDMA_1_CAUSE_TXBUF | SDMA_1_CAUSE_TXEND)
130
131/* SDMA Interrupt registers */
132#define SDMA_INTR_CAUSE 0x0000
133#define SDMA_INTR_MASK 0x0080
134
135/*
136 *****************************************************************************
137 *
138 * Baud Rate Generator Interface Registers
139 *
140 *****************************************************************************
141 */
142
143#define BRG_BCR 0x0000
144#define BRG_BTR 0x0004
145
146#endif /*_PPC_BOOT_MPSC_DEFS_H__ */
diff --git a/arch/ppc/boot/include/nonstdio.h b/arch/ppc/boot/include/nonstdio.h
deleted file mode 100644
index f2b5526faef3..000000000000
--- a/arch/ppc/boot/include/nonstdio.h
+++ /dev/null
@@ -1,34 +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 * This is sort of a catchall for I/O related functions. Stuff that
10 * wouldn't be in 'stdio.h' normally is here, and it's 'nonstdio.h'
11 * for a reason. -- Tom
12 */
13typedef int FILE;
14extern FILE *stdin, *stdout;
15#define NULL ((void *)0)
16#define EOF (-1)
17#define fopen(n, m) NULL
18#define fflush(f) 0
19#define fclose(f) 0
20#define perror(s) printf("%s: no files!\n", (s))
21
22extern int getc(void);
23extern int printf(const char *format, ...);
24extern int sprintf(char *str, const char *format, ...);
25extern int tstc(void);
26extern void exit(void);
27extern void outb(int port, unsigned char val);
28extern void putc(const char c);
29extern void puthex(unsigned long val);
30extern void puts(const char *);
31extern void udelay(long delay);
32extern unsigned char inb(int port);
33extern void board_isa_init(void);
34extern void ISA_init(unsigned long base);
diff --git a/arch/ppc/boot/include/of1275.h b/arch/ppc/boot/include/of1275.h
deleted file mode 100644
index 4ed88acfa73a..000000000000
--- a/arch/ppc/boot/include/of1275.h
+++ /dev/null
@@ -1,42 +0,0 @@
1/*
2 * Copyright (C) Paul Mackerras 1997.
3 * Copyright (C) Leigh Brown 2002.
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version
8 * 2 of the License, or (at your option) any later version.
9 */
10
11typedef void *prom_handle;
12typedef void *ihandle;
13typedef void *phandle;
14typedef int (*prom_entry)(void *);
15
16#define OF_INVALID_HANDLE ((prom_handle)-1UL)
17
18extern prom_entry of_prom_entry;
19
20/* function declarations */
21
22int call_prom(const char *service, int nargs, int nret, ...);
23int call_prom_ret(const char *service, int nargs, int nret,
24 unsigned int *rets, ...);
25void * claim(unsigned int virt, unsigned int size, unsigned int align);
26int map(unsigned int phys, unsigned int virt, unsigned int size);
27void enter(void);
28void exit(void);
29phandle finddevice(const char *name);
30int getprop(phandle node, const char *name, void *buf, int buflen);
31void ofinit(prom_entry entry);
32int ofstdio(ihandle *stdin, ihandle *stdout, ihandle *stderr);
33int read(ihandle instance, void *buf, int buflen);
34void release(void *virt, unsigned int size);
35int write(ihandle instance, void *buf, int buflen);
36
37/* inlines */
38
39extern inline void pause(void)
40{
41 enter();
42}
diff --git a/arch/ppc/boot/include/rs6000.h b/arch/ppc/boot/include/rs6000.h
deleted file mode 100644
index 433f45084e41..000000000000
--- a/arch/ppc/boot/include/rs6000.h
+++ /dev/null
@@ -1,243 +0,0 @@
1/* IBM RS/6000 "XCOFF" file definitions for BFD.
2 Copyright (C) 1990, 1991 Free Software Foundation, Inc.
3 FIXME: Can someone provide a transliteration of this name into ASCII?
4 Using the following chars caused a compiler warning on HIUX (so I replaced
5 them with octal escapes), and isn't useful without an understanding of what
6 character set it is.
7 Written by Mimi Ph\373\364ng-Th\345o V\365 of IBM
8 and John Gilmore of Cygnus Support. */
9
10/********************** FILE HEADER **********************/
11
12struct external_filehdr {
13 char f_magic[2]; /* magic number */
14 char f_nscns[2]; /* number of sections */
15 char f_timdat[4]; /* time & date stamp */
16 char f_symptr[4]; /* file pointer to symtab */
17 char f_nsyms[4]; /* number of symtab entries */
18 char f_opthdr[2]; /* sizeof(optional hdr) */
19 char f_flags[2]; /* flags */
20};
21
22 /* IBM RS/6000 */
23#define U802WRMAGIC 0730 /* writeable text segments **chh** */
24#define U802ROMAGIC 0735 /* readonly sharable text segments */
25#define U802TOCMAGIC 0737 /* readonly text segments and TOC */
26
27#define BADMAG(x) \
28 ((x).f_magic != U802ROMAGIC && (x).f_magic != U802WRMAGIC && \
29 (x).f_magic != U802TOCMAGIC)
30
31#define FILHDR struct external_filehdr
32#define FILHSZ 20
33
34
35/********************** AOUT "OPTIONAL HEADER" **********************/
36
37
38typedef struct
39{
40 unsigned char magic[2]; /* type of file */
41 unsigned char vstamp[2]; /* version stamp */
42 unsigned char tsize[4]; /* text size in bytes, padded to FW bdry */
43 unsigned char dsize[4]; /* initialized data " " */
44 unsigned char bsize[4]; /* uninitialized data " " */
45 unsigned char entry[4]; /* entry pt. */
46 unsigned char text_start[4]; /* base of text used for this file */
47 unsigned char data_start[4]; /* base of data used for this file */
48 unsigned char o_toc[4]; /* address of TOC */
49 unsigned char o_snentry[2]; /* section number of entry point */
50 unsigned char o_sntext[2]; /* section number of .text section */
51 unsigned char o_sndata[2]; /* section number of .data section */
52 unsigned char o_sntoc[2]; /* section number of TOC */
53 unsigned char o_snloader[2]; /* section number of .loader section */
54 unsigned char o_snbss[2]; /* section number of .bss section */
55 unsigned char o_algntext[2]; /* .text alignment */
56 unsigned char o_algndata[2]; /* .data alignment */
57 unsigned char o_modtype[2]; /* module type (??) */
58 unsigned char o_cputype[2]; /* cpu type */
59 unsigned char o_maxstack[4]; /* max stack size (??) */
60 unsigned char o_maxdata[4]; /* max data size (??) */
61 unsigned char o_resv2[12]; /* reserved */
62}
63AOUTHDR;
64
65#define AOUTSZ 72
66#define SMALL_AOUTSZ (28)
67#define AOUTHDRSZ 72
68
69#define RS6K_AOUTHDR_OMAGIC 0x0107 /* old: text & data writeable */
70#define RS6K_AOUTHDR_NMAGIC 0x0108 /* new: text r/o, data r/w */
71#define RS6K_AOUTHDR_ZMAGIC 0x010B /* paged: text r/o, both page-aligned */
72
73
74/********************** SECTION HEADER **********************/
75
76
77struct external_scnhdr {
78 char s_name[8]; /* section name */
79 char s_paddr[4]; /* physical address, aliased s_nlib */
80 char s_vaddr[4]; /* virtual address */
81 char s_size[4]; /* section size */
82 char s_scnptr[4]; /* file ptr to raw data for section */
83 char s_relptr[4]; /* file ptr to relocation */
84 char s_lnnoptr[4]; /* file ptr to line numbers */
85 char s_nreloc[2]; /* number of relocation entries */
86 char s_nlnno[2]; /* number of line number entries*/
87 char s_flags[4]; /* flags */
88};
89
90/*
91 * names of "special" sections
92 */
93#define _TEXT ".text"
94#define _DATA ".data"
95#define _BSS ".bss"
96#define _PAD ".pad"
97#define _LOADER ".loader"
98
99#define SCNHDR struct external_scnhdr
100#define SCNHSZ 40
101
102/* XCOFF uses a special .loader section with type STYP_LOADER. */
103#define STYP_LOADER 0x1000
104
105/* XCOFF uses a special .debug section with type STYP_DEBUG. */
106#define STYP_DEBUG 0x2000
107
108/* XCOFF handles line number or relocation overflow by creating
109 another section header with STYP_OVRFLO set. */
110#define STYP_OVRFLO 0x8000
111
112/********************** LINE NUMBERS **********************/
113
114/* 1 line number entry for every "breakpointable" source line in a section.
115 * Line numbers are grouped on a per function basis; first entry in a function
116 * grouping will have l_lnno = 0 and in place of physical address will be the
117 * symbol table index of the function name.
118 */
119struct external_lineno {
120 union {
121 char l_symndx[4]; /* function name symbol index, iff l_lnno == 0*/
122 char l_paddr[4]; /* (physical) address of line number */
123 } l_addr;
124 char l_lnno[2]; /* line number */
125};
126
127
128#define LINENO struct external_lineno
129#define LINESZ 6
130
131
132/********************** SYMBOLS **********************/
133
134#define E_SYMNMLEN 8 /* # characters in a symbol name */
135#define E_FILNMLEN 14 /* # characters in a file name */
136#define E_DIMNUM 4 /* # array dimensions in auxiliary entry */
137
138struct external_syment
139{
140 union {
141 char e_name[E_SYMNMLEN];
142 struct {
143 char e_zeroes[4];
144 char e_offset[4];
145 } e;
146 } e;
147 char e_value[4];
148 char e_scnum[2];
149 char e_type[2];
150 char e_sclass[1];
151 char e_numaux[1];
152};
153
154
155
156#define N_BTMASK (017)
157#define N_TMASK (060)
158#define N_BTSHFT (4)
159#define N_TSHIFT (2)
160
161
162union external_auxent {
163 struct {
164 char x_tagndx[4]; /* str, un, or enum tag indx */
165 union {
166 struct {
167 char x_lnno[2]; /* declaration line number */
168 char x_size[2]; /* str/union/array size */
169 } x_lnsz;
170 char x_fsize[4]; /* size of function */
171 } x_misc;
172 union {
173 struct { /* if ISFCN, tag, or .bb */
174 char x_lnnoptr[4]; /* ptr to fcn line # */
175 char x_endndx[4]; /* entry ndx past block end */
176 } x_fcn;
177 struct { /* if ISARY, up to 4 dimen. */
178 char x_dimen[E_DIMNUM][2];
179 } x_ary;
180 } x_fcnary;
181 char x_tvndx[2]; /* tv index */
182 } x_sym;
183
184 union {
185 char x_fname[E_FILNMLEN];
186 struct {
187 char x_zeroes[4];
188 char x_offset[4];
189 } x_n;
190 } x_file;
191
192 struct {
193 char x_scnlen[4]; /* section length */
194 char x_nreloc[2]; /* # relocation entries */
195 char x_nlinno[2]; /* # line numbers */
196 } x_scn;
197
198 struct {
199 char x_tvfill[4]; /* tv fill value */
200 char x_tvlen[2]; /* length of .tv */
201 char x_tvran[2][2]; /* tv range */
202 } x_tv; /* info about .tv section (in auxent of symbol .tv)) */
203
204 struct {
205 unsigned char x_scnlen[4];
206 unsigned char x_parmhash[4];
207 unsigned char x_snhash[2];
208 unsigned char x_smtyp[1];
209 unsigned char x_smclas[1];
210 unsigned char x_stab[4];
211 unsigned char x_snstab[2];
212 } x_csect;
213
214};
215
216#define SYMENT struct external_syment
217#define SYMESZ 18
218#define AUXENT union external_auxent
219#define AUXESZ 18
220#define DBXMASK 0x80 /* for dbx storage mask */
221#define SYMNAME_IN_DEBUG(symptr) ((symptr)->n_sclass & DBXMASK)
222
223
224
225/********************** RELOCATION DIRECTIVES **********************/
226
227
228struct external_reloc {
229 char r_vaddr[4];
230 char r_symndx[4];
231 char r_size[1];
232 char r_type[1];
233};
234
235
236#define RELOC struct external_reloc
237#define RELSZ 10
238
239#define DEFAULT_DATA_SECTION_ALIGNMENT 4
240#define DEFAULT_BSS_SECTION_ALIGNMENT 4
241#define DEFAULT_TEXT_SECTION_ALIGNMENT 4
242/* For new sections we havn't heard of before */
243#define DEFAULT_SECTION_ALIGNMENT 4
diff --git a/arch/ppc/boot/include/serial.h b/arch/ppc/boot/include/serial.h
deleted file mode 100644
index d710eabb4256..000000000000
--- a/arch/ppc/boot/include/serial.h
+++ /dev/null
@@ -1,46 +0,0 @@
1/*
2 * A really private header file for the (dumb) serial driver in arch/ppc/boot
3 *
4 * Shamelessly taken from include/linux/serialP.h:
5 *
6 * Copyright (C) 1997 by Theodore Ts'o.
7 *
8 * Redistribution of this file is permitted under the terms of the GNU
9 * Public License (GPL)
10 */
11
12#ifndef _PPC_BOOT_SERIALP_H
13#define _PPC_BOOT_SERIALP_H
14
15/*
16 * This is our internal structure for each serial port's state.
17 *
18 * Many fields are paralleled by the structure used by the serial_struct
19 * structure.
20 *
21 * Given that this is how SERIAL_PORT_DFNS are done, and that we need
22 * to use a few of their fields, we need to have our own copy of it.
23 */
24struct serial_state {
25 int magic;
26 int baud_base;
27 unsigned long port;
28 int irq;
29 int flags;
30 int hub6;
31 int type;
32 int line;
33 int revision; /* Chip revision (950) */
34 int xmit_fifo_size;
35 int custom_divisor;
36 int count;
37 u8 *iomem_base;
38 u16 iomem_reg_shift;
39 unsigned short close_delay;
40 unsigned short closing_wait; /* time to wait before closing */
41 unsigned long icount;
42 int io_type;
43 void *info;
44 void *dev;
45};
46#endif /* _PPC_BOOT_SERIAL_H */
diff --git a/arch/ppc/boot/ld.script b/arch/ppc/boot/ld.script
deleted file mode 100644
index d4dd8f15395e..000000000000
--- a/arch/ppc/boot/ld.script
+++ /dev/null
@@ -1,85 +0,0 @@
1OUTPUT_ARCH(powerpc:common)
2SECTIONS
3{
4 /* Read-only sections, merged into text segment: */
5 . = + SIZEOF_HEADERS;
6 .interp : { *(.interp) }
7 .hash : { *(.hash) }
8 .dynsym : { *(.dynsym) }
9 .dynstr : { *(.dynstr) }
10 .rel.text : { *(.rel.text) }
11 .rela.text : { *(.rela.text) }
12 .rel.data : { *(.rel.data) }
13 .rela.data : { *(.rela.data) }
14 .rel.rodata : { *(.rel.rodata) }
15 .rela.rodata : { *(.rela.rodata) }
16 .rel.got : { *(.rel.got) }
17 .rela.got : { *(.rela.got) }
18 .rel.ctors : { *(.rel.ctors) }
19 .rela.ctors : { *(.rela.ctors) }
20 .rel.dtors : { *(.rel.dtors) }
21 .rela.dtors : { *(.rela.dtors) }
22 .rel.bss : { *(.rel.bss) }
23 .rela.bss : { *(.rela.bss) }
24 .rel.plt : { *(.rel.plt) }
25 .rela.plt : { *(.rela.plt) }
26 .plt : { *(.plt) }
27 .text :
28 {
29 *(.text)
30 *(.fixup)
31 __relocate_start = .;
32 *(.relocate_code)
33 __relocate_end = .;
34 }
35 _etext = .;
36 PROVIDE (etext = .);
37
38 /* Read-write section, merged into data segment: */
39 . = ALIGN(4096);
40 .data :
41 {
42 *(.data)
43 *(.data1)
44 *(.data.boot)
45 *(.sdata)
46 *(.sdata2)
47 *(.got.plt) *(.got)
48 *(.dynamic)
49 *(.rodata)
50 *(.rodata.*)
51 *(.rodata1)
52 *(.got1)
53 __image_begin = .;
54 *(.image)
55 __image_end = .;
56 . = ALIGN(4096);
57 __ramdisk_begin = .;
58 *(.ramdisk)
59 __ramdisk_end = .;
60 . = ALIGN(4096);
61 CONSTRUCTORS
62 }
63 _edata = .;
64 PROVIDE (edata = .);
65
66 . = ALIGN(4096);
67 __bss_start = .;
68 .bss :
69 {
70 *(.sbss) *(.scommon)
71 *(.dynbss)
72 *(.bss)
73 *(COMMON)
74 }
75 _end = . ;
76 PROVIDE (end = .);
77
78 /DISCARD/ : {
79 *(__ksymtab)
80 *(__ksymtab_strings)
81 *(__bug_table)
82 *(__kcrctab)
83 }
84
85}
diff --git a/arch/ppc/boot/lib/.gitignore b/arch/ppc/boot/lib/.gitignore
deleted file mode 100644
index 1629a6167755..000000000000
--- a/arch/ppc/boot/lib/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
1inffast.c
2inflate.c
3inftrees.c
diff --git a/arch/ppc/boot/lib/Makefile b/arch/ppc/boot/lib/Makefile
deleted file mode 100644
index 2f995f712ec5..000000000000
--- a/arch/ppc/boot/lib/Makefile
+++ /dev/null
@@ -1,23 +0,0 @@
1#
2# Makefile for some libs needed by zImage.
3#
4
5CFLAGS_kbd.o := -Idrivers/char
6CFLAGS_vreset.o := -Iarch/ppc/boot/include
7
8zlib := inffast.c inflate.c inftrees.c
9
10lib-y += $(zlib:.c=.o) div64.o
11lib-$(CONFIG_VGA_CONSOLE) += vreset.o kbd.o
12
13
14# zlib files needs header from their original place
15EXTRA_CFLAGS += -Ilib/zlib_inflate
16
17quiet_cmd_copy_zlib = COPY $@
18 cmd_copy_zlib = cat $< > $@
19
20$(addprefix $(obj)/,$(zlib)): $(obj)/%: $(srctree)/lib/zlib_inflate/%
21 $(call cmd,copy_zlib)
22
23clean-files := $(zlib)
diff --git a/arch/ppc/boot/lib/div64.S b/arch/ppc/boot/lib/div64.S
deleted file mode 100644
index 3527569e9926..000000000000
--- a/arch/ppc/boot/lib/div64.S
+++ /dev/null
@@ -1,58 +0,0 @@
1/*
2 * Divide a 64-bit unsigned number by a 32-bit unsigned number.
3 * This routine assumes that the top 32 bits of the dividend are
4 * non-zero to start with.
5 * On entry, r3 points to the dividend, which get overwritten with
6 * the 64-bit quotient, and r4 contains the divisor.
7 * On exit, r3 contains the remainder.
8 *
9 * Copyright (C) 2002 Paul Mackerras, IBM Corp.
10 *
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version
14 * 2 of the License, or (at your option) any later version.
15 */
16#include <asm/ppc_asm.h>
17#include <asm/processor.h>
18
19_GLOBAL(__div64_32)
20 lwz r5,0(r3) # get the dividend into r5/r6
21 lwz r6,4(r3)
22 cmplw r5,r4
23 li r7,0
24 li r8,0
25 blt 1f
26 divwu r7,r5,r4 # if dividend.hi >= divisor,
27 mullw r0,r7,r4 # quotient.hi = dividend.hi / divisor
28 subf. r5,r0,r5 # dividend.hi %= divisor
29 beq 3f
301: mr r11,r5 # here dividend.hi != 0
31 andis. r0,r5,0xc000
32 bne 2f
33 cntlzw r0,r5 # we are shifting the dividend right
34 li r10,-1 # to make it < 2^32, and shifting
35 srw r10,r10,r0 # the divisor right the same amount,
36 add r9,r4,r10 # rounding up (so the estimate cannot
37 andc r11,r6,r10 # ever be too large, only too small)
38 andc r9,r9,r10
39 or r11,r5,r11
40 rotlw r9,r9,r0
41 rotlw r11,r11,r0
42 divwu r11,r11,r9 # then we divide the shifted quantities
432: mullw r10,r11,r4 # to get an estimate of the quotient,
44 mulhwu r9,r11,r4 # multiply the estimate by the divisor,
45 subfc r6,r10,r6 # take the product from the divisor,
46 add r8,r8,r11 # and add the estimate to the accumulated
47 subfe. r5,r9,r5 # quotient
48 bne 1b
493: cmplw r6,r4
50 blt 4f
51 divwu r0,r6,r4 # perform the remaining 32-bit division
52 mullw r10,r0,r4 # and get the remainder
53 add r8,r8,r0
54 subf r6,r10,r6
554: stw r7,0(r3) # return the quotient in *r3
56 stw r8,4(r3)
57 mr r3,r6 # return the remainder in r3
58 blr
diff --git a/arch/ppc/boot/lib/kbd.c b/arch/ppc/boot/lib/kbd.c
deleted file mode 100644
index 3931727434de..000000000000
--- a/arch/ppc/boot/lib/kbd.c
+++ /dev/null
@@ -1,248 +0,0 @@
1#include <linux/keyboard.h>
2
3#include "defkeymap.c" /* yeah I know it's bad -- Cort */
4
5
6unsigned char shfts, ctls, alts, caps;
7
8#define KBDATAP 0x60 /* kbd data port */
9#define KBSTATUSPORT 0x61 /* kbd status */
10#define KBSTATP 0x64 /* kbd status port */
11#define KBINRDY 0x01
12#define KBOUTRDY 0x02
13
14extern unsigned char inb(int port);
15extern void outb(int port, char val);
16extern void puts(const char *);
17extern void puthex(unsigned long val);
18extern void udelay(long x);
19
20static int kbd(int noblock)
21{
22 unsigned char dt, brk, val;
23 unsigned code;
24loop:
25 if (noblock) {
26 if ((inb(KBSTATP) & KBINRDY) == 0)
27 return (-1);
28 } else while((inb(KBSTATP) & KBINRDY) == 0) ;
29
30 dt = inb(KBDATAP);
31
32 brk = dt & 0x80; /* brk == 1 on key release */
33 dt = dt & 0x7f; /* keycode */
34
35 if (shfts)
36 code = shift_map[dt];
37 else if (ctls)
38 code = ctrl_map[dt];
39 else
40 code = plain_map[dt];
41
42 val = KVAL(code);
43 switch (KTYP(code) & 0x0f) {
44 case KT_LATIN:
45 if (brk)
46 break;
47 if (alts)
48 val |= 0x80;
49 if (val == 0x7f) /* map delete to backspace */
50 val = '\b';
51 return val;
52
53 case KT_LETTER:
54 if (brk)
55 break;
56 if (caps)
57 val -= 'a'-'A';
58 return val;
59
60 case KT_SPEC:
61 if (brk)
62 break;
63 if (val == KVAL(K_CAPS))
64 caps = !caps;
65 else if (val == KVAL(K_ENTER)) {
66enter: /* Wait for key up */
67 while (1) {
68 while((inb(KBSTATP) & KBINRDY) == 0) ;
69 dt = inb(KBDATAP);
70 if (dt & 0x80) /* key up */ break;
71 }
72 return 10;
73 }
74 break;
75
76 case KT_PAD:
77 if (brk)
78 break;
79 if (val < 10)
80 return val;
81 if (val == KVAL(K_PENTER))
82 goto enter;
83 break;
84
85 case KT_SHIFT:
86 switch (val) {
87 case KG_SHIFT:
88 case KG_SHIFTL:
89 case KG_SHIFTR:
90 shfts = brk ? 0 : 1;
91 break;
92 case KG_ALT:
93 case KG_ALTGR:
94 alts = brk ? 0 : 1;
95 break;
96 case KG_CTRL:
97 case KG_CTRLL:
98 case KG_CTRLR:
99 ctls = brk ? 0 : 1;
100 break;
101 }
102 break;
103
104 case KT_LOCK:
105 switch (val) {
106 case KG_SHIFT:
107 case KG_SHIFTL:
108 case KG_SHIFTR:
109 if (brk)
110 shfts = !shfts;
111 break;
112 case KG_ALT:
113 case KG_ALTGR:
114 if (brk)
115 alts = !alts;
116 break;
117 case KG_CTRL:
118 case KG_CTRLL:
119 case KG_CTRLR:
120 if (brk)
121 ctls = !ctls;
122 break;
123 }
124 break;
125 }
126 if (brk) return (-1); /* Ignore initial 'key up' codes */
127 goto loop;
128}
129
130static int __kbdreset(void)
131{
132 unsigned char c;
133 int i, t;
134
135 /* flush input queue */
136 t = 2000;
137 while ((inb(KBSTATP) & KBINRDY))
138 {
139 (void)inb(KBDATAP);
140 if (--t == 0)
141 return 1;
142 }
143 /* Send self-test */
144 t = 20000;
145 while (inb(KBSTATP) & KBOUTRDY)
146 if (--t == 0)
147 return 2;
148 outb(KBSTATP,0xAA);
149 t = 200000;
150 while ((inb(KBSTATP) & KBINRDY) == 0) /* wait input ready */
151 if (--t == 0)
152 return 3;
153 if ((c = inb(KBDATAP)) != 0x55)
154 {
155 puts("Keyboard self test failed - result:");
156 puthex(c);
157 puts("\n");
158 }
159 /* Enable interrupts and keyboard controller */
160 t = 20000;
161 while (inb(KBSTATP) & KBOUTRDY)
162 if (--t == 0) return 4;
163 outb(KBSTATP,0x60);
164 t = 20000;
165 while (inb(KBSTATP) & KBOUTRDY)
166 if (--t == 0) return 5;
167 outb(KBDATAP,0x45);
168 for (i = 0; i < 10000; i++) udelay(1);
169
170 t = 20000;
171 while (inb(KBSTATP) & KBOUTRDY)
172 if (--t == 0) return 6;
173 outb(KBSTATP,0x20);
174 t = 200000;
175 while ((inb(KBSTATP) & KBINRDY) == 0) /* wait input ready */
176 if (--t == 0) return 7;
177 if (! (inb(KBDATAP) & 0x40)) {
178 /*
179 * Quote from PS/2 System Reference Manual:
180 *
181 * "Address hex 0060 and address hex 0064 should be
182 * written only when the input-buffer-full bit and
183 * output-buffer-full bit in the Controller Status
184 * register are set 0." (KBINRDY and KBOUTRDY)
185 */
186 t = 200000;
187 while (inb(KBSTATP) & (KBINRDY | KBOUTRDY))
188 if (--t == 0) return 8;
189 outb(KBDATAP,0xF0);
190 t = 200000;
191 while (inb(KBSTATP) & (KBINRDY | KBOUTRDY))
192 if (--t == 0) return 9;
193 outb(KBDATAP,0x01);
194 }
195 t = 20000;
196 while (inb(KBSTATP) & KBOUTRDY)
197 if (--t == 0) return 10;
198 outb(KBSTATP,0xAE);
199 return 0;
200}
201
202static void kbdreset(void)
203{
204 int ret = __kbdreset();
205
206 if (ret) {
207 puts("__kbdreset failed: ");
208 puthex(ret);
209 puts("\n");
210 }
211}
212
213/* We have to actually read the keyboard when CRT_tstc is called,
214 * since the pending data might be a key release code, and therefore
215 * not valid data. In this case, kbd() will return -1, even though there's
216 * data to be read. Of course, we might actually read a valid key press,
217 * in which case it gets queued into key_pending for use by CRT_getc.
218 */
219
220static int kbd_reset = 0;
221
222static int key_pending = -1;
223
224int CRT_getc(void)
225{
226 int c;
227 if (!kbd_reset) {kbdreset(); kbd_reset++; }
228
229 if (key_pending != -1) {
230 c = key_pending;
231 key_pending = -1;
232 return c;
233 } else {
234 while ((c = kbd(0)) == 0) ;
235 return c;
236 }
237}
238
239int CRT_tstc(void)
240{
241 if (!kbd_reset) {kbdreset(); kbd_reset++; }
242
243 while (key_pending == -1 && ((inb(KBSTATP) & KBINRDY) != 0)) {
244 key_pending = kbd(1);
245 }
246
247 return (key_pending != -1);
248}
diff --git a/arch/ppc/boot/lib/vreset.c b/arch/ppc/boot/lib/vreset.c
deleted file mode 100644
index 98539e9f7f96..000000000000
--- a/arch/ppc/boot/lib/vreset.c
+++ /dev/null
@@ -1,805 +0,0 @@
1/*
2 * vreset.c
3 *
4 * Initialize the VGA control registers to 80x25 text mode.
5 *
6 * Adapted from a program by:
7 * Steve Sellgren
8 * San Francisco Indigo Company
9 * sfindigo!sellgren@uunet.uu.net
10 *
11 * Original concept by:
12 * Gary Thomas <gdt@linuxppc.org>
13 * Adapted for Moto boxes by:
14 * Pat Kane & Mark Scott, 1996
15 * Adapted for IBM portables by:
16 * Takeshi Ishimoto
17 * Multi-console support:
18 * Terje Malmedal <terje.malmedal@usit.uio.no>
19 */
20
21#include "iso_font.h"
22#include "nonstdio.h"
23
24extern char *vidmem;
25extern int lines, cols;
26struct VaRegs;
27
28/*
29 * VGA Register
30 */
31struct VgaRegs
32{
33 unsigned short io_port;
34 unsigned char io_index;
35 unsigned char io_value;
36};
37
38void unlockVideo(int slot);
39void setTextRegs(struct VgaRegs *svp);
40void setTextCLUT(int shift);
41void clearVideoMemory(void);
42void loadFont(unsigned char *ISA_mem);
43
44static void mdelay(int ms)
45{
46 for (; ms > 0; --ms)
47 udelay(1000);
48}
49
50/*
51 * Default console text mode registers used to reset
52 * graphics adapter.
53 */
54#define NREGS 54
55#define ENDMK 0xFFFF /* End marker */
56
57#define S3Vendor 0x5333
58#define CirrusVendor 0x1013
59#define DiamondVendor 0x100E
60#define MatroxVendor 0x102B
61#define ParadiseVendor 0x101C
62
63struct VgaRegs GenVgaTextRegs[NREGS+1] = {
64 /* port index value */
65 /* SR Regs */
66 { 0x3c4, 0x1, 0x0 },
67 { 0x3c4, 0x2, 0x3 },
68 { 0x3c4, 0x3, 0x0 },
69 { 0x3c4, 0x4, 0x2 },
70 /* CR Regs */
71 { 0x3d4, 0x0, 0x5f },
72 { 0x3d4, 0x1, 0x4f },
73 { 0x3d4, 0x2, 0x50 },
74 { 0x3d4, 0x3, 0x82 },
75 { 0x3d4, 0x4, 0x55 },
76 { 0x3d4, 0x5, 0x81 },
77 { 0x3d4, 0x6, 0xbf },
78 { 0x3d4, 0x7, 0x1f },
79 { 0x3d4, 0x8, 0x00 },
80 { 0x3d4, 0x9, 0x4f },
81 { 0x3d4, 0xa, 0x0d },
82 { 0x3d4, 0xb, 0x0e },
83 { 0x3d4, 0xc, 0x00 },
84 { 0x3d4, 0xd, 0x00 },
85 { 0x3d4, 0xe, 0x00 },
86 { 0x3d4, 0xf, 0x00 },
87 { 0x3d4, 0x10, 0x9c },
88 { 0x3d4, 0x11, 0x8e },
89 { 0x3d4, 0x12, 0x8f },
90 { 0x3d4, 0x13, 0x28 },
91 { 0x3d4, 0x14, 0x1f },
92 { 0x3d4, 0x15, 0x96 },
93 { 0x3d4, 0x16, 0xb9 },
94 { 0x3d4, 0x17, 0xa3 },
95 /* GR Regs */
96 { 0x3ce, 0x0, 0x0 },
97 { 0x3ce, 0x1, 0x0 },
98 { 0x3ce, 0x2, 0x0 },
99 { 0x3ce, 0x3, 0x0 },
100 { 0x3ce, 0x4, 0x0 },
101 { 0x3ce, 0x5, 0x10 },
102 { 0x3ce, 0x6, 0xe },
103 { 0x3ce, 0x7, 0x0 },
104 { 0x3ce, 0x8, 0xff },
105 { ENDMK }
106};
107
108struct RGBColors
109{
110 unsigned char r, g, b;
111};
112
113/*
114 * Default console text mode color table.
115 * These values were obtained by booting Linux with
116 * text mode firmware & then dumping the registers.
117 */
118struct RGBColors TextCLUT[256] =
119{
120 /* red green blue */
121 { 0x0, 0x0, 0x0 },
122 { 0x0, 0x0, 0x2a },
123 { 0x0, 0x2a, 0x0 },
124 { 0x0, 0x2a, 0x2a },
125 { 0x2a, 0x0, 0x0 },
126 { 0x2a, 0x0, 0x2a },
127 { 0x2a, 0x2a, 0x0 },
128 { 0x2a, 0x2a, 0x2a },
129 { 0x0, 0x0, 0x15 },
130 { 0x0, 0x0, 0x3f },
131 { 0x0, 0x2a, 0x15 },
132 { 0x0, 0x2a, 0x3f },
133 { 0x2a, 0x0, 0x15 },
134 { 0x2a, 0x0, 0x3f },
135 { 0x2a, 0x2a, 0x15 },
136 { 0x2a, 0x2a, 0x3f },
137 { 0x0, 0x15, 0x0 },
138 { 0x0, 0x15, 0x2a },
139 { 0x0, 0x3f, 0x0 },
140 { 0x0, 0x3f, 0x2a },
141 { 0x2a, 0x15, 0x0 },
142 { 0x2a, 0x15, 0x2a },
143 { 0x2a, 0x3f, 0x0 },
144 { 0x2a, 0x3f, 0x2a },
145 { 0x0, 0x15, 0x15 },
146 { 0x0, 0x15, 0x3f },
147 { 0x0, 0x3f, 0x15 },
148 { 0x0, 0x3f, 0x3f },
149 { 0x2a, 0x15, 0x15 },
150 { 0x2a, 0x15, 0x3f },
151 { 0x2a, 0x3f, 0x15 },
152 { 0x2a, 0x3f, 0x3f },
153 { 0x15, 0x0, 0x0 },
154 { 0x15, 0x0, 0x2a },
155 { 0x15, 0x2a, 0x0 },
156 { 0x15, 0x2a, 0x2a },
157 { 0x3f, 0x0, 0x0 },
158 { 0x3f, 0x0, 0x2a },
159 { 0x3f, 0x2a, 0x0 },
160 { 0x3f, 0x2a, 0x2a },
161 { 0x15, 0x0, 0x15 },
162 { 0x15, 0x0, 0x3f },
163 { 0x15, 0x2a, 0x15 },
164 { 0x15, 0x2a, 0x3f },
165 { 0x3f, 0x0, 0x15 },
166 { 0x3f, 0x0, 0x3f },
167 { 0x3f, 0x2a, 0x15 },
168 { 0x3f, 0x2a, 0x3f },
169 { 0x15, 0x15, 0x0 },
170 { 0x15, 0x15, 0x2a },
171 { 0x15, 0x3f, 0x0 },
172 { 0x15, 0x3f, 0x2a },
173 { 0x3f, 0x15, 0x0 },
174 { 0x3f, 0x15, 0x2a },
175 { 0x3f, 0x3f, 0x0 },
176 { 0x3f, 0x3f, 0x2a },
177 { 0x15, 0x15, 0x15 },
178 { 0x15, 0x15, 0x3f },
179 { 0x15, 0x3f, 0x15 },
180 { 0x15, 0x3f, 0x3f },
181 { 0x3f, 0x15, 0x15 },
182 { 0x3f, 0x15, 0x3f },
183 { 0x3f, 0x3f, 0x15 },
184 { 0x3f, 0x3f, 0x3f },
185 { 0x39, 0xc, 0x5 },
186 { 0x15, 0x2c, 0xf },
187 { 0x26, 0x10, 0x3d },
188 { 0x29, 0x29, 0x38 },
189 { 0x4, 0x1a, 0xe },
190 { 0x2, 0x1e, 0x3a },
191 { 0x3c, 0x25, 0x33 },
192 { 0x3c, 0xc, 0x2c },
193 { 0x3f, 0x3, 0x2b },
194 { 0x1c, 0x9, 0x13 },
195 { 0x25, 0x2a, 0x35 },
196 { 0x1e, 0xa, 0x38 },
197 { 0x24, 0x8, 0x3 },
198 { 0x3, 0xe, 0x36 },
199 { 0xc, 0x6, 0x2a },
200 { 0x26, 0x3, 0x32 },
201 { 0x5, 0x2f, 0x33 },
202 { 0x3c, 0x35, 0x2f },
203 { 0x2d, 0x26, 0x3e },
204 { 0xd, 0xa, 0x10 },
205 { 0x25, 0x3c, 0x11 },
206 { 0xd, 0x4, 0x2e },
207 { 0x5, 0x19, 0x3e },
208 { 0xc, 0x13, 0x34 },
209 { 0x2b, 0x6, 0x24 },
210 { 0x4, 0x3, 0xd },
211 { 0x2f, 0x3c, 0xc },
212 { 0x2a, 0x37, 0x1f },
213 { 0xf, 0x12, 0x38 },
214 { 0x38, 0xe, 0x2a },
215 { 0x12, 0x2f, 0x19 },
216 { 0x29, 0x2e, 0x31 },
217 { 0x25, 0x13, 0x3e },
218 { 0x33, 0x3e, 0x33 },
219 { 0x1d, 0x2c, 0x25 },
220 { 0x15, 0x15, 0x5 },
221 { 0x32, 0x25, 0x39 },
222 { 0x1a, 0x7, 0x1f },
223 { 0x13, 0xe, 0x1d },
224 { 0x36, 0x17, 0x34 },
225 { 0xf, 0x15, 0x23 },
226 { 0x2, 0x35, 0xd },
227 { 0x15, 0x3f, 0xc },
228 { 0x14, 0x2f, 0xf },
229 { 0x19, 0x21, 0x3e },
230 { 0x27, 0x11, 0x2f },
231 { 0x38, 0x3f, 0x3c },
232 { 0x36, 0x2d, 0x15 },
233 { 0x16, 0x17, 0x2 },
234 { 0x1, 0xa, 0x3d },
235 { 0x1b, 0x11, 0x3f },
236 { 0x21, 0x3c, 0xd },
237 { 0x1a, 0x39, 0x3d },
238 { 0x8, 0xe, 0xe },
239 { 0x22, 0x21, 0x23 },
240 { 0x1e, 0x30, 0x5 },
241 { 0x1f, 0x22, 0x3d },
242 { 0x1e, 0x2f, 0xa },
243 { 0x0, 0x1c, 0xe },
244 { 0x0, 0x1c, 0x15 },
245 { 0x0, 0x1c, 0x1c },
246 { 0x0, 0x15, 0x1c },
247 { 0x0, 0xe, 0x1c },
248 { 0x0, 0x7, 0x1c },
249 { 0xe, 0xe, 0x1c },
250 { 0x11, 0xe, 0x1c },
251 { 0x15, 0xe, 0x1c },
252 { 0x18, 0xe, 0x1c },
253 { 0x1c, 0xe, 0x1c },
254 { 0x1c, 0xe, 0x18 },
255 { 0x1c, 0xe, 0x15 },
256 { 0x1c, 0xe, 0x11 },
257 { 0x1c, 0xe, 0xe },
258 { 0x1c, 0x11, 0xe },
259 { 0x1c, 0x15, 0xe },
260 { 0x1c, 0x18, 0xe },
261 { 0x1c, 0x1c, 0xe },
262 { 0x18, 0x1c, 0xe },
263 { 0x15, 0x1c, 0xe },
264 { 0x11, 0x1c, 0xe },
265 { 0xe, 0x1c, 0xe },
266 { 0xe, 0x1c, 0x11 },
267 { 0xe, 0x1c, 0x15 },
268 { 0xe, 0x1c, 0x18 },
269 { 0xe, 0x1c, 0x1c },
270 { 0xe, 0x18, 0x1c },
271 { 0xe, 0x15, 0x1c },
272 { 0xe, 0x11, 0x1c },
273 { 0x14, 0x14, 0x1c },
274 { 0x16, 0x14, 0x1c },
275 { 0x18, 0x14, 0x1c },
276 { 0x1a, 0x14, 0x1c },
277 { 0x1c, 0x14, 0x1c },
278 { 0x1c, 0x14, 0x1a },
279 { 0x1c, 0x14, 0x18 },
280 { 0x1c, 0x14, 0x16 },
281 { 0x1c, 0x14, 0x14 },
282 { 0x1c, 0x16, 0x14 },
283 { 0x1c, 0x18, 0x14 },
284 { 0x1c, 0x1a, 0x14 },
285 { 0x1c, 0x1c, 0x14 },
286 { 0x1a, 0x1c, 0x14 },
287 { 0x18, 0x1c, 0x14 },
288 { 0x16, 0x1c, 0x14 },
289 { 0x14, 0x1c, 0x14 },
290 { 0x14, 0x1c, 0x16 },
291 { 0x14, 0x1c, 0x18 },
292 { 0x14, 0x1c, 0x1a },
293 { 0x14, 0x1c, 0x1c },
294 { 0x14, 0x1a, 0x1c },
295 { 0x14, 0x18, 0x1c },
296 { 0x14, 0x16, 0x1c },
297 { 0x0, 0x0, 0x10 },
298 { 0x4, 0x0, 0x10 },
299 { 0x8, 0x0, 0x10 },
300 { 0xc, 0x0, 0x10 },
301 { 0x10, 0x0, 0x10 },
302 { 0x10, 0x0, 0xc },
303 { 0x10, 0x0, 0x8 },
304 { 0x10, 0x0, 0x4 },
305 { 0x10, 0x0, 0x0 },
306 { 0x10, 0x4, 0x0 },
307 { 0x10, 0x8, 0x0 },
308 { 0x10, 0xc, 0x0 },
309 { 0x10, 0x10, 0x0 },
310 { 0xc, 0x10, 0x0 },
311 { 0x8, 0x10, 0x0 },
312 { 0x4, 0x10, 0x0 },
313 { 0x0, 0x10, 0x0 },
314 { 0x0, 0x10, 0x4 },
315 { 0x0, 0x10, 0x8 },
316 { 0x0, 0x10, 0xc },
317 { 0x0, 0x10, 0x10 },
318 { 0x0, 0xc, 0x10 },
319 { 0x0, 0x8, 0x10 },
320 { 0x0, 0x4, 0x10 },
321 { 0x8, 0x8, 0x10 },
322 { 0xa, 0x8, 0x10 },
323 { 0xc, 0x8, 0x10 },
324 { 0xe, 0x8, 0x10 },
325 { 0x10, 0x8, 0x10 },
326 { 0x10, 0x8, 0xe },
327 { 0x10, 0x8, 0xc },
328 { 0x10, 0x8, 0xa },
329 { 0x10, 0x8, 0x8 },
330 { 0x10, 0xa, 0x8 },
331 { 0x10, 0xc, 0x8 },
332 { 0x10, 0xe, 0x8 },
333 { 0x10, 0x10, 0x8 },
334 { 0xe, 0x10, 0x8 },
335 { 0xc, 0x10, 0x8 },
336 { 0xa, 0x10, 0x8 },
337 { 0x8, 0x10, 0x8 },
338 { 0x8, 0x10, 0xa },
339 { 0x8, 0x10, 0xc },
340 { 0x8, 0x10, 0xe },
341 { 0x8, 0x10, 0x10 },
342 { 0x8, 0xe, 0x10 },
343 { 0x8, 0xc, 0x10 },
344 { 0x8, 0xa, 0x10 },
345 { 0xb, 0xb, 0x10 },
346 { 0xc, 0xb, 0x10 },
347 { 0xd, 0xb, 0x10 },
348 { 0xf, 0xb, 0x10 },
349 { 0x10, 0xb, 0x10 },
350 { 0x10, 0xb, 0xf },
351 { 0x10, 0xb, 0xd },
352 { 0x10, 0xb, 0xc },
353 { 0x10, 0xb, 0xb },
354 { 0x10, 0xc, 0xb },
355 { 0x10, 0xd, 0xb },
356 { 0x10, 0xf, 0xb },
357 { 0x10, 0x10, 0xb },
358 { 0xf, 0x10, 0xb },
359 { 0xd, 0x10, 0xb },
360 { 0xc, 0x10, 0xb },
361 { 0xb, 0x10, 0xb },
362 { 0xb, 0x10, 0xc },
363 { 0xb, 0x10, 0xd },
364 { 0xb, 0x10, 0xf },
365 { 0xb, 0x10, 0x10 },
366 { 0xb, 0xf, 0x10 },
367 { 0xb, 0xd, 0x10 },
368 { 0xb, 0xc, 0x10 },
369 { 0x0, 0x0, 0x0 },
370 { 0x0, 0x0, 0x0 },
371 { 0x0, 0x0, 0x0 },
372 { 0x0, 0x0, 0x0 },
373 { 0x0, 0x0, 0x0 },
374 { 0x0, 0x0, 0x0 },
375 { 0x0, 0x0, 0x0 }
376};
377
378unsigned char AC[21] = {
379 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x14, 0x07,
380 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F,
381 0x0C, 0x00, 0x0F, 0x08, 0x00};
382
383static int scanPCI(int start_slt);
384static int PCIVendor(int);
385#ifdef DEBUG
386static void printslots(void);
387#endif
388extern void puthex(unsigned long);
389extern void puts(const char *);
390static void unlockS3(void);
391
392static inline void
393outw(int port, unsigned short val)
394{
395 outb(port, val >> 8);
396 outb(port+1, val);
397}
398
399int
400vga_init(unsigned char *ISA_mem)
401{
402 int slot;
403 struct VgaRegs *VgaTextRegs;
404
405 /* See if VGA already in TEXT mode - exit if so! */
406 outb(0x3CE, 0x06);
407 if ((inb(0x3CF) & 0x01) == 0){
408 puts("VGA already in text mode\n");
409 return 0;
410 }
411
412 /* If no VGA responding in text mode, then we have some work to do...
413 */
414 slot = -1;
415 while((slot = scanPCI(slot)) > -1) { /* find video card in use */
416 unlockVideo(slot); /* enable I/O to card */
417 VgaTextRegs = GenVgaTextRegs;
418
419 switch (PCIVendor(slot)) {
420 default:
421 break;
422 case(S3Vendor):
423 unlockS3();
424 break;
425
426 case(CirrusVendor):
427 outw(0x3C4, 0x0612); /* unlock ext regs */
428 outw(0x3C4, 0x0700); /* reset ext sequence mode */
429 break;
430
431 case(ParadiseVendor): /* IBM Portable 850 */
432 outw(0x3ce, 0x0f05); /* unlock pardise registers */
433 outw(0x3c4, 0x0648);
434 outw(0x3d4, 0x2985);
435 outw(0x3d4, 0x34a6);
436 outb(0x3ce, 0x0b); /* disable linear addressing */
437 outb(0x3cf, inb(0x3cf) & ~0x30);
438 outw(0x3c4, 0x1400);
439 outb(0x3ce, 0x0e); /* disable 256 color mode */
440 outb(0x3cf, inb(0x3cf) & ~0x01);
441 outb(0xd00, 0xff); /* enable auto-centering */
442 if (!(inb(0xd01) & 0x03)) {
443 outb(0x3d4, 0x33);
444 outb(0x3d5, inb(0x3d5) & ~0x90);
445 outb(0x3d4, 0x32);
446 outb(0x3d5, inb(0x3d5) | 0x04);
447 outw(0x3d4, 0x0250);
448 outw(0x3d4, 0x07ba);
449 outw(0x3d4, 0x0900);
450 outw(0x3d4, 0x15e7);
451 outw(0x3d4, 0x2a95);
452 }
453 outw(0x3d4, 0x34a0);
454 break;
455
456 #if 0 /* Untested - probably doesn't work */
457 case(MatroxVendor):
458 case(DiamondVendor):
459 puts("VGA Chip Vendor ID: ");
460 puthex(PCIVendor(slot));
461 puts("\n");
462 mdelay(1000);
463 #endif
464 };
465
466 outw(0x3C4, 0x0120); /* disable video */
467 setTextRegs(VgaTextRegs); /* initial register setup */
468 setTextCLUT(0); /* load color lookup table */
469 loadFont(ISA_mem); /* load font */
470 setTextRegs(VgaTextRegs); /* reload registers */
471 outw(0x3C4, 0x0100); /* re-enable video */
472 clearVideoMemory();
473
474 if (PCIVendor(slot) == S3Vendor) {
475 outb(0x3c2, 0x63); /* MISC */
476 } /* endif */
477
478 #ifdef DEBUG
479 printslots();
480 mdelay(5000);
481 #endif
482
483 mdelay(1000); /* give time for the video monitor to come up */
484 }
485 return (1); /* 'CRT' I/O supported */
486}
487
488/*
489 * Write to VGA Attribute registers.
490 */
491void
492writeAttr(unsigned char index, unsigned char data, unsigned char videoOn)
493{
494 unsigned char v;
495 v = inb(0x3da); /* reset attr. address toggle */
496 if (videoOn)
497 outb(0x3c0, (index & 0x1F) | 0x20);
498 else
499 outb(0x3c0, (index & 0x1F));
500 outb(0x3c0, data);
501}
502
503void
504setTextRegs(struct VgaRegs *svp)
505{
506 int i;
507
508 /*
509 * saved settings
510 */
511 while( svp->io_port != ENDMK ) {
512 outb(svp->io_port, svp->io_index);
513 outb(svp->io_port+1, svp->io_value);
514 svp++;
515 }
516
517 outb(0x3c2, 0x67); /* MISC */
518 outb(0x3c6, 0xff); /* MASK */
519
520 for ( i = 0; i < 0x10; i++)
521 writeAttr(i, AC[i], 0); /* palette */
522 writeAttr(0x10, 0x0c, 0); /* text mode */
523 writeAttr(0x11, 0x00, 0); /* overscan color (border) */
524 writeAttr(0x12, 0x0f, 0); /* plane enable */
525 writeAttr(0x13, 0x08, 0); /* pixel panning */
526 writeAttr(0x14, 0x00, 1); /* color select; video on */
527}
528
529void
530setTextCLUT(int shift)
531{
532 int i;
533
534 outb(0x3C6, 0xFF);
535 i = inb(0x3C7);
536 outb(0x3C8, 0);
537 i = inb(0x3C7);
538
539 for ( i = 0; i < 256; i++) {
540 outb(0x3C9, TextCLUT[i].r << shift);
541 outb(0x3C9, TextCLUT[i].g << shift);
542 outb(0x3C9, TextCLUT[i].b << shift);
543 }
544}
545
546void
547loadFont(unsigned char *ISA_mem)
548{
549 int i, j;
550 unsigned char *font_page = (unsigned char *) &ISA_mem[0xA0000];
551
552 outb(0x3C2, 0x67);
553 /*
554 * Load font
555 */
556 i = inb(0x3DA); /* Reset Attr toggle */
557
558 outb(0x3C0,0x30);
559 outb(0x3C0, 0x01); /* graphics mode */
560
561 outw(0x3C4, 0x0001); /* reset sequencer */
562 outw(0x3C4, 0x0204); /* write to plane 2 */
563 outw(0x3C4, 0x0406); /* enable plane graphics */
564 outw(0x3C4, 0x0003); /* reset sequencer */
565 outw(0x3CE, 0x0402); /* read plane 2 */
566 outw(0x3CE, 0x0500); /* write mode 0, read mode 0 */
567 outw(0x3CE, 0x0605); /* set graphics mode */
568
569 for (i = 0; i < sizeof(font); i += 16) {
570 for (j = 0; j < 16; j++) {
571 __asm__ volatile("eieio");
572 font_page[(2*i)+j] = font[i+j];
573 }
574 }
575}
576
577static void
578unlockS3(void)
579{
580 int s3_device_id;
581 outw(0x3d4, 0x3848);
582 outw(0x3d4, 0x39a5);
583 outb(0x3d4, 0x2d);
584 s3_device_id = inb(0x3d5) << 8;
585 outb(0x3d4, 0x2e);
586 s3_device_id |= inb(0x3d5);
587
588 if (s3_device_id != 0x8812) {
589 /* From the S3 manual */
590 outb(0x46E8, 0x10); /* Put into setup mode */
591 outb(0x3C3, 0x10);
592 outb(0x102, 0x01); /* Enable registers */
593 outb(0x46E8, 0x08); /* Enable video */
594 outb(0x3C3, 0x08);
595 outb(0x4AE8, 0x00);
596
597#if 0
598 outb(0x42E8, 0x80); /* Reset graphics engine? */
599#endif
600
601 outb(0x3D4, 0x38); /* Unlock all registers */
602 outb(0x3D5, 0x48);
603 outb(0x3D4, 0x39);
604 outb(0x3D5, 0xA5);
605 outb(0x3D4, 0x40);
606 outb(0x3D5, inb(0x3D5)|0x01);
607 outb(0x3D4, 0x33);
608 outb(0x3D5, inb(0x3D5)&~0x52);
609 outb(0x3D4, 0x35);
610 outb(0x3D5, inb(0x3D5)&~0x30);
611 outb(0x3D4, 0x3A);
612 outb(0x3D5, 0x00);
613 outb(0x3D4, 0x53);
614 outb(0x3D5, 0x00);
615 outb(0x3D4, 0x31);
616 outb(0x3D5, inb(0x3D5)&~0x4B);
617 outb(0x3D4, 0x58);
618
619 outb(0x3D5, 0);
620
621 outb(0x3D4, 0x54);
622 outb(0x3D5, 0x38);
623 outb(0x3D4, 0x60);
624 outb(0x3D5, 0x07);
625 outb(0x3D4, 0x61);
626 outb(0x3D5, 0x80);
627 outb(0x3D4, 0x62);
628 outb(0x3D5, 0xA1);
629 outb(0x3D4, 0x69); /* High order bits for cursor address */
630 outb(0x3D5, 0);
631
632 outb(0x3D4, 0x32);
633 outb(0x3D5, inb(0x3D5)&~0x10);
634 } else {
635 outw(0x3c4, 0x0806); /* IBM Portable 860 */
636 outw(0x3c4, 0x1041);
637 outw(0x3c4, 0x1128);
638 outw(0x3d4, 0x4000);
639 outw(0x3d4, 0x3100);
640 outw(0x3d4, 0x3a05);
641 outw(0x3d4, 0x6688);
642 outw(0x3d4, 0x5800); /* disable linear addressing */
643 outw(0x3d4, 0x4500); /* disable H/W cursor */
644 outw(0x3c4, 0x5410); /* enable auto-centering */
645 outw(0x3c4, 0x561f);
646 outw(0x3c4, 0x1b80); /* lock DCLK selection */
647 outw(0x3d4, 0x3900); /* lock S3 registers */
648 outw(0x3d4, 0x3800);
649 } /* endif */
650}
651
652/*
653 * cursor() sets an offset (0-1999) into the 80x25 text area.
654 */
655void
656cursor(int x, int y)
657{
658 int pos = (y*cols)+x;
659 outb(0x3D4, 14);
660 outb(0x3D5, pos >> 8);
661 outb(0x3D4, 15);
662 outb(0x3D5, pos);
663}
664
665void
666clearVideoMemory(void)
667{
668 int i, j;
669 for (i = 0; i < lines; i++) {
670 for (j = 0; j < cols; j++) {
671 vidmem[((i*cols)+j)*2] = 0x20; /* fill with space character */
672 vidmem[((i*cols)+j)*2+1] = 0x07; /* set bg & fg attributes */
673 }
674 }
675}
676
677/* ============ */
678
679
680#define NSLOTS 8
681#define NPCIREGS 5
682
683
684/*
685 should use devfunc number/indirect method to be totally safe on
686 all machines, this works for now on 3 slot Moto boxes
687*/
688
689struct PCI_ConfigInfo {
690 unsigned long * config_addr;
691 unsigned long regs[NPCIREGS];
692} PCI_slots [NSLOTS] = {
693
694 { (unsigned long *)0x80808000, {0xDEADBEEF,} }, /* onboard */
695 { (unsigned long *)0x80800800, {0xDEADBEEF,} }, /* onboard */
696 { (unsigned long *)0x80801000, {0xDEADBEEF,} }, /* onboard */
697 { (unsigned long *)0x80802000, {0xDEADBEEF,} }, /* onboard */
698 { (unsigned long *)0x80804000, {0xDEADBEEF,} }, /* onboard */
699 { (unsigned long *)0x80810000, {0xDEADBEEF,} }, /* slot A/1 */
700 { (unsigned long *)0x80820000, {0xDEADBEEF,} }, /* slot B/2 */
701 { (unsigned long *)0x80840000, {0xDEADBEEF,} } /* slot C/3 */
702};
703
704
705
706/*
707 * The following code modifies the PCI Command register
708 * to enable memory and I/O accesses.
709 */
710void
711unlockVideo(int slot)
712{
713 volatile unsigned char * ppci;
714
715 ppci = (unsigned char * )PCI_slots[slot].config_addr;
716 ppci[4] = 0x0003; /* enable memory and I/O accesses */
717 ppci[0x10] = 0x00000; /* turn off memory mapping */
718 ppci[0x11] = 0x00000; /* mem_base = 0 */
719 ppci[0x12] = 0x00000;
720 ppci[0x13] = 0x00000;
721 __asm__ volatile("eieio");
722
723 outb(0x3d4, 0x11);
724 outb(0x3d5, 0x0e); /* unlock CR0-CR7 */
725}
726
727long
728SwapBytes(long lv) /* turn little endian into big indian long */
729{
730 long t;
731 t = (lv&0x000000FF) << 24;
732 t |= (lv&0x0000FF00) << 8;
733 t |= (lv&0x00FF0000) >> 8;
734 t |= (lv&0xFF000000) >> 24;
735 return(t);
736}
737
738
739#define DEVID 0
740#define CMD 1
741#define CLASS 2
742#define MEMBASE 4
743
744int
745scanPCI(int start_slt)
746{
747 int slt, r;
748 struct PCI_ConfigInfo *pslot;
749 int theSlot = -1;
750 int highVgaSlot = 0;
751
752 for ( slt = start_slt + 1; slt < NSLOTS; slt++) {
753 pslot = &PCI_slots[slt];
754 for ( r = 0; r < NPCIREGS; r++) {
755 pslot->regs[r] = SwapBytes ( pslot->config_addr[r] );
756 }
757 /* card in slot ? */
758 if ( pslot->regs[DEVID] != 0xFFFFFFFF ) {
759 /* VGA ? */
760 if ( ((pslot->regs[CLASS] & 0xFFFFFF00) == 0x03000000) ||
761 ((pslot->regs[CLASS] & 0xFFFFFF00) == 0x00010000)) {
762 highVgaSlot = slt;
763 /* did firmware enable it ? */
764 if ( (pslot->regs[CMD] & 0x03) ) {
765 theSlot = slt;
766 break;
767 }
768 }
769 }
770 }
771
772 return ( theSlot );
773}
774
775/* return Vendor ID of card in the slot */
776static
777int PCIVendor(int slotnum) {
778 struct PCI_ConfigInfo *pslot;
779
780 pslot = &PCI_slots[slotnum];
781
782return (pslot->regs[DEVID] & 0xFFFF);
783}
784
785#ifdef DEBUG
786static
787void printslots(void)
788{
789 int i;
790#if 0
791 struct PCI_ConfigInfo *pslot;
792#endif
793 for(i=0; i < NSLOTS; i++) {
794#if 0
795 pslot = &PCI_slots[i];
796 printf("Slot: %d, Addr: %x, Vendor: %08x, Class: %08x\n",
797 i, pslot->config_addr, pslot->regs[0], pslot->regs[2]);
798#else
799 puts("PCI Slot number: "); puthex(i);
800 puts(" Vendor ID: ");
801 puthex(PCIVendor(i)); puts("\n");
802#endif
803 }
804}
805#endif /* DEBUG */
diff --git a/arch/ppc/boot/of1275/Makefile b/arch/ppc/boot/of1275/Makefile
deleted file mode 100644
index 0b979c004972..000000000000
--- a/arch/ppc/boot/of1275/Makefile
+++ /dev/null
@@ -1,6 +0,0 @@
1#
2# Makefile of1275 stuff
3#
4
5lib-y := claim.o enter.o exit.o finddevice.o getprop.o ofinit.o \
6 ofstdio.o read.o release.o write.o map.o call_prom.o
diff --git a/arch/ppc/boot/of1275/call_prom.c b/arch/ppc/boot/of1275/call_prom.c
deleted file mode 100644
index 9479a3a2b8c7..000000000000
--- a/arch/ppc/boot/of1275/call_prom.c
+++ /dev/null
@@ -1,74 +0,0 @@
1/*
2 * Copyright (C) 1996-2005 Paul Mackerras.
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 "of1275.h"
11#include <stdarg.h>
12
13int call_prom(const char *service, int nargs, int nret, ...)
14{
15 int i;
16 struct prom_args {
17 const char *service;
18 int nargs;
19 int nret;
20 unsigned int args[12];
21 } args;
22 va_list list;
23
24 args.service = service;
25 args.nargs = nargs;
26 args.nret = nret;
27
28 va_start(list, nret);
29 for (i = 0; i < nargs; i++)
30 args.args[i] = va_arg(list, unsigned int);
31 va_end(list);
32
33 for (i = 0; i < nret; i++)
34 args.args[nargs+i] = 0;
35
36 if (of_prom_entry(&args) < 0)
37 return -1;
38
39 return (nret > 0)? args.args[nargs]: 0;
40}
41
42int call_prom_ret(const char *service, int nargs, int nret,
43 unsigned int *rets, ...)
44{
45 int i;
46 struct prom_args {
47 const char *service;
48 int nargs;
49 int nret;
50 unsigned int args[12];
51 } args;
52 va_list list;
53
54 args.service = service;
55 args.nargs = nargs;
56 args.nret = nret;
57
58 va_start(list, rets);
59 for (i = 0; i < nargs; i++)
60 args.args[i] = va_arg(list, unsigned int);
61 va_end(list);
62
63 for (i = 0; i < nret; i++)
64 args.args[nargs+i] = 0;
65
66 if (of_prom_entry(&args) < 0)
67 return -1;
68
69 if (rets != (void *) 0)
70 for (i = 1; i < nret; ++i)
71 rets[i-1] = args.args[nargs+i];
72
73 return (nret > 0)? args.args[nargs]: 0;
74}
diff --git a/arch/ppc/boot/of1275/claim.c b/arch/ppc/boot/of1275/claim.c
deleted file mode 100644
index 1ed3aeeff8ae..000000000000
--- a/arch/ppc/boot/of1275/claim.c
+++ /dev/null
@@ -1,92 +0,0 @@
1/*
2 * Copyright (C) Paul Mackerras 1997.
3 * Copyright (C) Leigh Brown 2002.
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version
8 * 2 of the License, or (at your option) any later version.
9 */
10
11#include "of1275.h"
12#include "nonstdio.h"
13
14/*
15 * Older OF's require that when claiming a specific range of addresses,
16 * we claim the physical space in the /memory node and the virtual
17 * space in the chosen mmu node, and then do a map operation to
18 * map virtual to physical.
19 */
20static int need_map = -1;
21static ihandle chosen_mmu;
22static phandle memory;
23
24/* returns true if s2 is a prefix of s1 */
25static int string_match(const char *s1, const char *s2)
26{
27 for (; *s2; ++s2)
28 if (*s1++ != *s2)
29 return 0;
30 return 1;
31}
32
33static int check_of_version(void)
34{
35 phandle oprom, chosen;
36 char version[64];
37
38 oprom = finddevice("/openprom");
39 if (oprom == OF_INVALID_HANDLE)
40 return 0;
41 if (getprop(oprom, "model", version, sizeof(version)) <= 0)
42 return 0;
43 version[sizeof(version)-1] = 0;
44 printf("OF version = '%s'\n", version);
45 if (!string_match(version, "Open Firmware, 1.")
46 && !string_match(version, "FirmWorks,3."))
47 return 0;
48 chosen = finddevice("/chosen");
49 if (chosen == OF_INVALID_HANDLE) {
50 chosen = finddevice("/chosen@0");
51 if (chosen == OF_INVALID_HANDLE) {
52 printf("no chosen\n");
53 return 0;
54 }
55 }
56 if (getprop(chosen, "mmu", &chosen_mmu, sizeof(chosen_mmu)) <= 0) {
57 printf("no mmu\n");
58 return 0;
59 }
60 memory = (ihandle) call_prom("open", 1, 1, "/memory");
61 if (memory == OF_INVALID_HANDLE) {
62 memory = (ihandle) call_prom("open", 1, 1, "/memory@0");
63 if (memory == OF_INVALID_HANDLE) {
64 printf("no memory node\n");
65 return 0;
66 }
67 }
68 printf("old OF detected\n");
69 return 1;
70}
71
72void *claim(unsigned int virt, unsigned int size, unsigned int align)
73{
74 int ret;
75 unsigned int result;
76
77 if (need_map < 0)
78 need_map = check_of_version();
79 if (align || !need_map)
80 return (void *) call_prom("claim", 3, 1, virt, size, align);
81
82 ret = call_prom_ret("call-method", 5, 2, &result, "claim", memory,
83 align, size, virt);
84 if (ret != 0 || result == -1)
85 return (void *) -1;
86 ret = call_prom_ret("call-method", 5, 2, &result, "claim", chosen_mmu,
87 align, size, virt);
88 /* 0x12 == coherent + read/write */
89 ret = call_prom("call-method", 6, 1, "map", chosen_mmu,
90 0x12, size, virt, virt);
91 return virt;
92}
diff --git a/arch/ppc/boot/of1275/enter.c b/arch/ppc/boot/of1275/enter.c
deleted file mode 100644
index abe87a8fe2db..000000000000
--- a/arch/ppc/boot/of1275/enter.c
+++ /dev/null
@@ -1,22 +0,0 @@
1/*
2 * Copyright (C) Paul Mackerras 1997.
3 * Copyright (C) Leigh Brown 2002.
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version
8 * 2 of the License, or (at your option) any later version.
9 */
10
11#include "of1275.h"
12
13void
14enter(void)
15{
16 struct prom_args {
17 char *service;
18 } args;
19
20 args.service = "enter";
21 (*of_prom_entry)(&args);
22}
diff --git a/arch/ppc/boot/of1275/exit.c b/arch/ppc/boot/of1275/exit.c
deleted file mode 100644
index b9f89b6a8b45..000000000000
--- a/arch/ppc/boot/of1275/exit.c
+++ /dev/null
@@ -1,24 +0,0 @@
1/*
2 * Copyright (C) Paul Mackerras 1997.
3 * Copyright (C) Leigh Brown 2002.
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version
8 * 2 of the License, or (at your option) any later version.
9 */
10
11#include "of1275.h"
12
13void
14exit(void)
15{
16 struct prom_args {
17 char *service;
18 } args;
19
20 for (;;) {
21 args.service = "exit";
22 (*of_prom_entry)(&args);
23 }
24}
diff --git a/arch/ppc/boot/of1275/finddevice.c b/arch/ppc/boot/of1275/finddevice.c
deleted file mode 100644
index 0dcb1201b772..000000000000
--- a/arch/ppc/boot/of1275/finddevice.c
+++ /dev/null
@@ -1,16 +0,0 @@
1/*
2 * Copyright (C) Paul Mackerras 1997.
3 * Copyright (C) Leigh Brown 2002.
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version
8 * 2 of the License, or (at your option) any later version.
9 */
10
11#include "of1275.h"
12
13phandle finddevice(const char *name)
14{
15 return (phandle) call_prom("finddevice", 1, 1, name);
16}
diff --git a/arch/ppc/boot/of1275/getprop.c b/arch/ppc/boot/of1275/getprop.c
deleted file mode 100644
index 0cf75f035e4e..000000000000
--- a/arch/ppc/boot/of1275/getprop.c
+++ /dev/null
@@ -1,37 +0,0 @@
1/*
2 * Copyright (C) Paul Mackerras 1997.
3 * Copyright (C) Leigh Brown 2002.
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version
8 * 2 of the License, or (at your option) any later version.
9 */
10
11#include "of1275.h"
12
13int
14getprop(phandle node, const char *name, void *buf, int buflen)
15{
16 struct prom_args {
17 char *service;
18 int nargs;
19 int nret;
20 phandle node;
21 const char *name;
22 void *buf;
23 int buflen;
24 int size;
25 } args;
26
27 args.service = "getprop";
28 args.nargs = 4;
29 args.nret = 1;
30 args.node = node;
31 args.name = name;
32 args.buf = buf;
33 args.buflen = buflen;
34 args.size = -1;
35 (*of_prom_entry)(&args);
36 return args.size;
37}
diff --git a/arch/ppc/boot/of1275/map.c b/arch/ppc/boot/of1275/map.c
deleted file mode 100644
index 443256c6f6d6..000000000000
--- a/arch/ppc/boot/of1275/map.c
+++ /dev/null
@@ -1,48 +0,0 @@
1/*
2 * Copyright (C) Paul Mackerras 1997.
3 * Copyright (C) Leigh Brown 2002.
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version
8 * 2 of the License, or (at your option) any later version.
9 */
10
11#include "of1275.h"
12#include "nonstdio.h"
13
14extern ihandle of_prom_mmu;
15
16int
17map(unsigned int phys, unsigned int virt, unsigned int size)
18{
19 struct prom_args {
20 char *service;
21 int nargs;
22 int nret;
23 char *method;
24 ihandle mmu_ihandle;
25 int misc;
26 unsigned int size;
27 unsigned int virt;
28 unsigned int phys;
29 int ret0;
30 } args;
31
32 if (of_prom_mmu == 0) {
33 printf("map() called, no MMU found\n");
34 return -1;
35 }
36 args.service = "call-method";
37 args.nargs = 6;
38 args.nret = 1;
39 args.method = "map";
40 args.mmu_ihandle = of_prom_mmu;
41 args.misc = 0;
42 args.phys = phys;
43 args.virt = virt;
44 args.size = size;
45 (*of_prom_entry)(&args);
46
47 return (int)args.ret0;
48}
diff --git a/arch/ppc/boot/of1275/ofinit.c b/arch/ppc/boot/of1275/ofinit.c
deleted file mode 100644
index 0ee8af7639e9..000000000000
--- a/arch/ppc/boot/of1275/ofinit.c
+++ /dev/null
@@ -1,27 +0,0 @@
1/*
2 * Copyright (C) Paul Mackerras 1997.
3 * Copyright (C) Leigh Brown 2002.
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version
8 * 2 of the License, or (at your option) any later version.
9 */
10
11#include "of1275.h"
12
13prom_entry of_prom_entry;
14ihandle of_prom_mmu;
15
16void
17ofinit(prom_entry prom_ptr)
18{
19 phandle chosen;
20
21 of_prom_entry = prom_ptr;
22
23 if ((chosen = finddevice("/chosen")) == OF_INVALID_HANDLE)
24 return;
25 if (getprop(chosen, "mmu", &of_prom_mmu, sizeof(ihandle)) != 4)
26 return;
27}
diff --git a/arch/ppc/boot/of1275/ofstdio.c b/arch/ppc/boot/of1275/ofstdio.c
deleted file mode 100644
index 10abbe32b31f..000000000000
--- a/arch/ppc/boot/of1275/ofstdio.c
+++ /dev/null
@@ -1,32 +0,0 @@
1/*
2 * Copyright (C) Paul Mackerras 1997.
3 * Copyright (C) Leigh Brown 2002.
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version
8 * 2 of the License, or (at your option) any later version.
9 */
10
11#include "of1275.h"
12
13int
14ofstdio(ihandle *stdin, ihandle *stdout, ihandle *stderr)
15{
16 ihandle in, out;
17 phandle chosen;
18
19 if ((chosen = finddevice("/chosen")) == OF_INVALID_HANDLE)
20 goto err;
21 if (getprop(chosen, "stdout", &out, sizeof(out)) != 4)
22 goto err;
23 if (getprop(chosen, "stdin", &in, sizeof(in)) != 4)
24 goto err;
25
26 *stdin = in;
27 *stdout = out;
28 *stderr = out;
29 return 0;
30err:
31 return -1;
32}
diff --git a/arch/ppc/boot/of1275/read.c b/arch/ppc/boot/of1275/read.c
deleted file mode 100644
index 122813649fce..000000000000
--- a/arch/ppc/boot/of1275/read.c
+++ /dev/null
@@ -1,35 +0,0 @@
1/*
2 * Copyright (C) Paul Mackerras 1997.
3 * Copyright (C) Leigh Brown 2002.
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version
8 * 2 of the License, or (at your option) any later version.
9 */
10
11#include "of1275.h"
12
13int
14read(ihandle instance, void *buf, int buflen)
15{
16 struct prom_args {
17 char *service;
18 int nargs;
19 int nret;
20 ihandle instance;
21 void *buf;
22 int buflen;
23 int actual;
24 } args;
25
26 args.service = "read";
27 args.nargs = 3;
28 args.nret = 1;
29 args.instance = instance;
30 args.buf = buf;
31 args.buflen = buflen;
32 args.actual = -1;
33 (*of_prom_entry)(&args);
34 return args.actual;
35}
diff --git a/arch/ppc/boot/of1275/release.c b/arch/ppc/boot/of1275/release.c
deleted file mode 100644
index 28032d37145d..000000000000
--- a/arch/ppc/boot/of1275/release.c
+++ /dev/null
@@ -1,30 +0,0 @@
1/*
2 * Copyright (C) Paul Mackerras 1997.
3 * Copyright (C) Leigh Brown 2002.
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version
8 * 2 of the License, or (at your option) any later version.
9 */
10
11#include "of1275.h"
12
13void
14release(void *virt, unsigned int size)
15{
16 struct prom_args {
17 char *service;
18 int nargs;
19 int nret;
20 void *virt;
21 unsigned int size;
22 } args;
23
24 args.service = "release";
25 args.nargs = 2;
26 args.nret = 0;
27 args.virt = virt;
28 args.size = size;
29 (*of_prom_entry)(&args);
30}
diff --git a/arch/ppc/boot/of1275/write.c b/arch/ppc/boot/of1275/write.c
deleted file mode 100644
index 7361b9b2fca5..000000000000
--- a/arch/ppc/boot/of1275/write.c
+++ /dev/null
@@ -1,35 +0,0 @@
1/*
2 * Copyright (C) Paul Mackerras 1997.
3 * Copyright (C) Leigh Brown 2002.
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version
8 * 2 of the License, or (at your option) any later version.
9 */
10
11#include "of1275.h"
12
13int
14write(ihandle instance, void *buf, int buflen)
15{
16 struct prom_args {
17 char *service;
18 int nargs;
19 int nret;
20 ihandle instance;
21 void *buf;
22 int buflen;
23 int actual;
24 } args;
25
26 args.service = "write";
27 args.nargs = 3;
28 args.nret = 1;
29 args.instance = instance;
30 args.buf = buf;
31 args.buflen = buflen;
32 args.actual = -1;
33 (*of_prom_entry)(&args);
34 return args.actual;
35}
diff --git a/arch/ppc/boot/simple/Makefile b/arch/ppc/boot/simple/Makefile
deleted file mode 100644
index 5b877792d14f..000000000000
--- a/arch/ppc/boot/simple/Makefile
+++ /dev/null
@@ -1,277 +0,0 @@
1# This is far from simple, but I couldn't think of a good name. This is
2# for making the 'zImage' or 'zImage.initrd' on a number of targets.
3#
4# Author: Tom Rini <trini@mvista.com>
5#
6# Notes:
7# (1) For machines that do not want to use the ELF image directly (including
8# stripping just the ELF header off), they must set the variables
9# zimage-$(CONFIG_MACHINE) and zimagerd-$(CONFIG_MACHINE) to the target
10# that produces the desired image and they must set end-$(CONFIG_MACHINE)
11# to what will be suffixed to the image filename.
12# (2) Regardless of (1), to have the resulting image be something other
13# than 'zImage.elf', set end-$(CONFIG_MACHINE) to be the suffix used for
14# the zImage, znetboot, and znetbootrd targets.
15# (3) For machine targets which use the mktree program, you can optionally
16# set entrypoint-$(CONFIG_MACHINE) to the location which the image should be
17# loaded at. The optimal setting for entrypoint-$(CONFIG_MACHINE) is the link
18# address.
19# (4) It is advisable to pass in the memory size using BI_MEMSIZE and
20# get_mem_size(), which is memory controller dependent. Add in the correct
21# XXX_memory.o file for this to work, as well as editing the
22# misc-$(CONFIG_MACHINE) variable.
23
24boot := arch/ppc/boot
25common := $(boot)/common
26utils := $(boot)/utils
27bootlib := $(boot)/lib
28images := $(boot)/images
29of1275 := $(boot)/of1275
30tftpboot := /tftpboot
31
32# Normally, we use the 'misc.c' file for decompress_kernel and
33# whatnot. Sometimes we need to override this however.
34misc-y := misc.o
35
36# Normally, we have our images end in .elf, but something we want to
37# change this.
38end-y := elf
39
40# Additionally, we normally don't need to mess with the L2 / L3 caches
41# if present on 'classic' PPC.
42cacheflag-y := -DCLEAR_CACHES=""
43# This file will flush / disable the L2, and L3 if present.
44clear_L2_L3 := $(srctree)/$(boot)/simple/clear.S
45
46#
47# See arch/ppc/kconfig and arch/ppc/platforms/Kconfig
48# for definition of what platform each config option refer to.
49#----------------------------------------------------------------------------
50 zimage-$(CONFIG_CPCI690) := zImage-STRIPELF
51zimageinitrd-$(CONFIG_CPCI690) := zImage.initrd-STRIPELF
52 extra.o-$(CONFIG_CPCI690) := misc-cpci690.o
53 end-$(CONFIG_CPCI690) := cpci690
54 cacheflag-$(CONFIG_CPCI690) := -include $(clear_L2_L3)
55
56 zimage-$(CONFIG_IBM_OPENBIOS) := zImage-TREE
57zimageinitrd-$(CONFIG_IBM_OPENBIOS) := zImage.initrd-TREE
58 end-$(CONFIG_IBM_OPENBIOS) := treeboot
59 misc-$(CONFIG_IBM_OPENBIOS) := misc-embedded.o
60
61 end-$(CONFIG_EMBEDDEDBOOT) := embedded
62 misc-$(CONFIG_EMBEDDEDBOOT) := misc-embedded.o
63
64 zimage-$(CONFIG_BAMBOO) := zImage-TREE
65zimageinitrd-$(CONFIG_BAMBOO) := zImage.initrd-TREE
66 end-$(CONFIG_BAMBOO) := bamboo
67 entrypoint-$(CONFIG_BAMBOO) := 0x01000000
68 extra.o-$(CONFIG_BAMBOO) := pibs.o
69
70 zimage-$(CONFIG_BUBINGA) := zImage-TREE
71zimageinitrd-$(CONFIG_BUBINGA) := zImage.initrd-TREE
72 end-$(CONFIG_BUBINGA) := bubinga
73 entrypoint-$(CONFIG_BUBINGA) := 0x01000000
74 extra.o-$(CONFIG_BUBINGA) := openbios.o
75
76 zimage-$(CONFIG_EBONY) := zImage-TREE
77zimageinitrd-$(CONFIG_EBONY) := zImage.initrd-TREE
78 end-$(CONFIG_EBONY) := ebony
79 entrypoint-$(CONFIG_EBONY) := 0x01000000
80 extra.o-$(CONFIG_EBONY) := openbios.o
81
82 zimage-$(CONFIG_LUAN) := zImage-TREE
83zimageinitrd-$(CONFIG_LUAN) := zImage.initrd-TREE
84 end-$(CONFIG_LUAN) := luan
85 entrypoint-$(CONFIG_LUAN) := 0x01000000
86 extra.o-$(CONFIG_LUAN) := pibs.o
87
88 zimage-$(CONFIG_YUCCA) := zImage-TREE
89zimageinitrd-$(CONFIG_YUCCA) := zImage.initrd-TREE
90 end-$(CONFIG_YUCCA) := yucca
91 entrypoint-$(CONFIG_YUCCA) := 0x01000000
92 extra.o-$(CONFIG_YUCCA) := pibs.o
93
94 zimage-$(CONFIG_OCOTEA) := zImage-TREE
95zimageinitrd-$(CONFIG_OCOTEA) := zImage.initrd-TREE
96 end-$(CONFIG_OCOTEA) := ocotea
97 entrypoint-$(CONFIG_OCOTEA) := 0x01000000
98 extra.o-$(CONFIG_OCOTEA) := pibs.o
99
100 zimage-$(CONFIG_SYCAMORE) := zImage-TREE
101zimageinitrd-$(CONFIG_SYCAMORE) := zImage.initrd-TREE
102 end-$(CONFIG_SYCAMORE) := sycamore
103 entrypoint-$(CONFIG_SYCAMORE) := 0x01000000
104 extra.o-$(CONFIG_SYCAMORE) := openbios.o
105
106 zimage-$(CONFIG_WALNUT) := zImage-TREE
107zimageinitrd-$(CONFIG_WALNUT) := zImage.initrd-TREE
108 end-$(CONFIG_WALNUT) := walnut
109 entrypoint-$(CONFIG_WALNUT) := 0x01000000
110 extra.o-$(CONFIG_WALNUT) := openbios.o
111
112 extra.o-$(CONFIG_EV64260) := misc-ev64260.o
113 end-$(CONFIG_EV64260) := ev64260
114 cacheflag-$(CONFIG_EV64260) := -include $(clear_L2_L3)
115
116 extra.o-$(CONFIG_CHESTNUT) := misc-chestnut.o
117 end-$(CONFIG_CHESTNUT) := chestnut
118
119 extra.o-$(CONFIG_KATANA) := misc-katana.o
120 end-$(CONFIG_KATANA) := katana
121 cacheflag-$(CONFIG_KATANA) := -include $(clear_L2_L3)
122
123 extra.o-$(CONFIG_RADSTONE_PPC7D) := misc-radstone_ppc7d.o
124 end-$(CONFIG_RADSTONE_PPC7D) := radstone_ppc7d
125 cacheflag-$(CONFIG_RADSTONE_PPC7D) := -include $(clear_L2_L3)
126
127 extra.o-$(CONFIG_EV64360) := misc-ev64360.o
128 end-$(CONFIG_EV64360) := ev64360
129 cacheflag-$(CONFIG_EV64360) := -include $(clear_L2_L3)
130
131# kconfig 'feature', only one of these will ever be 'y' at a time.
132# The rest will be unset.
133motorola := $(CONFIG_MVME5100)$(CONFIG_PRPMC750) \
134$(CONFIG_PRPMC800)$(CONFIG_LOPEC)$(CONFIG_PPLUS)
135motorola := $(strip $(motorola))
136
137 zimage-$(motorola) := zImage-PPLUS
138zimageinitrd-$(motorola) := zImage.initrd-PPLUS
139 end-$(motorola) := pplus
140
141# Overrides previous assingment
142 extra.o-$(CONFIG_PPLUS) := prepmap.o
143 extra.o-$(CONFIG_LOPEC) := mpc10x_memory.o
144
145# Really only valid if CONFIG_6xx=y
146 zimage-$(CONFIG_PPC_PREP) := zImage-PPLUS
147zimageinitrd-$(CONFIG_PPC_PREP) := zImage.initrd-PPLUS
148ifeq ($(CONFIG_6xx),y)
149 extra.o-$(CONFIG_PPC_PREP) := prepmap.o
150 misc-$(CONFIG_PPC_PREP) += misc-prep.o mpc10x_memory.o
151endif
152 end-$(CONFIG_PPC_PREP) := prep
153
154 end-$(CONFIG_SANDPOINT) := sandpoint
155 cacheflag-$(CONFIG_SANDPOINT) := -include $(clear_L2_L3)
156
157 zimage-$(CONFIG_SPRUCE) := zImage-TREE
158zimageinitrd-$(CONFIG_SPRUCE) := zImage.initrd-TREE
159 end-$(CONFIG_SPRUCE) := spruce
160 entrypoint-$(CONFIG_SPRUCE) := 0x00800000
161 misc-$(CONFIG_SPRUCE) += misc-spruce.o
162
163 zimage-$(CONFIG_LITE5200) := zImage-STRIPELF
164zimageinitrd-$(CONFIG_LITE5200) := zImage.initrd-STRIPELF
165 end-$(CONFIG_LITE5200) := lite5200
166 cacheflag-$(CONFIG_LITE5200) := -include $(clear_L2_L3)
167
168
169# SMP images should have a '.smp' suffix.
170 end-$(CONFIG_SMP) := $(end-y).smp
171
172# This is a treeboot that needs init functions until the
173# boot rom is sorted out (i.e. this is short lived)
174EXTRA_AFLAGS := $(extra-aflags-y)
175# head.o needs to get the cacheflags defined.
176AFLAGS_head.o += $(cacheflag-y)
177
178# Linker args. This specifies where the image will be run at.
179LD_ARGS := -T $(srctree)/$(boot)/ld.script \
180 -Ttext $(CONFIG_BOOT_LOAD) -Bstatic
181OBJCOPY_ARGS := -O elf32-powerpc
182
183# head.o and relocate.o must be at the start.
184boot-y := head.o relocate.o $(extra.o-y) $(misc-y)
185boot-$(CONFIG_REDWOOD_5) += embed_config.o
186boot-$(CONFIG_REDWOOD_6) += embed_config.o
187boot-$(CONFIG_8xx) += embed_config.o
188boot-$(CONFIG_8260) += embed_config.o
189boot-$(CONFIG_EP405) += embed_config.o
190boot-$(CONFIG_XILINX_ML300) += embed_config.o
191boot-$(CONFIG_XILINX_ML403) += embed_config.o
192boot-$(CONFIG_BSEIP) += iic.o
193boot-$(CONFIG_MBX) += iic.o pci.o qspan_pci.o
194boot-$(CONFIG_MV64X60) += misc-mv64x60.o
195boot-$(CONFIG_RPXCLASSIC) += iic.o pci.o qspan_pci.o
196boot-$(CONFIG_RPXLITE) += iic.o
197# Different boards need different serial implementations.
198ifeq ($(CONFIG_SERIAL_CPM_CONSOLE),y)
199boot-$(CONFIG_8xx) += m8xx_tty.o
200boot-$(CONFIG_8260) += m8260_tty.o
201endif
202boot-$(CONFIG_SERIAL_MPC52xx_CONSOLE) += mpc52xx_tty.o
203boot-$(CONFIG_SERIAL_MPSC_CONSOLE) += mv64x60_tty.o
204boot-$(CONFIG_SERIAL_UARTLITE_CONSOLE) += uartlite_tty.o
205
206LIBS := $(common)/lib.a $(bootlib)/lib.a
207ifeq ($(CONFIG_PPC_PREP),y)
208LIBS += $(of1275)/lib.a
209endif
210
211OBJS := $(addprefix $(obj)/,$(boot-y))
212
213# Tools
214MKBUGBOOT := $(utils)/mkbugboot
215MKPREP := $(utils)/mkprep
216MKTREE := $(utils)/mktree
217
218targets := dummy.o
219
220$(obj)/zvmlinux: $(OBJS) $(LIBS) $(srctree)/$(boot)/ld.script \
221 $(images)/vmlinux.gz $(obj)/dummy.o
222 $(OBJCOPY) $(OBJCOPY_ARGS) \
223 --add-section=.image=$(images)/vmlinux.gz \
224 --set-section-flags=.image=contents,alloc,load,readonly,data \
225 $(obj)/dummy.o $(obj)/image.o
226 $(LD) $(LD_ARGS) -o $@ $(OBJS) $(obj)/image.o $(LIBS)
227 $(OBJCOPY) $(OBJCOPY_ARGS) $@ $@ -R .comment -R .stab \
228 -R .stabstr -R .ramdisk
229
230$(obj)/zvmlinux.initrd: $(OBJS) $(LIBS) $(srctree)/$(boot)/ld.script \
231 $(images)/vmlinux.gz $(obj)/dummy.o
232 $(OBJCOPY) $(OBJCOPY_ARGS) \
233 --add-section=.ramdisk=$(images)/ramdisk.image.gz \
234 --set-section-flags=.ramdisk=contents,alloc,load,readonly,data \
235 --add-section=.image=$(images)/vmlinux.gz \
236 --set-section-flags=.image=contents,alloc,load,readonly,data \
237 $(obj)/dummy.o $(obj)/image.o
238 $(LD) $(LD_ARGS) -o $@ $(OBJS) $(obj)/image.o $(LIBS)
239 $(OBJCOPY) $(OBJCOPY_ARGS) $@ $@ -R .comment -R .stab \
240 -R .stabstr
241
242# Sort-of dummy rules, that let us format the image we want.
243zImage: $(images)/$(zimage-y) $(obj)/zvmlinux
244 cp -f $(obj)/zvmlinux $(images)/zImage.elf
245 rm -f $(obj)/zvmlinux
246
247zImage.initrd: $(images)/$(zimageinitrd-y) $(obj)/zvmlinux.initrd
248 cp -f $(obj)/zvmlinux.initrd $(images)/zImage.initrd.elf
249 rm -f $(obj)/zvmlinux.initrd
250
251znetboot: zImage
252 cp $(images)/zImage.$(end-y) $(tftpboot)/zImage.$(end-y)
253
254znetboot.initrd: zImage.initrd
255 cp $(images)/zImage.initrd.$(end-y) $(tftpboot)/zImage.initrd.$(end-y)
256
257$(images)/zImage-STRIPELF: $(obj)/zvmlinux
258 dd if=$(obj)/zvmlinux of=$(images)/zImage.$(end-y) skip=64 bs=1k
259
260$(images)/zImage.initrd-STRIPELF: $(obj)/zvmlinux.initrd
261 dd if=$(obj)/zvmlinux.initrd of=$(images)/zImage.initrd.$(end-y) \
262 skip=64 bs=1k
263
264$(images)/zImage-TREE: $(obj)/zvmlinux $(MKTREE)
265 $(MKTREE) $(obj)/zvmlinux $(images)/zImage.$(end-y) $(entrypoint-y)
266
267$(images)/zImage.initrd-TREE: $(obj)/zvmlinux.initrd $(MKTREE)
268 $(MKTREE) $(obj)/zvmlinux.initrd $(images)/zImage.initrd.$(end-y) \
269 $(entrypoint-y)
270
271$(images)/zImage-PPLUS: $(obj)/zvmlinux $(MKPREP) $(MKBUGBOOT)
272 $(MKPREP) -pbp $(obj)/zvmlinux $(images)/zImage.$(end-y)
273 $(MKBUGBOOT) $(obj)/zvmlinux $(images)/zImage.bugboot
274
275$(images)/zImage.initrd-PPLUS: $(obj)/zvmlinux.initrd $(MKPREP) $(MKBUGBOOT)
276 $(MKPREP) -pbp $(obj)/zvmlinux.initrd $(images)/zImage.initrd.$(end-y)
277 $(MKBUGBOOT) $(obj)/zvmlinux.initrd $(images)/zImage.initrd.bugboot
diff --git a/arch/ppc/boot/simple/chrpmap.c b/arch/ppc/boot/simple/chrpmap.c
deleted file mode 100644
index 14d9e05d98bb..000000000000
--- a/arch/ppc/boot/simple/chrpmap.c
+++ /dev/null
@@ -1,12 +0,0 @@
1/*
2 * 2004 (C) IBM. This file is licensed under the terms of the GNU General
3 * Public License version 2. This program is licensed "as is" without any
4 * warranty of any kind, whether express or implied.
5 */
6
7#include <nonstdio.h>
8
9void board_isa_init(void)
10{
11 ISA_init(0xFE000000);
12}
diff --git a/arch/ppc/boot/simple/clear.S b/arch/ppc/boot/simple/clear.S
deleted file mode 100644
index 95c5647a0f51..000000000000
--- a/arch/ppc/boot/simple/clear.S
+++ /dev/null
@@ -1,19 +0,0 @@
1/*
2 * Code to call _setup_L2CR to flus, invalidate and disable the L2,
3 * and if present, do the same to the L3.
4 */
5
6#define CLEAR_CACHES \
7 bl _setup_L2CR; \
8 \
9 /* If 745x, turn off L3CR as well */ \
10 mfspr r8,SPRN_PVR; \
11 srwi r8,r8,16; \
12 \
13 cmpli cr0,r8,0x8000; /* 7450 */ \
14 cmpli cr1,r8,0x8001; /* 7455 */ \
15 cmpli cr2,r8,0x8002; /* 7457 */ \
16 /* Now test if any are true. */ \
17 cror 4*cr0+eq,4*cr0+eq,4*cr1+eq; \
18 cror 4*cr0+eq,4*cr0+eq,4*cr2+eq; \
19 beql _setup_L3CR
diff --git a/arch/ppc/boot/simple/cpc700_memory.c b/arch/ppc/boot/simple/cpc700_memory.c
deleted file mode 100644
index d75420a45a59..000000000000
--- a/arch/ppc/boot/simple/cpc700_memory.c
+++ /dev/null
@@ -1,34 +0,0 @@
1/*
2 * Find memory based upon settings in the CPC700 bridge
3 *
4 * Author: Dan Cox
5 *
6 * 2001-2002 (c) MontaVista, Software, Inc. This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10 */
11
12#include <asm/types.h>
13#include <asm/io.h>
14#include "cpc700.h"
15
16unsigned long
17cpc700_get_mem_size(void)
18{
19 int i;
20 unsigned long len, amt;
21
22 /* Start at MB1EA, since MB0EA will most likely be the ending address
23 for ROM space. */
24 for(len = 0, i = CPC700_MB1EA; i <= CPC700_MB4EA; i+=4) {
25 amt = cpc700_read_memreg(i);
26 if (amt == 0)
27 break;
28 len = amt;
29 }
30
31 return len;
32}
33
34
diff --git a/arch/ppc/boot/simple/dummy.c b/arch/ppc/boot/simple/dummy.c
deleted file mode 100644
index 31dbf45bf99c..000000000000
--- a/arch/ppc/boot/simple/dummy.c
+++ /dev/null
@@ -1,4 +0,0 @@
1int main(void)
2{
3 return 0;
4}
diff --git a/arch/ppc/boot/simple/embed_config.c b/arch/ppc/boot/simple/embed_config.c
deleted file mode 100644
index 3b46792d7b8b..000000000000
--- a/arch/ppc/boot/simple/embed_config.c
+++ /dev/null
@@ -1,938 +0,0 @@
1/* Board specific functions for those embedded 8xx boards that do
2 * not have boot monitor support for board information.
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 */
9
10#include <linux/types.h>
11#include <linux/string.h>
12#include <asm/reg.h>
13#ifdef CONFIG_8xx
14#include <asm/mpc8xx.h>
15#endif
16#ifdef CONFIG_8260
17#include <asm/mpc8260.h>
18#include <asm/immap_cpm2.h>
19#endif
20#ifdef CONFIG_40x
21#include <asm/io.h>
22#endif
23#ifdef CONFIG_XILINX_VIRTEX
24#include <platforms/4xx/xparameters/xparameters.h>
25#endif
26extern unsigned long timebase_period_ns;
27
28/* For those boards that don't provide one.
29*/
30#if !defined(CONFIG_MBX)
31static bd_t bdinfo;
32#endif
33
34/* IIC functions.
35 * These are just the basic master read/write operations so we can
36 * examine serial EEPROM.
37 */
38extern void iic_read(uint devaddr, u_char *buf, uint offset, uint count);
39
40/* Supply a default Ethernet address for those eval boards that don't
41 * ship with one. This is an address from the MBX board I have, so
42 * it is unlikely you will find it on your network.
43 */
44static ushort def_enet_addr[] = { 0x0800, 0x3e26, 0x1559 };
45
46#if defined(CONFIG_MBX)
47
48/* The MBX hands us a pretty much ready to go board descriptor. This
49 * is where the idea started in the first place.
50 */
51void
52embed_config(bd_t **bdp)
53{
54 u_char *mp;
55 u_char eebuf[128];
56 int i = 8;
57 bd_t *bd;
58
59 bd = *bdp;
60
61 /* Read the first 128 bytes of the EEPROM. There is more,
62 * but this is all we need.
63 */
64 iic_read(0xa4, eebuf, 0, 128);
65
66 /* All we are looking for is the Ethernet MAC address. The
67 * first 8 bytes are 'MOTOROLA', so check for part of that.
68 * Next, the VPD describes a MAC 'packet' as being of type 08
69 * and size 06. So we look for that and the MAC must follow.
70 * If there are more than one, we still only care about the first.
71 * If it's there, assume we have a valid MAC address. If not,
72 * grab our default one.
73 */
74 if ((*(uint *)eebuf) == 0x4d4f544f) {
75 while (i < 127 && !(eebuf[i] == 0x08 && eebuf[i + 1] == 0x06))
76 i += eebuf[i + 1] + 2; /* skip this packet */
77
78 if (i == 127) /* Couldn't find. */
79 mp = (u_char *)def_enet_addr;
80 else
81 mp = &eebuf[i + 2];
82 }
83 else
84 mp = (u_char *)def_enet_addr;
85
86 for (i=0; i<6; i++)
87 bd->bi_enetaddr[i] = *mp++;
88
89 /* The boot rom passes these to us in MHz. Linux now expects
90 * them to be in Hz.
91 */
92 bd->bi_intfreq *= 1000000;
93 bd->bi_busfreq *= 1000000;
94
95 /* Stuff a baud rate here as well.
96 */
97 bd->bi_baudrate = 9600;
98}
99#endif /* CONFIG_MBX */
100
101#if defined(CONFIG_RPXLITE) || defined(CONFIG_RPXCLASSIC) || \
102 defined(CONFIG_RPX8260) || defined(CONFIG_EP405)
103/* Helper functions for Embedded Planet boards.
104*/
105/* Because I didn't find anything that would do this.......
106*/
107u_char
108aschex_to_byte(u_char *cp)
109{
110 u_char byte, c;
111
112 c = *cp++;
113
114 if ((c >= 'A') && (c <= 'F')) {
115 c -= 'A';
116 c += 10;
117 } else if ((c >= 'a') && (c <= 'f')) {
118 c -= 'a';
119 c += 10;
120 } else
121 c -= '0';
122
123 byte = c * 16;
124
125 c = *cp;
126
127 if ((c >= 'A') && (c <= 'F')) {
128 c -= 'A';
129 c += 10;
130 } else if ((c >= 'a') && (c <= 'f')) {
131 c -= 'a';
132 c += 10;
133 } else
134 c -= '0';
135
136 byte += c;
137
138 return(byte);
139}
140
141static void
142rpx_eth(bd_t *bd, u_char *cp)
143{
144 int i;
145
146 for (i=0; i<6; i++) {
147 bd->bi_enetaddr[i] = aschex_to_byte(cp);
148 cp += 2;
149 }
150}
151
152#ifdef CONFIG_RPX8260
153static uint
154rpx_baseten(u_char *cp)
155{
156 uint retval;
157
158 retval = 0;
159
160 while (*cp != '\n') {
161 retval *= 10;
162 retval += (*cp) - '0';
163 cp++;
164 }
165 return(retval);
166}
167#endif
168
169#if defined(CONFIG_RPXLITE) || defined(CONFIG_RPXCLASSIC)
170static void
171rpx_brate(bd_t *bd, u_char *cp)
172{
173 uint rate;
174
175 rate = 0;
176
177 while (*cp != '\n') {
178 rate *= 10;
179 rate += (*cp) - '0';
180 cp++;
181 }
182
183 bd->bi_baudrate = rate * 100;
184}
185
186static void
187rpx_cpuspeed(bd_t *bd, u_char *cp)
188{
189 uint num, den;
190
191 num = den = 0;
192
193 while (*cp != '\n') {
194 num *= 10;
195 num += (*cp) - '0';
196 cp++;
197 if (*cp == '/') {
198 cp++;
199 den = (*cp) - '0';
200 break;
201 }
202 }
203
204 /* I don't know why the RPX just can't state the actual
205 * CPU speed.....
206 */
207 if (den) {
208 num /= den;
209 num *= den;
210 }
211 bd->bi_intfreq = bd->bi_busfreq = num * 1000000;
212
213 /* The 8xx can only run a maximum 50 MHz bus speed (until
214 * Motorola changes this :-). Greater than 50 MHz parts
215 * run internal/2 for bus speed.
216 */
217 if (num > 50)
218 bd->bi_busfreq /= 2;
219}
220#endif
221
222#if defined(CONFIG_RPXLITE) || defined(CONFIG_RPXCLASSIC) || defined(CONFIG_EP405)
223static void
224rpx_memsize(bd_t *bd, u_char *cp)
225{
226 uint size;
227
228 size = 0;
229
230 while (*cp != '\n') {
231 size *= 10;
232 size += (*cp) - '0';
233 cp++;
234 }
235
236 bd->bi_memsize = size * 1024 * 1024;
237}
238#endif /* LITE || CLASSIC || EP405 */
239#if defined(CONFIG_EP405)
240static void
241rpx_nvramsize(bd_t *bd, u_char *cp)
242{
243 uint size;
244
245 size = 0;
246
247 while (*cp != '\n') {
248 size *= 10;
249 size += (*cp) - '0';
250 cp++;
251 }
252
253 bd->bi_nvramsize = size * 1024;
254}
255#endif /* CONFIG_EP405 */
256
257#endif /* Embedded Planet boards */
258
259#if defined(CONFIG_RPXLITE) || defined(CONFIG_RPXCLASSIC)
260
261/* Read the EEPROM on the RPX-Lite board.
262*/
263void
264embed_config(bd_t **bdp)
265{
266 u_char eebuf[256], *cp;
267 bd_t *bd;
268
269 /* Read the first 256 bytes of the EEPROM. I think this
270 * is really all there is, and I hope if it gets bigger the
271 * info we want is still up front.
272 */
273 bd = &bdinfo;
274 *bdp = bd;
275
276#if 1
277 iic_read(0xa8, eebuf, 0, 128);
278 iic_read(0xa8, &eebuf[128], 128, 128);
279
280 /* We look for two things, the Ethernet address and the
281 * serial baud rate. The records are separated by
282 * newlines.
283 */
284 cp = eebuf;
285 for (;;) {
286 if (*cp == 'E') {
287 cp++;
288 if (*cp == 'A') {
289 cp += 2;
290 rpx_eth(bd, cp);
291 }
292 }
293 if (*cp == 'S') {
294 cp++;
295 if (*cp == 'B') {
296 cp += 2;
297 rpx_brate(bd, cp);
298 }
299 }
300 if (*cp == 'D') {
301 cp++;
302 if (*cp == '1') {
303 cp += 2;
304 rpx_memsize(bd, cp);
305 }
306 }
307 if (*cp == 'H') {
308 cp++;
309 if (*cp == 'Z') {
310 cp += 2;
311 rpx_cpuspeed(bd, cp);
312 }
313 }
314
315 /* Scan to the end of the record.
316 */
317 while ((*cp != '\n') && (*cp != 0xff))
318 cp++;
319
320 /* If the next character is a 0 or ff, we are done.
321 */
322 cp++;
323 if ((*cp == 0) || (*cp == 0xff))
324 break;
325 }
326 bd->bi_memstart = 0;
327#else
328 /* For boards without initialized EEPROM.
329 */
330 bd->bi_memstart = 0;
331 bd->bi_memsize = (8 * 1024 * 1024);
332 bd->bi_intfreq = 48000000;
333 bd->bi_busfreq = 48000000;
334 bd->bi_baudrate = 9600;
335#endif
336}
337#endif /* RPXLITE || RPXCLASSIC */
338
339#ifdef CONFIG_BSEIP
340/* Build a board information structure for the BSE ip-Engine.
341 * There is more to come since we will add some environment
342 * variables and a function to read them.
343 */
344void
345embed_config(bd_t **bdp)
346{
347 u_char *cp;
348 int i;
349 bd_t *bd;
350
351 bd = &bdinfo;
352 *bdp = bd;
353
354 /* Baud rate and processor speed will eventually come
355 * from the environment variables.
356 */
357 bd->bi_baudrate = 9600;
358
359 /* Get the Ethernet station address from the Flash ROM.
360 */
361 cp = (u_char *)0xfe003ffa;
362 for (i=0; i<6; i++) {
363 bd->bi_enetaddr[i] = *cp++;
364 }
365
366 /* The rest of this should come from the environment as well.
367 */
368 bd->bi_memstart = 0;
369 bd->bi_memsize = (16 * 1024 * 1024);
370 bd->bi_intfreq = 48000000;
371 bd->bi_busfreq = 48000000;
372}
373#endif /* BSEIP */
374
375#ifdef CONFIG_FADS
376/* Build a board information structure for the FADS.
377 */
378void
379embed_config(bd_t **bdp)
380{
381 u_char *cp;
382 int i;
383 bd_t *bd;
384
385 bd = &bdinfo;
386 *bdp = bd;
387
388 /* Just fill in some known values.
389 */
390 bd->bi_baudrate = 9600;
391
392 /* Use default enet.
393 */
394 cp = (u_char *)def_enet_addr;
395 for (i=0; i<6; i++) {
396 bd->bi_enetaddr[i] = *cp++;
397 }
398
399 bd->bi_memstart = 0;
400 bd->bi_memsize = (8 * 1024 * 1024);
401 bd->bi_intfreq = 40000000;
402 bd->bi_busfreq = 40000000;
403}
404#endif /* FADS */
405
406#ifdef CONFIG_8260
407/* Compute 8260 clock values if the rom doesn't provide them.
408 */
409static unsigned char bus2core_8260[] = {
410/* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
411 3, 2, 2, 2, 4, 4, 5, 9, 6, 11, 8, 10, 3, 12, 7, 2,
412 6, 5, 13, 2, 14, 4, 15, 2, 3, 11, 8, 10, 16, 12, 7, 2,
413};
414
415static void
416clk_8260(bd_t *bd)
417{
418 uint scmr, vco_out, clkin;
419 uint plldf, pllmf, corecnf;
420 volatile cpm2_map_t *ip;
421
422 ip = (cpm2_map_t *)CPM_MAP_ADDR;
423 scmr = ip->im_clkrst.car_scmr;
424
425 /* The clkin is always bus frequency.
426 */
427 clkin = bd->bi_busfreq;
428
429 /* Collect the bits from the scmr.
430 */
431 plldf = (scmr >> 12) & 1;
432 pllmf = scmr & 0xfff;
433 corecnf = (scmr >> 24) &0x1f;
434
435 /* This is arithmetic from the 8260 manual.
436 */
437 vco_out = clkin / (plldf + 1);
438 vco_out *= 2 * (pllmf + 1);
439 bd->bi_vco = vco_out; /* Save for later */
440
441 bd->bi_cpmfreq = vco_out / 2; /* CPM Freq, in MHz */
442 bd->bi_intfreq = bd->bi_busfreq * bus2core_8260[corecnf] / 2;
443
444 /* Set Baud rate divisor. The power up default is divide by 16,
445 * but we set it again here in case it was changed.
446 */
447 ip->im_clkrst.car_sccr = 1; /* DIV 16 BRG */
448 bd->bi_brgfreq = vco_out / 16;
449}
450
451static unsigned char bus2core_8280[] = {
452/* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
453 3, 2, 2, 2, 4, 4, 5, 9, 6, 11, 8, 10, 3, 12, 7, 2,
454 6, 5, 13, 2, 14, 2, 15, 2, 3, 2, 2, 2, 16, 2, 2, 2,
455};
456
457static void
458clk_8280(bd_t *bd)
459{
460 uint scmr, main_clk, clkin;
461 uint pllmf, corecnf;
462 volatile cpm2_map_t *ip;
463
464 ip = (cpm2_map_t *)CPM_MAP_ADDR;
465 scmr = ip->im_clkrst.car_scmr;
466
467 /* The clkin is always bus frequency.
468 */
469 clkin = bd->bi_busfreq;
470
471 /* Collect the bits from the scmr.
472 */
473 pllmf = scmr & 0xf;
474 corecnf = (scmr >> 24) & 0x1f;
475
476 /* This is arithmetic from the 8280 manual.
477 */
478 main_clk = clkin * (pllmf + 1);
479
480 bd->bi_cpmfreq = main_clk / 2; /* CPM Freq, in MHz */
481 bd->bi_intfreq = bd->bi_busfreq * bus2core_8280[corecnf] / 2;
482
483 /* Set Baud rate divisor. The power up default is divide by 16,
484 * but we set it again here in case it was changed.
485 */
486 ip->im_clkrst.car_sccr = (ip->im_clkrst.car_sccr & 0x3) | 0x1;
487 bd->bi_brgfreq = main_clk / 16;
488}
489#endif
490
491#ifdef CONFIG_SBC82xx
492void
493embed_config(bd_t **bdp)
494{
495 u_char *cp;
496 int i;
497 bd_t *bd;
498 unsigned long pvr;
499
500 bd = *bdp;
501
502 bd = &bdinfo;
503 *bdp = bd;
504 bd->bi_baudrate = 9600;
505 bd->bi_memsize = 256 * 1024 * 1024; /* just a guess */
506
507 cp = (void*)SBC82xx_MACADDR_NVRAM_SCC1;
508 memcpy(bd->bi_enetaddr, cp, 6);
509
510 /* can busfreq be calculated? */
511 pvr = mfspr(SPRN_PVR);
512 if ((pvr & 0xffff0000) == 0x80820000) {
513 bd->bi_busfreq = 100000000;
514 clk_8280(bd);
515 } else {
516 bd->bi_busfreq = 66000000;
517 clk_8260(bd);
518 }
519
520}
521#endif /* SBC82xx */
522
523#if defined(CONFIG_EST8260) || defined(CONFIG_TQM8260)
524void
525embed_config(bd_t **bdp)
526{
527 u_char *cp;
528 int i;
529 bd_t *bd;
530
531 bd = *bdp;
532#if 0
533 /* This is actually provided by my boot rom. I have it
534 * here for those people that may load the kernel with
535 * a JTAG/COP tool and not the rom monitor.
536 */
537 bd->bi_baudrate = 115200;
538 bd->bi_intfreq = 200000000;
539 bd->bi_busfreq = 66666666;
540 bd->bi_cpmfreq = 66666666;
541 bd->bi_brgfreq = 33333333;
542 bd->bi_memsize = 16 * 1024 * 1024;
543#else
544 /* The boot rom passes these to us in MHz. Linux now expects
545 * them to be in Hz.
546 */
547 bd->bi_intfreq *= 1000000;
548 bd->bi_busfreq *= 1000000;
549 bd->bi_cpmfreq *= 1000000;
550 bd->bi_brgfreq *= 1000000;
551#endif
552
553 cp = (u_char *)def_enet_addr;
554 for (i=0; i<6; i++) {
555 bd->bi_enetaddr[i] = *cp++;
556 }
557}
558#endif /* EST8260 */
559
560#ifdef CONFIG_SBS8260
561void
562embed_config(bd_t **bdp)
563{
564 u_char *cp;
565 int i;
566 bd_t *bd;
567
568 /* This should provided by the boot rom.
569 */
570 bd = &bdinfo;
571 *bdp = bd;
572 bd->bi_baudrate = 9600;
573 bd->bi_memsize = 64 * 1024 * 1024;
574
575 /* Set all of the clocks. We have to know the speed of the
576 * external clock. The development board had 66 MHz.
577 */
578 bd->bi_busfreq = 66666666;
579 clk_8260(bd);
580
581 /* I don't know how to compute this yet.
582 */
583 bd->bi_intfreq = 133000000;
584
585
586 cp = (u_char *)def_enet_addr;
587 for (i=0; i<6; i++) {
588 bd->bi_enetaddr[i] = *cp++;
589 }
590}
591#endif /* SBS8260 */
592
593#ifdef CONFIG_RPX8260
594void
595embed_config(bd_t **bdp)
596{
597 u_char *cp, *keyvals;
598 int i;
599 bd_t *bd;
600
601 keyvals = (u_char *)*bdp;
602
603 bd = &bdinfo;
604 *bdp = bd;
605
606 /* This is almost identical to the RPX-Lite/Classic functions
607 * on the 8xx boards. It would be nice to have a key lookup
608 * function in a string, but the format of all of the fields
609 * is slightly different.
610 */
611 cp = keyvals;
612 for (;;) {
613 if (*cp == 'E') {
614 cp++;
615 if (*cp == 'A') {
616 cp += 2;
617 rpx_eth(bd, cp);
618 }
619 }
620 if (*cp == 'S') {
621 cp++;
622 if (*cp == 'B') {
623 cp += 2;
624 bd->bi_baudrate = rpx_baseten(cp);
625 }
626 }
627 if (*cp == 'D') {
628 cp++;
629 if (*cp == '1') {
630 cp += 2;
631 bd->bi_memsize = rpx_baseten(cp) * 1024 * 1024;
632 }
633 }
634 if (*cp == 'X') {
635 cp++;
636 if (*cp == 'T') {
637 cp += 2;
638 bd->bi_busfreq = rpx_baseten(cp);
639 }
640 }
641 if (*cp == 'N') {
642 cp++;
643 if (*cp == 'V') {
644 cp += 2;
645 bd->bi_nvsize = rpx_baseten(cp) * 1024 * 1024;
646 }
647 }
648
649 /* Scan to the end of the record.
650 */
651 while ((*cp != '\n') && (*cp != 0xff))
652 cp++;
653
654 /* If the next character is a 0 or ff, we are done.
655 */
656 cp++;
657 if ((*cp == 0) || (*cp == 0xff))
658 break;
659 }
660 bd->bi_memstart = 0;
661
662 /* The memory size includes both the 60x and local bus DRAM.
663 * I don't want to use the local bus DRAM for real memory,
664 * so subtract it out. It would be nice if they were separate
665 * keys.
666 */
667 bd->bi_memsize -= 32 * 1024 * 1024;
668
669 /* Set all of the clocks. We have to know the speed of the
670 * external clock.
671 */
672 clk_8260(bd);
673
674 /* I don't know how to compute this yet.
675 */
676 bd->bi_intfreq = 200000000;
677}
678#endif /* RPX6 for testing */
679
680#ifdef CONFIG_ADS8260
681void
682embed_config(bd_t **bdp)
683{
684 u_char *cp;
685 int i;
686 bd_t *bd;
687
688 /* This should provided by the boot rom.
689 */
690 bd = &bdinfo;
691 *bdp = bd;
692 bd->bi_baudrate = 9600;
693 bd->bi_memsize = 16 * 1024 * 1024;
694
695 /* Set all of the clocks. We have to know the speed of the
696 * external clock. The development board had 66 MHz.
697 */
698 bd->bi_busfreq = 66666666;
699 clk_8260(bd);
700
701 /* I don't know how to compute this yet.
702 */
703 bd->bi_intfreq = 200000000;
704
705
706 cp = (u_char *)def_enet_addr;
707 for (i=0; i<6; i++) {
708 bd->bi_enetaddr[i] = *cp++;
709 }
710}
711#endif /* ADS8260 */
712
713#ifdef CONFIG_WILLOW
714void
715embed_config(bd_t **bdp)
716{
717 u_char *cp;
718 int i;
719 bd_t *bd;
720
721 /* Willow has Open Firmware....I should learn how to get this
722 * information from it.
723 */
724 bd = &bdinfo;
725 *bdp = bd;
726 bd->bi_baudrate = 9600;
727 bd->bi_memsize = 32 * 1024 * 1024;
728
729 /* Set all of the clocks. We have to know the speed of the
730 * external clock. The development board had 66 MHz.
731 */
732 bd->bi_busfreq = 66666666;
733 clk_8260(bd);
734
735 /* I don't know how to compute this yet.
736 */
737 bd->bi_intfreq = 200000000;
738
739
740 cp = (u_char *)def_enet_addr;
741 for (i=0; i<6; i++) {
742 bd->bi_enetaddr[i] = *cp++;
743 }
744}
745#endif /* WILLOW */
746
747#if defined(CONFIG_XILINX_ML300) || defined(CONFIG_XILINX_ML403)
748void
749embed_config(bd_t ** bdp)
750{
751 static const unsigned long line_size = 32;
752 static const unsigned long congruence_classes = 256;
753 unsigned long addr;
754 unsigned long dccr;
755 uint8_t* cp;
756 bd_t *bd;
757 int i;
758
759 /*
760 * Invalidate the data cache if the data cache is turned off.
761 * - The 405 core does not invalidate the data cache on power-up
762 * or reset but does turn off the data cache. We cannot assume
763 * that the cache contents are valid.
764 * - If the data cache is turned on this must have been done by
765 * a bootloader and we assume that the cache contents are
766 * valid.
767 */
768 __asm__("mfdccr %0": "=r" (dccr));
769 if (dccr == 0) {
770 for (addr = 0;
771 addr < (congruence_classes * line_size);
772 addr += line_size) {
773 __asm__("dccci 0,%0": :"b"(addr));
774 }
775 }
776
777 bd = &bdinfo;
778 *bdp = bd;
779 bd->bi_memsize = XPAR_DDR_0_SIZE;
780 bd->bi_intfreq = XPAR_CORE_CLOCK_FREQ_HZ;
781 bd->bi_busfreq = XPAR_PLB_CLOCK_FREQ_HZ;
782 bd->bi_pci_busfreq = XPAR_PCI_0_CLOCK_FREQ_HZ;
783
784 /* Copy the default ethernet address */
785 cp = (u_char *)def_enet_addr;
786 for (i=0; i<6; i++)
787 bd->bi_enetaddr[i] = *cp++;
788
789 timebase_period_ns = 1000000000 / bd->bi_tbfreq;
790 /* see bi_tbfreq definition in arch/ppc/platforms/4xx/xilinx_ml300.h */
791}
792#endif /* CONFIG_XILINX_ML300 || CONFIG_XILINX_ML403 */
793
794#ifdef CONFIG_IBM_OPENBIOS
795/* This could possibly work for all treeboot roms.
796*/
797#if defined(CONFIG_BUBINGA)
798#define BOARD_INFO_VECTOR 0xFFF80B50 /* openbios 1.19 moved this vector down - armin */
799#else
800#define BOARD_INFO_VECTOR 0xFFFE0B50
801#endif
802
803void
804embed_config(bd_t **bdp)
805{
806 u_char *cp;
807 int i;
808 bd_t *bd, *treeboot_bd;
809 bd_t *(*get_board_info)(void) =
810 (bd_t *(*)(void))(*(unsigned long *)BOARD_INFO_VECTOR);
811#if !defined(CONFIG_STB03xxx)
812
813 /* shut down the Ethernet controller that the boot rom
814 * sometimes leaves running.
815 */
816 mtdcr(DCRN_MALCR(DCRN_MAL_BASE), MALCR_MMSR); /* 1st reset MAL */
817 while (mfdcr(DCRN_MALCR(DCRN_MAL_BASE)) & MALCR_MMSR) {}; /* wait for the reset */
818 out_be32((volatile u32*)EMAC0_BASE,0x20000000); /* then reset EMAC */
819#endif
820
821 bd = &bdinfo;
822 *bdp = bd;
823 if ((treeboot_bd = get_board_info()) != NULL) {
824 memcpy(bd, treeboot_bd, sizeof(bd_t));
825 }
826 else {
827 /* Hmmm...better try to stuff some defaults.
828 */
829 bd->bi_memsize = 16 * 1024 * 1024;
830 cp = (u_char *)def_enet_addr;
831 for (i=0; i<6; i++) {
832 /* I should probably put different ones here,
833 * hopefully only one is used.
834 */
835 bd->BD_EMAC_ADDR(0,i) = *cp;
836
837#ifdef CONFIG_PCI
838 bd->bi_pci_enetaddr[i] = *cp++;
839#endif
840 }
841 bd->bi_tbfreq = 200 * 1000 * 1000;
842 bd->bi_intfreq = 200000000;
843 bd->bi_busfreq = 100000000;
844#ifdef CONFIG_PCI
845 bd->bi_pci_busfreq = 66666666;
846#endif
847 }
848 /* Yeah, this look weird, but on Redwood 4 they are
849 * different object in the structure. Sincr Redwwood 5
850 * and Redwood 6 use OpenBIOS, it requires a special value.
851 */
852#if defined(CONFIG_REDWOOD_5) || defined (CONFIG_REDWOOD_6)
853 bd->bi_tbfreq = 27 * 1000 * 1000;
854#endif
855 timebase_period_ns = 1000000000 / bd->bi_tbfreq;
856}
857#endif /* CONFIG_IBM_OPENBIOS */
858
859#ifdef CONFIG_EP405
860#include <linux/serial_reg.h>
861
862void
863embed_config(bd_t **bdp)
864{
865 u32 chcr0;
866 u_char *cp;
867 bd_t *bd;
868
869 /* Different versions of the PlanetCore firmware vary in how
870 they set up the serial port - in particular whether they
871 use the internal or external serial clock for UART0. Make
872 sure the UART is in a known state. */
873 /* FIXME: We should use the board's 11.0592MHz external serial
874 clock - it will be more accurate for serial rates. For
875 now, however the baud rates in ep405.h are for the internal
876 clock. */
877 chcr0 = mfdcr(DCRN_CHCR0);
878 if ( (chcr0 & 0x1fff) != 0x103e ) {
879 mtdcr(DCRN_CHCR0, (chcr0 & 0xffffe000) | 0x103e);
880 /* The following tricks serial_init() into resetting the baud rate */
881 writeb(0, UART0_IO_BASE + UART_LCR);
882 }
883
884 /* We haven't seen actual problems with the EP405 leaving the
885 * EMAC running (as we have on Walnut). But the registers
886 * suggest it may not be left completely quiescent. Reset it
887 * just to be sure. */
888 mtdcr(DCRN_MALCR(DCRN_MAL_BASE), MALCR_MMSR); /* 1st reset MAL */
889 while (mfdcr(DCRN_MALCR(DCRN_MAL_BASE)) & MALCR_MMSR) {}; /* wait for the reset */
890 out_be32((unsigned *)EMAC0_BASE,0x20000000); /* then reset EMAC */
891
892 bd = &bdinfo;
893 *bdp = bd;
894#if 1
895 cp = (u_char *)0xF0000EE0;
896 for (;;) {
897 if (*cp == 'E') {
898 cp++;
899 if (*cp == 'A') {
900 cp += 2;
901 rpx_eth(bd, cp);
902 }
903 }
904
905 if (*cp == 'D') {
906 cp++;
907 if (*cp == '1') {
908 cp += 2;
909 rpx_memsize(bd, cp);
910 }
911 }
912
913 if (*cp == 'N') {
914 cp++;
915 if (*cp == 'V') {
916 cp += 2;
917 rpx_nvramsize(bd, cp);
918 }
919 }
920 while ((*cp != '\n') && (*cp != 0xff))
921 cp++;
922
923 cp++;
924 if ((*cp == 0) || (*cp == 0xff))
925 break;
926 }
927 bd->bi_intfreq = 200000000;
928 bd->bi_busfreq = 100000000;
929 bd->bi_pci_busfreq= 33000000 ;
930#else
931
932 bd->bi_memsize = 64000000;
933 bd->bi_intfreq = 200000000;
934 bd->bi_busfreq = 100000000;
935 bd->bi_pci_busfreq= 33000000 ;
936#endif
937}
938#endif
diff --git a/arch/ppc/boot/simple/head.S b/arch/ppc/boot/simple/head.S
deleted file mode 100644
index 1b4d7b1d4ec1..000000000000
--- a/arch/ppc/boot/simple/head.S
+++ /dev/null
@@ -1,137 +0,0 @@
1/*
2 * Initial board bringup code for many different boards.
3 *
4 * Author: Tom Rini
5 * trini@mvista.com
6 * Derived from arch/ppc/boot/prep/head.S (Cort Dougan, many others).
7 *
8 * 2001-2004 (c) MontaVista, Software, Inc. This file is licensed under
9 * the terms of the GNU General Public License version 2. This program
10 * is licensed "as is" without any warranty of any kind, whether express
11 * or implied.
12 */
13
14#include <asm/reg.h>
15#include <asm/cache.h>
16#include <asm/ppc_asm.h>
17
18 .text
19
20/*
21 * Begin at some arbitrary location in RAM or Flash
22 * Initialize core registers
23 * Configure memory controller (Not executing from RAM)
24 * Move the boot code to the link address (8M)
25 * Setup C stack
26 * Initialize UART
27 * Decompress the kernel to 0x0
28 * Jump to the kernel entry
29 *
30 */
31
32 .globl start
33start:
34 bl start_
35#ifdef CONFIG_IBM_OPENBIOS
36 /* The IBM "Tree" bootrom knows that the address of the bootrom
37 * read only structure is 4 bytes after _start.
38 */
39 .long 0x62726f6d # structure ID - "brom"
40 .long 0x5f726f00 # - "_ro\0"
41 .long 1 # structure version
42 .long bootrom_cmdline # address of *bootrom_cmdline
43#endif
44
45start_:
46#ifdef CONFIG_FORCE
47 /* We have some really bad firmware. We must disable the L1
48 * icache/dcache now or the board won't boot.
49 */
50 li r4,0x0000
51 isync
52 mtspr SPRN_HID0,r4
53 sync
54 isync
55#endif
56
57#if defined(CONFIG_MBX) || defined(CONFIG_RPX8260) || defined(CONFIG_PPC_PREP)
58 mr r29,r3 /* On the MBX860, r3 is the board info pointer.
59 * On the RPXSUPER, r3 points to the NVRAM
60 * configuration keys.
61 * On PReP, r3 is the pointer to the residual data.
62 */
63#endif
64
65#if defined(CONFIG_XILINX_VIRTEX_4_FX)
66 /* PPC errata 213: only for Virtex-4 FX */
67 mfccr0 0
68 oris 0,0,0x50000000@h
69 mtccr0 0
70#endif
71
72 mflr r3 /* Save our actual starting address. */
73
74 /* The following functions we call must not modify r3 or r4.....
75 */
76#ifdef CONFIG_6xx
77 /* On PReP we must look at the OpenFirmware pointer and sanity
78 * test it. On other platforms, we disable the MMU right now
79 * and other bits.
80 */
81#ifdef CONFIG_PPC_PREP
82/*
83 * Save the OF pointer to r25, but only if the entry point is in a sane
84 * location; if not we store 0. If there is no entry point, or it is
85 * invalid, we establish the default MSR value immediately. Otherwise,
86 * we defer doing that, to allow OF functions to be called, until we
87 * begin uncompressing the kernel.
88 */
89 lis r8,0x0fff /* r8 = 0x0fffffff */
90 ori r8,r8,0xffff
91
92 subc r8,r8,r5 /* r8 = (r5 <= r8) ? ~0 : 0 */
93 subfe r8,r8,r8
94 nand r8,r8,r8
95
96 and. r5,r5,r8 /* r5 will be cleared if (r5 > r8) */
97 bne+ haveOF
98
99 li r8,MSR_IP|MSR_FP /* Not OF: set MSR immediately */
100 mtmsr r8
101 isync
102haveOF:
103 mr r25,r5
104#else
105 bl disable_6xx_mmu
106#endif
107 bl disable_6xx_l1cache
108
109 CLEAR_CACHES
110#endif
111
112#ifdef CONFIG_8xx
113 mfmsr r8 /* Turn off interrupts */
114 li r9,0
115 ori r9,r9,MSR_EE
116 andc r8,r8,r9
117 mtmsr r8
118
119 /* We do this because some boot roms don't initialize the
120 * processor correctly. Don't do this if you want to debug
121 * using a BDM device.
122 */
123 li r4,0 /* Zero DER to prevent FRZ */
124 mtspr SPRN_DER,r4
125#endif
126
127#if defined(CONFIG_MBX) || defined(CONFIG_RPX8260) || defined(CONFIG_PPC_PREP)
128 mr r4,r29 /* put the board info pointer where the relocate
129 * routine will find it
130 */
131#endif
132
133 /* Get the load address.
134 */
135 subi r3, r3, 4 /* Get the actual IP, not NIP */
136 b relocate
137
diff --git a/arch/ppc/boot/simple/iic.c b/arch/ppc/boot/simple/iic.c
deleted file mode 100644
index 5e91489426b4..000000000000
--- a/arch/ppc/boot/simple/iic.c
+++ /dev/null
@@ -1,214 +0,0 @@
1/* Minimal support functions to read configuration from IIC EEPROMS
2 * on MPC8xx boards. Originally written for RPGC RPX-Lite.
3 * Dan Malek (dmalek@jlc.net).
4 */
5#include <linux/types.h>
6#include <asm/uaccess.h>
7#include <asm/mpc8xx.h>
8#include <asm/cpm1.h>
9
10
11/* IIC functions.
12 * These are just the basic master read/write operations so we can
13 * examine serial EEPROM.
14 */
15void iic_read(uint devaddr, u_char *buf, uint offset, uint count);
16
17static int iic_init_done;
18
19static void
20iic_init(void)
21{
22 volatile iic_t *iip;
23 volatile i2c8xx_t *i2c;
24 volatile cpm8xx_t *cp;
25 volatile immap_t *immap;
26 uint dpaddr;
27
28 immap = (immap_t *)IMAP_ADDR;
29 cp = (cpm8xx_t *)&(immap->im_cpm);
30
31 /* Reset the CPM. This is necessary on the 860 processors
32 * that may have started the SCC1 ethernet without relocating
33 * the IIC.
34 * This also stops the Ethernet in case we were loaded by a
35 * BOOTP rom monitor.
36 */
37 cp->cp_cpcr = (CPM_CR_RST | CPM_CR_FLG);
38
39 /* Wait for it.
40 */
41 while (cp->cp_cpcr & (CPM_CR_RST | CPM_CR_FLG));
42
43 /* Remove any microcode patches. We will install our own
44 * later.
45 */
46 cp->cp_cpmcr1 = 0;
47 cp->cp_cpmcr2 = 0;
48 cp->cp_cpmcr3 = 0;
49 cp->cp_cpmcr4 = 0;
50 cp->cp_rccr = 0;
51
52 iip = (iic_t *)&cp->cp_dparam[PROFF_IIC];
53 i2c = (i2c8xx_t *)&(immap->im_i2c);
54
55 /* Initialize Port B IIC pins.
56 */
57 cp->cp_pbpar |= 0x00000030;
58 cp->cp_pbdir |= 0x00000030;
59 cp->cp_pbodr |= 0x00000030;
60
61 /* Initialize the parameter ram.
62 */
63
64 /* Allocate space for a two transmit and one receive buffer
65 * descriptor in the DP ram.
66 * For now, this address seems OK, but it may have to
67 * change with newer versions of the firmware.
68 */
69 dpaddr = 0x0840;
70
71 /* Set up the IIC parameters in the parameter ram.
72 */
73 iip->iic_tbase = dpaddr;
74 iip->iic_rbase = dpaddr + (2 * sizeof(cbd_t));
75
76 iip->iic_tfcr = SMC_EB;
77 iip->iic_rfcr = SMC_EB;
78
79 /* This should really be done by the reader/writer.
80 */
81 iip->iic_mrblr = 128;
82
83 /* Initialize Tx/Rx parameters.
84 */
85 cp->cp_cpcr = mk_cr_cmd(CPM_CR_CH_I2C, CPM_CR_INIT_TRX) | CPM_CR_FLG;
86 while (cp->cp_cpcr & CPM_CR_FLG);
87
88 /* Select an arbitrary address. Just make sure it is unique.
89 */
90 i2c->i2c_i2add = 0x34;
91
92 /* Make clock run maximum slow.
93 */
94 i2c->i2c_i2brg = 7;
95
96 /* Disable interrupts.
97 */
98 i2c->i2c_i2cmr = 0;
99 i2c->i2c_i2cer = 0xff;
100
101 /* Enable SDMA.
102 */
103 immap->im_siu_conf.sc_sdcr = 1;
104
105 iic_init_done = 1;
106}
107
108/* Read from IIC.
109 * Caller provides device address, memory buffer, and byte count.
110 */
111static u_char iitemp[32];
112
113void
114iic_read(uint devaddr, u_char *buf, uint offset, uint count)
115{
116 volatile iic_t *iip;
117 volatile i2c8xx_t *i2c;
118 volatile cbd_t *tbdf, *rbdf;
119 volatile cpm8xx_t *cp;
120 volatile immap_t *immap;
121 u_char *tb;
122 uint temp;
123
124 /* If the interface has not been initialized, do that now.
125 */
126 if (!iic_init_done)
127 iic_init();
128
129 immap = (immap_t *)IMAP_ADDR;
130 cp = (cpm8xx_t *)&(immap->im_cpm);
131
132 iip = (iic_t *)&cp->cp_dparam[PROFF_IIC];
133 i2c = (i2c8xx_t *)&(immap->im_i2c);
134
135 tbdf = (cbd_t *)&cp->cp_dpmem[iip->iic_tbase];
136 rbdf = (cbd_t *)&cp->cp_dpmem[iip->iic_rbase];
137
138 /* Send a "dummy write" operation. This is a write request with
139 * only the offset sent, followed by another start condition.
140 * This will ensure we start reading from the first location
141 * of the EEPROM.
142 */
143 tb = iitemp;
144 tb = (u_char *)(((uint)tb + 15) & ~15);
145 tbdf->cbd_bufaddr = (int)tb;
146 *tb = devaddr & 0xfe; /* Device address */
147 *(tb+1) = offset; /* Offset */
148 tbdf->cbd_datlen = 2; /* Length */
149 tbdf->cbd_sc =
150 BD_SC_READY | BD_SC_LAST | BD_SC_WRAP | BD_IIC_START;
151
152 i2c->i2c_i2mod = 1; /* Enable */
153 i2c->i2c_i2cer = 0xff;
154 i2c->i2c_i2com = 0x81; /* Start master */
155
156 /* Wait for IIC transfer.
157 */
158#if 0
159 while ((i2c->i2c_i2cer & 3) == 0);
160
161 if (tbdf->cbd_sc & BD_SC_READY)
162 printf("IIC ra complete but tbuf ready\n");
163#else
164 temp = 10000000;
165 while ((tbdf->cbd_sc & BD_SC_READY) && (temp != 0))
166 temp--;
167#if 0
168 /* We can't do this...there is no serial port yet!
169 */
170 if (temp == 0) {
171 printf("Timeout reading EEPROM\n");
172 return;
173 }
174#endif
175#endif
176
177 /* Chip errata, clear enable.
178 */
179 i2c->i2c_i2mod = 0;
180
181 /* To read, we need an empty buffer of the proper length.
182 * All that is used is the first byte for address, the remainder
183 * is just used for timing (and doesn't really have to exist).
184 */
185 tbdf->cbd_bufaddr = (int)tb;
186 *tb = devaddr | 1; /* Device address */
187 rbdf->cbd_bufaddr = (uint)buf; /* Desination buffer */
188 tbdf->cbd_datlen = rbdf->cbd_datlen = count + 1; /* Length */
189 tbdf->cbd_sc = BD_SC_READY | BD_SC_LAST | BD_SC_WRAP | BD_IIC_START;
190 rbdf->cbd_sc = BD_SC_EMPTY | BD_SC_WRAP;
191
192 /* Chip bug, set enable here.
193 */
194 i2c->i2c_i2mod = 1; /* Enable */
195 i2c->i2c_i2cer = 0xff;
196 i2c->i2c_i2com = 0x81; /* Start master */
197
198 /* Wait for IIC transfer.
199 */
200#if 0
201 while ((i2c->i2c_i2cer & 1) == 0);
202
203 if (rbdf->cbd_sc & BD_SC_EMPTY)
204 printf("IIC read complete but rbuf empty\n");
205#else
206 temp = 10000000;
207 while ((tbdf->cbd_sc & BD_SC_READY) && (temp != 0))
208 temp--;
209#endif
210
211 /* Chip errata, clear enable.
212 */
213 i2c->i2c_i2mod = 0;
214}
diff --git a/arch/ppc/boot/simple/m8260_tty.c b/arch/ppc/boot/simple/m8260_tty.c
deleted file mode 100644
index d770947e9b8f..000000000000
--- a/arch/ppc/boot/simple/m8260_tty.c
+++ /dev/null
@@ -1,325 +0,0 @@
1/* Minimal serial functions needed to send messages out the serial
2 * port on SMC1.
3 */
4#include <linux/types.h>
5#include <asm/mpc8260.h>
6#include <asm/cpm2.h>
7#include <asm/immap_cpm2.h>
8
9uint no_print;
10extern char *params[];
11extern int nparams;
12static u_char cons_hold[128], *sgptr;
13static int cons_hold_cnt;
14
15/* If defined, enables serial console. The value (1 through 4)
16 * should designate which SCC is used, but this isn't complete. Only
17 * SCC1 is known to work at this time.
18 * We're only linked if SERIAL_CPM_CONSOLE=y, so we only need to test
19 * SERIAL_CPM_SCC1.
20 */
21#ifdef CONFIG_SERIAL_CPM_SCC1
22#define SCC_CONSOLE 1
23#endif
24
25unsigned long
26serial_init(int ignored, bd_t *bd)
27{
28#ifdef SCC_CONSOLE
29 volatile scc_t *sccp;
30 volatile scc_uart_t *sup;
31#else
32 volatile smc_t *sp;
33 volatile smc_uart_t *up;
34#endif
35 volatile cbd_t *tbdf, *rbdf;
36 volatile cpm2_map_t *ip;
37 volatile iop_cpm2_t *io;
38 volatile cpm_cpm2_t *cp;
39 uint dpaddr, memaddr;
40
41 ip = (cpm2_map_t *)CPM_MAP_ADDR;
42 cp = &ip->im_cpm;
43 io = &ip->im_ioport;
44
45 /* Perform a reset.
46 */
47 cp->cp_cpcr = (CPM_CR_RST | CPM_CR_FLG);
48
49 /* Wait for it.
50 */
51 while (cp->cp_cpcr & CPM_CR_FLG);
52
53#ifdef CONFIG_ADS8260
54 /* Enable the RS-232 transceivers.
55 */
56 *(volatile uint *)(BCSR_ADDR + 4) &=
57 ~(BCSR1_RS232_EN1 | BCSR1_RS232_EN2);
58#endif
59
60#ifdef SCC_CONSOLE
61 sccp = (scc_t *)&(ip->im_scc[SCC_CONSOLE-1]);
62 sup = (scc_uart_t *)&ip->im_dprambase[PROFF_SCC1 + ((SCC_CONSOLE-1) << 8)];
63 sccp->scc_sccm &= ~(UART_SCCM_TX | UART_SCCM_RX);
64 sccp->scc_gsmrl &= ~(SCC_GSMRL_ENR | SCC_GSMRL_ENT);
65
66 /* Use Port D for SCC1 instead of other functions.
67 */
68 io->iop_ppard |= 0x00000003;
69 io->iop_psord &= ~0x00000001; /* Rx */
70 io->iop_psord |= 0x00000002; /* Tx */
71 io->iop_pdird &= ~0x00000001; /* Rx */
72 io->iop_pdird |= 0x00000002; /* Tx */
73
74#else
75 sp = (smc_t*)&(ip->im_smc[0]);
76 *(ushort *)(&ip->im_dprambase[PROFF_SMC1_BASE]) = PROFF_SMC1;
77 up = (smc_uart_t *)&ip->im_dprambase[PROFF_SMC1];
78
79 /* Disable transmitter/receiver.
80 */
81 sp->smc_smcmr &= ~(SMCMR_REN | SMCMR_TEN);
82
83 /* Use Port D for SMC1 instead of other functions.
84 */
85 io->iop_ppard |= 0x00c00000;
86 io->iop_pdird |= 0x00400000;
87 io->iop_pdird &= ~0x00800000;
88 io->iop_psord &= ~0x00c00000;
89#endif
90
91 /* Allocate space for two buffer descriptors in the DP ram.
92 * For now, this address seems OK, but it may have to
93 * change with newer versions of the firmware.
94 */
95 dpaddr = 0x0800;
96
97 /* Grab a few bytes from the top of memory.
98 */
99 memaddr = (bd->bi_memsize - 256) & ~15;
100
101 /* Set the physical address of the host memory buffers in
102 * the buffer descriptors.
103 */
104 rbdf = (cbd_t *)&ip->im_dprambase[dpaddr];
105 rbdf->cbd_bufaddr = memaddr;
106 rbdf->cbd_sc = 0;
107 tbdf = rbdf + 1;
108 tbdf->cbd_bufaddr = memaddr+128;
109 tbdf->cbd_sc = 0;
110
111 /* Set up the uart parameters in the parameter ram.
112 */
113#ifdef SCC_CONSOLE
114 sup->scc_genscc.scc_rbase = dpaddr;
115 sup->scc_genscc.scc_tbase = dpaddr + sizeof(cbd_t);
116
117 /* Set up the uart parameters in the
118 * parameter ram.
119 */
120 sup->scc_genscc.scc_rfcr = CPMFCR_GBL | CPMFCR_EB;
121 sup->scc_genscc.scc_tfcr = CPMFCR_GBL | CPMFCR_EB;
122
123 sup->scc_genscc.scc_mrblr = 128;
124 sup->scc_maxidl = 8;
125 sup->scc_brkcr = 1;
126 sup->scc_parec = 0;
127 sup->scc_frmec = 0;
128 sup->scc_nosec = 0;
129 sup->scc_brkec = 0;
130 sup->scc_uaddr1 = 0;
131 sup->scc_uaddr2 = 0;
132 sup->scc_toseq = 0;
133 sup->scc_char1 = 0x8000;
134 sup->scc_char2 = 0x8000;
135 sup->scc_char3 = 0x8000;
136 sup->scc_char4 = 0x8000;
137 sup->scc_char5 = 0x8000;
138 sup->scc_char6 = 0x8000;
139 sup->scc_char7 = 0x8000;
140 sup->scc_char8 = 0x8000;
141 sup->scc_rccm = 0xc0ff;
142
143 /* Send the CPM an initialize command.
144 */
145 cp->cp_cpcr = mk_cr_cmd(CPM_CR_SCC1_PAGE, CPM_CR_SCC1_SBLOCK, 0,
146 CPM_CR_INIT_TRX) | CPM_CR_FLG;
147 while (cp->cp_cpcr & CPM_CR_FLG);
148
149 /* Set UART mode, 8 bit, no parity, one stop.
150 * Enable receive and transmit.
151 */
152 sccp->scc_gsmrh = 0;
153 sccp->scc_gsmrl =
154 (SCC_GSMRL_MODE_UART | SCC_GSMRL_TDCR_16 | SCC_GSMRL_RDCR_16);
155
156 /* Disable all interrupts and clear all pending
157 * events.
158 */
159 sccp->scc_sccm = 0;
160 sccp->scc_scce = 0xffff;
161 sccp->scc_dsr = 0x7e7e;
162 sccp->scc_psmr = 0x3000;
163
164 /* Wire BRG1 to SCC1. The console driver will take care of
165 * others.
166 */
167 ip->im_cpmux.cmx_scr = 0;
168#else
169 up->smc_rbase = dpaddr;
170 up->smc_tbase = dpaddr+sizeof(cbd_t);
171 up->smc_rfcr = CPMFCR_EB;
172 up->smc_tfcr = CPMFCR_EB;
173 up->smc_brklen = 0;
174 up->smc_brkec = 0;
175 up->smc_brkcr = 0;
176 up->smc_mrblr = 128;
177 up->smc_maxidl = 8;
178
179 /* Set UART mode, 8 bit, no parity, one stop.
180 * Enable receive and transmit.
181 */
182 sp->smc_smcmr = smcr_mk_clen(9) | SMCMR_SM_UART;
183
184 /* Mask all interrupts and remove anything pending.
185 */
186 sp->smc_smcm = 0;
187 sp->smc_smce = 0xff;
188
189 /* Set up the baud rate generator.
190 */
191 ip->im_cpmux.cmx_smr = 0;
192#endif
193
194 /* The baud rate divisor needs to be coordinated with clk_8260().
195 */
196 ip->im_brgc1 =
197 (((bd->bi_brgfreq/16) / bd->bi_baudrate) << 1) |
198 CPM_BRG_EN;
199
200 /* Make the first buffer the only buffer.
201 */
202 tbdf->cbd_sc |= BD_SC_WRAP;
203 rbdf->cbd_sc |= BD_SC_EMPTY | BD_SC_WRAP;
204
205 /* Initialize Tx/Rx parameters.
206 */
207#ifdef SCC_CONSOLE
208 sccp->scc_gsmrl |= (SCC_GSMRL_ENR | SCC_GSMRL_ENT);
209#else
210 cp->cp_cpcr = mk_cr_cmd(CPM_CR_SMC1_PAGE, CPM_CR_SMC1_SBLOCK, 0, CPM_CR_INIT_TRX) | CPM_CR_FLG;
211 while (cp->cp_cpcr & CPM_CR_FLG);
212
213 /* Enable transmitter/receiver.
214 */
215 sp->smc_smcmr |= SMCMR_REN | SMCMR_TEN;
216#endif
217
218 /* This is ignored.
219 */
220 return 0;
221}
222
223int
224serial_readbuf(u_char *cbuf)
225{
226 volatile cbd_t *rbdf;
227 volatile char *buf;
228#ifdef SCC_CONSOLE
229 volatile scc_uart_t *sup;
230#else
231 volatile smc_uart_t *up;
232#endif
233 volatile cpm2_map_t *ip;
234 int i, nc;
235
236 ip = (cpm2_map_t *)CPM_MAP_ADDR;
237
238#ifdef SCC_CONSOLE
239 sup = (scc_uart_t *)&ip->im_dprambase[PROFF_SCC1 + ((SCC_CONSOLE-1) << 8)];
240 rbdf = (cbd_t *)&ip->im_dprambase[sup->scc_genscc.scc_rbase];
241#else
242 up = (smc_uart_t *)&(ip->im_dprambase[PROFF_SMC1]);
243 rbdf = (cbd_t *)&ip->im_dprambase[up->smc_rbase];
244#endif
245
246 /* Wait for character to show up.
247 */
248 buf = (char *)rbdf->cbd_bufaddr;
249 while (rbdf->cbd_sc & BD_SC_EMPTY);
250 nc = rbdf->cbd_datlen;
251 for (i=0; i<nc; i++)
252 *cbuf++ = *buf++;
253 rbdf->cbd_sc |= BD_SC_EMPTY;
254
255 return(nc);
256}
257
258void
259serial_putc(void *ignored, const char c)
260{
261 volatile cbd_t *tbdf;
262 volatile char *buf;
263#ifdef SCC_CONSOLE
264 volatile scc_uart_t *sup;
265#else
266 volatile smc_uart_t *up;
267#endif
268 volatile cpm2_map_t *ip;
269
270 ip = (cpm2_map_t *)CPM_MAP_ADDR;
271#ifdef SCC_CONSOLE
272 sup = (scc_uart_t *)&ip->im_dprambase[PROFF_SCC1 + ((SCC_CONSOLE-1) << 8)];
273 tbdf = (cbd_t *)&ip->im_dprambase[sup->scc_genscc.scc_tbase];
274#else
275 up = (smc_uart_t *)&(ip->im_dprambase[PROFF_SMC1]);
276 tbdf = (cbd_t *)&ip->im_dprambase[up->smc_tbase];
277#endif
278
279 /* Wait for last character to go.
280 */
281 buf = (char *)tbdf->cbd_bufaddr;
282 while (tbdf->cbd_sc & BD_SC_READY);
283
284 *buf = c;
285 tbdf->cbd_datlen = 1;
286 tbdf->cbd_sc |= BD_SC_READY;
287}
288
289char
290serial_getc(void *ignored)
291{
292 char c;
293
294 if (cons_hold_cnt <= 0) {
295 cons_hold_cnt = serial_readbuf(cons_hold);
296 sgptr = cons_hold;
297 }
298 c = *sgptr++;
299 cons_hold_cnt--;
300
301 return(c);
302}
303
304int
305serial_tstc(void *ignored)
306{
307 volatile cbd_t *rbdf;
308#ifdef SCC_CONSOLE
309 volatile scc_uart_t *sup;
310#else
311 volatile smc_uart_t *up;
312#endif
313 volatile cpm2_map_t *ip;
314
315 ip = (cpm2_map_t *)CPM_MAP_ADDR;
316#ifdef SCC_CONSOLE
317 sup = (scc_uart_t *)&ip->im_dprambase[PROFF_SCC1 + ((SCC_CONSOLE-1) << 8)];
318 rbdf = (cbd_t *)&ip->im_dprambase[sup->scc_genscc.scc_rbase];
319#else
320 up = (smc_uart_t *)&(ip->im_dprambase[PROFF_SMC1]);
321 rbdf = (cbd_t *)&ip->im_dprambase[up->smc_rbase];
322#endif
323
324 return(!(rbdf->cbd_sc & BD_SC_EMPTY));
325}
diff --git a/arch/ppc/boot/simple/m8xx_tty.c b/arch/ppc/boot/simple/m8xx_tty.c
deleted file mode 100644
index f28924e6aeb4..000000000000
--- a/arch/ppc/boot/simple/m8xx_tty.c
+++ /dev/null
@@ -1,289 +0,0 @@
1/* Minimal serial functions needed to send messages out the serial
2 * port on the MBX console.
3 *
4 * The MBX uses SMC1 for the serial port. We reset the port and use
5 * only the first BD that EPPC-Bug set up as a character FIFO.
6 *
7 * Later versions (at least 1.4, maybe earlier) of the MBX EPPC-Bug
8 * use COM1 instead of SMC1 as the console port. This kinda sucks
9 * for the rest of the kernel, so here we force the use of SMC1 again.
10 */
11#include <linux/types.h>
12#include <asm/uaccess.h>
13#include <asm/mpc8xx.h>
14#include <asm/cpm1.h>
15
16#ifdef CONFIG_MBX
17#define MBX_CSR1 ((volatile u_char *)0xfa100000)
18#define CSR1_COMEN (u_char)0x02
19#endif
20
21#ifdef TQM_SMC2_CONSOLE
22#define PROFF_CONS PROFF_SMC2
23#define CPM_CR_CH_CONS CPM_CR_CH_SMC2
24#define SMC_INDEX 1
25static volatile iop8xx_t *iopp = (iop8xx_t *)&(((immap_t *)IMAP_ADDR)->im_ioport);
26#else
27#define PROFF_CONS PROFF_SMC1
28#define CPM_CR_CH_CONS CPM_CR_CH_SMC1
29#define SMC_INDEX 0
30#endif
31
32static cpm8xx_t *cpmp = (cpm8xx_t *)&(((immap_t *)IMAP_ADDR)->im_cpm);
33
34unsigned long
35serial_init(int ignored, bd_t *bd)
36{
37 volatile smc_t *sp;
38 volatile smc_uart_t *up;
39 volatile cbd_t *tbdf, *rbdf;
40 volatile cpm8xx_t *cp;
41 uint dpaddr, memaddr;
42#ifndef CONFIG_MBX
43 uint ui;
44#endif
45
46 cp = cpmp;
47 sp = (smc_t*)&(cp->cp_smc[SMC_INDEX]);
48 up = (smc_uart_t *)&cp->cp_dparam[PROFF_CONS];
49
50 /* Disable transmitter/receiver.
51 */
52 sp->smc_smcmr &= ~(SMCMR_REN | SMCMR_TEN);
53
54#ifdef CONFIG_FADS
55 /* Enable SMC1/2 transceivers.
56 */
57 *((volatile uint *)BCSR1) &= ~(BCSR1_RS232EN_1|BCSR1_RS232EN_2);
58#endif
59
60#ifndef CONFIG_MBX
61 {
62 /* Initialize SMCx and use it for the console port.
63 */
64
65 /* Enable SDMA.
66 */
67 ((immap_t *)IMAP_ADDR)->im_siu_conf.sc_sdcr = 1;
68
69#ifdef TQM_SMC2_CONSOLE
70 /* Use Port A for SMC2 instead of other functions.
71 */
72 iopp->iop_papar |= 0x00c0;
73 iopp->iop_padir &= ~0x00c0;
74 iopp->iop_paodr &= ~0x00c0;
75#else
76 /* Use Port B for SMCs instead of other functions.
77 */
78 cp->cp_pbpar |= 0x00000cc0;
79 cp->cp_pbdir &= ~0x00000cc0;
80 cp->cp_pbodr &= ~0x00000cc0;
81#endif
82
83 /* Allocate space for two buffer descriptors in the DP ram.
84 * For now, this address seems OK, but it may have to
85 * change with newer versions of the firmware.
86 */
87 dpaddr = 0x0800;
88
89 /* Grab a few bytes from the top of memory for SMC FIFOs.
90 */
91 memaddr = (bd->bi_memsize - 32) & ~15;
92
93 /* Set the physical address of the host memory buffers in
94 * the buffer descriptors.
95 */
96 rbdf = (cbd_t *)&cp->cp_dpmem[dpaddr];
97 rbdf->cbd_bufaddr = memaddr;
98 rbdf->cbd_sc = 0;
99 tbdf = rbdf + 1;
100 tbdf->cbd_bufaddr = memaddr+4;
101 tbdf->cbd_sc = 0;
102
103 /* Set up the uart parameters in the parameter ram.
104 */
105 up->smc_rbase = dpaddr;
106 up->smc_tbase = dpaddr+sizeof(cbd_t);
107 up->smc_rfcr = SMC_EB;
108 up->smc_tfcr = SMC_EB;
109
110 /* Set UART mode, 8 bit, no parity, one stop.
111 * Enable receive and transmit.
112 */
113 sp->smc_smcmr = smcr_mk_clen(9) | SMCMR_SM_UART;
114
115 /* Mask all interrupts and remove anything pending.
116 */
117 sp->smc_smcm = 0;
118 sp->smc_smce = 0xff;
119
120 /* Set up the baud rate generator.
121 * See 8xx_io/commproc.c for details.
122 * This wires BRG1 to SMC1 and BRG2 to SMC2;
123 */
124 cp->cp_simode = 0x10000000;
125 ui = bd->bi_intfreq / 16 / bd->bi_baudrate;
126#ifdef TQM_SMC2_CONSOLE
127 cp->cp_brgc2 =
128#else
129 cp->cp_brgc1 =
130#endif
131 ((ui - 1) < 4096)
132 ? (((ui - 1) << 1) | CPM_BRG_EN)
133 : ((((ui / 16) - 1) << 1) | CPM_BRG_EN | CPM_BRG_DIV16);
134
135#else /* CONFIG_MBX */
136 if (*MBX_CSR1 & CSR1_COMEN) {
137 /* COM1 is enabled. Initialize SMC1 and use it for
138 * the console port.
139 */
140
141 /* Enable SDMA.
142 */
143 ((immap_t *)IMAP_ADDR)->im_siu_conf.sc_sdcr = 1;
144
145 /* Use Port B for SMCs instead of other functions.
146 */
147 cp->cp_pbpar |= 0x00000cc0;
148 cp->cp_pbdir &= ~0x00000cc0;
149 cp->cp_pbodr &= ~0x00000cc0;
150
151 /* Allocate space for two buffer descriptors in the DP ram.
152 * For now, this address seems OK, but it may have to
153 * change with newer versions of the firmware.
154 */
155 dpaddr = 0x0800;
156
157 /* Grab a few bytes from the top of memory. EPPC-Bug isn't
158 * running any more, so we can do this.
159 */
160 memaddr = (bd->bi_memsize - 32) & ~15;
161
162 /* Set the physical address of the host memory buffers in
163 * the buffer descriptors.
164 */
165 rbdf = (cbd_t *)&cp->cp_dpmem[dpaddr];
166 rbdf->cbd_bufaddr = memaddr;
167 rbdf->cbd_sc = 0;
168 tbdf = rbdf + 1;
169 tbdf->cbd_bufaddr = memaddr+4;
170 tbdf->cbd_sc = 0;
171
172 /* Set up the uart parameters in the parameter ram.
173 */
174 up->smc_rbase = dpaddr;
175 up->smc_tbase = dpaddr+sizeof(cbd_t);
176 up->smc_rfcr = SMC_EB;
177 up->smc_tfcr = SMC_EB;
178
179 /* Set UART mode, 8 bit, no parity, one stop.
180 * Enable receive and transmit.
181 */
182 sp->smc_smcmr = smcr_mk_clen(9) | SMCMR_SM_UART;
183
184 /* Mask all interrupts and remove anything pending.
185 */
186 sp->smc_smcm = 0;
187 sp->smc_smce = 0xff;
188
189 /* Set up the baud rate generator.
190 * See 8xx_io/commproc.c for details.
191 */
192 cp->cp_simode = 0x10000000;
193 cp->cp_brgc1 =
194 (((bd->bi_intfreq/16) / 9600) << 1) | CPM_BRG_EN;
195
196 /* Enable SMC1 for console output.
197 */
198 *MBX_CSR1 &= ~CSR1_COMEN;
199 }
200 else {
201#endif /* ndef CONFIG_MBX */
202 /* SMCx is used as console port.
203 */
204 tbdf = (cbd_t *)&cp->cp_dpmem[up->smc_tbase];
205 rbdf = (cbd_t *)&cp->cp_dpmem[up->smc_rbase];
206
207 /* Issue a stop transmit, and wait for it.
208 */
209 cp->cp_cpcr = mk_cr_cmd(CPM_CR_CH_CONS,
210 CPM_CR_STOP_TX) | CPM_CR_FLG;
211 while (cp->cp_cpcr & CPM_CR_FLG);
212 }
213
214 /* Make the first buffer the only buffer.
215 */
216 tbdf->cbd_sc |= BD_SC_WRAP;
217 rbdf->cbd_sc |= BD_SC_EMPTY | BD_SC_WRAP;
218
219 /* Single character receive.
220 */
221 up->smc_mrblr = 1;
222 up->smc_maxidl = 0;
223
224 /* Initialize Tx/Rx parameters.
225 */
226 cp->cp_cpcr = mk_cr_cmd(CPM_CR_CH_CONS, CPM_CR_INIT_TRX) | CPM_CR_FLG;
227 while (cp->cp_cpcr & CPM_CR_FLG);
228
229 /* Enable transmitter/receiver.
230 */
231 sp->smc_smcmr |= SMCMR_REN | SMCMR_TEN;
232
233 /* This is ignored.
234 */
235 return 0;
236}
237
238void
239serial_putc(void *ignored, const char c)
240{
241 volatile cbd_t *tbdf;
242 volatile char *buf;
243 volatile smc_uart_t *up;
244
245 up = (smc_uart_t *)&cpmp->cp_dparam[PROFF_CONS];
246 tbdf = (cbd_t *)&cpmp->cp_dpmem[up->smc_tbase];
247
248 /* Wait for last character to go.
249 */
250 buf = (char *)tbdf->cbd_bufaddr;
251 while (tbdf->cbd_sc & BD_SC_READY);
252
253 *buf = c;
254 tbdf->cbd_datlen = 1;
255 tbdf->cbd_sc |= BD_SC_READY;
256}
257
258char
259serial_getc(void *ignored)
260{
261 volatile cbd_t *rbdf;
262 volatile char *buf;
263 volatile smc_uart_t *up;
264 char c;
265
266 up = (smc_uart_t *)&cpmp->cp_dparam[PROFF_CONS];
267 rbdf = (cbd_t *)&cpmp->cp_dpmem[up->smc_rbase];
268
269 /* Wait for character to show up.
270 */
271 buf = (char *)rbdf->cbd_bufaddr;
272 while (rbdf->cbd_sc & BD_SC_EMPTY);
273 c = *buf;
274 rbdf->cbd_sc |= BD_SC_EMPTY;
275
276 return(c);
277}
278
279int
280serial_tstc(void *ignored)
281{
282 volatile cbd_t *rbdf;
283 volatile smc_uart_t *up;
284
285 up = (smc_uart_t *)&cpmp->cp_dparam[PROFF_CONS];
286 rbdf = (cbd_t *)&cpmp->cp_dpmem[up->smc_rbase];
287
288 return(!(rbdf->cbd_sc & BD_SC_EMPTY));
289}
diff --git a/arch/ppc/boot/simple/misc-chestnut.c b/arch/ppc/boot/simple/misc-chestnut.c
deleted file mode 100644
index 14a4b56d4f84..000000000000
--- a/arch/ppc/boot/simple/misc-chestnut.c
+++ /dev/null
@@ -1,32 +0,0 @@
1/*
2 * Setup for the IBM Chestnut (ibm-750fxgx_eval)
3 *
4 * Author: Mark A. Greer <mgreer@mvista.com>
5 *
6 * 2005 (c) MontaVista Software, Inc. This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10 */
11
12#include <linux/types.h>
13#include <asm/io.h>
14#include <asm/mv64x60_defs.h>
15#include <platforms/chestnut.h>
16
17/* Not in the kernel so won't include kernel.h to get its 'max' definition */
18#define max(a,b) (((a) > (b)) ? (a) : (b))
19
20void
21mv64x60_board_init(void __iomem *old_base, void __iomem *new_base)
22{
23#ifdef CONFIG_SERIAL_8250_CONSOLE
24 /*
25 * Change device bus 2 window so that bootoader can do I/O thru
26 * 8250/16550 UART that's mapped in that window.
27 */
28 out_le32(new_base + MV64x60_CPU2DEV_2_BASE, CHESTNUT_UART_BASE >> 16);
29 out_le32(new_base + MV64x60_CPU2DEV_2_SIZE, CHESTNUT_UART_SIZE >> 16);
30 __asm__ __volatile__("sync");
31#endif
32}
diff --git a/arch/ppc/boot/simple/misc-cpci690.c b/arch/ppc/boot/simple/misc-cpci690.c
deleted file mode 100644
index 8a8614d11a32..000000000000
--- a/arch/ppc/boot/simple/misc-cpci690.c
+++ /dev/null
@@ -1,65 +0,0 @@
1/*
2 * Add birec data for Force CPCI690 board.
3 *
4 * Author: Mark A. Greer <source@mvista.com>
5 *
6 * 2003 (c) MontaVista Software, Inc. This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10 */
11
12#include <linux/types.h>
13#include <asm/io.h>
14#include <platforms/cpci690.h>
15
16#define KB (1024UL)
17#define MB (1024UL*KB)
18#define GB (1024UL*MB)
19
20extern u32 mv64x60_console_baud;
21extern u32 mv64x60_mpsc_clk_src;
22extern u32 mv64x60_mpsc_clk_freq;
23
24u32 mag = 0xffff;
25
26unsigned long
27get_mem_size(void)
28{
29 u32 size;
30
31 switch (in_8(((void __iomem *)CPCI690_BR_BASE + CPCI690_BR_MEM_CTLR))
32 & 0x07) {
33 case 0x01:
34 size = 256*MB;
35 break;
36 case 0x02:
37 size = 512*MB;
38 break;
39 case 0x03:
40 size = 768*MB;
41 break;
42 case 0x04:
43 size = 1*GB;
44 break;
45 case 0x05:
46 size = 1*GB + 512*MB;
47 break;
48 case 0x06:
49 size = 2*GB;
50 break;
51 default:
52 size = 0;
53 }
54
55 return size;
56}
57
58void
59mv64x60_board_init(void __iomem *old_base, void __iomem *new_base)
60{
61 mv64x60_console_baud = CPCI690_MPSC_BAUD;
62 mv64x60_mpsc_clk_src = CPCI690_MPSC_CLK_SRC;
63 mv64x60_mpsc_clk_freq =
64 (get_mem_size() >= (1*GB)) ? 100000000 : 133333333;
65}
diff --git a/arch/ppc/boot/simple/misc-embedded.c b/arch/ppc/boot/simple/misc-embedded.c
deleted file mode 100644
index d5a00eb0e4eb..000000000000
--- a/arch/ppc/boot/simple/misc-embedded.c
+++ /dev/null
@@ -1,276 +0,0 @@
1/*
2 * Originally adapted by Gary Thomas. Much additional work by
3 * Cort Dougan <cort@fsmlabs.com>. On top of that still more work by
4 * Dan Malek <dmalek@jlc.net>.
5 *
6 * Currently maintained by: Tom Rini <trini@kernel.crashing.org>
7 */
8
9#include <linux/types.h>
10#include <linux/string.h>
11#include <asm/bootinfo.h>
12#include <asm/mmu.h>
13#include <asm/page.h>
14#include <asm/residual.h>
15#if defined(CONFIG_4xx)
16#include <asm/ibm4xx.h>
17#elif defined(CONFIG_8xx)
18#include <asm/mpc8xx.h>
19#elif defined(CONFIG_8260)
20#include <asm/mpc8260.h>
21#endif
22
23#include "nonstdio.h"
24
25/* The linker tells us where the image is. */
26extern char __image_begin, __image_end;
27extern char __ramdisk_begin, __ramdisk_end;
28extern char _end[];
29
30/* Because of the limited amount of memory on embedded, it presents
31 * loading problems. The biggest is that we load this boot program
32 * into a relatively low memory address, and the Linux kernel Bss often
33 * extends into this space when it get loaded. When the kernel starts
34 * and zeros the BSS space, it also writes over the information we
35 * save here and pass to the kernel (usually board info).
36 * On these boards, we grab some known memory holes to hold this information.
37 */
38char cmd_buf[256];
39char *cmd_line = cmd_buf;
40char *avail_ram;
41char *end_avail;
42char *zimage_start;
43
44/* This is for 4xx treeboot. It provides a place for the bootrom
45 * give us a pointer to a rom environment command line.
46 */
47char *bootrom_cmdline = "";
48
49/* This is the default cmdline that will be given to the user at boot time..
50 * If none was specified at compile time, we'll give it one that should work.
51 * -- Tom */
52#ifdef CONFIG_CMDLINE_BOOL
53char compiled_string[] = CONFIG_CMDLINE;
54#endif
55char ramroot_string[] = "root=/dev/ram";
56char netroot_string[] = "root=/dev/nfs rw ip=on";
57
58/* Serial port to use. */
59unsigned long com_port;
60
61/* We need to make sure that this is before the images to ensure
62 * that it's in a mapped location. - Tom */
63bd_t hold_resid_buf __attribute__ ((__section__ (".data.boot")));
64bd_t *hold_residual = &hold_resid_buf;
65
66extern unsigned long serial_init(int chan, bd_t *bp);
67extern void serial_close(unsigned long com_port);
68extern unsigned long start;
69extern void flush_instruction_cache(void);
70extern void gunzip(void *, int, unsigned char *, int *);
71extern void embed_config(bd_t **bp);
72
73/* Weak function for boards which don't need to build the
74 * board info struct because they are using PPCBoot/U-Boot.
75 */
76void __attribute__ ((weak))
77embed_config(bd_t **bdp)
78{
79}
80
81unsigned long
82load_kernel(unsigned long load_addr, int num_words, unsigned long cksum, bd_t *bp)
83{
84 char *cp, ch;
85 int timer = 0, zimage_size;
86 unsigned long initrd_size;
87
88 /* First, capture the embedded board information. Then
89 * initialize the serial console port.
90 */
91 embed_config(&bp);
92#if defined(CONFIG_SERIAL_CPM_CONSOLE) || \
93 defined(CONFIG_SERIAL_8250_CONSOLE) || \
94 defined(CONFIG_SERIAL_UARTLITE_CONSOLE)
95 com_port = serial_init(0, bp);
96#endif
97
98 /* Grab some space for the command line and board info. Since
99 * we no longer use the ELF header, but it was loaded, grab
100 * that space.
101 */
102#ifdef CONFIG_MBX
103 /* Because of the way the MBX loads the ELF image, we can't
104 * tell where we started. We read a magic variable from the NVRAM
105 * that gives us the intermediate buffer load address.
106 */
107 load_addr = *(uint *)0xfa000020;
108 load_addr += 0x10000; /* Skip ELF header */
109#endif
110 /* copy board data */
111 if (bp)
112 memcpy(hold_residual,bp,sizeof(bd_t));
113
114 /* Set end of memory available to us. It is always the highest
115 * memory address provided by the board information.
116 */
117 end_avail = (char *)(bp->bi_memsize);
118
119 puts("\nloaded at: "); puthex(load_addr);
120 puts(" "); puthex((unsigned long)(load_addr + (4*num_words))); puts("\n");
121 if ( (unsigned long)load_addr != (unsigned long)&start ) {
122 puts("relocated to: "); puthex((unsigned long)&start);
123 puts(" ");
124 puthex((unsigned long)((unsigned long)&start + (4*num_words)));
125 puts("\n");
126 }
127
128 if ( bp ) {
129 puts("board data at: "); puthex((unsigned long)bp);
130 puts(" ");
131 puthex((unsigned long)((unsigned long)bp + sizeof(bd_t)));
132 puts("\nrelocated to: ");
133 puthex((unsigned long)hold_residual);
134 puts(" ");
135 puthex((unsigned long)((unsigned long)hold_residual + sizeof(bd_t)));
136 puts("\n");
137 }
138
139 /*
140 * We link ourself to an arbitrary low address. When we run, we
141 * relocate ourself to that address. __image_being points to
142 * the part of the image where the zImage is. -- Tom
143 */
144 zimage_start = (char *)(unsigned long)(&__image_begin);
145 zimage_size = (unsigned long)(&__image_end) -
146 (unsigned long)(&__image_begin);
147
148 initrd_size = (unsigned long)(&__ramdisk_end) -
149 (unsigned long)(&__ramdisk_begin);
150
151 /*
152 * The zImage and initrd will be between start and _end, so they've
153 * already been moved once. We're good to go now. -- Tom
154 */
155 puts("zimage at: "); puthex((unsigned long)zimage_start);
156 puts(" "); puthex((unsigned long)(zimage_size+zimage_start));
157 puts("\n");
158
159 if ( initrd_size ) {
160 puts("initrd at: ");
161 puthex((unsigned long)(&__ramdisk_begin));
162 puts(" "); puthex((unsigned long)(&__ramdisk_end));puts("\n");
163 }
164
165 /*
166 * setup avail_ram - this is the first part of ram usable
167 * by the uncompress code. Anything after this program in RAM
168 * is now fair game. -- Tom
169 */
170 avail_ram = (char *)PAGE_ALIGN((unsigned long)_end);
171
172 puts("avail ram: "); puthex((unsigned long)avail_ram); puts(" ");
173 puthex((unsigned long)end_avail); puts("\n");
174 puts("\nLinux/PPC load: ");
175 cp = cmd_line;
176 /* This is where we try and pick the right command line for booting.
177 * If we were given one at compile time, use it. It Is Right.
178 * If we weren't, see if we have a ramdisk. If so, thats root.
179 * When in doubt, give them the netroot (root=/dev/nfs rw) -- Tom
180 */
181#ifdef CONFIG_CMDLINE_BOOL
182 memcpy (cmd_line, compiled_string, sizeof(compiled_string));
183#else
184 if ( initrd_size )
185 memcpy (cmd_line, ramroot_string, sizeof(ramroot_string));
186 else
187 memcpy (cmd_line, netroot_string, sizeof(netroot_string));
188#endif
189 while ( *cp )
190 putc(*cp++);
191 while (timer++ < 5*1000) {
192 if (tstc()) {
193 while ((ch = getc()) != '\n' && ch != '\r') {
194 if (ch == '\b' || ch == '\177') {
195 if (cp != cmd_line) {
196 cp--;
197 puts("\b \b");
198 }
199 } else if (ch == '\030' /* ^x */
200 || ch == '\025') { /* ^u */
201 while (cp != cmd_line) {
202 cp--;
203 puts("\b \b");
204 }
205 } else {
206 *cp++ = ch;
207 putc(ch);
208 }
209 }
210 break; /* Exit 'timer' loop */
211 }
212 udelay(1000); /* 1 msec */
213 }
214 *cp = 0;
215 puts("\nUncompressing Linux...");
216
217 gunzip(0, 0x400000, zimage_start, &zimage_size);
218 flush_instruction_cache();
219 puts("done.\n");
220 {
221 struct bi_record *rec;
222 unsigned long initrd_loc = 0;
223 unsigned long rec_loc = _ALIGN((unsigned long)(zimage_size) +
224 (1 << 20) - 1, (1 << 20));
225 rec = (struct bi_record *)rec_loc;
226
227 /* We need to make sure that the initrd and bi_recs do not
228 * overlap. */
229 if ( initrd_size ) {
230 initrd_loc = (unsigned long)(&__ramdisk_begin);
231 /* If the bi_recs are in the middle of the current
232 * initrd, move the initrd to the next MB
233 * boundary. */
234 if ((rec_loc > initrd_loc) &&
235 ((initrd_loc + initrd_size)
236 > rec_loc)) {
237 initrd_loc = _ALIGN((unsigned long)(zimage_size)
238 + (2 << 20) - 1, (2 << 20));
239 memmove((void *)initrd_loc, &__ramdisk_begin,
240 initrd_size);
241 puts("initrd moved: "); puthex(initrd_loc);
242 puts(" "); puthex(initrd_loc + initrd_size);
243 puts("\n");
244 }
245 }
246
247 rec->tag = BI_FIRST;
248 rec->size = sizeof(struct bi_record);
249 rec = (struct bi_record *)((unsigned long)rec + rec->size);
250
251 rec->tag = BI_CMD_LINE;
252 memcpy( (char *)rec->data, cmd_line, strlen(cmd_line)+1);
253 rec->size = sizeof(struct bi_record) + strlen(cmd_line) + 1;
254 rec = (struct bi_record *)((unsigned long)rec + rec->size);
255
256 if ( initrd_size ) {
257 rec->tag = BI_INITRD;
258 rec->data[0] = initrd_loc;
259 rec->data[1] = initrd_size;
260 rec->size = sizeof(struct bi_record) + 2 *
261 sizeof(unsigned long);
262 rec = (struct bi_record *)((unsigned long)rec +
263 rec->size);
264 }
265
266 rec->tag = BI_LAST;
267 rec->size = sizeof(struct bi_record);
268 rec = (struct bi_record *)((unsigned long)rec + rec->size);
269 }
270 puts("Now booting the kernel\n");
271#if defined(CONFIG_SERIAL_CPM_CONSOLE) || defined(CONFIG_SERIAL_8250_CONSOLE)
272 serial_close(com_port);
273#endif
274
275 return (unsigned long)hold_residual;
276}
diff --git a/arch/ppc/boot/simple/misc-ev64260.c b/arch/ppc/boot/simple/misc-ev64260.c
deleted file mode 100644
index 0b3978632aca..000000000000
--- a/arch/ppc/boot/simple/misc-ev64260.c
+++ /dev/null
@@ -1,54 +0,0 @@
1/*
2 * Host bridge init code for the Marvell/Galileo EV-64260-BP evaluation board
3 * with a GT64260 onboard.
4 *
5 * Author: Mark A. Greer <mgreer@mvista.com>
6 *
7 * 2001 (c) MontaVista Software, Inc. This file is licensed under
8 * the terms of the GNU General Public License version 2. This program
9 * is licensed "as is" without any warranty of any kind, whether express
10 * or implied.
11 */
12
13#include <linux/types.h>
14#include <asm/reg.h>
15#include <asm/io.h>
16#include <asm/mv64x60_defs.h>
17#include <platforms/ev64260.h>
18
19#ifdef CONFIG_SERIAL_MPSC_CONSOLE
20extern u32 mv64x60_console_baud;
21extern u32 mv64x60_mpsc_clk_src;
22extern u32 mv64x60_mpsc_clk_freq;
23#endif
24
25void
26mv64x60_board_init(void __iomem *old_base, void __iomem *new_base)
27{
28 u32 p, v;
29
30 /* DINK doesn't enable 745x timebase, so enable here (Adrian Cox) */
31 p = mfspr(SPRN_PVR);
32 p >>= 16;
33
34 /* Reasonable SWAG at a 745x PVR value */
35 if (((p & 0xfff0) == 0x8000) && (p != 0x800c)) {
36 v = mfspr(SPRN_HID0);
37 v |= HID0_TBEN;
38 mtspr(SPRN_HID0, v);
39 }
40
41#ifdef CONFIG_SERIAL_8250_CONSOLE
42 /*
43 * Change device bus 2 window so that bootoader can do I/O thru
44 * 8250/16550 UART that's mapped in that window.
45 */
46 out_le32(new_base + MV64x60_CPU2DEV_2_BASE, EV64260_UART_BASE >> 20);
47 out_le32(new_base + MV64x60_CPU2DEV_2_SIZE, EV64260_UART_END >> 20);
48 __asm__ __volatile__("sync");
49#elif defined(CONFIG_SERIAL_MPSC_CONSOLE)
50 mv64x60_console_baud = EV64260_DEFAULT_BAUD;
51 mv64x60_mpsc_clk_src = EV64260_MPSC_CLK_SRC;
52 mv64x60_mpsc_clk_freq = EV64260_MPSC_CLK_FREQ;
53#endif
54}
diff --git a/arch/ppc/boot/simple/misc-ev64360.c b/arch/ppc/boot/simple/misc-ev64360.c
deleted file mode 100644
index 96eaebb78df5..000000000000
--- a/arch/ppc/boot/simple/misc-ev64360.c
+++ /dev/null
@@ -1,42 +0,0 @@
1/*
2 * Copyright (C) 2005 Lee Nicks <allinux@gmail.com>
3 *
4 * Based on arch/ppc/boot/simple/misc-katana.c from:
5 * Mark A. Greer <source@mvista.com>
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 */
21
22#include <linux/types.h>
23#include <asm/io.h>
24#include <asm/mv64x60_defs.h>
25#include <platforms/ev64360.h>
26
27extern u32 mv64x60_console_baud;
28extern u32 mv64x60_mpsc_clk_src;
29extern u32 mv64x60_mpsc_clk_freq;
30
31/* Not in the kernel so won't include kernel.h to get its 'min' definition */
32#ifndef min
33#define min(a,b) (((a) < (b)) ? (a) : (b))
34#endif
35
36void
37mv64x60_board_init(void __iomem *old_base, void __iomem *new_base)
38{
39 mv64x60_console_baud = EV64360_DEFAULT_BAUD;
40 mv64x60_mpsc_clk_src = EV64360_MPSC_CLK_SRC;
41 mv64x60_mpsc_clk_freq = EV64360_MPSC_CLK_FREQ;
42}
diff --git a/arch/ppc/boot/simple/misc-katana.c b/arch/ppc/boot/simple/misc-katana.c
deleted file mode 100644
index 79a1bbcbc6c5..000000000000
--- a/arch/ppc/boot/simple/misc-katana.c
+++ /dev/null
@@ -1,42 +0,0 @@
1/*
2 * Set up MPSC values to bootwrapper can prompt user.
3 *
4 * Author: Mark A. Greer <source@mvista.com>
5 *
6 * 2004 (c) MontaVista Software, Inc. This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10 */
11
12#include <linux/types.h>
13#include <asm/io.h>
14#include <asm/mv64x60_defs.h>
15#include <platforms/katana.h>
16
17extern u32 mv64x60_console_baud;
18extern u32 mv64x60_mpsc_clk_src;
19extern u32 mv64x60_mpsc_clk_freq;
20
21/* Not in the kernel so won't include kernel.h to get its 'min' definition */
22#ifndef min
23#define min(a,b) (((a) < (b)) ? (a) : (b))
24#endif
25
26unsigned long mv64360_get_mem_size(void);
27
28void
29mv64x60_board_init(void __iomem *old_base, void __iomem *new_base)
30{
31 mv64x60_console_baud = KATANA_DEFAULT_BAUD;
32 mv64x60_mpsc_clk_src = KATANA_MPSC_CLK_SRC;
33 mv64x60_mpsc_clk_freq =
34 min(katana_bus_freq((void __iomem *)KATANA_CPLD_BASE),
35 MV64x60_TCLK_FREQ_MAX);
36}
37
38unsigned long
39get_mem_size(void)
40{
41 return mv64360_get_mem_size();
42}
diff --git a/arch/ppc/boot/simple/misc-mv64x60.c b/arch/ppc/boot/simple/misc-mv64x60.c
deleted file mode 100644
index 28b3108083ed..000000000000
--- a/arch/ppc/boot/simple/misc-mv64x60.c
+++ /dev/null
@@ -1,85 +0,0 @@
1/*
2 * Relocate bridge's register base and call board specific routine.
3 *
4 * Author: Mark A. Greer <source@mvista.com>
5 *
6 * 2005 (c) MontaVista Software, Inc. This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10 */
11
12#include <linux/types.h>
13#include <asm/io.h>
14#include <asm/mv64x60_defs.h>
15
16extern struct bi_record *decompress_kernel(unsigned long load_addr,
17 int num_words, unsigned long cksum);
18
19
20u32 size_reg[MV64x60_CPU2MEM_WINDOWS] = {
21 MV64x60_CPU2MEM_0_SIZE, MV64x60_CPU2MEM_1_SIZE,
22 MV64x60_CPU2MEM_2_SIZE, MV64x60_CPU2MEM_3_SIZE
23};
24
25/* Read mem ctlr to get the amount of mem in system */
26unsigned long
27mv64360_get_mem_size(void)
28{
29 u32 enables, i, v;
30 u32 mem = 0;
31
32 enables = in_le32((void __iomem *)CONFIG_MV64X60_NEW_BASE +
33 MV64360_CPU_BAR_ENABLE) & 0xf;
34
35 for (i=0; i<MV64x60_CPU2MEM_WINDOWS; i++)
36 if (!(enables & (1<<i))) {
37 v = in_le32((void __iomem *)CONFIG_MV64X60_NEW_BASE
38 + size_reg[i]) & 0xffff;
39 v = (v + 1) << 16;
40 mem += v;
41 }
42
43 return mem;
44}
45
46void
47mv64x60_move_base(void __iomem *old_base, void __iomem *new_base)
48{
49 u32 bits, mask, b;
50
51 if (old_base != new_base) {
52#ifdef CONFIG_GT64260
53 bits = 12;
54 mask = 0x07000000;
55#else /* Must be mv64[34]60 */
56 bits = 16;
57 mask = 0x03000000;
58#endif
59 b = in_le32(old_base + MV64x60_INTERNAL_SPACE_DECODE);
60 b &= mask;
61 b |= ((u32)new_base >> (32 - bits));
62 out_le32(old_base + MV64x60_INTERNAL_SPACE_DECODE, b);
63
64 __asm__ __volatile__("sync");
65
66 /* Wait for change to happen (in accordance with the manual) */
67 while (in_le32(new_base + MV64x60_INTERNAL_SPACE_DECODE) != b);
68 }
69}
70
71void __attribute__ ((weak))
72mv64x60_board_init(void __iomem *old_base, void __iomem *new_base)
73{
74}
75
76void *
77load_kernel(unsigned long load_addr, int num_words, unsigned long cksum,
78 void *ign1, void *ign2)
79{
80 mv64x60_move_base((void __iomem *)CONFIG_MV64X60_BASE,
81 (void __iomem *)CONFIG_MV64X60_NEW_BASE);
82 mv64x60_board_init((void __iomem *)CONFIG_MV64X60_BASE,
83 (void __iomem *)CONFIG_MV64X60_NEW_BASE);
84 return decompress_kernel(load_addr, num_words, cksum);
85}
diff --git a/arch/ppc/boot/simple/misc-prep.c b/arch/ppc/boot/simple/misc-prep.c
deleted file mode 100644
index 0086e1cfb48c..000000000000
--- a/arch/ppc/boot/simple/misc-prep.c
+++ /dev/null
@@ -1,209 +0,0 @@
1/*
2 * Maintainer: Tom Rini <trini@kernel.crashing.org>
3 *
4 * In the past: Gary Thomas, Cort Dougan <cort@cs.nmt.edu>
5 */
6
7#include <linux/pci_ids.h>
8#include <linux/types.h>
9#include <asm/residual.h>
10#include <asm/string.h>
11#include <asm/byteorder.h>
12#include "mpc10x.h"
13#include "of1275.h"
14#include "nonstdio.h"
15
16extern int keyb_present; /* keyboard controller is present by default */
17RESIDUAL hold_resid_buf;
18RESIDUAL *hold_residual = &hold_resid_buf;
19static void *OFW_interface; /* Pointer to OF, if available. */
20
21#ifdef CONFIG_VGA_CONSOLE
22char *vidmem = (char *)0xC00B8000;
23int lines = 25, cols = 80;
24int orig_x, orig_y = 24;
25#endif /* CONFIG_VGA_CONSOLE */
26
27extern int CRT_tstc(void);
28extern int vga_init(unsigned char *ISA_mem);
29extern void gunzip(void *, int, unsigned char *, int *);
30extern unsigned long serial_init(int chan, void *ignored);
31extern void serial_fixups(void);
32extern struct bi_record *decompress_kernel(unsigned long load_addr,
33 int num_words, unsigned long cksum);
34extern void disable_6xx_mmu(void);
35extern unsigned long mpc10x_get_mem_size(void);
36
37static void
38writel(unsigned int val, unsigned int address)
39{
40 /* Ensure I/O operations complete */
41 __asm__ volatile("eieio");
42 *(unsigned int *)address = cpu_to_le32(val);
43}
44
45#define PCI_CFG_ADDR(dev,off) ((0x80<<24) | (dev<<8) | (off&0xfc))
46#define PCI_CFG_DATA(off) (MPC10X_MAPA_CNFG_DATA+(off&3))
47
48static void
49pci_read_config_32(unsigned char devfn,
50 unsigned char offset,
51 unsigned int *val)
52{
53 /* Ensure I/O operations complete */
54 __asm__ volatile("eieio");
55 *(unsigned int *)PCI_CFG_ADDR(devfn,offset) =
56 cpu_to_le32(MPC10X_MAPA_CNFG_ADDR);
57 /* Ensure I/O operations complete */
58 __asm__ volatile("eieio");
59 *val = le32_to_cpu(*(unsigned int *)PCI_CFG_DATA(offset));
60 return;
61}
62
63#ifdef CONFIG_VGA_CONSOLE
64void
65scroll(void)
66{
67 int i;
68
69 memcpy ( vidmem, vidmem + cols * 2, ( lines - 1 ) * cols * 2 );
70 for ( i = ( lines - 1 ) * cols * 2; i < lines * cols * 2; i += 2 )
71 vidmem[i] = ' ';
72}
73#endif /* CONFIG_VGA_CONSOLE */
74
75unsigned long
76load_kernel(unsigned long load_addr, int num_words, unsigned long cksum,
77 RESIDUAL *residual, void *OFW)
78{
79 int start_multi = 0;
80 unsigned int pci_viddid, pci_did, tulip_pci_base, tulip_base;
81
82 /* If we have Open Firmware, initialise it immediately */
83 if (OFW) {
84 OFW_interface = OFW;
85 ofinit(OFW_interface);
86 }
87
88 board_isa_init();
89#if defined(CONFIG_VGA_CONSOLE)
90 vga_init((unsigned char *)0xC0000000);
91#endif /* CONFIG_VGA_CONSOLE */
92
93 if (residual) {
94 /* Is this Motorola PPCBug? */
95 if ((1 & residual->VitalProductData.FirmwareSupports) &&
96 (1 == residual->VitalProductData.FirmwareSupplier)) {
97 unsigned char base_mod;
98 unsigned char board_type = inb(0x801) & 0xF0;
99
100 /*
101 * Reset the onboard 21x4x Ethernet
102 * Motorola Ethernet is at IDSEL 14 (devfn 0x70)
103 */
104 pci_read_config_32(0x70, 0x00, &pci_viddid);
105 pci_did = (pci_viddid & 0xffff0000) >> 16;
106 /* Be sure we've really found a 21x4x chip */
107 if (((pci_viddid & 0xffff) == PCI_VENDOR_ID_DEC) &&
108 ((pci_did == PCI_DEVICE_ID_DEC_TULIP_FAST) ||
109 (pci_did == PCI_DEVICE_ID_DEC_TULIP) ||
110 (pci_did == PCI_DEVICE_ID_DEC_TULIP_PLUS) ||
111 (pci_did == PCI_DEVICE_ID_DEC_21142))) {
112 pci_read_config_32(0x70,
113 0x10,
114 &tulip_pci_base);
115 /* Get the physical base address */
116 tulip_base =
117 (tulip_pci_base & ~0x03UL) + 0x80000000;
118 /* Strobe the 21x4x reset bit in CSR0 */
119 writel(0x1, tulip_base);
120 }
121
122 /* If this is genesis 2 board then check for no
123 * keyboard controller and more than one processor.
124 */
125 if (board_type == 0xe0) {
126 base_mod = inb(0x803);
127 /* if a MVME2300/2400 or a Sitka then no keyboard */
128 if((base_mod == 0xFA) || (base_mod == 0xF9) ||
129 (base_mod == 0xE1)) {
130 keyb_present = 0; /* no keyboard */
131 }
132 }
133 /* If this is a multiprocessor system then
134 * park the other processor so that the
135 * kernel knows where to find them.
136 */
137 if (residual->MaxNumCpus > 1)
138 start_multi = 1;
139 }
140 memcpy(hold_residual,residual,sizeof(RESIDUAL));
141 }
142
143 /* Call decompress_kernel */
144 decompress_kernel(load_addr, num_words, cksum);
145
146 if (start_multi) {
147 residual->VitalProductData.SmpIar = (unsigned long)0xc0;
148 residual->Cpus[1].CpuState = CPU_GOOD;
149 hold_residual->VitalProductData.Reserved5 = 0xdeadbeef;
150 }
151
152 /* Now go and clear out the BATs and ensure that our MSR is
153 * correct .*/
154 disable_6xx_mmu();
155
156 /* Make r3 be a pointer to the residual data. */
157 return (unsigned long)hold_residual;
158}
159
160unsigned long
161get_mem_size(void)
162{
163 unsigned int pci_viddid, pci_did;
164
165 /* First, figure out what kind of host bridge we are on. If it's
166 * an MPC10x, we can ask it directly how much memory it has.
167 * Otherwise, see if the residual data has anything. This isn't
168 * the best way, but it can be the only way. If there's nothing,
169 * assume 32MB. -- Tom.
170 */
171 /* See what our host bridge is. */
172 pci_read_config_32(0x00, 0x00, &pci_viddid);
173 pci_did = (pci_viddid & 0xffff0000) >> 16;
174 /* See if we are on an MPC10x. */
175 if (((pci_viddid & 0xffff) == PCI_VENDOR_ID_MOTOROLA)
176 && ((pci_did == PCI_DEVICE_ID_MOTOROLA_MPC105)
177 || (pci_did == PCI_DEVICE_ID_MOTOROLA_MPC106)
178 || (pci_did == PCI_DEVICE_ID_MOTOROLA_MPC107)))
179 return mpc10x_get_mem_size();
180 /* If it's not, see if we have anything in the residual data. */
181 else if (hold_residual && hold_residual->TotalMemory)
182 return hold_residual->TotalMemory;
183 else if (OFW_interface) {
184 /*
185 * This is a 'best guess' check. We want to make sure
186 * we don't try this on a PReP box without OF
187 * -- Cort
188 */
189 while (OFW_interface)
190 {
191 phandle dev_handle;
192 int mem_info[2];
193
194 /* get handle to memory description */
195 if (!(dev_handle = finddevice("/memory@0")))
196 break;
197
198 /* get the info */
199 if (getprop(dev_handle, "reg", mem_info,
200 sizeof(mem_info)) != 8)
201 break;
202
203 return mem_info[1];
204 }
205 }
206
207 /* Fall back to hard-coding 32MB. */
208 return 32*1024*1024;
209}
diff --git a/arch/ppc/boot/simple/misc-radstone_ppc7d.c b/arch/ppc/boot/simple/misc-radstone_ppc7d.c
deleted file mode 100644
index 0f302ea9c3d1..000000000000
--- a/arch/ppc/boot/simple/misc-radstone_ppc7d.c
+++ /dev/null
@@ -1,24 +0,0 @@
1/*
2 * Misc data for Radstone PPC7D board.
3 *
4 * Author: James Chapman <jchapman@katalix.com>
5 */
6
7#include <linux/types.h>
8#include <platforms/radstone_ppc7d.h>
9
10#if defined(CONFIG_SERIAL_MPSC_CONSOLE)
11extern u32 mv64x60_console_baud;
12extern u32 mv64x60_mpsc_clk_src;
13extern u32 mv64x60_mpsc_clk_freq;
14#endif
15
16void
17mv64x60_board_init(void __iomem *old_base, void __iomem *new_base)
18{
19#if defined(CONFIG_SERIAL_MPSC_CONSOLE)
20 mv64x60_console_baud = PPC7D_DEFAULT_BAUD;
21 mv64x60_mpsc_clk_src = PPC7D_MPSC_CLK_SRC;
22 mv64x60_mpsc_clk_freq = PPC7D_MPSC_CLK_FREQ;
23#endif
24}
diff --git a/arch/ppc/boot/simple/misc-spruce.c b/arch/ppc/boot/simple/misc-spruce.c
deleted file mode 100644
index 5b3a6c6f113b..000000000000
--- a/arch/ppc/boot/simple/misc-spruce.c
+++ /dev/null
@@ -1,271 +0,0 @@
1/*
2 * Misc. bootloader code for IBM Spruce reference platform
3 *
4 * Authors: Johnnie Peters <jpeters@mvista.com>
5 * Matt Porter <mporter@mvista.com>
6 *
7 * Derived from arch/ppc/boot/prep/misc.c
8 *
9 * 2000-2001 (c) MontaVista, Software, Inc. This file is licensed under
10 * the terms of the GNU General Public License version 2. This program
11 * is licensed "as is" without any warranty of any kind, whether express
12 * or implied.
13 */
14
15#include <linux/types.h>
16#include <linux/pci.h>
17
18#include <asm/bootinfo.h>
19
20extern unsigned long decompress_kernel(unsigned long load_addr, int num_words,
21 unsigned long cksum);
22
23/* Define some important locations of the Spruce. */
24#define SPRUCE_PCI_CONFIG_ADDR 0xfec00000
25#define SPRUCE_PCI_CONFIG_DATA 0xfec00004
26
27/* PCI configuration space access routines. */
28unsigned int *pci_config_address = (unsigned int *)SPRUCE_PCI_CONFIG_ADDR;
29unsigned char *pci_config_data = (unsigned char *)SPRUCE_PCI_CONFIG_DATA;
30
31void cpc700_pcibios_read_config_byte(unsigned char bus, unsigned char dev_fn,
32 unsigned char offset, unsigned char *val)
33{
34 out_le32(pci_config_address,
35 (((bus & 0xff)<<16) | (dev_fn<<8) | (offset&0xfc) | 0x80000000));
36
37 *val= (in_le32((unsigned *)pci_config_data) >> (8 * (offset & 3))) & 0xff;
38}
39
40void cpc700_pcibios_write_config_byte(unsigned char bus, unsigned char dev_fn,
41 unsigned char offset, unsigned char val)
42{
43 out_le32(pci_config_address,
44 (((bus & 0xff)<<16) | (dev_fn<<8) | (offset&0xfc) | 0x80000000));
45
46 out_8(pci_config_data + (offset&3), val);
47}
48
49void cpc700_pcibios_read_config_word(unsigned char bus, unsigned char dev_fn,
50 unsigned char offset, unsigned short *val)
51{
52 out_le32(pci_config_address,
53 (((bus & 0xff)<<16) | (dev_fn<<8) | (offset&0xfc) | 0x80000000));
54
55 *val= in_le16((unsigned short *)(pci_config_data + (offset&3)));
56}
57
58void cpc700_pcibios_write_config_word(unsigned char bus, unsigned char dev_fn,
59 unsigned char offset, unsigned short val)
60{
61 out_le32(pci_config_address,
62 (((bus & 0xff)<<16) | (dev_fn<<8) | (offset&0xfc) | 0x80000000));
63
64 out_le16((unsigned short *)(pci_config_data + (offset&3)), val);
65}
66
67void cpc700_pcibios_read_config_dword(unsigned char bus, unsigned char dev_fn,
68 unsigned char offset, unsigned int *val)
69{
70 out_le32(pci_config_address,
71 (((bus & 0xff)<<16) | (dev_fn<<8) | (offset&0xfc) | 0x80000000));
72
73 *val= in_le32((unsigned *)pci_config_data);
74}
75
76void cpc700_pcibios_write_config_dword(unsigned char bus, unsigned char dev_fn,
77 unsigned char offset, unsigned int val)
78{
79 out_le32(pci_config_address,
80 (((bus & 0xff)<<16) | (dev_fn<<8) | (offset&0xfc) | 0x80000000));
81
82 out_le32((unsigned *)pci_config_data, val);
83}
84
85#define PCNET32_WIO_RDP 0x10
86#define PCNET32_WIO_RAP 0x12
87#define PCNET32_WIO_RESET 0x14
88
89#define PCNET32_DWIO_RDP 0x10
90#define PCNET32_DWIO_RAP 0x14
91#define PCNET32_DWIO_RESET 0x18
92
93/* Processor interface config register access */
94#define PIFCFGADDR 0xff500000
95#define PIFCFGDATA 0xff500004
96
97#define PLBMIFOPT 0x18 /* PLB Master Interface Options */
98
99#define MEM_MBEN 0x24
100#define MEM_TYPE 0x28
101#define MEM_B1SA 0x3c
102#define MEM_B1EA 0x5c
103#define MEM_B2SA 0x40
104#define MEM_B2EA 0x60
105
106unsigned long
107get_mem_size(void)
108{
109 int loop;
110 unsigned long mem_size = 0;
111 unsigned long mem_mben;
112 unsigned long mem_type;
113 unsigned long mem_start;
114 unsigned long mem_end;
115 volatile int *mem_addr = (int *)0xff500008;
116 volatile int *mem_data = (int *)0xff50000c;
117
118 /* Get the size of memory from the memory controller. */
119 *mem_addr = MEM_MBEN;
120 asm("sync");
121 mem_mben = *mem_data;
122 asm("sync");
123 for(loop = 0; loop < 1000; loop++);
124
125 *mem_addr = MEM_TYPE;
126 asm("sync");
127 mem_type = *mem_data;
128 asm("sync");
129 for(loop = 0; loop < 1000; loop++);
130
131 *mem_addr = MEM_TYPE;
132 /* Confirm bank 1 has DRAM memory */
133 if ((mem_mben & 0x40000000) &&
134 ((mem_type & 0x30000000) == 0x10000000)) {
135 *mem_addr = MEM_B1SA;
136 asm("sync");
137 mem_start = *mem_data;
138 asm("sync");
139 for(loop = 0; loop < 1000; loop++);
140
141 *mem_addr = MEM_B1EA;
142 asm("sync");
143 mem_end = *mem_data;
144 asm("sync");
145 for(loop = 0; loop < 1000; loop++);
146
147 mem_size = mem_end - mem_start + 0x100000;
148 }
149
150 /* Confirm bank 2 has DRAM memory */
151 if ((mem_mben & 0x20000000) &&
152 ((mem_type & 0xc000000) == 0x4000000)) {
153 *mem_addr = MEM_B2SA;
154 asm("sync");
155 mem_start = *mem_data;
156 asm("sync");
157 for(loop = 0; loop < 1000; loop++);
158
159 *mem_addr = MEM_B2EA;
160 asm("sync");
161 mem_end = *mem_data;
162 asm("sync");
163 for(loop = 0; loop < 1000; loop++);
164
165 mem_size += mem_end - mem_start + 0x100000;
166 }
167 return mem_size;
168}
169
170unsigned long
171load_kernel(unsigned long load_addr, int num_words, unsigned long cksum,
172 void *ign1, void *ign2)
173{
174 int csr0;
175 int csr_id;
176 int pci_devfn;
177 int found_multi = 0;
178 unsigned short vendor;
179 unsigned short device;
180 unsigned short command;
181 unsigned char header_type;
182 unsigned int bar0;
183 volatile int *pif_addr = (int *)0xff500000;
184 volatile int *pif_data = (int *)0xff500004;
185
186 /*
187 * Gah, these firmware guys need to learn that hardware
188 * byte swapping is evil! Disable all hardware byte
189 * swapping so it doesn't hurt anyone.
190 */
191 *pif_addr = PLBMIFOPT;
192 asm("sync");
193 *pif_data = 0x00000000;
194 asm("sync");
195
196 /* Search out and turn off the PcNet ethernet boot device. */
197 for (pci_devfn = 1; pci_devfn < 0xff; pci_devfn++) {
198 if (PCI_FUNC(pci_devfn) && !found_multi)
199 continue;
200
201 cpc700_pcibios_read_config_byte(0, pci_devfn,
202 PCI_HEADER_TYPE, &header_type);
203
204 if (!PCI_FUNC(pci_devfn))
205 found_multi = header_type & 0x80;
206
207 cpc700_pcibios_read_config_word(0, pci_devfn, PCI_VENDOR_ID,
208 &vendor);
209
210 if (vendor != 0xffff) {
211 cpc700_pcibios_read_config_word(0, pci_devfn,
212 PCI_DEVICE_ID, &device);
213
214 /* If this PCI device is the Lance PCNet board then turn it off */
215 if ((vendor == PCI_VENDOR_ID_AMD) &&
216 (device == PCI_DEVICE_ID_AMD_LANCE)) {
217
218 /* Turn on I/O Space on the board. */
219 cpc700_pcibios_read_config_word(0, pci_devfn,
220 PCI_COMMAND, &command);
221 command |= 0x1;
222 cpc700_pcibios_write_config_word(0, pci_devfn,
223 PCI_COMMAND, command);
224
225 /* Get the I/O space address */
226 cpc700_pcibios_read_config_dword(0, pci_devfn,
227 PCI_BASE_ADDRESS_0, &bar0);
228 bar0 &= 0xfffffffe;
229
230 /* Reset the PCNet Board */
231 inl (bar0+PCNET32_DWIO_RESET);
232 inw (bar0+PCNET32_WIO_RESET);
233
234 /* First do a work oriented read of csr0. If the value is
235 * 4 then this is the correct mode to access the board.
236 * If not try a double word ortiented read.
237 */
238 outw(0, bar0 + PCNET32_WIO_RAP);
239 csr0 = inw(bar0 + PCNET32_WIO_RDP);
240
241 if (csr0 == 4) {
242 /* Check the Chip id register */
243 outw(88, bar0 + PCNET32_WIO_RAP);
244 csr_id = inw(bar0 + PCNET32_WIO_RDP);
245
246 if (csr_id) {
247 /* This is the valid mode - set the stop bit */
248 outw(0, bar0 + PCNET32_WIO_RAP);
249 outw(csr0, bar0 + PCNET32_WIO_RDP);
250 }
251 } else {
252 outl(0, bar0 + PCNET32_DWIO_RAP);
253 csr0 = inl(bar0 + PCNET32_DWIO_RDP);
254 if (csr0 == 4) {
255 /* Check the Chip id register */
256 outl(88, bar0 + PCNET32_WIO_RAP);
257 csr_id = inl(bar0 + PCNET32_WIO_RDP);
258
259 if (csr_id) {
260 /* This is the valid mode - set the stop bit*/
261 outl(0, bar0 + PCNET32_WIO_RAP);
262 outl(csr0, bar0 + PCNET32_WIO_RDP);
263 }
264 }
265 }
266 }
267 }
268 }
269
270 return decompress_kernel(load_addr, num_words, cksum);
271}
diff --git a/arch/ppc/boot/simple/misc.c b/arch/ppc/boot/simple/misc.c
deleted file mode 100644
index c3d3305eb5ca..000000000000
--- a/arch/ppc/boot/simple/misc.c
+++ /dev/null
@@ -1,278 +0,0 @@
1/*
2 * Misc. bootloader code for many machines. This assumes you have are using
3 * a 6xx/7xx/74xx CPU in your machine. This assumes the chunk of memory
4 * below 8MB is free. Finally, it assumes you have a NS16550-style uart for
5 * your serial console. If a machine meets these requirements, it can quite
6 * likely use this code during boot.
7 *
8 * Author: Matt Porter <mporter@mvista.com>
9 * Derived from arch/ppc/boot/prep/misc.c
10 *
11 * 2001 (c) MontaVista, Software, Inc. This file is licensed under
12 * the terms of the GNU General Public License version 2. This program
13 * is licensed "as is" without any warranty of any kind, whether express
14 * or implied.
15 */
16
17#include <linux/types.h>
18#include <linux/string.h>
19
20#include <asm/page.h>
21#include <asm/mmu.h>
22#include <asm/bootinfo.h>
23#ifdef CONFIG_4xx
24#include <asm/ibm4xx.h>
25#endif
26#include <asm/reg.h>
27
28#include "nonstdio.h"
29
30/* Default cmdline */
31#ifdef CONFIG_CMDLINE
32#define CMDLINE CONFIG_CMDLINE
33#else
34#define CMDLINE ""
35#endif
36
37/* Keyboard (and VGA console)? */
38#ifdef CONFIG_VGA_CONSOLE
39#define HAS_KEYB 1
40#else
41#define HAS_KEYB 0
42#endif
43
44/* Will / Can the user give input?
45 */
46#if (defined(CONFIG_SERIAL_8250_CONSOLE) \
47 || defined(CONFIG_VGA_CONSOLE) \
48 || defined(CONFIG_SERIAL_MPC52xx_CONSOLE) \
49 || defined(CONFIG_SERIAL_MPSC_CONSOLE))
50#define INTERACTIVE_CONSOLE 1
51#endif
52
53char *avail_ram;
54char *end_avail;
55char *zimage_start;
56char cmd_preset[] = CMDLINE;
57char cmd_buf[256];
58char *cmd_line = cmd_buf;
59int keyb_present = HAS_KEYB;
60int zimage_size;
61
62unsigned long com_port;
63unsigned long initrd_size = 0;
64
65/* The linker tells us various locations in the image */
66extern char __image_begin, __image_end;
67extern char __ramdisk_begin, __ramdisk_end;
68extern char _end[];
69/* Original location */
70extern unsigned long start;
71
72extern int CRT_tstc(void);
73extern unsigned long serial_init(int chan, void *ignored);
74extern void serial_close(unsigned long com_port);
75extern void gunzip(void *, int, unsigned char *, int *);
76extern void serial_fixups(void);
77
78/* Allow get_mem_size to be hooked into. This is the default. */
79unsigned long __attribute__ ((weak))
80get_mem_size(void)
81{
82 return 0;
83}
84
85#if defined(CONFIG_40x)
86#define PPC4xx_EMAC0_MR0 EMAC0_BASE
87#endif
88
89#if defined(CONFIG_44x) && defined(PPC44x_EMAC0_MR0)
90#define PPC4xx_EMAC0_MR0 PPC44x_EMAC0_MR0
91#endif
92
93struct bi_record *
94decompress_kernel(unsigned long load_addr, int num_words, unsigned long cksum)
95{
96#ifdef INTERACTIVE_CONSOLE
97 int timer = 0;
98 char ch;
99#endif
100 char *cp;
101 struct bi_record *rec;
102 unsigned long initrd_loc = 0, TotalMemory = 0;
103
104#if defined(CONFIG_SERIAL_8250_CONSOLE) || defined(CONFIG_SERIAL_MPSC_CONSOLE)
105 com_port = serial_init(0, NULL);
106#endif
107
108#if defined(PPC4xx_EMAC0_MR0)
109 /* Reset MAL */
110 mtdcr(DCRN_MALCR(DCRN_MAL_BASE), MALCR_MMSR);
111 /* Wait for reset */
112 while (mfdcr(DCRN_MALCR(DCRN_MAL_BASE)) & MALCR_MMSR) {};
113 /* Reset EMAC */
114 *(volatile unsigned long *)PPC4xx_EMAC0_MR0 = 0x20000000;
115 __asm__ __volatile__("eieio");
116#endif
117
118 /*
119 * Call get_mem_size(), which is memory controller dependent,
120 * and we must have the correct file linked in here.
121 */
122 TotalMemory = get_mem_size();
123
124 /* assume the chunk below 8M is free */
125 end_avail = (char *)0x00800000;
126
127 /*
128 * Reveal where we were loaded at and where we
129 * were relocated to.
130 */
131 puts("loaded at: "); puthex(load_addr);
132 puts(" "); puthex((unsigned long)(load_addr + (4*num_words)));
133 puts("\n");
134 if ( (unsigned long)load_addr != (unsigned long)&start )
135 {
136 puts("relocated to: "); puthex((unsigned long)&start);
137 puts(" ");
138 puthex((unsigned long)((unsigned long)&start + (4*num_words)));
139 puts("\n");
140 }
141
142 /*
143 * We link ourself to 0x00800000. When we run, we relocate
144 * ourselves there. So we just need __image_begin for the
145 * start. -- Tom
146 */
147 zimage_start = (char *)(unsigned long)(&__image_begin);
148 zimage_size = (unsigned long)(&__image_end) -
149 (unsigned long)(&__image_begin);
150
151 initrd_size = (unsigned long)(&__ramdisk_end) -
152 (unsigned long)(&__ramdisk_begin);
153
154 /*
155 * The zImage and initrd will be between start and _end, so they've
156 * already been moved once. We're good to go now. -- Tom
157 */
158 avail_ram = (char *)PAGE_ALIGN((unsigned long)_end);
159 puts("zimage at: "); puthex((unsigned long)zimage_start);
160 puts(" "); puthex((unsigned long)(zimage_size+zimage_start));
161 puts("\n");
162
163 if ( initrd_size ) {
164 puts("initrd at: ");
165 puthex((unsigned long)(&__ramdisk_begin));
166 puts(" "); puthex((unsigned long)(&__ramdisk_end));puts("\n");
167 }
168
169#ifndef CONFIG_40x /* don't overwrite the 40x image located at 0x00400000! */
170 avail_ram = (char *)0x00400000;
171#endif
172 end_avail = (char *)0x00800000;
173 puts("avail ram: "); puthex((unsigned long)avail_ram); puts(" ");
174 puthex((unsigned long)end_avail); puts("\n");
175
176 if (keyb_present)
177 CRT_tstc(); /* Forces keyboard to be initialized */
178
179 /* Display standard Linux/PPC boot prompt for kernel args */
180 puts("\nLinux/PPC load: ");
181 cp = cmd_line;
182 memcpy (cmd_line, cmd_preset, sizeof(cmd_preset));
183 while ( *cp ) putc(*cp++);
184
185#ifdef INTERACTIVE_CONSOLE
186 /*
187 * If they have a console, allow them to edit the command line.
188 * Otherwise, don't bother wasting the five seconds.
189 */
190 while (timer++ < 5*1000) {
191 if (tstc()) {
192 while ((ch = getc()) != '\n' && ch != '\r') {
193 /* Test for backspace/delete */
194 if (ch == '\b' || ch == '\177') {
195 if (cp != cmd_line) {
196 cp--;
197 puts("\b \b");
198 }
199 /* Test for ^x/^u (and wipe the line) */
200 } else if (ch == '\030' || ch == '\025') {
201 while (cp != cmd_line) {
202 cp--;
203 puts("\b \b");
204 }
205 } else {
206 *cp++ = ch;
207 putc(ch);
208 }
209 }
210 break; /* Exit 'timer' loop */
211 }
212 udelay(1000); /* 1 msec */
213 }
214 *cp = 0;
215#endif
216 puts("\n");
217
218 puts("Uncompressing Linux...");
219 gunzip(NULL, 0x400000, zimage_start, &zimage_size);
220 puts("done.\n");
221
222 /* get the bi_rec address */
223 rec = bootinfo_addr(zimage_size);
224
225 /* We need to make sure that the initrd and bi_recs do not
226 * overlap. */
227 if ( initrd_size ) {
228 unsigned long rec_loc = (unsigned long) rec;
229 initrd_loc = (unsigned long)(&__ramdisk_begin);
230 /* If the bi_recs are in the middle of the current
231 * initrd, move the initrd to the next MB
232 * boundary. */
233 if ((rec_loc > initrd_loc) &&
234 ((initrd_loc + initrd_size) > rec_loc)) {
235 initrd_loc = _ALIGN((unsigned long)(zimage_size)
236 + (2 << 20) - 1, (2 << 20));
237 memmove((void *)initrd_loc, &__ramdisk_begin,
238 initrd_size);
239 puts("initrd moved: "); puthex(initrd_loc);
240 puts(" "); puthex(initrd_loc + initrd_size);
241 puts("\n");
242 }
243 }
244
245 bootinfo_init(rec);
246 if ( TotalMemory )
247 bootinfo_append(BI_MEMSIZE, sizeof(int), (void*)&TotalMemory);
248
249 bootinfo_append(BI_CMD_LINE, strlen(cmd_line)+1, (void*)cmd_line);
250
251 /* add a bi_rec for the initrd if it exists */
252 if (initrd_size) {
253 unsigned long initrd[2];
254
255 initrd[0] = initrd_loc;
256 initrd[1] = initrd_size;
257
258 bootinfo_append(BI_INITRD, sizeof(initrd), &initrd);
259 }
260 puts("Now booting the kernel\n");
261 serial_close(com_port);
262
263 return rec;
264}
265
266void __attribute__ ((weak))
267board_isa_init(void)
268{
269}
270
271/* Allow decompress_kernel to be hooked into. This is the default. */
272void * __attribute__ ((weak))
273load_kernel(unsigned long load_addr, int num_words, unsigned long cksum,
274 void *ign1, void *ign2)
275{
276 board_isa_init();
277 return decompress_kernel(load_addr, num_words, cksum);
278}
diff --git a/arch/ppc/boot/simple/mpc10x_memory.c b/arch/ppc/boot/simple/mpc10x_memory.c
deleted file mode 100644
index 8da8f576031d..000000000000
--- a/arch/ppc/boot/simple/mpc10x_memory.c
+++ /dev/null
@@ -1,109 +0,0 @@
1/*
2 * A routine to find out how much memory the machine has.
3 *
4 * Based on:
5 * arch/ppc/kernel/mpc10x_common.c
6 *
7 * Author: Mark A. Greer
8 * mgreer@mvista.com
9 *
10 * 2001-2002 (c) MontaVista, Software, Inc. This file is licensed under
11 * the terms of the GNU General Public License version 2. This program
12 * is licensed "as is" without any warranty of any kind, whether express
13 * or implied.
14 */
15
16#include <linux/pci.h>
17#include <asm/types.h>
18#include <asm/io.h>
19#include "mpc10x.h"
20
21/*
22 * *** WARNING - A BAT MUST be set to access the PCI config addr/data regs ***
23 */
24
25/*
26 * PCI config space macros, similar to indirect_xxx and early_xxx macros.
27 * We assume bus 0.
28 */
29#define MPC10X_CFG_read(val, addr, type, op) *val = op((type)(addr))
30#define MPC10X_CFG_write(val, addr, type, op) op((type *)(addr), (val))
31
32#define MPC10X_PCI_OP(rw, size, type, op, mask) \
33static void \
34mpc10x_##rw##_config_##size(unsigned int __iomem *cfg_addr, \
35 unsigned int *cfg_data, int devfn, int offset, \
36 type val) \
37{ \
38 out_be32(cfg_addr, \
39 ((offset & 0xfc) << 24) | (devfn << 16) \
40 | (0 << 8) | 0x80); \
41 MPC10X_CFG_##rw(val, cfg_data + (offset & mask), type, op); \
42 return; \
43}
44
45MPC10X_PCI_OP(read, byte, u8 *, in_8, 3)
46MPC10X_PCI_OP(read, dword, u32 *, in_le32, 0)
47
48/*
49 * Read the memory controller registers to determine the amount of memory in
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
52 * under a PReP memory map. On all other machines, we assume we are under
53 * a CHRP memory map. Further, on CONFIG_PPC_PREP we must rename
54 * this function.
55 */
56#ifdef CONFIG_PPC_PREP
57#define get_mem_size mpc10x_get_mem_size
58#endif
59unsigned long
60get_mem_size(void)
61{
62 unsigned int *config_addr, *config_data, val;
63 unsigned long start, end, total, offset;
64 int i;
65 unsigned char bank_enables;
66
67#ifdef CONFIG_PPC_PREP
68 config_addr = (unsigned int *)MPC10X_MAPA_CNFG_ADDR;
69 config_data = (unsigned int *)MPC10X_MAPA_CNFG_DATA;
70#else
71 config_addr = (unsigned int *)MPC10X_MAPB_CNFG_ADDR;
72 config_data = (unsigned int *)MPC10X_MAPB_CNFG_DATA;
73#endif
74
75 mpc10x_read_config_byte(config_addr, config_data, PCI_DEVFN(0,0),
76 MPC10X_MCTLR_MEM_BANK_ENABLES, &bank_enables);
77
78 total = 0;
79
80 for (i = 0; i < 8; i++) {
81 if (bank_enables & (1 << i)) {
82 offset = MPC10X_MCTLR_MEM_START_1 + ((i > 3) ? 4 : 0);
83 mpc10x_read_config_dword(config_addr, config_data,
84 PCI_DEVFN(0,0), offset, &val);
85 start = (val >> ((i & 3) << 3)) & 0xff;
86
87 offset = MPC10X_MCTLR_EXT_MEM_START_1 + ((i>3) ? 4 : 0);
88 mpc10x_read_config_dword(config_addr, config_data,
89 PCI_DEVFN(0,0), offset, &val);
90 val = (val >> ((i & 3) << 3)) & 0x03;
91 start = (val << 28) | (start << 20);
92
93 offset = MPC10X_MCTLR_MEM_END_1 + ((i > 3) ? 4 : 0);
94 mpc10x_read_config_dword(config_addr, config_data,
95 PCI_DEVFN(0,0), offset, &val);
96 end = (val >> ((i & 3) << 3)) & 0xff;
97
98 offset = MPC10X_MCTLR_EXT_MEM_END_1 + ((i > 3) ? 4 : 0);
99 mpc10x_read_config_dword(config_addr, config_data,
100 PCI_DEVFN(0,0), offset, &val);
101 val = (val >> ((i & 3) << 3)) & 0x03;
102 end = (val << 28) | (end << 20) | 0xfffff;
103
104 total += (end - start + 1);
105 }
106 }
107
108 return total;
109}
diff --git a/arch/ppc/boot/simple/mpc52xx_tty.c b/arch/ppc/boot/simple/mpc52xx_tty.c
deleted file mode 100644
index 6955891fb031..000000000000
--- a/arch/ppc/boot/simple/mpc52xx_tty.c
+++ /dev/null
@@ -1,137 +0,0 @@
1/*
2 * Minimal serial functions needed to send messages out a MPC52xx
3 * Programmable Serial Controller (PSC).
4 *
5 * Author: Dale Farnsworth <dfarnsworth@mvista.com>
6 *
7 * 2003-2004 (c) MontaVista, Software, Inc. This file is licensed under the
8 * terms of the GNU General Public License version 2. This program is licensed
9 * "as is" without any warranty of any kind, whether express or implied.
10 */
11
12#include <linux/types.h>
13#include <asm/uaccess.h>
14#include <asm/mpc52xx.h>
15#include <asm/mpc52xx_psc.h>
16#include <asm/serial.h>
17#include <asm/io.h>
18#include <asm/time.h>
19
20
21#ifdef MPC52xx_PF_CONSOLE_PORT
22#define MPC52xx_CONSOLE MPC52xx_PSCx_OFFSET(MPC52xx_PF_CONSOLE_PORT)
23#define MPC52xx_PSC_CONFIG_SHIFT ((MPC52xx_PF_CONSOLE_PORT-1)<<2)
24#else
25#error "MPC52xx_PF_CONSOLE_PORT not defined"
26#endif
27
28static struct mpc52xx_psc __iomem *psc =
29 (struct mpc52xx_psc __iomem *) MPC52xx_PA(MPC52xx_CONSOLE);
30
31/* The decrementer counts at the system bus clock frequency
32 * divided by four. The most accurate time base is connected to the
33 * rtc. We read the decrementer change during one rtc tick
34 * and multiply by 4 to get the system bus clock frequency. Since a
35 * rtc tick is one seconds, and that's pretty long, we change the rtc
36 * dividers temporarily to set them 64x faster ;)
37 */
38static int
39mpc52xx_ipbfreq(void)
40{
41 struct mpc52xx_rtc __iomem *rtc =
42 (struct mpc52xx_rtc __iomem *) MPC52xx_PA(MPC52xx_RTC_OFFSET);
43 struct mpc52xx_cdm __iomem *cdm =
44 (struct mpc52xx_cdm __iomem *) MPC52xx_PA(MPC52xx_CDM_OFFSET);
45 int current_time, previous_time;
46 int tbl_start, tbl_end;
47 int xlbfreq, ipbfreq;
48
49 out_be32(&rtc->dividers, 0x8f1f0000); /* Set RTC 64x faster */
50 previous_time = in_be32(&rtc->time);
51 while ((current_time = in_be32(&rtc->time)) == previous_time) ;
52 tbl_start = get_tbl();
53 previous_time = current_time;
54 while ((current_time = in_be32(&rtc->time)) == previous_time) ;
55 tbl_end = get_tbl();
56 out_be32(&rtc->dividers, 0xffff0000); /* Restore RTC */
57
58 xlbfreq = (tbl_end - tbl_start) << 8;
59 ipbfreq = (in_8(&cdm->ipb_clk_sel) & 1) ? xlbfreq / 2 : xlbfreq;
60
61 return ipbfreq;
62}
63
64unsigned long
65serial_init(int ignored, void *ignored2)
66{
67 struct mpc52xx_gpio __iomem *gpio =
68 (struct mpc52xx_gpio __iomem *) MPC52xx_PA(MPC52xx_GPIO_OFFSET);
69 int divisor;
70 int mode1;
71 int mode2;
72 u32 val32;
73
74 static int been_here = 0;
75
76 if (been_here)
77 return 0;
78
79 been_here = 1;
80
81 val32 = in_be32(&gpio->port_config);
82 val32 &= ~(0x7 << MPC52xx_PSC_CONFIG_SHIFT);
83 val32 |= MPC52xx_GPIO_PSC_CONFIG_UART_WITHOUT_CD
84 << MPC52xx_PSC_CONFIG_SHIFT;
85 out_be32(&gpio->port_config, val32);
86
87 out_8(&psc->command, MPC52xx_PSC_RST_TX
88 | MPC52xx_PSC_RX_DISABLE | MPC52xx_PSC_TX_ENABLE);
89 out_8(&psc->command, MPC52xx_PSC_RST_RX);
90
91 out_be32(&psc->sicr, 0x0);
92 out_be16(&psc->mpc52xx_psc_clock_select, 0xdd00);
93 out_be16(&psc->tfalarm, 0xf8);
94
95 out_8(&psc->command, MPC52xx_PSC_SEL_MODE_REG_1
96 | MPC52xx_PSC_RX_ENABLE
97 | MPC52xx_PSC_TX_ENABLE);
98
99 divisor = ((mpc52xx_ipbfreq()
100 / (CONFIG_SERIAL_MPC52xx_CONSOLE_BAUD * 16)) + 1) >> 1;
101
102 mode1 = MPC52xx_PSC_MODE_8_BITS | MPC52xx_PSC_MODE_PARNONE
103 | MPC52xx_PSC_MODE_ERR;
104 mode2 = MPC52xx_PSC_MODE_ONE_STOP;
105
106 out_8(&psc->ctur, divisor>>8);
107 out_8(&psc->ctlr, divisor);
108 out_8(&psc->command, MPC52xx_PSC_SEL_MODE_REG_1);
109 out_8(&psc->mode, mode1);
110 out_8(&psc->mode, mode2);
111
112 return 0; /* ignored */
113}
114
115void
116serial_putc(void *ignored, const char c)
117{
118 serial_init(0, NULL);
119
120 while (!(in_be16(&psc->mpc52xx_psc_status) & MPC52xx_PSC_SR_TXEMP)) ;
121 out_8(&psc->mpc52xx_psc_buffer_8, c);
122 while (!(in_be16(&psc->mpc52xx_psc_status) & MPC52xx_PSC_SR_TXEMP)) ;
123}
124
125char
126serial_getc(void *ignored)
127{
128 while (!(in_be16(&psc->mpc52xx_psc_status) & MPC52xx_PSC_SR_RXRDY)) ;
129
130 return in_8(&psc->mpc52xx_psc_buffer_8);
131}
132
133int
134serial_tstc(void *ignored)
135{
136 return (in_be16(&psc->mpc52xx_psc_status) & MPC52xx_PSC_SR_RXRDY) != 0;
137}
diff --git a/arch/ppc/boot/simple/mv64x60_tty.c b/arch/ppc/boot/simple/mv64x60_tty.c
deleted file mode 100644
index 8a735787a6e9..000000000000
--- a/arch/ppc/boot/simple/mv64x60_tty.c
+++ /dev/null
@@ -1,364 +0,0 @@
1/*
2 * Bootloader version of the embedded MPSC/UART driver for the Marvell 64x60.
3 * Note: Due to a GT64260A erratum, DMA will be used for UART input (via SDMA).
4 *
5 * Author: Mark A. Greer <mgreer@mvista.com>
6 *
7 * 2001 (c) MontaVista Software, Inc. This file is licensed under
8 * the terms of the GNU General Public License version 2. This program
9 * is licensed "as is" without any warranty of any kind, whether express
10 * or implied.
11 */
12
13/* This code assumes that the data cache has been disabled (L1, L2, L3). */
14
15#include <linux/types.h>
16#include <linux/serial_reg.h>
17#include <asm/serial.h>
18#include <asm/io.h>
19#include <asm/mv64x60_defs.h>
20#include <mpsc_defs.h>
21
22#ifdef CONFIG_EV64360
23#include <platforms/ev64360.h>
24u32 mv64x60_console_baud = EV64360_DEFAULT_BAUD;
25u32 mv64x60_mpsc_clk_src = EV64360_MPSC_CLK_SRC; /* TCLK */
26u32 mv64x60_mpsc_clk_freq = EV64360_MPSC_CLK_FREQ;
27#else
28u32 mv64x60_console_baud = 9600;
29u32 mv64x60_mpsc_clk_src = 8; /* TCLK */
30u32 mv64x60_mpsc_clk_freq = 100000000;
31#endif
32
33extern void udelay(long);
34static void stop_dma(int chan);
35
36static void __iomem *mv64x60_base = (void __iomem *)CONFIG_MV64X60_NEW_BASE;
37
38struct sdma_regs {
39 u32 sdc;
40 u32 sdcm;
41 u32 rx_desc;
42 u32 rx_buf_ptr;
43 u32 scrdp;
44 u32 tx_desc;
45 u32 sctdp;
46 u32 sftdp;
47};
48
49static struct sdma_regs sdma_regs[2];
50
51#define SDMA_REGS_INIT(s, reg_base) { \
52 (s)->sdc = (reg_base) + SDMA_SDC; \
53 (s)->sdcm = (reg_base) + SDMA_SDCM; \
54 (s)->rx_desc = (reg_base) + SDMA_RX_DESC; \
55 (s)->rx_buf_ptr = (reg_base) + SDMA_RX_BUF_PTR; \
56 (s)->scrdp = (reg_base) + SDMA_SCRDP; \
57 (s)->tx_desc = (reg_base) + SDMA_TX_DESC; \
58 (s)->sctdp = (reg_base) + SDMA_SCTDP; \
59 (s)->sftdp = (reg_base) + SDMA_SFTDP; \
60}
61
62static u32 mpsc_base[2] = { MV64x60_MPSC_0_OFFSET, MV64x60_MPSC_1_OFFSET };
63
64struct mv64x60_rx_desc {
65 u16 bufsize;
66 u16 bytecnt;
67 u32 cmd_stat;
68 u32 next_desc_ptr;
69 u32 buffer;
70};
71
72struct mv64x60_tx_desc {
73 u16 bytecnt;
74 u16 shadow;
75 u32 cmd_stat;
76 u32 next_desc_ptr;
77 u32 buffer;
78};
79
80#define MAX_RESET_WAIT 10000
81#define MAX_TX_WAIT 10000
82
83#define RX_NUM_DESC 2
84#define TX_NUM_DESC 2
85
86#define RX_BUF_SIZE 32
87#define TX_BUF_SIZE 32
88
89static struct mv64x60_rx_desc rd[2][RX_NUM_DESC] __attribute__ ((aligned(32)));
90static struct mv64x60_tx_desc td[2][TX_NUM_DESC] __attribute__ ((aligned(32)));
91
92static char rx_buf[2][RX_NUM_DESC * RX_BUF_SIZE] __attribute__ ((aligned(32)));
93static char tx_buf[2][TX_NUM_DESC * TX_BUF_SIZE] __attribute__ ((aligned(32)));
94
95static int cur_rd[2] = { 0, 0 };
96static int cur_td[2] = { 0, 0 };
97
98static char chan_initialized[2] = { 0, 0 };
99
100
101#define RX_INIT_RDP(rdp) { \
102 (rdp)->bufsize = 2; \
103 (rdp)->bytecnt = 0; \
104 (rdp)->cmd_stat = SDMA_DESC_CMDSTAT_L | SDMA_DESC_CMDSTAT_F | \
105 SDMA_DESC_CMDSTAT_O; \
106}
107
108#ifdef CONFIG_MV64360
109static u32 cpu2mem_tab[MV64x60_CPU2MEM_WINDOWS][2] = {
110 { MV64x60_CPU2MEM_0_BASE, MV64x60_CPU2MEM_0_SIZE },
111 { MV64x60_CPU2MEM_1_BASE, MV64x60_CPU2MEM_1_SIZE },
112 { MV64x60_CPU2MEM_2_BASE, MV64x60_CPU2MEM_2_SIZE },
113 { MV64x60_CPU2MEM_3_BASE, MV64x60_CPU2MEM_3_SIZE }
114};
115
116static u32 com2mem_tab[MV64x60_CPU2MEM_WINDOWS][2] = {
117 { MV64360_MPSC2MEM_0_BASE, MV64360_MPSC2MEM_0_SIZE },
118 { MV64360_MPSC2MEM_1_BASE, MV64360_MPSC2MEM_1_SIZE },
119 { MV64360_MPSC2MEM_2_BASE, MV64360_MPSC2MEM_2_SIZE },
120 { MV64360_MPSC2MEM_3_BASE, MV64360_MPSC2MEM_3_SIZE }
121};
122
123static u32 dram_selects[MV64x60_CPU2MEM_WINDOWS] = { 0xe, 0xd, 0xb, 0x7 };
124#endif
125
126unsigned long
127serial_init(int chan, void *ignored)
128{
129 u32 mpsc_routing_base, sdma_base, brg_bcr, cdv;
130 int i;
131
132 chan = (chan == 1); /* default to chan 0 if anything but 1 */
133
134 if (chan_initialized[chan])
135 return chan;
136
137 chan_initialized[chan] = 1;
138
139 if (chan == 0) {
140 sdma_base = MV64x60_SDMA_0_OFFSET;
141 brg_bcr = MV64x60_BRG_0_OFFSET + BRG_BCR;
142 SDMA_REGS_INIT(&sdma_regs[0], MV64x60_SDMA_0_OFFSET);
143 } else {
144 sdma_base = MV64x60_SDMA_1_OFFSET;
145 brg_bcr = MV64x60_BRG_1_OFFSET + BRG_BCR;
146 SDMA_REGS_INIT(&sdma_regs[0], MV64x60_SDMA_1_OFFSET);
147 }
148
149 mpsc_routing_base = MV64x60_MPSC_ROUTING_OFFSET;
150
151 stop_dma(chan);
152
153 /* Set up ring buffers */
154 for (i=0; i<RX_NUM_DESC; i++) {
155 RX_INIT_RDP(&rd[chan][i]);
156 rd[chan][i].buffer = (u32)&rx_buf[chan][i * RX_BUF_SIZE];
157 rd[chan][i].next_desc_ptr = (u32)&rd[chan][i+1];
158 }
159 rd[chan][RX_NUM_DESC - 1].next_desc_ptr = (u32)&rd[chan][0];
160
161 for (i=0; i<TX_NUM_DESC; i++) {
162 td[chan][i].bytecnt = 0;
163 td[chan][i].shadow = 0;
164 td[chan][i].buffer = (u32)&tx_buf[chan][i * TX_BUF_SIZE];
165 td[chan][i].cmd_stat = SDMA_DESC_CMDSTAT_F|SDMA_DESC_CMDSTAT_L;
166 td[chan][i].next_desc_ptr = (u32)&td[chan][i+1];
167 }
168 td[chan][TX_NUM_DESC - 1].next_desc_ptr = (u32)&td[chan][0];
169
170 /* Set MPSC Routing */
171 out_le32(mv64x60_base + mpsc_routing_base + MPSC_MRR, 0x3ffffe38);
172
173#ifdef CONFIG_GT64260
174 out_le32(mv64x60_base + GT64260_MPP_SERIAL_PORTS_MULTIPLEX, 0x00001102);
175#else /* Must be MV64360 or MV64460 */
176 {
177 u32 enables, prot_bits, v;
178
179 /* Set up comm unit to memory mapping windows */
180 /* Note: Assumes MV64x60_CPU2MEM_WINDOWS == 4 */
181
182 enables = in_le32(mv64x60_base + MV64360_CPU_BAR_ENABLE) & 0xf;
183 prot_bits = 0;
184
185 for (i=0; i<MV64x60_CPU2MEM_WINDOWS; i++) {
186 if (!(enables & (1 << i))) {
187 v = in_le32(mv64x60_base + cpu2mem_tab[i][0]);
188 v = ((v & 0xffff) << 16) | (dram_selects[i] << 8);
189 out_le32(mv64x60_base + com2mem_tab[i][0], v);
190
191 v = in_le32(mv64x60_base + cpu2mem_tab[i][1]);
192 v = (v & 0xffff) << 16;
193 out_le32(mv64x60_base + com2mem_tab[i][1], v);
194
195 prot_bits |= (0x3 << (i << 1)); /* r/w access */
196 }
197 }
198
199 out_le32(mv64x60_base + MV64360_MPSC_0_REMAP, 0);
200 out_le32(mv64x60_base + MV64360_MPSC_1_REMAP, 0);
201 out_le32(mv64x60_base + MV64360_MPSC2MEM_ACC_PROT_0, prot_bits);
202 out_le32(mv64x60_base + MV64360_MPSC2MEM_ACC_PROT_1, prot_bits);
203 out_le32(mv64x60_base + MV64360_MPSC2MEM_BAR_ENABLE, enables);
204 }
205#endif
206
207 /* MPSC 0/1 Rx & Tx get clocks BRG0/1 */
208 out_le32(mv64x60_base + mpsc_routing_base + MPSC_RCRR, 0x00000100);
209 out_le32(mv64x60_base + mpsc_routing_base + MPSC_TCRR, 0x00000100);
210
211 /* clear pending interrupts */
212 out_le32(mv64x60_base + MV64x60_SDMA_INTR_OFFSET + SDMA_INTR_MASK, 0);
213
214 out_le32(mv64x60_base + SDMA_SCRDP + sdma_base, (int)&rd[chan][0]);
215 out_le32(mv64x60_base + SDMA_SCTDP + sdma_base,
216 (int)&td[chan][TX_NUM_DESC - 1]);
217 out_le32(mv64x60_base + SDMA_SFTDP + sdma_base,
218 (int)&td[chan][TX_NUM_DESC - 1]);
219
220 out_le32(mv64x60_base + SDMA_SDC + sdma_base,
221 SDMA_SDC_RFT | SDMA_SDC_SFM | SDMA_SDC_BLMR | SDMA_SDC_BLMT |
222 (3 << 12));
223
224 cdv = ((mv64x60_mpsc_clk_freq/(32*mv64x60_console_baud))-1);
225 out_le32(mv64x60_base + brg_bcr,
226 ((mv64x60_mpsc_clk_src << 18) | (1 << 16) | cdv));
227
228 /* Put MPSC into UART mode, no null modem, 16x clock mode */
229 out_le32(mv64x60_base + MPSC_MMCRL + mpsc_base[chan], 0x000004c4);
230 out_le32(mv64x60_base + MPSC_MMCRH + mpsc_base[chan], 0x04400400);
231
232 out_le32(mv64x60_base + MPSC_CHR_1 + mpsc_base[chan], 0);
233 out_le32(mv64x60_base + MPSC_CHR_9 + mpsc_base[chan], 0);
234 out_le32(mv64x60_base + MPSC_CHR_10 + mpsc_base[chan], 0);
235 out_le32(mv64x60_base + MPSC_CHR_3 + mpsc_base[chan], 4);
236 out_le32(mv64x60_base + MPSC_CHR_4 + mpsc_base[chan], 0);
237 out_le32(mv64x60_base + MPSC_CHR_5 + mpsc_base[chan], 0);
238 out_le32(mv64x60_base + MPSC_CHR_6 + mpsc_base[chan], 0);
239 out_le32(mv64x60_base + MPSC_CHR_7 + mpsc_base[chan], 0);
240 out_le32(mv64x60_base + MPSC_CHR_8 + mpsc_base[chan], 0);
241
242 /* 8 data bits, 1 stop bit */
243 out_le32(mv64x60_base + MPSC_MPCR + mpsc_base[chan], (3 << 12));
244 out_le32(mv64x60_base + SDMA_SDCM + sdma_base, SDMA_SDCM_ERD);
245 out_le32(mv64x60_base + MPSC_CHR_2 + mpsc_base[chan], MPSC_CHR_2_EH);
246
247 udelay(100);
248
249 return chan;
250}
251
252static void
253stop_dma(int chan)
254{
255 int i;
256
257 /* Abort MPSC Rx (aborting Tx messes things up) */
258 out_le32(mv64x60_base + MPSC_CHR_2 + mpsc_base[chan], MPSC_CHR_2_RA);
259
260 /* Abort SDMA Rx, Tx */
261 out_le32(mv64x60_base + sdma_regs[chan].sdcm,
262 SDMA_SDCM_AR | SDMA_SDCM_STD);
263
264 for (i=0; i<MAX_RESET_WAIT; i++) {
265 if ((in_le32(mv64x60_base + sdma_regs[chan].sdcm) &
266 (SDMA_SDCM_AR | SDMA_SDCM_AT)) == 0)
267 break;
268
269 udelay(100);
270 }
271}
272
273static int
274wait_for_ownership(int chan)
275{
276 int i;
277
278 for (i=0; i<MAX_TX_WAIT; i++) {
279 if ((in_le32(mv64x60_base + sdma_regs[chan].sdcm) &
280 SDMA_SDCM_TXD) == 0)
281 break;
282
283 udelay(1000);
284 }
285
286 return (i < MAX_TX_WAIT);
287}
288
289void
290serial_putc(unsigned long com_port, unsigned char c)
291{
292 struct mv64x60_tx_desc *tdp;
293
294 if (wait_for_ownership(com_port) == 0)
295 return;
296
297 tdp = &td[com_port][cur_td[com_port]];
298 if (++cur_td[com_port] >= TX_NUM_DESC)
299 cur_td[com_port] = 0;
300
301 *(unchar *)(tdp->buffer ^ 7) = c;
302 tdp->bytecnt = 1;
303 tdp->shadow = 1;
304 tdp->cmd_stat = SDMA_DESC_CMDSTAT_L | SDMA_DESC_CMDSTAT_F |
305 SDMA_DESC_CMDSTAT_O;
306
307 out_le32(mv64x60_base + sdma_regs[com_port].sctdp, (int)tdp);
308 out_le32(mv64x60_base + sdma_regs[com_port].sftdp, (int)tdp);
309 out_le32(mv64x60_base + sdma_regs[com_port].sdcm,
310 in_le32(mv64x60_base + sdma_regs[com_port].sdcm) |
311 SDMA_SDCM_TXD);
312}
313
314unsigned char
315serial_getc(unsigned long com_port)
316{
317 struct mv64x60_rx_desc *rdp;
318 unchar c = '\0';
319
320 rdp = &rd[com_port][cur_rd[com_port]];
321
322 if ((rdp->cmd_stat & (SDMA_DESC_CMDSTAT_O|SDMA_DESC_CMDSTAT_ES)) == 0) {
323 c = *(unchar *)(rdp->buffer ^ 7);
324 RX_INIT_RDP(rdp);
325 if (++cur_rd[com_port] >= RX_NUM_DESC)
326 cur_rd[com_port] = 0;
327 }
328
329 return c;
330}
331
332int
333serial_tstc(unsigned long com_port)
334{
335 struct mv64x60_rx_desc *rdp;
336 int loop_count = 0;
337 int rc = 0;
338
339 rdp = &rd[com_port][cur_rd[com_port]];
340
341 /* Go through rcv descs until empty looking for one with data (no error)*/
342 while (((rdp->cmd_stat & SDMA_DESC_CMDSTAT_O) == 0) &&
343 (loop_count++ < RX_NUM_DESC)) {
344
345 /* If there was an error, reinit the desc & continue */
346 if ((rdp->cmd_stat & SDMA_DESC_CMDSTAT_ES) != 0) {
347 RX_INIT_RDP(rdp);
348 if (++cur_rd[com_port] >= RX_NUM_DESC)
349 cur_rd[com_port] = 0;
350 rdp = (struct mv64x60_rx_desc *)rdp->next_desc_ptr;
351 } else {
352 rc = 1;
353 break;
354 }
355 }
356
357 return rc;
358}
359
360void
361serial_close(unsigned long com_port)
362{
363 stop_dma(com_port);
364}
diff --git a/arch/ppc/boot/simple/openbios.c b/arch/ppc/boot/simple/openbios.c
deleted file mode 100644
index 6ff2701598f2..000000000000
--- a/arch/ppc/boot/simple/openbios.c
+++ /dev/null
@@ -1,128 +0,0 @@
1/*
2 * Copyright (c) 2005 DENX Software Engineering
3 * Stefan Roese <sr@denx.de>
4 *
5 * Based on original work by
6 * 2005 (c) SYSGO AG - g.jaeger@sysgo.com
7 *
8 * This file is licensed under the terms of the GNU General Public
9 * License version 2. This program is licensed "as is" without
10 * any warranty of any kind, whether express or implied.
11 *
12 */
13
14#include <linux/types.h>
15#include <linux/string.h>
16#include <asm/ppcboot.h>
17#include <asm/ibm4xx.h>
18#include <asm/reg.h>
19#ifdef CONFIG_40x
20#include <asm/io.h>
21#endif
22
23#if defined(CONFIG_BUBINGA)
24#define BOARD_INFO_VECTOR 0xFFF80B50 /* openbios 1.19 moved this vector down - armin */
25#else
26#define BOARD_INFO_VECTOR 0xFFFE0B50
27#endif
28
29#ifdef CONFIG_40x
30/* Supply a default Ethernet address for those eval boards that don't
31 * ship with one. This is an address from the MBX board I have, so
32 * it is unlikely you will find it on your network.
33 */
34static ushort def_enet_addr[] = { 0x0800, 0x3e26, 0x1559 };
35
36extern unsigned long timebase_period_ns;
37#endif /* CONFIG_40x */
38
39extern unsigned long decompress_kernel(unsigned long load_addr, int num_words,
40 unsigned long cksum);
41
42/* We need to make sure that this is before the images to ensure
43 * that it's in a mapped location. */
44bd_t hold_resid_buf __attribute__ ((__section__ (".data.boot")));
45bd_t *hold_residual = &hold_resid_buf;
46
47typedef struct openbios_board_info {
48 unsigned char bi_s_version[4]; /* Version of this structure */
49 unsigned char bi_r_version[30]; /* Version of the IBM ROM */
50 unsigned int bi_memsize; /* DRAM installed, in bytes */
51#ifdef CONFIG_405EP
52 unsigned char bi_enetaddr[2][6]; /* Local Ethernet MAC address */
53#else /* CONFIG_405EP */
54 unsigned char bi_enetaddr[6]; /* Local Ethernet MAC address */
55#endif /* CONFIG_405EP */
56 unsigned char bi_pci_enetaddr[6]; /* PCI Ethernet MAC address */
57 unsigned int bi_intfreq; /* Processor speed, in Hz */
58 unsigned int bi_busfreq; /* PLB Bus speed, in Hz */
59 unsigned int bi_pci_busfreq; /* PCI Bus speed, in Hz */
60#ifdef CONFIG_405EP
61 unsigned int bi_opb_busfreq; /* OPB Bus speed, in Hz */
62 unsigned int bi_pllouta_freq; /* PLL OUTA speed, in Hz */
63#endif /* CONFIG_405EP */
64} openbios_bd_t;
65
66void *
67load_kernel(unsigned long load_addr, int num_words, unsigned long cksum,
68 void *ign1, void *ign2)
69{
70#ifdef CONFIG_40x
71 openbios_bd_t *openbios_bd = NULL;
72 openbios_bd_t *(*get_board_info)(void) =
73 (openbios_bd_t *(*)(void))(*(unsigned long *)BOARD_INFO_VECTOR);
74
75 /*
76 * On 40x platforms we not only need the MAC-addresses, but also the
77 * clocks and memsize. Now try to get all values using the OpenBIOS
78 * "get_board_info()" callback.
79 */
80 if ((openbios_bd = get_board_info()) != NULL) {
81 /*
82 * Copy bd_info from OpenBIOS struct into U-Boot struct
83 * used by kernel
84 */
85 hold_residual->bi_memsize = openbios_bd->bi_memsize;
86 hold_residual->bi_intfreq = openbios_bd->bi_intfreq;
87 hold_residual->bi_busfreq = openbios_bd->bi_busfreq;
88 hold_residual->bi_pci_busfreq = openbios_bd->bi_pci_busfreq;
89 memcpy(hold_residual->bi_pci_enetaddr, openbios_bd->bi_pci_enetaddr, 6);
90#ifdef CONFIG_405EP
91 memcpy(hold_residual->bi_enetaddr, openbios_bd->bi_enetaddr[0], 6);
92 memcpy(hold_residual->bi_enet1addr, openbios_bd->bi_enetaddr[1], 6);
93 hold_residual->bi_opbfreq = openbios_bd->bi_opb_busfreq;
94 hold_residual->bi_procfreq = openbios_bd->bi_pllouta_freq;
95#else /* CONFIG_405EP */
96 memcpy(hold_residual->bi_enetaddr, openbios_bd->bi_enetaddr, 6);
97#endif /* CONFIG_405EP */
98 } else {
99 /* Hmmm...better try to stuff some defaults.
100 */
101 hold_residual->bi_memsize = 16 * 1024 * 1024;
102 hold_residual->bi_intfreq = 200000000;
103 hold_residual->bi_busfreq = 100000000;
104 hold_residual->bi_pci_busfreq = 66666666;
105
106 /*
107 * Only supply one mac-address in this fallback
108 */
109 memcpy(hold_residual->bi_enetaddr, (void *)def_enet_addr, 6);
110#ifdef CONFIG_405EP
111 hold_residual->bi_opbfreq = 50000000;
112 hold_residual->bi_procfreq = 200000000;
113#endif /* CONFIG_405EP */
114 }
115
116 timebase_period_ns = 1000000000 / hold_residual->bi_intfreq;
117#endif /* CONFIG_40x */
118
119#ifdef CONFIG_440GP
120 /* simply copy the MAC addresses */
121 memcpy(hold_residual->bi_enetaddr, (char *)OPENBIOS_MAC_BASE, 6);
122 memcpy(hold_residual->bi_enet1addr, (char *)(OPENBIOS_MAC_BASE+OPENBIOS_MAC_OFFSET), 6);
123#endif /* CONFIG_440GP */
124
125 decompress_kernel(load_addr, num_words, cksum);
126
127 return (void *)hold_residual;
128}
diff --git a/arch/ppc/boot/simple/pci.c b/arch/ppc/boot/simple/pci.c
deleted file mode 100644
index b0f673c8b7d9..000000000000
--- a/arch/ppc/boot/simple/pci.c
+++ /dev/null
@@ -1,274 +0,0 @@
1/* Stand alone funtions for QSpan Tundra support.
2 */
3#include <linux/types.h>
4#include <linux/pci.h>
5#include <asm/mpc8xx.h>
6
7extern void puthex(unsigned long val);
8extern void puts(const char *);
9
10/* To map PCI devices, you first write 0xffffffff into the device
11 * base address registers. When the register is read back, the
12 * number of most significant '1' bits describes the amount of address
13 * space needed for mapping. If the most significant bit is not set,
14 * either the device does not use that address register, or it has
15 * a fixed address that we can't change. After the address is assigned,
16 * the command register has to be written to enable the card.
17 */
18typedef struct {
19 u_char pci_bus;
20 u_char pci_devfn;
21 ushort pci_command;
22 uint pci_addrs[6];
23} pci_map_t;
24
25/* We should probably dynamically allocate these structures.
26*/
27#define MAX_PCI_DEVS 32
28int pci_dev_cnt;
29pci_map_t pci_map[MAX_PCI_DEVS];
30
31void pci_conf_write(int bus, int device, int func, int reg, uint writeval);
32void pci_conf_read(int bus, int device, int func, int reg, void *readval);
33void probe_addresses(int bus, int devfn);
34void map_pci_addrs(void);
35
36extern int
37qs_pci_read_config_byte(unsigned char bus, unsigned char dev_fn,
38 unsigned char offset, unsigned char *val);
39extern int
40qs_pci_read_config_word(unsigned char bus, unsigned char dev_fn,
41 unsigned char offset, unsigned short *val);
42extern int
43qs_pci_read_config_dword(unsigned char bus, unsigned char dev_fn,
44 unsigned char offset, unsigned int *val);
45extern int
46qs_pci_write_config_byte(unsigned char bus, unsigned char dev_fn,
47 unsigned char offset, unsigned char val);
48extern int
49qs_pci_write_config_word(unsigned char bus, unsigned char dev_fn,
50 unsigned char offset, unsigned short val);
51extern int
52qs_pci_write_config_dword(unsigned char bus, unsigned char dev_fn,
53 unsigned char offset, unsigned int val);
54
55
56/* This is a really stripped version of PCI bus scan. All we are
57 * looking for are devices that exist.
58 */
59void
60pci_scanner(int addr_probe)
61{
62 unsigned int devfn, l, class, bus_number;
63 unsigned char hdr_type, is_multi;
64
65 is_multi = 0;
66 bus_number = 0;
67 for (devfn = 0; devfn < 0xff; ++devfn) {
68 /* The device numbers are comprised of upper 5 bits of
69 * device number and lower 3 bits of multi-function number.
70 */
71 if ((devfn & 7) && !is_multi) {
72 /* Don't scan multifunction addresses if this is
73 * not a multifunction device.
74 */
75 continue;
76 }
77
78 /* Read the header to determine card type.
79 */
80 qs_pci_read_config_byte(bus_number, devfn, PCI_HEADER_TYPE,
81 &hdr_type);
82
83 /* If this is a base device number, check the header to
84 * determine if it is mulifunction.
85 */
86 if ((devfn & 7) == 0)
87 is_multi = hdr_type & 0x80;
88
89 /* Check to see if the board is really in the slot.
90 */
91 qs_pci_read_config_dword(bus_number, devfn, PCI_VENDOR_ID, &l);
92 /* some broken boards return 0 if a slot is empty: */
93 if (l == 0xffffffff || l == 0x00000000 || l == 0x0000ffff ||
94 l == 0xffff0000) {
95 /* Nothing there.
96 */
97 is_multi = 0;
98 continue;
99 }
100
101 /* If we are not performing an address probe,
102 * just simply print out some information.
103 */
104 if (!addr_probe) {
105 qs_pci_read_config_dword(bus_number, devfn,
106 PCI_CLASS_REVISION, &class);
107
108 class >>= 8; /* upper 3 bytes */
109
110#if 0
111 printf("Found (%3d:%d): vendor 0x%04x, device 0x%04x, class 0x%06x\n",
112 (devfn >> 3), (devfn & 7),
113 (l & 0xffff), (l >> 16) & 0xffff, class);
114#else
115 puts("Found ("); puthex(devfn >> 3);
116 puts(":"); puthex(devfn & 7);
117 puts("): vendor "); puthex(l & 0xffff);
118 puts(", device "); puthex((l >> 16) & 0xffff);
119 puts(", class "); puthex(class); puts("\n");
120#endif
121 }
122 else {
123 /* If this is a "normal" device, build address list.
124 */
125 if ((hdr_type & 0x7f) == PCI_HEADER_TYPE_NORMAL)
126 probe_addresses(bus_number, devfn);
127 }
128 }
129
130 /* Now map the boards.
131 */
132 if (addr_probe)
133 map_pci_addrs();
134}
135
136/* Probe addresses for the specified device. This is a destructive
137 * operation because it writes the registers.
138 */
139void
140probe_addresses(bus, devfn)
141{
142 int i;
143 uint pciaddr;
144 ushort pcicmd;
145 pci_map_t *pm;
146
147 if (pci_dev_cnt >= MAX_PCI_DEVS) {
148 puts("Too many PCI devices\n");
149 return;
150 }
151
152 pm = &pci_map[pci_dev_cnt++];
153
154 pm->pci_bus = bus;
155 pm->pci_devfn = devfn;
156
157 for (i=0; i<6; i++) {
158 qs_pci_write_config_dword(bus, devfn, PCI_BASE_ADDRESS_0 + (i * 4), -1);
159 qs_pci_read_config_dword(bus, devfn, PCI_BASE_ADDRESS_0 + (i * 4),
160 &pciaddr);
161 pm->pci_addrs[i] = pciaddr;
162 qs_pci_read_config_word(bus, devfn, PCI_COMMAND, &pcicmd);
163 pm->pci_command = pcicmd;
164 }
165}
166
167/* Map the cards into the PCI space. The PCI has separate memory
168 * and I/O spaces. In addition, some memory devices require mapping
169 * below 1M. The least significant 4 bits of the address register
170 * provide information. If this is an I/O device, only the LS bit
171 * is used to indicate that, so I/O devices can be mapped to a two byte
172 * boundard. Memory addresses can be mapped to a 32 byte boundary.
173 * The QSpan implementations usually have a 1Gbyte space for each
174 * memory and I/O spaces.
175 *
176 * This isn't a terribly fancy algorithm. I just map the spaces from
177 * the top starting with the largest address space. When finished,
178 * the registers are written and the card enabled.
179 *
180 * While the Tundra can map a large address space on most boards, we
181 * need to be careful because it may overlap other devices (like IMMR).
182 */
183#define MEMORY_SPACE_SIZE 0x20000000
184#define IO_SPACE_SIZE 0x20000000
185
186void
187map_pci_addrs()
188{
189 uint pci_mem_top, pci_mem_low;
190 uint pci_io_top;
191 uint addr_mask, reg_addr, space;
192 int i, j;
193 pci_map_t *pm;
194
195 pci_mem_top = MEMORY_SPACE_SIZE;
196 pci_io_top = IO_SPACE_SIZE;
197 pci_mem_low = (1 * 1024 * 1024); /* Below one meg addresses */
198
199 /* We can't map anything more than the maximum space, but test
200 * for it anyway to catch devices out of range.
201 */
202 addr_mask = 0x80000000;
203
204 do {
205 space = (~addr_mask) + 1; /* Size of the space */
206 for (i=0; i<pci_dev_cnt; i++) {
207 pm = &pci_map[i];
208 for (j=0; j<6; j++) {
209 /* If the MS bit is not set, this has either
210 * already been mapped, or is not used.
211 */
212 reg_addr = pm->pci_addrs[j];
213 if ((reg_addr & 0x80000000) == 0)
214 continue;
215 if (reg_addr & PCI_BASE_ADDRESS_SPACE_IO) {
216 if ((reg_addr & PCI_BASE_ADDRESS_IO_MASK) != addr_mask)
217 continue;
218 if (pci_io_top < space) {
219 puts("Out of PCI I/O space\n");
220 }
221 else {
222 pci_io_top -= space;
223 pm->pci_addrs[j] = pci_io_top;
224 pm->pci_command |= PCI_COMMAND_IO;
225 }
226 }
227 else {
228 if ((reg_addr & PCI_BASE_ADDRESS_MEM_MASK) != addr_mask)
229 continue;
230
231 /* Memory space. Test if below 1M.
232 */
233 if (reg_addr & PCI_BASE_ADDRESS_MEM_TYPE_1M) {
234 if (pci_mem_low < space) {
235 puts("Out of PCI 1M space\n");
236 }
237 else {
238 pci_mem_low -= space;
239 pm->pci_addrs[j] = pci_mem_low;
240 }
241 }
242 else {
243 if (pci_mem_top < space) {
244 puts("Out of PCI Mem space\n");
245 }
246 else {
247 pci_mem_top -= space;
248 pm->pci_addrs[j] = pci_mem_top;
249 }
250 }
251 pm->pci_command |= PCI_COMMAND_MEMORY;
252 }
253 }
254 }
255 addr_mask >>= 1;
256 addr_mask |= 0x80000000;
257 } while (addr_mask != 0xfffffffe);
258
259 /* Now, run the list one more time and map everything.
260 */
261 for (i=0; i<pci_dev_cnt; i++) {
262 pm = &pci_map[i];
263 for (j=0; j<6; j++) {
264 qs_pci_write_config_dword(pm->pci_bus, pm->pci_devfn,
265 PCI_BASE_ADDRESS_0 + (j * 4), pm->pci_addrs[j]);
266 }
267
268 /* Enable memory or address mapping.
269 */
270 qs_pci_write_config_word(pm->pci_bus, pm->pci_devfn, PCI_COMMAND,
271 pm->pci_command);
272 }
273}
274
diff --git a/arch/ppc/boot/simple/pibs.c b/arch/ppc/boot/simple/pibs.c
deleted file mode 100644
index f39d01e0619d..000000000000
--- a/arch/ppc/boot/simple/pibs.c
+++ /dev/null
@@ -1,104 +0,0 @@
1/*
2 * 2004-2005 (c) MontaVista, Software, Inc. This file is licensed under
3 * the terms of the GNU General Public License version 2. This program
4 * is licensed "as is" without any warranty of any kind, whether express
5 * or implied.
6 */
7
8#include <linux/types.h>
9#include <linux/string.h>
10#include <linux/ctype.h>
11#include <asm/ppcboot.h>
12#include <asm/ibm4xx.h>
13
14extern unsigned long decompress_kernel(unsigned long load_addr, int num_words,
15 unsigned long cksum);
16
17/* We need to make sure that this is before the images to ensure
18 * that it's in a mapped location. - Tom */
19bd_t hold_resid_buf __attribute__ ((__section__ (".data.boot")));
20bd_t *hold_residual = &hold_resid_buf;
21
22/* String functions lifted from lib/vsprintf.c and lib/ctype.c */
23unsigned char _ctype[] = {
24_C,_C,_C,_C,_C,_C,_C,_C, /* 0-7 */
25_C,_C|_S,_C|_S,_C|_S,_C|_S,_C|_S,_C,_C, /* 8-15 */
26_C,_C,_C,_C,_C,_C,_C,_C, /* 16-23 */
27_C,_C,_C,_C,_C,_C,_C,_C, /* 24-31 */
28_S|_SP,_P,_P,_P,_P,_P,_P,_P, /* 32-39 */
29_P,_P,_P,_P,_P,_P,_P,_P, /* 40-47 */
30_D,_D,_D,_D,_D,_D,_D,_D, /* 48-55 */
31_D,_D,_P,_P,_P,_P,_P,_P, /* 56-63 */
32_P,_U|_X,_U|_X,_U|_X,_U|_X,_U|_X,_U|_X,_U, /* 64-71 */
33_U,_U,_U,_U,_U,_U,_U,_U, /* 72-79 */
34_U,_U,_U,_U,_U,_U,_U,_U, /* 80-87 */
35_U,_U,_U,_P,_P,_P,_P,_P, /* 88-95 */
36_P,_L|_X,_L|_X,_L|_X,_L|_X,_L|_X,_L|_X,_L, /* 96-103 */
37_L,_L,_L,_L,_L,_L,_L,_L, /* 104-111 */
38_L,_L,_L,_L,_L,_L,_L,_L, /* 112-119 */
39_L,_L,_L,_P,_P,_P,_P,_C, /* 120-127 */
400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 128-143 */
410,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 144-159 */
42_S|_SP,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P, /* 160-175 */
43_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P, /* 176-191 */
44_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U, /* 192-207 */
45_U,_U,_U,_U,_U,_U,_U,_P,_U,_U,_U,_U,_U,_U,_U,_L, /* 208-223 */
46_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L, /* 224-239 */
47_L,_L,_L,_L,_L,_L,_L,_P,_L,_L,_L,_L,_L,_L,_L,_L}; /* 240-255 */
48
49/**
50 * simple_strtoull - convert a string to an unsigned long long
51 * @cp: The start of the string
52 * @endp: A pointer to the end of the parsed string will be placed here
53 * @base: The number base to use
54 */
55unsigned long long simple_strtoull(const char *cp,char **endp,unsigned int base)
56{
57 unsigned long long result = 0,value;
58
59 if (!base) {
60 base = 10;
61 if (*cp == '0') {
62 base = 8;
63 cp++;
64 if ((toupper(*cp) == 'X') && isxdigit(cp[1])) {
65 cp++;
66 base = 16;
67 }
68 }
69 } else if (base == 16) {
70 if (cp[0] == '0' && toupper(cp[1]) == 'X')
71 cp += 2;
72 }
73 while (isxdigit(*cp) && (value = isdigit(*cp) ? *cp-'0' : (islower(*cp)
74 ? toupper(*cp) : *cp)-'A'+10) < base) {
75 result = result*base + value;
76 cp++;
77 }
78 if (endp)
79 *endp = (char *)cp;
80 return result;
81}
82
83void *
84load_kernel(unsigned long load_addr, int num_words, unsigned long cksum,
85 void *ign1, void *ign2)
86{
87 unsigned long long mac64;
88
89 decompress_kernel(load_addr, num_words, cksum);
90
91 mac64 = simple_strtoull((char *)PIBS_MAC_BASE, 0, 16);
92 memcpy(hold_residual->bi_enetaddr, (char *)&mac64+2, 6);
93#if defined(CONFIG_440GX) || defined(CONFIG_440EP)
94 mac64 = simple_strtoull((char *)(PIBS_MAC_BASE+PIBS_MAC_OFFSET), 0, 16);
95 memcpy(hold_residual->bi_enet1addr, (char *)&mac64+2, 6);
96#endif
97#ifdef CONFIG_440GX
98 mac64 = simple_strtoull((char *)(PIBS_MAC_BASE+PIBS_MAC_OFFSET*2), 0, 16);
99 memcpy(hold_residual->bi_enet2addr, (char *)&mac64+2, 6);
100 mac64 = simple_strtoull((char *)(PIBS_MAC_BASE+PIBS_MAC_OFFSET*3), 0, 16);
101 memcpy(hold_residual->bi_enet3addr, (char *)&mac64+2, 6);
102#endif
103 return (void *)hold_residual;
104}
diff --git a/arch/ppc/boot/simple/prepmap.c b/arch/ppc/boot/simple/prepmap.c
deleted file mode 100644
index c871a4db6e8c..000000000000
--- a/arch/ppc/boot/simple/prepmap.c
+++ /dev/null
@@ -1,12 +0,0 @@
1/*
2 * 2004 (C) IBM. This file is licensed under the terms of the GNU General
3 * Public License version 2. This program is licensed "as is" without any
4 * warranty of any kind, whether express or implied.
5 */
6
7#include <nonstdio.h>
8
9void board_isa_init(void)
10{
11 ISA_init(0x80000000);
12}
diff --git a/arch/ppc/boot/simple/qspan_pci.c b/arch/ppc/boot/simple/qspan_pci.c
deleted file mode 100644
index d2966d032a4c..000000000000
--- a/arch/ppc/boot/simple/qspan_pci.c
+++ /dev/null
@@ -1,269 +0,0 @@
1/*
2 * LinuxPPC arch/ppc/kernel/qspan_pci.c Dan Malek (dmalek@jlc.net)
3 *
4 * QSpan Motorola bus to PCI bridge. The config address register
5 * is located 0x500 from the base of the bridge control/status registers.
6 * The data register is located at 0x504.
7 * This is a two step operation. First, the address register is written,
8 * then the data register is read/written as required.
9 * I don't know what to do about interrupts (yet).
10 */
11
12#include <linux/types.h>
13#include <linux/kernel.h>
14#include <linux/pci.h>
15#include <asm/mpc8xx.h>
16
17/*
18 * When reading the configuration space, if something does not respond
19 * the bus times out and we get a machine check interrupt. So, the
20 * good ol' exception tables come to mind to trap it and return some
21 * value.
22 *
23 * On an error we just return a -1, since that is what the caller wants
24 * returned if nothing is present. I copied this from __get_user_asm,
25 * with the only difference of returning -1 instead of EFAULT.
26 * There is an associated hack in the machine check trap code.
27 *
28 * The QSPAN is also a big endian device, that is it makes the PCI
29 * look big endian to us. This presents a problem for the Linux PCI
30 * functions, which assume little endian. For example, we see the
31 * first 32-bit word like this:
32 * ------------------------
33 * | Device ID | Vendor ID |
34 * ------------------------
35 * If we read/write as a double word, that's OK. But in our world,
36 * when read as a word, device ID is at location 0, not location 2 as
37 * the little endian PCI would believe. We have to switch bits in
38 * the PCI addresses given to us to get the data to/from the correct
39 * byte lanes.
40 *
41 * The QSPAN only supports 4 bits of "slot" in the dev_fn instead of 5.
42 * It always forces the MS bit to zero. Therefore, dev_fn values
43 * greater than 128 are returned as "no device found" errors.
44 *
45 * The QSPAN can only perform long word (32-bit) configuration cycles.
46 * The "offset" must have the two LS bits set to zero. Read operations
47 * require we read the entire word and then sort out what should be
48 * returned. Write operations other than long word require that we
49 * read the long word, update the proper word or byte, then write the
50 * entire long word back.
51 *
52 * PCI Bridge hack. We assume (correctly) that bus 0 is the primary
53 * PCI bus from the QSPAN. If we are called with a bus number other
54 * than zero, we create a Type 1 configuration access that a downstream
55 * PCI bridge will interpret.
56 */
57
58#define __get_pci_config(x, addr, op) \
59 __asm__ __volatile__( \
60 "1: "op" %0,0(%1)\n" \
61 " eieio\n" \
62 "2:\n" \
63 ".section .fixup,\"ax\"\n" \
64 "3: li %0,-1\n" \
65 " b 2b\n" \
66 ".section __ex_table,\"a\"\n" \
67 " .align 2\n" \
68 " .long 1b,3b\n" \
69 ".text" \
70 : "=r"(x) : "r"(addr))
71
72#define QS_CONFIG_ADDR ((volatile uint *)(PCI_CSR_ADDR + 0x500))
73#define QS_CONFIG_DATA ((volatile uint *)(PCI_CSR_ADDR + 0x504))
74
75#define mk_config_addr(bus, dev, offset) \
76 (((bus)<<16) | ((dev)<<8) | (offset & 0xfc))
77
78#define mk_config_type1(bus, dev, offset) \
79 mk_config_addr(bus, dev, offset) | 1;
80
81/* Initialize the QSpan device registers after power up.
82*/
83void
84qspan_init(void)
85{
86 uint *qptr;
87
88
89
90 qptr = (uint *)PCI_CSR_ADDR;
91
92 /* PCI Configuration/status. Upper bits written to clear
93 * pending interrupt or status. Lower bits enable QSPAN as
94 * PCI master, enable memory and I/O cycles, and enable PCI
95 * parity error checking.
96 * IMPORTANT: The last two bits of this word enable PCI
97 * master cycles into the QBus. The QSpan is broken and can't
98 * meet the timing specs of the PQ bus for this to work. Therefore,
99 * if you don't have external bus arbitration, you can't use
100 * this function.
101 */
102#ifdef EXTERNAL_PQ_ARB
103 qptr[1] = 0xf9000147;
104#else
105 qptr[1] = 0xf9000144;
106#endif
107
108 /* PCI Misc configuration. Set PCI latency timer resolution
109 * of 8 cycles, set cache size to 4 x 32.
110 */
111 qptr[3] = 0;
112
113 /* Set up PCI Target address mapping. Enable, Posted writes,
114 * 2Gbyte space (processor memory controller determines actual size).
115 */
116 qptr[64] = 0x8f000080;
117
118 /* Map processor 0x80000000 to PCI 0x00000000.
119 * Processor address bit 1 determines I/O type access (0x80000000)
120 * or memory type access (0xc0000000).
121 */
122 qptr[65] = 0x80000000;
123
124 /* Enable error logging and clear any pending error status.
125 */
126 qptr[80] = 0x90000000;
127
128 qptr[512] = 0x000c0003;
129
130 /* Set up Qbus slave image.
131 */
132 qptr[960] = 0x01000000;
133 qptr[961] = 0x000000d1;
134 qptr[964] = 0x00000000;
135 qptr[965] = 0x000000d1;
136
137}
138
139/* Functions to support PCI bios-like features to read/write configuration
140 * space. If the function fails for any reason, a -1 (0xffffffff) value
141 * must be returned.
142 */
143#define DEVICE_NOT_FOUND (-1)
144#define SUCCESSFUL 0
145
146int qs_pci_read_config_byte(unsigned char bus, unsigned char dev_fn,
147 unsigned char offset, unsigned char *val)
148{
149 uint temp;
150 u_char *cp;
151
152 if ((bus > 7) || (dev_fn > 127)) {
153 *val = 0xff;
154 return DEVICE_NOT_FOUND;
155 }
156
157 if (bus == 0)
158 *QS_CONFIG_ADDR = mk_config_addr(bus, dev_fn, offset);
159 else
160 *QS_CONFIG_ADDR = mk_config_type1(bus, dev_fn, offset);
161 __get_pci_config(temp, QS_CONFIG_DATA, "lwz");
162
163 offset ^= 0x03;
164 cp = ((u_char *)&temp) + (offset & 0x03);
165 *val = *cp;
166 return SUCCESSFUL;
167}
168
169int qs_pci_read_config_word(unsigned char bus, unsigned char dev_fn,
170 unsigned char offset, unsigned short *val)
171{
172 uint temp;
173 ushort *sp;
174
175 if ((bus > 7) || (dev_fn > 127)) {
176 *val = 0xffff;
177 return DEVICE_NOT_FOUND;
178 }
179
180 if (bus == 0)
181 *QS_CONFIG_ADDR = mk_config_addr(bus, dev_fn, offset);
182 else
183 *QS_CONFIG_ADDR = mk_config_type1(bus, dev_fn, offset);
184 __get_pci_config(temp, QS_CONFIG_DATA, "lwz");
185 offset ^= 0x02;
186
187 sp = ((ushort *)&temp) + ((offset >> 1) & 1);
188 *val = *sp;
189 return SUCCESSFUL;
190}
191
192int qs_pci_read_config_dword(unsigned char bus, unsigned char dev_fn,
193 unsigned char offset, unsigned int *val)
194{
195 if ((bus > 7) || (dev_fn > 127)) {
196 *val = 0xffffffff;
197 return DEVICE_NOT_FOUND;
198 }
199 if (bus == 0)
200 *QS_CONFIG_ADDR = mk_config_addr(bus, dev_fn, offset);
201 else
202 *QS_CONFIG_ADDR = mk_config_type1(bus, dev_fn, offset);
203 __get_pci_config(*val, QS_CONFIG_DATA, "lwz");
204 return SUCCESSFUL;
205}
206
207int qs_pci_write_config_byte(unsigned char bus, unsigned char dev_fn,
208 unsigned char offset, unsigned char val)
209{
210 uint temp;
211 u_char *cp;
212
213 if ((bus > 7) || (dev_fn > 127))
214 return DEVICE_NOT_FOUND;
215
216 qs_pci_read_config_dword(bus, dev_fn, offset, &temp);
217
218 offset ^= 0x03;
219 cp = ((u_char *)&temp) + (offset & 0x03);
220 *cp = val;
221
222 if (bus == 0)
223 *QS_CONFIG_ADDR = mk_config_addr(bus, dev_fn, offset);
224 else
225 *QS_CONFIG_ADDR = mk_config_type1(bus, dev_fn, offset);
226 *QS_CONFIG_DATA = temp;
227
228 return SUCCESSFUL;
229}
230
231int qs_pci_write_config_word(unsigned char bus, unsigned char dev_fn,
232 unsigned char offset, unsigned short val)
233{
234 uint temp;
235 ushort *sp;
236
237 if ((bus > 7) || (dev_fn > 127))
238 return DEVICE_NOT_FOUND;
239
240 qs_pci_read_config_dword(bus, dev_fn, offset, &temp);
241
242 offset ^= 0x02;
243 sp = ((ushort *)&temp) + ((offset >> 1) & 1);
244 *sp = val;
245
246 if (bus == 0)
247 *QS_CONFIG_ADDR = mk_config_addr(bus, dev_fn, offset);
248 else
249 *QS_CONFIG_ADDR = mk_config_type1(bus, dev_fn, offset);
250 *QS_CONFIG_DATA = temp;
251
252 return SUCCESSFUL;
253}
254
255int qs_pci_write_config_dword(unsigned char bus, unsigned char dev_fn,
256 unsigned char offset, unsigned int val)
257{
258 if ((bus > 7) || (dev_fn > 127))
259 return DEVICE_NOT_FOUND;
260
261 if (bus == 0)
262 *QS_CONFIG_ADDR = mk_config_addr(bus, dev_fn, offset);
263 else
264 *QS_CONFIG_ADDR = mk_config_type1(bus, dev_fn, offset);
265 *(unsigned int *)QS_CONFIG_DATA = val;
266
267 return SUCCESSFUL;
268}
269
diff --git a/arch/ppc/boot/simple/relocate.S b/arch/ppc/boot/simple/relocate.S
deleted file mode 100644
index 1bbbcd2f2bcb..000000000000
--- a/arch/ppc/boot/simple/relocate.S
+++ /dev/null
@@ -1,213 +0,0 @@
1/*
2 * This is the common part of the loader relocation and initialization
3 * process. All of the board/processor specific initialization is
4 * done before we get here.
5 *
6 * Author: Tom Rini
7 * trini@mvista.com
8 * Derived from arch/ppc/boot/prep/head.S (Cort Dougan, many others).
9 *
10 * 2001-2004 (c) MontaVista, Software, Inc. This file is licensed under
11 * the terms of the GNU General Public License version 2. This program
12 * is licensed "as is" without any warranty of any kind, whether express
13 * or implied.
14 */
15
16#include <asm/cache.h>
17#include <asm/ppc_asm.h>
18
19#define GETSYM(reg, sym) \
20 lis reg, sym@h; ori reg, reg, sym@l
21
22 .text
23 /* We get called from the early initialization code.
24 * Register 3 has the address where we were loaded,
25 * Register 4 contains any residual data passed from the
26 * boot rom.
27 */
28 .globl relocate
29relocate:
30 /* Save r3, r4 for later.
31 * The r8/r11 are legacy registers so I don't have to
32 * rewrite the code below :-).
33 */
34 mr r8, r3
35 mr r11, r4
36
37 /* compute the size of the whole image in words. */
38 GETSYM(r4,start)
39 GETSYM(r5,end)
40
41 addi r5,r5,3 /* round up */
42 sub r5,r5,r4 /* end - start */
43 srwi r5,r5,2
44 mr r7,r5 /* Save for later use. */
45
46 /*
47 * Check if we need to relocate ourselves to the link addr or were
48 * we loaded there to begin with.
49 */
50 cmpw cr0,r3,r4
51 beq start_ldr /* If 0, we don't need to relocate */
52
53 /* Move this code somewhere safe. This is max(load + size, end)
54 * r8 == load address
55 */
56 GETSYM(r4, start)
57 GETSYM(r5, end)
58
59 sub r6,r5,r4
60 add r6,r8,r6 /* r6 == phys(load + size) */
61
62 cmpw r5,r6
63 bgt 1f
64 b 2f
651:
66 mr r6, r5
672:
68 /* dest is in r6 */
69 /* Ensure alignment --- this code is precautionary */
70 addi r6,r6,4
71 li r5,0x0003
72 andc r6,r6,r5
73
74 /* Find physical address and size of do_relocate */
75 GETSYM(r5, __relocate_start)
76 GETSYM(r4, __relocate_end)
77 GETSYM(r3, start)
78
79 /* Size to copy */
80 sub r4,r4,r5
81 srwi r4,r4,2
82
83 /* Src addr to copy (= __relocate_start - start + where_loaded) */
84 sub r3,r5,r3
85 add r5,r8,r3
86
87 /* Save dest */
88 mr r3, r6
89
90 /* Do the copy */
91 mtctr r4
923: lwz r4,0(r5)
93 stw r4,0(r3)
94 addi r3,r3,4
95 addi r5,r5,4
96 bdnz 3b
97
98 GETSYM(r4, __relocate_start)
99 GETSYM(r5, do_relocate)
100
101 sub r4,r5,r4 /* Get entry point for do_relocate in */
102 add r6,r6,r4 /* relocated section */
103
104 /* This will return to the relocated do_relocate */
105 mtlr r6
106 b flush_instruction_cache
107
108 .section ".relocate_code","xa"
109
110do_relocate:
111 /* We have 2 cases --- start < load, or start > load
112 * This determines whether we copy from the end, or the start.
113 * Its easier to have 2 loops than to have paramaterised
114 * loops. Sigh.
115 */
116 li r6,0 /* Clear checksum */
117 mtctr r7 /* Setup for a loop */
118
119 GETSYM(r4, start)
120 mr r3,r8 /* Get the load addr */
121
122 cmpw cr0,r4,r3 /* If we need to copy from the end, do so */
123 bgt do_relocate_from_end
124
125do_relocate_from_start:
1261: lwz r5,0(r3) /* Load and decrement */
127 stw r5,0(r4) /* Store and decrement */
128 addi r3,r3,4
129 addi r4,r4,4
130 xor r6,r6,r5 /* Update checksum */
131 bdnz 1b /* Are we done? */
132 b do_relocate_out /* Finished */
133
134do_relocate_from_end:
135 GETSYM(r3, end)
136 slwi r4,r7,2
137 add r4,r8,r4 /* Get the physical end */
1381: lwzu r5,-4(r4)
139 stwu r5, -4(r3)
140 xor r6,r6,r5
141 bdnz 1b
142
143do_relocate_out:
144 GETSYM(r3,start_ldr)
145 mtlr r3 /* Easiest way to do an absolute jump */
146/* Some boards don't boot up with the I-cache enabled. Do that
147 * now because the decompress runs much faster that way.
148 * As a side effect, we have to ensure the data cache is not enabled
149 * so we can access the serial I/O without trouble.
150 */
151 b flush_instruction_cache
152
153 .previous
154
155start_ldr:
156/* Clear all of BSS and set up stack for C calls */
157 lis r3,__bss_start@h
158 ori r3,r3,__bss_start@l
159 lis r4,end@h
160 ori r4,r4,end@l
161 subi r3,r3,4
162 subi r4,r4,4
163 li r0,0
16450: stwu r0,4(r3)
165 cmpw cr0,r3,r4
166 blt 50b
16790: mr r9,r1 /* Save old stack pointer (in case it matters) */
168 lis r1,.stack@h
169 ori r1,r1,.stack@l
170 addi r1,r1,4096*2
171 subi r1,r1,256
172 li r2,0x000F /* Mask pointer to 16-byte boundary */
173 andc r1,r1,r2
174
175 /*
176 * Exec kernel loader
177 */
178 mr r3,r8 /* Load point */
179 mr r4,r7 /* Program length */
180 mr r5,r6 /* Checksum */
181 mr r6,r11 /* Residual data */
182 mr r7,r25 /* Validated OFW interface */
183 bl load_kernel
184
185 /*
186 * Make sure the kernel knows we don't have things set in
187 * registers. -- Tom
188 */
189 li r4,0
190 li r5,0
191 li r6,0
192
193 /*
194 * Start at the begining.
195 */
196#ifdef CONFIG_PPC_PREP
197 li r9,0xc
198 mtlr r9
199 /* tell kernel we're prep, by putting 0xdeadc0de at KERNELLOAD,
200 * and tell the kernel to start on the 4th instruction since we
201 * overwrite the first 3 sometimes (which are 'nop').
202 */
203 lis r10,0xdeadc0de@h
204 ori r10,r10,0xdeadc0de@l
205 li r9,0
206 stw r10,0(r9)
207#else
208 li r9,0
209 mtlr r9
210#endif
211 blr
212
213 .comm .stack,4096*2,4
diff --git a/arch/ppc/boot/simple/rw4/ppc_40x.h b/arch/ppc/boot/simple/rw4/ppc_40x.h
deleted file mode 100644
index 561fb26f5a93..000000000000
--- a/arch/ppc/boot/simple/rw4/ppc_40x.h
+++ /dev/null
@@ -1,664 +0,0 @@
1/*----------------------------------------------------------------------------+
2| This source code has been made available to you by IBM on an AS-IS
3| basis. Anyone receiving this source is licensed under IBM
4| copyrights to use it in any way he or she deems fit, including
5| copying it, modifying it, compiling it, and redistributing it either
6| with or without modifications. No license under IBM patents or
7| patent applications is to be implied by the copyright license.
8|
9| Any user of this software should understand that IBM cannot provide
10| technical support for this software and will not be responsible for
11| any consequences resulting from the use of this software.
12|
13| Any person who transfers this source code or any derivative work
14| must include the IBM copyright notice, this paragraph, and the
15| preceding two paragraphs in the transferred software.
16|
17| COPYRIGHT I B M CORPORATION 1997
18| LICENSED MATERIAL - PROGRAM PROPERTY OF I B M
19+----------------------------------------------------------------------------*/
20/*----------------------------------------------------------------------------+
21| Author: Tony J. Cerreto
22| Component: Assembler include file.
23| File: ppc_40x.h
24| Purpose: Include file containing PPC DCR defines.
25|
26| Changes:
27| Date Author Comment
28| --------- ------ --------------------------------------------------------
29| 01-Mar-00 tjc Created
30+----------------------------------------------------------------------------*/
31/* added by linguohui*/
32#define MW
33/*----------------------------------------------------------------------------+
34| PPC Special purpose registers Numbers
35+----------------------------------------------------------------------------*/
36#define ccr0 0x3b3 /* core configuration reg */
37#define ctr 0x009 /* count register */
38#define ctrreg 0x009 /* count register */
39#define dbcr0 0x3f2 /* debug control register 0 */
40#define dbcr1 0x3bd /* debug control register 1 */
41#define dbsr 0x3f0 /* debug status register */
42#define dccr 0x3fa /* data cache control reg. */
43#define dcwr 0x3ba /* data cache write-thru reg */
44#define dear 0x3d5 /* data exception address reg */
45#define esr 0x3d4 /* exception syndrome register */
46#define evpr 0x3d6 /* exception vector prefix reg */
47#define iccr 0x3fb /* instruction cache cntrl re */
48#define icdbdr 0x3d3 /* instr cache dbug data reg */
49#define lrreg 0x008 /* link register */
50#define pid 0x3b1 /* process id reg */
51#define pit 0x3db /* programmable interval time */
52#define pvr 0x11f /* processor version register */
53#define sgr 0x3b9 /* storage guarded reg */
54#define sler 0x3bb /* storage little endian reg */
55#define sprg0 0x110 /* special general purpose 0 */
56#define sprg1 0x111 /* special general purpose 1 */
57#define sprg2 0x112 /* special general purpose 2 */
58#define sprg3 0x113 /* special general purpose 3 */
59#define sprg4 0x114 /* special general purpose 4 */
60#define sprg5 0x115 /* special general purpose 5 */
61#define sprg6 0x116 /* special general purpose 6 */
62#define sprg7 0x117 /* special general purpose 7 */
63#define srr0 0x01a /* save/restore register 0 */
64#define srr1 0x01b /* save/restore register 1 */
65#define srr2 0x3de /* save/restore register 2 */
66#define srr3 0x3df /* save/restore register 3 */
67#define tbhi 0x11D
68#define tblo 0x11C
69#define tcr 0x3da /* timer control register */
70#define tsr 0x3d8 /* timer status register */
71#define xerreg 0x001 /* fixed point exception */
72#define xer 0x001 /* fixed point exception */
73#define zpr 0x3b0 /* zone protection reg */
74
75/*----------------------------------------------------------------------------+
76| Decompression Controller
77+----------------------------------------------------------------------------*/
78#define kiar 0x014 /* Decompression cntl addr reg */
79#define kidr 0x015 /* Decompression cntl data reg */
80#define kitor0 0x00 /* index table origin Reg 0 */
81#define kitor1 0x01 /* index table origin Reg 1 */
82#define kitor2 0x02 /* index table origin Reg 2 */
83#define kitor3 0x03 /* index table origin Reg 3 */
84#define kaddr0 0x04 /* addr decode Definition Reg 0 */
85#define kaddr1 0x05 /* addr decode Definition Reg 1 */
86#define kconf 0x40 /* Decompression cntl config reg */
87#define kid 0x41 /* Decompression cntl id reg */
88#define kver 0x42 /* Decompression cntl ver number */
89#define kpear 0x50 /* bus error addr reg (PLB) */
90#define kbear 0x51 /* bus error addr reg (DCP-EBC) */
91#define kesr0 0x52 /* bus error status reg 0 */
92
93/*----------------------------------------------------------------------------+
94| Romeo Specific Device Control Register Numbers.
95+----------------------------------------------------------------------------*/
96#ifndef VESTA
97#define cdbcr 0x3d7 /* cache debug cntrl reg */
98
99#define a_latcnt 0x1a9 /* PLB Latency count */
100#define a_tgval 0x1ac /* tone generation value */
101#define a_plb_pr 0x1bf /* PLB priority */
102
103#define cic_sel1 0x031 /* select register 1 */
104#define cic_sel2 0x032 /* select register 2 */
105
106#define clkgcrst 0x122 /* chip reset register */
107
108#define cp_cpmsr 0x100 /*rstatus register */
109#define cp_cpmer 0x101 /* enable register */
110
111#define dcp_kiar 0x190 /* indirect address register */
112#define dcp_kidr 0x191 /* indirect data register */
113
114#define hsmc_mcgr 0x1c0 /* HSMC global register */
115#define hsmc_mcbesr 0x1c1 /* bus error status register */
116#define hsmc_mcbear 0x1c2 /* bus error address register*/
117#define hsmc_mcbr0 0x1c4 /* SDRAM sub-ctrl bank reg 0 */
118#define hsmc_mccr0 0x1c5 /* SDRAM sub-ctrl ctrl reg 0 */
119#define hsmc_mcbr1 0x1c7 /* SDRAM sub-ctrl bank reg 1 */
120#define hsmc_mccr1 0x1c8 /* SDRAM sub-ctrl ctrl reg 1 */
121#define hsmc_sysr 0x1d1 /* system register */
122#define hsmc_data 0x1d2 /* data register */
123#define hsmc_mccrr 0x1d3 /* refresh register */
124
125#define ocm_pbar 0x1E0 /* base address register */
126
127#define plb0_pacr0 0x057 /* PLB arbiter control reg */
128#define plb1_pacr1 0x067 /* PLB arbiter control reg */
129
130#define v_displb 0x157 /* set left border of display*/
131#define v_disptb 0x158 /* top border of display */
132#define v_osd_la 0x159 /* first link address for OSD*/
133#define v_ptsdlta 0x15E /* PTS delta register */
134#define v_v0base 0x16C /* base mem add for VBI-0 */
135#define v_v1base 0x16D /* base mem add for VBI-1 */
136#define v_osbase 0x16E /* base mem add for OSD data */
137#endif
138
139/*----------------------------------------------------------------------------+
140| Vesta Device Control Register Numbers.
141+----------------------------------------------------------------------------*/
142/*----------------------------------------------------------------------------+
143| Cross bar switch.
144+----------------------------------------------------------------------------*/
145#define cbs0_cr 0x010 /* CBS configuration register */
146
147/*----------------------------------------------------------------------------+
148| DCR external master (DCRX).
149+----------------------------------------------------------------------------*/
150#define dcrx0_icr 0x020 /* internal control register */
151#define dcrx0_isr 0x021 /* internal status register */
152#define dcrx0_ecr 0x022 /* external control register */
153#define dcrx0_esr 0x023 /* external status register */
154#define dcrx0_tar 0x024 /* target address register */
155#define dcrx0_tdr 0x025 /* target data register */
156#define dcrx0_igr 0x026 /* interrupt generation register */
157#define dcrx0_bcr 0x027 /* buffer control register */
158
159/*----------------------------------------------------------------------------+
160| Chip interconnect configuration.
161+----------------------------------------------------------------------------*/
162#define cic0_cr 0x030 /* CIC control register */
163#define cic0_vcr 0x033 /* video macro control reg */
164#define cic0_sel3 0x035 /* select register 3 */
165
166/*----------------------------------------------------------------------------+
167| Chip interconnect configuration.
168+----------------------------------------------------------------------------*/
169#define sgpo0_sgpO 0x036 /* simplified GPIO output */
170#define sgpo0_gpod 0x037 /* simplified GPIO open drain */
171#define sgpo0_gptc 0x038 /* simplified GPIO tristate cntl */
172#define sgpo0_gpi 0x039 /* simplified GPIO input */
173
174/*----------------------------------------------------------------------------+
175| Universal interrupt controller.
176+----------------------------------------------------------------------------*/
177#define uic0_sr 0x040 /* status register */
178#define uic0_srs 0x041 /* status register set */
179#define uic0_er 0x042 /* enable register */
180#define uic0_cr 0x043 /* critical register */
181#define uic0_pr 0x044 /* parity register */
182#define uic0_tr 0x045 /* triggering register */
183#define uic0_msr 0x046 /* masked status register */
184#define uic0_vr 0x047 /* vector register */
185#define uic0_vcr 0x048 /* enable config register */
186
187/*----------------------------------------------------------------------------+
188| PLB 0 and 1.
189+----------------------------------------------------------------------------*/
190#define pb0_pesr 0x054 /* PLB error status reg 0 */
191#define pb0_pesrs 0x055 /* PLB error status reg 0 set */
192#define pb0_pear 0x056 /* PLB error address reg */
193
194#define pb1_pesr 0x064 /* PLB error status reg 1 */
195#define pb1_pesrs 0x065 /* PLB error status reg 1 set */
196#define pb1_pear 0x066 /* PLB error address reg */
197
198/*----------------------------------------------------------------------------+
199| EBIU DCR registers.
200+----------------------------------------------------------------------------*/
201#define ebiu0_brcrh0 0x070 /* bus region register 0 high */
202#define ebiu0_brcrh1 0x071 /* bus region register 1 high */
203#define ebiu0_brcrh2 0x072 /* bus region register 2 high */
204#define ebiu0_brcrh3 0x073 /* bus region register 3 high */
205#define ebiu0_brcrh4 0x074 /* bus region register 4 high */
206#define ebiu0_brcrh5 0x075 /* bus region register 5 high */
207#define ebiu0_brcrh6 0x076 /* bus region register 6 high */
208#define ebiu0_brcrh7 0x077 /* bus region register 7 high */
209#define ebiu0_brcr0 0x080 /* bus region register 0 */
210#define ebiu0_brcr1 0x081 /* bus region register 1 */
211#define ebiu0_brcr2 0x082 /* bus region register 2 */
212#define ebiu0_brcr3 0x083 /* bus region register 3 */
213#define ebiu0_brcr4 0x084 /* bus region register 4 */
214#define ebiu0_brcr5 0x085 /* bus region register 5 */
215#define ebiu0_brcr6 0x086 /* bus region register 6 */
216#define ebiu0_brcr7 0x087 /* bus region register 7 */
217#define ebiu0_bear 0x090 /* bus error address register */
218#define ebiu0_besr 0x091 /* bus error syndrome reg */
219#define ebiu0_besr0s 0x093 /* bus error syndrome reg */
220#define ebiu0_biucr 0x09a /* bus interface control reg */
221
222/*----------------------------------------------------------------------------+
223| OPB bridge.
224+----------------------------------------------------------------------------*/
225#define opbw0_gesr 0x0b0 /* error status reg */
226#define opbw0_gesrs 0x0b1 /* error status reg */
227#define opbw0_gear 0x0b2 /* error address reg */
228
229/*----------------------------------------------------------------------------+
230| DMA.
231+----------------------------------------------------------------------------*/
232#define dma0_cr0 0x0c0 /* DMA channel control reg 0 */
233#define dma0_ct0 0x0c1 /* DMA count register 0 */
234#define dma0_da0 0x0c2 /* DMA destination addr reg 0 */
235#define dma0_sa0 0x0c3 /* DMA source addr register 0 */
236#define dma0_cc0 0x0c4 /* DMA chained count 0 */
237#define dma0_cr1 0x0c8 /* DMA channel control reg 1 */
238#define dma0_ct1 0x0c9 /* DMA count register 1 */
239#define dma0_da1 0x0ca /* DMA destination addr reg 1 */
240#define dma0_sa1 0x0cb /* DMA source addr register 1 */
241#define dma0_cc1 0x0cc /* DMA chained count 1 */
242#define dma0_cr2 0x0d0 /* DMA channel control reg 2 */
243#define dma0_ct2 0x0d1 /* DMA count register 2 */
244#define dma0_da2 0x0d2 /* DMA destination addr reg 2 */
245#define dma0_sa2 0x0d3 /* DMA source addr register 2 */
246#define dma0_cc2 0x0d4 /* DMA chained count 2 */
247#define dma0_cr3 0x0d8 /* DMA channel control reg 3 */
248#define dma0_ct3 0x0d9 /* DMA count register 3 */
249#define dma0_da3 0x0da /* DMA destination addr reg 3 */
250#define dma0_sa3 0x0db /* DMA source addr register 3 */
251#define dma0_cc3 0x0dc /* DMA chained count 3 */
252#define dma0_sr 0x0e0 /* DMA status register */
253#define dma0_srs 0x0e1 /* DMA status register */
254#define dma0_s1 0x031 /* DMA select1 register */
255#define dma0_s2 0x032 /* DMA select2 register */
256
257/*---------------------------------------------------------------------------+
258| Clock and power management.
259+----------------------------------------------------------------------------*/
260#define cpm0_fr 0x102 /* force register */
261
262/*----------------------------------------------------------------------------+
263| Serial Clock Control.
264+----------------------------------------------------------------------------*/
265#define ser0_ccr 0x120 /* serial clock control register */
266
267/*----------------------------------------------------------------------------+
268| Audio Clock Control.
269+----------------------------------------------------------------------------*/
270#define aud0_apcr 0x121 /* audio clock ctrl register */
271
272/*----------------------------------------------------------------------------+
273| DENC.
274+----------------------------------------------------------------------------*/
275#define denc0_idr 0x130 /* DENC ID register */
276#define denc0_cr1 0x131 /* control register 1 */
277#define denc0_rr1 0x132 /* microvision 1 (reserved 1) */
278#define denc0_cr2 0x133 /* control register 2 */
279#define denc0_rr2 0x134 /* microvision 2 (reserved 2) */
280#define denc0_rr3 0x135 /* microvision 3 (reserved 3) */
281#define denc0_rr4 0x136 /* microvision 4 (reserved 4) */
282#define denc0_rr5 0x137 /* microvision 5 (reserved 5) */
283#define denc0_ccdr 0x138 /* closed caption data */
284#define denc0_cccr 0x139 /* closed caption control */
285#define denc0_trr 0x13A /* teletext request register */
286#define denc0_tosr 0x13B /* teletext odd field line se */
287#define denc0_tesr 0x13C /* teletext even field line s */
288#define denc0_rlsr 0x13D /* RGB rhift left register */
289#define denc0_vlsr 0x13E /* video level shift register */
290#define denc0_vsr 0x13F /* video scaling register */
291
292/*----------------------------------------------------------------------------+
293| Video decoder. Suspect 0x179, 0x169, 0x16a, 0x152 (rc).
294+----------------------------------------------------------------------------*/
295#define vid0_ccntl 0x140 /* control decoder operation */
296#define vid0_cmode 0x141 /* video operational mode */
297#define vid0_sstc0 0x142 /* STC high order bits 31:0 */
298#define vid0_sstc1 0x143 /* STC low order bit 32 */
299#define vid0_spts0 0x144 /* PTS high order bits 31:0 */
300#define vid0_spts1 0x145 /* PTS low order bit 32 */
301#define vid0_fifo 0x146 /* FIFO data port */
302#define vid0_fifos 0x147 /* FIFO status */
303#define vid0_cmd 0x148 /* send command to decoder */
304#define vid0_cmdd 0x149 /* port for command params */
305#define vid0_cmdst 0x14A /* command status */
306#define vid0_cmdad 0x14B /* command address */
307#define vid0_procia 0x14C /* instruction store */
308#define vid0_procid 0x14D /* data port for I_Store */
309#define vid0_osdm 0x151 /* OSD mode control */
310#define vid0_hosti 0x152 /* base interrupt register */
311#define vid0_mask 0x153 /* interrupt mask register */
312#define vid0_dispm 0x154 /* operational mode for Disp */
313#define vid0_dispd 0x155 /* setting for 'Sync' delay */
314#define vid0_vbctl 0x156 /* VBI */
315#define vid0_ttxctl 0x157 /* teletext control */
316#define vid0_disptb 0x158 /* display left/top border */
317#define vid0_osdgla 0x159 /* Graphics plane link addr */
318#define vid0_osdila 0x15A /* Image plane link addr */
319#define vid0_rbthr 0x15B /* rate buffer threshold */
320#define vid0_osdcla 0x15C /* Cursor link addr */
321#define vid0_stcca 0x15D /* STC common address */
322#define vid0_ptsctl 0x15F /* PTS Control */
323#define vid0_wprot 0x165 /* write protect for I_Store */
324#define vid0_vcqa 0x167 /* video clip queued block Ad */
325#define vid0_vcql 0x168 /* video clip queued block Le */
326#define vid0_blksz 0x169 /* block size bytes for copy op */
327#define vid0_srcad 0x16a /* copy source address bits 6-31 */
328#define vid0_udbas 0x16B /* base mem add for user data */
329#define vid0_vbibas 0x16C /* base mem add for VBI 0/1 */
330#define vid0_osdibas 0x16D /* Image plane base address */
331#define vid0_osdgbas 0x16E /* Graphic plane base address */
332#define vid0_rbbase 0x16F /* base mem add for video buf */
333#define vid0_dramad 0x170 /* DRAM address */
334#define vid0_dramdt 0x171 /* data port for DRAM access */
335#define vid0_dramcs 0x172 /* DRAM command and statusa */
336#define vid0_vcwa 0x173 /* v clip work address */
337#define vid0_vcwl 0x174 /* v clip work length */
338#define vid0_mseg0 0x175 /* segment address 0 */
339#define vid0_mseg1 0x176 /* segment address 1 */
340#define vid0_mseg2 0x177 /* segment address 2 */
341#define vid0_mseg3 0x178 /* segment address 3 */
342#define vid0_fbbase 0x179 /* frame buffer base memory */
343#define vid0_osdcbas 0x17A /* Cursor base addr */
344#define vid0_lboxtb 0x17B /* top left border */
345#define vid0_trdly 0x17C /* transparency gate delay */
346#define vid0_sbord 0x17D /* left/top small pict. bord. */
347#define vid0_zoffs 0x17E /* hor/ver zoom window */
348#define vid0_rbsz 0x17F /* rate buffer size read */
349
350/*----------------------------------------------------------------------------+
351| Transport demultiplexer.
352+----------------------------------------------------------------------------*/
353#define xpt0_lr 0x180 /* demux location register */
354#define xpt0_data 0x181 /* demux data register */
355#define xpt0_ir 0x182 /* demux interrupt register */
356
357#define xpt0_config1 0x0000 /* configuration 1 */
358#define xpt0_control1 0x0001 /* control 1 */
359#define xpt0_festat 0x0002 /* Front-end status */
360#define xpt0_feimask 0x0003 /* Front_end interrupt Mask */
361#define xpt0_ocmcnfg 0x0004 /* OCM Address */
362#define xpt0_settapi 0x0005 /* Set TAP Interrupt */
363
364#define xpt0_pcrhi 0x0010 /* PCR High */
365#define xpt0_pcrlow 0x0011 /* PCR Low */
366#define xpt0_lstchi 0x0012 /* Latched STC High */
367#define xpt0_lstclow 0x0013 /* Latched STC Low */
368#define xpt0_stchi 0x0014 /* STC High */
369#define xpt0_stclow 0x0015 /* STC Low */
370#define xpt0_pwm 0x0016 /* PWM */
371#define xpt0_pcrstct 0x0017 /* PCR-STC Threshold */
372#define xpt0_pcrstcd 0x0018 /* PCR-STC Delta */
373#define xpt0_stccomp 0x0019 /* STC Compare */
374#define xpt0_stccmpd 0x001a /* STC Compare Disarm */
375
376#define xpt0_dsstat 0x0048 /* Descrambler Status */
377#define xpt0_dsimask 0x0049 /* Descrambler Interrupt Mask */
378
379#define xpt0_vcchng 0x01f0 /* Video Channel Change */
380#define xpt0_acchng 0x01f1 /* Audio Channel Change */
381#define xpt0_axenable 0x01fe /* Aux PID Enables */
382#define xpt0_pcrpid 0x01ff /* PCR PID */
383
384#define xpt0_config2 0x1000 /* Configuration 2 */
385#define xpt0_pbuflvl 0x1002 /* Packet Buffer Level */
386#define xpt0_intmask 0x1003 /* Interrupt Mask */
387#define xpt0_plbcnfg 0x1004 /* PLB Configuration */
388
389#define xpt0_qint 0x1010 /* Queues Interrupts */
390#define xpt0_qintmsk 0x1011 /* Queues Interrupts Mask */
391#define xpt0_astatus 0x1012 /* Audio Status */
392#define xpt0_aintmask 0x1013 /* Audio Interrupt Mask */
393#define xpt0_vstatus 0x1014 /* Video Status */
394#define xpt0_vintmask 0x1015 /* Video Interrupt Mask */
395
396#define xpt0_qbase 0x1020 /* Queue Base */
397#define xpt0_bucketq 0x1021 /* Bucket Queue */
398#define xpt0_qstops 0x1024 /* Queue Stops */
399#define xpt0_qresets 0x1025 /* Queue Resets */
400#define xpt0_sfchng 0x1026 /* Section Filter Change */
401
402/*----------------------------------------------------------------------------+
403| Audio decoder. Suspect 0x1ad, 0x1b4, 0x1a3, 0x1a5 (read/write status)
404+----------------------------------------------------------------------------*/
405#define aud0_ctrl0 0x1a0 /* control 0 */
406#define aud0_ctrl1 0x1a1 /* control 1 */
407#define aud0_ctrl2 0x1a2 /* control 2 */
408#define aud0_cmd 0x1a3 /* command register */
409#define aud0_isr 0x1a4 /* interrupt status register */
410#define aud0_imr 0x1a5 /* interrupt mask register */
411#define aud0_dsr 0x1a6 /* decoder status register */
412#define aud0_stc 0x1a7 /* system time clock */
413#define aud0_csr 0x1a8 /* channel status register */
414#define aud0_lcnt 0x1a9 /* queued address register 2 */
415#define aud0_pts 0x1aa /* presentation time stamp */
416#define aud0_tgctrl 0x1ab /* tone generation control */
417#define aud0_qlr2 0x1ac /* queued length register 2 */
418#define aud0_auxd 0x1ad /* aux data */
419#define aud0_strmid 0x1ae /* stream ID */
420#define aud0_qar 0x1af /* queued address register */
421#define aud0_dsps 0x1b0 /* DSP status */
422#define aud0_qlr 0x1b1 /* queued len address */
423#define aud0_dspc 0x1b2 /* DSP control */
424#define aud0_wlr2 0x1b3 /* working length register 2 */
425#define aud0_instd 0x1b4 /* instruction download */
426#define aud0_war 0x1b5 /* working address register */
427#define aud0_seg1 0x1b6 /* segment 1 base register */
428#define aud0_seg2 0x1b7 /* segment 2 base register */
429#define aud0_avf 0x1b9 /* audio att value front */
430#define aud0_avr 0x1ba /* audio att value rear */
431#define aud0_avc 0x1bb /* audio att value center */
432#define aud0_seg3 0x1bc /* segment 3 base register */
433#define aud0_offset 0x1bd /* offset address */
434#define aud0_wrl 0x1be /* working length register */
435#define aud0_war2 0x1bf /* working address register 2 */
436
437/*----------------------------------------------------------------------------+
438| High speed memory controller 0 and 1.
439+----------------------------------------------------------------------------*/
440#define hsmc0_gr 0x1e0 /* HSMC global register */
441#define hsmc0_besr 0x1e1 /* bus error status register */
442#define hsmc0_bear 0x1e2 /* bus error address register */
443#define hsmc0_br0 0x1e4 /* SDRAM sub-ctrl bank reg 0 */
444#define hsmc0_cr0 0x1e5 /* SDRAM sub-ctrl ctrl reg 0 */
445#define hsmc0_br1 0x1e7 /* SDRAM sub-ctrl bank reg 1 */
446#define hsmc0_cr1 0x1e8 /* SDRAM sub-ctrl ctrl reg 1 */
447#define hsmc0_sysr 0x1f1 /* system register */
448#define hsmc0_data 0x1f2 /* data register */
449#define hsmc0_crr 0x1f3 /* refresh register */
450
451#define hsmc1_gr 0x1c0 /* HSMC global register */
452#define hsmc1_besr 0x1c1 /* bus error status register */
453#define hsmc1_bear 0x1c2 /* bus error address register */
454#define hsmc1_br0 0x1c4 /* SDRAM sub-ctrl bank reg 0 */
455#define hsmc1_cr0 0x1c5 /* SDRAM sub-ctrl ctrl reg 0 */
456#define hsmc1_br1 0x1c7 /* SDRAM sub-ctrl bank reg 1 */
457#define hsmc1_cr1 0x1c8 /* SDRAM sub-ctrl ctrl reg 1 */
458#define hsmc1_sysr 0x1d1 /* system register */
459#define hsmc1_data 0x1d2 /* data register */
460#define hsmc1_crr 0x1d3 /* refresh register */
461
462/*----------------------------------------------------------------------------+
463| Machine State Register bit definitions.
464+----------------------------------------------------------------------------*/
465#define msr_ape 0x00100000
466#define msr_apa 0x00080000
467#define msr_we 0x00040000
468#define msr_ce 0x00020000
469#define msr_ile 0x00010000
470#define msr_ee 0x00008000
471#define msr_pr 0x00004000
472#define msr_me 0x00001000
473#define msr_de 0x00000200
474#define msr_ir 0x00000020
475#define msr_dr 0x00000010
476#define msr_le 0x00000001
477
478/*----------------------------------------------------------------------------+
479| Used during interrupt processing.
480+----------------------------------------------------------------------------*/
481#define stack_reg_image_size 160
482
483/*----------------------------------------------------------------------------+
484| Function prolog definition and other Metaware (EABI) defines.
485+----------------------------------------------------------------------------*/
486#ifdef MW
487
488#define r0 0
489#define r1 1
490#define r2 2
491#define r3 3
492#define r4 4
493#define r5 5
494#define r6 6
495#define r7 7
496#define r8 8
497#define r9 9
498#define r10 10
499#define r11 11
500#define r12 12
501#define r13 13
502#define r14 14
503#define r15 15
504#define r16 16
505#define r17 17
506#define r18 18
507#define r19 19
508#define r20 20
509#define r21 21
510#define r22 22
511#define r23 23
512#define r24 24
513#define r25 25
514#define r26 26
515#define r27 27
516#define r28 28
517#define r29 29
518#define r30 30
519#define r31 31
520
521#define cr0 0
522#define cr1 1
523#define cr2 2
524#define cr3 3
525#define cr4 4
526#define cr5 5
527#define cr6 6
528#define cr7 7
529
530#define function_prolog(func_name) .text; \
531 .align 2; \
532 .globl func_name; \
533 func_name:
534#define function_epilog(func_name) .type func_name,@function; \
535 .size func_name,.-func_name
536
537#define function_call(func_name) bl func_name
538
539#define stack_frame_min 8
540#define stack_frame_bc 0
541#define stack_frame_lr 4
542#define stack_neg_off 0
543
544#endif
545
546/*----------------------------------------------------------------------------+
547| Function prolog definition and other DIAB (Elf) defines.
548+----------------------------------------------------------------------------*/
549#ifdef ELF_DIAB
550
551fprolog: macro f_name
552 .text
553 .align 2
554 .globl f_name
555f_name:
556 endm
557
558fepilog: macro f_name
559 .type f_name,@function
560 .size f_name,.-f_name
561 endm
562
563#define function_prolog(func_name) fprolog func_name
564#define function_epilog(func_name) fepilog func_name
565#define function_call(func_name) bl func_name
566
567#define stack_frame_min 8
568#define stack_frame_bc 0
569#define stack_frame_lr 4
570#define stack_neg_off 0
571
572#endif
573
574/*----------------------------------------------------------------------------+
575| Function prolog definition and other Xlc (XCOFF) defines.
576+----------------------------------------------------------------------------*/
577#ifdef XCOFF
578
579.machine "403ga"
580
581#define r0 0
582#define r1 1
583#define r2 2
584#define r3 3
585#define r4 4
586#define r5 5
587#define r6 6
588#define r7 7
589#define r8 8
590#define r9 9
591#define r10 10
592#define r11 11
593#define r12 12
594#define r13 13
595#define r14 14
596#define r15 15
597#define r16 16
598#define r17 17
599#define r18 18
600#define r19 19
601#define r20 20
602#define r21 21
603#define r22 22
604#define r23 23
605#define r24 24
606#define r25 25
607#define r26 26
608#define r27 27
609#define r28 28
610#define r29 29
611#define r30 30
612#define r31 31
613
614#define cr0 0
615#define cr1 1
616#define cr2 2
617#define cr3 3
618#define cr4 4
619#define cr5 5
620#define cr6 6
621#define cr7 7
622
623#define function_prolog(func_name) .csect .func_name[PR]; \
624 .globl .func_name[PR]; \
625 func_name:
626
627#define function_epilog(func_name) .toc; \
628 .csect func_name[DS]; \
629 .globl func_name[DS]; \
630 .long .func_name[PR]; \
631 .long TOC[tc0]
632
633#define function_call(func_name) .extern .func_name[PR]; \
634 stw r2,stack_frame_toc(r1); \
635 mfspr r2,sprg0; \
636 bl .func_name[PR]; \
637 lwz r2,stack_frame_toc(r1)
638
639#define stack_frame_min 56
640#define stack_frame_bc 0
641#define stack_frame_lr 8
642#define stack_frame_toc 20
643#define stack_neg_off 276
644
645#endif
646#define function_prolog(func_name) .text; \
647 .align 2; \
648 .globl func_name; \
649 func_name:
650#define function_epilog(func_name) .type func_name,@function; \
651 .size func_name,.-func_name
652
653#define function_call(func_name) bl func_name
654
655/*----------------------------------------------------------------------------+
656| Function prolog definition for GNU
657+----------------------------------------------------------------------------*/
658#ifdef _GNU_TOOL
659
660#define function_prolog(func_name) .globl func_name; \
661 func_name:
662#define function_epilog(func_name)
663
664#endif
diff --git a/arch/ppc/boot/simple/rw4/rw4_init.S b/arch/ppc/boot/simple/rw4/rw4_init.S
deleted file mode 100644
index b1061962e46b..000000000000
--- a/arch/ppc/boot/simple/rw4/rw4_init.S
+++ /dev/null
@@ -1,78 +0,0 @@
1#define VESTA
2#include "ppc_40x.h"
3#
4 .align 2
5 .text
6#
7# added by linguohui
8 .extern initb_ebiu0, initb_config, hdw_init_finish
9 .extern initb_hsmc0, initb_hsmc1, initb_cache
10# end added
11 .globl HdwInit
12#
13HdwInit:
14#
15#-----------------------------------------------------------------------*
16# If we are not executing from the FLASH get out *
17#-----------------------------------------------------------------------*
18# SAW keep this or comment out a la Hawthorne?
19# r3 contains NIP when used with Linux
20# rlwinm r28, r3, 8, 24, 31 # if MSB == 0xFF -> FLASH address
21# cmpwi r28, 0xff
22# bne locn01
23#
24#
25#------------------------------------------------------------------------
26# Init_cpu. Bank registers are setup for the IBM STB.
27#------------------------------------------------------------------------
28#
29# Setup processor core clock to be driven off chip. This is GPI4 bit
30# twenty. Setup Open Drain, Output Select, Three-State Control, and
31# Three-State Select registers.
32#
33
34
35 pb0pesr = 0x054
36 pb0pear = 0x056
37
38 mflr r30
39
40#-----------------------------------------------------------------------------
41# Vectors will be at 0x1F000000
42# Dummy Machine check handler just does RFI before true handler gets installed
43#-----------------------------------------------------------------------------
44#if 1 /* xuwentao added*/
45#ifdef SDRAM16MB
46 lis r10,0x0000
47 addi r10,r10,0x0000
48#else
49 lis r10,0x1F00
50 addi r10,r10,0x0000
51#endif
52
53 mtspr evpr,r10 #EVPR: 0x0 or 0x1f000000 depending
54 isync # on SDRAM memory model used.
55
56 lis r10,0xFFFF # clear PB0_PESR because some
57 ori r10,r10,0xFFFF # transitions from flash,changed by linguohui
58 mtdcr pb0pesr,r10 # to load RAM image via RiscWatch
59 lis r10,0x0000 # cause PB0_PESR machine checks
60 mtdcr pb0pear,r10
61 addis r10,r10,0x0000 # clear the
62 mtxer r10 # XER just in case...
63#endif /* xuwentao*/
64
65 bl initb_ebiu0 # init EBIU
66
67 bl initb_config # config PPC and board
68
69
70
71
72#------------------------------------------------------------------------
73# EVPR setup moved to top of this function.
74#------------------------------------------------------------------------
75#
76 mtlr r30
77 blr
78 .end
diff --git a/arch/ppc/boot/simple/rw4/rw4_init_brd.S b/arch/ppc/boot/simple/rw4/rw4_init_brd.S
deleted file mode 100644
index 386afdaad6c7..000000000000
--- a/arch/ppc/boot/simple/rw4/rw4_init_brd.S
+++ /dev/null
@@ -1,1125 +0,0 @@
1/*----------------------------------------------------------------------------+
2| This source code has been made available to you by IBM on an AS-IS
3| basis. Anyone receiving this source is licensed under IBM
4| copyrights to use it in any way he or she deems fit, including
5| copying it, modifying it, compiling it, and redistributing it either
6| with or without modifications. No license under IBM patents or
7| patent applications is to be implied by the copyright license.
8|
9| Any user of this software should understand that IBM cannot provide
10| technical support for this software and will not be responsible for
11| any consequences resulting from the use of this software.
12|
13| Any person who transfers this source code or any derivative work
14| must include the IBM copyright notice, this paragraph, and the
15| preceding two paragraphs in the transferred software.
16|
17| COPYRIGHT I B M CORPORATION 1997
18| LICENSED MATERIAL - PROGRAM PROPERTY OF I B M
19+----------------------------------------------------------------------------*/
20/*----------------------------------------------------------------------------+
21| Author: Tony J. Cerreto
22| Component: BSPS
23| File: init_brd.s
24| Purpose: Vesta Evaluation Board initialization subroutines. The following
25| routines are available:
26| 1. INITB_EBIU0: Initialize EBIU0.
27| 2. INITB_CONFIG: Configure board.
28| 3. INITB_HSMC0: Initialize HSMC0 (SDRAM).
29| 4. INITB_HSMC1: Initialize HSMC1 (SDRAM).
30| 5. INITB_CACHE: Initialize Data and Instruction Cache.
31| 6. INITB_DCACHE: Initialize Data Cache.
32| 7. INITB_ICACHE: Initialize Instruction Cache.
33| 8. INITB_GET_CSPD: Get CPU Speed (Bus Speed and Processor Speed)
34|
35| Changes:
36| Date: Author Comment:
37| --------- ------ --------
38| 01-Mar-00 tjc Created
39| 04-Mar-00 jfh Modified CIC_SEL3_VAL to support 1284 (Mux3 & GPIO 21-28)
40| 04-Mar-00 jfh Modified XILINIX Reg 0 to support 1284 (Mux3 & GPIO 21-28)
41| 04-Mar-00 jfh Modified XILINIX Reg 1 to support 1284 (Mux3 & GPIO 21-28)
42| 04-Mar-00 jfh Modified XILINIX Reg 4 to support 1284 (Mux3 & GPIO 21-28)
43| 19-May-00 rlb Relcoated HSMC0 to 0x1F000000 to support 32MB of contiguous
44| SDRAM space. Changed cache ctl regs to reflect this.
45| 22-May-00 tjc Changed initb_get_cspd interface and eliminated
46| initb_get_bspd routines.
47| 26-May-00 tjc Added two nop instructions after all mtxxx/mfxxx
48| instructions due to PPC405 bug.
49+----------------------------------------------------------------------------*/
50#define VESTA
51#include "ppc_40x.h"
52#include "stb.h"
53
54/*----------------------------------------------------------------------------+
55| BOARD CONFIGURATION DEFINES
56+----------------------------------------------------------------------------*/
57#define CBS0_CR_VAL 0x00000002 /* CBS control reg value */
58#define CIC0_CR_VAL 0xD0800448 /* CIC control reg value */
59#define CIC0_SEL3_VAL 0x11500000 /* CIC select 3 reg value */
60#define CIC0_VCR_VAL 0x00631700 /* CIC video cntl reg value */
61
62/*----------------------------------------------------------------------------+
63| EBIU0 BANK REGISTERS DEFINES
64+----------------------------------------------------------------------------*/
65#define EBIU0_BRCRH0_VAL 0x00000000 /* BR High 0 (Extension Reg)*/
66#define EBIU0_BRCRH1_VAL 0x00000000 /* BR High 1 (Extension Reg)*/
67#define EBIU0_BRCRH2_VAL 0x40000000 /* BR High 2 (Extension Reg)*/
68#define EBIU0_BRCRH3_VAL 0x40000000 /* BR High 3 (Extension Reg)*/
69#define EBIU0_BRCRH4_VAL 0x00000000 /* BR High 4 (Extension Reg)*/
70#define EBIU0_BRCRH5_VAL 0x00000000 /* BR High 5 (Extension Reg)*/
71#define EBIU0_BRCRH6_VAL 0x00000000 /* BR High 6 (Extension Reg)*/
72#define EBIU0_BRCRH7_VAL 0x40000000 /* BR High 7 (Extension Reg)*/
73
74#define EBIU0_BRCR0_VAL 0xFC58BFFE /* BR 0: 16 bit Flash 4 MB */
75#define EBIU0_BRCR1_VAL 0xFF00BFFE /* BR 1: Ext Connector 1 MB */
76#if 1
77#define EBIU0_BRCR2_VAL 0x207CFFBE /* BR 2: Xilinx 8 MB */
78 /* twt == 0x3f */
79#else
80#define EBIU0_BRCR2_VAL 0x207CCFBE /* BR 2: Xilinx 8 MB */
81 /* twt == 0x0f */
82#endif
83#define EBIU0_BRCR3_VAL 0x407CBFBE /* BR 3: IDE Drive 8 MB */
84#define EBIU0_BRCR4_VAL 0xFF00BFFF /* BR 4: Disabled. 0 MB */
85#define EBIU0_BRCR5_VAL 0xFF00BFFF /* BR 5: Disabled. 0 MB */
86#define EBIU0_BRCR6_VAL 0xFF00BFFF /* BR 6: Disabled. 0 MB */
87#define EBIU0_BRCR7_VAL 0xCE3F0003 /* BR 7: Line Mode DMA 2 MB */
88
89/*----------------------------------------------------------------------------+
90| GPIO DEFINES
91+----------------------------------------------------------------------------*/
92#define STB_GPIO0_OUTPUT (STB_GPIO0_BASE_ADDRESS+ 0x00)
93#define STB_GPIO0_TC (STB_GPIO0_BASE_ADDRESS+ 0x04)
94#define STB_GPIO0_OS_0_31 (STB_GPIO0_BASE_ADDRESS+ 0x08)
95#define STB_GPIO0_OS_32_63 (STB_GPIO0_BASE_ADDRESS+ 0x0C)
96#define STB_GPIO0_TS_0_31 (STB_GPIO0_BASE_ADDRESS+ 0x10)
97#define STB_GPIO0_TS_32_63 (STB_GPIO0_BASE_ADDRESS+ 0x14)
98#define STB_GPIO0_OD (STB_GPIO0_BASE_ADDRESS+ 0x18)
99#define STB_GPIO0_INPUT (STB_GPIO0_BASE_ADDRESS+ 0x1C)
100#define STB_GPIO0_R1 (STB_GPIO0_BASE_ADDRESS+ 0x20)
101#define STB_GPIO0_R2 (STB_GPIO0_BASE_ADDRESS+ 0x24)
102#define STB_GPIO0_R3 (STB_GPIO0_BASE_ADDRESS+ 0x28)
103#define STB_GPIO0_IS_1_0_31 (STB_GPIO0_BASE_ADDRESS+ 0x30)
104#define STB_GPIO0_IS_1_32_63 (STB_GPIO0_BASE_ADDRESS+ 0x34)
105#define STB_GPIO0_IS_2_0_31 (STB_GPIO0_BASE_ADDRESS+ 0x38)
106#define STB_GPIO0_IS_2_32_63 (STB_GPIO0_BASE_ADDRESS+ 0x3C)
107#define STB_GPIO0_IS_3_0_31 (STB_GPIO0_BASE_ADDRESS+ 0x40)
108#define STB_GPIO0_IS_3_32_63 (STB_GPIO0_BASE_ADDRESS+ 0x44)
109#define STB_GPIO0_SS_1 (STB_GPIO0_BASE_ADDRESS+ 0x50)
110#define STB_GPIO0_SS_2 (STB_GPIO0_BASE_ADDRESS+ 0x54)
111#define STB_GPIO0_SS_3 (STB_GPIO0_BASE_ADDRESS+ 0x58)
112
113#define GPIO0_TC_VAL 0x0C020004 /* three-state control val */
114#define GPIO0_OS_0_31_VAL 0x51A00004 /* output select 0-31 val */
115#define GPIO0_OS_32_63_VAL 0x0000002F /* output select 32-63 val */
116#define GPIO0_TS_0_31_VAL 0x51A00000 /* three-state sel 0-31 val*/
117#define GPIO0_TS_32_63_VAL 0x0000000F /* three-state sel 32-63 val*/
118#define GPIO0_OD_VAL 0xC0000004 /* open drain val */
119#define GPIO0_IS_1_0_31_VAL 0x50000151 /* input select 1 0-31 val */
120#define GPIO0_IS_1_32_63_VAL 0x00000000 /* input select 1 32-63 val */
121#define GPIO0_IS_2_0_31_VAL 0x00000000 /* input select 2 0-31 val */
122#define GPIO0_IS_2_32_63_VAL 0x00000000 /* input select 2 32-63 val */
123#define GPIO0_IS_3_0_31_VAL 0x00000440 /* input select 3 0-31 val */
124#define GPIO0_IS_3_32_63_VAL 0x00000000 /* input select 3 32-63 val */
125#define GPIO0_SS_1_VAL 0x00000000 /* sync select 1 val */
126#define GPIO0_SS_2_VAL 0x00000000 /* sync select 2 val */
127#define GPIO0_SS_3_VAL 0x00000000 /* sync select 3 val */
128
129/*----------------------------------------------------------------------------+
130| XILINX DEFINES
131+----------------------------------------------------------------------------*/
132#define STB_XILINX_LED (STB_FPGA_BASE_ADDRESS+ 0x0100)
133#define STB_XILINX1_REG0 (STB_FPGA_BASE_ADDRESS+ 0x40000)
134#define STB_XILINX1_REG1 (STB_FPGA_BASE_ADDRESS+ 0x40002)
135#define STB_XILINX1_REG2 (STB_FPGA_BASE_ADDRESS+ 0x40004)
136#define STB_XILINX1_REG3 (STB_FPGA_BASE_ADDRESS+ 0x40006)
137#define STB_XILINX1_REG4 (STB_FPGA_BASE_ADDRESS+ 0x40008)
138#define STB_XILINX1_REG5 (STB_FPGA_BASE_ADDRESS+ 0x4000A)
139#define STB_XILINX1_REG6 (STB_FPGA_BASE_ADDRESS+ 0x4000C)
140#define STB_XILINX1_ID (STB_FPGA_BASE_ADDRESS+ 0x4000E)
141#define STB_XILINX1_FLUSH (STB_FPGA_BASE_ADDRESS+ 0x4000E)
142#define STB_XILINX2_REG0 (STB_FPGA_BASE_ADDRESS+ 0x80000)
143#define STB_XILINX2_REG1 (STB_FPGA_BASE_ADDRESS+ 0x80002)
144#define STB_XILINX2_REG2 (STB_FPGA_BASE_ADDRESS+ 0x80004)
145
146#define XILINX1_R0_VAL 0x2440 /* Xilinx 1 Register 0 Val */
147#define XILINX1_R1_VAL 0x0025 /* Xilinx 1 Register 1 Val */
148#define XILINX1_R2_VAL 0x0441 /* Xilinx 1 Register 2 Val */
149#define XILINX1_R3_VAL 0x0008 /* Xilinx 1 Register 3 Val */
150#define XILINX1_R4_VAL 0x0100 /* Xilinx 1 Register 4 Val */
151#define XILINX1_R5_VAL 0x6810 /* Xilinx 1 Register 5 Val */
152#define XILINX1_R6_VAL 0x0000 /* Xilinx 1 Register 6 Val */
153#if 0
154#define XILINX2_R0_VAL 0x0008 /* Xilinx 2 Register 0 Val */
155#define XILINX2_R1_VAL 0x0000 /* Xilinx 2 Register 1 Val */
156#else
157#define XILINX2_R0_VAL 0x0018 /* disable IBM IrDA RxD */
158#define XILINX2_R1_VAL 0x0008 /* enable SICC MAX chip */
159#endif
160#define XILINX2_R2_VAL 0x0000 /* Xilinx 2 Register 2 Val */
161
162/*----------------------------------------------------------------------------+
163| HSMC BANK REGISTERS DEFINES
164+----------------------------------------------------------------------------*/
165#ifdef SDRAM16MB
166#define HSMC0_BR0_VAL 0x000D2D55 /* 0x1F000000-007FFFFF R/W */
167#define HSMC0_BR1_VAL 0x008D2D55 /* 0x1F800000-1FFFFFFF R/W */
168#else
169#define HSMC0_BR0_VAL 0x1F0D2D55 /* 0x1F000000-007FFFFF R/W */
170#define HSMC0_BR1_VAL 0x1F8D2D55 /* 0x1F800000-1FFFFFFF R/W */
171#endif
172#define HSMC1_BR0_VAL 0xA00D2D55 /* 0xA0000000-A07FFFFF R/W */
173#define HSMC1_BR1_VAL 0xA08D2D55 /* 0xA0800000-A0FFFFFF R/W */
174
175/*----------------------------------------------------------------------------+
176| CACHE DEFINES
177+----------------------------------------------------------------------------*/
178#define DCACHE_NLINES 128 /* no. D-cache lines */
179#define DCACHE_NBYTES 32 /* no. bytes/ D-cache line */
180#define ICACHE_NLINES 256 /* no. I-cache lines */
181#define ICACHE_NBYTES 32 /* no. bytes/ I-cache line */
182#ifdef SDRAM16MB
183#define DCACHE_ENABLE 0x80000000 /* D-cache regions to enable*/
184#define ICACHE_ENABLE 0x80000001 /* I-cache regions to enable*/
185#else
186#define DCACHE_ENABLE 0x18000000 /* D-cache regions to enable*/
187#define ICACHE_ENABLE 0x18000001 /* I-cache regions to enable*/
188#endif
189
190/*----------------------------------------------------------------------------+
191| CPU CORE SPEED CALCULATION DEFINES
192+----------------------------------------------------------------------------*/
193#define GCS_LCNT 500000 /* CPU speed loop count */
194#define GCS_TROW_BYTES 8 /* no. bytes in table row */
195#define GCS_CTICK_TOL 100 /* allowable clock tick tol */
196#define GCS_NMULT 4 /* no. of core speed mults */
197
198 /*--------------------------------------------------------------------+
199 | No. 13.5Mhz
200 | Clock Ticks
201 | based on a
202 | loop count Bus
203 | of 100,000 Speed
204 +--------------------------------------------------------------------*/
205gcs_lookup_table:
206 .int 50000, 54000000 /* 54.0 Mhz */
207 .int 66667, 40500000 /* 40.5 Mhz */
208 .int 54545, 49500000 /* 49.5 Mhz */
209 .int 46154, 58500000 /* 58.5 Mhz */
210 .int 0, 0 /* end of table flag */
211
212
213/*****************************************************************************+
214| XXXXXXX XXX XXX XXXXXX XXXXXXX XXXXXX XX XX XX XXXX
215| XX X XX XX X XX X XX X XX XX XXX XX XXXX XX
216| XX X XXX XX XX X XX XX XXXX XX XX XX XX
217| XXXX X XX XXXX XXXXX XX XXXX XX XX XX
218| XX X XXX XX XX X XX XX XX XXX XXXXXX XX
219| XX X XX XX XX XX X XX XX XX XX XX XX XX XX
220| XXXXXXX XXX XXX XXXX XXXXXXX XXX XX XX XX XX XX XXXXXXX
221+*****************************************************************************/
222/******************************************************************************
223|
224| Routine: INITB_EBIU0.
225|
226| Purpose: Initialize all the EBIU0 Bank Registers
227| Parameters: None.
228| Returns: None.
229|
230******************************************************************************/
231 function_prolog(initb_ebiu0)
232 /*--------------------------------------------------------------------+
233 | Set EBIU0 Bank 0
234 +--------------------------------------------------------------------*/
235 lis r10,EBIU0_BRCR0_VAL@h
236 ori r10,r10,EBIU0_BRCR0_VAL@l
237 mtdcr ebiu0_brcr0,r10
238 lis r10,EBIU0_BRCRH0_VAL@h
239 ori r10,r10,EBIU0_BRCRH0_VAL@l
240 mtdcr ebiu0_brcrh0,r10
241
242 /*--------------------------------------------------------------------+
243 | Set EBIU0 Bank 1
244 +--------------------------------------------------------------------*/
245 lis r10,EBIU0_BRCR1_VAL@h
246 ori r10,r10,EBIU0_BRCR1_VAL@l
247 mtdcr ebiu0_brcr1,r10
248 lis r10,EBIU0_BRCRH1_VAL@h
249 ori r10,r10,EBIU0_BRCRH1_VAL@l
250 mtdcr ebiu0_brcrh1,r10
251
252 /*--------------------------------------------------------------------+
253 | Set EBIU0 Bank 2
254 +--------------------------------------------------------------------*/
255 lis r10,EBIU0_BRCR2_VAL@h
256 ori r10,r10,EBIU0_BRCR2_VAL@l
257 mtdcr ebiu0_brcr2,r10
258 lis r10,EBIU0_BRCRH2_VAL@h
259 ori r10,r10,EBIU0_BRCRH2_VAL@l
260 mtdcr ebiu0_brcrh2,r10
261
262 /*--------------------------------------------------------------------+
263 | Set EBIU0 Bank 3
264 +--------------------------------------------------------------------*/
265 lis r10,EBIU0_BRCR3_VAL@h
266 ori r10,r10,EBIU0_BRCR3_VAL@l
267 mtdcr ebiu0_brcr3,r10
268 lis r10,EBIU0_BRCRH3_VAL@h
269 ori r10,r10,EBIU0_BRCRH3_VAL@l
270 mtdcr ebiu0_brcrh3,r10
271
272 /*--------------------------------------------------------------------+
273 | Set EBIU0 Bank 4
274 +--------------------------------------------------------------------*/
275 lis r10,EBIU0_BRCR4_VAL@h
276 ori r10,r10,EBIU0_BRCR4_VAL@l
277 mtdcr ebiu0_brcr4,r10
278 lis r10,EBIU0_BRCRH4_VAL@h
279 ori r10,r10,EBIU0_BRCRH4_VAL@l
280 mtdcr ebiu0_brcrh4,r10
281
282 /*--------------------------------------------------------------------+
283 | Set EBIU0 Bank 5
284 +--------------------------------------------------------------------*/
285 lis r10,EBIU0_BRCR5_VAL@h
286 ori r10,r10,EBIU0_BRCR5_VAL@l
287 mtdcr ebiu0_brcr5,r10
288 lis r10,EBIU0_BRCRH5_VAL@h
289 ori r10,r10,EBIU0_BRCRH5_VAL@l
290 mtdcr ebiu0_brcrh5,r10
291
292 /*--------------------------------------------------------------------+
293 | Set EBIU0 Bank 6
294 +--------------------------------------------------------------------*/
295 lis r10,EBIU0_BRCR6_VAL@h
296 ori r10,r10,EBIU0_BRCR6_VAL@l
297 mtdcr ebiu0_brcr6,r10
298 lis r10,EBIU0_BRCRH6_VAL@h
299 ori r10,r10,EBIU0_BRCRH6_VAL@l
300 mtdcr ebiu0_brcrh6,r10
301
302 /*--------------------------------------------------------------------+
303 | Set EBIU0 Bank 7
304 +--------------------------------------------------------------------*/
305 lis r10,EBIU0_BRCR7_VAL@h
306 ori r10,r10,EBIU0_BRCR7_VAL@l
307 mtdcr ebiu0_brcr7,r10
308 lis r10,EBIU0_BRCRH7_VAL@h
309 ori r10,r10,EBIU0_BRCRH7_VAL@l
310 mtdcr ebiu0_brcrh7,r10
311
312 blr
313 function_epilog(initb_ebiu0)
314
315
316/******************************************************************************
317|
318| Routine: INITB_CONFIG
319|
320| Purpose: Configure the Vesta Evaluation Board. The following items
321| will be configured:
322| 1. Cross-Bar Switch.
323| 2. Chip Interconnect.
324| 3. Clear/reset key PPC registers.
325| 4. Xilinx and GPIO Registers.
326|
327| Returns: None.
328|
329******************************************************************************/
330 function_prolog(initb_config)
331 /*--------------------------------------------------------------------+
332 | Init CROSS-BAR SWITCH
333 +--------------------------------------------------------------------*/
334 lis r10,CBS0_CR_VAL@h /* r10 <- CBS Cntl Reg val */
335 ori r10,r10,CBS0_CR_VAL@l
336 mtdcr cbs0_cr,r10
337
338 /*--------------------------------------------------------------------+
339 | Init Chip-Interconnect (CIC) Registers
340 +--------------------------------------------------------------------*/
341 lis r10,CIC0_CR_VAL@h /* r10 <- CIC Cntl Reg val */
342 ori r10,r10,CIC0_CR_VAL@l
343 mtdcr cic0_cr,r10
344
345 lis r10,CIC0_SEL3_VAL@h /* r10 <- CIC SEL3 Reg val */
346 ori r10,r10,CIC0_SEL3_VAL@l
347 mtdcr cic0_sel3,r10
348
349 lis r10,CIC0_VCR_VAL@h /* r10 <- CIC Vid C-Reg val */
350 ori r10,r10,CIC0_VCR_VAL@l
351 mtdcr cic0_vcr,r10
352
353 /*--------------------------------------------------------------------+
354 | Clear SGR and DCWR
355 +--------------------------------------------------------------------*/
356 li r10,0x0000
357 mtspr sgr,r10
358 mtspr dcwr,r10
359
360 /*--------------------------------------------------------------------+
361 | Clear/set up some machine state registers.
362 +--------------------------------------------------------------------*/
363 li r10,0x0000 /* r10 <- 0 */
364 mtdcr ebiu0_besr,r10 /* clr Bus Err Syndrome Reg */
365 mtspr esr,r10 /* clr Exceptn Syndrome Reg */
366 mttcr r10 /* timer control register */
367
368 mtdcr uic0_er,r10 /* disable all interrupts */
369
370 /* UIC_IIC0 | UIC_IIC1 | UIC_U0 | UIC_IR_RCV | UIC_IR_XMIT */
371 lis r10, 0x00600e00@h
372 ori r10,r10,0x00600e00@l
373 mtdcr uic0_pr,r10
374
375 li r10,0x00000020 /* UIC_EIR1 */
376 mtdcr uic0_tr,r10
377
378 lis r10,0xFFFF /* r10 <- 0xFFFFFFFF */
379 ori r10,r10,0xFFFF /* */
380 mtdbsr r10 /* clear/reset the dbsr */
381 mtdcr uic0_sr,r10 /* clear pending interrupts */
382
383 li r10,0x1000 /* set Machine Exception bit*/
384 oris r10,r10,0x2 /* set Criticl Exception bit*/
385 mtmsr r10 /* change MSR */
386
387 /*--------------------------------------------------------------------+
388 | Clear XER.
389 +--------------------------------------------------------------------*/
390 li r10,0x0000
391 mtxer r10
392
393 /*--------------------------------------------------------------------+
394 | Init GPIO0 Registers
395 +--------------------------------------------------------------------*/
396 lis r10, STB_GPIO0_TC@h /* Three-state control */
397 ori r10,r10,STB_GPIO0_TC@l
398 lis r11, GPIO0_TC_VAL@h
399 ori r11,r11,GPIO0_TC_VAL@l
400 stw r11,0(r10)
401
402 lis r10, STB_GPIO0_OS_0_31@h /* output select 0-31 */
403 ori r10,r10,STB_GPIO0_OS_0_31@l
404 lis r11, GPIO0_OS_0_31_VAL@h
405 ori r11,r11,GPIO0_OS_0_31_VAL@l
406 stw r11,0(r10)
407
408 lis r10, STB_GPIO0_OS_32_63@h /* output select 32-63 */
409 ori r10,r10,STB_GPIO0_OS_32_63@l
410 lis r11, GPIO0_OS_32_63_VAL@h
411 ori r11,r11,GPIO0_OS_32_63_VAL@l
412 stw r11,0(r10)
413
414 lis r10, STB_GPIO0_TS_0_31@h /* three-state select 0-31 */
415 ori r10,r10,STB_GPIO0_TS_0_31@l
416 lis r11, GPIO0_TS_0_31_VAL@h
417 ori r11,r11,GPIO0_TS_0_31_VAL@l
418 stw r11,0(r10)
419
420 lis r10, STB_GPIO0_TS_32_63@h /* three-state select 32-63 */
421 ori r10,r10,STB_GPIO0_TS_32_63@l
422 lis r11, GPIO0_TS_32_63_VAL@h
423 ori r11,r11,GPIO0_TS_32_63_VAL@l
424 stw r11,0(r10)
425
426 lis r10, STB_GPIO0_OD@h /* open drain */
427 ori r10,r10,STB_GPIO0_OD@l
428 lis r11, GPIO0_OD_VAL@h
429 ori r11,r11,GPIO0_OD_VAL@l
430 stw r11,0(r10)
431
432 lis r10, STB_GPIO0_IS_1_0_31@h /* input select 1, 0-31 */
433 ori r10,r10,STB_GPIO0_IS_1_0_31@l
434 lis r11, GPIO0_IS_1_0_31_VAL@h
435 ori r11,r11,GPIO0_IS_1_0_31_VAL@l
436 stw r11,0(r10)
437
438 lis r10, STB_GPIO0_IS_1_32_63@h /* input select 1, 32-63 */
439 ori r10,r10,STB_GPIO0_IS_1_32_63@l
440 lis r11, GPIO0_IS_1_32_63_VAL@h
441 ori r11,r11,GPIO0_IS_1_32_63_VAL@l
442 stw r11,0(r10)
443
444 lis r10, STB_GPIO0_IS_2_0_31@h /* input select 2, 0-31 */
445 ori r10,r10,STB_GPIO0_IS_2_0_31@l
446 lis r11, GPIO0_IS_2_0_31_VAL@h
447 ori r11,r11,GPIO0_IS_2_0_31_VAL@l
448 stw r11,0(r10)
449
450 lis r10, STB_GPIO0_IS_2_32_63@h /* input select 2, 32-63 */
451 ori r10,r10,STB_GPIO0_IS_2_32_63@l
452 lis r11, GPIO0_IS_2_32_63_VAL@h
453 ori r11,r11,GPIO0_IS_2_32_63_VAL@l
454 stw r11,0(r10)
455
456 lis r10, STB_GPIO0_IS_3_0_31@h /* input select 3, 0-31 */
457 ori r10,r10,STB_GPIO0_IS_3_0_31@l
458 lis r11, GPIO0_IS_3_0_31_VAL@h
459 ori r11,r11,GPIO0_IS_3_0_31_VAL@l
460 stw r11,0(r10)
461
462 lis r10, STB_GPIO0_IS_3_32_63@h /* input select 3, 32-63 */
463 ori r10,r10,STB_GPIO0_IS_3_32_63@l
464 lis r11, GPIO0_IS_3_32_63_VAL@h
465 ori r11,r11,GPIO0_IS_3_32_63_VAL@l
466 stw r11,0(r10)
467
468 lis r10, STB_GPIO0_SS_1@h /* sync select 1 */
469 ori r10,r10,STB_GPIO0_SS_1@l
470 lis r11, GPIO0_SS_1_VAL@h
471 ori r11,r11,GPIO0_SS_1_VAL@l
472 stw r11,0(r10)
473
474 lis r10, STB_GPIO0_SS_2@h /* sync select 2 */
475 ori r10,r10,STB_GPIO0_SS_2@l
476 lis r11, GPIO0_SS_2_VAL@h
477 ori r11,r11,GPIO0_SS_2_VAL@l
478 stw r11,0(r10)
479
480 lis r10, STB_GPIO0_SS_3@h /* sync select 3 */
481 ori r10,r10,STB_GPIO0_SS_3@l
482 lis r11, GPIO0_SS_3_VAL@h
483 ori r11,r11,GPIO0_SS_3_VAL@l
484 stw r11,0(r10)
485
486 /*--------------------------------------------------------------------+
487 | Init Xilinx #1 Registers
488 +--------------------------------------------------------------------*/
489 lis r10, STB_XILINX1_REG0@h /* init Xilinx1 Reg 0 */
490 ori r10,r10,STB_XILINX1_REG0@l
491 li r11,XILINX1_R0_VAL
492 sth r11,0(r10)
493
494 lis r10, STB_XILINX1_REG1@h /* init Xilinx1 Reg 1 */
495 ori r10,r10,STB_XILINX1_REG1@l
496 li r11,XILINX1_R1_VAL
497 sth r11,0(r10)
498
499 lis r10, STB_XILINX1_REG2@h /* init Xilinx1 Reg 2 */
500 ori r10,r10,STB_XILINX1_REG2@l
501 li r11,XILINX1_R2_VAL
502 sth r11,0(r10)
503
504 lis r10, STB_XILINX1_REG3@h /* init Xilinx1 Reg 3 */
505 ori r10,r10,STB_XILINX1_REG3@l
506 li r11,XILINX1_R3_VAL
507 sth r11,0(r10)
508
509 lis r10, STB_XILINX1_REG4@h /* init Xilinx1 Reg 4 */
510 ori r10,r10,STB_XILINX1_REG4@l
511 li r11,XILINX1_R4_VAL
512 sth r11,0(r10)
513
514 lis r10, STB_XILINX1_REG5@h /* init Xilinx1 Reg 5 */
515 ori r10,r10,STB_XILINX1_REG5@l
516 li r11,XILINX1_R5_VAL
517 sth r11,0(r10)
518
519 lis r10, STB_XILINX1_REG6@h /* init Xilinx1 Reg 6 */
520 ori r10,r10,STB_XILINX1_REG6@l
521 li r11,XILINX1_R6_VAL
522 sth r11,0(r10)
523
524 lis r10, STB_XILINX1_FLUSH@h /* latch registers in Xilinx*/
525 ori r10,r10,STB_XILINX1_FLUSH@l
526 li r11,0x0000
527 sth r11,0(r10)
528
529 /*--------------------------------------------------------------------+
530 | Init Xilinx #2 Registers
531 +--------------------------------------------------------------------*/
532 lis r10, STB_XILINX2_REG0@h /* init Xilinx2 Reg 0 */
533 ori r10,r10,STB_XILINX2_REG0@l
534 li r11,XILINX2_R0_VAL
535 sth r11,0(r10)
536
537 lis r10, STB_XILINX2_REG1@h /* init Xilinx2 Reg 1 */
538 ori r10,r10,STB_XILINX2_REG1@l
539 li r11,XILINX2_R1_VAL
540 sth r11,0(r10)
541
542 lis r10, STB_XILINX2_REG2@h /* init Xilinx2 Reg 2 */
543 ori r10,r10,STB_XILINX2_REG2@l
544 li r11,XILINX2_R2_VAL
545 sth r11,0(r10)
546
547 blr
548 function_epilog(initb_config)
549
550
551/******************************************************************************
552|
553| Routine: INITB_HSMC0.
554|
555| Purpose: Initialize the HSMC0 Registers for SDRAM
556| Parameters: None.
557| Returns: R3 = 0: Successful
558| = -1: Unsuccessful, SDRAM did not reset properly.
559|
560******************************************************************************/
561 function_prolog(initb_hsmc0)
562 mflr r0 /* Save return addr */
563
564 /*--------------------------------------------------------------------+
565 | Set Global SDRAM Controller to recommended default
566 +--------------------------------------------------------------------*/
567 lis r10,0x6C00
568 ori r10,r10,0x0000
569 mtdcr hsmc0_gr,r10
570
571 /*--------------------------------------------------------------------+
572 | Set HSMC0 Data Register to recommended default
573 +--------------------------------------------------------------------*/
574 lis r10,0x0037
575 ori r10,r10,0x0000
576 mtdcr hsmc0_data,r10
577
578 /*--------------------------------------------------------------------+
579 | Init HSMC0 Bank Register 0
580 +--------------------------------------------------------------------*/
581 lis r10,HSMC0_BR0_VAL@h
582 ori r10,r10,HSMC0_BR0_VAL@l
583 mtdcr hsmc0_br0,r10
584
585 /*--------------------------------------------------------------------+
586 | Init HSMC0 Bank Register 1
587 +--------------------------------------------------------------------*/
588 lis r10,HSMC0_BR1_VAL@h
589 ori r10,r10,HSMC0_BR1_VAL@l
590 mtdcr hsmc0_br1,r10
591
592 /*--------------------------------------------------------------------+
593 | Set HSMC0 Control Reg 0
594 +--------------------------------------------------------------------*/
595 lis r10,0x8077 /* PRECHARGE ALL DEVICE BKS */
596 ori r10,r10,0x0000
597 mtdcr hsmc0_cr0,r10
598 li r3,0x0000
599 bl hsmc_cr_wait /* wait for op completion */
600 cmpwi cr0,r3,0x0000
601 bne cr0,hsmc0_err
602
603 lis r10,0x8078 /* AUTO-REFRESH */
604 ori r10,r10,0x0000
605 mtdcr hsmc0_cr0,r10
606 li r3,0x0000
607 bl hsmc_cr_wait /* wait for op completion */
608 cmpwi cr0,r3,0x0000
609 bne cr0,hsmc0_err
610
611 lis r10,0x8070 /* PROG MODE W/DATA REG VAL */
612 ori r10,r10,0x8000
613 mtdcr hsmc0_cr0,r10
614 li r3,0x0000
615 bl hsmc_cr_wait /* wait for op completion */
616 cmpwi cr0,r3,0x0000
617 bne hsmc0_err
618
619 /*--------------------------------------------------------------------+
620 | Set HSMC0 Control Reg 1
621 +--------------------------------------------------------------------*/
622 lis r10,0x8077 /* PRECHARGE ALL DEVICE BKS */
623 ori r10,r10,0x0000
624 mtdcr hsmc0_cr1,r10
625 li r3,0x0001
626 bl hsmc_cr_wait /* wait for op completion */
627 cmpwi cr0,r3,0x0000
628 bne cr0,hsmc0_err
629
630 lis r10,0x8078 /* AUTO-REFRESH */
631 ori r10,r10,0x0000
632 mtdcr hsmc0_cr1,r10
633 li r3,0x0001
634 bl hsmc_cr_wait /* wait for op completion */
635 cmpwi cr0,r3,0x0000
636 bne cr0,hsmc0_err
637
638 lis r10,0x8070 /* PROG MODE W/DATA REG VAL */
639 ori r10,r10,0x8000
640 mtdcr hsmc0_cr1,r10
641 li r3,0x0001
642 bl hsmc_cr_wait /* wait for op completion */
643 cmpwi cr0,r3,0x0000
644 bne cr0,hsmc0_err
645
646 /*--------------------------------------------------------------------+
647 | Set HSMC0 Refresh Register
648 +--------------------------------------------------------------------*/
649 lis r10,0x0FE1
650 ori r10,r10,0x0000
651 mtdcr hsmc0_crr,r10
652 li r3,0
653
654hsmc0_err:
655 mtlr r0
656 blr
657 function_epilog(initb_hsmc0)
658
659
660/******************************************************************************
661|
662| Routine: INITB_HSMC1.
663|
664| Purpose: Initialize the HSMC1 Registers for SDRAM
665| Parameters: None.
666| Returns: R3 = 0: Successful
667| = -1: Unsuccessful, SDRAM did not reset properly.
668|
669******************************************************************************/
670 function_prolog(initb_hsmc1)
671 mflr r0 /* Save return addr */
672
673 /*--------------------------------------------------------------------+
674 | Set Global SDRAM Controller to recommended default
675 +--------------------------------------------------------------------*/
676 lis r10,0x6C00
677 ori r10,r10,0x0000
678 mtdcr hsmc1_gr,r10
679
680 /*--------------------------------------------------------------------+
681 | Set HSMC1 Data Register to recommended default
682 +--------------------------------------------------------------------*/
683 lis r10,0x0037
684 ori r10,r10,0x0000
685 mtdcr hsmc1_data,r10
686
687 /*--------------------------------------------------------------------+
688 | Init HSMC1 Bank Register 0
689 +--------------------------------------------------------------------*/
690 lis r10,HSMC1_BR0_VAL@h
691 ori r10,r10,HSMC1_BR0_VAL@l
692 mtdcr hsmc1_br0,r10
693
694 /*--------------------------------------------------------------------+
695 | Init HSMC1 Bank Register 1
696 +--------------------------------------------------------------------*/
697 lis r10,HSMC1_BR1_VAL@h
698 ori r10,r10,HSMC1_BR1_VAL@l
699 mtdcr hsmc1_br1,r10
700
701 /*--------------------------------------------------------------------+
702 | Set HSMC1 Control Reg 0
703 +--------------------------------------------------------------------*/
704 lis r10,0x8077 /* PRECHARGE ALL DEVICE BANKS */
705 ori r10,r10,0x0000
706 mtdcr hsmc1_cr0,r10
707 li r3,0x0002
708 bl hsmc_cr_wait /* wait for operation completion */
709 cmpwi cr0,r3,0x0000
710 bne hsmc1_err
711
712 lis r10,0x8078 /* AUTO-REFRESH */
713 ori r10,r10,0x0000
714 mtdcr hsmc1_cr0,r10
715 li r3,0x0002
716 bl hsmc_cr_wait /* wait for operation completion */
717 cmpwi cr0,r3,0x0000
718 bne hsmc1_err
719
720 lis r10,0x8070 /* PROGRAM MODE W/DATA REG VALUE */
721 ori r10,r10,0x8000
722 mtdcr hsmc1_cr0,r10
723 li r3,0x0002
724 bl hsmc_cr_wait /* wait for operation completion */
725 cmpwi cr0,r3,0x0000
726 bne hsmc1_err
727
728 /*--------------------------------------------------------------------+
729 | Set HSMC1 Control Reg 1
730 +--------------------------------------------------------------------*/
731 lis r10,0x8077 /* PRECHARGE ALL DEVICE BKS */
732 ori r10,r10,0x0000
733 mtdcr hsmc1_cr1,r10
734 li r3,0x0003
735 bl hsmc_cr_wait /* wait for op completion */
736 cmpwi cr0,r3,0x0000
737 bne hsmc1_err
738
739 lis r10,0x8078 /* AUTO-REFRESH */
740 ori r10,r10,0x0000
741 mtdcr hsmc1_cr1,r10
742 li r3,0x0003
743 bl hsmc_cr_wait /* wait for op completion */
744 cmpwi cr0,r3,0x0000
745 bne hsmc1_err
746
747 lis r10,0x8070 /* PROG MODE W/DATA REG VAL */
748 ori r10,r10,0x8000
749 mtdcr hsmc1_cr1,r10
750 li r3,0x0003
751 bl hsmc_cr_wait /* wait for op completion */
752 cmpwi cr0,r3,0x0000
753 bne hsmc1_err
754
755 /*--------------------------------------------------------------------+
756 | Set HSMC1 Refresh Register
757 +--------------------------------------------------------------------*/
758 lis r10,0x0FE1
759 ori r10,r10,0x0000
760 mtdcr hsmc1_crr,r10
761 xor r3,r3,r3
762
763hsmc1_err:
764 mtlr r0
765 blr
766 function_epilog(initb_hsmc1)
767
768
769/******************************************************************************
770|
771| Routine: INITB_CACHE
772|
773| Purpose: This routine will enable Data and Instruction Cache.
774| The Data Cache is an 8K two-way set associative and the
775| Instruction Cache is an 16K two-way set associative cache.
776|
777| Parameters: None.
778|
779| Returns: None.
780|
781******************************************************************************/
782 function_prolog(initb_cache)
783 mflr r0 /* Save return addr */
784
785 bl initb_Dcache /* enable D-Cache */
786 bl initb_Icache /* enable I-Cache */
787
788 mtlr r0
789 blr
790 function_epilog(initb_cache)
791
792
793/******************************************************************************
794|
795| Routine: INITB_DCACHE
796|
797| Purpose: This routine will invalidate all data in the Data Cache and
798| then enable D-Cache. If cache is enabled already, the D-Cache
799| will be flushed before the data is invalidated.
800|
801| Parameters: None.
802|
803| Returns: None.
804|
805******************************************************************************/
806 function_prolog(initb_Dcache)
807 /*--------------------------------------------------------------------+
808 | Flush Data Cache if enabled
809 +--------------------------------------------------------------------*/
810 mfdccr r10 /* r10 <- DCCR */
811 isync /* ensure prev insts done */
812 cmpwi r10,0x00
813 beq ic_dcinv /* D-cache off, invalidate */
814
815 /*--------------------------------------------------------------------+
816 | Data Cache enabled, force known memory addresses to be Cached
817 +--------------------------------------------------------------------*/
818 lis r10,HSMC0_BR0_VAL@h /* r10 <- first memory loc */
819 andis. r10,r10,0xFFF0
820 li r11,DCACHE_NLINES /* r11 <- # A-way addresses */
821 addi r11,r11,DCACHE_NLINES /* r11 <- # B-way addresses */
822 mtctr r11 /* set loop counter */
823
824ic_dcload:
825 lwz r12,0(r10) /* force cache of address */
826 addi r10,r10,DCACHE_NBYTES /* r10 <- next memory loc */
827 bdnz ic_dcload
828 sync /* ensure prev insts done */
829 isync
830
831 /*--------------------------------------------------------------------+
832 | Flush the known memory addresses from Cache
833 +--------------------------------------------------------------------*/
834 lis r10,HSMC0_BR0_VAL@h /* r10 <- first memory loc */
835 andis. r10,r10,0xFFF0
836 mtctr r11 /* set loop counter */
837
838ic_dcflush:
839 dcbf 0,r10 /* flush D-cache line */
840 addi r10,r10,DCACHE_NBYTES /* r10 <- next memory loc */
841 bdnz ic_dcflush
842 sync /* ensure prev insts done */
843 isync
844
845 /*--------------------------------------------------------------------+
846 | Disable then invalidate Data Cache
847 +--------------------------------------------------------------------*/
848 li r10,0 /* r10 <- 0 */
849 mtdccr r10 /* disable the D-Cache */
850 isync /* ensure prev insts done */
851
852ic_dcinv:
853 li r10,0 /* r10 <- line address */
854 li r11,DCACHE_NLINES /* r11 <- # lines in cache */
855 mtctr r11 /* set loop counter */
856
857ic_dcloop:
858 dccci 0,r10 /* invalidate A/B cache lns */
859 addi r10,r10,DCACHE_NBYTES /* bump to next line */
860 bdnz ic_dcloop
861 sync /* ensure prev insts done */
862 isync
863
864 /*--------------------------------------------------------------------+
865 | Enable Data Cache
866 +--------------------------------------------------------------------*/
867 lis r10,DCACHE_ENABLE@h /* r10 <- D-cache enable msk*/
868 ori r10,r10,DCACHE_ENABLE@l
869 mtdccr r10
870 sync /* ensure prev insts done */
871 isync
872
873 blr
874 function_epilog(initb_Dcache)
875
876
877/******************************************************************************
878|
879| Routine: INITB_ICACHE
880|
881| Purpose: This routine will invalidate all data in the Instruction
882| Cache then enable I-Cache.
883|
884| Parameters: None.
885|
886| Returns: None.
887|
888******************************************************************************/
889 function_prolog(initb_Icache)
890 /*--------------------------------------------------------------------+
891 | Invalidate Instruction Cache
892 +--------------------------------------------------------------------*/
893 li r10,0 /* r10 <- lines address */
894 iccci 0,r10 /* invalidate all I-cache */
895 sync /* ensure prev insts done */
896 isync
897
898 /*--------------------------------------------------------------------+
899 | Enable Instruction Cache
900 +--------------------------------------------------------------------*/
901 lis r10,ICACHE_ENABLE@h /* r10 <- I-cache enable msk*/
902 ori r10,r10,ICACHE_ENABLE@l
903 mticcr r10
904 sync /* ensure prev insts done */
905 isync
906
907 blr
908 function_epilog(initb_Icache)
909
910#if 0
911/******************************************************************************
912|
913| Routine: INITB_GET_CSPD
914|
915| Purpose: Determine the CPU Core Speed. The 13.5 Mhz Time Base
916| Counter (TBC) is used to measure a conditional branch
917| instruction.
918|
919| Parameters: R3 = Address of Bus Speed
920| R4 = Address of Core Speed
921|
922| Returns: (R3) = >0: Bus Speed.
923| 0: Bus Speed not found in Look-Up Table.
924| (R4) = >0: Core Speed.
925| 0: Core Speed not found in Look-Up Table.
926|
927| Note: 1. This routine assumes the bdnz branch instruction takes
928| two instruction cycles to complete.
929| 2. This routine must be called before interrupts are enabled.
930|
931******************************************************************************/
932 function_prolog(initb_get_cspd)
933 mflr r0 /* Save return address */
934 /*--------------------------------------------------------------------+
935 | Set-up timed loop
936 +--------------------------------------------------------------------*/
937 lis r9,gcs_time_loop@h /* r9 <- addr loop instr */
938 ori r9,r9,gcs_time_loop@l
939 lis r10,GCS_LCNT@h /* r10 <- loop count */
940 ori r10,r10,GCS_LCNT@l
941 mtctr r10 /* ctr <- loop count */
942 lis r11,STB_TIMERS_TBC@h /* r11 <- TBC register addr */
943 ori r11,r11,STB_TIMERS_TBC@l
944 li r12,0 /* r12 <- 0 */
945
946 /*--------------------------------------------------------------------+
947 | Cache timed-loop instruction
948 +--------------------------------------------------------------------*/
949 icbt 0,r9
950 sync
951 isync
952
953 /*--------------------------------------------------------------------+
954 | Get number of 13.5 Mhz cycles to execute time-loop
955 +--------------------------------------------------------------------*/
956 stw r12,0(r11) /* reset TBC */
957gcs_time_loop:
958 bdnz+ gcs_time_loop /* force branch pred taken */
959 lwz r5,0(r11) /* r5 <- num 13.5 Mhz ticks */
960 li r6,5 /* LUT based on 1/5th the...*/
961 divw r5,r5,r6 /*..loop count used */
962 sync
963 isync
964
965 /*--------------------------------------------------------------------+
966 | Look-up core speed based on TBC value
967 +--------------------------------------------------------------------*/
968 lis r6,gcs_lookup_table@h /* r6 <- pts at core spd LUT*/
969 ori r6,r6,gcs_lookup_table@l
970 bl gcs_cspd_lookup /* find core speed in LUT */
971
972 mtlr r0 /* set return address */
973 blr
974 function_epilog(initb_get_cspd)
975
976#endif
977/*****************************************************************************+
978| XXXX XX XX XXXXXX XXXXXXX XXXXXX XX XX XX XXXX
979| XX XXX XX X XX X XX X XX XX XXX XX XXXX XX
980| XX XXXX XX XX XX X XX XX XXXX XX XX XX XX
981| XX XX XXXX XX XXXX XXXXX XX XXXX XX XX XX
982| XX XX XXX XX XX X XX XX XX XXX XXXXXX XX
983| XX XX XX XX XX X XX XX XX XX XX XX XX XX
984| XXXX XX XX XXXX XXXXXXX XXX XX XX XX XX XX XXXXXXX
985+*****************************************************************************/
986/******************************************************************************
987|
988| Routine: HSMC_CR_WAIT
989|
990| Purpose: Wait for the HSMC Control Register (bits 12-16) to be reset
991| after an auto-refresh, pre-charge or program mode register
992| command execution.
993|
994| Parameters: R3 = HSMC Control Register ID.
995| 0: HSMC0 CR0
996| 1: HSMC0 CR1
997| 2: HSMC1 CR0
998| 3: HSMC1 CR1
999|
1000| Returns: R3 = 0: Successful
1001| -1: Unsuccessful
1002|
1003******************************************************************************/
1004hsmc_cr_wait:
1005
1006 li r11,10 /* r11 <- retry counter */
1007 mtctr r11 /* set retry counter */
1008 mr r11,r3 /* r11 <- HSMC CR reg id */
1009
1010hsmc_cr_rep:
1011 bdz hsmc_cr_err /* branch if max retries hit*/
1012
1013 /*--------------------------------------------------------------------+
1014 | GET HSMCx_CRx value based on HSMC Control Register ID
1015 +--------------------------------------------------------------------*/
1016try_hsmc0_cr0: /* CHECK IF ID=HSMC0 CR0 REG*/
1017 cmpwi cr0,r11,0x0000
1018 bne cr0,try_hsmc0_cr1
1019 mfdcr r10,hsmc0_cr0 /* r11 <- HSMC0 CR0 value */
1020 b hsmc_cr_read
1021
1022try_hsmc0_cr1: /* CHECK IF ID=HSMC0 CR1 REG*/
1023 cmpwi cr0,r11,0x0001
1024 bne cr0,try_hsmc1_cr0
1025 mfdcr r10,hsmc0_cr1 /* r10 <- HSMC0 CR1 value */
1026 b hsmc_cr_read
1027
1028try_hsmc1_cr0: /* CHECK IF ID=HSMC1 CR0 REG*/
1029 cmpwi cr0,r11,0x0002
1030 bne cr0,try_hsmc1_cr1
1031 mfdcr r10,hsmc1_cr0 /* r10 <- HSMC1 CR0 value */
1032 b hsmc_cr_read
1033
1034try_hsmc1_cr1: /* CHECK IF ID=HSMC1 CR1 REG*/
1035 cmpwi cr0,r11,0x0003
1036 bne cr0,hsmc_cr_err
1037 mfdcr r10,hsmc1_cr1 /* r10 <- HSMC1 CR1 value */
1038
1039 /*--------------------------------------------------------------------+
1040 | Check if HSMC CR register was reset after command execution
1041 +--------------------------------------------------------------------*/
1042hsmc_cr_read:
1043 lis r12,0x000F /* create "AND" mask */
1044 ori r12,r12,0x8000
1045 and. r10,r10,r12 /* r10 <- HSMC CR bits 12-16*/
1046 bne cr0,hsmc_cr_rep /* wait for bits to reset */
1047 li r3,0 /* set return code = success*/
1048 b hsmc_cr_done
1049
1050hsmc_cr_err: /* ERROR: SDRAM didn't reset*/
1051 li r3,-1 /* set RC=unsuccessful */
1052
1053hsmc_cr_done:
1054 blr
1055
1056#if 0
1057/******************************************************************************
1058|
1059| Routine: GCS_CSPD_LOOKUP
1060|
1061| Purpose: Uses the number of 13.5 Mhz clock ticks found after executing
1062| the branch instruction time loop to look-up the CPU Core Speed
1063| in the Core Speed Look-up Table.
1064|
1065| Parameters: R3 = Address of Bus Speed
1066| R4 = Address of Core Speed
1067| R5 = Number of 13.5 Mhz clock ticks found in time loop.
1068| R6 = Pointer to Core-Speed Look-Up Table
1069|
1070| Returns: (R3) = >0: Bus Speed.
1071| 0: Bus Speed not found in Look-Up Table.
1072| (R4) = >0: Core Speed.
1073| 0: Core Speed not found in Look-Up Table.
1074|
1075| Note: Core Speed = Bus Speed * Mult Factor (1-4x).
1076|
1077******************************************************************************/
1078gcs_cspd_lookup:
1079
1080 li r9,1 /* r9 <- core speed mult */
1081 /*--------------------------------------------------------------------+
1082 | Get theoritical number 13.5 Mhz ticks for a given Bus Speed from
1083 | Look-up Table. Check all mult factors to determine if calculated
1084 | value matches theoretical value (within a tolerance).
1085 +--------------------------------------------------------------------*/
1086gcs_cspd_loop:
1087 lwz r10,0(r6) /* r10 <- no. ticks from LUT*/
1088 divw r10,r10,r9 /* r10 <- div mult (1-4x) */
1089 subi r11,r10,GCS_CTICK_TOL /* r11 <- no. tks low range */
1090 addi r12,r10,GCS_CTICK_TOL /* r12 <- no. tks high range*/
1091
1092 cmpw cr0,r5,r11 /* calc value within range? */
1093 blt gcs_cspd_retry /* less than low range */
1094 cmpw cr0,r5,r12
1095 bgt gcs_cspd_retry /* greater than high range */
1096 b gcs_cspd_fnd /* calc value within range */
1097
1098 /*--------------------------------------------------------------------+
1099 | SO FAR CORE SPEED NOT FOUND: Check next mult factor
1100 +--------------------------------------------------------------------*/
1101gcs_cspd_retry:
1102 addi r9,r9,1 /* bump mult factor (1-4x) */
1103 cmpwi cr0,r9,GCS_NMULT
1104 ble gcs_cspd_loop
1105
1106 /*--------------------------------------------------------------------+
1107 | SO FAR CORE SPEED NOT FOUND: Point at next Bus Speed in LUT
1108 +--------------------------------------------------------------------*/
1109 li r9,1 /* reset mult factor */
1110 addi r6,r6,GCS_TROW_BYTES /* point at next table entry*/
1111 lwz r10,0(r6)
1112 cmpwi cr0,r10,0 /* check for EOT flag */
1113 bne gcs_cspd_loop
1114
1115 /*--------------------------------------------------------------------+
1116 | COMPUTE CORE SPEED AND GET BUS SPEED FROM LOOK-UP TABLE
1117 +--------------------------------------------------------------------*/
1118gcs_cspd_fnd:
1119 lwz r5,4(r6) /* r5 <- Bus Speed in LUT */
1120 mullw r6,r5,r9 /* r6 <- Core speed */
1121 stw r5,0(r3) /* (r3) <- Bus Speed */
1122 stw r6,0(r4) /* (r4) <- Core Speed */
1123
1124 blr
1125#endif
diff --git a/arch/ppc/boot/simple/rw4/stb.h b/arch/ppc/boot/simple/rw4/stb.h
deleted file mode 100644
index 9afa5ab24d26..000000000000
--- a/arch/ppc/boot/simple/rw4/stb.h
+++ /dev/null
@@ -1,239 +0,0 @@
1/*----------------------------------------------------------------------------+
2| This source code has been made available to you by IBM on an AS-IS
3| basis. Anyone receiving this source is licensed under IBM
4| copyrights to use it in any way he or she deems fit, including
5| copying it, modifying it, compiling it, and redistributing it either
6| with or without modifications. No license under IBM patents or
7| patent applications is to be implied by the copyright license.
8|
9| Any user of this software should understand that IBM cannot provide
10| technical support for this software and will not be responsible for
11| any consequences resulting from the use of this software.
12|
13| Any person who transfers this source code or any derivative work
14| must include the IBM copyright notice, this paragraph, and the
15| preceding two paragraphs in the transferred software.
16|
17| COPYRIGHT I B M CORPORATION 1999
18| LICENSED MATERIAL - PROGRAM PROPERTY OF I B M
19+----------------------------------------------------------------------------*/
20/*----------------------------------------------------------------------------+
21| Author: Maciej P. Tyrlik
22| Component: Include file.
23| File: stb.h
24| Purpose: Common Set-tob-box definitions.
25| Changes:
26| Date: Comment:
27| ----- --------
28| 14-Jan-97 Created for ElPaso pass 1 MPT
29| 13-May-97 Added function prototype and global variables MPT
30| 08-Dec-98 Added RAW IR task information MPT
31| 19-Jan-99 Port to Romeo MPT
32| 19-May-00 Changed SDRAM to 32MB contiguous 0x1F000000 - 0x20FFFFFF RLB
33+----------------------------------------------------------------------------*/
34
35#ifndef _stb_h_
36#define _stb_h_
37
38/*----------------------------------------------------------------------------+
39| Read/write from I/O macros.
40+----------------------------------------------------------------------------*/
41#define inbyte(port) (*((unsigned char volatile *)(port)))
42#define outbyte(port,data) *(unsigned char volatile *)(port)=\
43 (unsigned char)(data)
44
45#define inshort(port) (*((unsigned short volatile *)(port)))
46#define outshort(port,data) *(unsigned short volatile *)(port)=\
47 (unsigned short)(data)
48
49#define inword(port) (*((unsigned long volatile *)(port)))
50#define outword(port,data) *(unsigned long volatile *)(port)=\
51 (unsigned long)(data)
52
53/*----------------------------------------------------------------------------+
54| STB interrupts.
55+----------------------------------------------------------------------------*/
56#define STB_XP_TP_INT 0
57#define STB_XP_APP_INT 1
58#define STB_AUD_INT 2
59#define STB_VID_INT 3
60#define STB_DMA0_INT 4
61#define STB_DMA1_INT 5
62#define STB_DMA2_INT 6
63#define STB_DMA3_INT 7
64#define STB_SCI_INT 8
65#define STB_I2C1_INT 9
66#define STB_I2C2_INT 10
67#define STB_GPT_PWM0 11
68#define STB_GPT_PWM1 12
69#define STB_SCP_INT 13
70#define STB_SSP_INT 14
71#define STB_GPT_PWM2 15
72#define STB_EXT5_INT 16
73#define STB_EXT6_INT 17
74#define STB_EXT7_INT 18
75#define STB_EXT8_INT 19
76#define STB_SCC_INT 20
77#define STB_SICC_RECV_INT 21
78#define STB_SICC_TRAN_INT 22
79#define STB_PPU_INT 23
80#define STB_DCRX_INT 24
81#define STB_EXT0_INT 25
82#define STB_EXT1_INT 26
83#define STB_EXT2_INT 27
84#define STB_EXT3_INT 28
85#define STB_EXT4_INT 29
86#define STB_REDWOOD_ENET_INT STB_EXT1_INT
87
88/*----------------------------------------------------------------------------+
89| STB tasks, task stack sizes, and task priorities. The actual task priority
90| is 1 more than the specified number since priority 0 is reserved (system
91| internally adds 1 to supplied priority number).
92+----------------------------------------------------------------------------*/
93#define STB_IDLE_TASK_SS (5* 1024)
94#define STB_IDLE_TASK_PRIO 0
95#define STB_LEDTEST_SS (2* 1024)
96#define STB_LEDTEST_PRIO 0
97#define STB_CURSOR_TASK_SS (10* 1024)
98#define STB_CURSOR_TASK_PRIO 7
99#define STB_MPEG_TASK_SS (10* 1024)
100#define STB_MPEG_TASK_PRIO 9
101#define STB_DEMUX_TASK_SS (10* 1024)
102#define STB_DEMUX_TASK_PRIO 20
103#define RAW_STB_IR_TASK_SS (10* 1024)
104#define RAW_STB_IR_TASK_PRIO 20
105
106#define STB_SERIAL_ER_TASK_SS (10* 1024)
107#define STB_SERIAL_ER_TASK_PRIO 1
108#define STB_CA_TASK_SS (10* 1024)
109#define STB_CA_TASK_PRIO 8
110
111#define INIT_DEFAULT_VIDEO_SS (10* 1024)
112#define INIT_DEFAULT_VIDEO_PRIO 8
113#define INIT_DEFAULT_SERVI_SS (10* 1024)
114#define INIT_DEFAULT_SERVI_PRIO 8
115#define INIT_DEFAULT_POST_SS (10* 1024)
116#define INIT_DEFAULT_POST_PRIO 8
117#define INIT_DEFAULT_INTER_SS (10* 1024)
118#define INIT_DEFAULT_INTER_PRIO 8
119#define INIT_DEFAULT_BR_SS (10* 1024)
120#define INIT_DEFAULT_BR_PRIO 8
121#define INITIAL_TASK_STACK_SIZE (32* 1024)
122
123#ifdef VESTA
124/*----------------------------------------------------------------------------+
125| Vesta Overall Address Map (all addresses are double mapped, bit 0 of the
126| address is not decoded. Numbers below are dependent on board configuration.
127| FLASH, SDRAM, DRAM numbers can be affected by actual board setup.
128|
129| FFE0,0000 - FFFF,FFFF FLASH
130| F200,0000 - F210,FFFF FPGA logic
131| Ethernet = F200,0000
132| LED Display = F200,0100
133| Xilinx #1 Regs = F204,0000
134| Xilinx #2 Regs = F208,0000
135| Spare = F20C,0000
136| IDE CS0 = F210,0000
137| F410,0000 - F410,FFFF IDE CS1
138| C000,0000 - C7FF,FFFF OBP
139| C000,0000 - C000,0014 SICC (16550 + infra red)
140| C001,0000 - C001,0018 PPU (Parallel Port)
141| C002,0000 - C002,001B SC0 (Smart Card 0)
142| C003,0000 - C003,000F I2C0
143| C004,0000 - C004,0009 SCC (16550 UART)
144| C005,0000 - C005,0124 GPT (Timers)
145| C006,0000 - C006,0058 GPIO0
146| C007,0000 - C007,001b SC1 (Smart Card 1)
147| C008,0000 - C008,FFFF Unused
148| C009,0000 - C009,FFFF Unused
149| C00A,0000 - C00A,FFFF Unused
150| C00B,0000 - C00B,000F I2C1
151| C00C,0000 - C00C,0006 SCP
152| C00D,0000 - C00D,0010 SSP
153| A000,0000 - A0FF,FFFF SDRAM1 (16M)
154| 0000,0000 - 00FF,FFFF SDRAM0 (16M)
155+----------------------------------------------------------------------------*/
156#define STB_FLASH_BASE_ADDRESS 0xFFE00000
157#define STB_FPGA_BASE_ADDRESS 0xF2000000
158#define STB_SICC_BASE_ADDRESS 0xC0000000
159#define STB_PPU_BASE_ADDR 0xC0010000
160#define STB_SC0_BASE_ADDRESS 0xC0020000
161#define STB_I2C1_BASE_ADDRESS 0xC0030000
162#define STB_SCC_BASE_ADDRESS 0xC0040000
163#define STB_TIMERS_BASE_ADDRESS 0xC0050000
164#define STB_GPIO0_BASE_ADDRESS 0xC0060000
165#define STB_SC1_BASE_ADDRESS 0xC0070000
166#define STB_I2C2_BASE_ADDRESS 0xC00B0000
167#define STB_SCP_BASE_ADDRESS 0xC00C0000
168#define STB_SSP_BASE_ADDRESS 0xC00D0000
169/*----------------------------------------------------------------------------+
170|The following are used by the IBM RTOS SW.
171|15-May-00 Changed these values to reflect movement of base addresses in
172|order to support 32MB of contiguous SDRAM space.
173|Points to the cacheable region since these values are used in IBM RTOS
174|to establish the vector address.
175+----------------------------------------------------------------------------*/
176#define STB_SDRAM1_BASE_ADDRESS 0x20000000
177#define STB_SDRAM1_SIZE 0x01000000
178#define STB_SDRAM0_BASE_ADDRESS 0x1F000000
179#define STB_SDRAM0_SIZE 0x01000000
180
181#else
182/*----------------------------------------------------------------------------+
183| ElPaso Overall Address Map (all addresses are double mapped, bit 0 of the
184| address is not decoded. Numbers below are dependent on board configuration.
185| FLASH, SDRAM, DRAM numbers can be affected by actual board setup. OPB
186| devices are inside the ElPaso chip.
187| FFE0,0000 - FFFF,FFFF FLASH
188| F144,0000 - F104,FFFF FPGA logic
189| F140,0000 - F100,0000 ethernet (through FPGA logic)
190| C000,0000 - C7FF,FFFF OBP
191| C000,0000 - C000,0014 SICC (16550+ infra red)
192| C001,0000 - C001,0016 PPU (parallel port)
193| C002,0000 - C002,001B SC (smart card)
194| C003,0000 - C003,000F I2C 1
195| C004,0000 - C004,0009 SCC (16550 UART)
196| C005,0000 - C005,0124 Timers
197| C006,0000 - C006,0058 GPIO0
198| C007,0000 - C007,0058 GPIO1
199| C008,0000 - C008,0058 GPIO2
200| C009,0000 - C009,0058 GPIO3
201| C00A,0000 - C00A,0058 GPIO4
202| C00B,0000 - C00B,000F I2C 2
203| C00C,0000 - C00C,0006 SCP
204| C00D,0000 - C00D,0006 SSP
205| A000,0000 - A0FF,FFFF SDRAM 16M
206| 0000,0000 - 00FF,FFFF DRAM 16M
207+----------------------------------------------------------------------------*/
208#define STB_FLASH_BASE_ADDRESS 0xFFE00000
209#define STB_FPGA_BASE_ADDRESS 0xF1440000
210#define STB_ENET_BASE_ADDRESS 0xF1400000
211#define STB_SICC_BASE_ADDRESS 0xC0000000
212#define STB_PPU_BASE_ADDR 0xC0010000
213#define STB_SC_BASE_ADDRESS 0xC0020000
214#define STB_I2C1_BASE_ADDRESS 0xC0030000
215#define STB_SCC_BASE_ADDRESS 0xC0040000
216#define STB_TIMERS_BASE_ADDRESS 0xC0050000
217#define STB_GPIO0_BASE_ADDRESS 0xC0060000
218#define STB_GPIO1_BASE_ADDRESS 0xC0070000
219#define STB_GPIO2_BASE_ADDRESS 0xC0080000
220#define STB_GPIO3_BASE_ADDRESS 0xC0090000
221#define STB_GPIO4_BASE_ADDRESS 0xC00A0000
222#define STB_I2C2_BASE_ADDRESS 0xC00B0000
223#define STB_SCP_BASE_ADDRESS 0xC00C0000
224#define STB_SSP_BASE_ADDRESS 0xC00D0000
225#define STB_SDRAM_BASE_ADDRESS 0xA0000000
226#endif
227
228/*----------------------------------------------------------------------------+
229| Other common defines.
230+----------------------------------------------------------------------------*/
231#ifndef TRUE
232#define TRUE 1
233#endif
234
235#ifndef FALSE
236#define FALSE 0
237#endif
238
239#endif /* _stb_h_ */
diff --git a/arch/ppc/boot/simple/uartlite_tty.c b/arch/ppc/boot/simple/uartlite_tty.c
deleted file mode 100644
index ca1743e3e912..000000000000
--- a/arch/ppc/boot/simple/uartlite_tty.c
+++ /dev/null
@@ -1,45 +0,0 @@
1/*
2 * Xilinx UARTLITE bootloader driver
3 *
4 * Copyright (c) 2007 Secret Lab Technologies Ltd.
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version.
10 */
11
12#include <linux/types.h>
13#include <asm/serial.h>
14#include <asm/io.h>
15#include <platforms/4xx/xparameters/xparameters.h>
16
17#define UARTLITE_BASEADDR ((void*)(XPAR_UARTLITE_0_BASEADDR))
18
19unsigned long
20serial_init(int chan, void *ignored)
21{
22 /* Clear the RX FIFO */
23 out_be32(UARTLITE_BASEADDR + 0x0C, 0x2);
24 return 0;
25}
26
27void
28serial_putc(unsigned long com_port, unsigned char c)
29{
30 while ((in_be32(UARTLITE_BASEADDR + 0x8) & 0x08) != 0); /* spin */
31 out_be32(UARTLITE_BASEADDR + 0x4, c);
32}
33
34unsigned char
35serial_getc(unsigned long com_port)
36{
37 while ((in_be32(UARTLITE_BASEADDR + 0x8) & 0x01) == 0); /* spin */
38 return in_be32(UARTLITE_BASEADDR);
39}
40
41int
42serial_tstc(unsigned long com_port)
43{
44 return ((in_be32(UARTLITE_BASEADDR + 0x8) & 0x01) != 0);
45}
diff --git a/arch/ppc/boot/utils/.gitignore b/arch/ppc/boot/utils/.gitignore
deleted file mode 100644
index bbdfb3b9c532..000000000000
--- a/arch/ppc/boot/utils/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
1mkprep
2mkbugboot
3mktree
diff --git a/arch/ppc/boot/utils/elf.pl b/arch/ppc/boot/utils/elf.pl
deleted file mode 100644
index d3e9d9d5b84e..000000000000
--- a/arch/ppc/boot/utils/elf.pl
+++ /dev/null
@@ -1,33 +0,0 @@
1#
2# ELF header field numbers
3#
4
5$e_ident = 0; # Identification bytes / magic number
6$e_type = 1; # ELF file type
7$e_machine = 2; # Target machine type
8$e_version = 3; # File version
9$e_entry = 4; # Start address
10$e_phoff = 5; # Program header file offset
11$e_shoff = 6; # Section header file offset
12$e_flags = 7; # File flags
13$e_ehsize = 8; # Size of ELF header
14$e_phentsize = 9; # Size of program header
15$e_phnum = 10; # Number of program header entries
16$e_shentsize = 11; # Size of section header
17$e_shnum = 12; # Number of section header entries
18$e_shstrndx = 13; # Section header table string index
19
20#
21# Section header field numbers
22#
23
24$sh_name = 0; # Section name
25$sh_type = 1; # Section header type
26$sh_flags = 2; # Section header flags
27$sh_addr = 3; # Virtual address
28$sh_offset = 4; # File offset
29$sh_size = 5; # Section size
30$sh_link = 6; # Miscellaneous info
31$sh_info = 7; # More miscellaneous info
32$sh_addralign = 8; # Memory alignment
33$sh_entsize = 9; # Entry size if this is a table
diff --git a/arch/ppc/boot/utils/mkbugboot.c b/arch/ppc/boot/utils/mkbugboot.c
deleted file mode 100644
index 1640c4199ca6..000000000000
--- a/arch/ppc/boot/utils/mkbugboot.c
+++ /dev/null
@@ -1,147 +0,0 @@
1/*
2 * Makes a Motorola PPCBUG ROM bootable image which can be flashed
3 * into one of the FLASH banks on a Motorola PowerPlus board.
4 *
5 * Author: Matt Porter <mporter@mvista.com>
6 *
7 * 2001 (c) MontaVista, Software, Inc. This file is licensed under
8 * the terms of the GNU General Public License version 2. This program
9 * is licensed "as is" without any warranty of any kind, whether express
10 * or implied.
11 */
12
13#define ELF_HEADER_SIZE 65536
14
15#include <unistd.h>
16#include <sys/stat.h>
17#include <string.h>
18#include <stdio.h>
19#include <stdlib.h>
20#include <errno.h>
21#include <fcntl.h>
22#include <netinet/in.h>
23#ifdef __sun__
24#include <inttypes.h>
25#else
26#include <stdint.h>
27#endif
28
29/* size of read buffer */
30#define SIZE 0x1000
31
32/* PPCBUG ROM boot header */
33typedef struct bug_boot_header {
34 uint8_t magic_word[4]; /* "BOOT" */
35 uint32_t entry_offset; /* Offset from top of header to code */
36 uint32_t routine_length; /* Length of code */
37 uint8_t routine_name[8]; /* Name of the boot code */
38} bug_boot_header_t;
39
40#define HEADER_SIZE sizeof(bug_boot_header_t)
41
42void update_checksum(void *buf, size_t size, uint16_t *sum)
43{
44 uint32_t csum = *sum;
45
46 while (size) {
47 csum += *(uint16_t *)buf;
48 if (csum > 0xffff)
49 csum -= 0xffff;
50 buf = (uint16_t *)buf + 1;
51 size -= 2;
52 }
53 *sum = csum;
54}
55
56uint32_t copy_image(int in_fd, int out_fd, uint16_t *sum)
57{
58 uint8_t buf[SIZE];
59 int offset = 0;
60 int n;
61 uint32_t image_size = 0;
62
63 lseek(in_fd, ELF_HEADER_SIZE, SEEK_SET);
64
65 /* Copy an image while recording its size */
66 while ( (n = read(in_fd, buf + offset, SIZE - offset)) > 0 ) {
67 n += offset;
68 offset = n & 1;
69 n -= offset;
70 image_size = image_size + n;
71 /* who's going to deal with short writes? */
72 write(out_fd, buf, n);
73 update_checksum(buf, n, sum);
74 if (offset)
75 buf[0] = buf[n];
76 }
77
78 /* BUG romboot requires that our size is divisible by 2 */
79 /* align image to 2 byte boundary */
80 if (offset) {
81 image_size += 2;
82 buf[1] = '\0';
83 write(out_fd, buf, 2);
84 update_checksum(buf, 2, sum);
85 }
86 return image_size;
87}
88
89void write_bugboot_header(int out_fd, uint32_t boot_size, uint16_t *sum)
90{
91 static bug_boot_header_t bbh = {
92 .magic_word = "BOOT",
93 .routine_name = "LINUXROM"
94 };
95
96 /* Fill in the PPCBUG ROM boot header */
97 bbh.entry_offset = htonl(HEADER_SIZE); /* Entry address */
98 bbh.routine_length= htonl(HEADER_SIZE+boot_size+2); /* Routine length */
99
100 /* Output the header and bootloader to the file */
101 write(out_fd, &bbh, sizeof(bug_boot_header_t));
102 update_checksum(&bbh, sizeof(bug_boot_header_t), sum);
103}
104
105int main(int argc, char *argv[])
106{
107 int image_fd, bugboot_fd;
108 uint32_t kernel_size = 0;
109 uint16_t checksum = 0;
110
111 if (argc != 3) {
112 fprintf(stderr, "usage: %s <kernel_image> <bugboot>\n",argv[0]);
113 exit(-1);
114 }
115
116 /* Get file args */
117
118 /* kernel image file */
119 if ((image_fd = open(argv[1] , 0)) < 0)
120 exit(-1);
121
122 /* bugboot file */
123 if (!strcmp(argv[2], "-"))
124 bugboot_fd = 1; /* stdout */
125 else if ((bugboot_fd = creat(argv[2] , 0755)) < 0)
126 exit(-1);
127
128 /* Set file position after ROM header block where zImage will be written */
129 lseek(bugboot_fd, HEADER_SIZE, SEEK_SET);
130
131 /* Copy kernel image into bugboot image */
132 kernel_size = copy_image(image_fd, bugboot_fd, &checksum);
133
134 /* Set file position to beginning where header/romboot will be written */
135 lseek(bugboot_fd, 0, SEEK_SET);
136
137 /* Write out BUG header/romboot */
138 write_bugboot_header(bugboot_fd, kernel_size, &checksum);
139
140 /* Write out the calculated checksum */
141 lseek(bugboot_fd, 0, SEEK_END);
142 write(bugboot_fd, &checksum, 2);
143
144 /* Close bugboot file */
145 close(bugboot_fd);
146 return 0;
147}
diff --git a/arch/ppc/boot/utils/mkprep.c b/arch/ppc/boot/utils/mkprep.c
deleted file mode 100644
index 192bb397126f..000000000000
--- a/arch/ppc/boot/utils/mkprep.c
+++ /dev/null
@@ -1,241 +0,0 @@
1/*
2 * Makes a prep bootable image which can be dd'd onto
3 * a disk device to make a bootdisk. Will take
4 * as input a elf executable, strip off the header
5 * and write out a boot image as:
6 * 1) default - strips elf header
7 * suitable as a network boot image
8 * 2) -pbp - strips elf header and writes out prep boot partition image
9 * cat or dd onto disk for booting
10 * 3) -asm - strips elf header and writes out as asm data
11 * useful for generating data for a compressed image
12 * -- Cort
13 *
14 * Modified for x86 hosted builds by Matt Porter <porter@neta.com>
15 * Modified for Sparc hosted builds by Peter Wahl <PeterWahl@web.de>
16 */
17
18#include <stdio.h>
19#include <string.h>
20#include <stdlib.h>
21
22/* size of read buffer */
23#define SIZE 0x1000
24
25/*
26 * Partition table entry
27 * - from the PReP spec
28 */
29typedef struct partition_entry {
30 unsigned char boot_indicator;
31 unsigned char starting_head;
32 unsigned char starting_sector;
33 unsigned char starting_cylinder;
34
35 unsigned char system_indicator;
36 unsigned char ending_head;
37 unsigned char ending_sector;
38 unsigned char ending_cylinder;
39
40 unsigned char beginning_sector[4];
41 unsigned char number_of_sectors[4];
42} partition_entry_t;
43
44#define BootActive 0x80
45#define SystemPrep 0x41
46
47void copy_image(FILE *, FILE *);
48void write_prep_partition(FILE *, FILE *);
49void write_asm_data(FILE *, FILE *);
50
51unsigned int elfhdr_size = 65536;
52
53int main(int argc, char *argv[])
54{
55 FILE *in, *out;
56 int argptr = 1;
57 int prep = 0;
58 int asmoutput = 0;
59
60 if (argc < 3 || argc > 4) {
61 fprintf(stderr, "usage: %s [-pbp] [-asm] <boot-file> <image>\n",
62 argv[0]);
63 exit(-1);
64 }
65
66/* needs to handle args more elegantly -- but this is a small/simple program */
67
68 /* check for -pbp */
69 if (!strcmp(argv[argptr], "-pbp")) {
70 prep = 1;
71 argptr++;
72 }
73
74 /* check for -asm */
75 if (!strcmp(argv[argptr], "-asm")) {
76 asmoutput = 1;
77 argptr++;
78 }
79
80 /* input file */
81 if (!strcmp(argv[argptr], "-"))
82 in = stdin;
83 else if (!(in = fopen(argv[argptr], "r")))
84 exit(-1);
85 argptr++;
86
87 /* output file */
88 if (!strcmp(argv[argptr], "-"))
89 out = stdout;
90 else if (!(out = fopen(argv[argptr], "w")))
91 exit(-1);
92 argptr++;
93
94 /* skip elf header in input file */
95 /*if ( !prep )*/
96 fseek(in, elfhdr_size, SEEK_SET);
97
98 /* write prep partition if necessary */
99 if (prep)
100 write_prep_partition(in, out);
101
102 /* write input image to bootimage */
103 if (asmoutput)
104 write_asm_data(in, out);
105 else
106 copy_image(in, out);
107
108 return 0;
109}
110
111void store_le32(unsigned int v, unsigned char *p)
112{
113 p[0] = v;
114 p[1] = v >>= 8;
115 p[2] = v >>= 8;
116 p[3] = v >> 8;
117}
118
119void write_prep_partition(FILE *in, FILE *out)
120{
121 unsigned char block[512];
122 partition_entry_t pe;
123 unsigned char *entry = block;
124 unsigned char *length = block + 4;
125 long pos = ftell(in), size;
126
127 if (fseek(in, 0, SEEK_END) < 0) {
128 fprintf(stderr,"info failed\n");
129 exit(-1);
130 }
131 size = ftell(in);
132 if (fseek(in, pos, SEEK_SET) < 0) {
133 fprintf(stderr,"info failed\n");
134 exit(-1);
135 }
136
137 memset(block, '\0', sizeof(block));
138
139 /* set entry point and boot image size skipping over elf header */
140 store_le32(0x400/*+65536*/, entry);
141 store_le32(size-elfhdr_size+0x400, length);
142
143 /* sets magic number for msdos partition (used by linux) */
144 block[510] = 0x55;
145 block[511] = 0xAA;
146
147 /*
148 * Build a "PReP" partition table entry in the boot record
149 * - "PReP" may only look at the system_indicator
150 */
151 pe.boot_indicator = BootActive;
152 pe.system_indicator = SystemPrep;
153 /*
154 * The first block of the diskette is used by this "boot record" which
155 * actually contains the partition table. (The first block of the
156 * partition contains the boot image, but I digress...) We'll set up
157 * one partition on the diskette and it shall contain the rest of the
158 * diskette.
159 */
160 pe.starting_head = 0; /* zero-based */
161 pe.starting_sector = 2; /* one-based */
162 pe.starting_cylinder = 0; /* zero-based */
163 pe.ending_head = 1; /* assumes two heads */
164 pe.ending_sector = 18; /* assumes 18 sectors/track */
165 pe.ending_cylinder = 79; /* assumes 80 cylinders/diskette */
166
167 /*
168 * The "PReP" software ignores the above fields and just looks at
169 * the next two.
170 * - size of the diskette is (assumed to be)
171 * (2 tracks/cylinder)(18 sectors/tracks)(80 cylinders/diskette)
172 * - unlike the above sector numbers, the beginning sector is zero-based!
173 */
174#if 0
175 store_le32(1, pe.beginning_sector);
176#else
177 /* This has to be 0 on the PowerStack? */
178 store_le32(0, pe.beginning_sector);
179#endif
180
181 store_le32(2*18*80-1, pe.number_of_sectors);
182
183 memcpy(&block[0x1BE], &pe, sizeof(pe));
184
185 fwrite(block, sizeof(block), 1, out);
186 fwrite(entry, 4, 1, out);
187 fwrite(length, 4, 1, out);
188 /* set file position to 2nd sector where image will be written */
189 fseek( out, 0x400, SEEK_SET );
190}
191
192
193
194void copy_image(FILE *in, FILE *out)
195{
196 char buf[SIZE];
197 int n;
198
199 while ( (n = fread(buf, 1, SIZE, in)) > 0 )
200 fwrite(buf, 1, n, out);
201}
202
203
204void
205write_asm_data(FILE *in, FILE *out)
206{
207 int i, cnt, pos = 0;
208 unsigned int cksum = 0, val;
209 unsigned char *lp;
210 unsigned char buf[SIZE];
211 size_t len;
212
213 fputs("\t.data\n\t.globl input_data\ninput_data:\n", out);
214 while ((len = fread(buf, 1, sizeof(buf), in)) > 0) {
215 cnt = 0;
216 lp = buf;
217 /* Round up to longwords */
218 while (len & 3)
219 buf[len++] = '\0';
220 for (i = 0; i < len; i += 4) {
221 if (cnt == 0)
222 fputs("\t.long\t", out);
223 fprintf(out, "0x%02X%02X%02X%02X",
224 lp[0], lp[1], lp[2], lp[3]);
225 val = *(unsigned long *)lp;
226 cksum ^= val;
227 lp += 4;
228 if (++cnt == 4) {
229 cnt = 0;
230 fprintf(out, " # %x \n", pos+i-12);
231 } else {
232 fputs(",", out);
233 }
234 }
235 if (cnt)
236 fputs("0\n", out);
237 pos += len;
238 }
239 fprintf(out, "\t.globl input_len\ninput_len:\t.long\t0x%x\n", pos);
240 fprintf(stderr, "cksum = %x\n", cksum);
241}
diff --git a/arch/ppc/boot/utils/mktree.c b/arch/ppc/boot/utils/mktree.c
deleted file mode 100644
index 2be22e28f2b3..000000000000
--- a/arch/ppc/boot/utils/mktree.c
+++ /dev/null
@@ -1,152 +0,0 @@
1/*
2 * Makes a tree bootable image for IBM Evaluation boards.
3 * Basically, just take a zImage, skip the ELF header, and stuff
4 * a 32 byte header on the front.
5 *
6 * We use htonl, which is a network macro, to make sure we're doing
7 * The Right Thing on an LE machine. It's non-obvious, but it should
8 * work on anything BSD'ish.
9 */
10
11#include <fcntl.h>
12#include <stdio.h>
13#include <stdlib.h>
14#include <string.h>
15#include <sys/stat.h>
16#include <unistd.h>
17#include <netinet/in.h>
18#ifdef __sun__
19#include <inttypes.h>
20#else
21#include <stdint.h>
22#endif
23
24/* This gets tacked on the front of the image. There are also a few
25 * bytes allocated after the _start label used by the boot rom (see
26 * head.S for details).
27 */
28typedef struct boot_block {
29 uint32_t bb_magic; /* 0x0052504F */
30 uint32_t bb_dest; /* Target address of the image */
31 uint32_t bb_num_512blocks; /* Size, rounded-up, in 512 byte blks */
32 uint32_t bb_debug_flag; /* Run debugger or image after load */
33 uint32_t bb_entry_point; /* The image address to start */
34 uint32_t bb_checksum; /* 32 bit checksum including header */
35 uint32_t reserved[2];
36} boot_block_t;
37
38#define IMGBLK 512
39char tmpbuf[IMGBLK];
40
41int main(int argc, char *argv[])
42{
43 int in_fd, out_fd;
44 int nblks, i;
45 uint cksum, *cp;
46 struct stat st;
47 boot_block_t bt;
48
49 if (argc < 3) {
50 fprintf(stderr, "usage: %s <zImage-file> <boot-image> [entry-point]\n",argv[0]);
51 exit(1);
52 }
53
54 if (stat(argv[1], &st) < 0) {
55 perror("stat");
56 exit(2);
57 }
58
59 nblks = (st.st_size + IMGBLK) / IMGBLK;
60
61 bt.bb_magic = htonl(0x0052504F);
62
63 /* If we have the optional entry point parameter, use it */
64 if (argc == 4)
65 bt.bb_dest = bt.bb_entry_point = htonl(strtoul(argv[3], NULL, 0));
66 else
67 bt.bb_dest = bt.bb_entry_point = htonl(0x500000);
68
69 /* We know these from the linker command.
70 * ...and then move it up into memory a little more so the
71 * relocation can happen.
72 */
73 bt.bb_num_512blocks = htonl(nblks);
74 bt.bb_debug_flag = 0;
75
76 bt.bb_checksum = 0;
77
78 /* To be neat and tidy :-).
79 */
80 bt.reserved[0] = 0;
81 bt.reserved[1] = 0;
82
83 if ((in_fd = open(argv[1], O_RDONLY)) < 0) {
84 perror("zImage open");
85 exit(3);
86 }
87
88 if ((out_fd = open(argv[2], (O_RDWR | O_CREAT | O_TRUNC), 0666)) < 0) {
89 perror("bootfile open");
90 exit(3);
91 }
92
93 cksum = 0;
94 cp = (void *)&bt;
95 for (i=0; i<sizeof(bt)/sizeof(uint); i++)
96 cksum += *cp++;
97
98 /* Assume zImage is an ELF file, and skip the 64K header.
99 */
100 if (read(in_fd, tmpbuf, IMGBLK) != IMGBLK) {
101 fprintf(stderr, "%s is too small to be an ELF image\n",
102 argv[1]);
103 exit(4);
104 }
105
106 if ((*(uint *)tmpbuf) != htonl(0x7f454c46)) {
107 fprintf(stderr, "%s is not an ELF image\n", argv[1]);
108 exit(4);
109 }
110
111 if (lseek(in_fd, (64 * 1024), SEEK_SET) < 0) {
112 fprintf(stderr, "%s failed to seek in ELF image\n", argv[1]);
113 exit(4);
114 }
115
116 nblks -= (64 * 1024) / IMGBLK;
117
118 /* And away we go......
119 */
120 if (write(out_fd, &bt, sizeof(bt)) != sizeof(bt)) {
121 perror("boot-image write");
122 exit(5);
123 }
124
125 while (nblks-- > 0) {
126 if (read(in_fd, tmpbuf, IMGBLK) < 0) {
127 perror("zImage read");
128 exit(5);
129 }
130 cp = (uint *)tmpbuf;
131 for (i=0; i<sizeof(tmpbuf)/sizeof(uint); i++)
132 cksum += *cp++;
133 if (write(out_fd, tmpbuf, sizeof(tmpbuf)) != sizeof(tmpbuf)) {
134 perror("boot-image write");
135 exit(5);
136 }
137 }
138
139 /* rewrite the header with the computed checksum.
140 */
141 bt.bb_checksum = htonl(cksum);
142 if (lseek(out_fd, 0, SEEK_SET) < 0) {
143 perror("rewrite seek");
144 exit(1);
145 }
146 if (write(out_fd, &bt, sizeof(bt)) != sizeof(bt)) {
147 perror("boot-image rewrite");
148 exit(1);
149 }
150
151 exit(0);
152}
diff --git a/arch/ppc/configs/FADS_defconfig b/arch/ppc/configs/FADS_defconfig
deleted file mode 100644
index c1934f828a4b..000000000000
--- a/arch/ppc/configs/FADS_defconfig
+++ /dev/null
@@ -1,520 +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
7
8#
9# Code maturity level options
10#
11CONFIG_EXPERIMENTAL=y
12
13#
14# General setup
15#
16CONFIG_SWAP=y
17CONFIG_SYSVIPC=y
18# CONFIG_BSD_PROCESS_ACCT is not set
19CONFIG_SYSCTL=y
20CONFIG_LOG_BUF_SHIFT=14
21CONFIG_EMBEDDED=y
22CONFIG_FUTEX=y
23# CONFIG_EPOLL is not set
24
25#
26# Loadable module support
27#
28CONFIG_MODULES=y
29CONFIG_MODULE_UNLOAD=y
30# CONFIG_MODULE_FORCE_UNLOAD is not set
31CONFIG_OBSOLETE_MODPARM=y
32# CONFIG_MODVERSIONS is not set
33CONFIG_KMOD=y
34
35#
36# Platform support
37#
38CONFIG_PPC=y
39CONFIG_PPC32=y
40# CONFIG_6xx is not set
41# CONFIG_40x is not set
42# CONFIG_POWER3 is not set
43CONFIG_8xx=y
44
45#
46# IBM 4xx options
47#
48CONFIG_EMBEDDEDBOOT=y
49CONFIG_SERIAL_CONSOLE=y
50CONFIG_NOT_COHERENT_CACHE=y
51# CONFIG_RPXLITE is not set
52# CONFIG_RPXCLASSIC is not set
53# CONFIG_BSEIP is not set
54CONFIG_FADS=y
55# CONFIG_TQM823L is not set
56# CONFIG_TQM850L is not set
57# CONFIG_TQM855L is not set
58# CONFIG_TQM860L is not set
59# CONFIG_FPS850L is not set
60# CONFIG_SPD823TS is not set
61# CONFIG_IVMS8 is not set
62# CONFIG_IVML24 is not set
63# CONFIG_SM850 is not set
64# CONFIG_HERMES_PRO is not set
65# CONFIG_IP860 is not set
66# CONFIG_LWMON is not set
67# CONFIG_PCU_E is not set
68# CONFIG_CCM is not set
69# CONFIG_LANTEC is not set
70# CONFIG_MBX is not set
71# CONFIG_WINCEPT is not set
72# CONFIG_SMP is not set
73# CONFIG_PREEMPT is not set
74CONFIG_MATH_EMULATION=y
75# CONFIG_CPU_FREQ is not set
76
77#
78# General setup
79#
80# CONFIG_HIGHMEM is not set
81# CONFIG_PCI is not set
82# CONFIG_PCI_DOMAINS is not set
83# CONFIG_PCI_QSPAN is not set
84CONFIG_KCORE_ELF=y
85CONFIG_BINFMT_ELF=y
86CONFIG_KERNEL_ELF=y
87# CONFIG_BINFMT_MISC is not set
88# CONFIG_HOTPLUG is not set
89
90#
91# Parallel port support
92#
93# CONFIG_PARPORT is not set
94# CONFIG_CMDLINE_BOOL is not set
95
96#
97# Advanced setup
98#
99# CONFIG_ADVANCED_OPTIONS is not set
100
101#
102# Default settings for advanced configuration options are used
103#
104CONFIG_HIGHMEM_START=0xfe000000
105CONFIG_LOWMEM_SIZE=0x30000000
106CONFIG_KERNEL_START=0xc0000000
107CONFIG_TASK_SIZE=0x80000000
108CONFIG_BOOT_LOAD=0x00400000
109
110#
111# Memory Technology Devices (MTD)
112#
113# CONFIG_MTD is not set
114
115#
116# Plug and Play support
117#
118# CONFIG_PNP is not set
119
120#
121# Block devices
122#
123# CONFIG_BLK_DEV_FD is not set
124# CONFIG_BLK_DEV_LOOP is not set
125# CONFIG_BLK_DEV_NBD is not set
126# CONFIG_BLK_DEV_RAM is not set
127# CONFIG_BLK_DEV_INITRD is not set
128
129#
130# Multi-device support (RAID and LVM)
131#
132# CONFIG_MD is not set
133
134#
135# ATA/IDE/MFM/RLL support
136#
137# CONFIG_IDE is not set
138
139#
140# SCSI support
141#
142# CONFIG_SCSI is not set
143
144#
145# Fusion MPT device support
146#
147
148#
149# I2O device support
150#
151
152#
153# Networking support
154#
155CONFIG_NET=y
156
157#
158# Networking options
159#
160CONFIG_PACKET=y
161# CONFIG_PACKET_MMAP is not set
162# CONFIG_NETLINK_DEV is not set
163# CONFIG_NETFILTER is not set
164CONFIG_UNIX=y
165# CONFIG_NET_KEY is not set
166CONFIG_INET=y
167# CONFIG_IP_MULTICAST is not set
168# CONFIG_IP_ADVANCED_ROUTER is not set
169CONFIG_IP_PNP=y
170CONFIG_IP_PNP_DHCP=y
171CONFIG_IP_PNP_BOOTP=y
172# CONFIG_IP_PNP_RARP is not set
173# CONFIG_NET_IPIP is not set
174# CONFIG_NET_IPGRE is not set
175# CONFIG_ARPD is not set
176# CONFIG_INET_ECN is not set
177# CONFIG_SYN_COOKIES is not set
178# CONFIG_INET_AH is not set
179# CONFIG_INET_ESP is not set
180# CONFIG_INET_IPCOMP is not set
181# CONFIG_IPV6 is not set
182# CONFIG_XFRM_USER is not set
183
184#
185# SCTP Configuration (EXPERIMENTAL)
186#
187CONFIG_IPV6_SCTP__=y
188# CONFIG_IP_SCTP is not set
189# CONFIG_ATM is not set
190# CONFIG_VLAN_8021Q is not set
191# CONFIG_LLC is not set
192# CONFIG_DECNET is not set
193# CONFIG_BRIDGE is not set
194# CONFIG_X25 is not set
195# CONFIG_LAPB is not set
196# CONFIG_NET_DIVERT is not set
197# CONFIG_ECONET is not set
198# CONFIG_WAN_ROUTER is not set
199# CONFIG_NET_HW_FLOWCONTROL is not set
200
201#
202# QoS and/or fair queueing
203#
204# CONFIG_NET_SCHED is not set
205
206#
207# Network testing
208#
209# CONFIG_NET_PKTGEN is not set
210CONFIG_NETDEVICES=y
211# CONFIG_DUMMY is not set
212# CONFIG_BONDING is not set
213# CONFIG_EQUALIZER is not set
214# CONFIG_TUN is not set
215# CONFIG_ETHERTAP is not set
216
217#
218# Ethernet (10 or 100Mbit)
219#
220CONFIG_NET_ETHERNET=y
221# CONFIG_MII is not set
222# CONFIG_OAKNET is not set
223
224#
225# Ethernet (1000 Mbit)
226#
227
228#
229# Ethernet (10000 Mbit)
230#
231# CONFIG_PPP is not set
232# CONFIG_SLIP is not set
233
234#
235# Wireless LAN (non-hamradio)
236#
237# CONFIG_NET_RADIO is not set
238
239#
240# Token Ring devices (depends on LLC=y)
241#
242# CONFIG_SHAPER is not set
243
244#
245# Wan interfaces
246#
247# CONFIG_WAN is not set
248
249#
250# Amateur Radio support
251#
252# CONFIG_HAMRADIO is not set
253
254#
255# IrDA (infrared) support
256#
257# CONFIG_IRDA is not set
258
259#
260# ISDN subsystem
261#
262# CONFIG_ISDN_BOOL is not set
263
264#
265# Graphics support
266#
267# CONFIG_FB is not set
268
269#
270# Old CD-ROM drivers (not SCSI, not IDE)
271#
272# CONFIG_CD_NO_IDESCSI is not set
273
274#
275# Input device support
276#
277# CONFIG_INPUT is not set
278
279#
280# Userland interfaces
281#
282
283#
284# Input I/O drivers
285#
286# CONFIG_GAMEPORT is not set
287CONFIG_SOUND_GAMEPORT=y
288# CONFIG_SERIO is not set
289
290#
291# Input Device Drivers
292#
293
294#
295# Macintosh device drivers
296#
297
298#
299# Serial drivers
300#
301# CONFIG_SERIAL_8250 is not set
302
303#
304# Non-8250 serial port support
305#
306CONFIG_SERIAL_CORE=y
307CONFIG_SERIAL_CORE_CONSOLE=y
308CONFIG_SERIAL_CPM=y
309CONFIG_SERIAL_CPM_CONSOLE=y
310# CONFIG_SERIAL_CPM_SCC1 is not set
311# CONFIG_SERIAL_CPM_SCC2 is not set
312# CONFIG_SERIAL_CPM_SCC3 is not set
313# CONFIG_SERIAL_CPM_SCC4 is not set
314CONFIG_SERIAL_CPM_SMC1=y
315CONFIG_SERIAL_CPM_SMC2=y
316# CONFIG_SERIAL_CPM_ALT_SMC2 is not set
317CONFIG_UNIX98_PTYS=y
318# CONFIG_LEGACY_PTYS is not set
319
320#
321# I2C support
322#
323# CONFIG_I2C is not set
324
325#
326# I2C Hardware Sensors Mainboard support
327#
328
329#
330# I2C Hardware Sensors Chip support
331#
332# CONFIG_I2C_SENSOR is not set
333
334#
335# Mice
336#
337# CONFIG_BUSMOUSE is not set
338# CONFIG_QIC02_TAPE is not set
339
340#
341# IPMI
342#
343# CONFIG_IPMI_HANDLER is not set
344
345#
346# Watchdog Cards
347#
348# CONFIG_WATCHDOG is not set
349# CONFIG_NVRAM is not set
350CONFIG_GEN_RTC=y
351# CONFIG_GEN_RTC_X is not set
352# CONFIG_DTLK is not set
353# CONFIG_R3964 is not set
354# CONFIG_APPLICOM is not set
355
356#
357# Ftape, the floppy tape device driver
358#
359# CONFIG_FTAPE is not set
360# CONFIG_AGP is not set
361# CONFIG_DRM is not set
362# CONFIG_RAW_DRIVER is not set
363# CONFIG_HANGCHECK_TIMER is not set
364
365#
366# Multimedia devices
367#
368# CONFIG_VIDEO_DEV is not set
369
370#
371# Digital Video Broadcasting Devices
372#
373# CONFIG_DVB is not set
374
375#
376# File systems
377#
378# CONFIG_EXT2_FS is not set
379CONFIG_EXT3_FS=y
380CONFIG_EXT3_FS_XATTR=y
381# CONFIG_EXT3_FS_POSIX_ACL is not set
382# CONFIG_EXT3_FS_SECURITY is not set
383CONFIG_JBD=y
384# CONFIG_JBD_DEBUG is not set
385CONFIG_FS_MBCACHE=y
386# CONFIG_REISERFS_FS is not set
387# CONFIG_JFS_FS is not set
388# CONFIG_XFS_FS is not set
389# CONFIG_MINIX_FS is not set
390# CONFIG_ROMFS_FS is not set
391# CONFIG_QUOTA is not set
392# CONFIG_AUTOFS_FS is not set
393# CONFIG_AUTOFS4_FS is not set
394
395#
396# CD-ROM/DVD Filesystems
397#
398# CONFIG_ISO9660_FS is not set
399# CONFIG_UDF_FS is not set
400
401#
402# DOS/FAT/NT Filesystems
403#
404# CONFIG_FAT_FS is not set
405# CONFIG_NTFS_FS is not set
406
407#
408# Pseudo filesystems
409#
410CONFIG_PROC_FS=y
411# CONFIG_DEVFS_FS is not set
412CONFIG_DEVPTS_FS=y
413# CONFIG_DEVPTS_FS_XATTR is not set
414# CONFIG_TMPFS is not set
415CONFIG_RAMFS=y
416
417#
418# Miscellaneous filesystems
419#
420# CONFIG_ADFS_FS is not set
421# CONFIG_AFFS_FS is not set
422# CONFIG_HFS_FS is not set
423# CONFIG_BEFS_FS is not set
424# CONFIG_BFS_FS is not set
425# CONFIG_EFS_FS is not set
426# CONFIG_CRAMFS is not set
427# CONFIG_VXFS_FS is not set
428# CONFIG_HPFS_FS is not set
429# CONFIG_QNX4FS_FS is not set
430# CONFIG_SYSV_FS is not set
431# CONFIG_UFS_FS is not set
432
433#
434# Network File Systems
435#
436CONFIG_NFS_FS=y
437# CONFIG_NFS_V3 is not set
438# CONFIG_NFS_V4 is not set
439# CONFIG_NFSD is not set
440CONFIG_ROOT_NFS=y
441CONFIG_LOCKD=y
442# CONFIG_EXPORTFS is not set
443CONFIG_SUNRPC=y
444# CONFIG_SUNRPC_GSS is not set
445# CONFIG_SMB_FS is not set
446# CONFIG_CIFS is not set
447# CONFIG_NCP_FS is not set
448# CONFIG_CODA_FS is not set
449# CONFIG_INTERMEZZO_FS is not set
450# CONFIG_AFS_FS is not set
451
452#
453# Partition Types
454#
455CONFIG_PARTITION_ADVANCED=y
456# CONFIG_ACORN_PARTITION is not set
457# CONFIG_OSF_PARTITION is not set
458# CONFIG_AMIGA_PARTITION is not set
459# CONFIG_ATARI_PARTITION is not set
460# CONFIG_MAC_PARTITION is not set
461# CONFIG_MSDOS_PARTITION is not set
462# CONFIG_LDM_PARTITION is not set
463# CONFIG_NEC98_PARTITION is not set
464# CONFIG_SGI_PARTITION is not set
465# CONFIG_ULTRIX_PARTITION is not set
466# CONFIG_SUN_PARTITION is not set
467# CONFIG_EFI_PARTITION is not set
468
469#
470# Sound
471#
472# CONFIG_SOUND is not set
473
474#
475# MPC8xx CPM Options
476#
477CONFIG_SCC_ENET=y
478CONFIG_SCC1_ENET=y
479# CONFIG_SCC2_ENET is not set
480# CONFIG_SCC3_ENET is not set
481# CONFIG_FEC_ENET is not set
482CONFIG_ENET_BIG_BUFFERS=y
483
484#
485# Generic MPC8xx Options
486#
487CONFIG_8xx_COPYBACK=y
488# CONFIG_8xx_CPU6 is not set
489# CONFIG_UCODE_PATCH is not set
490
491#
492# USB support
493#
494# CONFIG_USB_GADGET is not set
495
496#
497# Bluetooth support
498#
499# CONFIG_BT is not set
500
501#
502# Library routines
503#
504# CONFIG_CRC32 is not set
505
506#
507# Kernel hacking
508#
509# CONFIG_DEBUG_KERNEL is not set
510# CONFIG_KALLSYMS is not set
511
512#
513# Security options
514#
515# CONFIG_SECURITY is not set
516
517#
518# Cryptographic options
519#
520# CONFIG_CRYPTO is not set
diff --git a/arch/ppc/configs/IVMS8_defconfig b/arch/ppc/configs/IVMS8_defconfig
deleted file mode 100644
index 66bbefe8e9b3..000000000000
--- a/arch/ppc/configs/IVMS8_defconfig
+++ /dev/null
@@ -1,548 +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
7
8#
9# Code maturity level options
10#
11CONFIG_EXPERIMENTAL=y
12
13#
14# General setup
15#
16CONFIG_SWAP=y
17CONFIG_SYSVIPC=y
18# CONFIG_BSD_PROCESS_ACCT is not set
19CONFIG_SYSCTL=y
20CONFIG_LOG_BUF_SHIFT=14
21CONFIG_EMBEDDED=y
22CONFIG_FUTEX=y
23# CONFIG_EPOLL is not set
24
25#
26# Loadable module support
27#
28CONFIG_MODULES=y
29CONFIG_MODULE_UNLOAD=y
30# CONFIG_MODULE_FORCE_UNLOAD is not set
31CONFIG_OBSOLETE_MODPARM=y
32# CONFIG_MODVERSIONS is not set
33CONFIG_KMOD=y
34
35#
36# Platform support
37#
38CONFIG_PPC=y
39CONFIG_PPC32=y
40# CONFIG_6xx is not set
41# CONFIG_40x is not set
42# CONFIG_POWER3 is not set
43CONFIG_8xx=y
44
45#
46# IBM 4xx options
47#
48CONFIG_EMBEDDEDBOOT=y
49CONFIG_SERIAL_CONSOLE=y
50CONFIG_NOT_COHERENT_CACHE=y
51# CONFIG_RPXLITE is not set
52# CONFIG_RPXCLASSIC is not set
53# CONFIG_BSEIP is not set
54# CONFIG_FADS is not set
55# CONFIG_TQM823L is not set
56# CONFIG_TQM850L is not set
57# CONFIG_TQM855L is not set
58# CONFIG_TQM860L is not set
59# CONFIG_FPS850L is not set
60# CONFIG_SPD823TS is not set
61CONFIG_IVMS8=y
62# CONFIG_IVML24 is not set
63# CONFIG_SM850 is not set
64# CONFIG_HERMES_PRO is not set
65# CONFIG_IP860 is not set
66# CONFIG_LWMON is not set
67# CONFIG_PCU_E is not set
68# CONFIG_CCM is not set
69# CONFIG_LANTEC is not set
70# CONFIG_MBX is not set
71# CONFIG_WINCEPT is not set
72# CONFIG_SMP is not set
73# CONFIG_PREEMPT is not set
74CONFIG_MATH_EMULATION=y
75# CONFIG_CPU_FREQ is not set
76
77#
78# General setup
79#
80# CONFIG_HIGHMEM is not set
81# CONFIG_PCI is not set
82# CONFIG_PCI_DOMAINS is not set
83# CONFIG_PCI_QSPAN is not set
84CONFIG_KCORE_ELF=y
85CONFIG_BINFMT_ELF=y
86CONFIG_KERNEL_ELF=y
87# CONFIG_BINFMT_MISC is not set
88# CONFIG_HOTPLUG is not set
89
90#
91# Parallel port support
92#
93# CONFIG_PARPORT is not set
94# CONFIG_CMDLINE_BOOL is not set
95
96#
97# Advanced setup
98#
99# CONFIG_ADVANCED_OPTIONS is not set
100
101#
102# Default settings for advanced configuration options are used
103#
104CONFIG_HIGHMEM_START=0xfe000000
105CONFIG_LOWMEM_SIZE=0x30000000
106CONFIG_KERNEL_START=0xc0000000
107CONFIG_TASK_SIZE=0x80000000
108CONFIG_BOOT_LOAD=0x00400000
109
110#
111# Memory Technology Devices (MTD)
112#
113# CONFIG_MTD is not set
114
115#
116# Plug and Play support
117#
118# CONFIG_PNP is not set
119
120#
121# Block devices
122#
123# CONFIG_BLK_DEV_FD is not set
124# CONFIG_BLK_DEV_LOOP is not set
125# CONFIG_BLK_DEV_NBD is not set
126# CONFIG_BLK_DEV_RAM is not set
127# CONFIG_BLK_DEV_INITRD is not set
128
129#
130# Multi-device support (RAID and LVM)
131#
132# CONFIG_MD is not set
133
134#
135# ATA/IDE/MFM/RLL support
136#
137CONFIG_IDE=y
138
139#
140# IDE, ATA and ATAPI Block devices
141#
142CONFIG_BLK_DEV_IDE=y
143
144#
145# Please see Documentation/ide.txt for help/info on IDE drives
146#
147# CONFIG_BLK_DEV_HD is not set
148CONFIG_BLK_DEV_IDEDISK=y
149CONFIG_IDEDISK_MULTI_MODE=y
150# CONFIG_IDEDISK_STROKE is not set
151CONFIG_BLK_DEV_IDECD=y
152# CONFIG_BLK_DEV_IDEFLOPPY is not set
153# CONFIG_IDE_TASK_IOCTL is not set
154
155#
156# IDE chipset support/bugfixes
157#
158CONFIG_BLK_DEV_MPC8xx_IDE=y
159CONFIG_IDE_8xx_PCCARD=y
160# CONFIG_IDE_8xx_DIRECT is not set
161# CONFIG_IDE_EXT_DIRECT is not set
162
163#
164# SCSI support
165#
166# CONFIG_SCSI is not set
167
168#
169# Fusion MPT device support
170#
171
172#
173# I2O device support
174#
175
176#
177# Networking support
178#
179CONFIG_NET=y
180
181#
182# Networking options
183#
184CONFIG_PACKET=y
185# CONFIG_PACKET_MMAP is not set
186# CONFIG_NETLINK_DEV is not set
187# CONFIG_NETFILTER is not set
188CONFIG_UNIX=y
189# CONFIG_NET_KEY is not set
190CONFIG_INET=y
191# CONFIG_IP_MULTICAST is not set
192# CONFIG_IP_ADVANCED_ROUTER is not set
193CONFIG_IP_PNP=y
194CONFIG_IP_PNP_DHCP=y
195# CONFIG_IP_PNP_BOOTP is not set
196# CONFIG_IP_PNP_RARP is not set
197# CONFIG_NET_IPIP is not set
198# CONFIG_NET_IPGRE is not set
199# CONFIG_ARPD is not set
200# CONFIG_INET_ECN is not set
201# CONFIG_SYN_COOKIES is not set
202# CONFIG_INET_AH is not set
203# CONFIG_INET_ESP is not set
204# CONFIG_INET_IPCOMP is not set
205# CONFIG_IPV6 is not set
206# CONFIG_XFRM_USER is not set
207
208#
209# SCTP Configuration (EXPERIMENTAL)
210#
211CONFIG_IPV6_SCTP__=y
212# CONFIG_IP_SCTP is not set
213# CONFIG_ATM is not set
214# CONFIG_VLAN_8021Q is not set
215# CONFIG_LLC is not set
216# CONFIG_DECNET is not set
217# CONFIG_BRIDGE is not set
218# CONFIG_X25 is not set
219# CONFIG_LAPB is not set
220# CONFIG_NET_DIVERT is not set
221# CONFIG_ECONET is not set
222# CONFIG_WAN_ROUTER is not set
223# CONFIG_NET_HW_FLOWCONTROL is not set
224
225#
226# QoS and/or fair queueing
227#
228# CONFIG_NET_SCHED is not set
229
230#
231# Network testing
232#
233# CONFIG_NET_PKTGEN is not set
234CONFIG_NETDEVICES=y
235# CONFIG_DUMMY is not set
236# CONFIG_BONDING is not set
237# CONFIG_EQUALIZER is not set
238# CONFIG_TUN is not set
239# CONFIG_ETHERTAP is not set
240
241#
242# Ethernet (10 or 100Mbit)
243#
244CONFIG_NET_ETHERNET=y
245# CONFIG_MII is not set
246# CONFIG_OAKNET is not set
247
248#
249# Ethernet (1000 Mbit)
250#
251
252#
253# Ethernet (10000 Mbit)
254#
255# CONFIG_PPP is not set
256# CONFIG_SLIP is not set
257
258#
259# Wireless LAN (non-hamradio)
260#
261# CONFIG_NET_RADIO is not set
262
263#
264# Token Ring devices (depends on LLC=y)
265#
266# CONFIG_SHAPER is not set
267
268#
269# Wan interfaces
270#
271# CONFIG_WAN is not set
272
273#
274# Amateur Radio support
275#
276# CONFIG_HAMRADIO is not set
277
278#
279# IrDA (infrared) support
280#
281# CONFIG_IRDA is not set
282
283#
284# ISDN subsystem
285#
286# CONFIG_ISDN_BOOL is not set
287
288#
289# Graphics support
290#
291# CONFIG_FB is not set
292
293#
294# Old CD-ROM drivers (not SCSI, not IDE)
295#
296# CONFIG_CD_NO_IDESCSI is not set
297
298#
299# Input device support
300#
301# CONFIG_INPUT is not set
302
303#
304# Userland interfaces
305#
306
307#
308# Input I/O drivers
309#
310# CONFIG_GAMEPORT is not set
311CONFIG_SOUND_GAMEPORT=y
312# CONFIG_SERIO is not set
313
314#
315# Input Device Drivers
316#
317
318#
319# Macintosh device drivers
320#
321
322#
323# Serial drivers
324#
325# CONFIG_SERIAL_8250 is not set
326
327#
328# Non-8250 serial port support
329#
330CONFIG_SERIAL_CORE=y
331CONFIG_SERIAL_CORE_CONSOLE=y
332CONFIG_SERIAL_CPM=y
333CONFIG_SERIAL_CPM_CONSOLE=y
334# CONFIG_SERIAL_CPM_SCC1 is not set
335# CONFIG_SERIAL_CPM_SCC2 is not set
336# CONFIG_SERIAL_CPM_SCC3 is not set
337# CONFIG_SERIAL_CPM_SCC4 is not set
338CONFIG_SERIAL_CPM_SMC1=y
339# CONFIG_SERIAL_CPM_SMC2 is not set
340CONFIG_UNIX98_PTYS=y
341# CONFIG_LEGACY_PTYS is not set
342
343#
344# I2C support
345#
346# CONFIG_I2C is not set
347
348#
349# I2C Hardware Sensors Mainboard support
350#
351
352#
353# I2C Hardware Sensors Chip support
354#
355# CONFIG_I2C_SENSOR is not set
356
357#
358# Mice
359#
360# CONFIG_BUSMOUSE is not set
361# CONFIG_QIC02_TAPE is not set
362
363#
364# IPMI
365#
366# CONFIG_IPMI_HANDLER is not set
367
368#
369# Watchdog Cards
370#
371# CONFIG_WATCHDOG is not set
372# CONFIG_NVRAM is not set
373CONFIG_GEN_RTC=y
374# CONFIG_GEN_RTC_X is not set
375# CONFIG_DTLK is not set
376# CONFIG_R3964 is not set
377# CONFIG_APPLICOM is not set
378
379#
380# Ftape, the floppy tape device driver
381#
382# CONFIG_FTAPE is not set
383# CONFIG_AGP is not set
384# CONFIG_DRM is not set
385# CONFIG_RAW_DRIVER is not set
386# CONFIG_HANGCHECK_TIMER is not set
387
388#
389# Multimedia devices
390#
391# CONFIG_VIDEO_DEV is not set
392
393#
394# Digital Video Broadcasting Devices
395#
396# CONFIG_DVB is not set
397
398#
399# File systems
400#
401CONFIG_EXT2_FS=y
402# CONFIG_EXT2_FS_XATTR is not set
403CONFIG_EXT3_FS=y
404CONFIG_EXT3_FS_XATTR=y
405# CONFIG_EXT3_FS_POSIX_ACL is not set
406# CONFIG_EXT3_FS_SECURITY is not set
407CONFIG_JBD=y
408# CONFIG_JBD_DEBUG is not set
409CONFIG_FS_MBCACHE=y
410# CONFIG_REISERFS_FS is not set
411# CONFIG_JFS_FS is not set
412# CONFIG_XFS_FS is not set
413# CONFIG_MINIX_FS is not set
414# CONFIG_ROMFS_FS is not set
415# CONFIG_QUOTA is not set
416# CONFIG_AUTOFS_FS is not set
417# CONFIG_AUTOFS4_FS is not set
418
419#
420# CD-ROM/DVD Filesystems
421#
422CONFIG_ISO9660_FS=y
423# CONFIG_JOLIET is not set
424# CONFIG_ZISOFS is not set
425# CONFIG_UDF_FS is not set
426
427#
428# DOS/FAT/NT Filesystems
429#
430# CONFIG_FAT_FS is not set
431# CONFIG_NTFS_FS is not set
432
433#
434# Pseudo filesystems
435#
436CONFIG_PROC_FS=y
437# CONFIG_DEVFS_FS is not set
438CONFIG_DEVPTS_FS=y
439# CONFIG_DEVPTS_FS_XATTR is not set
440CONFIG_TMPFS=y
441CONFIG_RAMFS=y
442
443#
444# Miscellaneous filesystems
445#
446# CONFIG_ADFS_FS is not set
447# CONFIG_AFFS_FS is not set
448# CONFIG_HFS_FS is not set
449# CONFIG_BEFS_FS is not set
450# CONFIG_BFS_FS is not set
451# CONFIG_EFS_FS is not set
452# CONFIG_CRAMFS is not set
453# CONFIG_VXFS_FS is not set
454# CONFIG_HPFS_FS is not set
455# CONFIG_QNX4FS_FS is not set
456# CONFIG_SYSV_FS is not set
457# CONFIG_UFS_FS is not set
458
459#
460# Network File Systems
461#
462CONFIG_NFS_FS=y
463# CONFIG_NFS_V3 is not set
464# CONFIG_NFS_V4 is not set
465# CONFIG_NFSD is not set
466CONFIG_ROOT_NFS=y
467CONFIG_LOCKD=y
468# CONFIG_EXPORTFS is not set
469CONFIG_SUNRPC=y
470# CONFIG_SUNRPC_GSS is not set
471# CONFIG_SMB_FS is not set
472# CONFIG_CIFS is not set
473# CONFIG_NCP_FS is not set
474# CONFIG_CODA_FS is not set
475# CONFIG_INTERMEZZO_FS is not set
476# CONFIG_AFS_FS is not set
477
478#
479# Partition Types
480#
481CONFIG_PARTITION_ADVANCED=y
482# CONFIG_ACORN_PARTITION is not set
483# CONFIG_OSF_PARTITION is not set
484# CONFIG_AMIGA_PARTITION is not set
485# CONFIG_ATARI_PARTITION is not set
486CONFIG_MAC_PARTITION=y
487# CONFIG_MSDOS_PARTITION is not set
488# CONFIG_LDM_PARTITION is not set
489# CONFIG_NEC98_PARTITION is not set
490# CONFIG_SGI_PARTITION is not set
491# CONFIG_ULTRIX_PARTITION is not set
492# CONFIG_SUN_PARTITION is not set
493# CONFIG_EFI_PARTITION is not set
494
495#
496# Sound
497#
498# CONFIG_SOUND is not set
499
500#
501# MPC8xx CPM Options
502#
503# CONFIG_SCC_ENET is not set
504CONFIG_FEC_ENET=y
505CONFIG_USE_MDIO=y
506CONFIG_FEC_AM79C874=y
507CONFIG_FEC_LXT970=y
508CONFIG_FEC_LXT971=y
509CONFIG_FEC_QS6612=y
510CONFIG_ENET_BIG_BUFFERS=y
511
512#
513# Generic MPC8xx Options
514#
515CONFIG_8xx_COPYBACK=y
516# CONFIG_8xx_CPU6 is not set
517# CONFIG_UCODE_PATCH is not set
518
519#
520# USB support
521#
522# CONFIG_USB_GADGET is not set
523
524#
525# Bluetooth support
526#
527# CONFIG_BT is not set
528
529#
530# Library routines
531#
532# CONFIG_CRC32 is not set
533
534#
535# Kernel hacking
536#
537# CONFIG_DEBUG_KERNEL is not set
538# CONFIG_KALLSYMS is not set
539
540#
541# Security options
542#
543# CONFIG_SECURITY is not set
544
545#
546# Cryptographic options
547#
548# CONFIG_CRYPTO is not set
diff --git a/arch/ppc/configs/TQM823L_defconfig b/arch/ppc/configs/TQM823L_defconfig
deleted file mode 100644
index 3b44f3d79bf6..000000000000
--- a/arch/ppc/configs/TQM823L_defconfig
+++ /dev/null
@@ -1,521 +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
7
8#
9# Code maturity level options
10#
11CONFIG_EXPERIMENTAL=y
12
13#
14# General setup
15#
16CONFIG_SWAP=y
17CONFIG_SYSVIPC=y
18# CONFIG_BSD_PROCESS_ACCT is not set
19CONFIG_SYSCTL=y
20CONFIG_LOG_BUF_SHIFT=14
21CONFIG_EMBEDDED=y
22CONFIG_FUTEX=y
23# CONFIG_EPOLL is not set
24
25#
26# Loadable module support
27#
28CONFIG_MODULES=y
29CONFIG_MODULE_UNLOAD=y
30# CONFIG_MODULE_FORCE_UNLOAD is not set
31CONFIG_OBSOLETE_MODPARM=y
32# CONFIG_MODVERSIONS is not set
33CONFIG_KMOD=y
34
35#
36# Platform support
37#
38CONFIG_PPC=y
39CONFIG_PPC32=y
40# CONFIG_6xx is not set
41# CONFIG_40x is not set
42# CONFIG_POWER3 is not set
43CONFIG_8xx=y
44
45#
46# IBM 4xx options
47#
48CONFIG_EMBEDDEDBOOT=y
49CONFIG_SERIAL_CONSOLE=y
50CONFIG_NOT_COHERENT_CACHE=y
51# CONFIG_RPXLITE is not set
52# CONFIG_RPXCLASSIC is not set
53# CONFIG_BSEIP is not set
54# CONFIG_FADS is not set
55CONFIG_TQM823L=y
56# CONFIG_TQM850L is not set
57# CONFIG_TQM855L is not set
58# CONFIG_TQM860L is not set
59# CONFIG_FPS850L is not set
60# CONFIG_SPD823TS is not set
61# CONFIG_IVMS8 is not set
62# CONFIG_IVML24 is not set
63# CONFIG_SM850 is not set
64# CONFIG_HERMES_PRO is not set
65# CONFIG_IP860 is not set
66# CONFIG_LWMON is not set
67# CONFIG_PCU_E is not set
68# CONFIG_CCM is not set
69# CONFIG_LANTEC is not set
70# CONFIG_MBX is not set
71# CONFIG_WINCEPT is not set
72CONFIG_TQM8xxL=y
73# CONFIG_SMP is not set
74# CONFIG_PREEMPT is not set
75CONFIG_MATH_EMULATION=y
76# CONFIG_CPU_FREQ is not set
77
78#
79# General setup
80#
81# CONFIG_HIGHMEM is not set
82# CONFIG_PCI is not set
83# CONFIG_PCI_DOMAINS is not set
84# CONFIG_PCI_QSPAN is not set
85CONFIG_KCORE_ELF=y
86CONFIG_BINFMT_ELF=y
87CONFIG_KERNEL_ELF=y
88# CONFIG_BINFMT_MISC is not set
89# CONFIG_HOTPLUG is not set
90
91#
92# Parallel port support
93#
94# CONFIG_PARPORT is not set
95# CONFIG_CMDLINE_BOOL is not set
96
97#
98# Advanced setup
99#
100# CONFIG_ADVANCED_OPTIONS is not set
101
102#
103# Default settings for advanced configuration options are used
104#
105CONFIG_HIGHMEM_START=0xfe000000
106CONFIG_LOWMEM_SIZE=0x30000000
107CONFIG_KERNEL_START=0xc0000000
108CONFIG_TASK_SIZE=0x80000000
109CONFIG_BOOT_LOAD=0x00400000
110
111#
112# Memory Technology Devices (MTD)
113#
114# CONFIG_MTD is not set
115
116#
117# Plug and Play support
118#
119# CONFIG_PNP is not set
120
121#
122# Block devices
123#
124# CONFIG_BLK_DEV_FD is not set
125# CONFIG_BLK_DEV_LOOP is not set
126# CONFIG_BLK_DEV_NBD is not set
127# CONFIG_BLK_DEV_RAM is not set
128# CONFIG_BLK_DEV_INITRD is not set
129
130#
131# Multi-device support (RAID and LVM)
132#
133# CONFIG_MD is not set
134
135#
136# ATA/IDE/MFM/RLL support
137#
138# CONFIG_IDE is not set
139
140#
141# SCSI support
142#
143# CONFIG_SCSI is not set
144
145#
146# Fusion MPT device support
147#
148
149#
150# I2O device support
151#
152
153#
154# Networking support
155#
156CONFIG_NET=y
157
158#
159# Networking options
160#
161CONFIG_PACKET=y
162# CONFIG_PACKET_MMAP is not set
163# CONFIG_NETLINK_DEV is not set
164# CONFIG_NETFILTER is not set
165CONFIG_UNIX=y
166# CONFIG_NET_KEY is not set
167CONFIG_INET=y
168# CONFIG_IP_MULTICAST is not set
169# CONFIG_IP_ADVANCED_ROUTER is not set
170CONFIG_IP_PNP=y
171CONFIG_IP_PNP_DHCP=y
172# CONFIG_IP_PNP_BOOTP is not set
173# CONFIG_IP_PNP_RARP is not set
174# CONFIG_NET_IPIP is not set
175# CONFIG_NET_IPGRE is not set
176# CONFIG_ARPD is not set
177# CONFIG_INET_ECN is not set
178# CONFIG_SYN_COOKIES is not set
179# CONFIG_INET_AH is not set
180# CONFIG_INET_ESP is not set
181# CONFIG_INET_IPCOMP is not set
182# CONFIG_IPV6 is not set
183# CONFIG_XFRM_USER is not set
184
185#
186# SCTP Configuration (EXPERIMENTAL)
187#
188CONFIG_IPV6_SCTP__=y
189# CONFIG_IP_SCTP is not set
190# CONFIG_ATM is not set
191# CONFIG_VLAN_8021Q is not set
192# CONFIG_LLC is not set
193# CONFIG_DECNET is not set
194# CONFIG_BRIDGE is not set
195# CONFIG_X25 is not set
196# CONFIG_LAPB is not set
197# CONFIG_NET_DIVERT is not set
198# CONFIG_ECONET is not set
199# CONFIG_WAN_ROUTER is not set
200# CONFIG_NET_HW_FLOWCONTROL is not set
201
202#
203# QoS and/or fair queueing
204#
205# CONFIG_NET_SCHED is not set
206
207#
208# Network testing
209#
210# CONFIG_NET_PKTGEN is not set
211CONFIG_NETDEVICES=y
212# CONFIG_DUMMY is not set
213# CONFIG_BONDING is not set
214# CONFIG_EQUALIZER is not set
215# CONFIG_TUN is not set
216# CONFIG_ETHERTAP is not set
217
218#
219# Ethernet (10 or 100Mbit)
220#
221CONFIG_NET_ETHERNET=y
222# CONFIG_MII is not set
223# CONFIG_OAKNET is not set
224
225#
226# Ethernet (1000 Mbit)
227#
228
229#
230# Ethernet (10000 Mbit)
231#
232# CONFIG_PPP is not set
233# CONFIG_SLIP is not set
234
235#
236# Wireless LAN (non-hamradio)
237#
238# CONFIG_NET_RADIO is not set
239
240#
241# Token Ring devices (depends on LLC=y)
242#
243# CONFIG_SHAPER is not set
244
245#
246# Wan interfaces
247#
248# CONFIG_WAN is not set
249
250#
251# Amateur Radio support
252#
253# CONFIG_HAMRADIO is not set
254
255#
256# IrDA (infrared) support
257#
258# CONFIG_IRDA is not set
259
260#
261# ISDN subsystem
262#
263# CONFIG_ISDN_BOOL is not set
264
265#
266# Graphics support
267#
268# CONFIG_FB is not set
269
270#
271# Old CD-ROM drivers (not SCSI, not IDE)
272#
273# CONFIG_CD_NO_IDESCSI is not set
274
275#
276# Input device support
277#
278# CONFIG_INPUT is not set
279
280#
281# Userland interfaces
282#
283
284#
285# Input I/O drivers
286#
287# CONFIG_GAMEPORT is not set
288CONFIG_SOUND_GAMEPORT=y
289# CONFIG_SERIO is not set
290
291#
292# Input Device Drivers
293#
294
295#
296# Macintosh device drivers
297#
298
299#
300# Serial drivers
301#
302# CONFIG_SERIAL_8250 is not set
303
304#
305# Non-8250 serial port support
306#
307CONFIG_SERIAL_CORE=y
308CONFIG_SERIAL_CORE_CONSOLE=y
309CONFIG_SERIAL_CPM=y
310CONFIG_SERIAL_CPM_CONSOLE=y
311# CONFIG_SERIAL_CPM_SCC1 is not set
312# CONFIG_SERIAL_CPM_SCC2 is not set
313# CONFIG_SERIAL_CPM_SCC3 is not set
314# CONFIG_SERIAL_CPM_SCC4 is not set
315CONFIG_SERIAL_CPM_SMC1=y
316CONFIG_SERIAL_CPM_SMC2=y
317CONFIG_SERIAL_CPM_ALT_SMC2=y
318CONFIG_UNIX98_PTYS=y
319# CONFIG_LEGACY_PTYS is not set
320
321#
322# I2C support
323#
324# CONFIG_I2C is not set
325
326#
327# I2C Hardware Sensors Mainboard support
328#
329
330#
331# I2C Hardware Sensors Chip support
332#
333# CONFIG_I2C_SENSOR is not set
334
335#
336# Mice
337#
338# CONFIG_BUSMOUSE is not set
339# CONFIG_QIC02_TAPE is not set
340
341#
342# IPMI
343#
344# CONFIG_IPMI_HANDLER is not set
345
346#
347# Watchdog Cards
348#
349# CONFIG_WATCHDOG is not set
350# CONFIG_NVRAM is not set
351CONFIG_GEN_RTC=y
352# CONFIG_GEN_RTC_X is not set
353# CONFIG_DTLK is not set
354# CONFIG_R3964 is not set
355# CONFIG_APPLICOM is not set
356
357#
358# Ftape, the floppy tape device driver
359#
360# CONFIG_FTAPE is not set
361# CONFIG_AGP is not set
362# CONFIG_DRM is not set
363# CONFIG_RAW_DRIVER is not set
364# CONFIG_HANGCHECK_TIMER is not set
365
366#
367# Multimedia devices
368#
369# CONFIG_VIDEO_DEV is not set
370
371#
372# Digital Video Broadcasting Devices
373#
374# CONFIG_DVB is not set
375
376#
377# File systems
378#
379# CONFIG_EXT2_FS is not set
380CONFIG_EXT3_FS=y
381CONFIG_EXT3_FS_XATTR=y
382# CONFIG_EXT3_FS_POSIX_ACL is not set
383# CONFIG_EXT3_FS_SECURITY is not set
384CONFIG_JBD=y
385# CONFIG_JBD_DEBUG is not set
386CONFIG_FS_MBCACHE=y
387# CONFIG_REISERFS_FS is not set
388# CONFIG_JFS_FS is not set
389# CONFIG_XFS_FS is not set
390# CONFIG_MINIX_FS is not set
391# CONFIG_ROMFS_FS is not set
392# CONFIG_QUOTA is not set
393# CONFIG_AUTOFS_FS is not set
394# CONFIG_AUTOFS4_FS is not set
395
396#
397# CD-ROM/DVD Filesystems
398#
399# CONFIG_ISO9660_FS is not set
400# CONFIG_UDF_FS is not set
401
402#
403# DOS/FAT/NT Filesystems
404#
405# CONFIG_FAT_FS is not set
406# CONFIG_NTFS_FS is not set
407
408#
409# Pseudo filesystems
410#
411CONFIG_PROC_FS=y
412# CONFIG_DEVFS_FS is not set
413CONFIG_DEVPTS_FS=y
414# CONFIG_DEVPTS_FS_XATTR is not set
415CONFIG_TMPFS=y
416CONFIG_RAMFS=y
417
418#
419# Miscellaneous filesystems
420#
421# CONFIG_ADFS_FS is not set
422# CONFIG_AFFS_FS is not set
423# CONFIG_HFS_FS is not set
424# CONFIG_BEFS_FS is not set
425# CONFIG_BFS_FS is not set
426# CONFIG_EFS_FS is not set
427# CONFIG_CRAMFS is not set
428# CONFIG_VXFS_FS is not set
429# CONFIG_HPFS_FS is not set
430# CONFIG_QNX4FS_FS is not set
431# CONFIG_SYSV_FS is not set
432# CONFIG_UFS_FS is not set
433
434#
435# Network File Systems
436#
437CONFIG_NFS_FS=y
438# CONFIG_NFS_V3 is not set
439# CONFIG_NFS_V4 is not set
440# CONFIG_NFSD is not set
441CONFIG_ROOT_NFS=y
442CONFIG_LOCKD=y
443# CONFIG_EXPORTFS is not set
444CONFIG_SUNRPC=y
445# CONFIG_SUNRPC_GSS is not set
446# CONFIG_SMB_FS is not set
447# CONFIG_CIFS is not set
448# CONFIG_NCP_FS is not set
449# CONFIG_CODA_FS is not set
450# CONFIG_INTERMEZZO_FS is not set
451# CONFIG_AFS_FS is not set
452
453#
454# Partition Types
455#
456CONFIG_PARTITION_ADVANCED=y
457# CONFIG_ACORN_PARTITION is not set
458# CONFIG_OSF_PARTITION is not set
459# CONFIG_AMIGA_PARTITION is not set
460# CONFIG_ATARI_PARTITION is not set
461# CONFIG_MAC_PARTITION is not set
462# CONFIG_MSDOS_PARTITION is not set
463# CONFIG_LDM_PARTITION is not set
464# CONFIG_NEC98_PARTITION is not set
465# CONFIG_SGI_PARTITION is not set
466# CONFIG_ULTRIX_PARTITION is not set
467# CONFIG_SUN_PARTITION is not set
468# CONFIG_EFI_PARTITION is not set
469
470#
471# Sound
472#
473# CONFIG_SOUND is not set
474
475#
476# MPC8xx CPM Options
477#
478CONFIG_SCC_ENET=y
479# CONFIG_SCC1_ENET is not set
480CONFIG_SCC2_ENET=y
481# CONFIG_SCC3_ENET is not set
482# CONFIG_FEC_ENET is not set
483CONFIG_ENET_BIG_BUFFERS=y
484
485#
486# Generic MPC8xx Options
487#
488CONFIG_8xx_COPYBACK=y
489# CONFIG_8xx_CPU6 is not set
490# CONFIG_UCODE_PATCH is not set
491
492#
493# USB support
494#
495# CONFIG_USB_GADGET is not set
496
497#
498# Bluetooth support
499#
500# CONFIG_BT is not set
501
502#
503# Library routines
504#
505# CONFIG_CRC32 is not set
506
507#
508# Kernel hacking
509#
510# CONFIG_DEBUG_KERNEL is not set
511# CONFIG_KALLSYMS is not set
512
513#
514# Security options
515#
516# CONFIG_SECURITY is not set
517
518#
519# Cryptographic options
520#
521# CONFIG_CRYPTO is not set
diff --git a/arch/ppc/configs/TQM8260_defconfig b/arch/ppc/configs/TQM8260_defconfig
deleted file mode 100644
index 57cfa83d12d9..000000000000
--- a/arch/ppc/configs/TQM8260_defconfig
+++ /dev/null
@@ -1,499 +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
7
8#
9# Code maturity level options
10#
11CONFIG_EXPERIMENTAL=y
12
13#
14# General setup
15#
16CONFIG_SWAP=y
17CONFIG_SYSVIPC=y
18# CONFIG_BSD_PROCESS_ACCT is not set
19CONFIG_SYSCTL=y
20CONFIG_LOG_BUF_SHIFT=14
21CONFIG_EMBEDDED=y
22CONFIG_FUTEX=y
23# CONFIG_EPOLL is not set
24
25#
26# Loadable module support
27#
28CONFIG_MODULES=y
29CONFIG_MODULE_UNLOAD=y
30# CONFIG_MODULE_FORCE_UNLOAD is not set
31CONFIG_OBSOLETE_MODPARM=y
32# CONFIG_MODVERSIONS is not set
33CONFIG_KMOD=y
34
35#
36# Platform support
37#
38CONFIG_PPC=y
39CONFIG_PPC32=y
40CONFIG_6xx=y
41# CONFIG_40x is not set
42# CONFIG_POWER3 is not set
43# CONFIG_8xx is not set
44
45#
46# IBM 4xx options
47#
48CONFIG_EMBEDDEDBOOT=y
49CONFIG_8260=y
50CONFIG_PPC_STD_MMU=y
51CONFIG_SERIAL_CONSOLE=y
52# CONFIG_EST8260 is not set
53# CONFIG_SBS8260 is not set
54# CONFIG_RPX6 is not set
55CONFIG_TQM8260=y
56# CONFIG_WILLOW_1 is not set
57# CONFIG_SMP is not set
58# CONFIG_PREEMPT is not set
59# CONFIG_CPU_FREQ is not set
60
61#
62# General setup
63#
64# CONFIG_HIGHMEM is not set
65# CONFIG_PCI is not set
66# CONFIG_PCI_DOMAINS is not set
67# CONFIG_PC_KEYBOARD is not set
68CONFIG_KCORE_ELF=y
69CONFIG_BINFMT_ELF=y
70CONFIG_KERNEL_ELF=y
71# CONFIG_BINFMT_MISC is not set
72# CONFIG_HOTPLUG is not set
73
74#
75# Parallel port support
76#
77# CONFIG_PARPORT is not set
78# CONFIG_PPC601_SYNC_FIX is not set
79# CONFIG_CMDLINE_BOOL is not set
80
81#
82# Advanced setup
83#
84# CONFIG_ADVANCED_OPTIONS is not set
85
86#
87# Default settings for advanced configuration options are used
88#
89CONFIG_HIGHMEM_START=0xfe000000
90CONFIG_LOWMEM_SIZE=0x30000000
91CONFIG_KERNEL_START=0xc0000000
92CONFIG_TASK_SIZE=0x80000000
93CONFIG_BOOT_LOAD=0x00400000
94
95#
96# Memory Technology Devices (MTD)
97#
98# CONFIG_MTD is not set
99
100#
101# Plug and Play support
102#
103# CONFIG_PNP is not set
104
105#
106# Block devices
107#
108# CONFIG_BLK_DEV_FD is not set
109# CONFIG_BLK_DEV_LOOP is not set
110# CONFIG_BLK_DEV_NBD is not set
111CONFIG_BLK_DEV_RAM=y
112CONFIG_BLK_DEV_RAM_SIZE=4096
113CONFIG_BLK_DEV_INITRD=y
114
115#
116# Multi-device support (RAID and LVM)
117#
118# CONFIG_MD is not set
119
120#
121# ATA/IDE/MFM/RLL support
122#
123# CONFIG_IDE is not set
124
125#
126# SCSI support
127#
128# CONFIG_SCSI is not set
129
130#
131# Fusion MPT device support
132#
133
134#
135# I2O device support
136#
137
138#
139# Networking support
140#
141CONFIG_NET=y
142
143#
144# Networking options
145#
146CONFIG_PACKET=y
147# CONFIG_PACKET_MMAP is not set
148# CONFIG_NETLINK_DEV is not set
149# CONFIG_NETFILTER is not set
150CONFIG_UNIX=y
151# CONFIG_NET_KEY is not set
152CONFIG_INET=y
153# CONFIG_IP_MULTICAST is not set
154# CONFIG_IP_ADVANCED_ROUTER is not set
155CONFIG_IP_PNP=y
156CONFIG_IP_PNP_DHCP=y
157# CONFIG_IP_PNP_BOOTP is not set
158# CONFIG_IP_PNP_RARP is not set
159# CONFIG_NET_IPIP is not set
160# CONFIG_NET_IPGRE is not set
161# CONFIG_ARPD is not set
162# CONFIG_INET_ECN is not set
163# CONFIG_SYN_COOKIES is not set
164# CONFIG_INET_AH is not set
165# CONFIG_INET_ESP is not set
166# CONFIG_INET_IPCOMP is not set
167# CONFIG_IPV6 is not set
168# CONFIG_XFRM_USER is not set
169
170#
171# SCTP Configuration (EXPERIMENTAL)
172#
173CONFIG_IPV6_SCTP__=y
174# CONFIG_IP_SCTP is not set
175# CONFIG_ATM is not set
176# CONFIG_VLAN_8021Q is not set
177# CONFIG_LLC is not set
178# CONFIG_DECNET is not set
179# CONFIG_BRIDGE is not set
180# CONFIG_X25 is not set
181# CONFIG_LAPB is not set
182# CONFIG_NET_DIVERT is not set
183# CONFIG_ECONET is not set
184# CONFIG_WAN_ROUTER is not set
185# CONFIG_NET_HW_FLOWCONTROL is not set
186
187#
188# QoS and/or fair queueing
189#
190# CONFIG_NET_SCHED is not set
191
192#
193# Network testing
194#
195# CONFIG_NET_PKTGEN is not set
196CONFIG_NETDEVICES=y
197# CONFIG_DUMMY is not set
198# CONFIG_BONDING is not set
199# CONFIG_EQUALIZER is not set
200# CONFIG_TUN is not set
201# CONFIG_ETHERTAP is not set
202
203#
204# Ethernet (10 or 100Mbit)
205#
206CONFIG_NET_ETHERNET=y
207# CONFIG_MII is not set
208# CONFIG_OAKNET is not set
209
210#
211# Ethernet (1000 Mbit)
212#
213
214#
215# Ethernet (10000 Mbit)
216#
217# CONFIG_PPP is not set
218# CONFIG_SLIP is not set
219
220#
221# Wireless LAN (non-hamradio)
222#
223# CONFIG_NET_RADIO is not set
224
225#
226# Token Ring devices (depends on LLC=y)
227#
228# CONFIG_SHAPER is not set
229
230#
231# Wan interfaces
232#
233# CONFIG_WAN is not set
234
235#
236# Amateur Radio support
237#
238# CONFIG_HAMRADIO is not set
239
240#
241# IrDA (infrared) support
242#
243# CONFIG_IRDA is not set
244
245#
246# ISDN subsystem
247#
248# CONFIG_ISDN_BOOL is not set
249
250#
251# Graphics support
252#
253# CONFIG_FB is not set
254
255#
256# Old CD-ROM drivers (not SCSI, not IDE)
257#
258# CONFIG_CD_NO_IDESCSI is not set
259
260#
261# Input device support
262#
263# CONFIG_INPUT is not set
264
265#
266# Userland interfaces
267#
268
269#
270# Input I/O drivers
271#
272# CONFIG_GAMEPORT is not set
273CONFIG_SOUND_GAMEPORT=y
274# CONFIG_SERIO is not set
275
276#
277# Input Device Drivers
278#
279
280#
281# Macintosh device drivers
282#
283
284#
285# Character devices
286#
287# CONFIG_SERIAL_NONSTANDARD is not set
288
289#
290# Serial drivers
291#
292CONFIG_SERIAL_8250=y
293CONFIG_SERIAL_8250_CONSOLE=y
294# CONFIG_SERIAL_8250_EXTENDED is not set
295
296#
297# Non-8250 serial port support
298#
299CONFIG_SERIAL_CORE=y
300CONFIG_SERIAL_CORE_CONSOLE=y
301CONFIG_UNIX98_PTYS=y
302CONFIG_UNIX98_PTY_COUNT=32
303
304#
305# I2C support
306#
307# CONFIG_I2C is not set
308
309#
310# I2C Hardware Sensors Mainboard support
311#
312
313#
314# I2C Hardware Sensors Chip support
315#
316# CONFIG_I2C_SENSOR is not set
317
318#
319# Mice
320#
321# CONFIG_BUSMOUSE is not set
322# CONFIG_QIC02_TAPE is not set
323
324#
325# IPMI
326#
327# CONFIG_IPMI_HANDLER is not set
328
329#
330# Watchdog Cards
331#
332# CONFIG_WATCHDOG is not set
333# CONFIG_NVRAM is not set
334CONFIG_GEN_RTC=y
335# CONFIG_GEN_RTC_X is not set
336# CONFIG_DTLK is not set
337# CONFIG_R3964 is not set
338# CONFIG_APPLICOM is not set
339
340#
341# Ftape, the floppy tape device driver
342#
343# CONFIG_FTAPE is not set
344# CONFIG_AGP is not set
345# CONFIG_DRM is not set
346# CONFIG_RAW_DRIVER is not set
347# CONFIG_HANGCHECK_TIMER is not set
348
349#
350# Multimedia devices
351#
352# CONFIG_VIDEO_DEV is not set
353
354#
355# Digital Video Broadcasting Devices
356#
357# CONFIG_DVB is not set
358
359#
360# File systems
361#
362CONFIG_EXT2_FS=y
363# CONFIG_EXT2_FS_XATTR is not set
364CONFIG_EXT3_FS=y
365CONFIG_EXT3_FS_XATTR=y
366# CONFIG_EXT3_FS_POSIX_ACL is not set
367# CONFIG_EXT3_FS_SECURITY is not set
368CONFIG_JBD=y
369# CONFIG_JBD_DEBUG is not set
370CONFIG_FS_MBCACHE=y
371# CONFIG_REISERFS_FS is not set
372# CONFIG_JFS_FS is not set
373# CONFIG_XFS_FS is not set
374# CONFIG_MINIX_FS is not set
375# CONFIG_ROMFS_FS is not set
376# CONFIG_QUOTA is not set
377# CONFIG_AUTOFS_FS is not set
378# CONFIG_AUTOFS4_FS is not set
379
380#
381# CD-ROM/DVD Filesystems
382#
383# CONFIG_ISO9660_FS is not set
384# CONFIG_UDF_FS is not set
385
386#
387# DOS/FAT/NT Filesystems
388#
389# CONFIG_FAT_FS is not set
390# CONFIG_NTFS_FS is not set
391
392#
393# Pseudo filesystems
394#
395CONFIG_PROC_FS=y
396# CONFIG_DEVFS_FS is not set
397CONFIG_DEVPTS_FS=y
398# CONFIG_DEVPTS_FS_XATTR is not set
399# CONFIG_TMPFS is not set
400CONFIG_RAMFS=y
401
402#
403# Miscellaneous filesystems
404#
405# CONFIG_ADFS_FS is not set
406# CONFIG_AFFS_FS is not set
407# CONFIG_HFS_FS is not set
408# CONFIG_BEFS_FS is not set
409# CONFIG_BFS_FS is not set
410# CONFIG_EFS_FS is not set
411# CONFIG_CRAMFS is not set
412# CONFIG_VXFS_FS is not set
413# CONFIG_HPFS_FS is not set
414# CONFIG_QNX4FS_FS is not set
415# CONFIG_SYSV_FS is not set
416# CONFIG_UFS_FS is not set
417
418#
419# Network File Systems
420#
421CONFIG_NFS_FS=y
422# CONFIG_NFS_V3 is not set
423# CONFIG_NFS_V4 is not set
424# CONFIG_NFSD is not set
425CONFIG_ROOT_NFS=y
426CONFIG_LOCKD=y
427# CONFIG_EXPORTFS is not set
428CONFIG_SUNRPC=y
429# CONFIG_SUNRPC_GSS is not set
430# CONFIG_SMB_FS is not set
431# CONFIG_CIFS is not set
432# CONFIG_NCP_FS is not set
433# CONFIG_CODA_FS is not set
434# CONFIG_INTERMEZZO_FS is not set
435# CONFIG_AFS_FS is not set
436
437#
438# Partition Types
439#
440CONFIG_PARTITION_ADVANCED=y
441# CONFIG_ACORN_PARTITION is not set
442# CONFIG_OSF_PARTITION is not set
443# CONFIG_AMIGA_PARTITION is not set
444# CONFIG_ATARI_PARTITION is not set
445# CONFIG_MAC_PARTITION is not set
446# CONFIG_MSDOS_PARTITION is not set
447# CONFIG_LDM_PARTITION is not set
448# CONFIG_NEC98_PARTITION is not set
449# CONFIG_SGI_PARTITION is not set
450# CONFIG_ULTRIX_PARTITION is not set
451# CONFIG_SUN_PARTITION is not set
452# CONFIG_EFI_PARTITION is not set
453
454#
455# Sound
456#
457# CONFIG_SOUND is not set
458# CONFIG_SCC_ENET is not set
459CONFIG_FEC_ENET=y
460# CONFIG_USE_MDIO is not set
461
462#
463# MPC8260 CPM Options
464#
465CONFIG_SCC_CONSOLE=y
466# CONFIG_FCC1_ENET is not set
467CONFIG_FCC2_ENET=y
468# CONFIG_FCC3_ENET is not set
469
470#
471# USB support
472#
473# CONFIG_USB_GADGET is not set
474
475#
476# Bluetooth support
477#
478# CONFIG_BT is not set
479
480#
481# Library routines
482#
483# CONFIG_CRC32 is not set
484
485#
486# Kernel hacking
487#
488# CONFIG_DEBUG_KERNEL is not set
489# CONFIG_KALLSYMS is not set
490
491#
492# Security options
493#
494# CONFIG_SECURITY is not set
495
496#
497# Cryptographic options
498#
499# CONFIG_CRYPTO is not set
diff --git a/arch/ppc/configs/TQM850L_defconfig b/arch/ppc/configs/TQM850L_defconfig
deleted file mode 100644
index b02d19630e31..000000000000
--- a/arch/ppc/configs/TQM850L_defconfig
+++ /dev/null
@@ -1,521 +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
7
8#
9# Code maturity level options
10#
11CONFIG_EXPERIMENTAL=y
12
13#
14# General setup
15#
16CONFIG_SWAP=y
17CONFIG_SYSVIPC=y
18# CONFIG_BSD_PROCESS_ACCT is not set
19CONFIG_SYSCTL=y
20CONFIG_LOG_BUF_SHIFT=14
21CONFIG_EMBEDDED=y
22CONFIG_FUTEX=y
23# CONFIG_EPOLL is not set
24
25#
26# Loadable module support
27#
28CONFIG_MODULES=y
29CONFIG_MODULE_UNLOAD=y
30# CONFIG_MODULE_FORCE_UNLOAD is not set
31CONFIG_OBSOLETE_MODPARM=y
32# CONFIG_MODVERSIONS is not set
33CONFIG_KMOD=y
34
35#
36# Platform support
37#
38CONFIG_PPC=y
39CONFIG_PPC32=y
40# CONFIG_6xx is not set
41# CONFIG_40x is not set
42# CONFIG_POWER3 is not set
43CONFIG_8xx=y
44
45#
46# IBM 4xx options
47#
48CONFIG_EMBEDDEDBOOT=y
49CONFIG_SERIAL_CONSOLE=y
50CONFIG_NOT_COHERENT_CACHE=y
51# CONFIG_RPXLITE is not set
52# CONFIG_RPXCLASSIC is not set
53# CONFIG_BSEIP is not set
54# CONFIG_FADS is not set
55# CONFIG_TQM823L is not set
56CONFIG_TQM850L=y
57# CONFIG_TQM855L is not set
58# CONFIG_TQM860L is not set
59# CONFIG_FPS850L is not set
60# CONFIG_SPD823TS is not set
61# CONFIG_IVMS8 is not set
62# CONFIG_IVML24 is not set
63# CONFIG_SM850 is not set
64# CONFIG_HERMES_PRO is not set
65# CONFIG_IP860 is not set
66# CONFIG_LWMON is not set
67# CONFIG_PCU_E is not set
68# CONFIG_CCM is not set
69# CONFIG_LANTEC is not set
70# CONFIG_MBX is not set
71# CONFIG_WINCEPT is not set
72CONFIG_TQM8xxL=y
73# CONFIG_SMP is not set
74# CONFIG_PREEMPT is not set
75CONFIG_MATH_EMULATION=y
76# CONFIG_CPU_FREQ is not set
77
78#
79# General setup
80#
81# CONFIG_HIGHMEM is not set
82# CONFIG_PCI is not set
83# CONFIG_PCI_DOMAINS is not set
84# CONFIG_PCI_QSPAN is not set
85CONFIG_KCORE_ELF=y
86CONFIG_BINFMT_ELF=y
87CONFIG_KERNEL_ELF=y
88# CONFIG_BINFMT_MISC is not set
89# CONFIG_HOTPLUG is not set
90
91#
92# Parallel port support
93#
94# CONFIG_PARPORT is not set
95# CONFIG_CMDLINE_BOOL is not set
96
97#
98# Advanced setup
99#
100# CONFIG_ADVANCED_OPTIONS is not set
101
102#
103# Default settings for advanced configuration options are used
104#
105CONFIG_HIGHMEM_START=0xfe000000
106CONFIG_LOWMEM_SIZE=0x30000000
107CONFIG_KERNEL_START=0xc0000000
108CONFIG_TASK_SIZE=0x80000000
109CONFIG_BOOT_LOAD=0x00400000
110
111#
112# Memory Technology Devices (MTD)
113#
114# CONFIG_MTD is not set
115
116#
117# Plug and Play support
118#
119# CONFIG_PNP is not set
120
121#
122# Block devices
123#
124# CONFIG_BLK_DEV_FD is not set
125# CONFIG_BLK_DEV_LOOP is not set
126# CONFIG_BLK_DEV_NBD is not set
127# CONFIG_BLK_DEV_RAM is not set
128# CONFIG_BLK_DEV_INITRD is not set
129
130#
131# Multi-device support (RAID and LVM)
132#
133# CONFIG_MD is not set
134
135#
136# ATA/IDE/MFM/RLL support
137#
138# CONFIG_IDE is not set
139
140#
141# SCSI support
142#
143# CONFIG_SCSI is not set
144
145#
146# Fusion MPT device support
147#
148
149#
150# I2O device support
151#
152
153#
154# Networking support
155#
156CONFIG_NET=y
157
158#
159# Networking options
160#
161CONFIG_PACKET=y
162# CONFIG_PACKET_MMAP is not set
163# CONFIG_NETLINK_DEV is not set
164# CONFIG_NETFILTER is not set
165CONFIG_UNIX=y
166# CONFIG_NET_KEY is not set
167CONFIG_INET=y
168# CONFIG_IP_MULTICAST is not set
169# CONFIG_IP_ADVANCED_ROUTER is not set
170CONFIG_IP_PNP=y
171CONFIG_IP_PNP_DHCP=y
172# CONFIG_IP_PNP_BOOTP is not set
173# CONFIG_IP_PNP_RARP is not set
174# CONFIG_NET_IPIP is not set
175# CONFIG_NET_IPGRE is not set
176# CONFIG_ARPD is not set
177# CONFIG_INET_ECN is not set
178# CONFIG_SYN_COOKIES is not set
179# CONFIG_INET_AH is not set
180# CONFIG_INET_ESP is not set
181# CONFIG_INET_IPCOMP is not set
182# CONFIG_IPV6 is not set
183# CONFIG_XFRM_USER is not set
184
185#
186# SCTP Configuration (EXPERIMENTAL)
187#
188CONFIG_IPV6_SCTP__=y
189# CONFIG_IP_SCTP is not set
190# CONFIG_ATM is not set
191# CONFIG_VLAN_8021Q is not set
192# CONFIG_LLC is not set
193# CONFIG_DECNET is not set
194# CONFIG_BRIDGE is not set
195# CONFIG_X25 is not set
196# CONFIG_LAPB is not set
197# CONFIG_NET_DIVERT is not set
198# CONFIG_ECONET is not set
199# CONFIG_WAN_ROUTER is not set
200# CONFIG_NET_HW_FLOWCONTROL is not set
201
202#
203# QoS and/or fair queueing
204#
205# CONFIG_NET_SCHED is not set
206
207#
208# Network testing
209#
210# CONFIG_NET_PKTGEN is not set
211CONFIG_NETDEVICES=y
212# CONFIG_DUMMY is not set
213# CONFIG_BONDING is not set
214# CONFIG_EQUALIZER is not set
215# CONFIG_TUN is not set
216# CONFIG_ETHERTAP is not set
217
218#
219# Ethernet (10 or 100Mbit)
220#
221CONFIG_NET_ETHERNET=y
222# CONFIG_MII is not set
223# CONFIG_OAKNET is not set
224
225#
226# Ethernet (1000 Mbit)
227#
228
229#
230# Ethernet (10000 Mbit)
231#
232# CONFIG_PPP is not set
233# CONFIG_SLIP is not set
234
235#
236# Wireless LAN (non-hamradio)
237#
238# CONFIG_NET_RADIO is not set
239
240#
241# Token Ring devices (depends on LLC=y)
242#
243# CONFIG_SHAPER is not set
244
245#
246# Wan interfaces
247#
248# CONFIG_WAN is not set
249
250#
251# Amateur Radio support
252#
253# CONFIG_HAMRADIO is not set
254
255#
256# IrDA (infrared) support
257#
258# CONFIG_IRDA is not set
259
260#
261# ISDN subsystem
262#
263# CONFIG_ISDN_BOOL is not set
264
265#
266# Graphics support
267#
268# CONFIG_FB is not set
269
270#
271# Old CD-ROM drivers (not SCSI, not IDE)
272#
273# CONFIG_CD_NO_IDESCSI is not set
274
275#
276# Input device support
277#
278# CONFIG_INPUT is not set
279
280#
281# Userland interfaces
282#
283
284#
285# Input I/O drivers
286#
287# CONFIG_GAMEPORT is not set
288CONFIG_SOUND_GAMEPORT=y
289# CONFIG_SERIO is not set
290
291#
292# Input Device Drivers
293#
294
295#
296# Macintosh device drivers
297#
298
299#
300# Serial drivers
301#
302# CONFIG_SERIAL_8250 is not set
303
304#
305# Non-8250 serial port support
306#
307CONFIG_SERIAL_CORE=y
308CONFIG_SERIAL_CORE_CONSOLE=y
309CONFIG_SERIAL_CPM=y
310CONFIG_SERIAL_CPM_CONSOLE=y
311# CONFIG_SERIAL_CPM_SCC1 is not set
312# CONFIG_SERIAL_CPM_SCC2 is not set
313# CONFIG_SERIAL_CPM_SCC3 is not set
314# CONFIG_SERIAL_CPM_SCC4 is not set
315CONFIG_SERIAL_CPM_SMC1=y
316CONFIG_SERIAL_CPM_SMC2=y
317CONFIG_SERIAL_CPM_ALT_SMC2=y
318CONFIG_UNIX98_PTYS=y
319# CONFIG_LEGACY_PTYS is not set
320
321#
322# I2C support
323#
324# CONFIG_I2C is not set
325
326#
327# I2C Hardware Sensors Mainboard support
328#
329
330#
331# I2C Hardware Sensors Chip support
332#
333# CONFIG_I2C_SENSOR is not set
334
335#
336# Mice
337#
338# CONFIG_BUSMOUSE is not set
339# CONFIG_QIC02_TAPE is not set
340
341#
342# IPMI
343#
344# CONFIG_IPMI_HANDLER is not set
345
346#
347# Watchdog Cards
348#
349# CONFIG_WATCHDOG is not set
350# CONFIG_NVRAM is not set
351CONFIG_GEN_RTC=y
352# CONFIG_GEN_RTC_X is not set
353# CONFIG_DTLK is not set
354# CONFIG_R3964 is not set
355# CONFIG_APPLICOM is not set
356
357#
358# Ftape, the floppy tape device driver
359#
360# CONFIG_FTAPE is not set
361# CONFIG_AGP is not set
362# CONFIG_DRM is not set
363# CONFIG_RAW_DRIVER is not set
364# CONFIG_HANGCHECK_TIMER is not set
365
366#
367# Multimedia devices
368#
369# CONFIG_VIDEO_DEV is not set
370
371#
372# Digital Video Broadcasting Devices
373#
374# CONFIG_DVB is not set
375
376#
377# File systems
378#
379# CONFIG_EXT2_FS is not set
380CONFIG_EXT3_FS=y
381CONFIG_EXT3_FS_XATTR=y
382# CONFIG_EXT3_FS_POSIX_ACL is not set
383# CONFIG_EXT3_FS_SECURITY is not set
384CONFIG_JBD=y
385# CONFIG_JBD_DEBUG is not set
386CONFIG_FS_MBCACHE=y
387# CONFIG_REISERFS_FS is not set
388# CONFIG_JFS_FS is not set
389# CONFIG_XFS_FS is not set
390# CONFIG_MINIX_FS is not set
391# CONFIG_ROMFS_FS is not set
392# CONFIG_QUOTA is not set
393# CONFIG_AUTOFS_FS is not set
394# CONFIG_AUTOFS4_FS is not set
395
396#
397# CD-ROM/DVD Filesystems
398#
399# CONFIG_ISO9660_FS is not set
400# CONFIG_UDF_FS is not set
401
402#
403# DOS/FAT/NT Filesystems
404#
405# CONFIG_FAT_FS is not set
406# CONFIG_NTFS_FS is not set
407
408#
409# Pseudo filesystems
410#
411CONFIG_PROC_FS=y
412# CONFIG_DEVFS_FS is not set
413CONFIG_DEVPTS_FS=y
414# CONFIG_DEVPTS_FS_XATTR is not set
415CONFIG_TMPFS=y
416CONFIG_RAMFS=y
417
418#
419# Miscellaneous filesystems
420#
421# CONFIG_ADFS_FS is not set
422# CONFIG_AFFS_FS is not set
423# CONFIG_HFS_FS is not set
424# CONFIG_BEFS_FS is not set
425# CONFIG_BFS_FS is not set
426# CONFIG_EFS_FS is not set
427# CONFIG_CRAMFS is not set
428# CONFIG_VXFS_FS is not set
429# CONFIG_HPFS_FS is not set
430# CONFIG_QNX4FS_FS is not set
431# CONFIG_SYSV_FS is not set
432# CONFIG_UFS_FS is not set
433
434#
435# Network File Systems
436#
437CONFIG_NFS_FS=y
438# CONFIG_NFS_V3 is not set
439# CONFIG_NFS_V4 is not set
440# CONFIG_NFSD is not set
441CONFIG_ROOT_NFS=y
442CONFIG_LOCKD=y
443# CONFIG_EXPORTFS is not set
444CONFIG_SUNRPC=y
445# CONFIG_SUNRPC_GSS is not set
446# CONFIG_SMB_FS is not set
447# CONFIG_CIFS is not set
448# CONFIG_NCP_FS is not set
449# CONFIG_CODA_FS is not set
450# CONFIG_INTERMEZZO_FS is not set
451# CONFIG_AFS_FS is not set
452
453#
454# Partition Types
455#
456CONFIG_PARTITION_ADVANCED=y
457# CONFIG_ACORN_PARTITION is not set
458# CONFIG_OSF_PARTITION is not set
459# CONFIG_AMIGA_PARTITION is not set
460# CONFIG_ATARI_PARTITION is not set
461# CONFIG_MAC_PARTITION is not set
462# CONFIG_MSDOS_PARTITION is not set
463# CONFIG_LDM_PARTITION is not set
464# CONFIG_NEC98_PARTITION is not set
465# CONFIG_SGI_PARTITION is not set
466# CONFIG_ULTRIX_PARTITION is not set
467# CONFIG_SUN_PARTITION is not set
468# CONFIG_EFI_PARTITION is not set
469
470#
471# Sound
472#
473# CONFIG_SOUND is not set
474
475#
476# MPC8xx CPM Options
477#
478CONFIG_SCC_ENET=y
479# CONFIG_SCC1_ENET is not set
480CONFIG_SCC2_ENET=y
481# CONFIG_SCC3_ENET is not set
482# CONFIG_FEC_ENET is not set
483CONFIG_ENET_BIG_BUFFERS=y
484
485#
486# Generic MPC8xx Options
487#
488CONFIG_8xx_COPYBACK=y
489CONFIG_8xx_CPU6=y
490# CONFIG_UCODE_PATCH is not set
491
492#
493# USB support
494#
495# CONFIG_USB_GADGET is not set
496
497#
498# Bluetooth support
499#
500# CONFIG_BT is not set
501
502#
503# Library routines
504#
505# CONFIG_CRC32 is not set
506
507#
508# Kernel hacking
509#
510# CONFIG_DEBUG_KERNEL is not set
511# CONFIG_KALLSYMS is not set
512
513#
514# Security options
515#
516# CONFIG_SECURITY is not set
517
518#
519# Cryptographic options
520#
521# CONFIG_CRYPTO is not set
diff --git a/arch/ppc/configs/TQM860L_defconfig b/arch/ppc/configs/TQM860L_defconfig
deleted file mode 100644
index 857e4ab28011..000000000000
--- a/arch/ppc/configs/TQM860L_defconfig
+++ /dev/null
@@ -1,549 +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
7
8#
9# Code maturity level options
10#
11CONFIG_EXPERIMENTAL=y
12
13#
14# General setup
15#
16CONFIG_SWAP=y
17CONFIG_SYSVIPC=y
18# CONFIG_BSD_PROCESS_ACCT is not set
19CONFIG_SYSCTL=y
20CONFIG_LOG_BUF_SHIFT=14
21CONFIG_EMBEDDED=y
22CONFIG_FUTEX=y
23# CONFIG_EPOLL is not set
24
25#
26# Loadable module support
27#
28CONFIG_MODULES=y
29CONFIG_MODULE_UNLOAD=y
30# CONFIG_MODULE_FORCE_UNLOAD is not set
31CONFIG_OBSOLETE_MODPARM=y
32# CONFIG_MODVERSIONS is not set
33CONFIG_KMOD=y
34
35#
36# Platform support
37#
38CONFIG_PPC=y
39CONFIG_PPC32=y
40# CONFIG_6xx is not set
41# CONFIG_40x is not set
42# CONFIG_POWER3 is not set
43CONFIG_8xx=y
44
45#
46# IBM 4xx options
47#
48CONFIG_EMBEDDEDBOOT=y
49CONFIG_SERIAL_CONSOLE=y
50CONFIG_NOT_COHERENT_CACHE=y
51# CONFIG_RPXLITE is not set
52# CONFIG_RPXCLASSIC is not set
53# CONFIG_BSEIP is not set
54# CONFIG_FADS is not set
55# CONFIG_TQM823L is not set
56# CONFIG_TQM850L is not set
57# CONFIG_TQM855L is not set
58CONFIG_TQM860L=y
59# CONFIG_FPS850L is not set
60# CONFIG_SPD823TS is not set
61# CONFIG_IVMS8 is not set
62# CONFIG_IVML24 is not set
63# CONFIG_SM850 is not set
64# CONFIG_HERMES_PRO is not set
65# CONFIG_IP860 is not set
66# CONFIG_LWMON is not set
67# CONFIG_PCU_E is not set
68# CONFIG_CCM is not set
69# CONFIG_LANTEC is not set
70# CONFIG_MBX is not set
71# CONFIG_WINCEPT is not set
72CONFIG_TQM8xxL=y
73# CONFIG_SMP is not set
74# CONFIG_PREEMPT is not set
75CONFIG_MATH_EMULATION=y
76# CONFIG_CPU_FREQ is not set
77
78#
79# General setup
80#
81# CONFIG_HIGHMEM is not set
82# CONFIG_PCI is not set
83# CONFIG_PCI_DOMAINS is not set
84# CONFIG_PCI_QSPAN is not set
85CONFIG_KCORE_ELF=y
86CONFIG_BINFMT_ELF=y
87CONFIG_KERNEL_ELF=y
88# CONFIG_BINFMT_MISC is not set
89# CONFIG_HOTPLUG is not set
90
91#
92# Parallel port support
93#
94# CONFIG_PARPORT is not set
95# CONFIG_CMDLINE_BOOL is not set
96
97#
98# Advanced setup
99#
100# CONFIG_ADVANCED_OPTIONS is not set
101
102#
103# Default settings for advanced configuration options are used
104#
105CONFIG_HIGHMEM_START=0xfe000000
106CONFIG_LOWMEM_SIZE=0x30000000
107CONFIG_KERNEL_START=0xc0000000
108CONFIG_TASK_SIZE=0x80000000
109CONFIG_BOOT_LOAD=0x00400000
110
111#
112# Memory Technology Devices (MTD)
113#
114# CONFIG_MTD is not set
115
116#
117# Plug and Play support
118#
119# CONFIG_PNP is not set
120
121#
122# Block devices
123#
124# CONFIG_BLK_DEV_FD is not set
125# CONFIG_BLK_DEV_LOOP is not set
126# CONFIG_BLK_DEV_NBD is not set
127# CONFIG_BLK_DEV_RAM is not set
128# CONFIG_BLK_DEV_INITRD is not set
129
130#
131# Multi-device support (RAID and LVM)
132#
133# CONFIG_MD is not set
134
135#
136# ATA/IDE/MFM/RLL support
137#
138CONFIG_IDE=y
139
140#
141# IDE, ATA and ATAPI Block devices
142#
143CONFIG_BLK_DEV_IDE=y
144
145#
146# Please see Documentation/ide.txt for help/info on IDE drives
147#
148# CONFIG_BLK_DEV_HD is not set
149CONFIG_BLK_DEV_IDEDISK=y
150# CONFIG_IDEDISK_MULTI_MODE is not set
151# CONFIG_IDEDISK_STROKE is not set
152# CONFIG_BLK_DEV_IDECD is not set
153# CONFIG_BLK_DEV_IDEFLOPPY is not set
154# CONFIG_IDE_TASK_IOCTL is not set
155
156#
157# IDE chipset support/bugfixes
158#
159CONFIG_BLK_DEV_MPC8xx_IDE=y
160CONFIG_IDE_8xx_PCCARD=y
161# CONFIG_IDE_8xx_DIRECT is not set
162# CONFIG_IDE_EXT_DIRECT is not set
163
164#
165# SCSI support
166#
167# CONFIG_SCSI is not set
168
169#
170# Fusion MPT device support
171#
172
173#
174# I2O device support
175#
176
177#
178# Networking support
179#
180CONFIG_NET=y
181
182#
183# Networking options
184#
185CONFIG_PACKET=y
186# CONFIG_PACKET_MMAP is not set
187# CONFIG_NETLINK_DEV is not set
188# CONFIG_NETFILTER is not set
189CONFIG_UNIX=y
190# CONFIG_NET_KEY is not set
191CONFIG_INET=y
192# CONFIG_IP_MULTICAST is not set
193# CONFIG_IP_ADVANCED_ROUTER is not set
194CONFIG_IP_PNP=y
195CONFIG_IP_PNP_DHCP=y
196# CONFIG_IP_PNP_BOOTP is not set
197# CONFIG_IP_PNP_RARP is not set
198# CONFIG_NET_IPIP is not set
199# CONFIG_NET_IPGRE is not set
200# CONFIG_ARPD is not set
201# CONFIG_INET_ECN is not set
202# CONFIG_SYN_COOKIES is not set
203# CONFIG_INET_AH is not set
204# CONFIG_INET_ESP is not set
205# CONFIG_INET_IPCOMP is not set
206# CONFIG_IPV6 is not set
207# CONFIG_XFRM_USER is not set
208
209#
210# SCTP Configuration (EXPERIMENTAL)
211#
212CONFIG_IPV6_SCTP__=y
213# CONFIG_IP_SCTP is not set
214# CONFIG_ATM is not set
215# CONFIG_VLAN_8021Q is not set
216# CONFIG_LLC is not set
217# CONFIG_DECNET is not set
218# CONFIG_BRIDGE is not set
219# CONFIG_X25 is not set
220# CONFIG_LAPB is not set
221# CONFIG_NET_DIVERT is not set
222# CONFIG_ECONET is not set
223# CONFIG_WAN_ROUTER is not set
224# CONFIG_NET_HW_FLOWCONTROL is not set
225
226#
227# QoS and/or fair queueing
228#
229# CONFIG_NET_SCHED is not set
230
231#
232# Network testing
233#
234# CONFIG_NET_PKTGEN is not set
235CONFIG_NETDEVICES=y
236# CONFIG_DUMMY is not set
237# CONFIG_BONDING is not set
238# CONFIG_EQUALIZER is not set
239# CONFIG_TUN is not set
240# CONFIG_ETHERTAP is not set
241
242#
243# Ethernet (10 or 100Mbit)
244#
245CONFIG_NET_ETHERNET=y
246# CONFIG_MII is not set
247# CONFIG_OAKNET is not set
248
249#
250# Ethernet (1000 Mbit)
251#
252
253#
254# Ethernet (10000 Mbit)
255#
256# CONFIG_PPP is not set
257# CONFIG_SLIP is not set
258
259#
260# Wireless LAN (non-hamradio)
261#
262# CONFIG_NET_RADIO is not set
263
264#
265# Token Ring devices (depends on LLC=y)
266#
267# CONFIG_SHAPER is not set
268
269#
270# Wan interfaces
271#
272# CONFIG_WAN is not set
273
274#
275# Amateur Radio support
276#
277# CONFIG_HAMRADIO is not set
278
279#
280# IrDA (infrared) support
281#
282# CONFIG_IRDA is not set
283
284#
285# ISDN subsystem
286#
287# CONFIG_ISDN_BOOL is not set
288
289#
290# Graphics support
291#
292# CONFIG_FB is not set
293
294#
295# Old CD-ROM drivers (not SCSI, not IDE)
296#
297# CONFIG_CD_NO_IDESCSI is not set
298
299#
300# Input device support
301#
302# CONFIG_INPUT is not set
303
304#
305# Userland interfaces
306#
307
308#
309# Input I/O drivers
310#
311# CONFIG_GAMEPORT is not set
312CONFIG_SOUND_GAMEPORT=y
313# CONFIG_SERIO is not set
314
315#
316# Input Device Drivers
317#
318
319#
320# Macintosh device drivers
321#
322
323#
324# Serial drivers
325#
326# CONFIG_SERIAL_8250 is not set
327
328#
329# Non-8250 serial port support
330#
331CONFIG_SERIAL_CORE=y
332CONFIG_SERIAL_CORE_CONSOLE=y
333CONFIG_SERIAL_CPM=y
334CONFIG_SERIAL_CPM_CONSOLE=y
335# CONFIG_SERIAL_CPM_SCC1 is not set
336# CONFIG_SERIAL_CPM_SCC2 is not set
337# CONFIG_SERIAL_CPM_SCC3 is not set
338# CONFIG_SERIAL_CPM_SCC4 is not set
339CONFIG_SERIAL_CPM_SMC1=y
340CONFIG_SERIAL_CPM_SMC2=y
341CONFIG_UNIX98_PTYS=y
342# CONFIG_LEGACY_PTYS is not set
343
344#
345# I2C support
346#
347# CONFIG_I2C is not set
348
349#
350# I2C Hardware Sensors Mainboard support
351#
352
353#
354# I2C Hardware Sensors Chip support
355#
356# CONFIG_I2C_SENSOR is not set
357
358#
359# Mice
360#
361# CONFIG_BUSMOUSE is not set
362# CONFIG_QIC02_TAPE is not set
363
364#
365# IPMI
366#
367# CONFIG_IPMI_HANDLER is not set
368
369#
370# Watchdog Cards
371#
372# CONFIG_WATCHDOG is not set
373# CONFIG_NVRAM is not set
374CONFIG_GEN_RTC=y
375# CONFIG_GEN_RTC_X is not set
376# CONFIG_DTLK is not set
377# CONFIG_R3964 is not set
378# CONFIG_APPLICOM is not set
379
380#
381# Ftape, the floppy tape device driver
382#
383# CONFIG_FTAPE is not set
384# CONFIG_AGP is not set
385# CONFIG_DRM is not set
386# CONFIG_RAW_DRIVER is not set
387# CONFIG_HANGCHECK_TIMER is not set
388
389#
390# Multimedia devices
391#
392# CONFIG_VIDEO_DEV is not set
393
394#
395# Digital Video Broadcasting Devices
396#
397# CONFIG_DVB is not set
398
399#
400# File systems
401#
402CONFIG_EXT2_FS=y
403# CONFIG_EXT2_FS_XATTR is not set
404CONFIG_EXT3_FS=y
405CONFIG_EXT3_FS_XATTR=y
406# CONFIG_EXT3_FS_POSIX_ACL is not set
407# CONFIG_EXT3_FS_SECURITY is not set
408CONFIG_JBD=y
409# CONFIG_JBD_DEBUG is not set
410CONFIG_FS_MBCACHE=y
411# CONFIG_REISERFS_FS is not set
412# CONFIG_JFS_FS is not set
413# CONFIG_XFS_FS is not set
414# CONFIG_MINIX_FS is not set
415# CONFIG_ROMFS_FS is not set
416# CONFIG_QUOTA is not set
417# CONFIG_AUTOFS_FS is not set
418# CONFIG_AUTOFS4_FS is not set
419
420#
421# CD-ROM/DVD Filesystems
422#
423# CONFIG_ISO9660_FS is not set
424# CONFIG_UDF_FS is not set
425
426#
427# DOS/FAT/NT Filesystems
428#
429# CONFIG_FAT_FS is not set
430# CONFIG_NTFS_FS is not set
431
432#
433# Pseudo filesystems
434#
435CONFIG_PROC_FS=y
436# CONFIG_DEVFS_FS is not set
437CONFIG_DEVPTS_FS=y
438# CONFIG_DEVPTS_FS_XATTR is not set
439CONFIG_TMPFS=y
440CONFIG_RAMFS=y
441
442#
443# Miscellaneous filesystems
444#
445# CONFIG_ADFS_FS is not set
446# CONFIG_AFFS_FS is not set
447# CONFIG_HFS_FS is not set
448# CONFIG_BEFS_FS is not set
449# CONFIG_BFS_FS is not set
450# CONFIG_EFS_FS is not set
451# CONFIG_CRAMFS is not set
452# CONFIG_VXFS_FS is not set
453# CONFIG_HPFS_FS is not set
454# CONFIG_QNX4FS_FS is not set
455# CONFIG_SYSV_FS is not set
456# CONFIG_UFS_FS is not set
457
458#
459# Network File Systems
460#
461CONFIG_NFS_FS=y
462# CONFIG_NFS_V3 is not set
463# CONFIG_NFS_V4 is not set
464# CONFIG_NFSD is not set
465CONFIG_ROOT_NFS=y
466CONFIG_LOCKD=y
467# CONFIG_EXPORTFS is not set
468CONFIG_SUNRPC=y
469# CONFIG_SUNRPC_GSS is not set
470# CONFIG_SMB_FS is not set
471# CONFIG_CIFS is not set
472# CONFIG_NCP_FS is not set
473# CONFIG_CODA_FS is not set
474# CONFIG_INTERMEZZO_FS is not set
475# CONFIG_AFS_FS is not set
476
477#
478# Partition Types
479#
480CONFIG_PARTITION_ADVANCED=y
481# CONFIG_ACORN_PARTITION is not set
482# CONFIG_OSF_PARTITION is not set
483# CONFIG_AMIGA_PARTITION is not set
484# CONFIG_ATARI_PARTITION is not set
485CONFIG_MAC_PARTITION=y
486CONFIG_MSDOS_PARTITION=y
487# CONFIG_BSD_DISKLABEL is not set
488# CONFIG_MINIX_SUBPARTITION is not set
489# CONFIG_SOLARIS_X86_PARTITION is not set
490# CONFIG_UNIXWARE_DISKLABEL is not set
491# CONFIG_LDM_PARTITION is not set
492# CONFIG_NEC98_PARTITION is not set
493# CONFIG_SGI_PARTITION is not set
494# CONFIG_ULTRIX_PARTITION is not set
495# CONFIG_SUN_PARTITION is not set
496# CONFIG_EFI_PARTITION is not set
497
498#
499# Sound
500#
501# CONFIG_SOUND is not set
502
503#
504# MPC8xx CPM Options
505#
506CONFIG_SCC_ENET=y
507CONFIG_SCC1_ENET=y
508# CONFIG_SCC2_ENET is not set
509# CONFIG_SCC3_ENET is not set
510# CONFIG_FEC_ENET is not set
511CONFIG_ENET_BIG_BUFFERS=y
512
513#
514# Generic MPC8xx Options
515#
516CONFIG_8xx_COPYBACK=y
517# CONFIG_8xx_CPU6 is not set
518# CONFIG_UCODE_PATCH is not set
519
520#
521# USB support
522#
523# CONFIG_USB_GADGET is not set
524
525#
526# Bluetooth support
527#
528# CONFIG_BT is not set
529
530#
531# Library routines
532#
533# CONFIG_CRC32 is not set
534
535#
536# Kernel hacking
537#
538# CONFIG_DEBUG_KERNEL is not set
539# CONFIG_KALLSYMS is not set
540
541#
542# Security options
543#
544# CONFIG_SECURITY is not set
545
546#
547# Cryptographic options
548#
549# CONFIG_CRYPTO is not set
diff --git a/arch/ppc/configs/bamboo_defconfig b/arch/ppc/configs/bamboo_defconfig
deleted file mode 100644
index 41fd3938fa5c..000000000000
--- a/arch/ppc/configs/bamboo_defconfig
+++ /dev/null
@@ -1,944 +0,0 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12
4# Tue Jun 28 15:24:25 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
30# CONFIG_POSIX_MQUEUE is not set
31# CONFIG_BSD_PROCESS_ACCT is not set
32CONFIG_SYSCTL=y
33# CONFIG_AUDIT is not set
34# CONFIG_HOTPLUG is not set
35CONFIG_KOBJECT_UEVENT=y
36# CONFIG_IKCONFIG is not set
37CONFIG_EMBEDDED=y
38CONFIG_KALLSYMS=y
39# CONFIG_KALLSYMS_ALL is not set
40# CONFIG_KALLSYMS_EXTRA_PASS is not set
41CONFIG_PRINTK=y
42CONFIG_BUG=y
43CONFIG_BASE_FULL=y
44CONFIG_FUTEX=y
45CONFIG_EPOLL=y
46# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
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
62# CONFIG_MODVERSIONS is not set
63# CONFIG_MODULE_SRCVERSION_ALL is not set
64CONFIG_KMOD=y
65
66#
67# Processor
68#
69# CONFIG_6xx is not set
70# CONFIG_40x is not set
71CONFIG_44x=y
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_BOOKE=y
79CONFIG_PTE_64BIT=y
80CONFIG_PHYS_64BIT=y
81# CONFIG_MATH_EMULATION is not set
82# CONFIG_KEXEC is not set
83# CONFIG_CPU_FREQ is not set
84CONFIG_4xx=y
85
86#
87# IBM 4xx options
88#
89CONFIG_BAMBOO=y
90# CONFIG_EBONY is not set
91# CONFIG_LUAN is not set
92# CONFIG_OCOTEA is not set
93CONFIG_440EP=y
94CONFIG_440=y
95CONFIG_IBM440EP_ERR42=y
96CONFIG_IBM_OCP=y
97# CONFIG_PPC4xx_DMA is not set
98CONFIG_PPC_GEN550=y
99# CONFIG_PM is not set
100CONFIG_NOT_COHERENT_CACHE=y
101
102#
103# Platform options
104#
105# CONFIG_PC_KEYBOARD is not set
106# CONFIG_SMP is not set
107# CONFIG_PREEMPT is not set
108# CONFIG_HIGHMEM is not set
109CONFIG_SELECT_MEMORY_MODEL=y
110CONFIG_FLATMEM_MANUAL=y
111# CONFIG_DISCONTIGMEM_MANUAL is not set
112# CONFIG_SPARSEMEM_MANUAL is not set
113CONFIG_FLATMEM=y
114CONFIG_FLAT_NODE_MEM_MAP=y
115CONFIG_BINFMT_ELF=y
116# CONFIG_BINFMT_MISC is not set
117CONFIG_CMDLINE_BOOL=y
118CONFIG_CMDLINE="ip=on"
119CONFIG_SECCOMP=y
120CONFIG_ISA_DMA_API=y
121
122#
123# Bus options
124#
125CONFIG_PCI=y
126CONFIG_PCI_DOMAINS=y
127# CONFIG_PCI_LEGACY_PROC is not set
128# CONFIG_PCI_NAMES is not set
129# CONFIG_PCI_DEBUG is not set
130
131#
132# PCCARD (PCMCIA/CardBus) support
133#
134# CONFIG_PCCARD is not set
135
136#
137# Advanced setup
138#
139# CONFIG_ADVANCED_OPTIONS is not set
140
141#
142# Default settings for advanced configuration options are used
143#
144CONFIG_HIGHMEM_START=0xfe000000
145CONFIG_LOWMEM_SIZE=0x30000000
146CONFIG_KERNEL_START=0xc0000000
147CONFIG_TASK_SIZE=0x80000000
148CONFIG_CONSISTENT_START=0xff100000
149CONFIG_CONSISTENT_SIZE=0x00200000
150CONFIG_BOOT_LOAD=0x01000000
151
152#
153# Device Drivers
154#
155
156#
157# Generic Driver Options
158#
159# CONFIG_STANDALONE is not set
160CONFIG_PREVENT_FIRMWARE_BUILD=y
161# CONFIG_FW_LOADER is not set
162# CONFIG_DEBUG_DRIVER is not set
163
164#
165# Memory Technology Devices (MTD)
166#
167# CONFIG_MTD is not set
168
169#
170# Parallel port support
171#
172# CONFIG_PARPORT is not set
173
174#
175# Plug and Play support
176#
177
178#
179# Block devices
180#
181# CONFIG_BLK_DEV_FD is not set
182# CONFIG_BLK_CPQ_DA is not set
183# CONFIG_BLK_CPQ_CISS_DA is not set
184# CONFIG_BLK_DEV_DAC960 is not set
185# CONFIG_BLK_DEV_UMEM is not set
186# CONFIG_BLK_DEV_COW_COMMON is not set
187# CONFIG_BLK_DEV_LOOP is not set
188# CONFIG_BLK_DEV_NBD is not set
189# CONFIG_BLK_DEV_SX8 is not set
190# CONFIG_BLK_DEV_UB is not set
191# CONFIG_BLK_DEV_RAM is not set
192CONFIG_BLK_DEV_RAM_COUNT=16
193CONFIG_INITRAMFS_SOURCE=""
194# CONFIG_LBD is not set
195# CONFIG_CDROM_PKTCDVD is not set
196
197#
198# IO Schedulers
199#
200CONFIG_IOSCHED_NOOP=y
201CONFIG_IOSCHED_AS=y
202CONFIG_IOSCHED_DEADLINE=y
203CONFIG_IOSCHED_CFQ=y
204# CONFIG_ATA_OVER_ETH is not set
205
206#
207# ATA/ATAPI/MFM/RLL support
208#
209CONFIG_IDE=y
210CONFIG_BLK_DEV_IDE=y
211
212#
213# Please see Documentation/ide.txt for help/info on IDE drives
214#
215# CONFIG_BLK_DEV_IDE_SATA is not set
216CONFIG_BLK_DEV_IDEDISK=y
217# CONFIG_IDEDISK_MULTI_MODE is not set
218# CONFIG_BLK_DEV_IDECD is not set
219# CONFIG_BLK_DEV_IDETAPE is not set
220# CONFIG_BLK_DEV_IDEFLOPPY is not set
221# CONFIG_BLK_DEV_IDESCSI is not set
222# CONFIG_IDE_TASK_IOCTL is not set
223
224#
225# IDE chipset support/bugfixes
226#
227CONFIG_IDE_GENERIC=y
228CONFIG_BLK_DEV_IDEPCI=y
229# CONFIG_IDEPCI_SHARE_IRQ is not set
230# CONFIG_BLK_DEV_OFFBOARD is not set
231# CONFIG_BLK_DEV_GENERIC is not set
232# CONFIG_BLK_DEV_OPTI621 is not set
233# CONFIG_BLK_DEV_SL82C105 is not set
234CONFIG_BLK_DEV_IDEDMA_PCI=y
235# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
236# CONFIG_IDEDMA_PCI_AUTO is not set
237# CONFIG_BLK_DEV_AEC62XX is not set
238# CONFIG_BLK_DEV_ALI15X3 is not set
239# CONFIG_BLK_DEV_AMD74XX is not set
240CONFIG_BLK_DEV_CMD64X=y
241# CONFIG_BLK_DEV_TRIFLEX is not set
242# CONFIG_BLK_DEV_CY82C693 is not set
243# CONFIG_BLK_DEV_CS5520 is not set
244# CONFIG_BLK_DEV_CS5530 is not set
245# CONFIG_BLK_DEV_HPT34X is not set
246# CONFIG_BLK_DEV_HPT366 is not set
247# CONFIG_BLK_DEV_SC1200 is not set
248# CONFIG_BLK_DEV_PIIX is not set
249# CONFIG_BLK_DEV_IT821X is not set
250# CONFIG_BLK_DEV_NS87415 is not set
251# CONFIG_BLK_DEV_PDC202XX_OLD is not set
252# CONFIG_BLK_DEV_PDC202XX_NEW is not set
253# CONFIG_BLK_DEV_SVWKS is not set
254# CONFIG_BLK_DEV_SIIMAGE is not set
255# CONFIG_BLK_DEV_SLC90E66 is not set
256# CONFIG_BLK_DEV_TRM290 is not set
257# CONFIG_BLK_DEV_VIA82CXXX is not set
258# CONFIG_IDE_ARM is not set
259CONFIG_BLK_DEV_IDEDMA=y
260# CONFIG_IDEDMA_IVB is not set
261# CONFIG_IDEDMA_AUTO is not set
262# CONFIG_BLK_DEV_HD is not set
263
264#
265# SCSI device support
266#
267CONFIG_SCSI=y
268CONFIG_SCSI_PROC_FS=y
269
270#
271# SCSI support type (disk, tape, CD-ROM)
272#
273# CONFIG_BLK_DEV_SD is not set
274CONFIG_CHR_DEV_ST=y
275# CONFIG_CHR_DEV_OSST is not set
276# CONFIG_BLK_DEV_SR is not set
277# CONFIG_CHR_DEV_SG is not set
278# CONFIG_CHR_DEV_SCH is not set
279
280#
281# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
282#
283# CONFIG_SCSI_MULTI_LUN is not set
284# CONFIG_SCSI_CONSTANTS is not set
285# CONFIG_SCSI_LOGGING is not set
286
287#
288# SCSI Transport Attributes
289#
290CONFIG_SCSI_SPI_ATTRS=y
291# CONFIG_SCSI_FC_ATTRS is not set
292# CONFIG_SCSI_ISCSI_ATTRS is not set
293
294#
295# SCSI low-level drivers
296#
297# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
298# CONFIG_SCSI_3W_9XXX is not set
299# CONFIG_SCSI_ACARD is not set
300# CONFIG_SCSI_AACRAID is not set
301# CONFIG_SCSI_AIC7XXX is not set
302# CONFIG_SCSI_AIC7XXX_OLD is not set
303# CONFIG_SCSI_AIC79XX is not set
304# CONFIG_SCSI_DPT_I2O is not set
305# CONFIG_MEGARAID_NEWGEN is not set
306# CONFIG_MEGARAID_LEGACY is not set
307# CONFIG_SCSI_SATA is not set
308# CONFIG_SCSI_BUSLOGIC is not set
309# CONFIG_SCSI_DMX3191D is not set
310# CONFIG_SCSI_EATA is not set
311# CONFIG_SCSI_FUTURE_DOMAIN is not set
312# CONFIG_SCSI_GDTH is not set
313# CONFIG_SCSI_IPS is not set
314# CONFIG_SCSI_INITIO is not set
315# CONFIG_SCSI_INIA100 is not set
316CONFIG_SCSI_SYM53C8XX_2=y
317CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1
318CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
319CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
320# CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set
321# CONFIG_SCSI_IPR is not set
322# CONFIG_SCSI_QLOGIC_FC is not set
323# CONFIG_SCSI_QLOGIC_1280 is not set
324CONFIG_SCSI_QLA2XXX=y
325# CONFIG_SCSI_QLA21XX is not set
326# CONFIG_SCSI_QLA22XX is not set
327# CONFIG_SCSI_QLA2300 is not set
328# CONFIG_SCSI_QLA2322 is not set
329# CONFIG_SCSI_QLA6312 is not set
330# CONFIG_SCSI_LPFC is not set
331# CONFIG_SCSI_DC395x is not set
332# CONFIG_SCSI_DC390T is not set
333# CONFIG_SCSI_NSP32 is not set
334# CONFIG_SCSI_DEBUG is not set
335
336#
337# Multi-device support (RAID and LVM)
338#
339# CONFIG_MD is not set
340
341#
342# Fusion MPT device support
343#
344# CONFIG_FUSION is not set
345# CONFIG_FUSION_SPI is not set
346# CONFIG_FUSION_FC is not set
347
348#
349# IEEE 1394 (FireWire) support
350#
351# CONFIG_IEEE1394 is not set
352
353#
354# I2O device support
355#
356# CONFIG_I2O is not set
357
358#
359# Macintosh device drivers
360#
361
362#
363# Networking support
364#
365CONFIG_NET=y
366
367#
368# Networking options
369#
370CONFIG_PACKET=y
371# CONFIG_PACKET_MMAP is not set
372CONFIG_UNIX=y
373# CONFIG_NET_KEY is not set
374CONFIG_INET=y
375# CONFIG_IP_MULTICAST is not set
376# CONFIG_IP_ADVANCED_ROUTER is not set
377CONFIG_IP_FIB_HASH=y
378CONFIG_IP_PNP=y
379# CONFIG_IP_PNP_DHCP is not set
380CONFIG_IP_PNP_BOOTP=y
381# CONFIG_IP_PNP_RARP is not set
382# CONFIG_NET_IPIP is not set
383# CONFIG_NET_IPGRE is not set
384# CONFIG_ARPD is not set
385# CONFIG_SYN_COOKIES is not set
386# CONFIG_INET_AH is not set
387# CONFIG_INET_ESP is not set
388# CONFIG_INET_IPCOMP is not set
389# CONFIG_INET_TUNNEL is not set
390CONFIG_IP_TCPDIAG=y
391# CONFIG_IP_TCPDIAG_IPV6 is not set
392# CONFIG_TCP_CONG_ADVANCED is not set
393CONFIG_TCP_CONG_BIC=y
394
395#
396# IP: Virtual Server Configuration
397#
398# CONFIG_IP_VS is not set
399# CONFIG_IPV6 is not set
400CONFIG_NETFILTER=y
401# CONFIG_NETFILTER_DEBUG is not set
402
403#
404# IP: Netfilter Configuration
405#
406# CONFIG_IP_NF_CONNTRACK is not set
407# CONFIG_IP_NF_CONNTRACK_MARK is not set
408# CONFIG_IP_NF_QUEUE is not set
409# CONFIG_IP_NF_IPTABLES is not set
410# CONFIG_IP_NF_ARPTABLES is not set
411
412#
413# SCTP Configuration (EXPERIMENTAL)
414#
415# CONFIG_IP_SCTP is not set
416# CONFIG_ATM is not set
417# CONFIG_BRIDGE is not set
418# CONFIG_VLAN_8021Q is not set
419# CONFIG_DECNET is not set
420# CONFIG_LLC2 is not set
421# CONFIG_IPX is not set
422# CONFIG_ATALK is not set
423# CONFIG_X25 is not set
424# CONFIG_LAPB is not set
425# CONFIG_NET_DIVERT is not set
426# CONFIG_ECONET is not set
427# CONFIG_WAN_ROUTER is not set
428
429#
430# QoS and/or fair queueing
431#
432# CONFIG_NET_SCHED is not set
433# CONFIG_NET_CLS_ROUTE is not set
434
435#
436# Network testing
437#
438# CONFIG_NET_PKTGEN is not set
439# CONFIG_NETPOLL is not set
440# CONFIG_NET_POLL_CONTROLLER is not set
441# CONFIG_HAMRADIO is not set
442# CONFIG_IRDA is not set
443# CONFIG_BT is not set
444CONFIG_NETDEVICES=y
445# CONFIG_DUMMY is not set
446# CONFIG_BONDING is not set
447# CONFIG_EQUALIZER is not set
448# CONFIG_TUN is not set
449
450#
451# ARCnet devices
452#
453# CONFIG_ARCNET is not set
454
455#
456# Ethernet (10 or 100Mbit)
457#
458CONFIG_NET_ETHERNET=y
459CONFIG_MII=y
460# CONFIG_HAPPYMEAL is not set
461# CONFIG_SUNGEM is not set
462# CONFIG_NET_VENDOR_3COM is not set
463
464#
465# Tulip family network device support
466#
467# CONFIG_NET_TULIP is not set
468# CONFIG_HP100 is not set
469CONFIG_IBM_EMAC=y
470# CONFIG_IBM_EMAC_ERRMSG is not set
471CONFIG_IBM_EMAC_RXB=64
472CONFIG_IBM_EMAC_TXB=8
473CONFIG_IBM_EMAC_FGAP=8
474CONFIG_IBM_EMAC_SKBRES=0
475CONFIG_NET_PCI=y
476# CONFIG_PCNET32 is not set
477# CONFIG_AMD8111_ETH is not set
478# CONFIG_ADAPTEC_STARFIRE is not set
479# CONFIG_B44 is not set
480# CONFIG_FORCEDETH is not set
481# CONFIG_DGRS is not set
482CONFIG_EEPRO100=y
483# CONFIG_E100 is not set
484# CONFIG_FEALNX is not set
485CONFIG_NATSEMI=y
486# CONFIG_NE2K_PCI is not set
487# CONFIG_8139CP is not set
488# CONFIG_8139TOO is not set
489# CONFIG_SIS900 is not set
490# CONFIG_EPIC100 is not set
491# CONFIG_SUNDANCE is not set
492# CONFIG_TLAN is not set
493# CONFIG_VIA_RHINE is not set
494
495#
496# Ethernet (1000 Mbit)
497#
498# CONFIG_ACENIC is not set
499# CONFIG_DL2K is not set
500CONFIG_E1000=y
501# CONFIG_E1000_NAPI is not set
502# CONFIG_E1000_DISABLE_PACKET_SPLIT is not set
503# CONFIG_NS83820 is not set
504# CONFIG_HAMACHI is not set
505# CONFIG_YELLOWFIN is not set
506# CONFIG_R8169 is not set
507# CONFIG_SKGE is not set
508# CONFIG_SK98LIN is not set
509# CONFIG_VIA_VELOCITY is not set
510# CONFIG_TIGON3 is not set
511# CONFIG_BNX2 is not set
512
513#
514# Ethernet (10000 Mbit)
515#
516# CONFIG_IXGB is not set
517# CONFIG_S2IO is not set
518
519#
520# Token Ring devices
521#
522# CONFIG_TR is not set
523
524#
525# Wireless LAN (non-hamradio)
526#
527# CONFIG_NET_RADIO is not set
528
529#
530# Wan interfaces
531#
532# CONFIG_WAN is not set
533# CONFIG_FDDI is not set
534# CONFIG_HIPPI is not set
535# CONFIG_PPP is not set
536# CONFIG_SLIP is not set
537# CONFIG_NET_FC is not set
538# CONFIG_SHAPER is not set
539# CONFIG_NETCONSOLE is not set
540
541#
542# ISDN subsystem
543#
544# CONFIG_ISDN is not set
545
546#
547# Telephony Support
548#
549# CONFIG_PHONE is not set
550
551#
552# Input device support
553#
554CONFIG_INPUT=y
555
556#
557# Userland interfaces
558#
559CONFIG_INPUT_MOUSEDEV=y
560CONFIG_INPUT_MOUSEDEV_PSAUX=y
561CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
562CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
563# CONFIG_INPUT_JOYDEV is not set
564# CONFIG_INPUT_TSDEV is not set
565# CONFIG_INPUT_EVDEV is not set
566# CONFIG_INPUT_EVBUG is not set
567
568#
569# Input Device Drivers
570#
571# CONFIG_INPUT_KEYBOARD is not set
572# CONFIG_INPUT_MOUSE is not set
573# CONFIG_INPUT_JOYSTICK is not set
574# CONFIG_INPUT_TOUCHSCREEN is not set
575# CONFIG_INPUT_MISC is not set
576
577#
578# Hardware I/O ports
579#
580CONFIG_SERIO=y
581# CONFIG_SERIO_I8042 is not set
582# CONFIG_SERIO_SERPORT is not set
583# CONFIG_SERIO_PCIPS2 is not set
584# CONFIG_SERIO_LIBPS2 is not set
585# CONFIG_SERIO_RAW is not set
586# CONFIG_GAMEPORT is not set
587
588#
589# Character devices
590#
591# CONFIG_VT is not set
592# CONFIG_SERIAL_NONSTANDARD is not set
593
594#
595# Serial drivers
596#
597CONFIG_SERIAL_8250=y
598CONFIG_SERIAL_8250_CONSOLE=y
599CONFIG_SERIAL_8250_NR_UARTS=4
600CONFIG_SERIAL_8250_EXTENDED=y
601# CONFIG_SERIAL_8250_MANY_PORTS is not set
602CONFIG_SERIAL_8250_SHARE_IRQ=y
603# CONFIG_SERIAL_8250_DETECT_IRQ is not set
604# CONFIG_SERIAL_8250_RSA is not set
605
606#
607# Non-8250 serial port support
608#
609CONFIG_SERIAL_CORE=y
610CONFIG_SERIAL_CORE_CONSOLE=y
611# CONFIG_SERIAL_JSM is not set
612CONFIG_UNIX98_PTYS=y
613CONFIG_LEGACY_PTYS=y
614CONFIG_LEGACY_PTY_COUNT=256
615
616#
617# IPMI
618#
619# CONFIG_IPMI_HANDLER is not set
620
621#
622# Watchdog Cards
623#
624# CONFIG_WATCHDOG is not set
625# CONFIG_NVRAM is not set
626# CONFIG_GEN_RTC is not set
627# CONFIG_DTLK is not set
628# CONFIG_R3964 is not set
629# CONFIG_APPLICOM is not set
630
631#
632# Ftape, the floppy tape device driver
633#
634# CONFIG_AGP is not set
635# CONFIG_DRM is not set
636# CONFIG_RAW_DRIVER is not set
637
638#
639# TPM devices
640#
641# CONFIG_TCG_TPM is not set
642
643#
644# I2C support
645#
646# CONFIG_I2C is not set
647
648#
649# Dallas's 1-wire bus
650#
651# CONFIG_W1 is not set
652
653#
654# Misc devices
655#
656
657#
658# Multimedia devices
659#
660# CONFIG_VIDEO_DEV is not set
661
662#
663# Digital Video Broadcasting Devices
664#
665# CONFIG_DVB is not set
666
667#
668# Graphics support
669#
670# CONFIG_FB is not set
671
672#
673# Sound
674#
675# CONFIG_SOUND is not set
676
677#
678# USB support
679#
680CONFIG_USB_ARCH_HAS_HCD=y
681CONFIG_USB_ARCH_HAS_OHCI=y
682CONFIG_USB=y
683CONFIG_USB_DEBUG=y
684
685#
686# Miscellaneous USB options
687#
688# CONFIG_USB_DEVICEFS is not set
689# CONFIG_USB_BANDWIDTH is not set
690# CONFIG_USB_DYNAMIC_MINORS is not set
691# CONFIG_USB_OTG is not set
692
693#
694# USB Host Controller Drivers
695#
696# CONFIG_USB_EHCI_HCD is not set
697# CONFIG_USB_ISP116X_HCD is not set
698# CONFIG_USB_OHCI_HCD is not set
699# CONFIG_USB_UHCI_HCD is not set
700# CONFIG_USB_SL811_HCD is not set
701
702#
703# USB Device Class drivers
704#
705# CONFIG_USB_BLUETOOTH_TTY is not set
706# CONFIG_USB_ACM is not set
707# CONFIG_USB_PRINTER is not set
708
709#
710# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
711#
712# CONFIG_USB_STORAGE is not set
713
714#
715# USB Input Devices
716#
717# CONFIG_USB_HID is not set
718
719#
720# USB HID Boot Protocol drivers
721#
722# CONFIG_USB_KBD is not set
723# CONFIG_USB_MOUSE is not set
724# CONFIG_USB_AIPTEK is not set
725# CONFIG_USB_WACOM is not set
726# CONFIG_USB_ACECAD is not set
727# CONFIG_USB_KBTAB is not set
728# CONFIG_USB_POWERMATE is not set
729# CONFIG_USB_MTOUCH is not set
730# CONFIG_USB_ITMTOUCH is not set
731# CONFIG_USB_EGALAX is not set
732# CONFIG_USB_XPAD is not set
733# CONFIG_USB_ATI_REMOTE is not set
734
735#
736# USB Imaging devices
737#
738# CONFIG_USB_MDC800 is not set
739# CONFIG_USB_MICROTEK is not set
740
741#
742# USB Multimedia devices
743#
744# CONFIG_USB_DABUSB is not set
745
746#
747# Video4Linux support is needed for USB Multimedia device support
748#
749
750#
751# USB Network Adapters
752#
753# CONFIG_USB_CATC is not set
754# CONFIG_USB_KAWETH is not set
755CONFIG_USB_PEGASUS=y
756# CONFIG_USB_RTL8150 is not set
757# CONFIG_USB_USBNET is not set
758CONFIG_USB_MON=y
759
760#
761# USB port drivers
762#
763
764#
765# USB Serial Converter support
766#
767# CONFIG_USB_SERIAL is not set
768
769#
770# USB Miscellaneous drivers
771#
772# CONFIG_USB_EMI62 is not set
773# CONFIG_USB_EMI26 is not set
774# CONFIG_USB_AUERSWALD is not set
775# CONFIG_USB_RIO500 is not set
776# CONFIG_USB_LEGOTOWER is not set
777# CONFIG_USB_LCD is not set
778# CONFIG_USB_LED is not set
779# CONFIG_USB_CYTHERM is not set
780# CONFIG_USB_PHIDGETKIT is not set
781# CONFIG_USB_PHIDGETSERVO is not set
782# CONFIG_USB_IDMOUSE is not set
783
784#
785# USB DSL modem support
786#
787
788#
789# USB Gadget Support
790#
791# CONFIG_USB_GADGET is not set
792
793#
794# MMC/SD Card support
795#
796# CONFIG_MMC is not set
797
798#
799# InfiniBand support
800#
801# CONFIG_INFINIBAND is not set
802
803#
804# SN Devices
805#
806
807#
808# File systems
809#
810# CONFIG_EXT2_FS is not set
811# CONFIG_EXT3_FS is not set
812# CONFIG_JBD is not set
813# CONFIG_REISERFS_FS is not set
814# CONFIG_JFS_FS is not set
815
816#
817# XFS support
818#
819# CONFIG_XFS_FS is not set
820# CONFIG_MINIX_FS is not set
821# CONFIG_ROMFS_FS is not set
822# CONFIG_QUOTA is not set
823CONFIG_DNOTIFY=y
824# CONFIG_AUTOFS_FS is not set
825# CONFIG_AUTOFS4_FS is not set
826
827#
828# CD-ROM/DVD Filesystems
829#
830# CONFIG_ISO9660_FS is not set
831# CONFIG_UDF_FS is not set
832
833#
834# DOS/FAT/NT Filesystems
835#
836# CONFIG_MSDOS_FS is not set
837# CONFIG_VFAT_FS is not set
838# CONFIG_NTFS_FS is not set
839
840#
841# Pseudo filesystems
842#
843CONFIG_PROC_FS=y
844CONFIG_PROC_KCORE=y
845CONFIG_SYSFS=y
846# CONFIG_DEVPTS_FS_XATTR is not set
847# CONFIG_TMPFS is not set
848# CONFIG_HUGETLB_PAGE is not set
849CONFIG_RAMFS=y
850
851#
852# Miscellaneous filesystems
853#
854# CONFIG_ADFS_FS is not set
855# CONFIG_AFFS_FS is not set
856# CONFIG_HFS_FS is not set
857# CONFIG_HFSPLUS_FS is not set
858# CONFIG_BEFS_FS is not set
859# CONFIG_BFS_FS is not set
860# CONFIG_EFS_FS is not set
861# CONFIG_CRAMFS is not set
862# CONFIG_VXFS_FS is not set
863# CONFIG_HPFS_FS is not set
864# CONFIG_QNX4FS_FS is not set
865# CONFIG_SYSV_FS is not set
866# CONFIG_UFS_FS is not set
867
868#
869# Network File Systems
870#
871CONFIG_NFS_FS=y
872# CONFIG_NFS_V3 is not set
873# CONFIG_NFS_V4 is not set
874# CONFIG_NFS_DIRECTIO is not set
875# CONFIG_NFSD is not set
876CONFIG_ROOT_NFS=y
877CONFIG_LOCKD=y
878CONFIG_NFS_COMMON=y
879CONFIG_SUNRPC=y
880# CONFIG_RPCSEC_GSS_KRB5 is not set
881# CONFIG_RPCSEC_GSS_SPKM3 is not set
882# CONFIG_SMB_FS is not set
883# CONFIG_CIFS is not set
884# CONFIG_NCP_FS is not set
885# CONFIG_CODA_FS is not set
886# CONFIG_AFS_FS is not set
887
888#
889# Partition Types
890#
891# CONFIG_PARTITION_ADVANCED is not set
892CONFIG_MSDOS_PARTITION=y
893
894#
895# Native Language Support
896#
897# CONFIG_NLS is not set
898
899#
900# Library routines
901#
902# CONFIG_CRC_CCITT is not set
903CONFIG_CRC32=y
904# CONFIG_LIBCRC32C is not set
905
906#
907# Profiling support
908#
909# CONFIG_PROFILING is not set
910
911#
912# Kernel hacking
913#
914# CONFIG_PRINTK_TIME is not set
915CONFIG_DEBUG_KERNEL=y
916CONFIG_MAGIC_SYSRQ=y
917CONFIG_LOG_BUF_SHIFT=14
918# CONFIG_SCHEDSTATS is not set
919# CONFIG_DEBUG_SLAB is not set
920# CONFIG_DEBUG_SPINLOCK is not set
921# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
922# CONFIG_DEBUG_KOBJECT is not set
923CONFIG_DEBUG_INFO=y
924# CONFIG_DEBUG_FS is not set
925# CONFIG_KGDB is not set
926# CONFIG_XMON is not set
927CONFIG_BDI_SWITCH=y
928# CONFIG_SERIAL_TEXT_DEBUG is not set
929CONFIG_PPC_OCP=y
930
931#
932# Security options
933#
934# CONFIG_KEYS is not set
935# CONFIG_SECURITY is not set
936
937#
938# Cryptographic options
939#
940# CONFIG_CRYPTO is not set
941
942#
943# Hardware crypto devices
944#
diff --git a/arch/ppc/configs/bseip_defconfig b/arch/ppc/configs/bseip_defconfig
deleted file mode 100644
index ce9f9f77f2ee..000000000000
--- a/arch/ppc/configs/bseip_defconfig
+++ /dev/null
@@ -1,517 +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
7
8#
9# Code maturity level options
10#
11CONFIG_EXPERIMENTAL=y
12
13#
14# General setup
15#
16CONFIG_SWAP=y
17CONFIG_SYSVIPC=y
18# CONFIG_BSD_PROCESS_ACCT is not set
19CONFIG_SYSCTL=y
20CONFIG_LOG_BUF_SHIFT=14
21CONFIG_EMBEDDED=y
22CONFIG_FUTEX=y
23# CONFIG_EPOLL is not set
24
25#
26# Loadable module support
27#
28# CONFIG_MODULES is not set
29
30#
31# Platform support
32#
33CONFIG_PPC=y
34CONFIG_PPC32=y
35# CONFIG_6xx is not set
36# CONFIG_40x is not set
37# CONFIG_POWER3 is not set
38CONFIG_8xx=y
39
40#
41# IBM 4xx options
42#
43CONFIG_EMBEDDEDBOOT=y
44CONFIG_SERIAL_CONSOLE=y
45CONFIG_NOT_COHERENT_CACHE=y
46# CONFIG_RPXLITE is not set
47# CONFIG_RPXCLASSIC is not set
48CONFIG_BSEIP=y
49# CONFIG_FADS is not set
50# CONFIG_TQM823L is not set
51# CONFIG_TQM850L is not set
52# CONFIG_TQM855L is not set
53# CONFIG_TQM860L is not set
54# CONFIG_FPS850L is not set
55# CONFIG_SPD823TS is not set
56# CONFIG_IVMS8 is not set
57# CONFIG_IVML24 is not set
58# CONFIG_SM850 is not set
59# CONFIG_HERMES_PRO is not set
60# CONFIG_IP860 is not set
61# CONFIG_LWMON is not set
62# CONFIG_PCU_E is not set
63# CONFIG_CCM is not set
64# CONFIG_LANTEC is not set
65# CONFIG_MBX is not set
66# CONFIG_WINCEPT is not set
67# CONFIG_SMP is not set
68# CONFIG_PREEMPT is not set
69CONFIG_MATH_EMULATION=y
70# CONFIG_CPU_FREQ is not set
71
72#
73# General setup
74#
75# CONFIG_HIGHMEM is not set
76# CONFIG_PCI is not set
77# CONFIG_PCI_DOMAINS is not set
78# CONFIG_PCI_QSPAN is not set
79CONFIG_KCORE_ELF=y
80CONFIG_BINFMT_ELF=y
81CONFIG_KERNEL_ELF=y
82# CONFIG_BINFMT_MISC is not set
83# CONFIG_HOTPLUG is not set
84
85#
86# Parallel port support
87#
88# CONFIG_PARPORT is not set
89# CONFIG_CMDLINE_BOOL is not set
90
91#
92# Advanced setup
93#
94# CONFIG_ADVANCED_OPTIONS is not set
95
96#
97# Default settings for advanced configuration options are used
98#
99CONFIG_HIGHMEM_START=0xfe000000
100CONFIG_LOWMEM_SIZE=0x30000000
101CONFIG_KERNEL_START=0xc0000000
102CONFIG_TASK_SIZE=0x80000000
103CONFIG_BOOT_LOAD=0x00400000
104
105#
106# Memory Technology Devices (MTD)
107#
108# CONFIG_MTD is not set
109
110#
111# Plug and Play support
112#
113# CONFIG_PNP is not set
114
115#
116# Block devices
117#
118# CONFIG_BLK_DEV_FD is not set
119CONFIG_BLK_DEV_LOOP=y
120# CONFIG_BLK_DEV_NBD is not set
121CONFIG_BLK_DEV_RAM=y
122CONFIG_BLK_DEV_RAM_SIZE=4096
123CONFIG_BLK_DEV_INITRD=y
124
125#
126# Multi-device support (RAID and LVM)
127#
128# CONFIG_MD is not set
129
130#
131# ATA/IDE/MFM/RLL support
132#
133# CONFIG_IDE is not set
134
135#
136# SCSI support
137#
138# CONFIG_SCSI is not set
139
140#
141# Fusion MPT device support
142#
143
144#
145# I2O device support
146#
147
148#
149# Networking support
150#
151CONFIG_NET=y
152
153#
154# Networking options
155#
156CONFIG_PACKET=y
157# CONFIG_PACKET_MMAP is not set
158# CONFIG_NETLINK_DEV is not set
159# CONFIG_NETFILTER is not set
160CONFIG_UNIX=y
161# CONFIG_NET_KEY is not set
162CONFIG_INET=y
163CONFIG_IP_MULTICAST=y
164# CONFIG_IP_ADVANCED_ROUTER is not set
165CONFIG_IP_PNP=y
166CONFIG_IP_PNP_DHCP=y
167CONFIG_IP_PNP_BOOTP=y
168# CONFIG_IP_PNP_RARP is not set
169# CONFIG_NET_IPIP is not set
170# CONFIG_NET_IPGRE is not set
171# CONFIG_IP_MROUTE is not set
172# CONFIG_ARPD is not set
173# CONFIG_INET_ECN is not set
174CONFIG_SYN_COOKIES=y
175# CONFIG_INET_AH is not set
176# CONFIG_INET_ESP is not set
177# CONFIG_INET_IPCOMP is not set
178# CONFIG_IPV6 is not set
179# CONFIG_XFRM_USER is not set
180
181#
182# SCTP Configuration (EXPERIMENTAL)
183#
184CONFIG_IPV6_SCTP__=y
185# CONFIG_IP_SCTP is not set
186# CONFIG_ATM is not set
187# CONFIG_VLAN_8021Q is not set
188# CONFIG_LLC is not set
189# CONFIG_DECNET is not set
190# CONFIG_BRIDGE is not set
191# CONFIG_X25 is not set
192# CONFIG_LAPB is not set
193# CONFIG_NET_DIVERT is not set
194# CONFIG_ECONET is not set
195# CONFIG_WAN_ROUTER is not set
196# CONFIG_NET_HW_FLOWCONTROL is not set
197
198#
199# QoS and/or fair queueing
200#
201# CONFIG_NET_SCHED is not set
202
203#
204# Network testing
205#
206# CONFIG_NET_PKTGEN is not set
207CONFIG_NETDEVICES=y
208# CONFIG_DUMMY is not set
209# CONFIG_BONDING is not set
210# CONFIG_EQUALIZER is not set
211# CONFIG_TUN is not set
212# CONFIG_ETHERTAP is not set
213
214#
215# Ethernet (10 or 100Mbit)
216#
217CONFIG_NET_ETHERNET=y
218# CONFIG_MII is not set
219# CONFIG_OAKNET is not set
220
221#
222# Ethernet (1000 Mbit)
223#
224
225#
226# Ethernet (10000 Mbit)
227#
228# CONFIG_PPP is not set
229# CONFIG_SLIP is not set
230
231#
232# Wireless LAN (non-hamradio)
233#
234# CONFIG_NET_RADIO is not set
235
236#
237# Token Ring devices (depends on LLC=y)
238#
239# CONFIG_SHAPER is not set
240
241#
242# Wan interfaces
243#
244# CONFIG_WAN is not set
245
246#
247# Amateur Radio support
248#
249# CONFIG_HAMRADIO is not set
250
251#
252# IrDA (infrared) support
253#
254# CONFIG_IRDA is not set
255
256#
257# ISDN subsystem
258#
259# CONFIG_ISDN_BOOL is not set
260
261#
262# Graphics support
263#
264# CONFIG_FB 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# Input device support
273#
274# CONFIG_INPUT is not set
275
276#
277# Userland interfaces
278#
279
280#
281# Input I/O drivers
282#
283# CONFIG_GAMEPORT is not set
284CONFIG_SOUND_GAMEPORT=y
285# CONFIG_SERIO is not set
286
287#
288# Input Device Drivers
289#
290
291#
292# Macintosh device drivers
293#
294
295#
296# Serial drivers
297#
298# CONFIG_SERIAL_8250 is not set
299
300#
301# Non-8250 serial port support
302#
303CONFIG_SERIAL_CORE=y
304CONFIG_SERIAL_CORE_CONSOLE=y
305CONFIG_SERIAL_CPM=y
306CONFIG_SERIAL_CPM_CONSOLE=y
307# CONFIG_SERIAL_CPM_SCC1 is not set
308# CONFIG_SERIAL_CPM_SCC2 is not set
309# CONFIG_SERIAL_CPM_SCC3 is not set
310# CONFIG_SERIAL_CPM_SCC4 is not set
311CONFIG_SERIAL_CPM_SMC1=y
312CONFIG_SERIAL_CPM_SMC2=y
313CONFIG_UNIX98_PTYS=y
314# CONFIG_LEGACY_PTYS is not set
315
316#
317# I2C support
318#
319# CONFIG_I2C is not set
320
321#
322# I2C Hardware Sensors Mainboard support
323#
324
325#
326# I2C Hardware Sensors Chip support
327#
328# CONFIG_I2C_SENSOR is not set
329
330#
331# Mice
332#
333# CONFIG_BUSMOUSE is not set
334# CONFIG_QIC02_TAPE is not set
335
336#
337# IPMI
338#
339# CONFIG_IPMI_HANDLER is not set
340
341#
342# Watchdog Cards
343#
344# CONFIG_WATCHDOG is not set
345# CONFIG_NVRAM is not set
346CONFIG_GEN_RTC=y
347# CONFIG_GEN_RTC_X is not set
348# CONFIG_DTLK is not set
349# CONFIG_R3964 is not set
350# CONFIG_APPLICOM is not set
351
352#
353# Ftape, the floppy tape device driver
354#
355# CONFIG_FTAPE is not set
356# CONFIG_AGP is not set
357# CONFIG_DRM is not set
358# CONFIG_RAW_DRIVER is not set
359# CONFIG_HANGCHECK_TIMER is not set
360
361#
362# Multimedia devices
363#
364# CONFIG_VIDEO_DEV is not set
365
366#
367# Digital Video Broadcasting Devices
368#
369# CONFIG_DVB is not set
370
371#
372# File systems
373#
374CONFIG_EXT2_FS=y
375# CONFIG_EXT2_FS_XATTR is not set
376CONFIG_EXT3_FS=y
377CONFIG_EXT3_FS_XATTR=y
378# CONFIG_EXT3_FS_POSIX_ACL is not set
379# CONFIG_EXT3_FS_SECURITY is not set
380CONFIG_JBD=y
381# CONFIG_JBD_DEBUG is not set
382CONFIG_FS_MBCACHE=y
383# CONFIG_REISERFS_FS is not set
384# CONFIG_JFS_FS is not set
385# CONFIG_XFS_FS is not set
386# CONFIG_MINIX_FS is not set
387# CONFIG_ROMFS_FS is not set
388# CONFIG_QUOTA is not set
389# CONFIG_AUTOFS_FS is not set
390# CONFIG_AUTOFS4_FS is not set
391
392#
393# CD-ROM/DVD Filesystems
394#
395# CONFIG_ISO9660_FS is not set
396# CONFIG_UDF_FS is not set
397
398#
399# DOS/FAT/NT Filesystems
400#
401# CONFIG_FAT_FS is not set
402# CONFIG_NTFS_FS is not set
403
404#
405# Pseudo filesystems
406#
407CONFIG_PROC_FS=y
408# CONFIG_DEVFS_FS is not set
409CONFIG_DEVPTS_FS=y
410# CONFIG_DEVPTS_FS_XATTR is not set
411CONFIG_TMPFS=y
412CONFIG_RAMFS=y
413
414#
415# Miscellaneous filesystems
416#
417# CONFIG_ADFS_FS is not set
418# CONFIG_AFFS_FS is not set
419# CONFIG_HFS_FS is not set
420# CONFIG_BEFS_FS is not set
421# CONFIG_BFS_FS is not set
422# CONFIG_EFS_FS is not set
423# CONFIG_CRAMFS is not set
424# CONFIG_VXFS_FS is not set
425# CONFIG_HPFS_FS is not set
426# CONFIG_QNX4FS_FS is not set
427# CONFIG_SYSV_FS is not set
428# CONFIG_UFS_FS is not set
429
430#
431# Network File Systems
432#
433CONFIG_NFS_FS=y
434# CONFIG_NFS_V3 is not set
435# CONFIG_NFS_V4 is not set
436# CONFIG_NFSD is not set
437CONFIG_ROOT_NFS=y
438CONFIG_LOCKD=y
439# CONFIG_EXPORTFS is not set
440CONFIG_SUNRPC=y
441# CONFIG_SUNRPC_GSS is not set
442# CONFIG_SMB_FS is not set
443# CONFIG_CIFS is not set
444# CONFIG_NCP_FS is not set
445# CONFIG_CODA_FS is not set
446# CONFIG_INTERMEZZO_FS is not set
447# CONFIG_AFS_FS is not set
448
449#
450# Partition Types
451#
452CONFIG_PARTITION_ADVANCED=y
453# CONFIG_ACORN_PARTITION is not set
454# CONFIG_OSF_PARTITION is not set
455# CONFIG_AMIGA_PARTITION is not set
456# CONFIG_ATARI_PARTITION is not set
457# CONFIG_MAC_PARTITION is not set
458# CONFIG_MSDOS_PARTITION is not set
459# CONFIG_LDM_PARTITION is not set
460# CONFIG_NEC98_PARTITION is not set
461# CONFIG_SGI_PARTITION is not set
462# CONFIG_ULTRIX_PARTITION is not set
463# CONFIG_SUN_PARTITION is not set
464# CONFIG_EFI_PARTITION is not set
465
466#
467# Sound
468#
469# CONFIG_SOUND is not set
470
471#
472# MPC8xx CPM Options
473#
474CONFIG_SCC_ENET=y
475# CONFIG_SCC1_ENET is not set
476CONFIG_SCC2_ENET=y
477# CONFIG_SCC3_ENET is not set
478# CONFIG_FEC_ENET is not set
479# CONFIG_ENET_BIG_BUFFERS is not set
480
481#
482# Generic MPC8xx Options
483#
484CONFIG_8xx_COPYBACK=y
485# CONFIG_8xx_CPU6 is not set
486# CONFIG_UCODE_PATCH is not set
487
488#
489# USB support
490#
491# CONFIG_USB_GADGET is not set
492
493#
494# Bluetooth support
495#
496# CONFIG_BT is not set
497
498#
499# Library routines
500#
501# CONFIG_CRC32 is not set
502
503#
504# Kernel hacking
505#
506# CONFIG_DEBUG_KERNEL is not set
507# CONFIG_KALLSYMS is not set
508
509#
510# Security options
511#
512# CONFIG_SECURITY is not set
513
514#
515# Cryptographic options
516#
517# CONFIG_CRYPTO is not set
diff --git a/arch/ppc/configs/bubinga_defconfig b/arch/ppc/configs/bubinga_defconfig
deleted file mode 100644
index ebec8013102c..000000000000
--- a/arch/ppc/configs/bubinga_defconfig
+++ /dev/null
@@ -1,592 +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
24# CONFIG_BSD_PROCESS_ACCT is not set
25CONFIG_SYSCTL=y
26CONFIG_LOG_BUF_SHIFT=14
27# CONFIG_HOTPLUG is not set
28# CONFIG_IKCONFIG is not set
29CONFIG_EMBEDDED=y
30# CONFIG_KALLSYMS is not set
31CONFIG_FUTEX=y
32# CONFIG_EPOLL is not set
33CONFIG_IOSCHED_NOOP=y
34CONFIG_IOSCHED_AS=y
35CONFIG_IOSCHED_DEADLINE=y
36# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
37
38#
39# Loadable module support
40#
41CONFIG_MODULES=y
42CONFIG_MODULE_UNLOAD=y
43# CONFIG_MODULE_FORCE_UNLOAD is not set
44CONFIG_OBSOLETE_MODPARM=y
45# CONFIG_MODVERSIONS is not set
46CONFIG_KMOD=y
47
48#
49# Processor
50#
51# CONFIG_6xx is not set
52CONFIG_40x=y
53# CONFIG_44x is not set
54# CONFIG_POWER3 is not set
55# CONFIG_POWER4 is not set
56# CONFIG_8xx is not set
57# CONFIG_MATH_EMULATION is not set
58# CONFIG_CPU_FREQ is not set
59CONFIG_4xx=y
60
61#
62# IBM 4xx options
63#
64# CONFIG_ASH is not set
65CONFIG_BUBINGA=y
66# CONFIG_CPCI405 is not set
67# CONFIG_EP405 is not set
68# CONFIG_OAK is not set
69# CONFIG_REDWOOD_5 is not set
70# CONFIG_REDWOOD_6 is not set
71# CONFIG_SYCAMORE is not set
72# CONFIG_WALNUT is not set
73CONFIG_IBM405_ERR77=y
74CONFIG_IBM405_ERR51=y
75CONFIG_IBM_OCP=y
76CONFIG_BIOS_FIXUP=y
77CONFIG_405EP=y
78CONFIG_IBM_OPENBIOS=y
79# CONFIG_PM is not set
80CONFIG_UART0_TTYS0=y
81# CONFIG_UART0_TTYS1 is not set
82CONFIG_NOT_COHERENT_CACHE=y
83
84#
85# Platform options
86#
87# CONFIG_PC_KEYBOARD is not set
88# CONFIG_SMP is not set
89# CONFIG_PREEMPT is not set
90# CONFIG_HIGHMEM is not set
91CONFIG_KERNEL_ELF=y
92CONFIG_BINFMT_ELF=y
93# CONFIG_BINFMT_MISC is not set
94# CONFIG_CMDLINE_BOOL is not set
95
96#
97# Bus options
98#
99CONFIG_PCI=y
100CONFIG_PCI_DOMAINS=y
101CONFIG_PCI_LEGACY_PROC=y
102# CONFIG_PCI_NAMES is not set
103
104#
105# Advanced setup
106#
107# CONFIG_ADVANCED_OPTIONS is not set
108
109#
110# Default settings for advanced configuration options are used
111#
112CONFIG_HIGHMEM_START=0xfe000000
113CONFIG_LOWMEM_SIZE=0x30000000
114CONFIG_KERNEL_START=0xc0000000
115CONFIG_TASK_SIZE=0x80000000
116CONFIG_BOOT_LOAD=0x00400000
117
118#
119# Device Drivers
120#
121
122#
123# Generic Driver Options
124#
125
126#
127# Memory Technology Devices (MTD)
128#
129# CONFIG_MTD is not set
130
131#
132# Parallel port support
133#
134# CONFIG_PARPORT is not set
135
136#
137# Plug and Play support
138#
139
140#
141# Block devices
142#
143# CONFIG_BLK_DEV_FD is not set
144# CONFIG_BLK_CPQ_DA is not set
145# CONFIG_BLK_CPQ_CISS_DA is not set
146# CONFIG_BLK_DEV_DAC960 is not set
147# CONFIG_BLK_DEV_UMEM is not set
148CONFIG_BLK_DEV_LOOP=y
149# CONFIG_BLK_DEV_CRYPTOLOOP is not set
150# CONFIG_BLK_DEV_NBD is not set
151# CONFIG_BLK_DEV_CARMEL is not set
152CONFIG_BLK_DEV_RAM=y
153CONFIG_BLK_DEV_RAM_SIZE=4096
154CONFIG_BLK_DEV_INITRD=y
155# CONFIG_LBD is not set
156
157#
158# ATA/ATAPI/MFM/RLL support
159#
160# CONFIG_IDE is not set
161
162#
163# SCSI device support
164#
165# CONFIG_SCSI is not set
166
167#
168# Multi-device support (RAID and LVM)
169#
170# CONFIG_MD is not set
171
172#
173# Fusion MPT device support
174#
175# CONFIG_FUSION is not set
176
177#
178# IEEE 1394 (FireWire) support
179#
180# CONFIG_IEEE1394 is not set
181
182#
183# I2O device support
184#
185# CONFIG_I2O is not set
186
187#
188# Macintosh device drivers
189#
190
191#
192# Networking support
193#
194CONFIG_NET=y
195
196#
197# Networking options
198#
199# CONFIG_PACKET is not set
200# CONFIG_NETLINK_DEV is not set
201CONFIG_UNIX=y
202# CONFIG_NET_KEY is not set
203CONFIG_INET=y
204CONFIG_IP_MULTICAST=y
205# CONFIG_IP_ADVANCED_ROUTER is not set
206CONFIG_IP_PNP=y
207# CONFIG_IP_PNP_DHCP is not set
208CONFIG_IP_PNP_BOOTP=y
209# CONFIG_IP_PNP_RARP is not set
210# CONFIG_NET_IPIP is not set
211# CONFIG_NET_IPGRE is not set
212# CONFIG_IP_MROUTE is not set
213# CONFIG_ARPD is not set
214CONFIG_SYN_COOKIES=y
215# CONFIG_INET_AH is not set
216# CONFIG_INET_ESP is not set
217# CONFIG_INET_IPCOMP is not set
218# CONFIG_IPV6 is not set
219# CONFIG_DECNET is not set
220# CONFIG_BRIDGE is not set
221# CONFIG_NETFILTER is not set
222
223#
224# SCTP Configuration (EXPERIMENTAL)
225#
226# CONFIG_IP_SCTP is not set
227# CONFIG_ATM is not set
228# CONFIG_VLAN_8021Q is not set
229# CONFIG_LLC2 is not set
230# CONFIG_IPX is not set
231# CONFIG_ATALK is not set
232# CONFIG_X25 is not set
233# CONFIG_LAPB is not set
234# CONFIG_NET_DIVERT is not set
235# CONFIG_ECONET is not set
236# CONFIG_WAN_ROUTER is not set
237# CONFIG_NET_HW_FLOWCONTROL is not set
238
239#
240# QoS and/or fair queueing
241#
242# CONFIG_NET_SCHED is not set
243
244#
245# Network testing
246#
247# CONFIG_NET_PKTGEN is not set
248CONFIG_NETDEVICES=y
249
250#
251# ARCnet devices
252#
253# CONFIG_ARCNET is not set
254# CONFIG_DUMMY is not set
255# CONFIG_BONDING is not set
256# CONFIG_EQUALIZER is not set
257# CONFIG_TUN is not set
258
259#
260# Ethernet (10 or 100Mbit)
261#
262CONFIG_NET_ETHERNET=y
263CONFIG_MII=y
264# CONFIG_OAKNET is not set
265# CONFIG_HAPPYMEAL is not set
266# CONFIG_SUNGEM is not set
267# CONFIG_NET_VENDOR_3COM is not set
268
269#
270# Tulip family network device support
271#
272# CONFIG_NET_TULIP is not set
273# CONFIG_HP100 is not set
274# CONFIG_NET_PCI is not set
275
276#
277# Ethernet (1000 Mbit)
278#
279# CONFIG_ACENIC is not set
280# CONFIG_DL2K is not set
281# CONFIG_E1000 is not set
282# CONFIG_NS83820 is not set
283# CONFIG_HAMACHI is not set
284# CONFIG_YELLOWFIN is not set
285# CONFIG_R8169 is not set
286# CONFIG_SIS190 is not set
287# CONFIG_SK98LIN is not set
288# CONFIG_TIGON3 is not set
289
290#
291# Ethernet (10000 Mbit)
292#
293# CONFIG_IXGB is not set
294CONFIG_IBM_EMAC=y
295# CONFIG_IBM_EMAC_ERRMSG is not set
296CONFIG_IBM_EMAC_RXB=64
297CONFIG_IBM_EMAC_TXB=8
298CONFIG_IBM_EMAC_FGAP=8
299CONFIG_IBM_EMAC_SKBRES=0
300# CONFIG_FDDI is not set
301# CONFIG_HIPPI is not set
302# CONFIG_PPP is not set
303# CONFIG_SLIP is not set
304
305#
306# Wireless LAN (non-hamradio)
307#
308# CONFIG_NET_RADIO is not set
309
310#
311# Token Ring devices
312#
313# CONFIG_TR is not set
314# CONFIG_RCPCI is not set
315# CONFIG_SHAPER is not set
316# CONFIG_NETCONSOLE is not set
317
318#
319# Wan interfaces
320#
321# CONFIG_WAN is not set
322
323#
324# Amateur Radio support
325#
326# CONFIG_HAMRADIO is not set
327
328#
329# IrDA (infrared) support
330#
331# CONFIG_IRDA is not set
332
333#
334# Bluetooth support
335#
336# CONFIG_BT is not set
337# CONFIG_NETPOLL is not set
338# CONFIG_NET_POLL_CONTROLLER is not set
339
340#
341# ISDN subsystem
342#
343# CONFIG_ISDN is not set
344
345#
346# Telephony Support
347#
348# CONFIG_PHONE is not set
349
350#
351# Input device support
352#
353CONFIG_INPUT=y
354
355#
356# Userland interfaces
357#
358# CONFIG_INPUT_MOUSEDEV is not set
359# CONFIG_INPUT_JOYDEV is not set
360# CONFIG_INPUT_TSDEV is not set
361# CONFIG_INPUT_EVDEV is not set
362# CONFIG_INPUT_EVBUG is not set
363
364#
365# Input I/O drivers
366#
367# CONFIG_GAMEPORT is not set
368CONFIG_SOUND_GAMEPORT=y
369CONFIG_SERIO=y
370# CONFIG_SERIO_I8042 is not set
371# CONFIG_SERIO_SERPORT is not set
372# CONFIG_SERIO_CT82C710 is not set
373# CONFIG_SERIO_PCIPS2 is not set
374
375#
376# Input Device Drivers
377#
378# CONFIG_INPUT_KEYBOARD is not set
379# CONFIG_INPUT_MOUSE is not set
380# CONFIG_INPUT_JOYSTICK is not set
381# CONFIG_INPUT_TOUCHSCREEN is not set
382# CONFIG_INPUT_MISC is not set
383
384#
385# Character devices
386#
387# CONFIG_VT is not set
388# CONFIG_SERIAL_NONSTANDARD is not set
389
390#
391# Serial drivers
392#
393CONFIG_SERIAL_8250=y
394CONFIG_SERIAL_8250_CONSOLE=y
395CONFIG_SERIAL_8250_NR_UARTS=4
396# CONFIG_SERIAL_8250_EXTENDED is not set
397
398#
399# Non-8250 serial port support
400#
401CONFIG_SERIAL_CORE=y
402CONFIG_SERIAL_CORE_CONSOLE=y
403CONFIG_UNIX98_PTYS=y
404CONFIG_LEGACY_PTYS=y
405CONFIG_LEGACY_PTY_COUNT=256
406# CONFIG_QIC02_TAPE is not set
407
408#
409# IPMI
410#
411# CONFIG_IPMI_HANDLER is not set
412
413#
414# Watchdog Cards
415#
416# CONFIG_WATCHDOG is not set
417# CONFIG_NVRAM is not set
418# CONFIG_GEN_RTC is not set
419# CONFIG_DTLK is not set
420# CONFIG_R3964 is not set
421# CONFIG_APPLICOM is not set
422
423#
424# Ftape, the floppy tape device driver
425#
426# CONFIG_FTAPE is not set
427# CONFIG_AGP is not set
428# CONFIG_DRM is not set
429# CONFIG_RAW_DRIVER is not set
430
431#
432# I2C support
433#
434# CONFIG_I2C is not set
435
436#
437# Misc devices
438#
439
440#
441# Multimedia devices
442#
443# CONFIG_VIDEO_DEV is not set
444
445#
446# Digital Video Broadcasting Devices
447#
448# CONFIG_DVB is not set
449
450#
451# Graphics support
452#
453# CONFIG_FB is not set
454
455#
456# Sound
457#
458# CONFIG_SOUND is not set
459
460#
461# USB support
462#
463# CONFIG_USB is not set
464
465#
466# USB Gadget Support
467#
468# CONFIG_USB_GADGET is not set
469
470#
471# File systems
472#
473CONFIG_EXT2_FS=y
474# CONFIG_EXT2_FS_XATTR is not set
475# CONFIG_EXT3_FS is not set
476# CONFIG_JBD is not set
477# CONFIG_REISERFS_FS is not set
478# CONFIG_JFS_FS is not set
479# CONFIG_XFS_FS is not set
480# CONFIG_MINIX_FS is not set
481# CONFIG_ROMFS_FS is not set
482# CONFIG_QUOTA is not set
483# CONFIG_AUTOFS_FS is not set
484# CONFIG_AUTOFS4_FS is not set
485
486#
487# CD-ROM/DVD Filesystems
488#
489# CONFIG_ISO9660_FS is not set
490# CONFIG_UDF_FS is not set
491
492#
493# DOS/FAT/NT Filesystems
494#
495# CONFIG_FAT_FS is not set
496# CONFIG_NTFS_FS is not set
497
498#
499# Pseudo filesystems
500#
501CONFIG_PROC_FS=y
502CONFIG_PROC_KCORE=y
503# CONFIG_DEVFS_FS is not set
504# CONFIG_DEVPTS_FS_XATTR is not set
505CONFIG_TMPFS=y
506# CONFIG_HUGETLB_PAGE is not set
507CONFIG_RAMFS=y
508
509#
510# Miscellaneous filesystems
511#
512# CONFIG_ADFS_FS is not set
513# CONFIG_AFFS_FS is not set
514# CONFIG_HFS_FS is not set
515# CONFIG_HFSPLUS_FS is not set
516# CONFIG_BEFS_FS is not set
517# CONFIG_BFS_FS is not set
518# CONFIG_EFS_FS is not set
519# CONFIG_CRAMFS is not set
520# CONFIG_VXFS_FS is not set
521# CONFIG_HPFS_FS is not set
522# CONFIG_QNX4FS_FS is not set
523# CONFIG_SYSV_FS is not set
524# CONFIG_UFS_FS is not set
525
526#
527# Network File Systems
528#
529CONFIG_NFS_FS=y
530# CONFIG_NFS_V3 is not set
531# CONFIG_NFS_V4 is not set
532# CONFIG_NFS_DIRECTIO is not set
533# CONFIG_NFSD is not set
534CONFIG_ROOT_NFS=y
535CONFIG_LOCKD=y
536# CONFIG_EXPORTFS is not set
537CONFIG_SUNRPC=y
538# CONFIG_RPCSEC_GSS_KRB5 is not set
539# CONFIG_SMB_FS is not set
540# CONFIG_CIFS is not set
541# CONFIG_NCP_FS is not set
542# CONFIG_CODA_FS is not set
543# CONFIG_INTERMEZZO_FS is not set
544# CONFIG_AFS_FS is not set
545
546#
547# Partition Types
548#
549CONFIG_PARTITION_ADVANCED=y
550# CONFIG_ACORN_PARTITION is not set
551# CONFIG_OSF_PARTITION is not set
552# CONFIG_AMIGA_PARTITION is not set
553# CONFIG_ATARI_PARTITION is not set
554# CONFIG_MAC_PARTITION is not set
555# CONFIG_MSDOS_PARTITION is not set
556# CONFIG_LDM_PARTITION is not set
557# CONFIG_NEC98_PARTITION is not set
558# CONFIG_SGI_PARTITION is not set
559# CONFIG_ULTRIX_PARTITION is not set
560# CONFIG_SUN_PARTITION is not set
561# CONFIG_EFI_PARTITION is not set
562
563#
564# Native Language Support
565#
566# CONFIG_NLS is not set
567
568#
569# IBM 40x options
570#
571
572#
573# Library routines
574#
575CONFIG_CRC32=y
576
577#
578# Kernel hacking
579#
580# CONFIG_DEBUG_KERNEL is not set
581# CONFIG_SERIAL_TEXT_DEBUG is not set
582CONFIG_PPC_OCP=y
583
584#
585# Security options
586#
587# CONFIG_SECURITY is not set
588
589#
590# Cryptographic options
591#
592# CONFIG_CRYPTO is not set
diff --git a/arch/ppc/configs/chestnut_defconfig b/arch/ppc/configs/chestnut_defconfig
deleted file mode 100644
index e219aad4d0e3..000000000000
--- a/arch/ppc/configs/chestnut_defconfig
+++ /dev/null
@@ -1,794 +0,0 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.11
4# Fri Mar 11 14:32:49 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
14
15#
16# Code maturity level options
17#
18CONFIG_EXPERIMENTAL=y
19CONFIG_CLEAN_COMPILE=y
20CONFIG_BROKEN_ON_SMP=y
21
22#
23# General setup
24#
25CONFIG_LOCALVERSION=""
26CONFIG_SWAP=y
27CONFIG_SYSVIPC=y
28# CONFIG_POSIX_MQUEUE is not set
29# CONFIG_BSD_PROCESS_ACCT is not set
30CONFIG_SYSCTL=y
31# CONFIG_AUDIT is not set
32CONFIG_LOG_BUF_SHIFT=14
33# CONFIG_HOTPLUG is not set
34CONFIG_KOBJECT_UEVENT=y
35# CONFIG_IKCONFIG is not set
36# CONFIG_EMBEDDED is not set
37CONFIG_KALLSYMS=y
38# CONFIG_KALLSYMS_EXTRA_PASS is not set
39CONFIG_BASE_FULL=y
40CONFIG_FUTEX=y
41CONFIG_EPOLL=y
42# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
43CONFIG_SHMEM=y
44CONFIG_CC_ALIGN_FUNCTIONS=0
45CONFIG_CC_ALIGN_LABELS=0
46CONFIG_CC_ALIGN_LOOPS=0
47CONFIG_CC_ALIGN_JUMPS=0
48# CONFIG_TINY_SHMEM is not set
49CONFIG_BASE_SMALL=0
50
51#
52# Loadable module support
53#
54CONFIG_MODULES=y
55CONFIG_MODULE_UNLOAD=y
56# CONFIG_MODULE_FORCE_UNLOAD is not set
57CONFIG_OBSOLETE_MODPARM=y
58# CONFIG_MODVERSIONS is not set
59# CONFIG_MODULE_SRCVERSION_ALL is not set
60CONFIG_KMOD=y
61
62#
63# Processor
64#
65CONFIG_6xx=y
66# CONFIG_40x is not set
67# CONFIG_44x is not set
68# CONFIG_POWER3 is not set
69# CONFIG_POWER4 is not set
70# CONFIG_8xx is not set
71# CONFIG_E500 is not set
72CONFIG_ALTIVEC=y
73# CONFIG_TAU is not set
74# CONFIG_CPU_FREQ is not set
75CONFIG_PPC_GEN550=y
76CONFIG_PPC_STD_MMU=y
77CONFIG_NOT_COHERENT_CACHE=y
78
79#
80# Platform options
81#
82# CONFIG_PPC_MULTIPLATFORM is not set
83# CONFIG_APUS is not set
84# CONFIG_KATANA is not set
85# CONFIG_WILLOW is not set
86# CONFIG_CPCI690 is not set
87# CONFIG_PCORE is not set
88# CONFIG_POWERPMC250 is not set
89CONFIG_CHESTNUT=y
90# CONFIG_SPRUCE is not set
91# CONFIG_EV64260 is not set
92# CONFIG_LOPEC is not set
93# CONFIG_MCPN765 is not set
94# CONFIG_MVME5100 is not set
95# CONFIG_PPLUS is not set
96# CONFIG_PRPMC750 is not set
97# CONFIG_PRPMC800 is not set
98# CONFIG_SANDPOINT is not set
99# CONFIG_RADSTONE_PPC7D is not set
100# CONFIG_ADIR is not set
101# CONFIG_K2 is not set
102# CONFIG_PAL4 is not set
103# CONFIG_GEMINI is not set
104# CONFIG_EST8260 is not set
105# CONFIG_SBC82xx is not set
106# CONFIG_SBS8260 is not set
107# CONFIG_RPX8260 is not set
108# CONFIG_TQM8260 is not set
109# CONFIG_ADS8272 is not set
110# CONFIG_PQ2FADS is not set
111# CONFIG_LITE5200 is not set
112# CONFIG_MPC834x_SYS is not set
113CONFIG_MV64360=y
114CONFIG_MV64X60=y
115
116#
117# Set bridge options
118#
119CONFIG_MV64X60_BASE=0xf1000000
120CONFIG_MV64X60_NEW_BASE=0xf1000000
121# CONFIG_SMP is not set
122# CONFIG_PREEMPT is not set
123# CONFIG_HIGHMEM is not set
124CONFIG_BINFMT_ELF=y
125CONFIG_BINFMT_MISC=y
126CONFIG_CMDLINE_BOOL=y
127CONFIG_CMDLINE="console=ttyS0,115200 ip=on"
128
129#
130# Bus options
131#
132CONFIG_GENERIC_ISA_DMA=y
133CONFIG_PCI=y
134CONFIG_PCI_DOMAINS=y
135CONFIG_PCI_LEGACY_PROC=y
136CONFIG_PCI_NAMES=y
137
138#
139# PCCARD (PCMCIA/CardBus) support
140#
141# CONFIG_PCCARD is not set
142
143#
144# PC-card bridges
145#
146
147#
148# Advanced setup
149#
150CONFIG_ADVANCED_OPTIONS=y
151CONFIG_HIGHMEM_START=0xfe000000
152# CONFIG_LOWMEM_SIZE_BOOL is not set
153CONFIG_LOWMEM_SIZE=0x30000000
154# CONFIG_KERNEL_START_BOOL is not set
155CONFIG_KERNEL_START=0xc0000000
156# CONFIG_TASK_SIZE_BOOL is not set
157CONFIG_TASK_SIZE=0x80000000
158# CONFIG_CONSISTENT_START_BOOL is not set
159CONFIG_CONSISTENT_START=0xff100000
160# CONFIG_CONSISTENT_SIZE_BOOL is not set
161CONFIG_CONSISTENT_SIZE=0x00200000
162# CONFIG_BOOT_LOAD_BOOL is not set
163CONFIG_BOOT_LOAD=0x00800000
164
165#
166# Device Drivers
167#
168
169#
170# Generic Driver Options
171#
172CONFIG_STANDALONE=y
173CONFIG_PREVENT_FIRMWARE_BUILD=y
174# CONFIG_FW_LOADER is not set
175
176#
177# Memory Technology Devices (MTD)
178#
179CONFIG_MTD=y
180# CONFIG_MTD_DEBUG is not set
181CONFIG_MTD_PARTITIONS=y
182# CONFIG_MTD_CONCAT is not set
183# CONFIG_MTD_REDBOOT_PARTS is not set
184# CONFIG_MTD_CMDLINE_PARTS is not set
185
186#
187# User Modules And Translation Layers
188#
189CONFIG_MTD_CHAR=y
190CONFIG_MTD_BLOCK=y
191# CONFIG_FTL is not set
192# CONFIG_NFTL is not set
193# CONFIG_INFTL is not set
194
195#
196# RAM/ROM/Flash chip drivers
197#
198CONFIG_MTD_CFI=y
199# CONFIG_MTD_JEDECPROBE is not set
200CONFIG_MTD_GEN_PROBE=y
201# CONFIG_MTD_CFI_ADV_OPTIONS is not set
202# CONFIG_MTD_CFI_NOSWAP is not set
203# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set
204# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set
205CONFIG_MTD_MAP_BANK_WIDTH_1=y
206CONFIG_MTD_MAP_BANK_WIDTH_2=y
207CONFIG_MTD_MAP_BANK_WIDTH_4=y
208# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
209# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
210# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
211CONFIG_MTD_CFI_I1=y
212CONFIG_MTD_CFI_I2=y
213# CONFIG_MTD_CFI_I4 is not set
214# CONFIG_MTD_CFI_I8 is not set
215CONFIG_MTD_CFI_INTELEXT=y
216# CONFIG_MTD_CFI_AMDSTD is not set
217# CONFIG_MTD_CFI_STAA is not set
218CONFIG_MTD_CFI_UTIL=y
219# CONFIG_MTD_RAM is not set
220# CONFIG_MTD_ROM is not set
221# CONFIG_MTD_ABSENT is not set
222# CONFIG_MTD_XIP is not set
223
224#
225# Mapping drivers for chip access
226#
227# CONFIG_MTD_COMPLEX_MAPPINGS is not set
228CONFIG_MTD_PHYSMAP=y
229CONFIG_MTD_PHYSMAP_START=0xfc000000
230CONFIG_MTD_PHYSMAP_LEN=0x02000000
231CONFIG_MTD_PHYSMAP_BANKWIDTH=4
232
233#
234# Self-contained MTD device drivers
235#
236# CONFIG_MTD_PMC551 is not set
237# CONFIG_MTD_SLRAM is not set
238# CONFIG_MTD_PHRAM is not set
239# CONFIG_MTD_MTDRAM is not set
240# CONFIG_MTD_BLKMTD is not set
241# CONFIG_MTD_BLOCK2MTD is not set
242
243#
244# Disk-On-Chip Device Drivers
245#
246# CONFIG_MTD_DOC2000 is not set
247# CONFIG_MTD_DOC2001 is not set
248# CONFIG_MTD_DOC2001PLUS is not set
249
250#
251# NAND Flash Device Drivers
252#
253# CONFIG_MTD_NAND is not set
254
255#
256# Parallel port support
257#
258# CONFIG_PARPORT is not set
259
260#
261# Plug and Play support
262#
263
264#
265# Block devices
266#
267# CONFIG_BLK_DEV_FD is not set
268# CONFIG_BLK_CPQ_DA is not set
269# CONFIG_BLK_CPQ_CISS_DA is not set
270# CONFIG_BLK_DEV_DAC960 is not set
271# CONFIG_BLK_DEV_UMEM is not set
272# CONFIG_BLK_DEV_COW_COMMON is not set
273CONFIG_BLK_DEV_LOOP=y
274# CONFIG_BLK_DEV_CRYPTOLOOP is not set
275# CONFIG_BLK_DEV_NBD is not set
276# CONFIG_BLK_DEV_SX8 is not set
277CONFIG_BLK_DEV_RAM=y
278CONFIG_BLK_DEV_RAM_COUNT=16
279CONFIG_BLK_DEV_RAM_SIZE=4096
280CONFIG_BLK_DEV_INITRD=y
281CONFIG_INITRAMFS_SOURCE=""
282# CONFIG_LBD is not set
283# CONFIG_CDROM_PKTCDVD is not set
284
285#
286# IO Schedulers
287#
288CONFIG_IOSCHED_NOOP=y
289CONFIG_IOSCHED_AS=y
290CONFIG_IOSCHED_DEADLINE=y
291CONFIG_IOSCHED_CFQ=y
292# CONFIG_ATA_OVER_ETH is not set
293
294#
295# ATA/ATAPI/MFM/RLL support
296#
297# CONFIG_IDE is not set
298
299#
300# SCSI device support
301#
302# CONFIG_SCSI is not set
303
304#
305# Multi-device support (RAID and LVM)
306#
307# CONFIG_MD is not set
308
309#
310# Fusion MPT device support
311#
312
313#
314# IEEE 1394 (FireWire) support
315#
316# CONFIG_IEEE1394 is not set
317
318#
319# I2O device support
320#
321# CONFIG_I2O is not set
322
323#
324# Macintosh device drivers
325#
326
327#
328# Networking support
329#
330CONFIG_NET=y
331
332#
333# Networking options
334#
335CONFIG_PACKET=y
336# CONFIG_PACKET_MMAP is not set
337# CONFIG_NETLINK_DEV is not set
338CONFIG_UNIX=y
339# CONFIG_NET_KEY is not set
340CONFIG_INET=y
341CONFIG_IP_MULTICAST=y
342# CONFIG_IP_ADVANCED_ROUTER is not set
343CONFIG_IP_PNP=y
344CONFIG_IP_PNP_DHCP=y
345# CONFIG_IP_PNP_BOOTP is not set
346# CONFIG_IP_PNP_RARP is not set
347# CONFIG_NET_IPIP is not set
348# CONFIG_NET_IPGRE is not set
349# CONFIG_IP_MROUTE is not set
350# CONFIG_ARPD is not set
351CONFIG_SYN_COOKIES=y
352# CONFIG_INET_AH is not set
353# CONFIG_INET_ESP is not set
354# CONFIG_INET_IPCOMP is not set
355# CONFIG_INET_TUNNEL is not set
356CONFIG_IP_TCPDIAG=y
357# CONFIG_IP_TCPDIAG_IPV6 is not set
358# CONFIG_IPV6 is not set
359# CONFIG_NETFILTER is not set
360
361#
362# SCTP Configuration (EXPERIMENTAL)
363#
364# CONFIG_IP_SCTP is not set
365# CONFIG_ATM is not set
366# CONFIG_BRIDGE is not set
367# CONFIG_VLAN_8021Q is not set
368# CONFIG_DECNET is not set
369# CONFIG_LLC2 is not set
370# CONFIG_IPX is not set
371# CONFIG_ATALK is not set
372# CONFIG_X25 is not set
373# CONFIG_LAPB is not set
374# CONFIG_NET_DIVERT is not set
375# CONFIG_ECONET is not set
376# CONFIG_WAN_ROUTER is not set
377
378#
379# QoS and/or fair queueing
380#
381# CONFIG_NET_SCHED is not set
382# CONFIG_NET_CLS_ROUTE is not set
383
384#
385# Network testing
386#
387# CONFIG_NET_PKTGEN is not set
388# CONFIG_NETPOLL is not set
389# CONFIG_NET_POLL_CONTROLLER is not set
390# CONFIG_HAMRADIO is not set
391# CONFIG_IRDA is not set
392# CONFIG_BT is not set
393CONFIG_NETDEVICES=y
394# CONFIG_DUMMY is not set
395# CONFIG_BONDING is not set
396# CONFIG_EQUALIZER is not set
397# CONFIG_TUN is not set
398
399#
400# ARCnet devices
401#
402# CONFIG_ARCNET is not set
403
404#
405# Ethernet (10 or 100Mbit)
406#
407CONFIG_NET_ETHERNET=y
408CONFIG_MII=y
409# CONFIG_HAPPYMEAL is not set
410# CONFIG_SUNGEM is not set
411# CONFIG_NET_VENDOR_3COM is not set
412
413#
414# Tulip family network device support
415#
416CONFIG_NET_TULIP=y
417# CONFIG_DE2104X is not set
418CONFIG_TULIP=y
419# CONFIG_TULIP_MWI is not set
420CONFIG_TULIP_MMIO=y
421# CONFIG_TULIP_NAPI is not set
422# CONFIG_DE4X5 is not set
423# CONFIG_WINBOND_840 is not set
424# CONFIG_DM9102 is not set
425# CONFIG_HP100 is not set
426CONFIG_NET_PCI=y
427# CONFIG_PCNET32 is not set
428# CONFIG_AMD8111_ETH is not set
429# CONFIG_ADAPTEC_STARFIRE is not set
430# CONFIG_B44 is not set
431# CONFIG_FORCEDETH is not set
432# CONFIG_DGRS is not set
433# CONFIG_EEPRO100 is not set
434CONFIG_E100=y
435# CONFIG_FEALNX is not set
436# CONFIG_NATSEMI is not set
437# CONFIG_NE2K_PCI is not set
438# CONFIG_8139CP is not set
439# CONFIG_8139TOO is not set
440# CONFIG_SIS900 is not set
441# CONFIG_EPIC100 is not set
442# CONFIG_SUNDANCE is not set
443# CONFIG_TLAN is not set
444# CONFIG_VIA_RHINE is not set
445
446#
447# Ethernet (1000 Mbit)
448#
449# CONFIG_ACENIC is not set
450# CONFIG_DL2K is not set
451# CONFIG_E1000 is not set
452# CONFIG_NS83820 is not set
453# CONFIG_HAMACHI is not set
454# CONFIG_YELLOWFIN is not set
455# CONFIG_R8169 is not set
456# CONFIG_SK98LIN is not set
457# CONFIG_VIA_VELOCITY is not set
458# CONFIG_TIGON3 is not set
459CONFIG_MV643XX_ETH=y
460CONFIG_MV643XX_ETH_0=y
461CONFIG_MV643XX_ETH_1=y
462# CONFIG_MV643XX_ETH_2 is not set
463
464#
465# Ethernet (10000 Mbit)
466#
467# CONFIG_IXGB is not set
468# CONFIG_S2IO is not set
469
470#
471# Token Ring devices
472#
473# CONFIG_TR is not set
474
475#
476# Wireless LAN (non-hamradio)
477#
478# CONFIG_NET_RADIO is not set
479
480#
481# Wan interfaces
482#
483# CONFIG_WAN is not set
484# CONFIG_FDDI is not set
485# CONFIG_HIPPI is not set
486# CONFIG_PPP is not set
487# CONFIG_SLIP is not set
488# CONFIG_SHAPER is not set
489# CONFIG_NETCONSOLE is not set
490
491#
492# ISDN subsystem
493#
494# CONFIG_ISDN is not set
495
496#
497# Telephony Support
498#
499# CONFIG_PHONE is not set
500
501#
502# Input device support
503#
504CONFIG_INPUT=y
505
506#
507# Userland interfaces
508#
509CONFIG_INPUT_MOUSEDEV=y
510CONFIG_INPUT_MOUSEDEV_PSAUX=y
511CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
512CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
513# CONFIG_INPUT_JOYDEV is not set
514# CONFIG_INPUT_TSDEV is not set
515# CONFIG_INPUT_EVDEV is not set
516# CONFIG_INPUT_EVBUG is not set
517
518#
519# Input Device Drivers
520#
521# CONFIG_INPUT_KEYBOARD is not set
522# CONFIG_INPUT_MOUSE is not set
523# CONFIG_INPUT_JOYSTICK is not set
524# CONFIG_INPUT_TOUCHSCREEN is not set
525# CONFIG_INPUT_MISC is not set
526
527#
528# Hardware I/O ports
529#
530# CONFIG_SERIO is not set
531# CONFIG_GAMEPORT is not set
532CONFIG_SOUND_GAMEPORT=y
533
534#
535# Character devices
536#
537CONFIG_VT=y
538CONFIG_VT_CONSOLE=y
539CONFIG_HW_CONSOLE=y
540# CONFIG_SERIAL_NONSTANDARD is not set
541
542#
543# Serial drivers
544#
545CONFIG_SERIAL_8250=y
546CONFIG_SERIAL_8250_CONSOLE=y
547CONFIG_SERIAL_8250_NR_UARTS=2
548# CONFIG_SERIAL_8250_EXTENDED is not set
549
550#
551# Non-8250 serial port support
552#
553# CONFIG_SERIAL_MPSC is not set
554CONFIG_SERIAL_CORE=y
555CONFIG_SERIAL_CORE_CONSOLE=y
556CONFIG_UNIX98_PTYS=y
557CONFIG_LEGACY_PTYS=y
558CONFIG_LEGACY_PTY_COUNT=256
559
560#
561# IPMI
562#
563# CONFIG_IPMI_HANDLER is not set
564
565#
566# Watchdog Cards
567#
568# CONFIG_WATCHDOG is not set
569# CONFIG_NVRAM is not set
570CONFIG_GEN_RTC=y
571# CONFIG_GEN_RTC_X is not set
572# CONFIG_DTLK is not set
573# CONFIG_R3964 is not set
574# CONFIG_APPLICOM is not set
575
576#
577# Ftape, the floppy tape device driver
578#
579# CONFIG_AGP is not set
580# CONFIG_DRM is not set
581# CONFIG_RAW_DRIVER is not set
582
583#
584# TPM devices
585#
586# CONFIG_TCG_TPM is not set
587
588#
589# I2C support
590#
591# CONFIG_I2C is not set
592
593#
594# Dallas's 1-wire bus
595#
596# CONFIG_W1 is not set
597
598#
599# Misc devices
600#
601
602#
603# Multimedia devices
604#
605# CONFIG_VIDEO_DEV is not set
606
607#
608# Digital Video Broadcasting Devices
609#
610# CONFIG_DVB is not set
611
612#
613# Graphics support
614#
615# CONFIG_FB is not set
616
617#
618# Console display driver support
619#
620# CONFIG_VGA_CONSOLE is not set
621CONFIG_DUMMY_CONSOLE=y
622
623#
624# Sound
625#
626# CONFIG_SOUND is not set
627
628#
629# USB support
630#
631# CONFIG_USB is not set
632CONFIG_USB_ARCH_HAS_HCD=y
633CONFIG_USB_ARCH_HAS_OHCI=y
634
635#
636# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
637#
638
639#
640# USB Gadget Support
641#
642# CONFIG_USB_GADGET is not set
643
644#
645# MMC/SD Card support
646#
647# CONFIG_MMC is not set
648
649#
650# InfiniBand support
651#
652# CONFIG_INFINIBAND is not set
653
654#
655# File systems
656#
657CONFIG_EXT2_FS=y
658# CONFIG_EXT2_FS_XATTR is not set
659# CONFIG_EXT3_FS is not set
660# CONFIG_JBD is not set
661# CONFIG_REISERFS_FS is not set
662# CONFIG_JFS_FS is not set
663
664#
665# XFS support
666#
667# CONFIG_XFS_FS is not set
668# CONFIG_MINIX_FS is not set
669# CONFIG_ROMFS_FS is not set
670# CONFIG_QUOTA is not set
671CONFIG_DNOTIFY=y
672# CONFIG_AUTOFS_FS is not set
673# CONFIG_AUTOFS4_FS is not set
674
675#
676# CD-ROM/DVD Filesystems
677#
678# CONFIG_ISO9660_FS is not set
679# CONFIG_UDF_FS is not set
680
681#
682# DOS/FAT/NT Filesystems
683#
684# CONFIG_MSDOS_FS is not set
685# CONFIG_VFAT_FS is not set
686# CONFIG_NTFS_FS is not set
687
688#
689# Pseudo filesystems
690#
691CONFIG_PROC_FS=y
692CONFIG_PROC_KCORE=y
693CONFIG_SYSFS=y
694CONFIG_DEVFS_FS=y
695CONFIG_DEVFS_MOUNT=y
696# CONFIG_DEVFS_DEBUG is not set
697# CONFIG_DEVPTS_FS_XATTR is not set
698CONFIG_TMPFS=y
699# CONFIG_TMPFS_XATTR is not set
700# CONFIG_HUGETLB_PAGE is not set
701CONFIG_RAMFS=y
702
703#
704# Miscellaneous filesystems
705#
706# CONFIG_ADFS_FS is not set
707# CONFIG_AFFS_FS is not set
708# CONFIG_HFS_FS is not set
709# CONFIG_HFSPLUS_FS is not set
710# CONFIG_BEFS_FS is not set
711# CONFIG_BFS_FS is not set
712# CONFIG_EFS_FS is not set
713# CONFIG_JFFS_FS is not set
714CONFIG_JFFS2_FS=y
715CONFIG_JFFS2_FS_DEBUG=0
716# CONFIG_JFFS2_FS_NAND is not set
717# CONFIG_JFFS2_FS_NOR_ECC is not set
718# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
719CONFIG_JFFS2_ZLIB=y
720CONFIG_JFFS2_RTIME=y
721# CONFIG_JFFS2_RUBIN is not set
722# CONFIG_CRAMFS is not set
723# CONFIG_VXFS_FS is not set
724# CONFIG_HPFS_FS is not set
725# CONFIG_QNX4FS_FS is not set
726# CONFIG_SYSV_FS is not set
727# CONFIG_UFS_FS is not set
728
729#
730# Network File Systems
731#
732CONFIG_NFS_FS=y
733CONFIG_NFS_V3=y
734# CONFIG_NFS_V4 is not set
735# CONFIG_NFS_DIRECTIO is not set
736# CONFIG_NFSD is not set
737CONFIG_ROOT_NFS=y
738CONFIG_LOCKD=y
739CONFIG_LOCKD_V4=y
740CONFIG_SUNRPC=y
741# CONFIG_RPCSEC_GSS_KRB5 is not set
742# CONFIG_RPCSEC_GSS_SPKM3 is not set
743# CONFIG_SMB_FS is not set
744# CONFIG_CIFS is not set
745# CONFIG_NCP_FS is not set
746# CONFIG_CODA_FS is not set
747# CONFIG_AFS_FS is not set
748
749#
750# Partition Types
751#
752# CONFIG_PARTITION_ADVANCED is not set
753CONFIG_MSDOS_PARTITION=y
754
755#
756# Native Language Support
757#
758# CONFIG_NLS is not set
759
760#
761# Library routines
762#
763# CONFIG_CRC_CCITT is not set
764CONFIG_CRC32=y
765# CONFIG_LIBCRC32C is not set
766CONFIG_ZLIB_INFLATE=y
767CONFIG_ZLIB_DEFLATE=y
768
769#
770# Profiling support
771#
772# CONFIG_PROFILING is not set
773
774#
775# Kernel hacking
776#
777# CONFIG_DEBUG_KERNEL is not set
778# CONFIG_PRINTK_TIME is not set
779# CONFIG_SERIAL_TEXT_DEBUG is not set
780
781#
782# Security options
783#
784# CONFIG_KEYS is not set
785# CONFIG_SECURITY is not set
786
787#
788# Cryptographic options
789#
790# CONFIG_CRYPTO is not set
791
792#
793# Hardware crypto devices
794#
diff --git a/arch/ppc/configs/cpci405_defconfig b/arch/ppc/configs/cpci405_defconfig
deleted file mode 100644
index a336ffa8ff41..000000000000
--- a/arch/ppc/configs/cpci405_defconfig
+++ /dev/null
@@ -1,631 +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
24# CONFIG_BSD_PROCESS_ACCT is not set
25CONFIG_SYSCTL=y
26CONFIG_LOG_BUF_SHIFT=14
27# CONFIG_HOTPLUG is not set
28# CONFIG_IKCONFIG is not set
29CONFIG_EMBEDDED=y
30# CONFIG_KALLSYMS is not set
31CONFIG_FUTEX=y
32# CONFIG_EPOLL is not set
33CONFIG_IOSCHED_NOOP=y
34CONFIG_IOSCHED_AS=y
35CONFIG_IOSCHED_DEADLINE=y
36# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
37
38#
39# Loadable module support
40#
41CONFIG_MODULES=y
42CONFIG_MODULE_UNLOAD=y
43# CONFIG_MODULE_FORCE_UNLOAD is not set
44CONFIG_OBSOLETE_MODPARM=y
45# CONFIG_MODVERSIONS is not set
46CONFIG_KMOD=y
47
48#
49# Processor
50#
51# CONFIG_6xx is not set
52CONFIG_40x=y
53# CONFIG_44x is not set
54# CONFIG_POWER3 is not set
55# CONFIG_POWER4 is not set
56# CONFIG_8xx is not set
57# CONFIG_MATH_EMULATION is not set
58# CONFIG_CPU_FREQ is not set
59CONFIG_4xx=y
60
61#
62# IBM 4xx options
63#
64# CONFIG_ASH is not set
65CONFIG_CPCI405=y
66# CONFIG_EP405 is not set
67# CONFIG_EVB405EP is not set
68# CONFIG_OAK is not set
69# CONFIG_REDWOOD_5 is not set
70# CONFIG_REDWOOD_6 is not set
71# CONFIG_SYCAMORE is not set
72# CONFIG_WALNUT is not set
73CONFIG_IBM405_ERR77=y
74CONFIG_IBM405_ERR51=y
75CONFIG_IBM_OCP=y
76CONFIG_PPC_OCP=y
77CONFIG_405GP=y
78# CONFIG_PM is not set
79CONFIG_UART0_TTYS0=y
80# CONFIG_UART0_TTYS1 is not set
81CONFIG_NOT_COHERENT_CACHE=y
82
83#
84# Platform options
85#
86# CONFIG_PC_KEYBOARD is not set
87# CONFIG_SMP is not set
88# CONFIG_PREEMPT is not set
89# CONFIG_HIGHMEM is not set
90CONFIG_KERNEL_ELF=y
91CONFIG_BINFMT_ELF=y
92# CONFIG_BINFMT_MISC is not set
93CONFIG_CMDLINE_BOOL=y
94CONFIG_CMDLINE="ip=on"
95
96#
97# Bus options
98#
99CONFIG_PCI=y
100CONFIG_PCI_DOMAINS=y
101CONFIG_PCI_LEGACY_PROC=y
102# CONFIG_PCI_NAMES is not set
103
104#
105# Advanced setup
106#
107# CONFIG_ADVANCED_OPTIONS is not set
108
109#
110# Default settings for advanced configuration options are used
111#
112CONFIG_HIGHMEM_START=0xfe000000
113CONFIG_LOWMEM_SIZE=0x30000000
114CONFIG_KERNEL_START=0xc0000000
115CONFIG_TASK_SIZE=0x80000000
116CONFIG_BOOT_LOAD=0x00400000
117
118#
119# Device Drivers
120#
121
122#
123# Generic Driver Options
124#
125
126#
127# Memory Technology Devices (MTD)
128#
129# CONFIG_MTD is not set
130
131#
132# Parallel port support
133#
134# CONFIG_PARPORT is not set
135
136#
137# Plug and Play support
138#
139
140#
141# Block devices
142#
143# CONFIG_BLK_DEV_FD is not set
144# CONFIG_BLK_CPQ_DA is not set
145# CONFIG_BLK_CPQ_CISS_DA is not set
146# CONFIG_BLK_DEV_DAC960 is not set
147# CONFIG_BLK_DEV_UMEM is not set
148# CONFIG_BLK_DEV_LOOP is not set
149# CONFIG_BLK_DEV_NBD is not set
150# CONFIG_BLK_DEV_CARMEL is not set
151CONFIG_BLK_DEV_RAM=y
152CONFIG_BLK_DEV_RAM_SIZE=4096
153CONFIG_BLK_DEV_INITRD=y
154# CONFIG_LBD is not set
155
156#
157# ATA/ATAPI/MFM/RLL support
158#
159CONFIG_IDE=y
160CONFIG_BLK_DEV_IDE=y
161
162#
163# Please see Documentation/ide.txt for help/info on IDE drives
164#
165CONFIG_BLK_DEV_IDEDISK=y
166# CONFIG_IDEDISK_MULTI_MODE is not set
167# CONFIG_IDEDISK_STROKE is not set
168# CONFIG_BLK_DEV_IDECD is not set
169# CONFIG_BLK_DEV_IDETAPE is not set
170# CONFIG_BLK_DEV_IDEFLOPPY is not set
171# CONFIG_IDE_TASK_IOCTL is not set
172# CONFIG_IDE_TASKFILE_IO is not set
173
174#
175# IDE chipset support/bugfixes
176#
177CONFIG_IDE_GENERIC=y
178# CONFIG_BLK_DEV_IDEPCI is not set
179# CONFIG_BLK_DEV_IDEDMA is not set
180# CONFIG_IDEDMA_AUTO is not set
181# CONFIG_BLK_DEV_HD is not set
182
183#
184# SCSI device support
185#
186# CONFIG_SCSI is not set
187
188#
189# Multi-device support (RAID and LVM)
190#
191# CONFIG_MD is not set
192
193#
194# Fusion MPT device support
195#
196# CONFIG_FUSION is not set
197
198#
199# IEEE 1394 (FireWire) support
200#
201# CONFIG_IEEE1394 is not set
202
203#
204# I2O device support
205#
206# CONFIG_I2O is not set
207
208#
209# Macintosh device drivers
210#
211
212#
213# Networking support
214#
215CONFIG_NET=y
216
217#
218# Networking options
219#
220# CONFIG_PACKET is not set
221# CONFIG_NETLINK_DEV is not set
222CONFIG_UNIX=y
223# CONFIG_NET_KEY is not set
224CONFIG_INET=y
225CONFIG_IP_MULTICAST=y
226# CONFIG_IP_ADVANCED_ROUTER is not set
227CONFIG_IP_PNP=y
228# CONFIG_IP_PNP_DHCP is not set
229CONFIG_IP_PNP_BOOTP=y
230# CONFIG_IP_PNP_RARP is not set
231# CONFIG_NET_IPIP is not set
232# CONFIG_NET_IPGRE is not set
233# CONFIG_IP_MROUTE is not set
234# CONFIG_ARPD is not set
235CONFIG_SYN_COOKIES=y
236# CONFIG_INET_AH is not set
237# CONFIG_INET_ESP is not set
238# CONFIG_INET_IPCOMP is not set
239# CONFIG_IPV6 is not set
240# CONFIG_DECNET is not set
241# CONFIG_BRIDGE is not set
242# CONFIG_NETFILTER is not set
243
244#
245# SCTP Configuration (EXPERIMENTAL)
246#
247# CONFIG_IP_SCTP is not set
248# CONFIG_ATM is not set
249# CONFIG_VLAN_8021Q is not set
250# CONFIG_LLC2 is not set
251# CONFIG_IPX is not set
252# CONFIG_ATALK is not set
253# CONFIG_X25 is not set
254# CONFIG_LAPB is not set
255# CONFIG_NET_DIVERT is not set
256# CONFIG_ECONET is not set
257# CONFIG_WAN_ROUTER is not set
258# CONFIG_NET_HW_FLOWCONTROL is not set
259
260#
261# QoS and/or fair queueing
262#
263# CONFIG_NET_SCHED is not set
264
265#
266# Network testing
267#
268# CONFIG_NET_PKTGEN is not set
269CONFIG_NETDEVICES=y
270
271#
272# ARCnet devices
273#
274# CONFIG_ARCNET is not set
275# CONFIG_DUMMY is not set
276# CONFIG_BONDING is not set
277# CONFIG_EQUALIZER is not set
278# CONFIG_TUN is not set
279
280#
281# Ethernet (10 or 100Mbit)
282#
283# CONFIG_NET_ETHERNET is not set
284
285#
286# Ethernet (1000 Mbit)
287#
288# CONFIG_ACENIC is not set
289# CONFIG_DL2K is not set
290# CONFIG_E1000 is not set
291# CONFIG_NS83820 is not set
292# CONFIG_HAMACHI is not set
293# CONFIG_YELLOWFIN is not set
294# CONFIG_R8169 is not set
295# CONFIG_SIS190 is not set
296# CONFIG_SK98LIN is not set
297# CONFIG_TIGON3 is not set
298
299#
300# Ethernet (10000 Mbit)
301#
302# CONFIG_IXGB is not set
303CONFIG_IBM_EMAC=y
304# CONFIG_IBM_EMAC_ERRMSG is not set
305CONFIG_IBM_EMAC_RXB=64
306CONFIG_IBM_EMAC_TXB=8
307CONFIG_IBM_EMAC_FGAP=8
308CONFIG_IBM_EMAC_SKBRES=0
309# CONFIG_FDDI is not set
310# CONFIG_HIPPI is not set
311# CONFIG_PPP is not set
312# CONFIG_SLIP is not set
313
314#
315# Wireless LAN (non-hamradio)
316#
317# CONFIG_NET_RADIO is not set
318
319#
320# Token Ring devices
321#
322# CONFIG_TR is not set
323# CONFIG_RCPCI is not set
324# CONFIG_SHAPER is not set
325# CONFIG_NETCONSOLE is not set
326
327#
328# Wan interfaces
329#
330# CONFIG_WAN is not set
331
332#
333# Amateur Radio support
334#
335# CONFIG_HAMRADIO is not set
336
337#
338# IrDA (infrared) support
339#
340# CONFIG_IRDA is not set
341
342#
343# Bluetooth support
344#
345# CONFIG_BT is not set
346# CONFIG_NETPOLL is not set
347# CONFIG_NET_POLL_CONTROLLER is not set
348
349#
350# ISDN subsystem
351#
352# CONFIG_ISDN is not set
353
354#
355# Telephony Support
356#
357# CONFIG_PHONE is not set
358
359#
360# Input device support
361#
362CONFIG_INPUT=y
363
364#
365# Userland interfaces
366#
367# CONFIG_INPUT_MOUSEDEV is not set
368# CONFIG_INPUT_JOYDEV is not set
369# CONFIG_INPUT_TSDEV is not set
370# CONFIG_INPUT_EVDEV is not set
371# CONFIG_INPUT_EVBUG is not set
372
373#
374# Input I/O drivers
375#
376# CONFIG_GAMEPORT is not set
377CONFIG_SOUND_GAMEPORT=y
378CONFIG_SERIO=y
379# CONFIG_SERIO_I8042 is not set
380# CONFIG_SERIO_SERPORT is not set
381# CONFIG_SERIO_CT82C710 is not set
382# CONFIG_SERIO_PCIPS2 is not set
383
384#
385# Input Device Drivers
386#
387# CONFIG_INPUT_KEYBOARD is not set
388# CONFIG_INPUT_MOUSE is not set
389# CONFIG_INPUT_JOYSTICK is not set
390# CONFIG_INPUT_TOUCHSCREEN is not set
391# CONFIG_INPUT_MISC is not set
392
393#
394# Character devices
395#
396# CONFIG_VT is not set
397# CONFIG_SERIAL_NONSTANDARD is not set
398
399#
400# Serial drivers
401#
402CONFIG_SERIAL_8250=y
403CONFIG_SERIAL_8250_CONSOLE=y
404CONFIG_SERIAL_8250_NR_UARTS=4
405# CONFIG_SERIAL_8250_EXTENDED is not set
406
407#
408# Non-8250 serial port support
409#
410CONFIG_SERIAL_CORE=y
411CONFIG_SERIAL_CORE_CONSOLE=y
412# CONFIG_UNIX98_PTYS is not set
413CONFIG_LEGACY_PTYS=y
414CONFIG_LEGACY_PTY_COUNT=256
415# CONFIG_QIC02_TAPE is not set
416
417#
418# IPMI
419#
420# CONFIG_IPMI_HANDLER is not set
421
422#
423# Watchdog Cards
424#
425# CONFIG_WATCHDOG is not set
426# CONFIG_NVRAM is not set
427CONFIG_GEN_RTC=y
428# CONFIG_GEN_RTC_X is not set
429# CONFIG_DTLK is not set
430# CONFIG_R3964 is not set
431# CONFIG_APPLICOM is not set
432
433#
434# Ftape, the floppy tape device driver
435#
436# CONFIG_FTAPE is not set
437# CONFIG_AGP is not set
438# CONFIG_DRM is not set
439# CONFIG_RAW_DRIVER is not set
440
441#
442# I2C support
443#
444# CONFIG_I2C is not set
445
446#
447# Misc devices
448#
449
450#
451# Multimedia devices
452#
453# CONFIG_VIDEO_DEV is not set
454
455#
456# Digital Video Broadcasting Devices
457#
458# CONFIG_DVB is not set
459
460#
461# Graphics support
462#
463# CONFIG_FB is not set
464
465#
466# Sound
467#
468# CONFIG_SOUND is not set
469
470#
471# USB support
472#
473# CONFIG_USB is not set
474
475#
476# USB Gadget Support
477#
478# CONFIG_USB_GADGET is not set
479
480#
481# File systems
482#
483CONFIG_EXT2_FS=y
484# CONFIG_EXT2_FS_XATTR is not set
485# CONFIG_EXT3_FS is not set
486# CONFIG_JBD is not set
487# CONFIG_REISERFS_FS is not set
488# CONFIG_JFS_FS is not set
489# CONFIG_XFS_FS is not set
490# CONFIG_MINIX_FS is not set
491# CONFIG_ROMFS_FS is not set
492# CONFIG_QUOTA is not set
493# CONFIG_AUTOFS_FS is not set
494# CONFIG_AUTOFS4_FS is not set
495
496#
497# CD-ROM/DVD Filesystems
498#
499# CONFIG_ISO9660_FS is not set
500# CONFIG_UDF_FS is not set
501
502#
503# DOS/FAT/NT Filesystems
504#
505CONFIG_FAT_FS=y
506CONFIG_MSDOS_FS=y
507# CONFIG_VFAT_FS is not set
508# CONFIG_NTFS_FS is not set
509
510#
511# Pseudo filesystems
512#
513CONFIG_PROC_FS=y
514CONFIG_PROC_KCORE=y
515# CONFIG_DEVFS_FS is not set
516CONFIG_TMPFS=y
517# CONFIG_HUGETLB_PAGE is not set
518CONFIG_RAMFS=y
519
520#
521# Miscellaneous filesystems
522#
523# CONFIG_ADFS_FS is not set
524# CONFIG_AFFS_FS is not set
525# CONFIG_HFS_FS is not set
526# CONFIG_HFSPLUS_FS is not set
527# CONFIG_BEFS_FS is not set
528# CONFIG_BFS_FS is not set
529# CONFIG_EFS_FS is not set
530# CONFIG_CRAMFS is not set
531# CONFIG_VXFS_FS is not set
532# CONFIG_HPFS_FS is not set
533# CONFIG_QNX4FS_FS is not set
534# CONFIG_SYSV_FS is not set
535# CONFIG_UFS_FS is not set
536
537#
538# Network File Systems
539#
540CONFIG_NFS_FS=y
541CONFIG_NFS_V3=y
542# CONFIG_NFS_V4 is not set
543# CONFIG_NFS_DIRECTIO is not set
544# CONFIG_NFSD is not set
545CONFIG_ROOT_NFS=y
546CONFIG_LOCKD=y
547CONFIG_LOCKD_V4=y
548# CONFIG_EXPORTFS is not set
549CONFIG_SUNRPC=y
550# CONFIG_RPCSEC_GSS_KRB5 is not set
551# CONFIG_SMB_FS is not set
552# CONFIG_CIFS is not set
553# CONFIG_NCP_FS is not set
554# CONFIG_CODA_FS is not set
555# CONFIG_INTERMEZZO_FS is not set
556# CONFIG_AFS_FS is not set
557
558#
559# Partition Types
560#
561# CONFIG_PARTITION_ADVANCED is not set
562CONFIG_MSDOS_PARTITION=y
563
564#
565# Native Language Support
566#
567CONFIG_NLS=y
568CONFIG_NLS_DEFAULT="iso8859-1"
569# CONFIG_NLS_CODEPAGE_437 is not set
570# CONFIG_NLS_CODEPAGE_737 is not set
571# CONFIG_NLS_CODEPAGE_775 is not set
572# CONFIG_NLS_CODEPAGE_850 is not set
573# CONFIG_NLS_CODEPAGE_852 is not set
574# CONFIG_NLS_CODEPAGE_855 is not set
575# CONFIG_NLS_CODEPAGE_857 is not set
576# CONFIG_NLS_CODEPAGE_860 is not set
577# CONFIG_NLS_CODEPAGE_861 is not set
578# CONFIG_NLS_CODEPAGE_862 is not set
579# CONFIG_NLS_CODEPAGE_863 is not set
580# CONFIG_NLS_CODEPAGE_864 is not set
581# CONFIG_NLS_CODEPAGE_865 is not set
582# CONFIG_NLS_CODEPAGE_866 is not set
583# CONFIG_NLS_CODEPAGE_869 is not set
584# CONFIG_NLS_CODEPAGE_936 is not set
585# CONFIG_NLS_CODEPAGE_950 is not set
586# CONFIG_NLS_CODEPAGE_932 is not set
587# CONFIG_NLS_CODEPAGE_949 is not set
588# CONFIG_NLS_CODEPAGE_874 is not set
589# CONFIG_NLS_ISO8859_8 is not set
590# CONFIG_NLS_CODEPAGE_1250 is not set
591# CONFIG_NLS_CODEPAGE_1251 is not set
592CONFIG_NLS_ISO8859_1=y
593# CONFIG_NLS_ISO8859_2 is not set
594# CONFIG_NLS_ISO8859_3 is not set
595# CONFIG_NLS_ISO8859_4 is not set
596# CONFIG_NLS_ISO8859_5 is not set
597# CONFIG_NLS_ISO8859_6 is not set
598# CONFIG_NLS_ISO8859_7 is not set
599# CONFIG_NLS_ISO8859_9 is not set
600# CONFIG_NLS_ISO8859_13 is not set
601# CONFIG_NLS_ISO8859_14 is not set
602# CONFIG_NLS_ISO8859_15 is not set
603# CONFIG_NLS_KOI8_R is not set
604# CONFIG_NLS_KOI8_U is not set
605# CONFIG_NLS_UTF8 is not set
606
607#
608# IBM 40x options
609#
610
611#
612# Library routines
613#
614CONFIG_CRC32=y
615
616#
617# Kernel hacking
618#
619# CONFIG_DEBUG_KERNEL is not set
620# CONFIG_SERIAL_TEXT_DEBUG is not set
621CONFIG_OCP=y
622
623#
624# Security options
625#
626# CONFIG_SECURITY is not set
627
628#
629# Cryptographic options
630#
631# CONFIG_CRYPTO is not set
diff --git a/arch/ppc/configs/cpci690_defconfig b/arch/ppc/configs/cpci690_defconfig
deleted file mode 100644
index ff3f7e02ab0f..000000000000
--- a/arch/ppc/configs/cpci690_defconfig
+++ /dev/null
@@ -1,798 +0,0 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.13-mm1
4# Thu Sep 1 17:10:37 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_LOCALVERSION_AUTO=y
29# CONFIG_SWAP is not set
30CONFIG_SYSVIPC=y
31# CONFIG_POSIX_MQUEUE is not set
32# CONFIG_BSD_PROCESS_ACCT is not set
33CONFIG_SYSCTL=y
34# CONFIG_AUDIT is not set
35# CONFIG_HOTPLUG is not set
36CONFIG_KOBJECT_UEVENT=y
37# CONFIG_IKCONFIG is not set
38CONFIG_INITRAMFS_SOURCE=""
39# CONFIG_EMBEDDED is not set
40CONFIG_KALLSYMS=y
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
62# CONFIG_MODVERSIONS is not set
63# CONFIG_MODULE_SRCVERSION_ALL is not set
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
79# CONFIG_TAU is not set
80# CONFIG_KEXEC is not set
81# CONFIG_CPU_FREQ is not set
82# CONFIG_WANT_EARLY_SERIAL is not set
83CONFIG_PPC_STD_MMU=y
84# CONFIG_NOT_COHERENT_CACHE is not set
85
86#
87# Performance-monitoring counters support
88#
89# CONFIG_PERFCTR is not set
90
91#
92# Platform options
93#
94# CONFIG_PPC_MULTIPLATFORM is not set
95# CONFIG_APUS is not set
96# CONFIG_KATANA is not set
97# CONFIG_WILLOW is not set
98CONFIG_CPCI690=y
99# CONFIG_POWERPMC250 is not set
100# CONFIG_CHESTNUT is not set
101# CONFIG_SPRUCE is not set
102# CONFIG_HDPU is not set
103# CONFIG_EV64260 is not set
104# CONFIG_LOPEC is not set
105# CONFIG_MVME5100 is not set
106# CONFIG_PPLUS is not set
107# CONFIG_PRPMC750 is not set
108# CONFIG_PRPMC800 is not set
109# CONFIG_SANDPOINT is not set
110# CONFIG_RADSTONE_PPC7D is not set
111# CONFIG_PAL4 is not set
112# CONFIG_GEMINI is not set
113# CONFIG_EST8260 is not set
114# CONFIG_SBC82xx is not set
115# CONFIG_SBS8260 is not set
116# CONFIG_RPX8260 is not set
117# CONFIG_TQM8260 is not set
118# CONFIG_ADS8272 is not set
119# CONFIG_PQ2FADS is not set
120# CONFIG_LITE5200 is not set
121# CONFIG_MPC834x_SYS is not set
122# CONFIG_EV64360 is not set
123CONFIG_GT64260=y
124CONFIG_MV64X60=y
125
126#
127# Set bridge options
128#
129CONFIG_MV64X60_BASE=0xf1000000
130CONFIG_MV64X60_NEW_BASE=0xf1000000
131# CONFIG_SMP is not set
132CONFIG_HIGHMEM=y
133CONFIG_HZ_100=y
134# CONFIG_HZ_250 is not set
135# CONFIG_HZ_1000 is not set
136CONFIG_HZ=100
137CONFIG_PREEMPT_NONE=y
138# CONFIG_PREEMPT_VOLUNTARY is not set
139# CONFIG_PREEMPT is not set
140CONFIG_SELECT_MEMORY_MODEL=y
141CONFIG_FLATMEM_MANUAL=y
142# CONFIG_DISCONTIGMEM_MANUAL is not set
143# CONFIG_SPARSEMEM_MANUAL is not set
144CONFIG_FLATMEM=y
145CONFIG_FLAT_NODE_MEM_MAP=y
146# CONFIG_SPARSEMEM_STATIC is not set
147CONFIG_BINFMT_ELF=y
148CONFIG_BINFMT_MISC=y
149CONFIG_CMDLINE_BOOL=y
150CONFIG_CMDLINE="console=ttyMM0 ip=on"
151# CONFIG_PM is not set
152CONFIG_SECCOMP=y
153CONFIG_ISA_DMA_API=y
154
155#
156# Bus options
157#
158CONFIG_GENERIC_ISA_DMA=y
159CONFIG_PCI=y
160CONFIG_PCI_DOMAINS=y
161CONFIG_PCI_LEGACY_PROC=y
162
163#
164# PCCARD (PCMCIA/CardBus) support
165#
166# CONFIG_PCCARD is not set
167
168#
169# Advanced setup
170#
171# CONFIG_ADVANCED_OPTIONS is not set
172
173#
174# Default settings for advanced configuration options are used
175#
176CONFIG_HIGHMEM_START=0xfe000000
177CONFIG_LOWMEM_SIZE=0x30000000
178CONFIG_KERNEL_START=0xc0000000
179CONFIG_TASK_SIZE=0x80000000
180CONFIG_BOOT_LOAD=0x00800000
181
182#
183# Networking
184#
185CONFIG_NET=y
186
187#
188# Networking options
189#
190CONFIG_PACKET=y
191# CONFIG_PACKET_MMAP is not set
192CONFIG_UNIX=y
193# CONFIG_NET_KEY is not set
194CONFIG_INET=y
195CONFIG_IP_MULTICAST=y
196# CONFIG_IP_ADVANCED_ROUTER is not set
197CONFIG_IP_FIB_HASH=y
198CONFIG_IP_PNP=y
199CONFIG_IP_PNP_DHCP=y
200# CONFIG_IP_PNP_BOOTP is not set
201# CONFIG_IP_PNP_RARP is not set
202# CONFIG_NET_IPIP is not set
203# CONFIG_NET_IPGRE is not set
204# CONFIG_IP_MROUTE is not set
205# CONFIG_ARPD is not set
206CONFIG_SYN_COOKIES=y
207# CONFIG_INET_AH is not set
208# CONFIG_INET_ESP is not set
209# CONFIG_INET_IPCOMP is not set
210# CONFIG_INET_TUNNEL is not set
211CONFIG_INET_DIAG=y
212CONFIG_INET_TCP_DIAG=y
213# CONFIG_TCP_CONG_ADVANCED is not set
214CONFIG_TCP_CONG_BIC=y
215# CONFIG_IPV6 is not set
216# CONFIG_NETFILTER is not set
217
218#
219# DCCP Configuration (EXPERIMENTAL)
220#
221# CONFIG_IP_DCCP is not set
222
223#
224# SCTP Configuration (EXPERIMENTAL)
225#
226# CONFIG_IP_SCTP is not set
227# CONFIG_ATM is not set
228# CONFIG_BRIDGE is not set
229# CONFIG_VLAN_8021Q is not set
230# CONFIG_DECNET is not set
231# CONFIG_LLC2 is not set
232# CONFIG_IPX is not set
233# CONFIG_ATALK is not set
234# CONFIG_X25 is not set
235# CONFIG_LAPB is not set
236# CONFIG_NET_DIVERT is not set
237# CONFIG_ECONET is not set
238# CONFIG_WAN_ROUTER is not set
239# CONFIG_NET_SCHED is not set
240# CONFIG_NET_CLS_ROUTE is not set
241
242#
243# Network testing
244#
245# CONFIG_NET_PKTGEN is not set
246# CONFIG_NETFILTER_NETLINK is not set
247# CONFIG_HAMRADIO is not set
248# CONFIG_IRDA is not set
249# CONFIG_BT is not set
250# CONFIG_IEEE80211 is not set
251
252#
253# Device Drivers
254#
255
256#
257# Generic Driver Options
258#
259CONFIG_STANDALONE=y
260CONFIG_PREVENT_FIRMWARE_BUILD=y
261# CONFIG_FW_LOADER is not set
262
263#
264# Memory Technology Devices (MTD)
265#
266# CONFIG_MTD is not set
267
268#
269# Parallel port support
270#
271# CONFIG_PARPORT is not set
272
273#
274# Plug and Play support
275#
276
277#
278# Block devices
279#
280# CONFIG_BLK_DEV_FD is not set
281# CONFIG_BLK_CPQ_DA is not set
282# CONFIG_BLK_CPQ_CISS_DA is not set
283# CONFIG_BLK_DEV_DAC960 is not set
284# CONFIG_BLK_DEV_UMEM is not set
285# CONFIG_BLK_DEV_COW_COMMON is not set
286CONFIG_BLK_DEV_LOOP=y
287# CONFIG_BLK_DEV_CRYPTOLOOP is not set
288# CONFIG_BLK_DEV_NBD is not set
289# CONFIG_BLK_DEV_SX8 is not set
290CONFIG_BLK_DEV_RAM=y
291CONFIG_BLK_DEV_RAM_COUNT=16
292CONFIG_BLK_DEV_RAM_SIZE=4096
293CONFIG_BLK_DEV_INITRD=y
294# CONFIG_LBD is not set
295# CONFIG_CDROM_PKTCDVD is not set
296
297#
298# IO Schedulers
299#
300CONFIG_IOSCHED_NOOP=y
301CONFIG_IOSCHED_AS=y
302CONFIG_IOSCHED_DEADLINE=y
303CONFIG_IOSCHED_CFQ=y
304# CONFIG_ATA_OVER_ETH is not set
305
306#
307# ATA/ATAPI/MFM/RLL support
308#
309# CONFIG_IDE is not set
310
311#
312# SCSI device support
313#
314# CONFIG_RAID_ATTRS is not set
315# CONFIG_SCSI is not set
316
317#
318# Multi-device support (RAID and LVM)
319#
320# CONFIG_MD is not set
321
322#
323# Fusion MPT device support
324#
325# CONFIG_FUSION is not set
326
327#
328# IEEE 1394 (FireWire) support
329#
330# CONFIG_IEEE1394 is not set
331
332#
333# I2O device support
334#
335# CONFIG_I2O is not set
336
337#
338# Macintosh device drivers
339#
340
341#
342# Network device support
343#
344CONFIG_NETDEVICES=y
345# CONFIG_DUMMY is not set
346# CONFIG_BONDING is not set
347# CONFIG_EQUALIZER is not set
348# CONFIG_TUN is not set
349
350#
351# ARCnet devices
352#
353# CONFIG_ARCNET is not set
354
355#
356# PHY device support
357#
358# CONFIG_PHYLIB is not set
359
360#
361# Ethernet (10 or 100Mbit)
362#
363CONFIG_NET_ETHERNET=y
364CONFIG_MII=y
365# CONFIG_HAPPYMEAL is not set
366# CONFIG_SUNGEM is not set
367# CONFIG_NET_VENDOR_3COM is not set
368
369#
370# Tulip family network device support
371#
372CONFIG_NET_TULIP=y
373# CONFIG_DE2104X is not set
374CONFIG_TULIP=y
375# CONFIG_TULIP_MWI is not set
376# CONFIG_TULIP_MMIO is not set
377# CONFIG_TULIP_NAPI is not set
378# CONFIG_DE4X5 is not set
379# CONFIG_WINBOND_840 is not set
380# CONFIG_DM9102 is not set
381# CONFIG_ULI526X is not set
382# CONFIG_HP100 is not set
383CONFIG_NET_PCI=y
384# CONFIG_PCNET32 is not set
385# CONFIG_AMD8111_ETH is not set
386# CONFIG_ADAPTEC_STARFIRE is not set
387# CONFIG_B44 is not set
388# CONFIG_FORCEDETH is not set
389# CONFIG_DGRS is not set
390CONFIG_EEPRO100=y
391# CONFIG_E100 is not set
392# CONFIG_FEALNX is not set
393# CONFIG_NATSEMI is not set
394# CONFIG_NE2K_PCI is not set
395# CONFIG_8139CP is not set
396# CONFIG_8139TOO is not set
397# CONFIG_SIS900 is not set
398# CONFIG_EPIC100 is not set
399# CONFIG_SUNDANCE is not set
400# CONFIG_TLAN is not set
401# CONFIG_VIA_RHINE is not set
402
403#
404# Ethernet (1000 Mbit)
405#
406# CONFIG_ACENIC is not set
407# CONFIG_DL2K is not set
408# CONFIG_E1000 is not set
409# CONFIG_NS83820 is not set
410# CONFIG_HAMACHI is not set
411# CONFIG_YELLOWFIN is not set
412# CONFIG_R8169 is not set
413# CONFIG_SIS190 is not set
414# CONFIG_SKGE is not set
415# CONFIG_SKY2 is not set
416# CONFIG_SK98LIN is not set
417# CONFIG_VIA_VELOCITY is not set
418# CONFIG_TIGON3 is not set
419# CONFIG_BNX2 is not set
420
421#
422# Ethernet (10000 Mbit)
423#
424# CONFIG_CHELSIO_T1 is not set
425# CONFIG_IXGB is not set
426# CONFIG_S2IO is not set
427
428#
429# Token Ring devices
430#
431# CONFIG_TR is not set
432
433#
434# Wireless LAN (non-hamradio)
435#
436# CONFIG_NET_RADIO is not set
437
438#
439# Wan interfaces
440#
441# CONFIG_WAN is not set
442# CONFIG_FDDI is not set
443# CONFIG_HIPPI is not set
444# CONFIG_PPP is not set
445# CONFIG_SLIP is not set
446# CONFIG_SHAPER is not set
447# CONFIG_NETCONSOLE is not set
448# CONFIG_KGDBOE is not set
449# CONFIG_NETPOLL is not set
450# CONFIG_NETPOLL_RX is not set
451# CONFIG_NETPOLL_TRAP is not set
452# CONFIG_NET_POLL_CONTROLLER is not set
453
454#
455# ISDN subsystem
456#
457# CONFIG_ISDN is not set
458
459#
460# Telephony Support
461#
462# CONFIG_PHONE is not set
463
464#
465# Input device support
466#
467CONFIG_INPUT=y
468
469#
470# Userland interfaces
471#
472CONFIG_INPUT_MOUSEDEV=y
473CONFIG_INPUT_MOUSEDEV_PSAUX=y
474CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
475CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
476# CONFIG_INPUT_JOYDEV is not set
477# CONFIG_INPUT_TSDEV is not set
478# CONFIG_INPUT_EVDEV is not set
479# CONFIG_INPUT_EVBUG is not set
480
481#
482# Input Device Drivers
483#
484# CONFIG_INPUT_KEYBOARD is not set
485# CONFIG_INPUT_MOUSE is not set
486# CONFIG_INPUT_JOYSTICK is not set
487# CONFIG_INPUT_TOUCHSCREEN is not set
488# CONFIG_INPUT_MISC is not set
489
490#
491# Hardware I/O ports
492#
493# CONFIG_SERIO is not set
494# CONFIG_GAMEPORT is not set
495
496#
497# Character devices
498#
499CONFIG_VT=y
500CONFIG_VT_CONSOLE=y
501CONFIG_HW_CONSOLE=y
502# CONFIG_SERIAL_NONSTANDARD is not set
503
504#
505# Serial drivers
506#
507# CONFIG_SERIAL_8250 is not set
508
509#
510# Non-8250 serial port support
511#
512CONFIG_SERIAL_MPSC=y
513CONFIG_SERIAL_MPSC_CONSOLE=y
514CONFIG_SERIAL_CORE=y
515CONFIG_SERIAL_CORE_CONSOLE=y
516# CONFIG_SERIAL_JSM is not set
517CONFIG_UNIX98_PTYS=y
518CONFIG_LEGACY_PTYS=y
519CONFIG_LEGACY_PTY_COUNT=256
520
521#
522# IPMI
523#
524# CONFIG_IPMI_HANDLER is not set
525
526#
527# Watchdog Cards
528#
529# CONFIG_WATCHDOG is not set
530# CONFIG_NVRAM is not set
531CONFIG_GEN_RTC=y
532# CONFIG_GEN_RTC_X is not set
533# CONFIG_DTLK is not set
534# CONFIG_R3964 is not set
535# CONFIG_APPLICOM is not set
536
537#
538# Ftape, the floppy tape device driver
539#
540# CONFIG_AGP is not set
541# CONFIG_DRM is not set
542# CONFIG_RAW_DRIVER is not set
543
544#
545# TPM devices
546#
547# CONFIG_TCG_TPM is not set
548
549#
550# I2C support
551#
552# CONFIG_I2C is not set
553
554#
555# Dallas's 1-wire bus
556#
557# CONFIG_W1 is not set
558
559#
560# Hardware Monitoring support
561#
562CONFIG_HWMON=y
563# CONFIG_HWMON_VID is not set
564# CONFIG_HWMON_DEBUG_CHIP is not set
565
566#
567# Misc devices
568#
569
570#
571# Multimedia Capabilities Port drivers
572#
573
574#
575# Multimedia devices
576#
577# CONFIG_VIDEO_DEV is not set
578
579#
580# Digital Video Broadcasting Devices
581#
582# CONFIG_DVB is not set
583
584#
585# Graphics support
586#
587# CONFIG_FB is not set
588
589#
590# Console display driver support
591#
592# CONFIG_VGA_CONSOLE is not set
593CONFIG_DUMMY_CONSOLE=y
594
595#
596# Speakup console speech
597#
598# CONFIG_SPEAKUP is not set
599
600#
601# Sound
602#
603# CONFIG_SOUND is not set
604
605#
606# USB support
607#
608CONFIG_USB_ARCH_HAS_HCD=y
609CONFIG_USB_ARCH_HAS_OHCI=y
610# CONFIG_USB is not set
611
612#
613# USB Gadget Support
614#
615# CONFIG_USB_GADGET is not set
616
617#
618# MMC/SD Card support
619#
620# CONFIG_MMC is not set
621
622#
623# InfiniBand support
624#
625# CONFIG_INFINIBAND is not set
626
627#
628# SN Devices
629#
630
631#
632# Distributed Lock Manager
633#
634# CONFIG_DLM is not set
635
636#
637# File systems
638#
639CONFIG_EXT2_FS=y
640# CONFIG_EXT2_FS_XATTR is not set
641# CONFIG_EXT2_FS_XIP is not set
642# CONFIG_EXT3_FS is not set
643# CONFIG_REISER4_FS is not set
644# CONFIG_REISERFS_FS is not set
645# CONFIG_JFS_FS is not set
646# CONFIG_FS_POSIX_ACL is not set
647
648#
649# XFS support
650#
651# CONFIG_XFS_FS is not set
652# CONFIG_OCFS2_FS is not set
653# CONFIG_MINIX_FS is not set
654# CONFIG_ROMFS_FS is not set
655CONFIG_INOTIFY=y
656# CONFIG_QUOTA is not set
657CONFIG_DNOTIFY=y
658# CONFIG_AUTOFS_FS is not set
659# CONFIG_AUTOFS4_FS is not set
660# CONFIG_FUSE_FS is not set
661
662#
663# CD-ROM/DVD Filesystems
664#
665# CONFIG_ISO9660_FS is not set
666# CONFIG_UDF_FS is not set
667
668#
669# DOS/FAT/NT Filesystems
670#
671# CONFIG_MSDOS_FS is not set
672# CONFIG_VFAT_FS is not set
673# CONFIG_NTFS_FS is not set
674
675#
676# Pseudo filesystems
677#
678CONFIG_PROC_FS=y
679CONFIG_PROC_KCORE=y
680CONFIG_SYSFS=y
681CONFIG_TMPFS=y
682# CONFIG_HUGETLB_PAGE is not set
683CONFIG_RAMFS=y
684# CONFIG_CONFIGFS_FS is not set
685# CONFIG_RELAYFS_FS is not set
686
687#
688# Miscellaneous filesystems
689#
690# CONFIG_ADFS_FS is not set
691# CONFIG_AFFS_FS is not set
692# CONFIG_ASFS_FS is not set
693# CONFIG_HFS_FS is not set
694# CONFIG_HFSPLUS_FS is not set
695# CONFIG_BEFS_FS is not set
696# CONFIG_BFS_FS is not set
697# CONFIG_EFS_FS is not set
698# CONFIG_CRAMFS is not set
699# CONFIG_VXFS_FS is not set
700# CONFIG_HPFS_FS is not set
701# CONFIG_QNX4FS_FS is not set
702# CONFIG_SYSV_FS is not set
703# CONFIG_UFS_FS is not set
704
705#
706# Network File Systems
707#
708CONFIG_NFS_FS=y
709CONFIG_NFS_V3=y
710# CONFIG_NFS_V3_ACL is not set
711CONFIG_NFS_V4=y
712# CONFIG_NFS_DIRECTIO is not set
713# CONFIG_NFSD is not set
714CONFIG_ROOT_NFS=y
715CONFIG_LOCKD=y
716CONFIG_LOCKD_V4=y
717CONFIG_NFS_COMMON=y
718CONFIG_SUNRPC=y
719CONFIG_SUNRPC_GSS=y
720CONFIG_RPCSEC_GSS_KRB5=y
721# CONFIG_RPCSEC_GSS_SPKM3 is not set
722# CONFIG_SMB_FS is not set
723# CONFIG_CIFS is not set
724# CONFIG_NCP_FS is not set
725# CONFIG_CODA_FS is not set
726# CONFIG_AFS_FS is not set
727# CONFIG_9P_FS is not set
728
729#
730# Partition Types
731#
732# CONFIG_PARTITION_ADVANCED is not set
733CONFIG_MSDOS_PARTITION=y
734
735#
736# Native Language Support
737#
738# CONFIG_NLS is not set
739
740#
741# Library routines
742#
743# CONFIG_CRC_CCITT is not set
744# CONFIG_CRC16 is not set
745CONFIG_CRC32=y
746# CONFIG_LIBCRC32C is not set
747
748#
749# Profiling support
750#
751# CONFIG_PROFILING is not set
752
753#
754# Kernel hacking
755#
756# CONFIG_PRINTK_TIME is not set
757# CONFIG_DEBUG_KERNEL is not set
758CONFIG_LOG_BUF_SHIFT=14
759# CONFIG_SERIAL_TEXT_DEBUG is not set
760
761#
762# Security options
763#
764# CONFIG_KEYS is not set
765# CONFIG_SECURITY is not set
766
767#
768# Cryptographic options
769#
770CONFIG_CRYPTO=y
771# CONFIG_CRYPTO_HMAC is not set
772# CONFIG_CRYPTO_NULL is not set
773# CONFIG_CRYPTO_MD4 is not set
774CONFIG_CRYPTO_MD5=y
775# CONFIG_CRYPTO_SHA1 is not set
776# CONFIG_CRYPTO_SHA256 is not set
777# CONFIG_CRYPTO_SHA512 is not set
778# CONFIG_CRYPTO_WP512 is not set
779# CONFIG_CRYPTO_TGR192 is not set
780CONFIG_CRYPTO_DES=y
781# CONFIG_CRYPTO_BLOWFISH is not set
782# CONFIG_CRYPTO_TWOFISH is not set
783# CONFIG_CRYPTO_SERPENT is not set
784# CONFIG_CRYPTO_AES is not set
785# CONFIG_CRYPTO_CAST5 is not set
786# CONFIG_CRYPTO_CAST6 is not set
787# CONFIG_CRYPTO_TEA is not set
788# CONFIG_CRYPTO_ARC4 is not set
789# CONFIG_CRYPTO_KHAZAD is not set
790# CONFIG_CRYPTO_ANUBIS is not set
791# CONFIG_CRYPTO_DEFLATE is not set
792# CONFIG_CRYPTO_MICHAEL_MIC is not set
793# CONFIG_CRYPTO_CRC32C is not set
794# CONFIG_CRYPTO_TEST is not set
795
796#
797# Hardware crypto devices
798#
diff --git a/arch/ppc/configs/ebony_defconfig b/arch/ppc/configs/ebony_defconfig
deleted file mode 100644
index c8deca3b4545..000000000000
--- a/arch/ppc/configs/ebony_defconfig
+++ /dev/null
@@ -1,585 +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
30# CONFIG_IKCONFIG is not set
31CONFIG_EMBEDDED=y
32CONFIG_KALLSYMS=y
33# CONFIG_KALLSYMS_ALL is not set
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
46# CONFIG_MODULE_UNLOAD is not set
47CONFIG_OBSOLETE_MODPARM=y
48# CONFIG_MODVERSIONS is not set
49CONFIG_KMOD=y
50
51#
52# Processor
53#
54# CONFIG_6xx is not set
55# CONFIG_40x is not set
56CONFIG_44x=y
57# CONFIG_POWER3 is not set
58# CONFIG_POWER4 is not set
59# CONFIG_8xx is not set
60# CONFIG_E500 is not set
61CONFIG_BOOKE=y
62CONFIG_PTE_64BIT=y
63# CONFIG_MATH_EMULATION is not set
64# CONFIG_CPU_FREQ is not set
65CONFIG_4xx=y
66
67#
68# IBM 4xx options
69#
70CONFIG_EBONY=y
71# CONFIG_OCOTEA is not set
72CONFIG_440GP=y
73CONFIG_440=y
74CONFIG_IBM_OCP=y
75# CONFIG_PM is not set
76CONFIG_NOT_COHERENT_CACHE=y
77
78#
79# Platform options
80#
81# CONFIG_PC_KEYBOARD is not set
82# CONFIG_SMP is not set
83# CONFIG_PREEMPT is not set
84# CONFIG_HIGHMEM is not set
85CONFIG_KERNEL_ELF=y
86CONFIG_BINFMT_ELF=y
87# CONFIG_BINFMT_MISC is not set
88CONFIG_CMDLINE_BOOL=y
89CONFIG_CMDLINE="ip=on"
90
91#
92# Bus options
93#
94CONFIG_PCI=y
95CONFIG_PCI_DOMAINS=y
96# CONFIG_PCI_LEGACY_PROC is not set
97# CONFIG_PCI_NAMES is not set
98
99#
100# Advanced setup
101#
102# CONFIG_ADVANCED_OPTIONS is not set
103
104#
105# Default settings for advanced configuration options are used
106#
107CONFIG_HIGHMEM_START=0xfe000000
108CONFIG_LOWMEM_SIZE=0x30000000
109CONFIG_KERNEL_START=0xc0000000
110CONFIG_TASK_SIZE=0x80000000
111CONFIG_CONSISTENT_START=0xff100000
112CONFIG_CONSISTENT_SIZE=0x00200000
113CONFIG_BOOT_LOAD=0x01000000
114
115#
116# Device Drivers
117#
118
119#
120# Generic Driver Options
121#
122CONFIG_PREVENT_FIRMWARE_BUILD=y
123# CONFIG_DEBUG_DRIVER is not set
124
125#
126# Memory Technology Devices (MTD)
127#
128# CONFIG_MTD is not set
129
130#
131# Parallel port support
132#
133# CONFIG_PARPORT is not set
134
135#
136# Plug and Play support
137#
138
139#
140# Block devices
141#
142# CONFIG_BLK_DEV_FD is not set
143# CONFIG_BLK_CPQ_DA is not set
144# CONFIG_BLK_CPQ_CISS_DA is not set
145# CONFIG_BLK_DEV_DAC960 is not set
146# CONFIG_BLK_DEV_UMEM is not set
147# CONFIG_BLK_DEV_LOOP is not set
148# CONFIG_BLK_DEV_NBD is not set
149# CONFIG_BLK_DEV_SX8 is not set
150# CONFIG_BLK_DEV_RAM is not set
151CONFIG_LBD=y
152
153#
154# ATA/ATAPI/MFM/RLL support
155#
156# CONFIG_IDE is not set
157
158#
159# SCSI device support
160#
161# CONFIG_SCSI is not set
162
163#
164# Multi-device support (RAID and LVM)
165#
166# CONFIG_MD is not set
167
168#
169# Fusion MPT device support
170#
171
172#
173# IEEE 1394 (FireWire) support
174#
175# CONFIG_IEEE1394 is not set
176
177#
178# I2O device support
179#
180# CONFIG_I2O is not set
181
182#
183# Macintosh device drivers
184#
185
186#
187# Networking support
188#
189CONFIG_NET=y
190
191#
192# Networking options
193#
194CONFIG_PACKET=y
195# CONFIG_PACKET_MMAP is not set
196# CONFIG_NETLINK_DEV is not set
197CONFIG_UNIX=y
198# CONFIG_NET_KEY is not set
199CONFIG_INET=y
200# CONFIG_IP_MULTICAST is not set
201# CONFIG_IP_ADVANCED_ROUTER is not set
202CONFIG_IP_PNP=y
203# CONFIG_IP_PNP_DHCP is not set
204CONFIG_IP_PNP_BOOTP=y
205# CONFIG_IP_PNP_RARP is not set
206# CONFIG_NET_IPIP is not set
207# CONFIG_NET_IPGRE is not set
208# CONFIG_ARPD is not set
209# CONFIG_SYN_COOKIES is not set
210# CONFIG_INET_AH is not set
211# CONFIG_INET_ESP is not set
212# CONFIG_INET_IPCOMP is not set
213
214#
215# IP: Virtual Server Configuration
216#
217# CONFIG_IP_VS is not set
218# CONFIG_IPV6 is not set
219CONFIG_NETFILTER=y
220# CONFIG_NETFILTER_DEBUG is not set
221
222#
223# IP: Netfilter Configuration
224#
225# CONFIG_IP_NF_CONNTRACK is not set
226# CONFIG_IP_NF_QUEUE is not set
227# CONFIG_IP_NF_IPTABLES is not set
228# CONFIG_IP_NF_ARPTABLES is not set
229# CONFIG_IP_NF_COMPAT_IPCHAINS is not set
230# CONFIG_IP_NF_COMPAT_IPFWADM is not set
231
232#
233# SCTP Configuration (EXPERIMENTAL)
234#
235# CONFIG_IP_SCTP is not set
236# CONFIG_ATM is not set
237# CONFIG_BRIDGE is not set
238# CONFIG_VLAN_8021Q is not set
239# CONFIG_DECNET is not set
240# CONFIG_LLC2 is not set
241# CONFIG_IPX is not set
242# CONFIG_ATALK is not set
243# CONFIG_X25 is not set
244# CONFIG_LAPB is not set
245# CONFIG_NET_DIVERT is not set
246# CONFIG_ECONET is not set
247# CONFIG_WAN_ROUTER is not set
248# CONFIG_NET_HW_FLOWCONTROL is not set
249
250#
251# QoS and/or fair queueing
252#
253# CONFIG_NET_SCHED is not set
254# CONFIG_NET_CLS_ROUTE is not set
255
256#
257# Network testing
258#
259# CONFIG_NET_PKTGEN is not set
260# CONFIG_NETPOLL is not set
261# CONFIG_NET_POLL_CONTROLLER is not set
262# CONFIG_HAMRADIO is not set
263# CONFIG_IRDA is not set
264# CONFIG_BT is not set
265CONFIG_NETDEVICES=y
266# CONFIG_DUMMY is not set
267# CONFIG_BONDING is not set
268# CONFIG_EQUALIZER is not set
269# CONFIG_TUN is not set
270
271#
272# ARCnet devices
273#
274# CONFIG_ARCNET is not set
275
276#
277# Ethernet (10 or 100Mbit)
278#
279# CONFIG_NET_ETHERNET is not set
280CONFIG_IBM_EMAC=y
281# CONFIG_IBM_EMAC_ERRMSG is not set
282CONFIG_IBM_EMAC_RXB=64
283CONFIG_IBM_EMAC_TXB=8
284CONFIG_IBM_EMAC_FGAP=8
285CONFIG_IBM_EMAC_SKBRES=0
286
287#
288# Ethernet (1000 Mbit)
289#
290# CONFIG_ACENIC is not set
291# CONFIG_DL2K is not set
292# CONFIG_E1000 is not set
293# CONFIG_NS83820 is not set
294# CONFIG_HAMACHI is not set
295# CONFIG_YELLOWFIN is not set
296# CONFIG_R8169 is not set
297# CONFIG_SK98LIN is not set
298# CONFIG_TIGON3 is not set
299
300#
301# Ethernet (10000 Mbit)
302#
303# CONFIG_IXGB is not set
304# CONFIG_S2IO is not set
305
306#
307# Token Ring devices
308#
309# CONFIG_TR is not set
310
311#
312# Wireless LAN (non-hamradio)
313#
314# CONFIG_NET_RADIO is not set
315
316#
317# Wan interfaces
318#
319# CONFIG_WAN is not set
320# CONFIG_FDDI is not set
321# CONFIG_HIPPI is not set
322# CONFIG_PPP is not set
323# CONFIG_SLIP is not set
324# CONFIG_SHAPER is not set
325# CONFIG_NETCONSOLE is not set
326
327#
328# ISDN subsystem
329#
330# CONFIG_ISDN is not set
331
332#
333# Telephony Support
334#
335# CONFIG_PHONE is not set
336
337#
338# Input device support
339#
340CONFIG_INPUT=y
341
342#
343# Userland interfaces
344#
345CONFIG_INPUT_MOUSEDEV=y
346CONFIG_INPUT_MOUSEDEV_PSAUX=y
347CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
348CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
349# CONFIG_INPUT_JOYDEV is not set
350# CONFIG_INPUT_TSDEV is not set
351# CONFIG_INPUT_EVDEV is not set
352# CONFIG_INPUT_EVBUG is not set
353
354#
355# Input I/O drivers
356#
357# CONFIG_GAMEPORT is not set
358CONFIG_SOUND_GAMEPORT=y
359CONFIG_SERIO=y
360# CONFIG_SERIO_I8042 is not set
361# CONFIG_SERIO_SERPORT is not set
362# CONFIG_SERIO_CT82C710 is not set
363# CONFIG_SERIO_PCIPS2 is not set
364
365#
366# Input Device Drivers
367#
368# CONFIG_INPUT_KEYBOARD is not set
369# CONFIG_INPUT_MOUSE is not set
370# CONFIG_INPUT_JOYSTICK is not set
371# CONFIG_INPUT_TOUCHSCREEN is not set
372# CONFIG_INPUT_MISC is not set
373
374#
375# Character devices
376#
377# CONFIG_VT is not set
378# CONFIG_SERIAL_NONSTANDARD is not set
379
380#
381# Serial drivers
382#
383CONFIG_SERIAL_8250=y
384CONFIG_SERIAL_8250_CONSOLE=y
385CONFIG_SERIAL_8250_NR_UARTS=4
386CONFIG_SERIAL_8250_EXTENDED=y
387# CONFIG_SERIAL_8250_MANY_PORTS is not set
388CONFIG_SERIAL_8250_SHARE_IRQ=y
389# CONFIG_SERIAL_8250_DETECT_IRQ is not set
390# CONFIG_SERIAL_8250_MULTIPORT is not set
391# CONFIG_SERIAL_8250_RSA is not set
392
393#
394# Non-8250 serial port support
395#
396CONFIG_SERIAL_CORE=y
397CONFIG_SERIAL_CORE_CONSOLE=y
398CONFIG_UNIX98_PTYS=y
399CONFIG_LEGACY_PTYS=y
400CONFIG_LEGACY_PTY_COUNT=256
401# CONFIG_QIC02_TAPE is not set
402
403#
404# IPMI
405#
406# CONFIG_IPMI_HANDLER is not set
407
408#
409# Watchdog Cards
410#
411# CONFIG_WATCHDOG is not set
412# CONFIG_NVRAM is not set
413# CONFIG_GEN_RTC is not set
414# CONFIG_DTLK is not set
415# CONFIG_R3964 is not set
416# CONFIG_APPLICOM is not set
417
418#
419# Ftape, the floppy tape device driver
420#
421# CONFIG_FTAPE is not set
422# CONFIG_AGP is not set
423# CONFIG_DRM is not set
424# CONFIG_RAW_DRIVER is not set
425
426#
427# I2C support
428#
429# CONFIG_I2C is not set
430
431#
432# Misc devices
433#
434
435#
436# Multimedia devices
437#
438# CONFIG_VIDEO_DEV is not set
439
440#
441# Digital Video Broadcasting Devices
442#
443# CONFIG_DVB is not set
444
445#
446# Graphics support
447#
448# CONFIG_FB is not set
449
450#
451# Sound
452#
453# CONFIG_SOUND is not set
454
455#
456# USB support
457#
458# CONFIG_USB is not set
459
460#
461# USB Gadget Support
462#
463# CONFIG_USB_GADGET is not set
464
465#
466# File systems
467#
468# CONFIG_EXT2_FS is not set
469# CONFIG_EXT3_FS is not set
470# CONFIG_JBD is not set
471# CONFIG_REISERFS_FS is not set
472# CONFIG_JFS_FS is not set
473# CONFIG_XFS_FS is not set
474# CONFIG_MINIX_FS is not set
475# CONFIG_ROMFS_FS is not set
476# CONFIG_QUOTA is not set
477# CONFIG_AUTOFS_FS is not set
478# CONFIG_AUTOFS4_FS is not set
479
480#
481# CD-ROM/DVD Filesystems
482#
483# CONFIG_ISO9660_FS is not set
484# CONFIG_UDF_FS is not set
485
486#
487# DOS/FAT/NT Filesystems
488#
489# CONFIG_FAT_FS is not set
490# CONFIG_NTFS_FS is not set
491
492#
493# Pseudo filesystems
494#
495CONFIG_PROC_FS=y
496CONFIG_PROC_KCORE=y
497CONFIG_SYSFS=y
498# CONFIG_DEVFS_FS is not set
499# CONFIG_DEVPTS_FS_XATTR is not set
500# CONFIG_TMPFS is not set
501# CONFIG_HUGETLB_PAGE is not set
502CONFIG_RAMFS=y
503
504#
505# Miscellaneous filesystems
506#
507# CONFIG_ADFS_FS is not set
508# CONFIG_AFFS_FS is not set
509# CONFIG_HFS_FS is not set
510# CONFIG_HFSPLUS_FS is not set
511# CONFIG_BEFS_FS is not set
512# CONFIG_BFS_FS is not set
513# CONFIG_EFS_FS is not set
514# CONFIG_CRAMFS is not set
515# CONFIG_VXFS_FS is not set
516# CONFIG_HPFS_FS is not set
517# CONFIG_QNX4FS_FS is not set
518# CONFIG_SYSV_FS is not set
519# CONFIG_UFS_FS is not set
520
521#
522# Network File Systems
523#
524CONFIG_NFS_FS=y
525# CONFIG_NFS_V3 is not set
526# CONFIG_NFS_V4 is not set
527# CONFIG_NFS_DIRECTIO is not set
528# CONFIG_NFSD is not set
529CONFIG_ROOT_NFS=y
530CONFIG_LOCKD=y
531# CONFIG_EXPORTFS is not set
532CONFIG_SUNRPC=y
533# CONFIG_RPCSEC_GSS_KRB5 is not set
534# CONFIG_SMB_FS is not set
535# CONFIG_CIFS is not set
536# CONFIG_NCP_FS is not set
537# CONFIG_CODA_FS is not set
538# CONFIG_AFS_FS is not set
539
540#
541# Partition Types
542#
543# CONFIG_PARTITION_ADVANCED is not set
544CONFIG_MSDOS_PARTITION=y
545
546#
547# Native Language Support
548#
549# CONFIG_NLS is not set
550
551#
552# Library routines
553#
554CONFIG_CRC32=y
555# CONFIG_LIBCRC32C is not set
556
557#
558# Profiling support
559#
560# CONFIG_PROFILING is not set
561
562#
563# Kernel hacking
564#
565CONFIG_DEBUG_KERNEL=y
566# CONFIG_DEBUG_SLAB is not set
567# CONFIG_MAGIC_SYSRQ is not set
568# CONFIG_DEBUG_SPINLOCK is not set
569# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
570# CONFIG_KGDB is not set
571# CONFIG_XMON is not set
572CONFIG_BDI_SWITCH=y
573# CONFIG_DEBUG_INFO is not set
574# CONFIG_SERIAL_TEXT_DEBUG is not set
575CONFIG_PPC_OCP=y
576
577#
578# Security options
579#
580# CONFIG_SECURITY is not set
581
582#
583# Cryptographic options
584#
585# CONFIG_CRYPTO is not set
diff --git a/arch/ppc/configs/ep405_defconfig b/arch/ppc/configs/ep405_defconfig
deleted file mode 100644
index 880b5f8d30c3..000000000000
--- a/arch/ppc/configs/ep405_defconfig
+++ /dev/null
@@ -1,572 +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
30# CONFIG_IKCONFIG is not set
31CONFIG_EMBEDDED=y
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
46# CONFIG_MODULE_FORCE_UNLOAD is not set
47CONFIG_OBSOLETE_MODPARM=y
48# CONFIG_MODVERSIONS is not set
49CONFIG_KMOD=y
50
51#
52# Processor
53#
54# CONFIG_6xx is not set
55CONFIG_40x=y
56# CONFIG_44x is not set
57# CONFIG_POWER3 is not set
58# CONFIG_POWER4 is not set
59# CONFIG_8xx is not set
60# CONFIG_MATH_EMULATION is not set
61# CONFIG_CPU_FREQ is not set
62CONFIG_4xx=y
63
64#
65# IBM 4xx options
66#
67# CONFIG_ASH is not set
68# CONFIG_BUBINGA is not set
69# CONFIG_CPCI405 is not set
70CONFIG_EP405=y
71# CONFIG_OAK is not set
72# CONFIG_REDWOOD_5 is not set
73# CONFIG_REDWOOD_6 is not set
74# CONFIG_SYCAMORE is not set
75# CONFIG_WALNUT is not set
76# CONFIG_EP405PC is not set
77CONFIG_IBM405_ERR77=y
78CONFIG_IBM405_ERR51=y
79CONFIG_IBM_OCP=y
80CONFIG_BIOS_FIXUP=y
81CONFIG_405GP=y
82CONFIG_EMBEDDEDBOOT=y
83# CONFIG_PM is not set
84CONFIG_UART0_TTYS0=y
85# CONFIG_UART0_TTYS1 is not set
86CONFIG_NOT_COHERENT_CACHE=y
87
88#
89# Platform options
90#
91# CONFIG_PC_KEYBOARD is not set
92# CONFIG_SMP is not set
93# CONFIG_PREEMPT is not set
94# CONFIG_HIGHMEM is not set
95CONFIG_KERNEL_ELF=y
96CONFIG_BINFMT_ELF=y
97# CONFIG_BINFMT_MISC is not set
98CONFIG_CMDLINE_BOOL=y
99CONFIG_CMDLINE="ip=on"
100
101#
102# Bus options
103#
104CONFIG_PCI=y
105CONFIG_PCI_DOMAINS=y
106# CONFIG_PCI_LEGACY_PROC is not set
107# CONFIG_PCI_NAMES is not set
108
109#
110# Advanced setup
111#
112# CONFIG_ADVANCED_OPTIONS is not set
113
114#
115# Default settings for advanced configuration options are used
116#
117CONFIG_HIGHMEM_START=0xfe000000
118CONFIG_LOWMEM_SIZE=0x30000000
119CONFIG_KERNEL_START=0xc0000000
120CONFIG_TASK_SIZE=0x80000000
121CONFIG_BOOT_LOAD=0x00400000
122
123#
124# Device Drivers
125#
126
127#
128# Generic Driver Options
129#
130
131#
132# Memory Technology Devices (MTD)
133#
134# CONFIG_MTD is not set
135
136#
137# Parallel port support
138#
139# CONFIG_PARPORT is not set
140
141#
142# Plug and Play support
143#
144
145#
146# Block devices
147#
148# CONFIG_BLK_DEV_FD is not set
149# CONFIG_BLK_CPQ_DA is not set
150# CONFIG_BLK_CPQ_CISS_DA is not set
151# CONFIG_BLK_DEV_DAC960 is not set
152# CONFIG_BLK_DEV_UMEM is not set
153CONFIG_BLK_DEV_LOOP=y
154# CONFIG_BLK_DEV_CRYPTOLOOP is not set
155# CONFIG_BLK_DEV_NBD is not set
156# CONFIG_BLK_DEV_CARMEL is not set
157CONFIG_BLK_DEV_RAM=y
158CONFIG_BLK_DEV_RAM_SIZE=4096
159CONFIG_BLK_DEV_INITRD=y
160# CONFIG_LBD is not set
161
162#
163# ATA/ATAPI/MFM/RLL support
164#
165# CONFIG_IDE is not set
166
167#
168# SCSI device support
169#
170# CONFIG_SCSI is not set
171
172#
173# Multi-device support (RAID and LVM)
174#
175# CONFIG_MD is not set
176
177#
178# Fusion MPT device support
179#
180
181#
182# IEEE 1394 (FireWire) support
183#
184# CONFIG_IEEE1394 is not set
185
186#
187# I2O device support
188#
189# CONFIG_I2O is not set
190
191#
192# Macintosh device drivers
193#
194
195#
196# Networking support
197#
198CONFIG_NET=y
199
200#
201# Networking options
202#
203# CONFIG_PACKET is not set
204# CONFIG_NETLINK_DEV is not set
205CONFIG_UNIX=y
206# CONFIG_NET_KEY is not set
207CONFIG_INET=y
208CONFIG_IP_MULTICAST=y
209# CONFIG_IP_ADVANCED_ROUTER is not set
210CONFIG_IP_PNP=y
211# CONFIG_IP_PNP_DHCP is not set
212CONFIG_IP_PNP_BOOTP=y
213# CONFIG_IP_PNP_RARP is not set
214# CONFIG_NET_IPIP is not set
215# CONFIG_NET_IPGRE is not set
216# CONFIG_IP_MROUTE is not set
217# CONFIG_ARPD is not set
218CONFIG_SYN_COOKIES=y
219# CONFIG_INET_AH is not set
220# CONFIG_INET_ESP is not set
221# CONFIG_INET_IPCOMP is not set
222# CONFIG_IPV6 is not set
223# CONFIG_NETFILTER is not set
224
225#
226# SCTP Configuration (EXPERIMENTAL)
227#
228# CONFIG_IP_SCTP is not set
229# CONFIG_ATM is not set
230# CONFIG_BRIDGE is not set
231# CONFIG_VLAN_8021Q is not set
232# CONFIG_DECNET is not set
233# CONFIG_LLC2 is not set
234# CONFIG_IPX is not set
235# CONFIG_ATALK is not set
236# CONFIG_X25 is not set
237# CONFIG_LAPB is not set
238# CONFIG_NET_DIVERT is not set
239# CONFIG_ECONET is not set
240# CONFIG_WAN_ROUTER is not set
241# CONFIG_NET_HW_FLOWCONTROL is not set
242
243#
244# QoS and/or fair queueing
245#
246# CONFIG_NET_SCHED is not set
247
248#
249# Network testing
250#
251# CONFIG_NET_PKTGEN is not set
252# CONFIG_NETPOLL is not set
253# CONFIG_NET_POLL_CONTROLLER is not set
254# CONFIG_HAMRADIO is not set
255# CONFIG_IRDA is not set
256# CONFIG_BT is not set
257CONFIG_NETDEVICES=y
258# CONFIG_DUMMY is not set
259# CONFIG_BONDING is not set
260# CONFIG_EQUALIZER is not set
261# CONFIG_TUN is not set
262
263#
264# ARCnet devices
265#
266# CONFIG_ARCNET is not set
267
268#
269# Ethernet (10 or 100Mbit)
270#
271CONFIG_NET_ETHERNET=y
272# CONFIG_MII is not set
273# CONFIG_OAKNET is not set
274# CONFIG_HAPPYMEAL is not set
275# CONFIG_SUNGEM is not set
276# CONFIG_NET_VENDOR_3COM is not set
277
278#
279# Tulip family network device support
280#
281# CONFIG_NET_TULIP is not set
282# CONFIG_HP100 is not set
283# CONFIG_NET_PCI is not set
284
285#
286# Ethernet (1000 Mbit)
287#
288# CONFIG_ACENIC is not set
289# CONFIG_DL2K is not set
290# CONFIG_E1000 is not set
291# CONFIG_NS83820 is not set
292# CONFIG_HAMACHI is not set
293# CONFIG_YELLOWFIN is not set
294# CONFIG_R8169 is not set
295# CONFIG_SK98LIN is not set
296# CONFIG_TIGON3 is not set
297
298#
299# Ethernet (10000 Mbit)
300#
301# CONFIG_IXGB is not set
302# CONFIG_S2IO is not set
303
304#
305# Token Ring devices
306#
307# CONFIG_TR is not set
308
309#
310# Wireless LAN (non-hamradio)
311#
312# CONFIG_NET_RADIO is not set
313
314#
315# Wan interfaces
316#
317# CONFIG_WAN is not set
318# CONFIG_FDDI is not set
319# CONFIG_HIPPI is not set
320# CONFIG_PPP is not set
321# CONFIG_SLIP is not set
322# CONFIG_RCPCI is not set
323# CONFIG_SHAPER is not set
324# CONFIG_NETCONSOLE is not set
325
326#
327# ISDN subsystem
328#
329# CONFIG_ISDN is not set
330
331#
332# Telephony Support
333#
334# CONFIG_PHONE is not set
335
336#
337# Input device support
338#
339CONFIG_INPUT=y
340
341#
342# Userland interfaces
343#
344CONFIG_INPUT_MOUSEDEV=y
345CONFIG_INPUT_MOUSEDEV_PSAUX=y
346CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
347CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
348# CONFIG_INPUT_JOYDEV is not set
349# CONFIG_INPUT_TSDEV is not set
350# CONFIG_INPUT_EVDEV is not set
351# CONFIG_INPUT_EVBUG is not set
352
353#
354# Input I/O drivers
355#
356# CONFIG_GAMEPORT is not set
357CONFIG_SOUND_GAMEPORT=y
358CONFIG_SERIO=y
359# CONFIG_SERIO_I8042 is not set
360CONFIG_SERIO_SERPORT=y
361# CONFIG_SERIO_CT82C710 is not set
362# CONFIG_SERIO_PCIPS2 is not set
363
364#
365# Input Device Drivers
366#
367# CONFIG_INPUT_KEYBOARD is not set
368# CONFIG_INPUT_MOUSE is not set
369# CONFIG_INPUT_JOYSTICK is not set
370# CONFIG_INPUT_TOUCHSCREEN is not set
371# CONFIG_INPUT_MISC is not set
372
373#
374# Character devices
375#
376# CONFIG_VT is not set
377# CONFIG_SERIAL_NONSTANDARD is not set
378
379#
380# Serial drivers
381#
382CONFIG_SERIAL_8250=y
383CONFIG_SERIAL_8250_CONSOLE=y
384CONFIG_SERIAL_8250_NR_UARTS=4
385# CONFIG_SERIAL_8250_EXTENDED is not set
386
387#
388# Non-8250 serial port support
389#
390CONFIG_SERIAL_CORE=y
391CONFIG_SERIAL_CORE_CONSOLE=y
392CONFIG_UNIX98_PTYS=y
393CONFIG_LEGACY_PTYS=y
394CONFIG_LEGACY_PTY_COUNT=256
395# CONFIG_QIC02_TAPE is not set
396
397#
398# IPMI
399#
400# CONFIG_IPMI_HANDLER is not set
401
402#
403# Watchdog Cards
404#
405# CONFIG_WATCHDOG is not set
406# CONFIG_NVRAM is not set
407CONFIG_GEN_RTC=y
408# CONFIG_GEN_RTC_X is not set
409# CONFIG_DTLK is not set
410# CONFIG_R3964 is not set
411# CONFIG_APPLICOM is not set
412
413#
414# Ftape, the floppy tape device driver
415#
416# CONFIG_FTAPE is not set
417# CONFIG_AGP is not set
418# CONFIG_DRM is not set
419# CONFIG_RAW_DRIVER is not set
420
421#
422# I2C support
423#
424# CONFIG_I2C is not set
425
426#
427# Misc devices
428#
429
430#
431# Multimedia devices
432#
433# CONFIG_VIDEO_DEV is not set
434
435#
436# Digital Video Broadcasting Devices
437#
438# CONFIG_DVB is not set
439
440#
441# Graphics support
442#
443# CONFIG_FB is not set
444
445#
446# Sound
447#
448# CONFIG_SOUND is not set
449
450#
451# USB support
452#
453# CONFIG_USB is not set
454
455#
456# USB Gadget Support
457#
458# CONFIG_USB_GADGET is not set
459
460#
461# File systems
462#
463CONFIG_EXT2_FS=y
464# CONFIG_EXT2_FS_XATTR is not set
465# CONFIG_EXT3_FS is not set
466# CONFIG_JBD is not set
467# CONFIG_REISERFS_FS is not set
468# CONFIG_JFS_FS is not set
469# CONFIG_XFS_FS is not set
470# CONFIG_MINIX_FS is not set
471# CONFIG_ROMFS_FS is not set
472# CONFIG_QUOTA is not set
473# CONFIG_AUTOFS_FS is not set
474# CONFIG_AUTOFS4_FS is not set
475
476#
477# CD-ROM/DVD Filesystems
478#
479# CONFIG_ISO9660_FS is not set
480# CONFIG_UDF_FS is not set
481
482#
483# DOS/FAT/NT Filesystems
484#
485# CONFIG_FAT_FS is not set
486# CONFIG_NTFS_FS is not set
487
488#
489# Pseudo filesystems
490#
491CONFIG_PROC_FS=y
492CONFIG_PROC_KCORE=y
493CONFIG_SYSFS=y
494# CONFIG_DEVFS_FS is not set
495# CONFIG_DEVPTS_FS_XATTR is not set
496CONFIG_TMPFS=y
497# CONFIG_HUGETLB_PAGE is not set
498CONFIG_RAMFS=y
499
500#
501# Miscellaneous filesystems
502#
503# CONFIG_ADFS_FS is not set
504# CONFIG_AFFS_FS is not set
505# CONFIG_HFS_FS is not set
506# CONFIG_HFSPLUS_FS is not set
507# CONFIG_BEFS_FS is not set
508# CONFIG_BFS_FS is not set
509# CONFIG_EFS_FS is not set
510# CONFIG_CRAMFS is not set
511# CONFIG_VXFS_FS is not set
512# CONFIG_HPFS_FS is not set
513# CONFIG_QNX4FS_FS is not set
514# CONFIG_SYSV_FS is not set
515# CONFIG_UFS_FS is not set
516
517#
518# Network File Systems
519#
520CONFIG_NFS_FS=y
521# CONFIG_NFS_V3 is not set
522# CONFIG_NFS_V4 is not set
523# CONFIG_NFS_DIRECTIO is not set
524# CONFIG_NFSD is not set
525CONFIG_ROOT_NFS=y
526CONFIG_LOCKD=y
527# CONFIG_EXPORTFS is not set
528CONFIG_SUNRPC=y
529# CONFIG_RPCSEC_GSS_KRB5 is not set
530# CONFIG_SMB_FS is not set
531# CONFIG_CIFS is not set
532# CONFIG_NCP_FS is not set
533# CONFIG_CODA_FS is not set
534# CONFIG_AFS_FS is not set
535
536#
537# Partition Types
538#
539# CONFIG_PARTITION_ADVANCED is not set
540CONFIG_MSDOS_PARTITION=y
541
542#
543# Native Language Support
544#
545# CONFIG_NLS is not set
546
547#
548# IBM 40x options
549#
550
551#
552# Library routines
553#
554CONFIG_CRC32=y
555# CONFIG_LIBCRC32C is not set
556
557#
558# Kernel hacking
559#
560# CONFIG_DEBUG_KERNEL is not set
561# CONFIG_SERIAL_TEXT_DEBUG is not set
562CONFIG_PPC_OCP=y
563
564#
565# Security options
566#
567# CONFIG_SECURITY is not set
568
569#
570# Cryptographic options
571#
572# CONFIG_CRYPTO is not set
diff --git a/arch/ppc/configs/est8260_defconfig b/arch/ppc/configs/est8260_defconfig
deleted file mode 100644
index b3f6446bb083..000000000000
--- a/arch/ppc/configs/est8260_defconfig
+++ /dev/null
@@ -1,491 +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
7
8#
9# Code maturity level options
10#
11CONFIG_EXPERIMENTAL=y
12
13#
14# General setup
15#
16CONFIG_SWAP=y
17CONFIG_SYSVIPC=y
18# CONFIG_BSD_PROCESS_ACCT is not set
19CONFIG_SYSCTL=y
20CONFIG_LOG_BUF_SHIFT=14
21CONFIG_EMBEDDED=y
22CONFIG_FUTEX=y
23# CONFIG_EPOLL is not set
24
25#
26# Loadable module support
27#
28# CONFIG_MODULES is not set
29
30#
31# Platform support
32#
33CONFIG_PPC=y
34CONFIG_PPC32=y
35CONFIG_6xx=y
36# CONFIG_40x is not set
37# CONFIG_POWER3 is not set
38# CONFIG_8xx is not set
39
40#
41# IBM 4xx options
42#
43CONFIG_EMBEDDEDBOOT=y
44CONFIG_8260=y
45CONFIG_PPC_STD_MMU=y
46CONFIG_SERIAL_CONSOLE=y
47CONFIG_EST8260=y
48# CONFIG_SBS8260 is not set
49# CONFIG_RPX6 is not set
50# CONFIG_TQM8260 is not set
51# CONFIG_WILLOW_1 is not set
52# CONFIG_SMP is not set
53# CONFIG_PREEMPT is not set
54# CONFIG_CPU_FREQ is not set
55
56#
57# General setup
58#
59# CONFIG_HIGHMEM is not set
60# CONFIG_PCI is not set
61# CONFIG_PCI_DOMAINS is not set
62# CONFIG_PC_KEYBOARD is not set
63CONFIG_KCORE_ELF=y
64CONFIG_BINFMT_ELF=y
65CONFIG_KERNEL_ELF=y
66# CONFIG_BINFMT_MISC is not set
67# CONFIG_HOTPLUG is not set
68
69#
70# Parallel port support
71#
72# CONFIG_PARPORT is not set
73# CONFIG_PPC601_SYNC_FIX is not set
74# CONFIG_CMDLINE_BOOL is not set
75
76#
77# Advanced setup
78#
79# CONFIG_ADVANCED_OPTIONS is not set
80
81#
82# Default settings for advanced configuration options are used
83#
84CONFIG_HIGHMEM_START=0xfe000000
85CONFIG_LOWMEM_SIZE=0x30000000
86CONFIG_KERNEL_START=0xc0000000
87CONFIG_TASK_SIZE=0x80000000
88CONFIG_BOOT_LOAD=0x00400000
89
90#
91# Memory Technology Devices (MTD)
92#
93# CONFIG_MTD is not set
94
95#
96# Plug and Play support
97#
98# CONFIG_PNP is not set
99
100#
101# Block devices
102#
103# CONFIG_BLK_DEV_FD is not set
104CONFIG_BLK_DEV_LOOP=y
105# CONFIG_BLK_DEV_NBD is not set
106CONFIG_BLK_DEV_RAM=y
107CONFIG_BLK_DEV_RAM_SIZE=4096
108CONFIG_BLK_DEV_INITRD=y
109
110#
111# Multi-device support (RAID and LVM)
112#
113# CONFIG_MD is not set
114
115#
116# ATA/IDE/MFM/RLL support
117#
118# CONFIG_IDE is not set
119
120#
121# SCSI support
122#
123# CONFIG_SCSI is not set
124
125#
126# Fusion MPT device support
127#
128
129#
130# I2O device support
131#
132
133#
134# Networking support
135#
136CONFIG_NET=y
137
138#
139# Networking options
140#
141CONFIG_PACKET=y
142# CONFIG_PACKET_MMAP is not set
143# CONFIG_NETLINK_DEV is not set
144# CONFIG_NETFILTER is not set
145CONFIG_UNIX=y
146# CONFIG_NET_KEY is not set
147CONFIG_INET=y
148CONFIG_IP_MULTICAST=y
149# CONFIG_IP_ADVANCED_ROUTER is not set
150CONFIG_IP_PNP=y
151CONFIG_IP_PNP_DHCP=y
152CONFIG_IP_PNP_BOOTP=y
153# CONFIG_IP_PNP_RARP is not set
154# CONFIG_NET_IPIP is not set
155# CONFIG_NET_IPGRE is not set
156# CONFIG_IP_MROUTE is not set
157# CONFIG_ARPD is not set
158# CONFIG_INET_ECN is not set
159CONFIG_SYN_COOKIES=y
160# CONFIG_INET_AH is not set
161# CONFIG_INET_ESP is not set
162# CONFIG_INET_IPCOMP is not set
163# CONFIG_IPV6 is not set
164# CONFIG_XFRM_USER is not set
165
166#
167# SCTP Configuration (EXPERIMENTAL)
168#
169CONFIG_IPV6_SCTP__=y
170# CONFIG_IP_SCTP is not set
171# CONFIG_ATM is not set
172# CONFIG_VLAN_8021Q is not set
173# CONFIG_LLC is not set
174# CONFIG_DECNET is not set
175# CONFIG_BRIDGE is not set
176# CONFIG_X25 is not set
177# CONFIG_LAPB is not set
178# CONFIG_NET_DIVERT is not set
179# CONFIG_ECONET is not set
180# CONFIG_WAN_ROUTER is not set
181# CONFIG_NET_HW_FLOWCONTROL is not set
182
183#
184# QoS and/or fair queueing
185#
186# CONFIG_NET_SCHED is not set
187
188#
189# Network testing
190#
191# CONFIG_NET_PKTGEN is not set
192CONFIG_NETDEVICES=y
193# CONFIG_DUMMY is not set
194# CONFIG_BONDING is not set
195# CONFIG_EQUALIZER is not set
196# CONFIG_TUN is not set
197# CONFIG_ETHERTAP is not set
198
199#
200# Ethernet (10 or 100Mbit)
201#
202CONFIG_NET_ETHERNET=y
203# CONFIG_MII is not set
204# CONFIG_OAKNET is not set
205
206#
207# Ethernet (1000 Mbit)
208#
209
210#
211# Ethernet (10000 Mbit)
212#
213# CONFIG_PPP is not set
214# CONFIG_SLIP is not set
215
216#
217# Wireless LAN (non-hamradio)
218#
219# CONFIG_NET_RADIO is not set
220
221#
222# Token Ring devices (depends on LLC=y)
223#
224# CONFIG_SHAPER is not set
225
226#
227# Wan interfaces
228#
229# CONFIG_WAN is not set
230
231#
232# Amateur Radio support
233#
234# CONFIG_HAMRADIO is not set
235
236#
237# IrDA (infrared) support
238#
239# CONFIG_IRDA is not set
240
241#
242# ISDN subsystem
243#
244# CONFIG_ISDN_BOOL is not set
245
246#
247# Graphics support
248#
249# CONFIG_FB is not set
250
251#
252# Old CD-ROM drivers (not SCSI, not IDE)
253#
254# CONFIG_CD_NO_IDESCSI is not set
255
256#
257# Input device support
258#
259# CONFIG_INPUT is not set
260
261#
262# Userland interfaces
263#
264
265#
266# Input I/O drivers
267#
268# CONFIG_GAMEPORT is not set
269CONFIG_SOUND_GAMEPORT=y
270# CONFIG_SERIO is not set
271
272#
273# Input Device Drivers
274#
275
276#
277# Macintosh device drivers
278#
279
280#
281# Character devices
282#
283# CONFIG_SERIAL_NONSTANDARD is not set
284
285#
286# Serial drivers
287#
288CONFIG_SERIAL_8250=y
289CONFIG_SERIAL_8250_CONSOLE=y
290# CONFIG_SERIAL_8250_EXTENDED is not set
291
292#
293# Non-8250 serial port support
294#
295CONFIG_SERIAL_CORE=y
296CONFIG_SERIAL_CORE_CONSOLE=y
297CONFIG_UNIX98_PTYS=y
298CONFIG_UNIX98_PTY_COUNT=256
299
300#
301# I2C support
302#
303# CONFIG_I2C is not set
304
305#
306# I2C Hardware Sensors Mainboard support
307#
308
309#
310# I2C Hardware Sensors Chip support
311#
312# CONFIG_I2C_SENSOR is not set
313
314#
315# Mice
316#
317# CONFIG_BUSMOUSE is not set
318# CONFIG_QIC02_TAPE is not set
319
320#
321# IPMI
322#
323# CONFIG_IPMI_HANDLER is not set
324
325#
326# Watchdog Cards
327#
328# CONFIG_WATCHDOG is not set
329# CONFIG_NVRAM is not set
330CONFIG_GEN_RTC=y
331# CONFIG_GEN_RTC_X is not set
332# CONFIG_DTLK is not set
333# CONFIG_R3964 is not set
334# CONFIG_APPLICOM is not set
335
336#
337# Ftape, the floppy tape device driver
338#
339# CONFIG_FTAPE is not set
340# CONFIG_AGP is not set
341# CONFIG_DRM is not set
342# CONFIG_RAW_DRIVER is not set
343# CONFIG_HANGCHECK_TIMER is not set
344
345#
346# Multimedia devices
347#
348# CONFIG_VIDEO_DEV is not set
349
350#
351# Digital Video Broadcasting Devices
352#
353# CONFIG_DVB is not set
354
355#
356# File systems
357#
358CONFIG_EXT2_FS=y
359# CONFIG_EXT2_FS_XATTR is not set
360CONFIG_EXT3_FS=y
361CONFIG_EXT3_FS_XATTR=y
362# CONFIG_EXT3_FS_POSIX_ACL is not set
363# CONFIG_EXT3_FS_SECURITY is not set
364CONFIG_JBD=y
365# CONFIG_JBD_DEBUG is not set
366CONFIG_FS_MBCACHE=y
367# CONFIG_REISERFS_FS is not set
368# CONFIG_JFS_FS is not set
369# CONFIG_XFS_FS is not set
370# CONFIG_MINIX_FS is not set
371# CONFIG_ROMFS_FS is not set
372# CONFIG_QUOTA is not set
373# CONFIG_AUTOFS_FS is not set
374# CONFIG_AUTOFS4_FS is not set
375
376#
377# CD-ROM/DVD Filesystems
378#
379# CONFIG_ISO9660_FS is not set
380# CONFIG_UDF_FS is not set
381
382#
383# DOS/FAT/NT Filesystems
384#
385# CONFIG_FAT_FS is not set
386# CONFIG_NTFS_FS is not set
387
388#
389# Pseudo filesystems
390#
391CONFIG_PROC_FS=y
392# CONFIG_DEVFS_FS is not set
393CONFIG_DEVPTS_FS=y
394# CONFIG_DEVPTS_FS_XATTR is not set
395CONFIG_TMPFS=y
396CONFIG_RAMFS=y
397
398#
399# Miscellaneous filesystems
400#
401# CONFIG_ADFS_FS is not set
402# CONFIG_AFFS_FS is not set
403# CONFIG_HFS_FS is not set
404# CONFIG_BEFS_FS is not set
405# CONFIG_BFS_FS is not set
406# CONFIG_EFS_FS is not set
407# CONFIG_CRAMFS is not set
408# CONFIG_VXFS_FS is not set
409# CONFIG_HPFS_FS is not set
410# CONFIG_QNX4FS_FS is not set
411# CONFIG_SYSV_FS is not set
412# CONFIG_UFS_FS is not set
413
414#
415# Network File Systems
416#
417CONFIG_NFS_FS=y
418# CONFIG_NFS_V3 is not set
419# CONFIG_NFS_V4 is not set
420# CONFIG_NFSD is not set
421CONFIG_ROOT_NFS=y
422CONFIG_LOCKD=y
423# CONFIG_EXPORTFS is not set
424CONFIG_SUNRPC=y
425# CONFIG_SUNRPC_GSS is not set
426# CONFIG_SMB_FS is not set
427# CONFIG_CIFS is not set
428# CONFIG_NCP_FS is not set
429# CONFIG_CODA_FS is not set
430# CONFIG_INTERMEZZO_FS is not set
431# CONFIG_AFS_FS is not set
432
433#
434# Partition Types
435#
436CONFIG_PARTITION_ADVANCED=y
437# CONFIG_ACORN_PARTITION is not set
438# CONFIG_OSF_PARTITION is not set
439# CONFIG_AMIGA_PARTITION is not set
440# CONFIG_ATARI_PARTITION is not set
441# CONFIG_MAC_PARTITION is not set
442# CONFIG_MSDOS_PARTITION is not set
443# CONFIG_LDM_PARTITION is not set
444# CONFIG_NEC98_PARTITION is not set
445# CONFIG_SGI_PARTITION is not set
446# CONFIG_ULTRIX_PARTITION is not set
447# CONFIG_SUN_PARTITION is not set
448# CONFIG_EFI_PARTITION is not set
449
450#
451# Sound
452#
453# CONFIG_SOUND is not set
454CONFIG_SCC_ENET=y
455# CONFIG_FEC_ENET is not set
456
457#
458# MPC8260 CPM Options
459#
460CONFIG_SCC_CONSOLE=y
461
462#
463# USB support
464#
465# CONFIG_USB_GADGET is not set
466
467#
468# Bluetooth support
469#
470# CONFIG_BT is not set
471
472#
473# Library routines
474#
475# CONFIG_CRC32 is not set
476
477#
478# Kernel hacking
479#
480# CONFIG_DEBUG_KERNEL is not set
481# CONFIG_KALLSYMS is not set
482
483#
484# Security options
485#
486# CONFIG_SECURITY is not set
487
488#
489# Cryptographic options
490#
491# CONFIG_CRYPTO is not set
diff --git a/arch/ppc/configs/ev64260_defconfig b/arch/ppc/configs/ev64260_defconfig
deleted file mode 100644
index 587e9a3b9491..000000000000
--- a/arch/ppc/configs/ev64260_defconfig
+++ /dev/null
@@ -1,758 +0,0 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.10-rc2
4# Fri Nov 19 11:17:02 2004
5#
6CONFIG_MMU=y
7CONFIG_GENERIC_HARDIRQS=y
8CONFIG_RWSEM_XCHGADD_ALGORITHM=y
9CONFIG_HAVE_DEC_LOCK=y
10CONFIG_PPC=y
11CONFIG_PPC32=y
12CONFIG_GENERIC_NVRAM=y
13
14#
15# Code maturity level options
16#
17CONFIG_EXPERIMENTAL=y
18CONFIG_CLEAN_COMPILE=y
19CONFIG_BROKEN_ON_SMP=y
20
21#
22# General setup
23#
24CONFIG_LOCALVERSION=""
25CONFIG_SWAP=y
26CONFIG_SYSVIPC=y
27# CONFIG_POSIX_MQUEUE is not set
28# CONFIG_BSD_PROCESS_ACCT is not set
29CONFIG_SYSCTL=y
30# CONFIG_AUDIT is not set
31CONFIG_LOG_BUF_SHIFT=14
32# CONFIG_HOTPLUG is not set
33CONFIG_KOBJECT_UEVENT=y
34# CONFIG_IKCONFIG is not set
35# CONFIG_EMBEDDED is not set
36CONFIG_KALLSYMS=y
37# CONFIG_KALLSYMS_EXTRA_PASS is not set
38CONFIG_FUTEX=y
39CONFIG_EPOLL=y
40# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
41CONFIG_SHMEM=y
42CONFIG_CC_ALIGN_FUNCTIONS=0
43CONFIG_CC_ALIGN_LABELS=0
44CONFIG_CC_ALIGN_LOOPS=0
45CONFIG_CC_ALIGN_JUMPS=0
46# CONFIG_TINY_SHMEM is not set
47
48#
49# Loadable module support
50#
51CONFIG_MODULES=y
52CONFIG_MODULE_UNLOAD=y
53# CONFIG_MODULE_FORCE_UNLOAD is not set
54CONFIG_OBSOLETE_MODPARM=y
55# CONFIG_MODVERSIONS is not set
56# CONFIG_MODULE_SRCVERSION_ALL is not set
57CONFIG_KMOD=y
58
59#
60# Processor
61#
62CONFIG_6xx=y
63# CONFIG_40x is not set
64# CONFIG_44x is not set
65# CONFIG_POWER3 is not set
66# CONFIG_POWER4 is not set
67# CONFIG_8xx is not set
68# CONFIG_E500 is not set
69CONFIG_ALTIVEC=y
70CONFIG_TAU=y
71# CONFIG_TAU_INT is not set
72# CONFIG_TAU_AVERAGE is not set
73# CONFIG_CPU_FREQ is not set
74CONFIG_PPC_GEN550=y
75CONFIG_PPC_STD_MMU=y
76# CONFIG_NOT_COHERENT_CACHE is not set
77
78#
79# Platform options
80#
81# CONFIG_PPC_MULTIPLATFORM is not set
82# CONFIG_APUS is not set
83# CONFIG_WILLOW is not set
84# CONFIG_PCORE is not set
85# CONFIG_POWERPMC250 is not set
86# CONFIG_SPRUCE is not set
87CONFIG_EV64260=y
88# CONFIG_LOPEC is not set
89# CONFIG_MCPN765 is not set
90# CONFIG_MVME5100 is not set
91# CONFIG_PPLUS is not set
92# CONFIG_PRPMC750 is not set
93# CONFIG_PRPMC800 is not set
94# CONFIG_SANDPOINT is not set
95# CONFIG_ADIR is not set
96# CONFIG_K2 is not set
97# CONFIG_PAL4 is not set
98# CONFIG_GEMINI is not set
99# CONFIG_EST8260 is not set
100# CONFIG_SBC82xx is not set
101# CONFIG_SBS8260 is not set
102# CONFIG_RPX8260 is not set
103# CONFIG_TQM8260 is not set
104# CONFIG_ADS8272 is not set
105# CONFIG_LITE5200 is not set
106CONFIG_GT64260=y
107CONFIG_MV64X60=y
108
109#
110# Set bridge options
111#
112CONFIG_MV64X60_BASE=0xf1000000
113CONFIG_MV64X60_NEW_BASE=0xfbe00000
114# CONFIG_SMP is not set
115# CONFIG_PREEMPT is not set
116# CONFIG_HIGHMEM is not set
117CONFIG_BINFMT_ELF=y
118CONFIG_BINFMT_MISC=y
119CONFIG_CMDLINE_BOOL=y
120CONFIG_CMDLINE="console=ttyS0,115200 ip=on"
121
122#
123# Bus options
124#
125CONFIG_GENERIC_ISA_DMA=y
126CONFIG_PCI=y
127CONFIG_PCI_DOMAINS=y
128CONFIG_PCI_LEGACY_PROC=y
129CONFIG_PCI_NAMES=y
130
131#
132# Advanced setup
133#
134# CONFIG_ADVANCED_OPTIONS is not set
135
136#
137# Default settings for advanced configuration options are used
138#
139CONFIG_HIGHMEM_START=0xfe000000
140CONFIG_LOWMEM_SIZE=0x30000000
141CONFIG_KERNEL_START=0xc0000000
142CONFIG_TASK_SIZE=0x80000000
143CONFIG_BOOT_LOAD=0x00800000
144
145#
146# Device Drivers
147#
148
149#
150# Generic Driver Options
151#
152CONFIG_STANDALONE=y
153CONFIG_PREVENT_FIRMWARE_BUILD=y
154
155#
156# Memory Technology Devices (MTD)
157#
158# CONFIG_MTD is not set
159
160#
161# Parallel port support
162#
163# CONFIG_PARPORT is not set
164
165#
166# Plug and Play support
167#
168
169#
170# Block devices
171#
172# CONFIG_BLK_DEV_FD is not set
173# CONFIG_BLK_CPQ_DA is not set
174# CONFIG_BLK_CPQ_CISS_DA is not set
175# CONFIG_BLK_DEV_DAC960 is not set
176# CONFIG_BLK_DEV_UMEM is not set
177CONFIG_BLK_DEV_LOOP=y
178# CONFIG_BLK_DEV_CRYPTOLOOP is not set
179# CONFIG_BLK_DEV_NBD is not set
180# CONFIG_BLK_DEV_SX8 is not set
181CONFIG_BLK_DEV_RAM=y
182CONFIG_BLK_DEV_RAM_SIZE=4096
183CONFIG_BLK_DEV_INITRD=y
184CONFIG_INITRAMFS_SOURCE=""
185# CONFIG_LBD is not set
186# CONFIG_CDROM_PKTCDVD is not set
187
188#
189# IO Schedulers
190#
191CONFIG_IOSCHED_NOOP=y
192CONFIG_IOSCHED_AS=y
193CONFIG_IOSCHED_DEADLINE=y
194CONFIG_IOSCHED_CFQ=y
195
196#
197# ATA/ATAPI/MFM/RLL support
198#
199# CONFIG_IDE is not set
200
201#
202# SCSI device support
203#
204# CONFIG_SCSI is not set
205
206#
207# Multi-device support (RAID and LVM)
208#
209# CONFIG_MD is not set
210
211#
212# Fusion MPT device support
213#
214
215#
216# IEEE 1394 (FireWire) support
217#
218# CONFIG_IEEE1394 is not set
219
220#
221# I2O device support
222#
223# CONFIG_I2O is not set
224
225#
226# Macintosh device drivers
227#
228
229#
230# Networking support
231#
232CONFIG_NET=y
233
234#
235# Networking options
236#
237CONFIG_PACKET=y
238# CONFIG_PACKET_MMAP is not set
239# CONFIG_NETLINK_DEV is not set
240CONFIG_UNIX=y
241# CONFIG_NET_KEY is not set
242CONFIG_INET=y
243CONFIG_IP_MULTICAST=y
244# CONFIG_IP_ADVANCED_ROUTER is not set
245CONFIG_IP_PNP=y
246CONFIG_IP_PNP_DHCP=y
247# CONFIG_IP_PNP_BOOTP is not set
248# CONFIG_IP_PNP_RARP is not set
249# CONFIG_NET_IPIP is not set
250# CONFIG_NET_IPGRE is not set
251# CONFIG_IP_MROUTE is not set
252# CONFIG_ARPD is not set
253CONFIG_SYN_COOKIES=y
254# CONFIG_INET_AH is not set
255# CONFIG_INET_ESP is not set
256# CONFIG_INET_IPCOMP is not set
257# CONFIG_INET_TUNNEL is not set
258CONFIG_IP_TCPDIAG=y
259# CONFIG_IP_TCPDIAG_IPV6 is not set
260
261#
262# IP: Virtual Server Configuration
263#
264# CONFIG_IP_VS is not set
265# CONFIG_IPV6 is not set
266CONFIG_NETFILTER=y
267# CONFIG_NETFILTER_DEBUG is not set
268
269#
270# IP: Netfilter Configuration
271#
272# CONFIG_IP_NF_CONNTRACK is not set
273# CONFIG_IP_NF_CONNTRACK_MARK is not set
274# CONFIG_IP_NF_QUEUE is not set
275# CONFIG_IP_NF_IPTABLES is not set
276# CONFIG_IP_NF_ARPTABLES is not set
277# CONFIG_IP_NF_COMPAT_IPCHAINS is not set
278# CONFIG_IP_NF_COMPAT_IPFWADM is not set
279
280#
281# SCTP Configuration (EXPERIMENTAL)
282#
283# CONFIG_IP_SCTP is not set
284# CONFIG_ATM is not set
285# CONFIG_BRIDGE is not set
286# CONFIG_VLAN_8021Q is not set
287# CONFIG_DECNET is not set
288# CONFIG_LLC2 is not set
289# CONFIG_IPX is not set
290# CONFIG_ATALK is not set
291# CONFIG_X25 is not set
292# CONFIG_LAPB is not set
293# CONFIG_NET_DIVERT is not set
294# CONFIG_ECONET is not set
295# CONFIG_WAN_ROUTER is not set
296
297#
298# QoS and/or fair queueing
299#
300# CONFIG_NET_SCHED is not set
301# CONFIG_NET_CLS_ROUTE is not set
302
303#
304# Network testing
305#
306# CONFIG_NET_PKTGEN is not set
307# CONFIG_NETPOLL is not set
308# CONFIG_NET_POLL_CONTROLLER is not set
309# CONFIG_HAMRADIO is not set
310# CONFIG_IRDA is not set
311# CONFIG_BT is not set
312CONFIG_NETDEVICES=y
313# CONFIG_DUMMY is not set
314# CONFIG_BONDING is not set
315# CONFIG_EQUALIZER is not set
316# CONFIG_TUN is not set
317
318#
319# ARCnet devices
320#
321# CONFIG_ARCNET is not set
322
323#
324# Ethernet (10 or 100Mbit)
325#
326CONFIG_NET_ETHERNET=y
327CONFIG_MII=y
328# CONFIG_HAPPYMEAL is not set
329# CONFIG_SUNGEM is not set
330# CONFIG_NET_VENDOR_3COM is not set
331
332#
333# Tulip family network device support
334#
335CONFIG_NET_TULIP=y
336# CONFIG_DE2104X is not set
337CONFIG_TULIP=y
338# CONFIG_TULIP_MWI is not set
339# CONFIG_TULIP_MMIO is not set
340# CONFIG_TULIP_NAPI is not set
341# CONFIG_DE4X5 is not set
342# CONFIG_WINBOND_840 is not set
343# CONFIG_DM9102 is not set
344# CONFIG_HP100 is not set
345CONFIG_NET_PCI=y
346# CONFIG_PCNET32 is not set
347# CONFIG_AMD8111_ETH is not set
348# CONFIG_ADAPTEC_STARFIRE is not set
349# CONFIG_B44 is not set
350# CONFIG_FORCEDETH is not set
351# CONFIG_DGRS is not set
352# CONFIG_EEPRO100 is not set
353CONFIG_E100=y
354# CONFIG_E100_NAPI is not set
355# CONFIG_FEALNX is not set
356# CONFIG_NATSEMI is not set
357# CONFIG_NE2K_PCI is not set
358# CONFIG_8139CP is not set
359# CONFIG_8139TOO is not set
360# CONFIG_SIS900 is not set
361# CONFIG_EPIC100 is not set
362# CONFIG_SUNDANCE is not set
363# CONFIG_TLAN is not set
364# CONFIG_VIA_RHINE is not set
365
366#
367# Ethernet (1000 Mbit)
368#
369# CONFIG_ACENIC is not set
370# CONFIG_DL2K is not set
371# CONFIG_E1000 is not set
372# CONFIG_NS83820 is not set
373# CONFIG_HAMACHI is not set
374# CONFIG_YELLOWFIN is not set
375# CONFIG_R8169 is not set
376# CONFIG_SK98LIN is not set
377# CONFIG_VIA_VELOCITY is not set
378# CONFIG_TIGON3 is not set
379
380#
381# Ethernet (10000 Mbit)
382#
383# CONFIG_IXGB is not set
384# CONFIG_S2IO is not set
385
386#
387# Token Ring devices
388#
389# CONFIG_TR is not set
390
391#
392# Wireless LAN (non-hamradio)
393#
394# CONFIG_NET_RADIO is not set
395
396#
397# Wan interfaces
398#
399# CONFIG_WAN is not set
400# CONFIG_FDDI is not set
401# CONFIG_HIPPI is not set
402# CONFIG_PPP is not set
403# CONFIG_SLIP is not set
404# CONFIG_SHAPER is not set
405# CONFIG_NETCONSOLE is not set
406
407#
408# ISDN subsystem
409#
410# CONFIG_ISDN is not set
411
412#
413# Telephony Support
414#
415# CONFIG_PHONE is not set
416
417#
418# Input device support
419#
420CONFIG_INPUT=y
421
422#
423# Userland interfaces
424#
425CONFIG_INPUT_MOUSEDEV=y
426CONFIG_INPUT_MOUSEDEV_PSAUX=y
427CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
428CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
429# CONFIG_INPUT_JOYDEV is not set
430# CONFIG_INPUT_TSDEV is not set
431# CONFIG_INPUT_EVDEV is not set
432# CONFIG_INPUT_EVBUG is not set
433
434#
435# Input I/O drivers
436#
437# CONFIG_GAMEPORT is not set
438CONFIG_SOUND_GAMEPORT=y
439CONFIG_SERIO=y
440CONFIG_SERIO_I8042=y
441CONFIG_SERIO_SERPORT=y
442# CONFIG_SERIO_CT82C710 is not set
443# CONFIG_SERIO_PCIPS2 is not set
444# CONFIG_SERIO_RAW is not set
445
446#
447# Input Device Drivers
448#
449CONFIG_INPUT_KEYBOARD=y
450CONFIG_KEYBOARD_ATKBD=y
451# CONFIG_KEYBOARD_SUNKBD is not set
452# CONFIG_KEYBOARD_LKKBD is not set
453# CONFIG_KEYBOARD_XTKBD is not set
454# CONFIG_KEYBOARD_NEWTON is not set
455CONFIG_INPUT_MOUSE=y
456CONFIG_MOUSE_PS2=y
457# CONFIG_MOUSE_SERIAL is not set
458# CONFIG_MOUSE_VSXXXAA is not set
459# CONFIG_INPUT_JOYSTICK is not set
460# CONFIG_INPUT_TOUCHSCREEN is not set
461# CONFIG_INPUT_MISC is not set
462
463#
464# Character devices
465#
466CONFIG_VT=y
467CONFIG_VT_CONSOLE=y
468CONFIG_HW_CONSOLE=y
469# CONFIG_SERIAL_NONSTANDARD is not set
470
471#
472# Serial drivers
473#
474CONFIG_SERIAL_8250=y
475CONFIG_SERIAL_8250_CONSOLE=y
476CONFIG_SERIAL_8250_NR_UARTS=4
477# CONFIG_SERIAL_8250_EXTENDED is not set
478
479#
480# Non-8250 serial port support
481#
482CONFIG_SERIAL_CORE=y
483CONFIG_SERIAL_CORE_CONSOLE=y
484CONFIG_UNIX98_PTYS=y
485CONFIG_LEGACY_PTYS=y
486CONFIG_LEGACY_PTY_COUNT=256
487
488#
489# IPMI
490#
491# CONFIG_IPMI_HANDLER is not set
492
493#
494# Watchdog Cards
495#
496# CONFIG_WATCHDOG is not set
497# CONFIG_NVRAM is not set
498CONFIG_GEN_RTC=y
499# CONFIG_GEN_RTC_X is not set
500# CONFIG_DTLK is not set
501# CONFIG_R3964 is not set
502# CONFIG_APPLICOM is not set
503
504#
505# Ftape, the floppy tape device driver
506#
507# CONFIG_AGP is not set
508# CONFIG_DRM is not set
509# CONFIG_RAW_DRIVER is not set
510
511#
512# I2C support
513#
514CONFIG_I2C=m
515CONFIG_I2C_CHARDEV=m
516
517#
518# I2C Algorithms
519#
520# CONFIG_I2C_ALGOBIT is not set
521# CONFIG_I2C_ALGOPCF is not set
522# CONFIG_I2C_ALGOPCA is not set
523
524#
525# I2C Hardware Bus support
526#
527# CONFIG_I2C_ALI1535 is not set
528# CONFIG_I2C_ALI1563 is not set
529# CONFIG_I2C_ALI15X3 is not set
530# CONFIG_I2C_AMD756 is not set
531# CONFIG_I2C_AMD8111 is not set
532# CONFIG_I2C_I801 is not set
533# CONFIG_I2C_I810 is not set
534# CONFIG_I2C_NFORCE2 is not set
535# CONFIG_I2C_PARPORT_LIGHT is not set
536# CONFIG_I2C_PIIX4 is not set
537# CONFIG_I2C_PROSAVAGE is not set
538# CONFIG_I2C_SAVAGE4 is not set
539# CONFIG_SCx200_ACB is not set
540# CONFIG_I2C_SIS5595 is not set
541# CONFIG_I2C_SIS630 is not set
542# CONFIG_I2C_SIS96X is not set
543# CONFIG_I2C_STUB is not set
544# CONFIG_I2C_VIA is not set
545# CONFIG_I2C_VIAPRO is not set
546# CONFIG_I2C_VOODOO3 is not set
547# CONFIG_I2C_PCA_ISA is not set
548
549#
550# Hardware Sensors Chip support
551#
552# CONFIG_I2C_SENSOR is not set
553# CONFIG_SENSORS_ADM1021 is not set
554# CONFIG_SENSORS_ADM1025 is not set
555# CONFIG_SENSORS_ADM1031 is not set
556# CONFIG_SENSORS_ASB100 is not set
557# CONFIG_SENSORS_DS1621 is not set
558# CONFIG_SENSORS_FSCHER is not set
559# CONFIG_SENSORS_GL518SM is not set
560# CONFIG_SENSORS_IT87 is not set
561# CONFIG_SENSORS_LM63 is not set
562# CONFIG_SENSORS_LM75 is not set
563# CONFIG_SENSORS_LM77 is not set
564# CONFIG_SENSORS_LM78 is not set
565# CONFIG_SENSORS_LM80 is not set
566# CONFIG_SENSORS_LM83 is not set
567# CONFIG_SENSORS_LM85 is not set
568# CONFIG_SENSORS_LM87 is not set
569# CONFIG_SENSORS_LM90 is not set
570# CONFIG_SENSORS_MAX1619 is not set
571# CONFIG_SENSORS_PC87360 is not set
572# CONFIG_SENSORS_SMSC47M1 is not set
573# CONFIG_SENSORS_VIA686A is not set
574# CONFIG_SENSORS_W83781D is not set
575# CONFIG_SENSORS_W83L785TS is not set
576# CONFIG_SENSORS_W83627HF is not set
577
578#
579# Other I2C Chip support
580#
581# CONFIG_SENSORS_EEPROM is not set
582# CONFIG_SENSORS_PCF8574 is not set
583# CONFIG_SENSORS_PCF8591 is not set
584# CONFIG_SENSORS_RTC8564 is not set
585# CONFIG_I2C_DEBUG_CORE is not set
586# CONFIG_I2C_DEBUG_ALGO is not set
587# CONFIG_I2C_DEBUG_BUS is not set
588# CONFIG_I2C_DEBUG_CHIP is not set
589
590#
591# Dallas's 1-wire bus
592#
593# CONFIG_W1 is not set
594
595#
596# Misc devices
597#
598
599#
600# Multimedia devices
601#
602# CONFIG_VIDEO_DEV is not set
603
604#
605# Digital Video Broadcasting Devices
606#
607# CONFIG_DVB is not set
608
609#
610# Graphics support
611#
612# CONFIG_FB is not set
613
614#
615# Console display driver support
616#
617CONFIG_VGA_CONSOLE=y
618CONFIG_DUMMY_CONSOLE=y
619
620#
621# Sound
622#
623# CONFIG_SOUND is not set
624
625#
626# USB support
627#
628# CONFIG_USB is not set
629CONFIG_USB_ARCH_HAS_HCD=y
630CONFIG_USB_ARCH_HAS_OHCI=y
631
632#
633# USB Gadget Support
634#
635# CONFIG_USB_GADGET is not set
636
637#
638# File systems
639#
640CONFIG_EXT2_FS=y
641# CONFIG_EXT2_FS_XATTR is not set
642# CONFIG_EXT3_FS is not set
643# CONFIG_JBD is not set
644# CONFIG_REISERFS_FS is not set
645# CONFIG_JFS_FS is not set
646# CONFIG_XFS_FS is not set
647# CONFIG_MINIX_FS is not set
648# CONFIG_ROMFS_FS is not set
649# CONFIG_QUOTA is not set
650CONFIG_DNOTIFY=y
651# CONFIG_AUTOFS_FS is not set
652# CONFIG_AUTOFS4_FS is not set
653
654#
655# CD-ROM/DVD Filesystems
656#
657# CONFIG_ISO9660_FS is not set
658# CONFIG_UDF_FS is not set
659
660#
661# DOS/FAT/NT Filesystems
662#
663# CONFIG_MSDOS_FS is not set
664# CONFIG_VFAT_FS is not set
665# CONFIG_NTFS_FS is not set
666
667#
668# Pseudo filesystems
669#
670CONFIG_PROC_FS=y
671# CONFIG_PROC_KCORE is not set
672CONFIG_SYSFS=y
673CONFIG_DEVFS_FS=y
674# CONFIG_DEVFS_MOUNT is not set
675# CONFIG_DEVFS_DEBUG is not set
676# CONFIG_DEVPTS_FS_XATTR is not set
677CONFIG_TMPFS=y
678# CONFIG_TMPFS_XATTR is not set
679# CONFIG_HUGETLB_PAGE is not set
680CONFIG_RAMFS=y
681
682#
683# Miscellaneous filesystems
684#
685# CONFIG_ADFS_FS is not set
686# CONFIG_AFFS_FS is not set
687# CONFIG_HFS_FS is not set
688# CONFIG_HFSPLUS_FS is not set
689# CONFIG_BEFS_FS is not set
690# CONFIG_BFS_FS is not set
691# CONFIG_EFS_FS is not set
692# CONFIG_CRAMFS is not set
693# CONFIG_VXFS_FS is not set
694# CONFIG_HPFS_FS is not set
695# CONFIG_QNX4FS_FS is not set
696# CONFIG_SYSV_FS is not set
697# CONFIG_UFS_FS is not set
698
699#
700# Network File Systems
701#
702CONFIG_NFS_FS=y
703CONFIG_NFS_V3=y
704# CONFIG_NFS_V4 is not set
705# CONFIG_NFS_DIRECTIO is not set
706# CONFIG_NFSD is not set
707CONFIG_ROOT_NFS=y
708CONFIG_LOCKD=y
709CONFIG_LOCKD_V4=y
710# CONFIG_EXPORTFS is not set
711CONFIG_SUNRPC=y
712# CONFIG_RPCSEC_GSS_KRB5 is not set
713# CONFIG_RPCSEC_GSS_SPKM3 is not set
714# CONFIG_SMB_FS is not set
715# CONFIG_CIFS is not set
716# CONFIG_NCP_FS is not set
717# CONFIG_CODA_FS is not set
718# CONFIG_AFS_FS is not set
719
720#
721# Partition Types
722#
723# CONFIG_PARTITION_ADVANCED is not set
724CONFIG_MSDOS_PARTITION=y
725
726#
727# Native Language Support
728#
729# CONFIG_NLS is not set
730
731#
732# Library routines
733#
734# CONFIG_CRC_CCITT is not set
735CONFIG_CRC32=y
736# CONFIG_LIBCRC32C is not set
737
738#
739# Profiling support
740#
741# CONFIG_PROFILING is not set
742
743#
744# Kernel hacking
745#
746# CONFIG_DEBUG_KERNEL is not set
747# CONFIG_SERIAL_TEXT_DEBUG is not set
748
749#
750# Security options
751#
752# CONFIG_KEYS is not set
753# CONFIG_SECURITY is not set
754
755#
756# Cryptographic options
757#
758# CONFIG_CRYPTO is not set
diff --git a/arch/ppc/configs/ev64360_defconfig b/arch/ppc/configs/ev64360_defconfig
deleted file mode 100644
index f297c4bb632b..000000000000
--- a/arch/ppc/configs/ev64360_defconfig
+++ /dev/null
@@ -1,817 +0,0 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.14
4# Fri Oct 28 19:15:34 2005
5#
6CONFIG_MMU=y
7CONFIG_GENERIC_HARDIRQS=y
8CONFIG_RWSEM_XCHGADD_ALGORITHM=y
9CONFIG_GENERIC_CALIBRATE_DELAY=y
10CONFIG_PPC=y
11CONFIG_PPC32=y
12CONFIG_GENERIC_NVRAM=y
13CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
14CONFIG_ARCH_MAY_HAVE_PC_FDC=y
15
16#
17# Code maturity level options
18#
19CONFIG_EXPERIMENTAL=y
20CONFIG_CLEAN_COMPILE=y
21CONFIG_BROKEN_ON_SMP=y
22CONFIG_LOCK_KERNEL=y
23CONFIG_INIT_ENV_ARG_LIMIT=32
24
25#
26# General setup
27#
28CONFIG_LOCALVERSION=""
29CONFIG_LOCALVERSION_AUTO=y
30CONFIG_SWAP=y
31CONFIG_SYSVIPC=y
32CONFIG_POSIX_MQUEUE=y
33# CONFIG_BSD_PROCESS_ACCT is not set
34CONFIG_SYSCTL=y
35# CONFIG_AUDIT is not set
36CONFIG_HOTPLUG=y
37CONFIG_KOBJECT_UEVENT=y
38# CONFIG_IKCONFIG is not set
39CONFIG_INITRAMFS_SOURCE=""
40# CONFIG_EMBEDDED is not set
41CONFIG_KALLSYMS=y
42# CONFIG_KALLSYMS_EXTRA_PASS is not set
43CONFIG_PRINTK=y
44CONFIG_BUG=y
45CONFIG_BASE_FULL=y
46CONFIG_FUTEX=y
47CONFIG_EPOLL=y
48CONFIG_SHMEM=y
49CONFIG_CC_ALIGN_FUNCTIONS=0
50CONFIG_CC_ALIGN_LABELS=0
51CONFIG_CC_ALIGN_LOOPS=0
52CONFIG_CC_ALIGN_JUMPS=0
53# CONFIG_TINY_SHMEM is not set
54CONFIG_BASE_SMALL=0
55
56#
57# Loadable module support
58#
59# CONFIG_MODULES is not set
60
61#
62# Processor
63#
64CONFIG_6xx=y
65# CONFIG_40x is not set
66# CONFIG_44x is not set
67# CONFIG_POWER3 is not set
68# CONFIG_POWER4 is not set
69# CONFIG_8xx is not set
70# CONFIG_E200 is not set
71# CONFIG_E500 is not set
72CONFIG_PPC_FPU=y
73CONFIG_ALTIVEC=y
74CONFIG_TAU=y
75# CONFIG_TAU_INT is not set
76# CONFIG_TAU_AVERAGE is not set
77# CONFIG_KEXEC is not set
78# CONFIG_CPU_FREQ is not set
79# CONFIG_WANT_EARLY_SERIAL is not set
80CONFIG_PPC_STD_MMU=y
81CONFIG_NOT_COHERENT_CACHE=y
82
83#
84# Platform options
85#
86# CONFIG_PPC_MULTIPLATFORM is not set
87# CONFIG_APUS is not set
88# CONFIG_KATANA is not set
89# CONFIG_WILLOW is not set
90# CONFIG_CPCI690 is not set
91# CONFIG_POWERPMC250 is not set
92# CONFIG_CHESTNUT is not set
93# CONFIG_SPRUCE is not set
94# CONFIG_HDPU is not set
95# CONFIG_EV64260 is not set
96# CONFIG_LOPEC is not set
97# CONFIG_MVME5100 is not set
98# CONFIG_PPLUS is not set
99# CONFIG_PRPMC750 is not set
100# CONFIG_PRPMC800 is not set
101# CONFIG_SANDPOINT is not set
102# CONFIG_RADSTONE_PPC7D is not set
103# CONFIG_PAL4 is not set
104# CONFIG_GEMINI is not set
105# CONFIG_EST8260 is not set
106# CONFIG_SBC82xx is not set
107# CONFIG_SBS8260 is not set
108# CONFIG_RPX8260 is not set
109# CONFIG_TQM8260 is not set
110# CONFIG_ADS8272 is not set
111# CONFIG_PQ2FADS is not set
112# CONFIG_LITE5200 is not set
113# CONFIG_MPC834x_SYS is not set
114CONFIG_EV64360=y
115CONFIG_MV64360=y
116CONFIG_MV64X60=y
117
118#
119# Set bridge options
120#
121CONFIG_MV64X60_BASE=0xf1000000
122CONFIG_MV64X60_NEW_BASE=0xf1000000
123# CONFIG_SMP is not set
124# CONFIG_HIGHMEM is not set
125# CONFIG_HZ_100 is not set
126CONFIG_HZ_250=y
127# CONFIG_HZ_1000 is not set
128CONFIG_HZ=250
129# CONFIG_PREEMPT_NONE is not set
130# CONFIG_PREEMPT_VOLUNTARY is not set
131CONFIG_PREEMPT=y
132CONFIG_PREEMPT_BKL=y
133CONFIG_SELECT_MEMORY_MODEL=y
134CONFIG_FLATMEM_MANUAL=y
135# CONFIG_DISCONTIGMEM_MANUAL is not set
136# CONFIG_SPARSEMEM_MANUAL is not set
137CONFIG_FLATMEM=y
138CONFIG_FLAT_NODE_MEM_MAP=y
139# CONFIG_SPARSEMEM_STATIC is not set
140CONFIG_BINFMT_ELF=y
141CONFIG_BINFMT_MISC=y
142CONFIG_CMDLINE_BOOL=y
143CONFIG_CMDLINE="console=ttyMM0,115200 root=/dev/mtdblock1 rw rootfstype=jffs2"
144# CONFIG_PM is not set
145# CONFIG_HIBERNATION is not set
146CONFIG_SECCOMP=y
147CONFIG_ISA_DMA_API=y
148
149#
150# Bus options
151#
152CONFIG_GENERIC_ISA_DMA=y
153CONFIG_PCI=y
154CONFIG_PCI_DOMAINS=y
155# CONFIG_PCI_LEGACY_PROC is not set
156
157#
158# PCCARD (PCMCIA/CardBus) support
159#
160# CONFIG_PCCARD is not set
161
162#
163# Advanced setup
164#
165CONFIG_ADVANCED_OPTIONS=y
166CONFIG_HIGHMEM_START=0xfe000000
167# CONFIG_LOWMEM_SIZE_BOOL is not set
168CONFIG_LOWMEM_SIZE=0x30000000
169# CONFIG_KERNEL_START_BOOL is not set
170CONFIG_KERNEL_START=0xc0000000
171# CONFIG_TASK_SIZE_BOOL is not set
172CONFIG_TASK_SIZE=0x80000000
173# CONFIG_CONSISTENT_START_BOOL is not set
174CONFIG_CONSISTENT_START=0xff100000
175# CONFIG_CONSISTENT_SIZE_BOOL is not set
176CONFIG_CONSISTENT_SIZE=0x00200000
177# CONFIG_BOOT_LOAD_BOOL is not set
178CONFIG_BOOT_LOAD=0x00800000
179
180#
181# Networking
182#
183CONFIG_NET=y
184
185#
186# Networking options
187#
188CONFIG_PACKET=y
189# CONFIG_PACKET_MMAP is not set
190CONFIG_UNIX=y
191# CONFIG_NET_KEY is not set
192CONFIG_INET=y
193CONFIG_IP_MULTICAST=y
194# CONFIG_IP_ADVANCED_ROUTER is not set
195CONFIG_IP_FIB_HASH=y
196CONFIG_IP_PNP=y
197CONFIG_IP_PNP_DHCP=y
198# CONFIG_IP_PNP_BOOTP is not set
199# CONFIG_IP_PNP_RARP is not set
200# CONFIG_NET_IPIP is not set
201# CONFIG_NET_IPGRE is not set
202# CONFIG_IP_MROUTE is not set
203# CONFIG_ARPD is not set
204CONFIG_SYN_COOKIES=y
205# CONFIG_INET_AH is not set
206# CONFIG_INET_ESP is not set
207# CONFIG_INET_IPCOMP is not set
208# CONFIG_INET_TUNNEL is not set
209CONFIG_INET_DIAG=y
210CONFIG_INET_TCP_DIAG=y
211# CONFIG_TCP_CONG_ADVANCED is not set
212CONFIG_TCP_CONG_BIC=y
213# CONFIG_IPV6 is not set
214# CONFIG_NETFILTER is not set
215
216#
217# DCCP Configuration (EXPERIMENTAL)
218#
219# CONFIG_IP_DCCP is not set
220
221#
222# SCTP Configuration (EXPERIMENTAL)
223#
224# CONFIG_IP_SCTP is not set
225# CONFIG_ATM is not set
226# CONFIG_BRIDGE is not set
227# CONFIG_VLAN_8021Q is not set
228# CONFIG_DECNET is not set
229# CONFIG_LLC2 is not set
230# CONFIG_IPX is not set
231# CONFIG_ATALK is not set
232# CONFIG_X25 is not set
233# CONFIG_LAPB is not set
234# CONFIG_NET_DIVERT is not set
235# CONFIG_ECONET is not set
236# CONFIG_WAN_ROUTER is not set
237# CONFIG_NET_SCHED is not set
238# CONFIG_NET_CLS_ROUTE is not set
239
240#
241# Network testing
242#
243# CONFIG_NET_PKTGEN is not set
244# CONFIG_HAMRADIO is not set
245# CONFIG_IRDA is not set
246# CONFIG_BT is not set
247# CONFIG_IEEE80211 is not set
248
249#
250# Device Drivers
251#
252
253#
254# Generic Driver Options
255#
256CONFIG_STANDALONE=y
257CONFIG_PREVENT_FIRMWARE_BUILD=y
258# CONFIG_FW_LOADER is not set
259
260#
261# Connector - unified userspace <-> kernelspace linker
262#
263# CONFIG_CONNECTOR is not set
264
265#
266# Memory Technology Devices (MTD)
267#
268CONFIG_MTD=y
269# CONFIG_MTD_DEBUG is not set
270CONFIG_MTD_CONCAT=y
271CONFIG_MTD_PARTITIONS=y
272# CONFIG_MTD_REDBOOT_PARTS is not set
273# CONFIG_MTD_CMDLINE_PARTS is not set
274
275#
276# User Modules And Translation Layers
277#
278CONFIG_MTD_CHAR=y
279CONFIG_MTD_BLOCK=y
280# CONFIG_FTL is not set
281# CONFIG_NFTL is not set
282# CONFIG_INFTL is not set
283
284#
285# RAM/ROM/Flash chip drivers
286#
287CONFIG_MTD_CFI=y
288# CONFIG_MTD_JEDECPROBE is not set
289CONFIG_MTD_GEN_PROBE=y
290CONFIG_MTD_CFI_ADV_OPTIONS=y
291CONFIG_MTD_CFI_NOSWAP=y
292# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set
293# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set
294CONFIG_MTD_CFI_GEOMETRY=y
295# CONFIG_MTD_MAP_BANK_WIDTH_1 is not set
296# CONFIG_MTD_MAP_BANK_WIDTH_2 is not set
297CONFIG_MTD_MAP_BANK_WIDTH_4=y
298# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
299# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
300# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
301# CONFIG_MTD_CFI_I1 is not set
302CONFIG_MTD_CFI_I2=y
303# CONFIG_MTD_CFI_I4 is not set
304# CONFIG_MTD_CFI_I8 is not set
305# CONFIG_MTD_OTP is not set
306CONFIG_MTD_CFI_INTELEXT=y
307# CONFIG_MTD_CFI_AMDSTD is not set
308# CONFIG_MTD_CFI_STAA is not set
309CONFIG_MTD_CFI_UTIL=y
310# CONFIG_MTD_RAM is not set
311# CONFIG_MTD_ROM is not set
312# CONFIG_MTD_ABSENT is not set
313
314#
315# Mapping drivers for chip access
316#
317# CONFIG_MTD_COMPLEX_MAPPINGS is not set
318CONFIG_MTD_PHYSMAP=y
319CONFIG_MTD_PHYSMAP_START=0xff000000
320CONFIG_MTD_PHYSMAP_LEN=0x01000000
321CONFIG_MTD_PHYSMAP_BANKWIDTH=4
322# CONFIG_MTD_PLATRAM is not set
323
324#
325# Self-contained MTD device drivers
326#
327# CONFIG_MTD_PMC551 is not set
328# CONFIG_MTD_SLRAM is not set
329CONFIG_MTD_PHRAM=y
330# CONFIG_MTD_MTDRAM is not set
331# CONFIG_MTD_BLKMTD is not set
332# CONFIG_MTD_BLOCK2MTD is not set
333
334#
335# Disk-On-Chip Device Drivers
336#
337# CONFIG_MTD_DOC2000 is not set
338# CONFIG_MTD_DOC2001 is not set
339# CONFIG_MTD_DOC2001PLUS is not set
340
341#
342# NAND Flash Device Drivers
343#
344# CONFIG_MTD_NAND is not set
345
346#
347# Parallel port support
348#
349# CONFIG_PARPORT is not set
350
351#
352# Plug and Play support
353#
354
355#
356# Block devices
357#
358# CONFIG_BLK_DEV_FD is not set
359# CONFIG_BLK_CPQ_DA is not set
360# CONFIG_BLK_CPQ_CISS_DA is not set
361# CONFIG_BLK_DEV_DAC960 is not set
362# CONFIG_BLK_DEV_UMEM is not set
363# CONFIG_BLK_DEV_COW_COMMON is not set
364CONFIG_BLK_DEV_LOOP=y
365# CONFIG_BLK_DEV_CRYPTOLOOP is not set
366# CONFIG_BLK_DEV_NBD is not set
367# CONFIG_BLK_DEV_SX8 is not set
368CONFIG_BLK_DEV_RAM=y
369CONFIG_BLK_DEV_RAM_COUNT=16
370CONFIG_BLK_DEV_RAM_SIZE=32768
371CONFIG_BLK_DEV_INITRD=y
372# CONFIG_LBD is not set
373# CONFIG_CDROM_PKTCDVD is not set
374
375#
376# IO Schedulers
377#
378CONFIG_IOSCHED_NOOP=y
379CONFIG_IOSCHED_AS=y
380CONFIG_IOSCHED_DEADLINE=y
381CONFIG_IOSCHED_CFQ=y
382# CONFIG_ATA_OVER_ETH is not set
383
384#
385# ATA/ATAPI/MFM/RLL support
386#
387# CONFIG_IDE is not set
388
389#
390# SCSI device support
391#
392# CONFIG_RAID_ATTRS is not set
393# CONFIG_SCSI is not set
394
395#
396# Multi-device support (RAID and LVM)
397#
398# CONFIG_MD is not set
399
400#
401# Fusion MPT device support
402#
403# CONFIG_FUSION is not set
404
405#
406# IEEE 1394 (FireWire) support
407#
408# CONFIG_IEEE1394 is not set
409
410#
411# I2O device support
412#
413# CONFIG_I2O is not set
414
415#
416# Macintosh device drivers
417#
418
419#
420# Network device support
421#
422CONFIG_NETDEVICES=y
423# CONFIG_DUMMY is not set
424# CONFIG_BONDING is not set
425# CONFIG_EQUALIZER is not set
426# CONFIG_TUN is not set
427
428#
429# ARCnet devices
430#
431# CONFIG_ARCNET is not set
432
433#
434# PHY device support
435#
436
437#
438# Ethernet (10 or 100Mbit)
439#
440# CONFIG_NET_ETHERNET is not set
441
442#
443# Ethernet (1000 Mbit)
444#
445# CONFIG_ACENIC is not set
446# CONFIG_DL2K is not set
447# CONFIG_E1000 is not set
448# CONFIG_NS83820 is not set
449# CONFIG_HAMACHI is not set
450# CONFIG_YELLOWFIN is not set
451# CONFIG_R8169 is not set
452# CONFIG_SIS190 is not set
453# CONFIG_SKGE is not set
454# CONFIG_SK98LIN is not set
455# CONFIG_TIGON3 is not set
456# CONFIG_BNX2 is not set
457CONFIG_MV643XX_ETH=y
458CONFIG_MV643XX_ETH_0=y
459# CONFIG_MV643XX_ETH_1 is not set
460# CONFIG_MV643XX_ETH_2 is not set
461
462#
463# Ethernet (10000 Mbit)
464#
465# CONFIG_CHELSIO_T1 is not set
466# CONFIG_IXGB is not set
467# CONFIG_S2IO is not set
468
469#
470# Token Ring devices
471#
472# CONFIG_TR is not set
473
474#
475# Wireless LAN (non-hamradio)
476#
477# CONFIG_NET_RADIO is not set
478
479#
480# Wan interfaces
481#
482# CONFIG_WAN is not set
483# CONFIG_FDDI is not set
484# CONFIG_HIPPI is not set
485# CONFIG_PPP is not set
486# CONFIG_SLIP is not set
487# CONFIG_SHAPER is not set
488# CONFIG_NETCONSOLE is not set
489# CONFIG_NETPOLL is not set
490# CONFIG_NET_POLL_CONTROLLER is not set
491
492#
493# ISDN subsystem
494#
495# CONFIG_ISDN is not set
496
497#
498# Telephony Support
499#
500# CONFIG_PHONE is not set
501
502#
503# Input device support
504#
505CONFIG_INPUT=y
506
507#
508# Userland interfaces
509#
510CONFIG_INPUT_MOUSEDEV=y
511# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
512CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
513CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
514# CONFIG_INPUT_JOYDEV is not set
515# CONFIG_INPUT_TSDEV is not set
516# CONFIG_INPUT_EVDEV is not set
517# CONFIG_INPUT_EVBUG is not set
518
519#
520# Input Device Drivers
521#
522# CONFIG_INPUT_KEYBOARD is not set
523# CONFIG_INPUT_MOUSE is not set
524# CONFIG_INPUT_JOYSTICK is not set
525# CONFIG_INPUT_TOUCHSCREEN is not set
526# CONFIG_INPUT_MISC is not set
527
528#
529# Hardware I/O ports
530#
531# CONFIG_SERIO is not set
532# CONFIG_GAMEPORT is not set
533
534#
535# Character devices
536#
537CONFIG_VT=y
538CONFIG_VT_CONSOLE=y
539CONFIG_HW_CONSOLE=y
540# CONFIG_SERIAL_NONSTANDARD is not set
541
542#
543# Serial drivers
544#
545# CONFIG_SERIAL_8250 is not set
546
547#
548# Non-8250 serial port support
549#
550CONFIG_SERIAL_MPSC=y
551CONFIG_SERIAL_MPSC_CONSOLE=y
552CONFIG_SERIAL_CORE=y
553CONFIG_SERIAL_CORE_CONSOLE=y
554# CONFIG_SERIAL_JSM is not set
555CONFIG_UNIX98_PTYS=y
556CONFIG_LEGACY_PTYS=y
557CONFIG_LEGACY_PTY_COUNT=256
558
559#
560# IPMI
561#
562# CONFIG_IPMI_HANDLER is not set
563
564#
565# Watchdog Cards
566#
567CONFIG_WATCHDOG=y
568# CONFIG_WATCHDOG_NOWAYOUT is not set
569
570#
571# Watchdog Device Drivers
572#
573# CONFIG_SOFT_WATCHDOG is not set
574CONFIG_MV64X60_WDT=y
575
576#
577# PCI-based Watchdog Cards
578#
579# CONFIG_PCIPCWATCHDOG is not set
580# CONFIG_WDTPCI is not set
581# CONFIG_NVRAM is not set
582CONFIG_GEN_RTC=y
583# CONFIG_GEN_RTC_X is not set
584# CONFIG_DTLK is not set
585# CONFIG_R3964 is not set
586# CONFIG_APPLICOM is not set
587
588#
589# Ftape, the floppy tape device driver
590#
591# CONFIG_AGP is not set
592# CONFIG_DRM is not set
593# CONFIG_RAW_DRIVER is not set
594
595#
596# TPM devices
597#
598# CONFIG_TCG_TPM is not set
599
600#
601# I2C support
602#
603# CONFIG_I2C is not set
604
605#
606# Dallas's 1-wire bus
607#
608# CONFIG_W1 is not set
609
610#
611# Hardware Monitoring support
612#
613CONFIG_HWMON=y
614# CONFIG_HWMON_VID is not set
615# CONFIG_HWMON_DEBUG_CHIP is not set
616
617#
618# Misc devices
619#
620
621#
622# Multimedia Capabilities Port drivers
623#
624
625#
626# Multimedia devices
627#
628# CONFIG_VIDEO_DEV is not set
629
630#
631# Digital Video Broadcasting Devices
632#
633# CONFIG_DVB is not set
634
635#
636# Graphics support
637#
638# CONFIG_FB is not set
639
640#
641# Console display driver support
642#
643# CONFIG_VGA_CONSOLE is not set
644CONFIG_DUMMY_CONSOLE=y
645
646#
647# Sound
648#
649# CONFIG_SOUND is not set
650
651#
652# USB support
653#
654CONFIG_USB_ARCH_HAS_HCD=y
655CONFIG_USB_ARCH_HAS_OHCI=y
656# CONFIG_USB is not set
657
658#
659# USB Gadget Support
660#
661# CONFIG_USB_GADGET is not set
662
663#
664# MMC/SD Card support
665#
666# CONFIG_MMC is not set
667
668#
669# InfiniBand support
670#
671# CONFIG_INFINIBAND is not set
672
673#
674# SN Devices
675#
676
677#
678# File systems
679#
680CONFIG_EXT2_FS=y
681# CONFIG_EXT2_FS_XATTR is not set
682# CONFIG_EXT2_FS_XIP is not set
683# CONFIG_EXT3_FS is not set
684# CONFIG_JBD is not set
685# CONFIG_REISERFS_FS is not set
686# CONFIG_JFS_FS is not set
687# CONFIG_FS_POSIX_ACL is not set
688# CONFIG_XFS_FS is not set
689# CONFIG_MINIX_FS is not set
690# CONFIG_ROMFS_FS is not set
691CONFIG_INOTIFY=y
692# CONFIG_QUOTA is not set
693CONFIG_DNOTIFY=y
694# CONFIG_AUTOFS_FS is not set
695# CONFIG_AUTOFS4_FS is not set
696# CONFIG_FUSE_FS is not set
697
698#
699# CD-ROM/DVD Filesystems
700#
701# CONFIG_ISO9660_FS is not set
702# CONFIG_UDF_FS is not set
703
704#
705# DOS/FAT/NT Filesystems
706#
707# CONFIG_MSDOS_FS is not set
708# CONFIG_VFAT_FS is not set
709# CONFIG_NTFS_FS is not set
710
711#
712# Pseudo filesystems
713#
714CONFIG_PROC_FS=y
715CONFIG_PROC_KCORE=y
716CONFIG_SYSFS=y
717CONFIG_TMPFS=y
718# CONFIG_HUGETLB_PAGE is not set
719CONFIG_RAMFS=y
720# CONFIG_RELAYFS_FS is not set
721
722#
723# Miscellaneous filesystems
724#
725# CONFIG_ADFS_FS is not set
726# CONFIG_AFFS_FS is not set
727# CONFIG_HFS_FS is not set
728# CONFIG_HFSPLUS_FS is not set
729# CONFIG_BEFS_FS is not set
730# CONFIG_BFS_FS is not set
731# CONFIG_EFS_FS is not set
732# CONFIG_JFFS_FS is not set
733CONFIG_JFFS2_FS=y
734CONFIG_JFFS2_FS_DEBUG=0
735CONFIG_JFFS2_FS_WRITEBUFFER=y
736# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
737CONFIG_JFFS2_ZLIB=y
738CONFIG_JFFS2_RTIME=y
739# CONFIG_JFFS2_RUBIN is not set
740# CONFIG_CRAMFS is not set
741# CONFIG_VXFS_FS is not set
742# CONFIG_HPFS_FS is not set
743# CONFIG_QNX4FS_FS is not set
744# CONFIG_SYSV_FS is not set
745# CONFIG_UFS_FS is not set
746
747#
748# Network File Systems
749#
750CONFIG_NFS_FS=y
751CONFIG_NFS_V3=y
752# CONFIG_NFS_V3_ACL is not set
753# CONFIG_NFS_V4 is not set
754# CONFIG_NFS_DIRECTIO is not set
755# CONFIG_NFSD is not set
756CONFIG_ROOT_NFS=y
757CONFIG_LOCKD=y
758CONFIG_LOCKD_V4=y
759CONFIG_NFS_COMMON=y
760CONFIG_SUNRPC=y
761# CONFIG_RPCSEC_GSS_KRB5 is not set
762# CONFIG_RPCSEC_GSS_SPKM3 is not set
763# CONFIG_SMB_FS is not set
764# CONFIG_CIFS is not set
765# CONFIG_NCP_FS is not set
766# CONFIG_CODA_FS is not set
767# CONFIG_AFS_FS is not set
768# CONFIG_9P_FS is not set
769
770#
771# Partition Types
772#
773# CONFIG_PARTITION_ADVANCED is not set
774CONFIG_MSDOS_PARTITION=y
775
776#
777# Native Language Support
778#
779# CONFIG_NLS is not set
780
781#
782# Library routines
783#
784# CONFIG_CRC_CCITT is not set
785# CONFIG_CRC16 is not set
786CONFIG_CRC32=y
787# CONFIG_LIBCRC32C is not set
788CONFIG_ZLIB_INFLATE=y
789CONFIG_ZLIB_DEFLATE=y
790
791#
792# Profiling support
793#
794# CONFIG_PROFILING is not set
795
796#
797# Kernel hacking
798#
799# CONFIG_PRINTK_TIME is not set
800# CONFIG_DEBUG_KERNEL is not set
801CONFIG_LOG_BUF_SHIFT=14
802# CONFIG_SERIAL_TEXT_DEBUG is not set
803
804#
805# Security options
806#
807# CONFIG_KEYS is not set
808# CONFIG_SECURITY is not set
809
810#
811# Cryptographic options
812#
813# CONFIG_CRYPTO is not set
814
815#
816# Hardware crypto devices
817#
diff --git a/arch/ppc/configs/hdpu_defconfig b/arch/ppc/configs/hdpu_defconfig
deleted file mode 100644
index 956a17897e33..000000000000
--- a/arch/ppc/configs/hdpu_defconfig
+++ /dev/null
@@ -1,890 +0,0 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.11
4# Wed Mar 16 12:43:19 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
14
15#
16# Code maturity level options
17#
18CONFIG_EXPERIMENTAL=y
19CONFIG_CLEAN_COMPILE=y
20CONFIG_LOCK_KERNEL=y
21
22#
23# General setup
24#
25CONFIG_LOCALVERSION=""
26CONFIG_SWAP=y
27CONFIG_SYSVIPC=y
28# CONFIG_POSIX_MQUEUE is not set
29# CONFIG_BSD_PROCESS_ACCT is not set
30CONFIG_SYSCTL=y
31# CONFIG_AUDIT is not set
32CONFIG_HOTPLUG=y
33CONFIG_KOBJECT_UEVENT=y
34# CONFIG_IKCONFIG is not set
35# CONFIG_CPUSETS is not set
36CONFIG_EMBEDDED=y
37# CONFIG_KALLSYMS is not set
38CONFIG_BASE_FULL=y
39CONFIG_FUTEX=y
40CONFIG_EPOLL=y
41# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
42CONFIG_SHMEM=y
43CONFIG_CC_ALIGN_FUNCTIONS=0
44CONFIG_CC_ALIGN_LABELS=0
45CONFIG_CC_ALIGN_LOOPS=0
46CONFIG_CC_ALIGN_JUMPS=0
47# CONFIG_TINY_SHMEM is not set
48CONFIG_BASE_SMALL=0
49
50#
51# Loadable module support
52#
53CONFIG_MODULES=y
54CONFIG_MODULE_UNLOAD=y
55# CONFIG_MODULE_FORCE_UNLOAD is not set
56CONFIG_OBSOLETE_MODPARM=y
57# CONFIG_MODVERSIONS is not set
58# CONFIG_MODULE_SRCVERSION_ALL is not set
59CONFIG_KMOD=y
60CONFIG_STOP_MACHINE=y
61
62#
63# Processor
64#
65CONFIG_6xx=y
66# CONFIG_40x is not set
67# CONFIG_44x is not set
68# CONFIG_POWER3 is not set
69# CONFIG_POWER4 is not set
70# CONFIG_8xx is not set
71# CONFIG_E500 is not set
72CONFIG_ALTIVEC=y
73# CONFIG_TAU is not set
74# CONFIG_CPU_FREQ is not set
75# CONFIG_PM is not set
76CONFIG_PPC_STD_MMU=y
77# CONFIG_NOT_COHERENT_CACHE is not set
78
79#
80# Platform options
81#
82# CONFIG_PPC_MULTIPLATFORM is not set
83# CONFIG_APUS is not set
84# CONFIG_KATANA is not set
85# CONFIG_WILLOW is not set
86# CONFIG_CPCI690 is not set
87# CONFIG_PCORE is not set
88# CONFIG_POWERPMC250 is not set
89# CONFIG_CHESTNUT is not set
90# CONFIG_SPRUCE is not set
91CONFIG_HDPU=y
92# CONFIG_EV64260 is not set
93# CONFIG_LOPEC is not set
94# CONFIG_MCPN765 is not set
95# CONFIG_MVME5100 is not set
96# CONFIG_PPLUS is not set
97# CONFIG_PRPMC750 is not set
98# CONFIG_PRPMC800 is not set
99# CONFIG_SANDPOINT is not set
100# CONFIG_RADSTONE_PPC7D is not set
101# CONFIG_ADIR is not set
102# CONFIG_K2 is not set
103# CONFIG_PAL4 is not set
104# CONFIG_GEMINI is not set
105# CONFIG_EST8260 is not set
106# CONFIG_SBC82xx is not set
107# CONFIG_SBS8260 is not set
108# CONFIG_RPX8260 is not set
109# CONFIG_TQM8260 is not set
110# CONFIG_ADS8272 is not set
111# CONFIG_PQ2FADS is not set
112# CONFIG_LITE5200 is not set
113# CONFIG_MPC834x_SYS is not set
114CONFIG_MV64360=y
115CONFIG_MV64X60=y
116
117#
118# Set bridge options
119#
120CONFIG_MV64X60_BASE=0xf1000000
121CONFIG_MV64X60_NEW_BASE=0xf1000000
122# CONFIG_SMP is not set
123# CONFIG_IRQ_ALL_CPUS is not set
124# CONFIG_NR_CPUS is not set
125CONFIG_PREEMPT=y
126CONFIG_HIGHMEM=y
127CONFIG_BINFMT_ELF=y
128CONFIG_BINFMT_MISC=y
129CONFIG_CMDLINE_BOOL=y
130CONFIG_CMDLINE="root=/dev/nfs ip=auto"
131
132#
133# Bus options
134#
135CONFIG_GENERIC_ISA_DMA=y
136CONFIG_PCI=y
137CONFIG_PCI_DOMAINS=y
138CONFIG_PCI_LEGACY_PROC=y
139CONFIG_PCI_NAMES=y
140
141#
142# PCCARD (PCMCIA/CardBus) support
143#
144# CONFIG_PCCARD is not set
145
146#
147# Advanced setup
148#
149CONFIG_ADVANCED_OPTIONS=y
150# CONFIG_HIGHMEM_START_BOOL is not set
151CONFIG_HIGHMEM_START=0xfe000000
152# CONFIG_LOWMEM_SIZE_BOOL is not set
153CONFIG_LOWMEM_SIZE=0x30000000
154CONFIG_KERNEL_START_BOOL=y
155CONFIG_KERNEL_START=0x80000000
156# CONFIG_TASK_SIZE_BOOL is not set
157CONFIG_TASK_SIZE=0x80000000
158# CONFIG_BOOT_LOAD_BOOL is not set
159CONFIG_BOOT_LOAD=0x00800000
160
161#
162# Device Drivers
163#
164
165#
166# Generic Driver Options
167#
168CONFIG_STANDALONE=y
169CONFIG_PREVENT_FIRMWARE_BUILD=y
170CONFIG_FW_LOADER=y
171
172#
173# Memory Technology Devices (MTD)
174#
175CONFIG_MTD=y
176# CONFIG_MTD_DEBUG is not set
177# CONFIG_MTD_CONCAT is not set
178CONFIG_MTD_PARTITIONS=y
179# CONFIG_MTD_REDBOOT_PARTS is not set
180# CONFIG_MTD_CMDLINE_PARTS is not set
181
182#
183# User Modules And Translation Layers
184#
185CONFIG_MTD_CHAR=y
186# CONFIG_MTD_BLOCK is not set
187# CONFIG_MTD_BLOCK_RO is not set
188# CONFIG_FTL is not set
189# CONFIG_NFTL is not set
190# CONFIG_INFTL is not set
191
192#
193# RAM/ROM/Flash chip drivers
194#
195CONFIG_MTD_CFI=y
196# CONFIG_MTD_JEDECPROBE is not set
197CONFIG_MTD_GEN_PROBE=y
198# CONFIG_MTD_CFI_ADV_OPTIONS is not set
199CONFIG_MTD_MAP_BANK_WIDTH_1=y
200CONFIG_MTD_MAP_BANK_WIDTH_2=y
201CONFIG_MTD_MAP_BANK_WIDTH_4=y
202# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
203# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
204# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
205CONFIG_MTD_CFI_I1=y
206CONFIG_MTD_CFI_I2=y
207# CONFIG_MTD_CFI_I4 is not set
208# CONFIG_MTD_CFI_I8 is not set
209CONFIG_MTD_CFI_INTELEXT=y
210# CONFIG_MTD_CFI_AMDSTD is not set
211# CONFIG_MTD_CFI_STAA is not set
212CONFIG_MTD_CFI_UTIL=y
213# CONFIG_MTD_RAM is not set
214# CONFIG_MTD_ROM is not set
215# CONFIG_MTD_ABSENT is not set
216
217#
218# Mapping drivers for chip access
219#
220# CONFIG_MTD_COMPLEX_MAPPINGS is not set
221CONFIG_MTD_PHYSMAP=y
222CONFIG_MTD_PHYSMAP_START=0xfc000000
223CONFIG_MTD_PHYSMAP_LEN=0x04000000
224CONFIG_MTD_PHYSMAP_BANKWIDTH=4
225
226#
227# Self-contained MTD device drivers
228#
229# CONFIG_MTD_PMC551 is not set
230# CONFIG_MTD_SLRAM is not set
231# CONFIG_MTD_PHRAM is not set
232# CONFIG_MTD_MTDRAM is not set
233# CONFIG_MTD_BLKMTD is not set
234# CONFIG_MTD_BLOCK2MTD is not set
235
236#
237# Disk-On-Chip Device Drivers
238#
239# CONFIG_MTD_DOC2000 is not set
240# CONFIG_MTD_DOC2001 is not set
241# CONFIG_MTD_DOC2001PLUS is not set
242
243#
244# NAND Flash Device Drivers
245#
246# CONFIG_MTD_NAND is not set
247
248#
249# Parallel port support
250#
251# CONFIG_PARPORT is not set
252
253#
254# Plug and Play support
255#
256
257#
258# Block devices
259#
260# CONFIG_BLK_DEV_FD is not set
261# CONFIG_BLK_CPQ_DA is not set
262# CONFIG_BLK_CPQ_CISS_DA is not set
263# CONFIG_BLK_DEV_DAC960 is not set
264# CONFIG_BLK_DEV_UMEM is not set
265# CONFIG_BLK_DEV_COW_COMMON is not set
266CONFIG_BLK_DEV_LOOP=y
267# CONFIG_BLK_DEV_CRYPTOLOOP is not set
268# CONFIG_BLK_DEV_NBD is not set
269# CONFIG_BLK_DEV_SX8 is not set
270CONFIG_BLK_DEV_RAM=y
271CONFIG_BLK_DEV_RAM_COUNT=16
272CONFIG_BLK_DEV_RAM_SIZE=8192
273CONFIG_BLK_DEV_INITRD=y
274CONFIG_INITRAMFS_SOURCE=""
275# CONFIG_LBD is not set
276# CONFIG_CDROM_PKTCDVD is not set
277
278#
279# IO Schedulers
280#
281CONFIG_IOSCHED_NOOP=y
282CONFIG_IOSCHED_AS=y
283CONFIG_IOSCHED_DEADLINE=y
284CONFIG_IOSCHED_CFQ=y
285# CONFIG_ATA_OVER_ETH is not set
286
287#
288# ATA/ATAPI/MFM/RLL support
289#
290# CONFIG_IDE is not set
291
292#
293# SCSI device support
294#
295CONFIG_SCSI=y
296CONFIG_SCSI_PROC_FS=y
297
298#
299# SCSI support type (disk, tape, CD-ROM)
300#
301CONFIG_BLK_DEV_SD=y
302CONFIG_CHR_DEV_ST=y
303# CONFIG_CHR_DEV_OSST is not set
304CONFIG_BLK_DEV_SR=y
305# CONFIG_BLK_DEV_SR_VENDOR is not set
306CONFIG_CHR_DEV_SG=y
307
308#
309# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
310#
311# CONFIG_SCSI_MULTI_LUN is not set
312CONFIG_SCSI_CONSTANTS=y
313# CONFIG_SCSI_LOGGING is not set
314
315#
316# SCSI Transport Attributes
317#
318# CONFIG_SCSI_SPI_ATTRS is not set
319# CONFIG_SCSI_FC_ATTRS is not set
320# CONFIG_SCSI_ISCSI_ATTRS is not set
321
322#
323# SCSI low-level drivers
324#
325# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
326# CONFIG_SCSI_3W_9XXX is not set
327# CONFIG_SCSI_ACARD is not set
328# CONFIG_SCSI_AACRAID is not set
329CONFIG_SCSI_AIC7XXX=y
330CONFIG_AIC7XXX_CMDS_PER_DEVICE=32
331CONFIG_AIC7XXX_RESET_DELAY_MS=15000
332# CONFIG_AIC7XXX_DEBUG_ENABLE is not set
333CONFIG_AIC7XXX_DEBUG_MASK=0
334# CONFIG_AIC7XXX_REG_PRETTY_PRINT is not set
335# CONFIG_SCSI_AIC7XXX_OLD is not set
336# CONFIG_SCSI_AIC79XX is not set
337# CONFIG_SCSI_DPT_I2O is not set
338# CONFIG_MEGARAID_NEWGEN is not set
339# CONFIG_MEGARAID_LEGACY is not set
340# CONFIG_SCSI_SATA is not set
341# CONFIG_SCSI_BUSLOGIC is not set
342# CONFIG_SCSI_DMX3191D is not set
343# CONFIG_SCSI_EATA is not set
344# CONFIG_SCSI_EATA_PIO is not set
345# CONFIG_SCSI_FUTURE_DOMAIN is not set
346# CONFIG_SCSI_GDTH is not set
347# CONFIG_SCSI_IPS is not set
348# CONFIG_SCSI_INITIO is not set
349# CONFIG_SCSI_INIA100 is not set
350# CONFIG_SCSI_SYM53C8XX_2 is not set
351# CONFIG_SCSI_IPR is not set
352# CONFIG_SCSI_QLOGIC_ISP is not set
353# CONFIG_SCSI_QLOGIC_FC is not set
354# CONFIG_SCSI_QLOGIC_1280 is not set
355CONFIG_SCSI_QLA2XXX=y
356# CONFIG_SCSI_QLA21XX is not set
357# CONFIG_SCSI_QLA22XX is not set
358# CONFIG_SCSI_QLA2300 is not set
359# CONFIG_SCSI_QLA2322 is not set
360# CONFIG_SCSI_QLA6312 is not set
361# CONFIG_SCSI_DC395x is not set
362# CONFIG_SCSI_DC390T is not set
363# CONFIG_SCSI_NSP32 is not set
364# CONFIG_SCSI_DEBUG is not set
365
366#
367# Multi-device support (RAID and LVM)
368#
369# CONFIG_MD is not set
370
371#
372# Fusion MPT device support
373#
374# CONFIG_FUSION is not set
375
376#
377# IEEE 1394 (FireWire) support
378#
379# CONFIG_IEEE1394 is not set
380
381#
382# I2O device support
383#
384# CONFIG_I2O is not set
385
386#
387# Macintosh device drivers
388#
389
390#
391# Networking support
392#
393CONFIG_NET=y
394
395#
396# Networking options
397#
398CONFIG_PACKET=y
399CONFIG_PACKET_MMAP=y
400# CONFIG_NETLINK_DEV is not set
401CONFIG_UNIX=y
402# CONFIG_NET_KEY is not set
403CONFIG_INET=y
404CONFIG_IP_MULTICAST=y
405# CONFIG_IP_ADVANCED_ROUTER is not set
406CONFIG_IP_PNP=y
407# CONFIG_IP_PNP_DHCP is not set
408CONFIG_IP_PNP_BOOTP=y
409# CONFIG_IP_PNP_RARP is not set
410# CONFIG_NET_IPIP is not set
411# CONFIG_NET_IPGRE is not set
412# CONFIG_IP_MROUTE is not set
413# CONFIG_ARPD is not set
414# CONFIG_SYN_COOKIES is not set
415# CONFIG_INET_AH is not set
416# CONFIG_INET_ESP is not set
417# CONFIG_INET_IPCOMP is not set
418# CONFIG_INET_TUNNEL is not set
419# CONFIG_IP_TCPDIAG is not set
420# CONFIG_IP_TCPDIAG_IPV6 is not set
421# CONFIG_IPV6 is not set
422# CONFIG_NETFILTER is not set
423
424#
425# SCTP Configuration (EXPERIMENTAL)
426#
427# CONFIG_IP_SCTP is not set
428# CONFIG_ATM is not set
429# CONFIG_BRIDGE is not set
430# CONFIG_VLAN_8021Q is not set
431# CONFIG_DECNET is not set
432# CONFIG_LLC2 is not set
433# CONFIG_IPX is not set
434# CONFIG_ATALK is not set
435# CONFIG_X25 is not set
436# CONFIG_LAPB is not set
437# CONFIG_NET_DIVERT is not set
438# CONFIG_ECONET is not set
439# CONFIG_WAN_ROUTER is not set
440
441#
442# QoS and/or fair queueing
443#
444# CONFIG_NET_SCHED is not set
445# CONFIG_NET_CLS_ROUTE is not set
446
447#
448# Network testing
449#
450# CONFIG_NET_PKTGEN is not set
451# CONFIG_NETPOLL is not set
452# CONFIG_NET_POLL_CONTROLLER is not set
453# CONFIG_HAMRADIO is not set
454# CONFIG_IRDA is not set
455# CONFIG_BT is not set
456CONFIG_NETDEVICES=y
457# CONFIG_DUMMY is not set
458# CONFIG_BONDING is not set
459# CONFIG_EQUALIZER is not set
460# CONFIG_TUN is not set
461
462#
463# ARCnet devices
464#
465# CONFIG_ARCNET is not set
466
467#
468# Ethernet (10 or 100Mbit)
469#
470CONFIG_NET_ETHERNET=y
471CONFIG_MII=y
472# CONFIG_HAPPYMEAL is not set
473# CONFIG_SUNGEM is not set
474# CONFIG_NET_VENDOR_3COM is not set
475
476#
477# Tulip family network device support
478#
479# CONFIG_NET_TULIP is not set
480# CONFIG_HP100 is not set
481# CONFIG_NET_PCI is not set
482
483#
484# Ethernet (1000 Mbit)
485#
486# CONFIG_ACENIC is not set
487# CONFIG_DL2K is not set
488# CONFIG_E1000 is not set
489# CONFIG_NS83820 is not set
490# CONFIG_HAMACHI is not set
491# CONFIG_YELLOWFIN is not set
492# CONFIG_R8169 is not set
493# CONFIG_SK98LIN is not set
494# CONFIG_TIGON3 is not set
495CONFIG_MV643XX_ETH=y
496CONFIG_MV643XX_ETH_0=y
497# CONFIG_MV643XX_ETH_1 is not set
498# CONFIG_MV643XX_ETH_2 is not set
499
500#
501# Ethernet (10000 Mbit)
502#
503# CONFIG_IXGB is not set
504# CONFIG_S2IO is not set
505
506#
507# Token Ring devices
508#
509# CONFIG_TR is not set
510
511#
512# Wireless LAN (non-hamradio)
513#
514# CONFIG_NET_RADIO is not set
515
516#
517# Wan interfaces
518#
519# CONFIG_WAN is not set
520# CONFIG_FDDI is not set
521# CONFIG_HIPPI is not set
522# CONFIG_PPP is not set
523# CONFIG_SLIP is not set
524# CONFIG_NET_FC is not set
525# CONFIG_SHAPER is not set
526# CONFIG_NETCONSOLE is not set
527
528#
529# ISDN subsystem
530#
531# CONFIG_ISDN is not set
532
533#
534# Telephony Support
535#
536# CONFIG_PHONE is not set
537
538#
539# Input device support
540#
541CONFIG_INPUT=y
542
543#
544# Userland interfaces
545#
546CONFIG_INPUT_MOUSEDEV=y
547CONFIG_INPUT_MOUSEDEV_PSAUX=y
548CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
549CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
550# CONFIG_INPUT_JOYDEV is not set
551# CONFIG_INPUT_TSDEV is not set
552# CONFIG_INPUT_EVDEV is not set
553# CONFIG_INPUT_EVBUG is not set
554
555#
556# Input Device Drivers
557#
558# CONFIG_INPUT_KEYBOARD is not set
559# CONFIG_INPUT_MOUSE is not set
560# CONFIG_INPUT_JOYSTICK is not set
561# CONFIG_INPUT_TOUCHSCREEN is not set
562# CONFIG_INPUT_MISC is not set
563
564#
565# Hardware I/O ports
566#
567# CONFIG_SERIO is not set
568# CONFIG_GAMEPORT is not set
569CONFIG_SOUND_GAMEPORT=y
570
571#
572# Character devices
573#
574# CONFIG_VT is not set
575# CONFIG_SERIAL_NONSTANDARD is not set
576
577#
578# Serial drivers
579#
580# CONFIG_SERIAL_8250 is not set
581
582#
583# Non-8250 serial port support
584#
585CONFIG_SERIAL_MPSC=y
586CONFIG_SERIAL_MPSC_CONSOLE=y
587CONFIG_SERIAL_CORE=y
588CONFIG_SERIAL_CORE_CONSOLE=y
589CONFIG_UNIX98_PTYS=y
590CONFIG_LEGACY_PTYS=y
591CONFIG_LEGACY_PTY_COUNT=256
592
593#
594# IPMI
595#
596# CONFIG_IPMI_HANDLER is not set
597
598#
599# Watchdog Cards
600#
601# CONFIG_WATCHDOG is not set
602# CONFIG_NVRAM is not set
603CONFIG_GEN_RTC=y
604# CONFIG_GEN_RTC_X is not set
605# CONFIG_DTLK is not set
606# CONFIG_R3964 is not set
607# CONFIG_APPLICOM is not set
608
609#
610# Ftape, the floppy tape device driver
611#
612# CONFIG_AGP is not set
613# CONFIG_DRM is not set
614# CONFIG_RAW_DRIVER is not set
615
616#
617# TPM devices
618#
619# CONFIG_TCG_TPM is not set
620
621#
622# I2C support
623#
624# CONFIG_I2C is not set
625
626#
627# Dallas's 1-wire bus
628#
629# CONFIG_W1 is not set
630
631#
632# Misc devices
633#
634
635#
636# Multimedia devices
637#
638# CONFIG_VIDEO_DEV is not set
639
640#
641# Digital Video Broadcasting Devices
642#
643# CONFIG_DVB is not set
644
645#
646# Graphics support
647#
648# CONFIG_FB is not set
649
650#
651# Sound
652#
653# CONFIG_SOUND is not set
654
655#
656# USB support
657#
658CONFIG_USB_ARCH_HAS_HCD=y
659CONFIG_USB_ARCH_HAS_OHCI=y
660# CONFIG_USB is not set
661
662#
663# USB Gadget Support
664#
665# CONFIG_USB_GADGET is not set
666
667#
668# MMC/SD Card support
669#
670# CONFIG_MMC is not set
671
672#
673# InfiniBand support
674#
675# CONFIG_INFINIBAND is not set
676
677#
678# File systems
679#
680CONFIG_EXT2_FS=y
681# CONFIG_EXT2_FS_XATTR is not set
682CONFIG_EXT3_FS=y
683# CONFIG_EXT3_FS_XATTR is not set
684CONFIG_JBD=y
685# CONFIG_JBD_DEBUG is not set
686# CONFIG_REISERFS_FS is not set
687# CONFIG_JFS_FS is not set
688CONFIG_FS_POSIX_ACL=y
689
690#
691# XFS support
692#
693# CONFIG_XFS_FS is not set
694# CONFIG_MINIX_FS is not set
695# CONFIG_ROMFS_FS is not set
696# CONFIG_QUOTA is not set
697CONFIG_DNOTIFY=y
698# CONFIG_AUTOFS_FS is not set
699# CONFIG_AUTOFS4_FS is not set
700
701#
702# CD-ROM/DVD Filesystems
703#
704CONFIG_ISO9660_FS=y
705CONFIG_JOLIET=y
706# CONFIG_ZISOFS is not set
707CONFIG_UDF_FS=y
708CONFIG_UDF_NLS=y
709
710#
711# DOS/FAT/NT Filesystems
712#
713# CONFIG_MSDOS_FS is not set
714# CONFIG_VFAT_FS is not set
715# CONFIG_NTFS_FS is not set
716
717#
718# Pseudo filesystems
719#
720CONFIG_PROC_FS=y
721CONFIG_PROC_KCORE=y
722CONFIG_SYSFS=y
723# CONFIG_DEVFS_FS is not set
724# CONFIG_DEVPTS_FS_XATTR is not set
725CONFIG_TMPFS=y
726# CONFIG_TMPFS_XATTR is not set
727# CONFIG_HUGETLB_PAGE is not set
728CONFIG_RAMFS=y
729
730#
731# Miscellaneous filesystems
732#
733# CONFIG_ADFS_FS is not set
734# CONFIG_AFFS_FS is not set
735# CONFIG_HFS_FS is not set
736# CONFIG_HFSPLUS_FS is not set
737# CONFIG_BEFS_FS is not set
738# CONFIG_BFS_FS is not set
739# CONFIG_EFS_FS is not set
740# CONFIG_JFFS_FS is not set
741CONFIG_JFFS2_FS=y
742CONFIG_JFFS2_FS_DEBUG=0
743# CONFIG_JFFS2_FS_NAND is not set
744# CONFIG_JFFS2_FS_NOR_ECC is not set
745# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
746CONFIG_JFFS2_ZLIB=y
747CONFIG_JFFS2_RTIME=y
748# CONFIG_JFFS2_RUBIN is not set
749# CONFIG_CRAMFS is not set
750# CONFIG_VXFS_FS is not set
751# CONFIG_HPFS_FS is not set
752# CONFIG_QNX4FS_FS is not set
753# CONFIG_SYSV_FS is not set
754# CONFIG_UFS_FS is not set
755
756#
757# Network File Systems
758#
759CONFIG_NFS_FS=y
760CONFIG_NFS_V3=y
761CONFIG_NFS_V4=y
762CONFIG_NFS_DIRECTIO=y
763CONFIG_NFSD=y
764CONFIG_NFSD_V3=y
765CONFIG_NFSD_V4=y
766CONFIG_NFSD_TCP=y
767CONFIG_ROOT_NFS=y
768CONFIG_LOCKD=y
769CONFIG_LOCKD_V4=y
770CONFIG_EXPORTFS=y
771CONFIG_SUNRPC=y
772CONFIG_SUNRPC_GSS=y
773CONFIG_RPCSEC_GSS_KRB5=y
774# CONFIG_RPCSEC_GSS_SPKM3 is not set
775# CONFIG_SMB_FS is not set
776# CONFIG_CIFS is not set
777# CONFIG_NCP_FS is not set
778# CONFIG_CODA_FS is not set
779# CONFIG_AFS_FS is not set
780
781#
782# Partition Types
783#
784# CONFIG_PARTITION_ADVANCED is not set
785CONFIG_MSDOS_PARTITION=y
786
787#
788# Native Language Support
789#
790CONFIG_NLS=y
791CONFIG_NLS_DEFAULT="iso8859-1"
792# CONFIG_NLS_CODEPAGE_437 is not set
793# CONFIG_NLS_CODEPAGE_737 is not set
794# CONFIG_NLS_CODEPAGE_775 is not set
795# CONFIG_NLS_CODEPAGE_850 is not set
796# CONFIG_NLS_CODEPAGE_852 is not set
797# CONFIG_NLS_CODEPAGE_855 is not set
798# CONFIG_NLS_CODEPAGE_857 is not set
799# CONFIG_NLS_CODEPAGE_860 is not set
800# CONFIG_NLS_CODEPAGE_861 is not set
801# CONFIG_NLS_CODEPAGE_862 is not set
802# CONFIG_NLS_CODEPAGE_863 is not set
803# CONFIG_NLS_CODEPAGE_864 is not set
804# CONFIG_NLS_CODEPAGE_865 is not set
805# CONFIG_NLS_CODEPAGE_866 is not set
806# CONFIG_NLS_CODEPAGE_869 is not set
807# CONFIG_NLS_CODEPAGE_936 is not set
808# CONFIG_NLS_CODEPAGE_950 is not set
809# CONFIG_NLS_CODEPAGE_932 is not set
810# CONFIG_NLS_CODEPAGE_949 is not set
811# CONFIG_NLS_CODEPAGE_874 is not set
812# CONFIG_NLS_ISO8859_8 is not set
813# CONFIG_NLS_CODEPAGE_1250 is not set
814# CONFIG_NLS_CODEPAGE_1251 is not set
815# CONFIG_NLS_ASCII is not set
816# CONFIG_NLS_ISO8859_1 is not set
817# CONFIG_NLS_ISO8859_2 is not set
818# CONFIG_NLS_ISO8859_3 is not set
819# CONFIG_NLS_ISO8859_4 is not set
820# CONFIG_NLS_ISO8859_5 is not set
821# CONFIG_NLS_ISO8859_6 is not set
822# CONFIG_NLS_ISO8859_7 is not set
823# CONFIG_NLS_ISO8859_9 is not set
824# CONFIG_NLS_ISO8859_13 is not set
825# CONFIG_NLS_ISO8859_14 is not set
826# CONFIG_NLS_ISO8859_15 is not set
827# CONFIG_NLS_KOI8_R is not set
828# CONFIG_NLS_KOI8_U is not set
829# CONFIG_NLS_UTF8 is not set
830
831#
832# Library routines
833#
834# CONFIG_CRC_CCITT is not set
835CONFIG_CRC32=y
836# CONFIG_LIBCRC32C is not set
837CONFIG_ZLIB_INFLATE=y
838CONFIG_ZLIB_DEFLATE=y
839
840#
841# Profiling support
842#
843# CONFIG_PROFILING is not set
844
845#
846# Kernel hacking
847#
848# CONFIG_PRINTK_TIME is not set
849# CONFIG_DEBUG_KERNEL is not set
850CONFIG_LOG_BUF_SHIFT=15
851# CONFIG_SERIAL_TEXT_DEBUG is not set
852
853#
854# Security options
855#
856# CONFIG_KEYS is not set
857# CONFIG_SECURITY is not set
858
859#
860# Cryptographic options
861#
862CONFIG_CRYPTO=y
863# CONFIG_CRYPTO_HMAC is not set
864# CONFIG_CRYPTO_NULL is not set
865# CONFIG_CRYPTO_MD4 is not set
866CONFIG_CRYPTO_MD5=y
867# CONFIG_CRYPTO_SHA1 is not set
868# CONFIG_CRYPTO_SHA256 is not set
869# CONFIG_CRYPTO_SHA512 is not set
870# CONFIG_CRYPTO_WP512 is not set
871# CONFIG_CRYPTO_TGR192 is not set
872CONFIG_CRYPTO_DES=y
873# CONFIG_CRYPTO_BLOWFISH is not set
874# CONFIG_CRYPTO_TWOFISH is not set
875# CONFIG_CRYPTO_SERPENT is not set
876# CONFIG_CRYPTO_AES is not set
877# CONFIG_CRYPTO_CAST5 is not set
878# CONFIG_CRYPTO_CAST6 is not set
879# CONFIG_CRYPTO_TEA is not set
880# CONFIG_CRYPTO_ARC4 is not set
881# CONFIG_CRYPTO_KHAZAD is not set
882# CONFIG_CRYPTO_ANUBIS is not set
883# CONFIG_CRYPTO_DEFLATE is not set
884# CONFIG_CRYPTO_MICHAEL_MIC is not set
885# CONFIG_CRYPTO_CRC32C is not set
886# CONFIG_CRYPTO_TEST is not set
887
888#
889# Hardware crypto devices
890#
diff --git a/arch/ppc/configs/katana_defconfig b/arch/ppc/configs/katana_defconfig
deleted file mode 100644
index 7311fe6b42de..000000000000
--- a/arch/ppc/configs/katana_defconfig
+++ /dev/null
@@ -1,948 +0,0 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.13-mm1
4# Thu Sep 1 17:16:03 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_LOCALVERSION_AUTO=y
29CONFIG_SWAP=y
30CONFIG_SYSVIPC=y
31# CONFIG_POSIX_MQUEUE is not set
32# CONFIG_BSD_PROCESS_ACCT is not set
33CONFIG_SYSCTL=y
34# CONFIG_AUDIT is not set
35# CONFIG_HOTPLUG is not set
36CONFIG_KOBJECT_UEVENT=y
37# CONFIG_IKCONFIG is not set
38CONFIG_INITRAMFS_SOURCE=""
39# CONFIG_EMBEDDED is not set
40CONFIG_KALLSYMS=y
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
62# CONFIG_MODVERSIONS is not set
63# CONFIG_MODULE_SRCVERSION_ALL is not set
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
79# CONFIG_TAU is not set
80# CONFIG_KEXEC is not set
81# CONFIG_CPU_FREQ is not set
82# CONFIG_WANT_EARLY_SERIAL is not set
83CONFIG_PPC_STD_MMU=y
84CONFIG_NOT_COHERENT_CACHE=y
85
86#
87# Performance-monitoring counters support
88#
89# CONFIG_PERFCTR is not set
90
91#
92# Platform options
93#
94# CONFIG_PPC_MULTIPLATFORM is not set
95# CONFIG_APUS is not set
96CONFIG_KATANA=y
97# CONFIG_WILLOW is not set
98# CONFIG_CPCI690 is not set
99# CONFIG_POWERPMC250 is not set
100# CONFIG_CHESTNUT is not set
101# CONFIG_SPRUCE is not set
102# CONFIG_HDPU is not set
103# CONFIG_EV64260 is not set
104# CONFIG_LOPEC is not set
105# CONFIG_MVME5100 is not set
106# CONFIG_PPLUS is not set
107# CONFIG_PRPMC750 is not set
108# CONFIG_PRPMC800 is not set
109# CONFIG_SANDPOINT is not set
110# CONFIG_RADSTONE_PPC7D is not set
111# CONFIG_PAL4 is not set
112# CONFIG_GEMINI is not set
113# CONFIG_EST8260 is not set
114# CONFIG_SBC82xx is not set
115# CONFIG_SBS8260 is not set
116# CONFIG_RPX8260 is not set
117# CONFIG_TQM8260 is not set
118# CONFIG_ADS8272 is not set
119# CONFIG_PQ2FADS is not set
120# CONFIG_LITE5200 is not set
121# CONFIG_MPC834x_SYS is not set
122# CONFIG_EV64360 is not set
123CONFIG_MV64360=y
124CONFIG_MV64X60=y
125
126#
127# Set bridge options
128#
129CONFIG_MV64X60_BASE=0xf8100000
130CONFIG_MV64X60_NEW_BASE=0xf8100000
131# CONFIG_SMP is not set
132CONFIG_HIGHMEM=y
133# CONFIG_HZ_100 is not set
134CONFIG_HZ_250=y
135# CONFIG_HZ_1000 is not set
136CONFIG_HZ=250
137CONFIG_PREEMPT_NONE=y
138# CONFIG_PREEMPT_VOLUNTARY is not set
139# CONFIG_PREEMPT is not set
140CONFIG_SELECT_MEMORY_MODEL=y
141CONFIG_FLATMEM_MANUAL=y
142# CONFIG_DISCONTIGMEM_MANUAL is not set
143# CONFIG_SPARSEMEM_MANUAL is not set
144CONFIG_FLATMEM=y
145CONFIG_FLAT_NODE_MEM_MAP=y
146# CONFIG_SPARSEMEM_STATIC is not set
147CONFIG_BINFMT_ELF=y
148CONFIG_BINFMT_MISC=y
149CONFIG_CMDLINE_BOOL=y
150CONFIG_CMDLINE="console=ttyMM0 ip=on"
151# CONFIG_PM is not set
152CONFIG_SECCOMP=y
153CONFIG_ISA_DMA_API=y
154
155#
156# Bus options
157#
158CONFIG_GENERIC_ISA_DMA=y
159CONFIG_PCI=y
160CONFIG_PCI_DOMAINS=y
161CONFIG_PCI_LEGACY_PROC=y
162
163#
164# PCCARD (PCMCIA/CardBus) support
165#
166# CONFIG_PCCARD is not set
167
168#
169# Advanced setup
170#
171CONFIG_ADVANCED_OPTIONS=y
172# CONFIG_HIGHMEM_START_BOOL is not set
173CONFIG_HIGHMEM_START=0xfe000000
174# CONFIG_LOWMEM_SIZE_BOOL is not set
175CONFIG_LOWMEM_SIZE=0x30000000
176# CONFIG_KERNEL_START_BOOL is not set
177CONFIG_KERNEL_START=0xc0000000
178# CONFIG_TASK_SIZE_BOOL is not set
179CONFIG_TASK_SIZE=0x80000000
180CONFIG_CONSISTENT_START_BOOL=y
181CONFIG_CONSISTENT_START=0xf0000000
182CONFIG_CONSISTENT_SIZE_BOOL=y
183CONFIG_CONSISTENT_SIZE=0x00400000
184# CONFIG_BOOT_LOAD_BOOL is not set
185CONFIG_BOOT_LOAD=0x00800000
186
187#
188# Networking
189#
190CONFIG_NET=y
191
192#
193# Networking options
194#
195CONFIG_PACKET=y
196# CONFIG_PACKET_MMAP is not set
197CONFIG_UNIX=y
198# CONFIG_NET_KEY is not set
199CONFIG_INET=y
200CONFIG_IP_MULTICAST=y
201# CONFIG_IP_ADVANCED_ROUTER is not set
202CONFIG_IP_FIB_HASH=y
203CONFIG_IP_PNP=y
204CONFIG_IP_PNP_DHCP=y
205# CONFIG_IP_PNP_BOOTP is not set
206# CONFIG_IP_PNP_RARP is not set
207# CONFIG_NET_IPIP is not set
208# CONFIG_NET_IPGRE is not set
209# CONFIG_IP_MROUTE is not set
210# CONFIG_ARPD is not set
211CONFIG_SYN_COOKIES=y
212# CONFIG_INET_AH is not set
213# CONFIG_INET_ESP is not set
214# CONFIG_INET_IPCOMP is not set
215# CONFIG_INET_TUNNEL is not set
216CONFIG_INET_DIAG=y
217CONFIG_INET_TCP_DIAG=y
218# CONFIG_TCP_CONG_ADVANCED is not set
219CONFIG_TCP_CONG_BIC=y
220# CONFIG_IPV6 is not set
221# CONFIG_NETFILTER is not set
222
223#
224# DCCP Configuration (EXPERIMENTAL)
225#
226# CONFIG_IP_DCCP is not set
227
228#
229# SCTP Configuration (EXPERIMENTAL)
230#
231# CONFIG_IP_SCTP is not set
232# CONFIG_ATM is not set
233# CONFIG_BRIDGE is not set
234# CONFIG_VLAN_8021Q is not set
235# CONFIG_DECNET is not set
236# CONFIG_LLC2 is not set
237# CONFIG_IPX is not set
238# CONFIG_ATALK is not set
239# CONFIG_X25 is not set
240# CONFIG_LAPB is not set
241# CONFIG_NET_DIVERT is not set
242# CONFIG_ECONET is not set
243# CONFIG_WAN_ROUTER is not set
244# CONFIG_NET_SCHED is not set
245# CONFIG_NET_CLS_ROUTE is not set
246
247#
248# Network testing
249#
250# CONFIG_NET_PKTGEN is not set
251# CONFIG_NETFILTER_NETLINK is not set
252# CONFIG_HAMRADIO is not set
253# CONFIG_IRDA is not set
254# CONFIG_BT is not set
255# CONFIG_IEEE80211 is not set
256
257#
258# Device Drivers
259#
260
261#
262# Generic Driver Options
263#
264CONFIG_STANDALONE=y
265CONFIG_PREVENT_FIRMWARE_BUILD=y
266# CONFIG_FW_LOADER is not set
267
268#
269# Memory Technology Devices (MTD)
270#
271CONFIG_MTD=y
272# CONFIG_MTD_DEBUG is not set
273CONFIG_MTD_CONCAT=y
274CONFIG_MTD_PARTITIONS=y
275# CONFIG_MTD_REDBOOT_PARTS is not set
276# CONFIG_MTD_CMDLINE_PARTS is not set
277
278#
279# User Modules And Translation Layers
280#
281CONFIG_MTD_CHAR=y
282CONFIG_MTD_BLOCK=y
283# CONFIG_FTL is not set
284# CONFIG_NFTL is not set
285# CONFIG_INFTL is not set
286
287#
288# RAM/ROM/Flash chip drivers
289#
290CONFIG_MTD_CFI=y
291# CONFIG_MTD_JEDECPROBE is not set
292CONFIG_MTD_GEN_PROBE=y
293CONFIG_MTD_CFI_ADV_OPTIONS=y
294CONFIG_MTD_CFI_NOSWAP=y
295# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set
296# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set
297CONFIG_MTD_CFI_GEOMETRY=y
298# CONFIG_MTD_MAP_BANK_WIDTH_1 is not set
299# CONFIG_MTD_MAP_BANK_WIDTH_2 is not set
300CONFIG_MTD_MAP_BANK_WIDTH_4=y
301# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
302# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
303# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
304# CONFIG_MTD_CFI_I1 is not set
305CONFIG_MTD_CFI_I2=y
306# CONFIG_MTD_CFI_I4 is not set
307# CONFIG_MTD_CFI_I8 is not set
308# CONFIG_MTD_OTP is not set
309CONFIG_MTD_CFI_INTELEXT=y
310# CONFIG_MTD_CFI_AMDSTD is not set
311# CONFIG_MTD_CFI_STAA is not set
312CONFIG_MTD_CFI_UTIL=y
313# CONFIG_MTD_RAM is not set
314# CONFIG_MTD_ROM is not set
315# CONFIG_MTD_ABSENT is not set
316
317#
318# Mapping drivers for chip access
319#
320# CONFIG_MTD_COMPLEX_MAPPINGS is not set
321CONFIG_MTD_PHYSMAP=y
322CONFIG_MTD_PHYSMAP_START=0xe0000000
323CONFIG_MTD_PHYSMAP_LEN=0x0
324CONFIG_MTD_PHYSMAP_BANKWIDTH=4
325# CONFIG_MTD_PLATRAM is not set
326
327#
328# Self-contained MTD device drivers
329#
330# CONFIG_MTD_PMC551 is not set
331# CONFIG_MTD_SLRAM is not set
332CONFIG_MTD_PHRAM=y
333# CONFIG_MTD_MTDRAM is not set
334# CONFIG_MTD_BLKMTD is not set
335# CONFIG_MTD_BLOCK2MTD is not set
336
337#
338# Disk-On-Chip Device Drivers
339#
340# CONFIG_MTD_DOC2000 is not set
341# CONFIG_MTD_DOC2001 is not set
342# CONFIG_MTD_DOC2001PLUS is not set
343
344#
345# NAND Flash Device Drivers
346#
347# CONFIG_MTD_NAND is not set
348
349#
350# Parallel port support
351#
352# CONFIG_PARPORT is not set
353
354#
355# Plug and Play support
356#
357
358#
359# Block devices
360#
361# CONFIG_BLK_DEV_FD is not set
362# CONFIG_BLK_CPQ_DA is not set
363# CONFIG_BLK_CPQ_CISS_DA is not set
364# CONFIG_BLK_DEV_DAC960 is not set
365# CONFIG_BLK_DEV_UMEM is not set
366# CONFIG_BLK_DEV_COW_COMMON is not set
367CONFIG_BLK_DEV_LOOP=y
368# CONFIG_BLK_DEV_CRYPTOLOOP is not set
369# CONFIG_BLK_DEV_NBD is not set
370# CONFIG_BLK_DEV_SX8 is not set
371CONFIG_BLK_DEV_RAM=y
372CONFIG_BLK_DEV_RAM_COUNT=16
373CONFIG_BLK_DEV_RAM_SIZE=4096
374CONFIG_BLK_DEV_INITRD=y
375# CONFIG_LBD is not set
376# CONFIG_CDROM_PKTCDVD is not set
377
378#
379# IO Schedulers
380#
381CONFIG_IOSCHED_NOOP=y
382CONFIG_IOSCHED_AS=y
383CONFIG_IOSCHED_DEADLINE=y
384CONFIG_IOSCHED_CFQ=y
385# CONFIG_ATA_OVER_ETH is not set
386
387#
388# ATA/ATAPI/MFM/RLL support
389#
390# CONFIG_IDE is not set
391
392#
393# SCSI device support
394#
395# CONFIG_RAID_ATTRS is not set
396# CONFIG_SCSI is not set
397
398#
399# Multi-device support (RAID and LVM)
400#
401# CONFIG_MD is not set
402
403#
404# Fusion MPT device support
405#
406# CONFIG_FUSION is not set
407
408#
409# IEEE 1394 (FireWire) support
410#
411# CONFIG_IEEE1394 is not set
412
413#
414# I2O device support
415#
416# CONFIG_I2O is not set
417
418#
419# Macintosh device drivers
420#
421
422#
423# Network device support
424#
425CONFIG_NETDEVICES=y
426# CONFIG_DUMMY is not set
427# CONFIG_BONDING is not set
428# CONFIG_EQUALIZER is not set
429# CONFIG_TUN is not set
430
431#
432# ARCnet devices
433#
434# CONFIG_ARCNET is not set
435
436#
437# PHY device support
438#
439# CONFIG_PHYLIB is not set
440
441#
442# Ethernet (10 or 100Mbit)
443#
444CONFIG_NET_ETHERNET=y
445CONFIG_MII=y
446# CONFIG_HAPPYMEAL is not set
447# CONFIG_SUNGEM is not set
448# CONFIG_NET_VENDOR_3COM is not set
449
450#
451# Tulip family network device support
452#
453CONFIG_NET_TULIP=y
454# CONFIG_DE2104X is not set
455CONFIG_TULIP=y
456# CONFIG_TULIP_MWI is not set
457# CONFIG_TULIP_MMIO is not set
458# CONFIG_TULIP_NAPI is not set
459# CONFIG_DE4X5 is not set
460# CONFIG_WINBOND_840 is not set
461# CONFIG_DM9102 is not set
462# CONFIG_ULI526X is not set
463# CONFIG_HP100 is not set
464CONFIG_NET_PCI=y
465# CONFIG_PCNET32 is not set
466# CONFIG_AMD8111_ETH is not set
467# CONFIG_ADAPTEC_STARFIRE is not set
468# CONFIG_B44 is not set
469# CONFIG_FORCEDETH is not set
470# CONFIG_DGRS is not set
471# CONFIG_EEPRO100 is not set
472CONFIG_E100=y
473# CONFIG_FEALNX is not set
474# CONFIG_NATSEMI is not set
475# CONFIG_NE2K_PCI is not set
476# CONFIG_8139CP is not set
477# CONFIG_8139TOO is not set
478# CONFIG_SIS900 is not set
479# CONFIG_EPIC100 is not set
480# CONFIG_SUNDANCE is not set
481# CONFIG_TLAN is not set
482# CONFIG_VIA_RHINE is not set
483
484#
485# Ethernet (1000 Mbit)
486#
487# CONFIG_ACENIC is not set
488# CONFIG_DL2K is not set
489CONFIG_E1000=y
490# CONFIG_E1000_NAPI is not set
491# CONFIG_E1000_DISABLE_PACKET_SPLIT is not set
492# CONFIG_NS83820 is not set
493# CONFIG_HAMACHI is not set
494# CONFIG_YELLOWFIN is not set
495# CONFIG_R8169 is not set
496# CONFIG_SIS190 is not set
497# CONFIG_SKGE is not set
498# CONFIG_SKY2 is not set
499# CONFIG_SK98LIN is not set
500# CONFIG_VIA_VELOCITY is not set
501# CONFIG_TIGON3 is not set
502# CONFIG_BNX2 is not set
503CONFIG_MV643XX_ETH=y
504CONFIG_MV643XX_ETH_0=y
505CONFIG_MV643XX_ETH_1=y
506CONFIG_MV643XX_ETH_2=y
507
508#
509# Ethernet (10000 Mbit)
510#
511# CONFIG_CHELSIO_T1 is not set
512# CONFIG_IXGB is not set
513# CONFIG_S2IO is not set
514
515#
516# Token Ring devices
517#
518# CONFIG_TR is not set
519
520#
521# Wireless LAN (non-hamradio)
522#
523# CONFIG_NET_RADIO is not set
524
525#
526# Wan interfaces
527#
528# CONFIG_WAN is not set
529# CONFIG_FDDI is not set
530# CONFIG_HIPPI is not set
531# CONFIG_PPP is not set
532# CONFIG_SLIP is not set
533# CONFIG_SHAPER is not set
534# CONFIG_NETCONSOLE is not set
535# CONFIG_KGDBOE is not set
536# CONFIG_NETPOLL is not set
537# CONFIG_NETPOLL_RX is not set
538# CONFIG_NETPOLL_TRAP is not set
539# CONFIG_NET_POLL_CONTROLLER is not set
540
541#
542# ISDN subsystem
543#
544# CONFIG_ISDN is not set
545
546#
547# Telephony Support
548#
549# CONFIG_PHONE is not set
550
551#
552# Input device support
553#
554CONFIG_INPUT=y
555
556#
557# Userland interfaces
558#
559CONFIG_INPUT_MOUSEDEV=y
560CONFIG_INPUT_MOUSEDEV_PSAUX=y
561CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
562CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
563# CONFIG_INPUT_JOYDEV is not set
564# CONFIG_INPUT_TSDEV is not set
565# CONFIG_INPUT_EVDEV is not set
566# CONFIG_INPUT_EVBUG is not set
567
568#
569# Input Device Drivers
570#
571# CONFIG_INPUT_KEYBOARD is not set
572# CONFIG_INPUT_MOUSE is not set
573# CONFIG_INPUT_JOYSTICK is not set
574# CONFIG_INPUT_TOUCHSCREEN is not set
575# CONFIG_INPUT_MISC is not set
576
577#
578# Hardware I/O ports
579#
580# CONFIG_SERIO is not set
581# CONFIG_GAMEPORT is not set
582
583#
584# Character devices
585#
586CONFIG_VT=y
587CONFIG_VT_CONSOLE=y
588CONFIG_HW_CONSOLE=y
589# CONFIG_SERIAL_NONSTANDARD is not set
590
591#
592# Serial drivers
593#
594# CONFIG_SERIAL_8250 is not set
595
596#
597# Non-8250 serial port support
598#
599CONFIG_SERIAL_MPSC=y
600CONFIG_SERIAL_MPSC_CONSOLE=y
601CONFIG_SERIAL_CORE=y
602CONFIG_SERIAL_CORE_CONSOLE=y
603# CONFIG_SERIAL_JSM is not set
604CONFIG_UNIX98_PTYS=y
605CONFIG_LEGACY_PTYS=y
606CONFIG_LEGACY_PTY_COUNT=256
607
608#
609# IPMI
610#
611# CONFIG_IPMI_HANDLER is not set
612
613#
614# Watchdog Cards
615#
616# CONFIG_WATCHDOG is not set
617# CONFIG_NVRAM is not set
618CONFIG_GEN_RTC=y
619# CONFIG_GEN_RTC_X is not set
620# CONFIG_DTLK is not set
621# CONFIG_R3964 is not set
622# CONFIG_APPLICOM is not set
623
624#
625# Ftape, the floppy tape device driver
626#
627# CONFIG_AGP is not set
628# CONFIG_DRM is not set
629# CONFIG_RAW_DRIVER is not set
630
631#
632# TPM devices
633#
634# CONFIG_TCG_TPM is not set
635
636#
637# I2C support
638#
639CONFIG_I2C=y
640CONFIG_I2C_CHARDEV=y
641
642#
643# I2C Algorithms
644#
645# CONFIG_I2C_ALGOBIT is not set
646# CONFIG_I2C_ALGOPCF is not set
647# CONFIG_I2C_ALGOPCA is not set
648
649#
650# I2C Hardware Bus support
651#
652# CONFIG_I2C_ALI1535 is not set
653# CONFIG_I2C_ALI1563 is not set
654# CONFIG_I2C_ALI15X3 is not set
655# CONFIG_I2C_AMD756 is not set
656# CONFIG_I2C_AMD8111 is not set
657# CONFIG_I2C_I801 is not set
658# CONFIG_I2C_I810 is not set
659# CONFIG_I2C_PIIX4 is not set
660# CONFIG_I2C_MPC is not set
661# CONFIG_I2C_NFORCE2 is not set
662# CONFIG_I2C_PARPORT_LIGHT is not set
663# CONFIG_I2C_PROSAVAGE is not set
664# CONFIG_I2C_SAVAGE4 is not set
665# CONFIG_SCx200_ACB is not set
666# CONFIG_I2C_SIS5595 is not set
667# CONFIG_I2C_SIS630 is not set
668# CONFIG_I2C_SIS96X is not set
669# CONFIG_I2C_STUB is not set
670# CONFIG_I2C_VIA is not set
671# CONFIG_I2C_VIAPRO is not set
672# CONFIG_I2C_VOODOO3 is not set
673# CONFIG_I2C_PCA_ISA is not set
674CONFIG_I2C_MV64XXX=y
675
676#
677# Miscellaneous I2C Chip support
678#
679# CONFIG_SENSORS_DS1337 is not set
680# CONFIG_SENSORS_DS1374 is not set
681# CONFIG_SENSORS_EEPROM is not set
682# CONFIG_SENSORS_PCF8574 is not set
683# CONFIG_SENSORS_PCA9539 is not set
684# CONFIG_SENSORS_PCF8591 is not set
685# CONFIG_SENSORS_RTC8564 is not set
686CONFIG_SENSORS_M41T00=y
687# CONFIG_SENSORS_MAX6875 is not set
688# CONFIG_I2C_DEBUG_CORE is not set
689# CONFIG_I2C_DEBUG_ALGO is not set
690# CONFIG_I2C_DEBUG_BUS is not set
691# CONFIG_I2C_DEBUG_CHIP is not set
692
693#
694# Dallas's 1-wire bus
695#
696# CONFIG_W1 is not set
697
698#
699# Hardware Monitoring support
700#
701CONFIG_HWMON=y
702# CONFIG_HWMON_VID is not set
703# CONFIG_SENSORS_ADM1021 is not set
704# CONFIG_SENSORS_ADM1025 is not set
705# CONFIG_SENSORS_ADM1026 is not set
706# CONFIG_SENSORS_ADM1031 is not set
707# CONFIG_SENSORS_ADM9240 is not set
708# CONFIG_SENSORS_ASB100 is not set
709# CONFIG_SENSORS_ATXP1 is not set
710# CONFIG_SENSORS_DS1621 is not set
711# CONFIG_SENSORS_FSCHER is not set
712# CONFIG_SENSORS_FSCPOS is not set
713# CONFIG_SENSORS_GL518SM is not set
714# CONFIG_SENSORS_GL520SM is not set
715# CONFIG_SENSORS_IT87 is not set
716# CONFIG_SENSORS_LM63 is not set
717# CONFIG_SENSORS_LM75 is not set
718# CONFIG_SENSORS_LM77 is not set
719# CONFIG_SENSORS_LM78 is not set
720# CONFIG_SENSORS_LM80 is not set
721# CONFIG_SENSORS_LM83 is not set
722# CONFIG_SENSORS_LM85 is not set
723# CONFIG_SENSORS_LM87 is not set
724# CONFIG_SENSORS_LM90 is not set
725# CONFIG_SENSORS_LM92 is not set
726# CONFIG_SENSORS_MAX1619 is not set
727# CONFIG_SENSORS_PC87360 is not set
728# CONFIG_SENSORS_SIS5595 is not set
729# CONFIG_SENSORS_SMSC47M1 is not set
730# CONFIG_SENSORS_SMSC47B397 is not set
731# CONFIG_SENSORS_VIA686A is not set
732# CONFIG_SENSORS_W83781D is not set
733# CONFIG_SENSORS_W83792D is not set
734# CONFIG_SENSORS_W83L785TS is not set
735# CONFIG_SENSORS_W83627HF is not set
736# CONFIG_SENSORS_W83627EHF is not set
737# CONFIG_HWMON_DEBUG_CHIP is not set
738
739#
740# Misc devices
741#
742
743#
744# Multimedia Capabilities Port drivers
745#
746
747#
748# Multimedia devices
749#
750# CONFIG_VIDEO_DEV is not set
751
752#
753# Digital Video Broadcasting Devices
754#
755# CONFIG_DVB is not set
756
757#
758# Graphics support
759#
760# CONFIG_FB is not set
761
762#
763# Console display driver support
764#
765# CONFIG_VGA_CONSOLE is not set
766CONFIG_DUMMY_CONSOLE=y
767
768#
769# Speakup console speech
770#
771# CONFIG_SPEAKUP is not set
772
773#
774# Sound
775#
776# CONFIG_SOUND is not set
777
778#
779# USB support
780#
781CONFIG_USB_ARCH_HAS_HCD=y
782CONFIG_USB_ARCH_HAS_OHCI=y
783# CONFIG_USB is not set
784
785#
786# USB Gadget Support
787#
788# CONFIG_USB_GADGET is not set
789
790#
791# MMC/SD Card support
792#
793# CONFIG_MMC is not set
794
795#
796# InfiniBand support
797#
798# CONFIG_INFINIBAND is not set
799
800#
801# SN Devices
802#
803
804#
805# Distributed Lock Manager
806#
807# CONFIG_DLM is not set
808
809#
810# File systems
811#
812CONFIG_EXT2_FS=y
813# CONFIG_EXT2_FS_XATTR is not set
814# CONFIG_EXT2_FS_XIP is not set
815# CONFIG_EXT3_FS is not set
816# CONFIG_REISER4_FS is not set
817# CONFIG_REISERFS_FS is not set
818# CONFIG_JFS_FS is not set
819# CONFIG_FS_POSIX_ACL is not set
820
821#
822# XFS support
823#
824# CONFIG_XFS_FS is not set
825# CONFIG_OCFS2_FS is not set
826# CONFIG_MINIX_FS is not set
827# CONFIG_ROMFS_FS is not set
828CONFIG_INOTIFY=y
829# CONFIG_QUOTA is not set
830CONFIG_DNOTIFY=y
831# CONFIG_AUTOFS_FS is not set
832# CONFIG_AUTOFS4_FS is not set
833# CONFIG_FUSE_FS is not set
834
835#
836# CD-ROM/DVD Filesystems
837#
838# CONFIG_ISO9660_FS is not set
839# CONFIG_UDF_FS is not set
840
841#
842# DOS/FAT/NT Filesystems
843#
844# CONFIG_MSDOS_FS is not set
845# CONFIG_VFAT_FS is not set
846# CONFIG_NTFS_FS is not set
847
848#
849# Pseudo filesystems
850#
851CONFIG_PROC_FS=y
852CONFIG_PROC_KCORE=y
853CONFIG_SYSFS=y
854CONFIG_TMPFS=y
855# CONFIG_HUGETLB_PAGE is not set
856CONFIG_RAMFS=y
857# CONFIG_CONFIGFS_FS is not set
858# CONFIG_RELAYFS_FS is not set
859
860#
861# Miscellaneous filesystems
862#
863# CONFIG_ADFS_FS is not set
864# CONFIG_AFFS_FS is not set
865# CONFIG_ASFS_FS is not set
866# CONFIG_HFS_FS is not set
867# CONFIG_HFSPLUS_FS is not set
868# CONFIG_BEFS_FS is not set
869# CONFIG_BFS_FS is not set
870# CONFIG_EFS_FS is not set
871# CONFIG_JFFS_FS is not set
872# CONFIG_JFFS2_FS is not set
873# CONFIG_CRAMFS is not set
874# CONFIG_VXFS_FS is not set
875# CONFIG_HPFS_FS is not set
876# CONFIG_QNX4FS_FS is not set
877# CONFIG_SYSV_FS is not set
878# CONFIG_UFS_FS is not set
879
880#
881# Network File Systems
882#
883CONFIG_NFS_FS=y
884CONFIG_NFS_V3=y
885# CONFIG_NFS_V3_ACL is not set
886# CONFIG_NFS_V4 is not set
887# CONFIG_NFS_DIRECTIO is not set
888# CONFIG_NFSD is not set
889CONFIG_ROOT_NFS=y
890CONFIG_LOCKD=y
891CONFIG_LOCKD_V4=y
892CONFIG_NFS_COMMON=y
893CONFIG_SUNRPC=y
894# CONFIG_RPCSEC_GSS_KRB5 is not set
895# CONFIG_RPCSEC_GSS_SPKM3 is not set
896# CONFIG_SMB_FS is not set
897# CONFIG_CIFS is not set
898# CONFIG_NCP_FS is not set
899# CONFIG_CODA_FS is not set
900# CONFIG_AFS_FS is not set
901# CONFIG_9P_FS is not set
902
903#
904# Partition Types
905#
906# CONFIG_PARTITION_ADVANCED is not set
907CONFIG_MSDOS_PARTITION=y
908
909#
910# Native Language Support
911#
912# CONFIG_NLS is not set
913
914#
915# Library routines
916#
917# CONFIG_CRC_CCITT is not set
918# CONFIG_CRC16 is not set
919CONFIG_CRC32=y
920# CONFIG_LIBCRC32C is not set
921
922#
923# Profiling support
924#
925# CONFIG_PROFILING is not set
926
927#
928# Kernel hacking
929#
930# CONFIG_PRINTK_TIME is not set
931# CONFIG_DEBUG_KERNEL is not set
932CONFIG_LOG_BUF_SHIFT=14
933# CONFIG_SERIAL_TEXT_DEBUG is not set
934
935#
936# Security options
937#
938# CONFIG_KEYS is not set
939# CONFIG_SECURITY is not set
940
941#
942# Cryptographic options
943#
944# CONFIG_CRYPTO is not set
945
946#
947# Hardware crypto devices
948#
diff --git a/arch/ppc/configs/lite5200_defconfig b/arch/ppc/configs/lite5200_defconfig
deleted file mode 100644
index 7e7a943d8cfe..000000000000
--- a/arch/ppc/configs/lite5200_defconfig
+++ /dev/null
@@ -1,436 +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# Code maturity level options
12#
13CONFIG_EXPERIMENTAL=y
14CONFIG_CLEAN_COMPILE=y
15CONFIG_STANDALONE=y
16CONFIG_BROKEN_ON_SMP=y
17#
18# General setup
19#
20CONFIG_SWAP=y
21CONFIG_SYSVIPC=y
22# CONFIG_BSD_PROCESS_ACCT is not set
23CONFIG_SYSCTL=y
24# CONFIG_AUDIT is not set
25CONFIG_LOG_BUF_SHIFT=14
26# CONFIG_HOTPLUG is not set
27# CONFIG_IKCONFIG is not set
28# CONFIG_EMBEDDED is not set
29CONFIG_KALLSYMS=y
30# CONFIG_KALLSYMS_ALL is not set
31# CONFIG_KALLSYMS_EXTRA_PASS is not set
32CONFIG_FUTEX=y
33CONFIG_EPOLL=y
34CONFIG_IOSCHED_NOOP=y
35CONFIG_IOSCHED_AS=y
36CONFIG_IOSCHED_DEADLINE=y
37CONFIG_IOSCHED_CFQ=y
38# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
39#
40# Loadable module support
41#
42CONFIG_MODULES=y
43CONFIG_MODULE_UNLOAD=y
44# CONFIG_MODULE_FORCE_UNLOAD is not set
45CONFIG_OBSOLETE_MODPARM=y
46CONFIG_MODVERSIONS=y
47CONFIG_KMOD=y
48#
49# Processor
50#
51CONFIG_6xx=y
52# CONFIG_40x is not set
53# CONFIG_44x is not set
54# CONFIG_POWER3 is not set
55# CONFIG_POWER4 is not set
56# CONFIG_8xx is not set
57# CONFIG_E500 is not set
58# CONFIG_ALTIVEC is not set
59# CONFIG_TAU is not set
60# CONFIG_CPU_FREQ is not set
61CONFIG_FSL_OCP=y
62CONFIG_PPC_STD_MMU=y
63#
64# Platform options
65#
66# CONFIG_PPC_MULTIPLATFORM is not set
67# CONFIG_APUS is not set
68# CONFIG_WILLOW is not set
69# CONFIG_PCORE is not set
70# CONFIG_POWERPMC250 is not set
71# CONFIG_EV64260 is not set
72# CONFIG_SPRUCE is not set
73# CONFIG_LOPEC is not set
74# CONFIG_MCPN765 is not set
75# CONFIG_MVME5100 is not set
76# CONFIG_PPLUS is not set
77# CONFIG_PRPMC750 is not set
78# CONFIG_PRPMC800 is not set
79# CONFIG_SANDPOINT is not set
80# CONFIG_ADIR is not set
81# CONFIG_K2 is not set
82# CONFIG_PAL4 is not set
83# CONFIG_GEMINI is not set
84# CONFIG_EST8260 is not set
85# CONFIG_SBC82xx is not set
86# CONFIG_SBS8260 is not set
87# CONFIG_RPX6 is not set
88# CONFIG_TQM8260 is not set
89# CONFIG_ADS8272 is not set
90CONFIG_LITE5200=y
91CONFIG_PPC_MPC52xx=y
92# CONFIG_SMP is not set
93# CONFIG_PREEMPT is not set
94# CONFIG_HIGHMEM is not set
95CONFIG_KERNEL_ELF=y
96CONFIG_BINFMT_ELF=y
97# CONFIG_BINFMT_MISC is not set
98CONFIG_CMDLINE_BOOL=y
99CONFIG_CMDLINE="console=ttyS0 root=/dev/ram0 rw"
100#
101# Bus options
102#
103CONFIG_GENERIC_ISA_DMA=y
104CONFIG_PCI=y
105CONFIG_PCI_DOMAINS=y
106# CONFIG_PCI_LEGACY_PROC is not set
107# CONFIG_PCI_NAMES is not set
108#
109# Advanced setup
110#
111CONFIG_ADVANCED_OPTIONS=y
112CONFIG_HIGHMEM_START=0xfe000000
113# CONFIG_LOWMEM_SIZE_BOOL is not set
114CONFIG_LOWMEM_SIZE=0x30000000
115# CONFIG_KERNEL_START_BOOL is not set
116CONFIG_KERNEL_START=0xc0000000
117# CONFIG_TASK_SIZE_BOOL is not set
118CONFIG_TASK_SIZE=0x80000000
119# CONFIG_BOOT_LOAD_BOOL is not set
120CONFIG_BOOT_LOAD=0x00800000
121#
122# Device Drivers
123#
124#
125# Generic Driver Options
126#
127CONFIG_PREVENT_FIRMWARE_BUILD=y
128# CONFIG_DEBUG_DRIVER is not set
129#
130# Memory Technology Devices (MTD)
131#
132# CONFIG_MTD is not set
133#
134# Parallel port support
135#
136# CONFIG_PARPORT is not set
137#
138# Plug and Play support
139#
140#
141# Block devices
142#
143# CONFIG_BLK_DEV_FD is not set
144# CONFIG_BLK_CPQ_DA is not set
145# CONFIG_BLK_CPQ_CISS_DA is not set
146# CONFIG_BLK_DEV_DAC960 is not set
147# CONFIG_BLK_DEV_UMEM is not set
148# CONFIG_BLK_DEV_LOOP is not set
149# CONFIG_BLK_DEV_SX8 is not set
150CONFIG_BLK_DEV_RAM=y
151CONFIG_BLK_DEV_RAM_SIZE=4096
152CONFIG_BLK_DEV_INITRD=y
153# CONFIG_LBD is not set
154#
155# ATA/ATAPI/MFM/RLL support
156#
157# CONFIG_IDE is not set
158#
159# SCSI device support
160#
161# CONFIG_SCSI is not set
162#
163# Multi-device support (RAID and LVM)
164#
165# CONFIG_MD is not set
166#
167# Fusion MPT device support
168#
169#
170# IEEE 1394 (FireWire) support
171#
172# CONFIG_IEEE1394 is not set
173#
174# I2O device support
175#
176# CONFIG_I2O is not set
177#
178# Macintosh device drivers
179#
180#
181# Networking support
182#
183# CONFIG_NET is not set
184# CONFIG_NETPOLL is not set
185# CONFIG_NET_POLL_CONTROLLER is not set
186#
187# ISDN subsystem
188#
189#
190# Telephony Support
191#
192# CONFIG_PHONE is not set
193#
194# Input device support
195#
196CONFIG_INPUT=y
197#
198# Userland interfaces
199#
200CONFIG_INPUT_MOUSEDEV=y
201CONFIG_INPUT_MOUSEDEV_PSAUX=y
202CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
203CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
204# CONFIG_INPUT_JOYDEV is not set
205# CONFIG_INPUT_TSDEV is not set
206CONFIG_INPUT_EVDEV=y
207CONFIG_INPUT_EVBUG=y
208#
209# Input I/O drivers
210#
211# CONFIG_GAMEPORT is not set
212CONFIG_SOUND_GAMEPORT=y
213CONFIG_SERIO=y
214# CONFIG_SERIO_I8042 is not set
215CONFIG_SERIO_SERPORT=y
216# CONFIG_SERIO_CT82C710 is not set
217# CONFIG_SERIO_PCIPS2 is not set
218#
219# Input Device Drivers
220#
221# CONFIG_INPUT_KEYBOARD is not set
222# CONFIG_INPUT_MOUSE is not set
223# CONFIG_INPUT_JOYSTICK is not set
224# CONFIG_INPUT_TOUCHSCREEN is not set
225# CONFIG_INPUT_MISC is not set
226#
227# Character devices
228#
229CONFIG_VT=y
230CONFIG_VT_CONSOLE=y
231CONFIG_HW_CONSOLE=y
232# CONFIG_SERIAL_NONSTANDARD is not set
233#
234# Serial drivers
235#
236# CONFIG_SERIAL_8250 is not set
237#
238# Non-8250 serial port support
239#
240CONFIG_SERIAL_CORE=y
241CONFIG_SERIAL_CORE_CONSOLE=y
242CONFIG_SERIAL_MPC52xx=y
243CONFIG_SERIAL_MPC52xx_CONSOLE=y
244CONFIG_SERIAL_MPC52xx_CONSOLE_BAUD=9600
245CONFIG_UNIX98_PTYS=y
246CONFIG_LEGACY_PTYS=y
247CONFIG_LEGACY_PTY_COUNT=256
248# CONFIG_QIC02_TAPE is not set
249#
250# IPMI
251#
252# CONFIG_IPMI_HANDLER is not set
253#
254# Watchdog Cards
255#
256# CONFIG_WATCHDOG is not set
257# CONFIG_NVRAM is not set
258# CONFIG_GEN_RTC is not set
259# CONFIG_DTLK is not set
260# CONFIG_R3964 is not set
261# CONFIG_APPLICOM is not set
262#
263# Ftape, the floppy tape device driver
264#
265# CONFIG_FTAPE is not set
266# CONFIG_AGP is not set
267# CONFIG_DRM is not set
268# CONFIG_RAW_DRIVER is not set
269#
270# I2C support
271#
272# CONFIG_I2C is not set
273#
274# Misc devices
275#
276#
277# Multimedia devices
278#
279# CONFIG_VIDEO_DEV is not set
280#
281# Digital Video Broadcasting Devices
282#
283#
284# Graphics support
285#
286# CONFIG_FB is not set
287#
288# Console display driver support
289#
290CONFIG_VGA_CONSOLE=y
291# CONFIG_MDA_CONSOLE is not set
292CONFIG_DUMMY_CONSOLE=y
293#
294# Sound
295#
296# CONFIG_SOUND is not set
297#
298# USB support
299#
300# CONFIG_USB is not set
301#
302# USB Gadget Support
303#
304# CONFIG_USB_GADGET is not set
305#
306# File systems
307#
308CONFIG_EXT2_FS=y
309# CONFIG_EXT2_FS_XATTR is not set
310# CONFIG_EXT3_FS is not set
311# CONFIG_JBD is not set
312# CONFIG_REISERFS_FS is not set
313# CONFIG_JFS_FS is not set
314# CONFIG_XFS_FS is not set
315# CONFIG_MINIX_FS is not set
316# CONFIG_ROMFS_FS is not set
317# CONFIG_QUOTA is not set
318# CONFIG_AUTOFS_FS is not set
319# CONFIG_AUTOFS4_FS is not set
320#
321# CD-ROM/DVD Filesystems
322#
323# CONFIG_ISO9660_FS is not set
324# CONFIG_UDF_FS is not set
325#
326# DOS/FAT/NT Filesystems
327#
328# CONFIG_FAT_FS is not set
329# CONFIG_NTFS_FS is not set
330#
331# Pseudo filesystems
332#
333CONFIG_PROC_FS=y
334CONFIG_PROC_KCORE=y
335CONFIG_SYSFS=y
336# CONFIG_DEVFS_FS is not set
337# CONFIG_DEVPTS_FS_XATTR is not set
338CONFIG_TMPFS=y
339# CONFIG_HUGETLB_PAGE is not set
340CONFIG_RAMFS=y
341#
342# Miscellaneous filesystems
343#
344# CONFIG_ADFS_FS is not set
345# CONFIG_AFFS_FS is not set
346# CONFIG_HFS_FS is not set
347# CONFIG_HFSPLUS_FS is not set
348# CONFIG_BEFS_FS is not set
349# CONFIG_BFS_FS is not set
350# CONFIG_EFS_FS is not set
351# CONFIG_CRAMFS is not set
352# CONFIG_VXFS_FS is not set
353# CONFIG_HPFS_FS is not set
354# CONFIG_QNX4FS_FS is not set
355# CONFIG_SYSV_FS is not set
356# CONFIG_UFS_FS is not set
357#
358# Partition Types
359#
360# CONFIG_PARTITION_ADVANCED is not set
361CONFIG_MSDOS_PARTITION=y
362#
363# Native Language Support
364#
365CONFIG_NLS=y
366CONFIG_NLS_DEFAULT="iso8859-1"
367# CONFIG_NLS_CODEPAGE_437 is not set
368# CONFIG_NLS_CODEPAGE_737 is not set
369# CONFIG_NLS_CODEPAGE_775 is not set
370# CONFIG_NLS_CODEPAGE_850 is not set
371# CONFIG_NLS_CODEPAGE_852 is not set
372# CONFIG_NLS_CODEPAGE_855 is not set
373# CONFIG_NLS_CODEPAGE_857 is not set
374# CONFIG_NLS_CODEPAGE_860 is not set
375# CONFIG_NLS_CODEPAGE_861 is not set
376# CONFIG_NLS_CODEPAGE_862 is not set
377# CONFIG_NLS_CODEPAGE_863 is not set
378# CONFIG_NLS_CODEPAGE_864 is not set
379# CONFIG_NLS_CODEPAGE_865 is not set
380# CONFIG_NLS_CODEPAGE_866 is not set
381# CONFIG_NLS_CODEPAGE_869 is not set
382# CONFIG_NLS_CODEPAGE_936 is not set
383# CONFIG_NLS_CODEPAGE_950 is not set
384# CONFIG_NLS_CODEPAGE_932 is not set
385# CONFIG_NLS_CODEPAGE_949 is not set
386# CONFIG_NLS_CODEPAGE_874 is not set
387# CONFIG_NLS_ISO8859_8 is not set
388# CONFIG_NLS_CODEPAGE_1250 is not set
389# CONFIG_NLS_CODEPAGE_1251 is not set
390# CONFIG_NLS_ASCII is not set
391CONFIG_NLS_ISO8859_1=m
392# CONFIG_NLS_ISO8859_2 is not set
393# CONFIG_NLS_ISO8859_3 is not set
394# CONFIG_NLS_ISO8859_4 is not set
395# CONFIG_NLS_ISO8859_5 is not set
396# CONFIG_NLS_ISO8859_6 is not set
397# CONFIG_NLS_ISO8859_7 is not set
398# CONFIG_NLS_ISO8859_9 is not set
399# CONFIG_NLS_ISO8859_13 is not set
400# CONFIG_NLS_ISO8859_14 is not set
401# CONFIG_NLS_ISO8859_15 is not set
402# CONFIG_NLS_KOI8_R is not set
403# CONFIG_NLS_KOI8_U is not set
404# CONFIG_NLS_UTF8 is not set
405#
406# Library routines
407#
408# CONFIG_CRC16 is not set
409# CONFIG_CRC32 is not set
410# CONFIG_LIBCRC32C is not set
411#
412# Profiling support
413#
414# CONFIG_PROFILING is not set
415#
416# Kernel hacking
417#
418CONFIG_DEBUG_KERNEL=y
419# CONFIG_DEBUG_SLAB is not set
420CONFIG_MAGIC_SYSRQ=y
421# CONFIG_DEBUG_SPINLOCK is not set
422CONFIG_DEBUG_SPINLOCK_SLEEP=y
423# CONFIG_KGDB is not set
424# CONFIG_XMON is not set
425# CONFIG_BDI_SWITCH is not set
426CONFIG_DEBUG_INFO=y
427CONFIG_SERIAL_TEXT_DEBUG=y
428CONFIG_PPC_OCP=y
429#
430# Security options
431#
432# CONFIG_SECURITY is not set
433#
434# Cryptographic options
435#
436# CONFIG_CRYPTO is not set
diff --git a/arch/ppc/configs/lopec_defconfig b/arch/ppc/configs/lopec_defconfig
deleted file mode 100644
index 85ea06b3b5c6..000000000000
--- a/arch/ppc/configs/lopec_defconfig
+++ /dev/null
@@ -1,814 +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
16CONFIG_STANDALONE=y
17CONFIG_BROKEN_ON_SMP=y
18
19#
20# General setup
21#
22CONFIG_SWAP=y
23CONFIG_SYSVIPC=y
24# CONFIG_POSIX_MQUEUE is not set
25# CONFIG_BSD_PROCESS_ACCT is not set
26CONFIG_SYSCTL=y
27# CONFIG_AUDIT is not set
28CONFIG_LOG_BUF_SHIFT=14
29CONFIG_HOTPLUG=y
30# CONFIG_IKCONFIG is not set
31CONFIG_EMBEDDED=y
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
46# CONFIG_MODULE_FORCE_UNLOAD is not set
47CONFIG_OBSOLETE_MODPARM=y
48# CONFIG_MODVERSIONS is not set
49CONFIG_KMOD=y
50
51#
52# Processor
53#
54CONFIG_6xx=y
55# CONFIG_40x is not set
56# CONFIG_44x is not set
57# CONFIG_POWER3 is not set
58# CONFIG_POWER4 is not set
59# CONFIG_8xx is not set
60CONFIG_ALTIVEC=y
61# CONFIG_TAU is not set
62# CONFIG_CPU_FREQ is not set
63CONFIG_PPC_STD_MMU=y
64
65#
66# Platform options
67#
68# CONFIG_PPC_MULTIPLATFORM is not set
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
75CONFIG_LOPEC=y
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_EPIC_SERIAL_MODE=y
91CONFIG_MPC10X_BRIDGE=y
92# CONFIG_MPC10X_STORE_GATHERING is not set
93CONFIG_PPCBUG_NVRAM=y
94# CONFIG_SMP is not set
95# CONFIG_PREEMPT is not set
96# CONFIG_HIGHMEM is not set
97CONFIG_KERNEL_ELF=y
98CONFIG_BINFMT_ELF=y
99CONFIG_BINFMT_MISC=m
100CONFIG_CMDLINE_BOOL=y
101CONFIG_CMDLINE="ip=on"
102
103#
104# Bus options
105#
106CONFIG_GENERIC_ISA_DMA=y
107CONFIG_PCI=y
108CONFIG_PCI_DOMAINS=y
109# CONFIG_PCI_LEGACY_PROC is not set
110CONFIG_PCI_NAMES=y
111
112#
113# PCMCIA/CardBus support
114#
115# CONFIG_PCMCIA is not set
116
117#
118# Advanced setup
119#
120# CONFIG_ADVANCED_OPTIONS is not set
121
122#
123# Default settings for advanced configuration options are used
124#
125CONFIG_HIGHMEM_START=0xfe000000
126CONFIG_LOWMEM_SIZE=0x30000000
127CONFIG_KERNEL_START=0xc0000000
128CONFIG_TASK_SIZE=0x80000000
129CONFIG_BOOT_LOAD=0x00800000
130
131#
132# Device Drivers
133#
134
135#
136# Generic Driver Options
137#
138# CONFIG_FW_LOADER is not set
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
154#
155# Block devices
156#
157# CONFIG_BLK_DEV_FD is not set
158# CONFIG_BLK_CPQ_DA is not set
159# CONFIG_BLK_CPQ_CISS_DA is not set
160# CONFIG_BLK_DEV_DAC960 is not set
161# CONFIG_BLK_DEV_UMEM is not set
162CONFIG_BLK_DEV_LOOP=m
163# CONFIG_BLK_DEV_CRYPTOLOOP is not set
164# CONFIG_BLK_DEV_NBD is not set
165# CONFIG_BLK_DEV_CARMEL is not set
166CONFIG_BLK_DEV_RAM=m
167CONFIG_BLK_DEV_RAM_SIZE=4096
168# CONFIG_LBD is not set
169
170#
171# ATA/ATAPI/MFM/RLL support
172#
173CONFIG_IDE=y
174CONFIG_BLK_DEV_IDE=y
175
176#
177# Please see Documentation/ide.txt for help/info on IDE drives
178#
179CONFIG_BLK_DEV_IDEDISK=y
180CONFIG_IDEDISK_MULTI_MODE=y
181# CONFIG_IDEDISK_STROKE is not set
182CONFIG_BLK_DEV_IDECD=y
183# CONFIG_BLK_DEV_IDETAPE is not set
184# CONFIG_BLK_DEV_IDEFLOPPY is not set
185# CONFIG_BLK_DEV_IDESCSI is not set
186# CONFIG_IDE_TASK_IOCTL is not set
187# CONFIG_IDE_TASKFILE_IO is not set
188
189#
190# IDE chipset support/bugfixes
191#
192CONFIG_IDE_GENERIC=y
193CONFIG_BLK_DEV_IDEPCI=y
194# CONFIG_IDEPCI_SHARE_IRQ is not set
195# CONFIG_BLK_DEV_OFFBOARD is not set
196CONFIG_BLK_DEV_GENERIC=y
197# CONFIG_BLK_DEV_OPTI621 is not set
198CONFIG_BLK_DEV_SL82C105=y
199CONFIG_BLK_DEV_IDEDMA_PCI=y
200# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
201CONFIG_IDEDMA_PCI_AUTO=y
202# CONFIG_IDEDMA_ONLYDISK is not set
203CONFIG_BLK_DEV_ADMA=y
204# CONFIG_BLK_DEV_AEC62XX is not set
205# CONFIG_BLK_DEV_ALI15X3 is not set
206# CONFIG_BLK_DEV_AMD74XX is not set
207# CONFIG_BLK_DEV_CMD64X is not set
208# CONFIG_BLK_DEV_TRIFLEX is not set
209# CONFIG_BLK_DEV_CY82C693 is not set
210# CONFIG_BLK_DEV_CS5520 is not set
211# CONFIG_BLK_DEV_CS5530 is not set
212# CONFIG_BLK_DEV_HPT34X is not set
213# CONFIG_BLK_DEV_HPT366 is not set
214# CONFIG_BLK_DEV_SC1200 is not set
215# CONFIG_BLK_DEV_PIIX is not set
216# CONFIG_BLK_DEV_NS87415 is not set
217# CONFIG_BLK_DEV_PDC202XX_OLD is not set
218# CONFIG_BLK_DEV_PDC202XX_NEW is not set
219# CONFIG_BLK_DEV_SVWKS is not set
220# CONFIG_BLK_DEV_SIIMAGE is not set
221# CONFIG_BLK_DEV_SLC90E66 is not set
222# CONFIG_BLK_DEV_TRM290 is not set
223# CONFIG_BLK_DEV_VIA82CXXX is not set
224CONFIG_BLK_DEV_IDEDMA=y
225# CONFIG_IDEDMA_IVB is not set
226CONFIG_IDEDMA_AUTO=y
227# CONFIG_BLK_DEV_HD is not set
228
229#
230# SCSI device support
231#
232CONFIG_SCSI=y
233CONFIG_SCSI_PROC_FS=y
234
235#
236# SCSI support type (disk, tape, CD-ROM)
237#
238CONFIG_BLK_DEV_SD=y
239# CONFIG_CHR_DEV_ST is not set
240# CONFIG_CHR_DEV_OSST is not set
241# CONFIG_BLK_DEV_SR is not set
242# CONFIG_CHR_DEV_SG is not set
243
244#
245# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
246#
247# CONFIG_SCSI_MULTI_LUN is not set
248# CONFIG_SCSI_REPORT_LUNS is not set
249CONFIG_SCSI_CONSTANTS=y
250# CONFIG_SCSI_LOGGING is not set
251
252#
253# SCSI Transport Attributes
254#
255CONFIG_SCSI_SPI_ATTRS=y
256# CONFIG_SCSI_FC_ATTRS is not set
257
258#
259# SCSI low-level drivers
260#
261# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
262# CONFIG_SCSI_ACARD is not set
263# CONFIG_SCSI_AACRAID is not set
264# CONFIG_SCSI_AIC7XXX is not set
265# CONFIG_SCSI_AIC7XXX_OLD is not set
266# CONFIG_SCSI_AIC79XX is not set
267# CONFIG_SCSI_ADVANSYS is not set
268# CONFIG_SCSI_MEGARAID is not set
269# CONFIG_SCSI_SATA is not set
270# CONFIG_SCSI_BUSLOGIC is not set
271# CONFIG_SCSI_CPQFCTS is not set
272# CONFIG_SCSI_DMX3191D is not set
273# CONFIG_SCSI_EATA is not set
274# CONFIG_SCSI_EATA_PIO is not set
275# CONFIG_SCSI_FUTURE_DOMAIN is not set
276# CONFIG_SCSI_GDTH is not set
277# CONFIG_SCSI_IPS is not set
278# CONFIG_SCSI_INIA100 is not set
279CONFIG_SCSI_SYM53C8XX_2=y
280CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=0
281CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
282CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
283# CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set
284# CONFIG_SCSI_IPR is not set
285# CONFIG_SCSI_QLOGIC_ISP is not set
286# CONFIG_SCSI_QLOGIC_FC is not set
287# CONFIG_SCSI_QLOGIC_1280 is not set
288CONFIG_SCSI_QLA2XXX=y
289# CONFIG_SCSI_QLA21XX is not set
290# CONFIG_SCSI_QLA22XX is not set
291# CONFIG_SCSI_QLA2300 is not set
292# CONFIG_SCSI_QLA2322 is not set
293# CONFIG_SCSI_QLA6312 is not set
294# CONFIG_SCSI_QLA6322 is not set
295# CONFIG_SCSI_DC395x is not set
296# CONFIG_SCSI_DC390T is not set
297# CONFIG_SCSI_NSP32 is not set
298# CONFIG_SCSI_DEBUG is not set
299
300#
301# Multi-device support (RAID and LVM)
302#
303# CONFIG_MD is not set
304
305#
306# Fusion MPT device support
307#
308# CONFIG_FUSION is not set
309
310#
311# IEEE 1394 (FireWire) support
312#
313# CONFIG_IEEE1394 is not set
314
315#
316# I2O device support
317#
318# CONFIG_I2O is not set
319
320#
321# Macintosh device drivers
322#
323
324#
325# Networking support
326#
327CONFIG_NET=y
328
329#
330# Networking options
331#
332CONFIG_PACKET=y
333# CONFIG_PACKET_MMAP is not set
334# CONFIG_NETLINK_DEV is not set
335CONFIG_UNIX=y
336# CONFIG_NET_KEY is not set
337CONFIG_INET=y
338CONFIG_IP_MULTICAST=y
339# CONFIG_IP_ADVANCED_ROUTER is not set
340CONFIG_IP_PNP=y
341# CONFIG_IP_PNP_DHCP is not set
342CONFIG_IP_PNP_BOOTP=y
343# CONFIG_IP_PNP_RARP is not set
344# CONFIG_NET_IPIP is not set
345# CONFIG_NET_IPGRE is not set
346# CONFIG_IP_MROUTE is not set
347# CONFIG_ARPD is not set
348CONFIG_SYN_COOKIES=y
349# CONFIG_INET_AH is not set
350# CONFIG_INET_ESP is not set
351# CONFIG_INET_IPCOMP is not set
352# CONFIG_IPV6 is not set
353# CONFIG_NETFILTER is not set
354
355#
356# SCTP Configuration (EXPERIMENTAL)
357#
358# CONFIG_IP_SCTP is not set
359# CONFIG_ATM is not set
360# CONFIG_BRIDGE is not set
361# CONFIG_VLAN_8021Q is not set
362# CONFIG_DECNET is not set
363# CONFIG_LLC2 is not set
364# CONFIG_IPX is not set
365# CONFIG_ATALK is not set
366# CONFIG_X25 is not set
367# CONFIG_LAPB is not set
368# CONFIG_NET_DIVERT is not set
369# CONFIG_ECONET is not set
370# CONFIG_WAN_ROUTER is not set
371# CONFIG_NET_HW_FLOWCONTROL is not set
372
373#
374# QoS and/or fair queueing
375#
376# CONFIG_NET_SCHED is not set
377
378#
379# Network testing
380#
381# CONFIG_NET_PKTGEN is not set
382# CONFIG_NETPOLL is not set
383# CONFIG_NET_POLL_CONTROLLER is not set
384# CONFIG_HAMRADIO is not set
385# CONFIG_IRDA is not set
386# CONFIG_BT is not set
387CONFIG_NETDEVICES=y
388CONFIG_DUMMY=m
389# CONFIG_BONDING is not set
390# CONFIG_EQUALIZER is not set
391# CONFIG_TUN is not set
392
393#
394# ARCnet devices
395#
396# CONFIG_ARCNET is not set
397
398#
399# Ethernet (10 or 100Mbit)
400#
401CONFIG_NET_ETHERNET=y
402CONFIG_MII=y
403# CONFIG_OAKNET is not set
404# CONFIG_HAPPYMEAL is not set
405# CONFIG_SUNGEM is not set
406# CONFIG_NET_VENDOR_3COM is not set
407
408#
409# Tulip family network device support
410#
411# CONFIG_NET_TULIP is not set
412# CONFIG_HP100 is not set
413CONFIG_NET_PCI=y
414# CONFIG_PCNET32 is not set
415# CONFIG_AMD8111_ETH is not set
416# CONFIG_ADAPTEC_STARFIRE is not set
417# CONFIG_B44 is not set
418# CONFIG_FORCEDETH is not set
419# CONFIG_DGRS is not set
420# CONFIG_EEPRO100 is not set
421CONFIG_E100=y
422# CONFIG_E100_NAPI is not set
423# CONFIG_FEALNX is not set
424# CONFIG_NATSEMI is not set
425# CONFIG_NE2K_PCI is not set
426# CONFIG_8139CP is not set
427# CONFIG_8139TOO is not set
428# CONFIG_SIS900 is not set
429# CONFIG_EPIC100 is not set
430# CONFIG_SUNDANCE is not set
431# CONFIG_TLAN is not set
432# CONFIG_VIA_RHINE is not set
433
434#
435# Ethernet (1000 Mbit)
436#
437# CONFIG_ACENIC is not set
438# CONFIG_DL2K is not set
439# CONFIG_E1000 is not set
440# CONFIG_NS83820 is not set
441# CONFIG_HAMACHI is not set
442# CONFIG_YELLOWFIN is not set
443# CONFIG_R8169 is not set
444# CONFIG_SK98LIN is not set
445# CONFIG_TIGON3 is not set
446
447#
448# Ethernet (10000 Mbit)
449#
450# CONFIG_IXGB is not set
451# CONFIG_S2IO is not set
452
453#
454# Token Ring devices
455#
456# CONFIG_TR is not set
457
458#
459# Wireless LAN (non-hamradio)
460#
461# CONFIG_NET_RADIO is not set
462
463#
464# Wan interfaces
465#
466# CONFIG_WAN is not set
467# CONFIG_FDDI is not set
468# CONFIG_HIPPI is not set
469# CONFIG_PPP is not set
470# CONFIG_SLIP is not set
471# CONFIG_NET_FC is not set
472# CONFIG_RCPCI is not set
473# CONFIG_SHAPER is not set
474# CONFIG_NETCONSOLE is not set
475
476#
477# ISDN subsystem
478#
479# CONFIG_ISDN is not set
480
481#
482# Telephony Support
483#
484# CONFIG_PHONE is not set
485
486#
487# Input device support
488#
489# CONFIG_INPUT is not set
490
491#
492# Userland interfaces
493#
494
495#
496# Input I/O drivers
497#
498# CONFIG_GAMEPORT is not set
499CONFIG_SOUND_GAMEPORT=y
500# CONFIG_SERIO is not set
501# CONFIG_SERIO_I8042 is not set
502
503#
504# Input Device Drivers
505#
506
507#
508# Character devices
509#
510# CONFIG_VT is not set
511# CONFIG_SERIAL_NONSTANDARD is not set
512
513#
514# Serial drivers
515#
516CONFIG_SERIAL_8250=y
517CONFIG_SERIAL_8250_CONSOLE=y
518CONFIG_SERIAL_8250_NR_UARTS=1
519# CONFIG_SERIAL_8250_EXTENDED is not set
520
521#
522# Non-8250 serial port support
523#
524CONFIG_SERIAL_CORE=y
525CONFIG_SERIAL_CORE_CONSOLE=y
526CONFIG_UNIX98_PTYS=y
527CONFIG_LEGACY_PTYS=y
528CONFIG_LEGACY_PTY_COUNT=256
529# CONFIG_QIC02_TAPE is not set
530
531#
532# IPMI
533#
534# CONFIG_IPMI_HANDLER is not set
535
536#
537# Watchdog Cards
538#
539# CONFIG_WATCHDOG is not set
540# CONFIG_NVRAM is not set
541CONFIG_GEN_RTC=y
542# CONFIG_GEN_RTC_X is not set
543# CONFIG_DTLK is not set
544# CONFIG_R3964 is not set
545# CONFIG_APPLICOM is not set
546
547#
548# Ftape, the floppy tape device driver
549#
550# CONFIG_FTAPE is not set
551# CONFIG_AGP is not set
552# CONFIG_DRM is not set
553# CONFIG_RAW_DRIVER is not set
554
555#
556# I2C support
557#
558# CONFIG_I2C is not set
559
560#
561# Misc devices
562#
563
564#
565# Multimedia devices
566#
567# CONFIG_VIDEO_DEV is not set
568
569#
570# Digital Video Broadcasting Devices
571#
572# CONFIG_DVB is not set
573
574#
575# Graphics support
576#
577# CONFIG_FB is not set
578
579#
580# Sound
581#
582# CONFIG_SOUND is not set
583
584#
585# USB support
586#
587CONFIG_USB=m
588# CONFIG_USB_DEBUG is not set
589
590#
591# Miscellaneous USB options
592#
593CONFIG_USB_DEVICEFS=y
594# CONFIG_USB_BANDWIDTH is not set
595# CONFIG_USB_DYNAMIC_MINORS is not set
596
597#
598# USB Host Controller Drivers
599#
600# CONFIG_USB_EHCI_HCD is not set
601CONFIG_USB_OHCI_HCD=m
602# CONFIG_USB_UHCI_HCD is not set
603
604#
605# USB Device Class drivers
606#
607# CONFIG_USB_BLUETOOTH_TTY is not set
608CONFIG_USB_ACM=m
609# CONFIG_USB_PRINTER is not set
610# CONFIG_USB_STORAGE is not set
611
612#
613# USB Human Interface Devices (HID)
614#
615CONFIG_USB_HID=m
616
617#
618# Input core support is needed for USB HID input layer or HIDBP support
619#
620# CONFIG_USB_HIDDEV is not set
621
622#
623# USB HID Boot Protocol drivers
624#
625
626#
627# USB Imaging devices
628#
629# CONFIG_USB_MDC800 is not set
630# CONFIG_USB_MICROTEK is not set
631# CONFIG_USB_HPUSBSCSI is not set
632
633#
634# USB Multimedia devices
635#
636# CONFIG_USB_DABUSB is not set
637
638#
639# Video4Linux support is needed for USB Multimedia device support
640#
641
642#
643# USB Network adaptors
644#
645# CONFIG_USB_CATC is not set
646# CONFIG_USB_KAWETH is not set
647# CONFIG_USB_PEGASUS is not set
648# CONFIG_USB_RTL8150 is not set
649# CONFIG_USB_USBNET is not set
650
651#
652# USB port drivers
653#
654
655#
656# USB Serial Converter support
657#
658CONFIG_USB_SERIAL=m
659# CONFIG_USB_SERIAL_GENERIC is not set
660# CONFIG_USB_SERIAL_BELKIN is not set
661# CONFIG_USB_SERIAL_WHITEHEAT is not set
662# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
663# CONFIG_USB_SERIAL_EMPEG is not set
664# CONFIG_USB_SERIAL_FTDI_SIO is not set
665CONFIG_USB_SERIAL_VISOR=m
666# CONFIG_USB_SERIAL_IPAQ is not set
667# CONFIG_USB_SERIAL_IR is not set
668# CONFIG_USB_SERIAL_EDGEPORT is not set
669# CONFIG_USB_SERIAL_EDGEPORT_TI is not set
670# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
671# CONFIG_USB_SERIAL_KEYSPAN is not set
672# CONFIG_USB_SERIAL_KLSI is not set
673# CONFIG_USB_SERIAL_KOBIL_SCT is not set
674# CONFIG_USB_SERIAL_MCT_U232 is not set
675# CONFIG_USB_SERIAL_PL2303 is not set
676# CONFIG_USB_SERIAL_SAFE is not set
677# CONFIG_USB_SERIAL_CYBERJACK is not set
678# CONFIG_USB_SERIAL_XIRCOM is not set
679# CONFIG_USB_SERIAL_OMNINET is not set
680
681#
682# USB Miscellaneous drivers
683#
684# CONFIG_USB_EMI62 is not set
685# CONFIG_USB_EMI26 is not set
686# CONFIG_USB_TIGL is not set
687# CONFIG_USB_AUERSWALD is not set
688# CONFIG_USB_RIO500 is not set
689# CONFIG_USB_LEGOTOWER is not set
690# CONFIG_USB_LCD is not set
691# CONFIG_USB_LED is not set
692# CONFIG_USB_CYTHERM is not set
693# CONFIG_USB_PHIDGETSERVO is not set
694# CONFIG_USB_TEST is not set
695
696#
697# USB Gadget Support
698#
699# CONFIG_USB_GADGET is not set
700
701#
702# File systems
703#
704CONFIG_EXT2_FS=y
705# CONFIG_EXT2_FS_XATTR is not set
706CONFIG_EXT3_FS=y
707CONFIG_EXT3_FS_XATTR=y
708# CONFIG_EXT3_FS_POSIX_ACL is not set
709# CONFIG_EXT3_FS_SECURITY is not set
710CONFIG_JBD=y
711# CONFIG_JBD_DEBUG is not set
712CONFIG_FS_MBCACHE=y
713# CONFIG_REISERFS_FS is not set
714# CONFIG_JFS_FS is not set
715# CONFIG_XFS_FS is not set
716# CONFIG_MINIX_FS is not set
717# CONFIG_ROMFS_FS is not set
718# CONFIG_QUOTA is not set
719# CONFIG_AUTOFS_FS is not set
720# CONFIG_AUTOFS4_FS is not set
721
722#
723# CD-ROM/DVD Filesystems
724#
725# CONFIG_ISO9660_FS is not set
726# CONFIG_UDF_FS is not set
727
728#
729# DOS/FAT/NT Filesystems
730#
731# CONFIG_FAT_FS is not set
732# CONFIG_NTFS_FS is not set
733
734#
735# Pseudo filesystems
736#
737CONFIG_PROC_FS=y
738CONFIG_PROC_KCORE=y
739CONFIG_SYSFS=y
740# CONFIG_DEVFS_FS is not set
741# CONFIG_DEVPTS_FS_XATTR is not set
742CONFIG_TMPFS=y
743# CONFIG_HUGETLB_PAGE is not set
744CONFIG_RAMFS=y
745
746#
747# Miscellaneous filesystems
748#
749# CONFIG_ADFS_FS is not set
750# CONFIG_AFFS_FS is not set
751# CONFIG_HFS_FS is not set
752# CONFIG_HFSPLUS_FS is not set
753# CONFIG_BEFS_FS is not set
754# CONFIG_BFS_FS is not set
755# CONFIG_EFS_FS is not set
756# CONFIG_CRAMFS is not set
757# CONFIG_VXFS_FS is not set
758# CONFIG_HPFS_FS is not set
759# CONFIG_QNX4FS_FS is not set
760# CONFIG_SYSV_FS is not set
761# CONFIG_UFS_FS is not set
762
763#
764# Network File Systems
765#
766CONFIG_NFS_FS=y
767CONFIG_NFS_V3=y
768# CONFIG_NFS_V4 is not set
769# CONFIG_NFS_DIRECTIO is not set
770# CONFIG_NFSD is not set
771CONFIG_ROOT_NFS=y
772CONFIG_LOCKD=y
773CONFIG_LOCKD_V4=y
774# CONFIG_EXPORTFS is not set
775CONFIG_SUNRPC=y
776# CONFIG_RPCSEC_GSS_KRB5 is not set
777# CONFIG_SMB_FS is not set
778# CONFIG_CIFS is not set
779# CONFIG_NCP_FS is not set
780# CONFIG_CODA_FS is not set
781# CONFIG_AFS_FS is not set
782
783#
784# Partition Types
785#
786# CONFIG_PARTITION_ADVANCED is not set
787CONFIG_MSDOS_PARTITION=y
788
789#
790# Native Language Support
791#
792# CONFIG_NLS is not set
793
794#
795# Library routines
796#
797# CONFIG_CRC32 is not set
798# CONFIG_LIBCRC32C is not set
799
800#
801# Kernel hacking
802#
803# CONFIG_DEBUG_KERNEL is not set
804# CONFIG_SERIAL_TEXT_DEBUG is not set
805
806#
807# Security options
808#
809# CONFIG_SECURITY is not set
810
811#
812# Cryptographic options
813#
814# CONFIG_CRYPTO is not set
diff --git a/arch/ppc/configs/luan_defconfig b/arch/ppc/configs/luan_defconfig
deleted file mode 100644
index 71d7bf192e0e..000000000000
--- a/arch/ppc/configs/luan_defconfig
+++ /dev/null
@@ -1,668 +0,0 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.11-rc2
4# Mon Jan 31 16:26:31 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
14
15#
16# Code maturity level options
17#
18CONFIG_EXPERIMENTAL=y
19CONFIG_CLEAN_COMPILE=y
20CONFIG_BROKEN_ON_SMP=y
21
22#
23# General setup
24#
25CONFIG_LOCALVERSION=""
26CONFIG_SWAP=y
27CONFIG_SYSVIPC=y
28# CONFIG_POSIX_MQUEUE is not set
29# CONFIG_BSD_PROCESS_ACCT is not set
30CONFIG_SYSCTL=y
31# CONFIG_AUDIT is not set
32CONFIG_LOG_BUF_SHIFT=14
33# CONFIG_HOTPLUG is not set
34CONFIG_KOBJECT_UEVENT=y
35# CONFIG_IKCONFIG is not set
36CONFIG_EMBEDDED=y
37CONFIG_KALLSYMS=y
38# CONFIG_KALLSYMS_ALL is not set
39# CONFIG_KALLSYMS_EXTRA_PASS is not set
40CONFIG_FUTEX=y
41CONFIG_EPOLL=y
42# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
43CONFIG_SHMEM=y
44CONFIG_CC_ALIGN_FUNCTIONS=0
45CONFIG_CC_ALIGN_LABELS=0
46CONFIG_CC_ALIGN_LOOPS=0
47CONFIG_CC_ALIGN_JUMPS=0
48# CONFIG_TINY_SHMEM is not set
49
50#
51# Loadable module support
52#
53CONFIG_MODULES=y
54CONFIG_MODULE_UNLOAD=y
55# CONFIG_MODULE_FORCE_UNLOAD is not set
56CONFIG_OBSOLETE_MODPARM=y
57# CONFIG_MODVERSIONS is not set
58# CONFIG_MODULE_SRCVERSION_ALL is not set
59CONFIG_KMOD=y
60
61#
62# Processor
63#
64# CONFIG_6xx is not set
65# CONFIG_40x is not set
66CONFIG_44x=y
67# CONFIG_POWER3 is not set
68# CONFIG_POWER4 is not set
69# CONFIG_8xx is not set
70# CONFIG_E500 is not set
71CONFIG_BOOKE=y
72CONFIG_PTE_64BIT=y
73CONFIG_PHYS_64BIT=y
74# CONFIG_MATH_EMULATION is not set
75# CONFIG_CPU_FREQ is not set
76CONFIG_4xx=y
77
78#
79# IBM 4xx options
80#
81# CONFIG_EBONY is not set
82CONFIG_LUAN=y
83# CONFIG_OCOTEA is not set
84CONFIG_440SP=y
85CONFIG_440=y
86CONFIG_IBM_OCP=y
87CONFIG_IBM_EMAC4=y
88# CONFIG_PPC4xx_DMA is not set
89CONFIG_PPC_GEN550=y
90# CONFIG_PM is not set
91CONFIG_NOT_COHERENT_CACHE=y
92
93#
94# Platform options
95#
96# CONFIG_PC_KEYBOARD is not set
97# CONFIG_SMP is not set
98# CONFIG_PREEMPT is not set
99# CONFIG_HIGHMEM is not set
100CONFIG_BINFMT_ELF=y
101# CONFIG_BINFMT_MISC is not set
102CONFIG_CMDLINE_BOOL=y
103CONFIG_CMDLINE="ip=on console=ttyS0,115200"
104
105#
106# Bus options
107#
108CONFIG_PCI=y
109CONFIG_PCI_DOMAINS=y
110# CONFIG_PCI_LEGACY_PROC is not set
111# CONFIG_PCI_NAMES is not set
112
113#
114# PCCARD (PCMCIA/CardBus) support
115#
116# CONFIG_PCCARD is not set
117
118#
119# PC-card bridges
120#
121
122#
123# Advanced setup
124#
125# CONFIG_ADVANCED_OPTIONS is not set
126
127#
128# Default settings for advanced configuration options are used
129#
130CONFIG_HIGHMEM_START=0xfe000000
131CONFIG_LOWMEM_SIZE=0x30000000
132CONFIG_KERNEL_START=0xc0000000
133CONFIG_TASK_SIZE=0x80000000
134CONFIG_CONSISTENT_START=0xff100000
135CONFIG_CONSISTENT_SIZE=0x00200000
136CONFIG_BOOT_LOAD=0x01000000
137
138#
139# Device Drivers
140#
141
142#
143# Generic Driver Options
144#
145# CONFIG_STANDALONE is not set
146CONFIG_PREVENT_FIRMWARE_BUILD=y
147# CONFIG_FW_LOADER is not set
148# CONFIG_DEBUG_DRIVER is not set
149
150#
151# Memory Technology Devices (MTD)
152#
153# CONFIG_MTD is not set
154
155#
156# Parallel port support
157#
158# CONFIG_PARPORT is not set
159
160#
161# Plug and Play support
162#
163
164#
165# Block devices
166#
167# CONFIG_BLK_DEV_FD 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
172# CONFIG_BLK_DEV_COW_COMMON is not set
173# CONFIG_BLK_DEV_LOOP is not set
174# CONFIG_BLK_DEV_NBD is not set
175# CONFIG_BLK_DEV_SX8 is not set
176# CONFIG_BLK_DEV_RAM is not set
177CONFIG_BLK_DEV_RAM_COUNT=16
178CONFIG_INITRAMFS_SOURCE=""
179# CONFIG_LBD is not set
180# CONFIG_CDROM_PKTCDVD is not set
181
182#
183# IO Schedulers
184#
185CONFIG_IOSCHED_NOOP=y
186CONFIG_IOSCHED_AS=y
187CONFIG_IOSCHED_DEADLINE=y
188CONFIG_IOSCHED_CFQ=y
189# CONFIG_ATA_OVER_ETH is not set
190
191#
192# ATA/ATAPI/MFM/RLL support
193#
194# CONFIG_IDE is not set
195
196#
197# SCSI device support
198#
199# CONFIG_SCSI is not set
200
201#
202# Multi-device support (RAID and LVM)
203#
204# CONFIG_MD is not set
205
206#
207# Fusion MPT device support
208#
209
210#
211# IEEE 1394 (FireWire) support
212#
213# CONFIG_IEEE1394 is not set
214
215#
216# I2O device support
217#
218# CONFIG_I2O is not set
219
220#
221# Macintosh device drivers
222#
223
224#
225# Networking support
226#
227CONFIG_NET=y
228
229#
230# Networking options
231#
232CONFIG_PACKET=y
233# CONFIG_PACKET_MMAP is not set
234# CONFIG_NETLINK_DEV is not set
235CONFIG_UNIX=y
236# CONFIG_NET_KEY is not set
237CONFIG_INET=y
238# CONFIG_IP_MULTICAST is not set
239# CONFIG_IP_ADVANCED_ROUTER is not set
240CONFIG_IP_PNP=y
241# CONFIG_IP_PNP_DHCP is not set
242CONFIG_IP_PNP_BOOTP=y
243# CONFIG_IP_PNP_RARP is not set
244# CONFIG_NET_IPIP is not set
245# CONFIG_NET_IPGRE is not set
246# CONFIG_ARPD is not set
247# CONFIG_SYN_COOKIES is not set
248# CONFIG_INET_AH is not set
249# CONFIG_INET_ESP is not set
250# CONFIG_INET_IPCOMP is not set
251# CONFIG_INET_TUNNEL is not set
252CONFIG_IP_TCPDIAG=y
253# CONFIG_IP_TCPDIAG_IPV6 is not set
254
255#
256# IP: Virtual Server Configuration
257#
258# CONFIG_IP_VS is not set
259# CONFIG_IPV6 is not set
260CONFIG_NETFILTER=y
261# CONFIG_NETFILTER_DEBUG is not set
262
263#
264# IP: Netfilter Configuration
265#
266# CONFIG_IP_NF_CONNTRACK is not set
267# CONFIG_IP_NF_CONNTRACK_MARK is not set
268# CONFIG_IP_NF_QUEUE is not set
269# CONFIG_IP_NF_IPTABLES is not set
270# CONFIG_IP_NF_ARPTABLES is not set
271
272#
273# SCTP Configuration (EXPERIMENTAL)
274#
275# CONFIG_IP_SCTP is not set
276# CONFIG_ATM is not set
277# CONFIG_BRIDGE is not set
278# CONFIG_VLAN_8021Q is not set
279# CONFIG_DECNET is not set
280# CONFIG_LLC2 is not set
281# CONFIG_IPX is not set
282# CONFIG_ATALK is not set
283# CONFIG_X25 is not set
284# CONFIG_LAPB is not set
285# CONFIG_NET_DIVERT is not set
286# CONFIG_ECONET is not set
287# CONFIG_WAN_ROUTER is not set
288
289#
290# QoS and/or fair queueing
291#
292# CONFIG_NET_SCHED is not set
293# CONFIG_NET_CLS_ROUTE is not set
294
295#
296# Network testing
297#
298# CONFIG_NET_PKTGEN is not set
299# CONFIG_NETPOLL is not set
300# CONFIG_NET_POLL_CONTROLLER is not set
301# CONFIG_HAMRADIO is not set
302# CONFIG_IRDA is not set
303# CONFIG_BT is not set
304CONFIG_NETDEVICES=y
305# CONFIG_DUMMY is not set
306# CONFIG_BONDING is not set
307# CONFIG_EQUALIZER is not set
308# CONFIG_TUN is not set
309
310#
311# ARCnet devices
312#
313# CONFIG_ARCNET is not set
314
315#
316# Ethernet (10 or 100Mbit)
317#
318CONFIG_NET_ETHERNET=y
319# CONFIG_MII is not set
320# CONFIG_HAPPYMEAL is not set
321# CONFIG_SUNGEM is not set
322# CONFIG_NET_VENDOR_3COM is not set
323
324#
325# Tulip family network device support
326#
327# CONFIG_NET_TULIP is not set
328# CONFIG_HP100 is not set
329CONFIG_IBM_EMAC=y
330# CONFIG_IBM_EMAC_ERRMSG is not set
331CONFIG_IBM_EMAC_RXB=128
332CONFIG_IBM_EMAC_TXB=128
333CONFIG_IBM_EMAC_FGAP=8
334CONFIG_IBM_EMAC_SKBRES=0
335# CONFIG_NET_PCI is not set
336
337#
338# Ethernet (1000 Mbit)
339#
340# CONFIG_ACENIC is not set
341# CONFIG_DL2K is not set
342# CONFIG_E1000 is not set
343# CONFIG_NS83820 is not set
344# CONFIG_HAMACHI is not set
345# CONFIG_YELLOWFIN is not set
346# CONFIG_R8169 is not set
347# CONFIG_SK98LIN is not set
348# CONFIG_TIGON3 is not set
349
350#
351# Ethernet (10000 Mbit)
352#
353# CONFIG_IXGB is not set
354# CONFIG_S2IO is not set
355
356#
357# Token Ring devices
358#
359# CONFIG_TR is not set
360
361#
362# Wireless LAN (non-hamradio)
363#
364# CONFIG_NET_RADIO is not set
365
366#
367# Wan interfaces
368#
369# CONFIG_WAN is not set
370# CONFIG_FDDI is not set
371# CONFIG_HIPPI is not set
372# CONFIG_PPP is not set
373# CONFIG_SLIP is not set
374# CONFIG_SHAPER is not set
375# CONFIG_NETCONSOLE is not set
376
377#
378# ISDN subsystem
379#
380# CONFIG_ISDN is not set
381
382#
383# Telephony Support
384#
385# CONFIG_PHONE is not set
386
387#
388# Input device support
389#
390CONFIG_INPUT=y
391
392#
393# Userland interfaces
394#
395CONFIG_INPUT_MOUSEDEV=y
396CONFIG_INPUT_MOUSEDEV_PSAUX=y
397CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
398CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
399# CONFIG_INPUT_JOYDEV is not set
400# CONFIG_INPUT_TSDEV is not set
401# CONFIG_INPUT_EVDEV is not set
402# CONFIG_INPUT_EVBUG is not set
403
404#
405# Input I/O drivers
406#
407# CONFIG_GAMEPORT is not set
408CONFIG_SOUND_GAMEPORT=y
409CONFIG_SERIO=y
410# CONFIG_SERIO_I8042 is not set
411# CONFIG_SERIO_SERPORT is not set
412# CONFIG_SERIO_CT82C710 is not set
413# CONFIG_SERIO_PCIPS2 is not set
414# CONFIG_SERIO_LIBPS2 is not set
415# CONFIG_SERIO_RAW is not set
416
417#
418# Input Device Drivers
419#
420# CONFIG_INPUT_KEYBOARD is not set
421# CONFIG_INPUT_MOUSE is not set
422# CONFIG_INPUT_JOYSTICK is not set
423# CONFIG_INPUT_TOUCHSCREEN is not set
424# CONFIG_INPUT_MISC is not set
425
426#
427# Character devices
428#
429# CONFIG_VT is not set
430# CONFIG_SERIAL_NONSTANDARD is not set
431
432#
433# Serial drivers
434#
435CONFIG_SERIAL_8250=y
436CONFIG_SERIAL_8250_CONSOLE=y
437CONFIG_SERIAL_8250_NR_UARTS=4
438CONFIG_SERIAL_8250_EXTENDED=y
439# CONFIG_SERIAL_8250_MANY_PORTS is not set
440CONFIG_SERIAL_8250_SHARE_IRQ=y
441# CONFIG_SERIAL_8250_DETECT_IRQ is not set
442# CONFIG_SERIAL_8250_MULTIPORT is not set
443# CONFIG_SERIAL_8250_RSA is not set
444
445#
446# Non-8250 serial port support
447#
448CONFIG_SERIAL_CORE=y
449CONFIG_SERIAL_CORE_CONSOLE=y
450CONFIG_UNIX98_PTYS=y
451CONFIG_LEGACY_PTYS=y
452CONFIG_LEGACY_PTY_COUNT=256
453
454#
455# IPMI
456#
457# CONFIG_IPMI_HANDLER is not set
458
459#
460# Watchdog Cards
461#
462# CONFIG_WATCHDOG is not set
463# CONFIG_NVRAM is not set
464# CONFIG_GEN_RTC is not set
465# CONFIG_DTLK is not set
466# CONFIG_R3964 is not set
467# CONFIG_APPLICOM is not set
468
469#
470# Ftape, the floppy tape device driver
471#
472# CONFIG_AGP is not set
473# CONFIG_DRM is not set
474# CONFIG_RAW_DRIVER is not set
475
476#
477# I2C support
478#
479# CONFIG_I2C is not set
480
481#
482# Dallas's 1-wire bus
483#
484# CONFIG_W1 is not set
485
486#
487# Misc devices
488#
489
490#
491# Multimedia devices
492#
493# CONFIG_VIDEO_DEV is not set
494
495#
496# Digital Video Broadcasting Devices
497#
498# CONFIG_DVB is not set
499
500#
501# Graphics support
502#
503# CONFIG_FB is not set
504
505#
506# Sound
507#
508# CONFIG_SOUND is not set
509
510#
511# USB support
512#
513# CONFIG_USB is not set
514CONFIG_USB_ARCH_HAS_HCD=y
515CONFIG_USB_ARCH_HAS_OHCI=y
516
517#
518# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
519#
520
521#
522# USB Gadget Support
523#
524# CONFIG_USB_GADGET is not set
525
526#
527# MMC/SD Card support
528#
529# CONFIG_MMC is not set
530
531#
532# InfiniBand support
533#
534# CONFIG_INFINIBAND is not set
535
536#
537# File systems
538#
539# CONFIG_EXT2_FS is not set
540# CONFIG_EXT3_FS is not set
541# CONFIG_JBD is not set
542# CONFIG_REISERFS_FS is not set
543# CONFIG_JFS_FS is not set
544# CONFIG_XFS_FS is not set
545# CONFIG_MINIX_FS is not set
546# CONFIG_ROMFS_FS is not set
547# CONFIG_QUOTA is not set
548CONFIG_DNOTIFY=y
549# CONFIG_AUTOFS_FS is not set
550# CONFIG_AUTOFS4_FS is not set
551
552#
553# CD-ROM/DVD Filesystems
554#
555# CONFIG_ISO9660_FS is not set
556# CONFIG_UDF_FS is not set
557
558#
559# DOS/FAT/NT Filesystems
560#
561# CONFIG_MSDOS_FS is not set
562# CONFIG_VFAT_FS is not set
563# CONFIG_NTFS_FS is not set
564
565#
566# Pseudo filesystems
567#
568CONFIG_PROC_FS=y
569CONFIG_PROC_KCORE=y
570CONFIG_SYSFS=y
571# CONFIG_DEVFS_FS is not set
572# CONFIG_DEVPTS_FS_XATTR is not set
573# CONFIG_TMPFS is not set
574# CONFIG_HUGETLB_PAGE is not set
575CONFIG_RAMFS=y
576
577#
578# Miscellaneous filesystems
579#
580# CONFIG_ADFS_FS is not set
581# CONFIG_AFFS_FS is not set
582# CONFIG_HFS_FS is not set
583# CONFIG_HFSPLUS_FS is not set
584# CONFIG_BEFS_FS is not set
585# CONFIG_BFS_FS is not set
586# CONFIG_EFS_FS is not set
587# CONFIG_CRAMFS is not set
588# CONFIG_VXFS_FS is not set
589# CONFIG_HPFS_FS is not set
590# CONFIG_QNX4FS_FS is not set
591# CONFIG_SYSV_FS is not set
592# CONFIG_UFS_FS is not set
593
594#
595# Network File Systems
596#
597CONFIG_NFS_FS=y
598# CONFIG_NFS_V3 is not set
599# CONFIG_NFS_V4 is not set
600# CONFIG_NFS_DIRECTIO is not set
601# CONFIG_NFSD is not set
602CONFIG_ROOT_NFS=y
603CONFIG_LOCKD=y
604# CONFIG_EXPORTFS is not set
605CONFIG_SUNRPC=y
606# CONFIG_RPCSEC_GSS_KRB5 is not set
607# CONFIG_RPCSEC_GSS_SPKM3 is not set
608# CONFIG_SMB_FS is not set
609# CONFIG_CIFS is not set
610# CONFIG_NCP_FS is not set
611# CONFIG_CODA_FS is not set
612# CONFIG_AFS_FS is not set
613
614#
615# Partition Types
616#
617# CONFIG_PARTITION_ADVANCED is not set
618CONFIG_MSDOS_PARTITION=y
619
620#
621# Native Language Support
622#
623# CONFIG_NLS is not set
624
625#
626# Library routines
627#
628# CONFIG_CRC_CCITT is not set
629CONFIG_CRC32=y
630# CONFIG_LIBCRC32C is not set
631
632#
633# Profiling support
634#
635# CONFIG_PROFILING is not set
636
637#
638# Kernel hacking
639#
640CONFIG_DEBUG_KERNEL=y
641# CONFIG_MAGIC_SYSRQ is not set
642# CONFIG_SCHEDSTATS is not set
643# CONFIG_DEBUG_SLAB is not set
644# CONFIG_DEBUG_SPINLOCK is not set
645# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
646# CONFIG_DEBUG_KOBJECT is not set
647CONFIG_DEBUG_INFO=y
648# CONFIG_DEBUG_FS is not set
649# CONFIG_KGDB is not set
650# CONFIG_XMON is not set
651CONFIG_BDI_SWITCH=y
652# CONFIG_SERIAL_TEXT_DEBUG is not set
653CONFIG_PPC_OCP=y
654
655#
656# Security options
657#
658# CONFIG_KEYS is not set
659# CONFIG_SECURITY is not set
660
661#
662# Cryptographic options
663#
664# CONFIG_CRYPTO is not set
665
666#
667# Hardware crypto devices
668#
diff --git a/arch/ppc/configs/mbx_defconfig b/arch/ppc/configs/mbx_defconfig
deleted file mode 100644
index 52c3799e67ba..000000000000
--- a/arch/ppc/configs/mbx_defconfig
+++ /dev/null
@@ -1,512 +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
7
8#
9# Code maturity level options
10#
11CONFIG_EXPERIMENTAL=y
12
13#
14# General setup
15#
16CONFIG_SWAP=y
17CONFIG_SYSVIPC=y
18# CONFIG_BSD_PROCESS_ACCT is not set
19# CONFIG_SYSCTL is not set
20CONFIG_LOG_BUF_SHIFT=14
21CONFIG_EMBEDDED=y
22CONFIG_FUTEX=y
23# CONFIG_EPOLL is not set
24
25#
26# Loadable module support
27#
28# CONFIG_MODULES is not set
29
30#
31# Platform support
32#
33CONFIG_PPC=y
34CONFIG_PPC32=y
35# CONFIG_6xx is not set
36# CONFIG_40x is not set
37# CONFIG_POWER3 is not set
38CONFIG_8xx=y
39
40#
41# IBM 4xx options
42#
43CONFIG_EMBEDDEDBOOT=y
44CONFIG_SERIAL_CONSOLE=y
45CONFIG_NOT_COHERENT_CACHE=y
46# CONFIG_RPXLITE is not set
47# CONFIG_RPXCLASSIC is not set
48# CONFIG_BSEIP is not set
49# CONFIG_FADS is not set
50# CONFIG_TQM823L is not set
51# CONFIG_TQM850L is not set
52# CONFIG_TQM855L is not set
53# CONFIG_TQM860L is not set
54# CONFIG_FPS850L is not set
55# CONFIG_SPD823TS is not set
56# CONFIG_IVMS8 is not set
57# CONFIG_IVML24 is not set
58# CONFIG_SM850 is not set
59# CONFIG_HERMES_PRO is not set
60# CONFIG_IP860 is not set
61# CONFIG_LWMON is not set
62# CONFIG_PCU_E is not set
63# CONFIG_CCM is not set
64# CONFIG_LANTEC is not set
65CONFIG_MBX=y
66# CONFIG_WINCEPT is not set
67# CONFIG_SMP is not set
68# CONFIG_PREEMPT is not set
69CONFIG_MATH_EMULATION=y
70# CONFIG_CPU_FREQ is not set
71
72#
73# General setup
74#
75# CONFIG_HIGHMEM is not set
76# CONFIG_PCI is not set
77# CONFIG_PCI_DOMAINS is not set
78# CONFIG_PCI_QSPAN is not set
79CONFIG_KCORE_ELF=y
80CONFIG_BINFMT_ELF=y
81CONFIG_KERNEL_ELF=y
82# CONFIG_BINFMT_MISC is not set
83# CONFIG_HOTPLUG is not set
84
85#
86# Parallel port support
87#
88# CONFIG_PARPORT is not set
89# CONFIG_CMDLINE_BOOL is not set
90
91#
92# Advanced setup
93#
94# CONFIG_ADVANCED_OPTIONS is not set
95
96#
97# Default settings for advanced configuration options are used
98#
99CONFIG_HIGHMEM_START=0xfe000000
100CONFIG_LOWMEM_SIZE=0x30000000
101CONFIG_KERNEL_START=0xc0000000
102CONFIG_TASK_SIZE=0x80000000
103CONFIG_BOOT_LOAD=0x00400000
104
105#
106# Memory Technology Devices (MTD)
107#
108# CONFIG_MTD is not set
109
110#
111# Plug and Play support
112#
113# CONFIG_PNP is not set
114
115#
116# Block devices
117#
118# CONFIG_BLK_DEV_FD is not set
119# CONFIG_BLK_DEV_LOOP is not set
120# CONFIG_BLK_DEV_NBD is not set
121# CONFIG_BLK_DEV_RAM is not set
122# CONFIG_BLK_DEV_INITRD is not set
123
124#
125# Multi-device support (RAID and LVM)
126#
127# CONFIG_MD is not set
128
129#
130# ATA/IDE/MFM/RLL support
131#
132# CONFIG_IDE is not set
133
134#
135# SCSI support
136#
137# CONFIG_SCSI is not set
138
139#
140# Fusion MPT device support
141#
142
143#
144# I2O device support
145#
146
147#
148# Networking support
149#
150CONFIG_NET=y
151
152#
153# Networking options
154#
155# CONFIG_PACKET is not set
156# CONFIG_NETLINK_DEV is not set
157# CONFIG_NETFILTER is not set
158CONFIG_UNIX=y
159# CONFIG_NET_KEY is not set
160CONFIG_INET=y
161# CONFIG_IP_MULTICAST is not set
162# CONFIG_IP_ADVANCED_ROUTER is not set
163CONFIG_IP_PNP=y
164CONFIG_IP_PNP_DHCP=y
165CONFIG_IP_PNP_BOOTP=y
166# CONFIG_IP_PNP_RARP is not set
167# CONFIG_NET_IPIP is not set
168# CONFIG_NET_IPGRE is not set
169# CONFIG_ARPD is not set
170# CONFIG_INET_ECN is not set
171# CONFIG_SYN_COOKIES is not set
172# CONFIG_INET_AH is not set
173# CONFIG_INET_ESP is not set
174# CONFIG_INET_IPCOMP is not set
175# CONFIG_IPV6 is not set
176# CONFIG_XFRM_USER is not set
177
178#
179# SCTP Configuration (EXPERIMENTAL)
180#
181CONFIG_IPV6_SCTP__=y
182# CONFIG_IP_SCTP is not set
183# CONFIG_ATM is not set
184# CONFIG_VLAN_8021Q is not set
185# CONFIG_LLC is not set
186# CONFIG_DECNET is not set
187# CONFIG_BRIDGE is not set
188# CONFIG_X25 is not set
189# CONFIG_LAPB is not set
190# CONFIG_NET_DIVERT is not set
191# CONFIG_ECONET is not set
192# CONFIG_WAN_ROUTER is not set
193# CONFIG_NET_HW_FLOWCONTROL is not set
194
195#
196# QoS and/or fair queueing
197#
198# CONFIG_NET_SCHED is not set
199
200#
201# Network testing
202#
203# CONFIG_NET_PKTGEN is not set
204CONFIG_NETDEVICES=y
205# CONFIG_DUMMY is not set
206# CONFIG_BONDING is not set
207# CONFIG_EQUALIZER is not set
208# CONFIG_TUN is not set
209# CONFIG_ETHERTAP is not set
210
211#
212# Ethernet (10 or 100Mbit)
213#
214CONFIG_NET_ETHERNET=y
215CONFIG_MII=y
216# CONFIG_OAKNET is not set
217
218#
219# Ethernet (1000 Mbit)
220#
221
222#
223# Ethernet (10000 Mbit)
224#
225# CONFIG_PPP is not set
226# CONFIG_SLIP is not set
227
228#
229# Wireless LAN (non-hamradio)
230#
231# CONFIG_NET_RADIO is not set
232
233#
234# Token Ring devices (depends on LLC=y)
235#
236# CONFIG_SHAPER is not set
237
238#
239# Wan interfaces
240#
241# CONFIG_WAN is not set
242
243#
244# Amateur Radio support
245#
246# CONFIG_HAMRADIO is not set
247
248#
249# IrDA (infrared) support
250#
251# CONFIG_IRDA is not set
252
253#
254# ISDN subsystem
255#
256# CONFIG_ISDN_BOOL is not set
257
258#
259# Graphics support
260#
261# CONFIG_FB is not set
262
263#
264# Old CD-ROM drivers (not SCSI, not IDE)
265#
266# CONFIG_CD_NO_IDESCSI is not set
267
268#
269# Input device support
270#
271# CONFIG_INPUT is not set
272
273#
274# Userland interfaces
275#
276
277#
278# Input I/O drivers
279#
280# CONFIG_GAMEPORT is not set
281CONFIG_SOUND_GAMEPORT=y
282# CONFIG_SERIO is not set
283
284#
285# Input Device Drivers
286#
287
288#
289# Macintosh device drivers
290#
291
292#
293# Serial drivers
294#
295# CONFIG_SERIAL_8250 is not set
296
297#
298# Non-8250 serial port support
299#
300CONFIG_SERIAL_CORE=y
301CONFIG_SERIAL_CORE_CONSOLE=y
302CONFIG_SERIAL_CPM=y
303CONFIG_SERIAL_CPM_CONSOLE=y
304# CONFIG_SERIAL_CPM_SCC1 is not set
305CONFIG_SERIAL_CPM_SCC2=y
306CONFIG_SERIAL_CPM_SCC3=y
307# CONFIG_SERIAL_CPM_SCC4 is not set
308CONFIG_SERIAL_CPM_SMC1=y
309CONFIG_SERIAL_CPM_SMC2=y
310CONFIG_UNIX98_PTYS=y
311# CONFIG_LEGACY_PTYS is not set
312
313#
314# I2C support
315#
316# CONFIG_I2C is not set
317
318#
319# I2C Hardware Sensors Mainboard support
320#
321
322#
323# I2C Hardware Sensors Chip support
324#
325# CONFIG_I2C_SENSOR is not set
326
327#
328# Mice
329#
330# CONFIG_BUSMOUSE is not set
331# CONFIG_QIC02_TAPE is not set
332
333#
334# IPMI
335#
336# CONFIG_IPMI_HANDLER is not set
337
338#
339# Watchdog Cards
340#
341# CONFIG_WATCHDOG is not set
342# CONFIG_NVRAM is not set
343CONFIG_GEN_RTC=y
344# CONFIG_GEN_RTC_X is not set
345# CONFIG_DTLK is not set
346# CONFIG_R3964 is not set
347# CONFIG_APPLICOM is not set
348
349#
350# Ftape, the floppy tape device driver
351#
352# CONFIG_FTAPE is not set
353# CONFIG_AGP is not set
354# CONFIG_DRM is not set
355# CONFIG_RAW_DRIVER is not set
356# CONFIG_HANGCHECK_TIMER is not set
357
358#
359# Multimedia devices
360#
361# CONFIG_VIDEO_DEV is not set
362
363#
364# Digital Video Broadcasting Devices
365#
366# CONFIG_DVB is not set
367
368#
369# File systems
370#
371CONFIG_EXT2_FS=y
372# CONFIG_EXT2_FS_XATTR is not set
373CONFIG_EXT3_FS=y
374CONFIG_EXT3_FS_XATTR=y
375# CONFIG_EXT3_FS_POSIX_ACL is not set
376# CONFIG_EXT3_FS_SECURITY is not set
377CONFIG_JBD=y
378# CONFIG_JBD_DEBUG is not set
379CONFIG_FS_MBCACHE=y
380# CONFIG_REISERFS_FS is not set
381# CONFIG_JFS_FS is not set
382# CONFIG_XFS_FS is not set
383# CONFIG_MINIX_FS is not set
384# CONFIG_ROMFS_FS is not set
385# CONFIG_QUOTA is not set
386# CONFIG_AUTOFS_FS is not set
387# CONFIG_AUTOFS4_FS is not set
388
389#
390# CD-ROM/DVD Filesystems
391#
392# CONFIG_ISO9660_FS is not set
393# CONFIG_UDF_FS is not set
394
395#
396# DOS/FAT/NT Filesystems
397#
398# CONFIG_FAT_FS is not set
399# CONFIG_NTFS_FS is not set
400
401#
402# Pseudo filesystems
403#
404CONFIG_PROC_FS=y
405# CONFIG_DEVFS_FS is not set
406CONFIG_TMPFS=y
407CONFIG_RAMFS=y
408
409#
410# Miscellaneous filesystems
411#
412# CONFIG_ADFS_FS is not set
413# CONFIG_AFFS_FS is not set
414# CONFIG_HFS_FS is not set
415# CONFIG_BEFS_FS is not set
416# CONFIG_BFS_FS is not set
417# CONFIG_EFS_FS is not set
418# CONFIG_CRAMFS is not set
419# CONFIG_VXFS_FS is not set
420# CONFIG_HPFS_FS is not set
421# CONFIG_QNX4FS_FS is not set
422# CONFIG_SYSV_FS is not set
423# CONFIG_UFS_FS is not set
424
425#
426# Network File Systems
427#
428CONFIG_NFS_FS=y
429# CONFIG_NFS_V3 is not set
430# CONFIG_NFS_V4 is not set
431# CONFIG_NFSD is not set
432CONFIG_ROOT_NFS=y
433CONFIG_LOCKD=y
434# CONFIG_EXPORTFS is not set
435CONFIG_SUNRPC=y
436# CONFIG_SUNRPC_GSS is not set
437# CONFIG_SMB_FS is not set
438# CONFIG_CIFS is not set
439# CONFIG_NCP_FS is not set
440# CONFIG_CODA_FS is not set
441# CONFIG_INTERMEZZO_FS is not set
442# CONFIG_AFS_FS is not set
443
444#
445# Partition Types
446#
447CONFIG_PARTITION_ADVANCED=y
448# CONFIG_ACORN_PARTITION is not set
449# CONFIG_OSF_PARTITION is not set
450# CONFIG_AMIGA_PARTITION is not set
451# CONFIG_ATARI_PARTITION is not set
452# CONFIG_MAC_PARTITION is not set
453# CONFIG_MSDOS_PARTITION is not set
454# CONFIG_LDM_PARTITION is not set
455# CONFIG_NEC98_PARTITION is not set
456# CONFIG_SGI_PARTITION is not set
457# CONFIG_ULTRIX_PARTITION is not set
458# CONFIG_SUN_PARTITION is not set
459# CONFIG_EFI_PARTITION is not set
460
461#
462# Sound
463#
464# CONFIG_SOUND is not set
465
466#
467# MPC8xx CPM Options
468#
469CONFIG_SCC_ENET=y
470CONFIG_SCC1_ENET=y
471# CONFIG_SCC2_ENET is not set
472# CONFIG_SCC3_ENET is not set
473# CONFIG_FEC_ENET is not set
474CONFIG_ENET_BIG_BUFFERS=y
475
476#
477# Generic MPC8xx Options
478#
479CONFIG_8xx_COPYBACK=y
480CONFIG_8xx_CPU6=y
481# CONFIG_UCODE_PATCH is not set
482
483#
484# USB support
485#
486# CONFIG_USB_GADGET is not set
487
488#
489# Bluetooth support
490#
491# CONFIG_BT is not set
492
493#
494# Library routines
495#
496# CONFIG_CRC32 is not set
497
498#
499# Kernel hacking
500#
501# CONFIG_DEBUG_KERNEL is not set
502# CONFIG_KALLSYMS is not set
503
504#
505# Security options
506#
507# CONFIG_SECURITY is not set
508
509#
510# Cryptographic options
511#
512# CONFIG_CRYPTO is not set
diff --git a/arch/ppc/configs/ml300_defconfig b/arch/ppc/configs/ml300_defconfig
deleted file mode 100644
index d66cacdb95be..000000000000
--- a/arch/ppc/configs/ml300_defconfig
+++ /dev/null
@@ -1,739 +0,0 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16-rc1
4# Wed Jan 18 00:49:20 2006
5#
6CONFIG_MMU=y
7CONFIG_GENERIC_HARDIRQS=y
8CONFIG_RWSEM_XCHGADD_ALGORITHM=y
9CONFIG_GENERIC_CALIBRATE_DELAY=y
10CONFIG_PPC=y
11CONFIG_PPC32=y
12CONFIG_GENERIC_NVRAM=y
13CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
14CONFIG_ARCH_MAY_HAVE_PC_FDC=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_LOCALVERSION_AUTO=y
29# CONFIG_SWAP is not set
30CONFIG_SYSVIPC=y
31# CONFIG_POSIX_MQUEUE is not set
32CONFIG_BSD_PROCESS_ACCT=y
33CONFIG_BSD_PROCESS_ACCT_V3=y
34CONFIG_SYSCTL=y
35# CONFIG_AUDIT is not set
36# CONFIG_IKCONFIG is not set
37CONFIG_INITRAMFS_SOURCE=""
38CONFIG_CC_OPTIMIZE_FOR_SIZE=y
39# CONFIG_EMBEDDED is not set
40CONFIG_KALLSYMS=y
41# CONFIG_KALLSYMS_ALL is not set
42# CONFIG_KALLSYMS_EXTRA_PASS is not set
43CONFIG_HOTPLUG=y
44CONFIG_PRINTK=y
45CONFIG_BUG=y
46CONFIG_ELF_CORE=y
47CONFIG_BASE_FULL=y
48CONFIG_FUTEX=y
49CONFIG_EPOLL=y
50CONFIG_SHMEM=y
51CONFIG_CC_ALIGN_FUNCTIONS=0
52CONFIG_CC_ALIGN_LABELS=0
53CONFIG_CC_ALIGN_LOOPS=0
54CONFIG_CC_ALIGN_JUMPS=0
55CONFIG_SLAB=y
56# CONFIG_TINY_SHMEM is not set
57CONFIG_BASE_SMALL=0
58# CONFIG_SLOB is not set
59
60#
61# Loadable module support
62#
63CONFIG_MODULES=y
64CONFIG_MODULE_UNLOAD=y
65CONFIG_MODULE_FORCE_UNLOAD=y
66CONFIG_OBSOLETE_MODPARM=y
67CONFIG_MODVERSIONS=y
68CONFIG_MODULE_SRCVERSION_ALL=y
69CONFIG_KMOD=y
70
71#
72# Block layer
73#
74CONFIG_LBD=y
75
76#
77# IO Schedulers
78#
79CONFIG_IOSCHED_NOOP=y
80CONFIG_IOSCHED_AS=y
81CONFIG_IOSCHED_DEADLINE=y
82CONFIG_IOSCHED_CFQ=y
83CONFIG_DEFAULT_AS=y
84# CONFIG_DEFAULT_DEADLINE is not set
85# CONFIG_DEFAULT_CFQ is not set
86# CONFIG_DEFAULT_NOOP is not set
87CONFIG_DEFAULT_IOSCHED="anticipatory"
88
89#
90# Processor
91#
92# CONFIG_6xx is not set
93CONFIG_40x=y
94# CONFIG_44x is not set
95# CONFIG_POWER3 is not set
96# CONFIG_8xx is not set
97# CONFIG_E200 is not set
98# CONFIG_E500 is not set
99# CONFIG_MATH_EMULATION is not set
100# CONFIG_KEXEC is not set
101# CONFIG_CPU_FREQ is not set
102CONFIG_4xx=y
103# CONFIG_WANT_EARLY_SERIAL is not set
104
105#
106# IBM 4xx options
107#
108# CONFIG_BUBINGA is not set
109# CONFIG_CPCI405 is not set
110# CONFIG_EP405 is not set
111# CONFIG_REDWOOD_5 is not set
112# CONFIG_REDWOOD_6 is not set
113# CONFIG_SYCAMORE is not set
114# CONFIG_WALNUT is not set
115CONFIG_XILINX_ML300=y
116CONFIG_IBM405_ERR77=y
117CONFIG_IBM405_ERR51=y
118CONFIG_XILINX_VIRTEX=y
119CONFIG_EMBEDDEDBOOT=y
120# CONFIG_PPC4xx_DMA is not set
121CONFIG_PPC_GEN550=y
122CONFIG_UART0_TTYS0=y
123# CONFIG_UART0_TTYS1 is not set
124CONFIG_NOT_COHERENT_CACHE=y
125
126#
127# Platform options
128#
129# CONFIG_PC_KEYBOARD is not set
130# CONFIG_HIGHMEM is not set
131# CONFIG_HZ_100 is not set
132CONFIG_HZ_250=y
133# CONFIG_HZ_1000 is not set
134CONFIG_HZ=250
135CONFIG_PREEMPT_NONE=y
136# CONFIG_PREEMPT_VOLUNTARY is not set
137# CONFIG_PREEMPT is not set
138CONFIG_SELECT_MEMORY_MODEL=y
139CONFIG_FLATMEM_MANUAL=y
140# CONFIG_DISCONTIGMEM_MANUAL is not set
141# CONFIG_SPARSEMEM_MANUAL is not set
142CONFIG_FLATMEM=y
143CONFIG_FLAT_NODE_MEM_MAP=y
144# CONFIG_SPARSEMEM_STATIC is not set
145CONFIG_SPLIT_PTLOCK_CPUS=4
146CONFIG_BINFMT_ELF=y
147# CONFIG_BINFMT_MISC is not set
148CONFIG_CMDLINE_BOOL=y
149CONFIG_CMDLINE="console=ttyS0,9600"
150# CONFIG_PM is not set
151# CONFIG_HIBERNATION is not set
152CONFIG_SECCOMP=y
153CONFIG_ISA_DMA_API=y
154
155#
156# Bus options
157#
158# CONFIG_PPC_I8259 is not set
159# CONFIG_PCI is not set
160# CONFIG_PCI_DOMAINS is not set
161
162#
163# PCCARD (PCMCIA/CardBus) support
164#
165# CONFIG_PCCARD is not set
166
167#
168# Advanced setup
169#
170# CONFIG_ADVANCED_OPTIONS is not set
171
172#
173# Default settings for advanced configuration options are used
174#
175CONFIG_HIGHMEM_START=0xfe000000
176CONFIG_LOWMEM_SIZE=0x30000000
177CONFIG_KERNEL_START=0xc0000000
178CONFIG_TASK_SIZE=0x80000000
179CONFIG_CONSISTENT_START=0xff100000
180CONFIG_CONSISTENT_SIZE=0x00200000
181CONFIG_BOOT_LOAD=0x00400000
182
183#
184# Networking
185#
186CONFIG_NET=y
187
188#
189# Networking options
190#
191CONFIG_PACKET=y
192CONFIG_PACKET_MMAP=y
193CONFIG_UNIX=y
194# CONFIG_NET_KEY is not set
195CONFIG_INET=y
196# CONFIG_IP_MULTICAST is not set
197# CONFIG_IP_ADVANCED_ROUTER is not set
198CONFIG_IP_FIB_HASH=y
199CONFIG_IP_PNP=y
200CONFIG_IP_PNP_DHCP=y
201# CONFIG_IP_PNP_BOOTP is not set
202# CONFIG_IP_PNP_RARP is not set
203# CONFIG_NET_IPIP is not set
204# CONFIG_NET_IPGRE is not set
205# CONFIG_ARPD is not set
206# CONFIG_SYN_COOKIES is not set
207# CONFIG_INET_AH is not set
208# CONFIG_INET_ESP is not set
209# CONFIG_INET_IPCOMP is not set
210# CONFIG_INET_TUNNEL is not set
211CONFIG_INET_DIAG=y
212CONFIG_INET_TCP_DIAG=y
213# CONFIG_TCP_CONG_ADVANCED is not set
214CONFIG_TCP_CONG_BIC=y
215# CONFIG_IPV6 is not set
216# CONFIG_NETFILTER is not set
217
218#
219# DCCP Configuration (EXPERIMENTAL)
220#
221# CONFIG_IP_DCCP is not set
222
223#
224# SCTP Configuration (EXPERIMENTAL)
225#
226# CONFIG_IP_SCTP is not set
227# CONFIG_ATM is not set
228# CONFIG_BRIDGE is not set
229# CONFIG_VLAN_8021Q is not set
230# CONFIG_DECNET is not set
231# CONFIG_LLC2 is not set
232# CONFIG_IPX is not set
233# CONFIG_ATALK is not set
234# CONFIG_X25 is not set
235# CONFIG_LAPB is not set
236
237#
238# TIPC Configuration (EXPERIMENTAL)
239#
240# CONFIG_TIPC is not set
241# CONFIG_NET_DIVERT is not set
242# CONFIG_ECONET is not set
243# CONFIG_WAN_ROUTER is not set
244
245#
246# QoS and/or fair queueing
247#
248# CONFIG_NET_SCHED is not set
249
250#
251# Network testing
252#
253# CONFIG_NET_PKTGEN is not set
254# CONFIG_HAMRADIO is not set
255# CONFIG_IRDA is not set
256# CONFIG_BT is not set
257# CONFIG_IEEE80211 is not set
258
259#
260# Device Drivers
261#
262
263#
264# Generic Driver Options
265#
266CONFIG_STANDALONE=y
267CONFIG_PREVENT_FIRMWARE_BUILD=y
268# CONFIG_FW_LOADER is not set
269# CONFIG_DEBUG_DRIVER is not set
270
271#
272# Connector - unified userspace <-> kernelspace linker
273#
274# CONFIG_CONNECTOR is not set
275
276#
277# Memory Technology Devices (MTD)
278#
279# CONFIG_MTD is not set
280
281#
282# Parallel port support
283#
284# CONFIG_PARPORT is not set
285
286#
287# Plug and Play support
288#
289
290#
291# Block devices
292#
293# CONFIG_BLK_DEV_FD is not set
294# CONFIG_BLK_DEV_COW_COMMON is not set
295# CONFIG_BLK_DEV_LOOP is not set
296# CONFIG_BLK_DEV_NBD is not set
297CONFIG_BLK_DEV_RAM=y
298CONFIG_BLK_DEV_RAM_COUNT=16
299CONFIG_BLK_DEV_RAM_SIZE=65536
300CONFIG_BLK_DEV_INITRD=y
301# CONFIG_CDROM_PKTCDVD is not set
302# CONFIG_ATA_OVER_ETH is not set
303
304#
305# ATA/ATAPI/MFM/RLL support
306#
307# CONFIG_IDE is not set
308
309#
310# SCSI device support
311#
312# CONFIG_RAID_ATTRS is not set
313# CONFIG_SCSI is not set
314
315#
316# Multi-device support (RAID and LVM)
317#
318# CONFIG_MD is not set
319
320#
321# Fusion MPT device support
322#
323# CONFIG_FUSION is not set
324
325#
326# IEEE 1394 (FireWire) support
327#
328
329#
330# I2O device support
331#
332
333#
334# Macintosh device drivers
335#
336# CONFIG_WINDFARM is not set
337
338#
339# Network device support
340#
341CONFIG_NETDEVICES=y
342# CONFIG_DUMMY is not set
343# CONFIG_BONDING is not set
344# CONFIG_EQUALIZER is not set
345CONFIG_TUN=y
346
347#
348# PHY device support
349#
350
351#
352# Ethernet (10 or 100Mbit)
353#
354# CONFIG_NET_ETHERNET is not set
355# CONFIG_IBM_EMAC is not set
356
357#
358# Ethernet (1000 Mbit)
359#
360
361#
362# Ethernet (10000 Mbit)
363#
364
365#
366# Token Ring devices
367#
368
369#
370# Wireless LAN (non-hamradio)
371#
372# CONFIG_NET_RADIO is not set
373
374#
375# Wan interfaces
376#
377# CONFIG_WAN is not set
378# CONFIG_PPP is not set
379# CONFIG_SLIP is not set
380# CONFIG_SHAPER is not set
381# CONFIG_NETCONSOLE is not set
382# CONFIG_NETPOLL is not set
383# CONFIG_NET_POLL_CONTROLLER is not set
384
385#
386# ISDN subsystem
387#
388# CONFIG_ISDN is not set
389
390#
391# Telephony Support
392#
393# CONFIG_PHONE is not set
394
395#
396# Input device support
397#
398CONFIG_INPUT=y
399
400#
401# Userland interfaces
402#
403CONFIG_INPUT_MOUSEDEV=y
404# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
405CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
406CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
407# CONFIG_INPUT_JOYDEV is not set
408# CONFIG_INPUT_TSDEV is not set
409# CONFIG_INPUT_EVDEV is not set
410# CONFIG_INPUT_EVBUG is not set
411
412#
413# Input Device Drivers
414#
415# CONFIG_INPUT_KEYBOARD is not set
416# CONFIG_INPUT_MOUSE is not set
417# CONFIG_INPUT_JOYSTICK is not set
418# CONFIG_INPUT_TOUCHSCREEN is not set
419# CONFIG_INPUT_MISC is not set
420
421#
422# Hardware I/O ports
423#
424# CONFIG_SERIO is not set
425# CONFIG_GAMEPORT is not set
426
427#
428# Character devices
429#
430CONFIG_VT=y
431CONFIG_VT_CONSOLE=y
432CONFIG_HW_CONSOLE=y
433# CONFIG_SERIAL_NONSTANDARD is not set
434
435#
436# Serial drivers
437#
438CONFIG_SERIAL_8250=y
439CONFIG_SERIAL_8250_CONSOLE=y
440CONFIG_SERIAL_8250_NR_UARTS=4
441CONFIG_SERIAL_8250_RUNTIME_UARTS=4
442# CONFIG_SERIAL_8250_EXTENDED is not set
443
444#
445# Non-8250 serial port support
446#
447CONFIG_SERIAL_CORE=y
448CONFIG_SERIAL_CORE_CONSOLE=y
449CONFIG_UNIX98_PTYS=y
450# CONFIG_LEGACY_PTYS is not set
451
452#
453# IPMI
454#
455# CONFIG_IPMI_HANDLER is not set
456
457#
458# Watchdog Cards
459#
460# CONFIG_WATCHDOG is not set
461# CONFIG_NVRAM is not set
462# CONFIG_GEN_RTC is not set
463# CONFIG_DTLK is not set
464# CONFIG_R3964 is not set
465
466#
467# Ftape, the floppy tape device driver
468#
469# CONFIG_AGP is not set
470# CONFIG_RAW_DRIVER is not set
471
472#
473# TPM devices
474#
475# CONFIG_TCG_TPM is not set
476# CONFIG_TELCLOCK is not set
477
478#
479# I2C support
480#
481# CONFIG_I2C is not set
482
483#
484# SPI support
485#
486# CONFIG_SPI is not set
487# CONFIG_SPI_MASTER is not set
488
489#
490# Dallas's 1-wire bus
491#
492# CONFIG_W1 is not set
493
494#
495# Hardware Monitoring support
496#
497# CONFIG_HWMON is not set
498# CONFIG_HWMON_VID is not set
499
500#
501# Misc devices
502#
503
504#
505# Multimedia Capabilities Port drivers
506#
507
508#
509# Multimedia devices
510#
511# CONFIG_VIDEO_DEV is not set
512
513#
514# Digital Video Broadcasting Devices
515#
516# CONFIG_DVB is not set
517
518#
519# Graphics support
520#
521# CONFIG_FB is not set
522
523#
524# Console display driver support
525#
526CONFIG_DUMMY_CONSOLE=y
527
528#
529# Sound
530#
531# CONFIG_SOUND is not set
532
533#
534# USB support
535#
536# CONFIG_USB_ARCH_HAS_HCD is not set
537# CONFIG_USB_ARCH_HAS_OHCI is not set
538
539#
540# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
541#
542
543#
544# USB Gadget Support
545#
546# CONFIG_USB_GADGET is not set
547
548#
549# MMC/SD Card support
550#
551# CONFIG_MMC is not set
552
553#
554# InfiniBand support
555#
556
557#
558# SN Devices
559#
560
561#
562# File systems
563#
564CONFIG_EXT2_FS=y
565# CONFIG_EXT2_FS_XATTR is not set
566# CONFIG_EXT2_FS_XIP is not set
567# CONFIG_EXT3_FS is not set
568# CONFIG_REISERFS_FS is not set
569# CONFIG_JFS_FS is not set
570# CONFIG_FS_POSIX_ACL is not set
571# CONFIG_XFS_FS is not set
572# CONFIG_OCFS2_FS is not set
573# CONFIG_MINIX_FS is not set
574# CONFIG_ROMFS_FS is not set
575CONFIG_INOTIFY=y
576# CONFIG_QUOTA is not set
577CONFIG_DNOTIFY=y
578# CONFIG_AUTOFS_FS is not set
579# CONFIG_AUTOFS4_FS is not set
580# CONFIG_FUSE_FS is not set
581
582#
583# CD-ROM/DVD Filesystems
584#
585# CONFIG_ISO9660_FS is not set
586# CONFIG_UDF_FS is not set
587
588#
589# DOS/FAT/NT Filesystems
590#
591CONFIG_FAT_FS=y
592CONFIG_MSDOS_FS=y
593CONFIG_VFAT_FS=y
594CONFIG_FAT_DEFAULT_CODEPAGE=437
595CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
596# CONFIG_NTFS_FS is not set
597
598#
599# Pseudo filesystems
600#
601CONFIG_PROC_FS=y
602CONFIG_PROC_KCORE=y
603CONFIG_SYSFS=y
604CONFIG_TMPFS=y
605# CONFIG_HUGETLB_PAGE is not set
606CONFIG_RAMFS=y
607# CONFIG_RELAYFS_FS is not set
608# CONFIG_CONFIGFS_FS is not set
609
610#
611# Miscellaneous filesystems
612#
613# CONFIG_ADFS_FS is not set
614# CONFIG_AFFS_FS is not set
615# CONFIG_HFS_FS is not set
616# CONFIG_HFSPLUS_FS is not set
617# CONFIG_BEFS_FS is not set
618# CONFIG_BFS_FS is not set
619# CONFIG_EFS_FS is not set
620# CONFIG_CRAMFS is not set
621# CONFIG_VXFS_FS is not set
622# CONFIG_HPFS_FS is not set
623# CONFIG_QNX4FS_FS is not set
624# CONFIG_SYSV_FS is not set
625# CONFIG_UFS_FS is not set
626
627#
628# Network File Systems
629#
630# CONFIG_NFS_FS is not set
631# CONFIG_NFSD is not set
632# CONFIG_SMB_FS is not set
633# CONFIG_CIFS is not set
634# CONFIG_NCP_FS is not set
635# CONFIG_CODA_FS is not set
636# CONFIG_AFS_FS is not set
637# CONFIG_9P_FS is not set
638
639#
640# Partition Types
641#
642# CONFIG_PARTITION_ADVANCED is not set
643CONFIG_MSDOS_PARTITION=y
644
645#
646# Native Language Support
647#
648CONFIG_NLS=y
649CONFIG_NLS_DEFAULT="iso8859-1"
650CONFIG_NLS_CODEPAGE_437=y
651# CONFIG_NLS_CODEPAGE_737 is not set
652# CONFIG_NLS_CODEPAGE_775 is not set
653# CONFIG_NLS_CODEPAGE_850 is not set
654# CONFIG_NLS_CODEPAGE_852 is not set
655# CONFIG_NLS_CODEPAGE_855 is not set
656# CONFIG_NLS_CODEPAGE_857 is not set
657# CONFIG_NLS_CODEPAGE_860 is not set
658# CONFIG_NLS_CODEPAGE_861 is not set
659# CONFIG_NLS_CODEPAGE_862 is not set
660# CONFIG_NLS_CODEPAGE_863 is not set
661# CONFIG_NLS_CODEPAGE_864 is not set
662# CONFIG_NLS_CODEPAGE_865 is not set
663# CONFIG_NLS_CODEPAGE_866 is not set
664# CONFIG_NLS_CODEPAGE_869 is not set
665# CONFIG_NLS_CODEPAGE_936 is not set
666# CONFIG_NLS_CODEPAGE_950 is not set
667# CONFIG_NLS_CODEPAGE_932 is not set
668# CONFIG_NLS_CODEPAGE_949 is not set
669# CONFIG_NLS_CODEPAGE_874 is not set
670# CONFIG_NLS_ISO8859_8 is not set
671# CONFIG_NLS_CODEPAGE_1250 is not set
672# CONFIG_NLS_CODEPAGE_1251 is not set
673CONFIG_NLS_ASCII=y
674CONFIG_NLS_ISO8859_1=y
675# CONFIG_NLS_ISO8859_2 is not set
676# CONFIG_NLS_ISO8859_3 is not set
677# CONFIG_NLS_ISO8859_4 is not set
678# CONFIG_NLS_ISO8859_5 is not set
679# CONFIG_NLS_ISO8859_6 is not set
680# CONFIG_NLS_ISO8859_7 is not set
681# CONFIG_NLS_ISO8859_9 is not set
682# CONFIG_NLS_ISO8859_13 is not set
683# CONFIG_NLS_ISO8859_14 is not set
684# CONFIG_NLS_ISO8859_15 is not set
685# CONFIG_NLS_KOI8_R is not set
686# CONFIG_NLS_KOI8_U is not set
687CONFIG_NLS_UTF8=y
688
689#
690# IBM 40x options
691#
692
693#
694# Library routines
695#
696# CONFIG_CRC_CCITT is not set
697# CONFIG_CRC16 is not set
698CONFIG_CRC32=y
699# CONFIG_LIBCRC32C is not set
700# CONFIG_PROFILING is not set
701
702#
703# Kernel hacking
704#
705CONFIG_PRINTK_TIME=y
706CONFIG_MAGIC_SYSRQ=y
707CONFIG_DEBUG_KERNEL=y
708CONFIG_LOG_BUF_SHIFT=14
709CONFIG_DETECT_SOFTLOCKUP=y
710# CONFIG_SCHEDSTATS is not set
711# CONFIG_DEBUG_SLAB is not set
712CONFIG_DEBUG_MUTEXES=y
713# CONFIG_DEBUG_SPINLOCK is not set
714# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
715# CONFIG_DEBUG_KOBJECT is not set
716CONFIG_DEBUG_INFO=y
717# CONFIG_DEBUG_FS is not set
718# CONFIG_DEBUG_VM is not set
719CONFIG_FORCED_INLINING=y
720# CONFIG_RCU_TORTURE_TEST is not set
721# CONFIG_KGDB is not set
722# CONFIG_XMON is not set
723# CONFIG_BDI_SWITCH is not set
724# CONFIG_SERIAL_TEXT_DEBUG is not set
725
726#
727# Security options
728#
729# CONFIG_KEYS is not set
730# CONFIG_SECURITY is not set
731
732#
733# Cryptographic options
734#
735# CONFIG_CRYPTO is not set
736
737#
738# Hardware crypto devices
739#
diff --git a/arch/ppc/configs/ml403_defconfig b/arch/ppc/configs/ml403_defconfig
deleted file mode 100644
index 71bcfa7ab7f7..000000000000
--- a/arch/ppc/configs/ml403_defconfig
+++ /dev/null
@@ -1,740 +0,0 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16-rc1
4# Wed Jan 18 01:11:41 2006
5#
6CONFIG_MMU=y
7CONFIG_GENERIC_HARDIRQS=y
8CONFIG_RWSEM_XCHGADD_ALGORITHM=y
9CONFIG_GENERIC_CALIBRATE_DELAY=y
10CONFIG_PPC=y
11CONFIG_PPC32=y
12CONFIG_GENERIC_NVRAM=y
13CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
14CONFIG_ARCH_MAY_HAVE_PC_FDC=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_LOCALVERSION_AUTO=y
29# CONFIG_SWAP is not set
30CONFIG_SYSVIPC=y
31# CONFIG_POSIX_MQUEUE is not set
32CONFIG_BSD_PROCESS_ACCT=y
33CONFIG_BSD_PROCESS_ACCT_V3=y
34CONFIG_SYSCTL=y
35# CONFIG_AUDIT is not set
36# CONFIG_IKCONFIG is not set
37CONFIG_INITRAMFS_SOURCE=""
38CONFIG_CC_OPTIMIZE_FOR_SIZE=y
39# CONFIG_EMBEDDED is not set
40CONFIG_KALLSYMS=y
41# CONFIG_KALLSYMS_ALL is not set
42# CONFIG_KALLSYMS_EXTRA_PASS is not set
43CONFIG_HOTPLUG=y
44CONFIG_PRINTK=y
45CONFIG_BUG=y
46CONFIG_ELF_CORE=y
47CONFIG_BASE_FULL=y
48CONFIG_FUTEX=y
49CONFIG_EPOLL=y
50CONFIG_SHMEM=y
51CONFIG_CC_ALIGN_FUNCTIONS=0
52CONFIG_CC_ALIGN_LABELS=0
53CONFIG_CC_ALIGN_LOOPS=0
54CONFIG_CC_ALIGN_JUMPS=0
55CONFIG_SLAB=y
56# CONFIG_TINY_SHMEM is not set
57CONFIG_BASE_SMALL=0
58# CONFIG_SLOB is not set
59
60#
61# Loadable module support
62#
63CONFIG_MODULES=y
64CONFIG_MODULE_UNLOAD=y
65CONFIG_MODULE_FORCE_UNLOAD=y
66CONFIG_OBSOLETE_MODPARM=y
67CONFIG_MODVERSIONS=y
68CONFIG_MODULE_SRCVERSION_ALL=y
69CONFIG_KMOD=y
70
71#
72# Block layer
73#
74CONFIG_LBD=y
75
76#
77# IO Schedulers
78#
79CONFIG_IOSCHED_NOOP=y
80CONFIG_IOSCHED_AS=y
81CONFIG_IOSCHED_DEADLINE=y
82CONFIG_IOSCHED_CFQ=y
83CONFIG_DEFAULT_AS=y
84# CONFIG_DEFAULT_DEADLINE is not set
85# CONFIG_DEFAULT_CFQ is not set
86# CONFIG_DEFAULT_NOOP is not set
87CONFIG_DEFAULT_IOSCHED="anticipatory"
88
89#
90# Processor
91#
92# CONFIG_6xx is not set
93CONFIG_40x=y
94# CONFIG_44x is not set
95# CONFIG_POWER3 is not set
96# CONFIG_8xx is not set
97# CONFIG_E200 is not set
98# CONFIG_E500 is not set
99# CONFIG_MATH_EMULATION is not set
100# CONFIG_KEXEC is not set
101# CONFIG_CPU_FREQ is not set
102CONFIG_4xx=y
103# CONFIG_WANT_EARLY_SERIAL is not set
104
105#
106# IBM 4xx options
107#
108# CONFIG_BUBINGA is not set
109# CONFIG_CPCI405 is not set
110# CONFIG_EP405 is not set
111# CONFIG_REDWOOD_5 is not set
112# CONFIG_REDWOOD_6 is not set
113# CONFIG_SYCAMORE is not set
114# CONFIG_WALNUT is not set
115# CONFIG_XILINX_ML300 is not set
116CONFIG_XILINX_ML403=y
117CONFIG_IBM405_ERR77=y
118CONFIG_IBM405_ERR51=y
119CONFIG_XILINX_VIRTEX=y
120CONFIG_EMBEDDEDBOOT=y
121# CONFIG_PPC4xx_DMA is not set
122CONFIG_PPC_GEN550=y
123CONFIG_UART0_TTYS0=y
124# CONFIG_UART0_TTYS1 is not set
125CONFIG_NOT_COHERENT_CACHE=y
126
127#
128# Platform options
129#
130# CONFIG_PC_KEYBOARD is not set
131# CONFIG_HIGHMEM is not set
132# CONFIG_HZ_100 is not set
133CONFIG_HZ_250=y
134# CONFIG_HZ_1000 is not set
135CONFIG_HZ=250
136CONFIG_PREEMPT_NONE=y
137# CONFIG_PREEMPT_VOLUNTARY is not set
138# CONFIG_PREEMPT is not set
139CONFIG_SELECT_MEMORY_MODEL=y
140CONFIG_FLATMEM_MANUAL=y
141# CONFIG_DISCONTIGMEM_MANUAL is not set
142# CONFIG_SPARSEMEM_MANUAL is not set
143CONFIG_FLATMEM=y
144CONFIG_FLAT_NODE_MEM_MAP=y
145# CONFIG_SPARSEMEM_STATIC is not set
146CONFIG_SPLIT_PTLOCK_CPUS=4
147CONFIG_BINFMT_ELF=y
148# CONFIG_BINFMT_MISC is not set
149CONFIG_CMDLINE_BOOL=y
150CONFIG_CMDLINE="console=ttyS0,9600"
151# CONFIG_PM is not set
152# CONFIG_HIBERNATION is not set
153CONFIG_SECCOMP=y
154CONFIG_ISA_DMA_API=y
155
156#
157# Bus options
158#
159# CONFIG_PPC_I8259 is not set
160# CONFIG_PCI is not set
161# CONFIG_PCI_DOMAINS is not set
162
163#
164# PCCARD (PCMCIA/CardBus) support
165#
166# CONFIG_PCCARD is not set
167
168#
169# Advanced setup
170#
171# CONFIG_ADVANCED_OPTIONS is not set
172
173#
174# Default settings for advanced configuration options are used
175#
176CONFIG_HIGHMEM_START=0xfe000000
177CONFIG_LOWMEM_SIZE=0x30000000
178CONFIG_KERNEL_START=0xc0000000
179CONFIG_TASK_SIZE=0x80000000
180CONFIG_CONSISTENT_START=0xff100000
181CONFIG_CONSISTENT_SIZE=0x00200000
182CONFIG_BOOT_LOAD=0x00400000
183
184#
185# Networking
186#
187CONFIG_NET=y
188
189#
190# Networking options
191#
192CONFIG_PACKET=y
193CONFIG_PACKET_MMAP=y
194CONFIG_UNIX=y
195# CONFIG_NET_KEY is not set
196CONFIG_INET=y
197# CONFIG_IP_MULTICAST is not set
198# CONFIG_IP_ADVANCED_ROUTER is not set
199CONFIG_IP_FIB_HASH=y
200CONFIG_IP_PNP=y
201CONFIG_IP_PNP_DHCP=y
202# CONFIG_IP_PNP_BOOTP is not set
203# CONFIG_IP_PNP_RARP is not set
204# CONFIG_NET_IPIP is not set
205# CONFIG_NET_IPGRE is not set
206# CONFIG_ARPD is not set
207# CONFIG_SYN_COOKIES is not set
208# CONFIG_INET_AH is not set
209# CONFIG_INET_ESP is not set
210# CONFIG_INET_IPCOMP is not set
211# CONFIG_INET_TUNNEL is not set
212CONFIG_INET_DIAG=y
213CONFIG_INET_TCP_DIAG=y
214# CONFIG_TCP_CONG_ADVANCED is not set
215CONFIG_TCP_CONG_BIC=y
216# CONFIG_IPV6 is not set
217# CONFIG_NETFILTER is not set
218
219#
220# DCCP Configuration (EXPERIMENTAL)
221#
222# CONFIG_IP_DCCP is not set
223
224#
225# SCTP Configuration (EXPERIMENTAL)
226#
227# CONFIG_IP_SCTP is not set
228# CONFIG_ATM is not set
229# CONFIG_BRIDGE is not set
230# CONFIG_VLAN_8021Q is not set
231# CONFIG_DECNET is not set
232# CONFIG_LLC2 is not set
233# CONFIG_IPX is not set
234# CONFIG_ATALK is not set
235# CONFIG_X25 is not set
236# CONFIG_LAPB is not set
237
238#
239# TIPC Configuration (EXPERIMENTAL)
240#
241# CONFIG_TIPC is not set
242# CONFIG_NET_DIVERT is not set
243# CONFIG_ECONET is not set
244# CONFIG_WAN_ROUTER is not set
245
246#
247# QoS and/or fair queueing
248#
249# CONFIG_NET_SCHED is not set
250
251#
252# Network testing
253#
254# CONFIG_NET_PKTGEN is not set
255# CONFIG_HAMRADIO is not set
256# CONFIG_IRDA is not set
257# CONFIG_BT is not set
258# CONFIG_IEEE80211 is not set
259
260#
261# Device Drivers
262#
263
264#
265# Generic Driver Options
266#
267CONFIG_STANDALONE=y
268CONFIG_PREVENT_FIRMWARE_BUILD=y
269# CONFIG_FW_LOADER is not set
270# CONFIG_DEBUG_DRIVER is not set
271
272#
273# Connector - unified userspace <-> kernelspace linker
274#
275# CONFIG_CONNECTOR is not set
276
277#
278# Memory Technology Devices (MTD)
279#
280# CONFIG_MTD is not set
281
282#
283# Parallel port support
284#
285# CONFIG_PARPORT is not set
286
287#
288# Plug and Play support
289#
290
291#
292# Block devices
293#
294# CONFIG_BLK_DEV_FD is not set
295# CONFIG_BLK_DEV_COW_COMMON is not set
296# CONFIG_BLK_DEV_LOOP is not set
297# CONFIG_BLK_DEV_NBD is not set
298CONFIG_BLK_DEV_RAM=y
299CONFIG_BLK_DEV_RAM_COUNT=16
300CONFIG_BLK_DEV_RAM_SIZE=65536
301CONFIG_BLK_DEV_INITRD=y
302# CONFIG_CDROM_PKTCDVD is not set
303# CONFIG_ATA_OVER_ETH is not set
304
305#
306# ATA/ATAPI/MFM/RLL support
307#
308# CONFIG_IDE is not set
309
310#
311# SCSI device support
312#
313# CONFIG_RAID_ATTRS is not set
314# CONFIG_SCSI is not set
315
316#
317# Multi-device support (RAID and LVM)
318#
319# CONFIG_MD is not set
320
321#
322# Fusion MPT device support
323#
324# CONFIG_FUSION is not set
325
326#
327# IEEE 1394 (FireWire) support
328#
329
330#
331# I2O device support
332#
333
334#
335# Macintosh device drivers
336#
337# CONFIG_WINDFARM is not set
338
339#
340# Network device support
341#
342CONFIG_NETDEVICES=y
343# CONFIG_DUMMY is not set
344# CONFIG_BONDING is not set
345# CONFIG_EQUALIZER is not set
346CONFIG_TUN=y
347
348#
349# PHY device support
350#
351
352#
353# Ethernet (10 or 100Mbit)
354#
355# CONFIG_NET_ETHERNET is not set
356# CONFIG_IBM_EMAC is not set
357
358#
359# Ethernet (1000 Mbit)
360#
361
362#
363# Ethernet (10000 Mbit)
364#
365
366#
367# Token Ring devices
368#
369
370#
371# Wireless LAN (non-hamradio)
372#
373# CONFIG_NET_RADIO is not set
374
375#
376# Wan interfaces
377#
378# CONFIG_WAN is not set
379# CONFIG_PPP is not set
380# CONFIG_SLIP is not set
381# CONFIG_SHAPER is not set
382# CONFIG_NETCONSOLE is not set
383# CONFIG_NETPOLL is not set
384# CONFIG_NET_POLL_CONTROLLER is not set
385
386#
387# ISDN subsystem
388#
389# CONFIG_ISDN is not set
390
391#
392# Telephony Support
393#
394# CONFIG_PHONE is not set
395
396#
397# Input device support
398#
399CONFIG_INPUT=y
400
401#
402# Userland interfaces
403#
404CONFIG_INPUT_MOUSEDEV=y
405# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
406CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
407CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
408# CONFIG_INPUT_JOYDEV is not set
409# CONFIG_INPUT_TSDEV is not set
410# CONFIG_INPUT_EVDEV is not set
411# CONFIG_INPUT_EVBUG is not set
412
413#
414# Input Device Drivers
415#
416# CONFIG_INPUT_KEYBOARD is not set
417# CONFIG_INPUT_MOUSE is not set
418# CONFIG_INPUT_JOYSTICK is not set
419# CONFIG_INPUT_TOUCHSCREEN is not set
420# CONFIG_INPUT_MISC is not set
421
422#
423# Hardware I/O ports
424#
425# CONFIG_SERIO is not set
426# CONFIG_GAMEPORT is not set
427
428#
429# Character devices
430#
431CONFIG_VT=y
432CONFIG_VT_CONSOLE=y
433CONFIG_HW_CONSOLE=y
434# CONFIG_SERIAL_NONSTANDARD is not set
435
436#
437# Serial drivers
438#
439CONFIG_SERIAL_8250=y
440CONFIG_SERIAL_8250_CONSOLE=y
441CONFIG_SERIAL_8250_NR_UARTS=4
442CONFIG_SERIAL_8250_RUNTIME_UARTS=4
443# CONFIG_SERIAL_8250_EXTENDED is not set
444
445#
446# Non-8250 serial port support
447#
448CONFIG_SERIAL_CORE=y
449CONFIG_SERIAL_CORE_CONSOLE=y
450CONFIG_UNIX98_PTYS=y
451# CONFIG_LEGACY_PTYS is not set
452
453#
454# IPMI
455#
456# CONFIG_IPMI_HANDLER is not set
457
458#
459# Watchdog Cards
460#
461# CONFIG_WATCHDOG is not set
462# CONFIG_NVRAM is not set
463# CONFIG_GEN_RTC is not set
464# CONFIG_DTLK is not set
465# CONFIG_R3964 is not set
466
467#
468# Ftape, the floppy tape device driver
469#
470# CONFIG_AGP is not set
471# CONFIG_RAW_DRIVER is not set
472
473#
474# TPM devices
475#
476# CONFIG_TCG_TPM is not set
477# CONFIG_TELCLOCK is not set
478
479#
480# I2C support
481#
482# CONFIG_I2C is not set
483
484#
485# SPI support
486#
487# CONFIG_SPI is not set
488# CONFIG_SPI_MASTER is not set
489
490#
491# Dallas's 1-wire bus
492#
493# CONFIG_W1 is not set
494
495#
496# Hardware Monitoring support
497#
498# CONFIG_HWMON is not set
499# CONFIG_HWMON_VID is not set
500
501#
502# Misc devices
503#
504
505#
506# Multimedia Capabilities Port drivers
507#
508
509#
510# Multimedia devices
511#
512# CONFIG_VIDEO_DEV is not set
513
514#
515# Digital Video Broadcasting Devices
516#
517# CONFIG_DVB is not set
518
519#
520# Graphics support
521#
522# CONFIG_FB is not set
523
524#
525# Console display driver support
526#
527CONFIG_DUMMY_CONSOLE=y
528
529#
530# Sound
531#
532# CONFIG_SOUND is not set
533
534#
535# USB support
536#
537# CONFIG_USB_ARCH_HAS_HCD is not set
538# CONFIG_USB_ARCH_HAS_OHCI is not set
539
540#
541# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
542#
543
544#
545# USB Gadget Support
546#
547# CONFIG_USB_GADGET is not set
548
549#
550# MMC/SD Card support
551#
552# CONFIG_MMC is not set
553
554#
555# InfiniBand support
556#
557
558#
559# SN Devices
560#
561
562#
563# File systems
564#
565CONFIG_EXT2_FS=y
566# CONFIG_EXT2_FS_XATTR is not set
567# CONFIG_EXT2_FS_XIP is not set
568# CONFIG_EXT3_FS is not set
569# CONFIG_REISERFS_FS is not set
570# CONFIG_JFS_FS is not set
571# CONFIG_FS_POSIX_ACL is not set
572# CONFIG_XFS_FS is not set
573# CONFIG_OCFS2_FS is not set
574# CONFIG_MINIX_FS is not set
575# CONFIG_ROMFS_FS is not set
576CONFIG_INOTIFY=y
577# CONFIG_QUOTA is not set
578CONFIG_DNOTIFY=y
579# CONFIG_AUTOFS_FS is not set
580# CONFIG_AUTOFS4_FS is not set
581# CONFIG_FUSE_FS is not set
582
583#
584# CD-ROM/DVD Filesystems
585#
586# CONFIG_ISO9660_FS is not set
587# CONFIG_UDF_FS is not set
588
589#
590# DOS/FAT/NT Filesystems
591#
592CONFIG_FAT_FS=y
593CONFIG_MSDOS_FS=y
594CONFIG_VFAT_FS=y
595CONFIG_FAT_DEFAULT_CODEPAGE=437
596CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
597# CONFIG_NTFS_FS is not set
598
599#
600# Pseudo filesystems
601#
602CONFIG_PROC_FS=y
603CONFIG_PROC_KCORE=y
604CONFIG_SYSFS=y
605CONFIG_TMPFS=y
606# CONFIG_HUGETLB_PAGE is not set
607CONFIG_RAMFS=y
608# CONFIG_RELAYFS_FS is not set
609# CONFIG_CONFIGFS_FS is not set
610
611#
612# Miscellaneous filesystems
613#
614# CONFIG_ADFS_FS is not set
615# CONFIG_AFFS_FS is not set
616# CONFIG_HFS_FS is not set
617# CONFIG_HFSPLUS_FS is not set
618# CONFIG_BEFS_FS is not set
619# CONFIG_BFS_FS is not set
620# CONFIG_EFS_FS is not set
621# CONFIG_CRAMFS is not set
622# CONFIG_VXFS_FS is not set
623# CONFIG_HPFS_FS is not set
624# CONFIG_QNX4FS_FS is not set
625# CONFIG_SYSV_FS is not set
626# CONFIG_UFS_FS is not set
627
628#
629# Network File Systems
630#
631# CONFIG_NFS_FS is not set
632# CONFIG_NFSD is not set
633# CONFIG_SMB_FS is not set
634# CONFIG_CIFS is not set
635# CONFIG_NCP_FS is not set
636# CONFIG_CODA_FS is not set
637# CONFIG_AFS_FS is not set
638# CONFIG_9P_FS is not set
639
640#
641# Partition Types
642#
643# CONFIG_PARTITION_ADVANCED is not set
644CONFIG_MSDOS_PARTITION=y
645
646#
647# Native Language Support
648#
649CONFIG_NLS=y
650CONFIG_NLS_DEFAULT="iso8859-1"
651CONFIG_NLS_CODEPAGE_437=y
652# CONFIG_NLS_CODEPAGE_737 is not set
653# CONFIG_NLS_CODEPAGE_775 is not set
654# CONFIG_NLS_CODEPAGE_850 is not set
655# CONFIG_NLS_CODEPAGE_852 is not set
656# CONFIG_NLS_CODEPAGE_855 is not set
657# CONFIG_NLS_CODEPAGE_857 is not set
658# CONFIG_NLS_CODEPAGE_860 is not set
659# CONFIG_NLS_CODEPAGE_861 is not set
660# CONFIG_NLS_CODEPAGE_862 is not set
661# CONFIG_NLS_CODEPAGE_863 is not set
662# CONFIG_NLS_CODEPAGE_864 is not set
663# CONFIG_NLS_CODEPAGE_865 is not set
664# CONFIG_NLS_CODEPAGE_866 is not set
665# CONFIG_NLS_CODEPAGE_869 is not set
666# CONFIG_NLS_CODEPAGE_936 is not set
667# CONFIG_NLS_CODEPAGE_950 is not set
668# CONFIG_NLS_CODEPAGE_932 is not set
669# CONFIG_NLS_CODEPAGE_949 is not set
670# CONFIG_NLS_CODEPAGE_874 is not set
671# CONFIG_NLS_ISO8859_8 is not set
672# CONFIG_NLS_CODEPAGE_1250 is not set
673# CONFIG_NLS_CODEPAGE_1251 is not set
674CONFIG_NLS_ASCII=y
675CONFIG_NLS_ISO8859_1=y
676# CONFIG_NLS_ISO8859_2 is not set
677# CONFIG_NLS_ISO8859_3 is not set
678# CONFIG_NLS_ISO8859_4 is not set
679# CONFIG_NLS_ISO8859_5 is not set
680# CONFIG_NLS_ISO8859_6 is not set
681# CONFIG_NLS_ISO8859_7 is not set
682# CONFIG_NLS_ISO8859_9 is not set
683# CONFIG_NLS_ISO8859_13 is not set
684# CONFIG_NLS_ISO8859_14 is not set
685# CONFIG_NLS_ISO8859_15 is not set
686# CONFIG_NLS_KOI8_R is not set
687# CONFIG_NLS_KOI8_U is not set
688CONFIG_NLS_UTF8=y
689
690#
691# IBM 40x options
692#
693
694#
695# Library routines
696#
697# CONFIG_CRC_CCITT is not set
698# CONFIG_CRC16 is not set
699CONFIG_CRC32=y
700# CONFIG_LIBCRC32C is not set
701# CONFIG_PROFILING is not set
702
703#
704# Kernel hacking
705#
706CONFIG_PRINTK_TIME=y
707CONFIG_MAGIC_SYSRQ=y
708CONFIG_DEBUG_KERNEL=y
709CONFIG_LOG_BUF_SHIFT=14
710CONFIG_DETECT_SOFTLOCKUP=y
711# CONFIG_SCHEDSTATS is not set
712# CONFIG_DEBUG_SLAB is not set
713CONFIG_DEBUG_MUTEXES=y
714# CONFIG_DEBUG_SPINLOCK is not set
715# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
716# CONFIG_DEBUG_KOBJECT is not set
717CONFIG_DEBUG_INFO=y
718# CONFIG_DEBUG_FS is not set
719# CONFIG_DEBUG_VM is not set
720CONFIG_FORCED_INLINING=y
721# CONFIG_RCU_TORTURE_TEST is not set
722# CONFIG_KGDB is not set
723# CONFIG_XMON is not set
724# CONFIG_BDI_SWITCH is not set
725# CONFIG_SERIAL_TEXT_DEBUG is not set
726
727#
728# Security options
729#
730# CONFIG_KEYS is not set
731# CONFIG_SECURITY is not set
732
733#
734# Cryptographic options
735#
736# CONFIG_CRYPTO is not set
737
738#
739# Hardware crypto devices
740#
diff --git a/arch/ppc/configs/mvme5100_defconfig b/arch/ppc/configs/mvme5100_defconfig
deleted file mode 100644
index 46776b9c1a33..000000000000
--- a/arch/ppc/configs/mvme5100_defconfig
+++ /dev/null
@@ -1,746 +0,0 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.9-rc2
4# Wed Sep 22 09:53:26 2004
5#
6CONFIG_MMU=y
7CONFIG_RWSEM_XCHGADD_ALGORITHM=y
8CONFIG_HAVE_DEC_LOCK=y
9CONFIG_PPC=y
10CONFIG_PPC32=y
11CONFIG_GENERIC_NVRAM=y
12CONFIG_GENERIC_IOMAP=y
13
14#
15# Code maturity level options
16#
17CONFIG_EXPERIMENTAL=y
18CONFIG_CLEAN_COMPILE=y
19CONFIG_BROKEN_ON_SMP=y
20
21#
22# General setup
23#
24CONFIG_LOCALVERSION=""
25CONFIG_SWAP=y
26CONFIG_SYSVIPC=y
27# CONFIG_POSIX_MQUEUE is not set
28# CONFIG_BSD_PROCESS_ACCT is not set
29CONFIG_SYSCTL=y
30# CONFIG_AUDIT is not set
31CONFIG_LOG_BUF_SHIFT=14
32# CONFIG_HOTPLUG is not set
33# CONFIG_IKCONFIG is not set
34CONFIG_EMBEDDED=y
35CONFIG_KALLSYMS=y
36# CONFIG_KALLSYMS_EXTRA_PASS is not set
37CONFIG_FUTEX=y
38CONFIG_EPOLL=y
39CONFIG_IOSCHED_NOOP=y
40CONFIG_IOSCHED_AS=y
41CONFIG_IOSCHED_DEADLINE=y
42CONFIG_IOSCHED_CFQ=y
43# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
44CONFIG_SHMEM=y
45# CONFIG_TINY_SHMEM is not set
46
47#
48# Loadable module support
49#
50CONFIG_MODULES=y
51CONFIG_MODULE_UNLOAD=y
52# CONFIG_MODULE_FORCE_UNLOAD is not set
53CONFIG_OBSOLETE_MODPARM=y
54# CONFIG_MODVERSIONS is not set
55CONFIG_KMOD=y
56
57#
58# Processor
59#
60CONFIG_6xx=y
61# CONFIG_40x is not set
62# CONFIG_44x is not set
63# CONFIG_POWER3 is not set
64# CONFIG_POWER4 is not set
65# CONFIG_8xx is not set
66# CONFIG_E500 is not set
67CONFIG_ALTIVEC=y
68# CONFIG_TAU is not set
69# CONFIG_CPU_FREQ is not set
70CONFIG_PPC_STD_MMU=y
71
72#
73# Platform options
74#
75# CONFIG_PPC_MULTIPLATFORM is not set
76# CONFIG_APUS is not set
77# CONFIG_WILLOW is not set
78# CONFIG_PCORE is not set
79# CONFIG_POWERPMC250 is not set
80# CONFIG_EV64260 is not set
81# CONFIG_SPRUCE is not set
82# CONFIG_LOPEC is not set
83# CONFIG_MCPN765 is not set
84CONFIG_MVME5100=y
85# CONFIG_PPLUS is not set
86# CONFIG_PRPMC750 is not set
87# CONFIG_PRPMC800 is not set
88# CONFIG_SANDPOINT is not set
89# CONFIG_ADIR is not set
90# CONFIG_K2 is not set
91# CONFIG_PAL4 is not set
92# CONFIG_GEMINI is not set
93# CONFIG_EST8260 is not set
94# CONFIG_SBC82xx is not set
95# CONFIG_SBS8260 is not set
96# CONFIG_RPX8260 is not set
97# CONFIG_TQM8260 is not set
98# CONFIG_ADS8272 is not set
99# CONFIG_LITE5200 is not set
100# CONFIG_MVME5100_IPMC761_PRESENT is not set
101# CONFIG_SMP is not set
102# CONFIG_PREEMPT is not set
103# CONFIG_HIGHMEM is not set
104CONFIG_BINFMT_ELF=y
105# CONFIG_BINFMT_MISC is not set
106CONFIG_CMDLINE_BOOL=y
107CONFIG_CMDLINE="ip=on"
108
109#
110# Bus options
111#
112CONFIG_GENERIC_ISA_DMA=y
113CONFIG_PCI=y
114CONFIG_PCI_DOMAINS=y
115# CONFIG_PCI_LEGACY_PROC is not set
116# CONFIG_PCI_NAMES is not set
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#
139CONFIG_STANDALONE=y
140CONFIG_PREVENT_FIRMWARE_BUILD=y
141
142#
143# Memory Technology Devices (MTD)
144#
145# CONFIG_MTD is not set
146
147#
148# Parallel port support
149#
150# CONFIG_PARPORT is not set
151
152#
153# Plug and Play support
154#
155
156#
157# Block devices
158#
159# CONFIG_BLK_DEV_FD 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
164# CONFIG_BLK_DEV_LOOP is not set
165# CONFIG_BLK_DEV_NBD is not set
166# CONFIG_BLK_DEV_SX8 is not set
167CONFIG_BLK_DEV_RAM=y
168CONFIG_BLK_DEV_RAM_SIZE=4096
169CONFIG_BLK_DEV_INITRD=y
170# CONFIG_LBD is not set
171
172#
173# ATA/ATAPI/MFM/RLL support
174#
175CONFIG_IDE=y
176CONFIG_BLK_DEV_IDE=y
177
178#
179# Please see Documentation/ide.txt for help/info on IDE drives
180#
181# CONFIG_BLK_DEV_IDE_SATA is not set
182CONFIG_BLK_DEV_IDEDISK=y
183# CONFIG_IDEDISK_MULTI_MODE is not set
184# CONFIG_BLK_DEV_IDECD is not set
185# CONFIG_BLK_DEV_IDETAPE is not set
186# CONFIG_BLK_DEV_IDEFLOPPY is not set
187# CONFIG_BLK_DEV_IDESCSI is not set
188# CONFIG_IDE_TASK_IOCTL is not set
189# CONFIG_IDE_TASKFILE_IO is not set
190
191#
192# IDE chipset support/bugfixes
193#
194CONFIG_IDE_GENERIC=y
195# CONFIG_BLK_DEV_IDEPCI is not set
196# CONFIG_IDE_ARM is not set
197# CONFIG_BLK_DEV_IDEDMA is not set
198# CONFIG_IDEDMA_AUTO is not set
199# CONFIG_BLK_DEV_HD is not set
200
201#
202# SCSI device support
203#
204CONFIG_SCSI=y
205CONFIG_SCSI_PROC_FS=y
206
207#
208# SCSI support type (disk, tape, CD-ROM)
209#
210CONFIG_BLK_DEV_SD=y
211# CONFIG_CHR_DEV_ST is not set
212# CONFIG_CHR_DEV_OSST is not set
213CONFIG_BLK_DEV_SR=y
214# CONFIG_BLK_DEV_SR_VENDOR is not set
215# CONFIG_CHR_DEV_SG is not set
216
217#
218# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
219#
220# CONFIG_SCSI_MULTI_LUN is not set
221# CONFIG_SCSI_CONSTANTS is not set
222# CONFIG_SCSI_LOGGING is not set
223
224#
225# SCSI Transport Attributes
226#
227CONFIG_SCSI_SPI_ATTRS=y
228# CONFIG_SCSI_FC_ATTRS is not set
229
230#
231# SCSI low-level drivers
232#
233# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
234# CONFIG_SCSI_3W_9XXX is not set
235# CONFIG_SCSI_ACARD is not set
236# CONFIG_SCSI_AACRAID is not set
237# CONFIG_SCSI_AIC7XXX is not set
238# CONFIG_SCSI_AIC7XXX_OLD is not set
239# CONFIG_SCSI_AIC79XX is not set
240# CONFIG_SCSI_DPT_I2O is not set
241# CONFIG_MEGARAID_NEWGEN is not set
242# CONFIG_MEGARAID_LEGACY is not set
243# CONFIG_SCSI_SATA is not set
244# CONFIG_SCSI_BUSLOGIC is not set
245# CONFIG_SCSI_DMX3191D is not set
246# CONFIG_SCSI_EATA is not set
247# CONFIG_SCSI_EATA_PIO is not set
248# CONFIG_SCSI_FUTURE_DOMAIN is not set
249# CONFIG_SCSI_GDTH is not set
250# CONFIG_SCSI_IPS is not set
251# CONFIG_SCSI_INIA100 is not set
252CONFIG_SCSI_SYM53C8XX_2=y
253CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=0
254CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=8
255CONFIG_SCSI_SYM53C8XX_MAX_TAGS=32
256# CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set
257# CONFIG_SCSI_IPR is not set
258# CONFIG_SCSI_QLOGIC_ISP is not set
259# CONFIG_SCSI_QLOGIC_FC is not set
260# CONFIG_SCSI_QLOGIC_1280 is not set
261CONFIG_SCSI_QLA2XXX=y
262# CONFIG_SCSI_QLA21XX is not set
263# CONFIG_SCSI_QLA22XX is not set
264# CONFIG_SCSI_QLA2300 is not set
265# CONFIG_SCSI_QLA2322 is not set
266# CONFIG_SCSI_QLA6312 is not set
267# CONFIG_SCSI_QLA6322 is not set
268# CONFIG_SCSI_DC395x is not set
269# CONFIG_SCSI_DC390T is not set
270# CONFIG_SCSI_NSP32 is not set
271# CONFIG_SCSI_DEBUG is not set
272
273#
274# Multi-device support (RAID and LVM)
275#
276# CONFIG_MD is not set
277
278#
279# Fusion MPT device support
280#
281# CONFIG_FUSION is not set
282
283#
284# IEEE 1394 (FireWire) support
285#
286# CONFIG_IEEE1394 is not set
287
288#
289# I2O device support
290#
291# CONFIG_I2O is not set
292
293#
294# Macintosh device drivers
295#
296
297#
298# Networking support
299#
300CONFIG_NET=y
301
302#
303# Networking options
304#
305CONFIG_PACKET=y
306# CONFIG_PACKET_MMAP is not set
307# CONFIG_NETLINK_DEV is not set
308CONFIG_UNIX=y
309# CONFIG_NET_KEY is not set
310CONFIG_INET=y
311CONFIG_IP_MULTICAST=y
312# CONFIG_IP_ADVANCED_ROUTER is not set
313CONFIG_IP_PNP=y
314# CONFIG_IP_PNP_DHCP is not set
315CONFIG_IP_PNP_BOOTP=y
316# CONFIG_IP_PNP_RARP 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
321# CONFIG_SYN_COOKIES is not set
322# CONFIG_INET_AH is not set
323# CONFIG_INET_ESP is not set
324# CONFIG_INET_IPCOMP is not set
325CONFIG_INET_TUNNEL=m
326
327#
328# IP: Virtual Server Configuration
329#
330# CONFIG_IP_VS is not set
331# CONFIG_IPV6 is not set
332CONFIG_NETFILTER=y
333# CONFIG_NETFILTER_DEBUG is not set
334
335#
336# IP: Netfilter Configuration
337#
338CONFIG_IP_NF_CONNTRACK=m
339# CONFIG_IP_NF_CT_ACCT is not set
340# CONFIG_IP_NF_CT_PROTO_SCTP is not set
341CONFIG_IP_NF_FTP=m
342CONFIG_IP_NF_IRC=m
343CONFIG_IP_NF_TFTP=m
344CONFIG_IP_NF_AMANDA=m
345# CONFIG_IP_NF_QUEUE is not set
346CONFIG_IP_NF_IPTABLES=m
347# CONFIG_IP_NF_MATCH_LIMIT is not set
348# CONFIG_IP_NF_MATCH_IPRANGE is not set
349# CONFIG_IP_NF_MATCH_MAC is not set
350# CONFIG_IP_NF_MATCH_PKTTYPE is not set
351# CONFIG_IP_NF_MATCH_MARK is not set
352# CONFIG_IP_NF_MATCH_MULTIPORT is not set
353# CONFIG_IP_NF_MATCH_TOS is not set
354# CONFIG_IP_NF_MATCH_RECENT is not set
355# CONFIG_IP_NF_MATCH_ECN is not set
356# CONFIG_IP_NF_MATCH_DSCP is not set
357# CONFIG_IP_NF_MATCH_AH_ESP is not set
358# CONFIG_IP_NF_MATCH_LENGTH is not set
359# CONFIG_IP_NF_MATCH_TTL is not set
360# CONFIG_IP_NF_MATCH_TCPMSS is not set
361CONFIG_IP_NF_MATCH_HELPER=m
362# CONFIG_IP_NF_MATCH_STATE is not set
363# CONFIG_IP_NF_MATCH_CONNTRACK is not set
364# CONFIG_IP_NF_MATCH_OWNER is not set
365# CONFIG_IP_NF_MATCH_ADDRTYPE is not set
366# CONFIG_IP_NF_MATCH_REALM is not set
367# CONFIG_IP_NF_MATCH_SCTP is not set
368# CONFIG_IP_NF_FILTER is not set
369# CONFIG_IP_NF_TARGET_LOG is not set
370# CONFIG_IP_NF_TARGET_ULOG is not set
371# CONFIG_IP_NF_TARGET_TCPMSS is not set
372# CONFIG_IP_NF_NAT is not set
373# CONFIG_IP_NF_MANGLE is not set
374# CONFIG_IP_NF_RAW is not set
375# CONFIG_IP_NF_ARPTABLES is not set
376# CONFIG_IP_NF_COMPAT_IPCHAINS is not set
377# CONFIG_IP_NF_COMPAT_IPFWADM is not set
378CONFIG_XFRM=y
379CONFIG_XFRM_USER=y
380
381#
382# SCTP Configuration (EXPERIMENTAL)
383#
384# CONFIG_IP_SCTP is not set
385# CONFIG_ATM is not set
386# CONFIG_BRIDGE is not set
387# CONFIG_VLAN_8021Q is not set
388# CONFIG_DECNET is not set
389# CONFIG_LLC2 is not set
390# CONFIG_IPX is not set
391# CONFIG_ATALK is not set
392# CONFIG_X25 is not set
393# CONFIG_LAPB is not set
394# CONFIG_NET_DIVERT is not set
395# CONFIG_ECONET is not set
396# CONFIG_WAN_ROUTER is not set
397# CONFIG_NET_HW_FLOWCONTROL is not set
398
399#
400# QoS and/or fair queueing
401#
402# CONFIG_NET_SCHED is not set
403# CONFIG_NET_CLS_ROUTE is not set
404
405#
406# Network testing
407#
408# CONFIG_NET_PKTGEN is not set
409# CONFIG_NETPOLL is not set
410# CONFIG_NET_POLL_CONTROLLER is not set
411# CONFIG_HAMRADIO is not set
412# CONFIG_IRDA is not set
413# CONFIG_BT is not set
414CONFIG_NETDEVICES=y
415# CONFIG_DUMMY is not set
416# CONFIG_BONDING is not set
417# CONFIG_EQUALIZER is not set
418# CONFIG_TUN is not set
419
420#
421# ARCnet devices
422#
423# CONFIG_ARCNET is not set
424
425#
426# Ethernet (10 or 100Mbit)
427#
428CONFIG_NET_ETHERNET=y
429CONFIG_MII=y
430# CONFIG_HAPPYMEAL is not set
431# CONFIG_SUNGEM is not set
432# CONFIG_NET_VENDOR_3COM is not set
433
434#
435# Tulip family network device support
436#
437CONFIG_NET_TULIP=y
438# CONFIG_DE2104X is not set
439CONFIG_TULIP=y
440# CONFIG_TULIP_MWI is not set
441# CONFIG_TULIP_MMIO is not set
442# CONFIG_TULIP_NAPI is not set
443# CONFIG_DE4X5 is not set
444# CONFIG_WINBOND_840 is not set
445# CONFIG_DM9102 is not set
446# CONFIG_HP100 is not set
447CONFIG_NET_PCI=y
448# CONFIG_PCNET32 is not set
449# CONFIG_AMD8111_ETH is not set
450# CONFIG_ADAPTEC_STARFIRE is not set
451# CONFIG_B44 is not set
452# CONFIG_FORCEDETH is not set
453# CONFIG_DGRS is not set
454# CONFIG_EEPRO100 is not set
455CONFIG_E100=y
456# CONFIG_E100_NAPI is not set
457# CONFIG_FEALNX is not set
458# CONFIG_NATSEMI is not set
459# CONFIG_NE2K_PCI is not set
460# CONFIG_8139CP is not set
461# CONFIG_8139TOO is not set
462# CONFIG_SIS900 is not set
463# CONFIG_EPIC100 is not set
464# CONFIG_SUNDANCE is not set
465# CONFIG_TLAN is not set
466# CONFIG_VIA_RHINE is not set
467# CONFIG_VIA_VELOCITY is not set
468
469#
470# Ethernet (1000 Mbit)
471#
472# CONFIG_ACENIC is not set
473# CONFIG_DL2K is not set
474# CONFIG_E1000 is not set
475# CONFIG_NS83820 is not set
476# CONFIG_HAMACHI is not set
477# CONFIG_YELLOWFIN is not set
478# CONFIG_R8169 is not set
479# CONFIG_SK98LIN is not set
480# CONFIG_TIGON3 is not set
481
482#
483# Ethernet (10000 Mbit)
484#
485# CONFIG_IXGB is not set
486# CONFIG_S2IO is not set
487
488#
489# Token Ring devices
490#
491# CONFIG_TR is not set
492
493#
494# Wireless LAN (non-hamradio)
495#
496# CONFIG_NET_RADIO is not set
497
498#
499# Wan interfaces
500#
501# CONFIG_WAN is not set
502# CONFIG_FDDI is not set
503# CONFIG_HIPPI is not set
504# CONFIG_PPP is not set
505# CONFIG_SLIP is not set
506# CONFIG_NET_FC is not set
507# CONFIG_SHAPER is not set
508# CONFIG_NETCONSOLE is not set
509
510#
511# ISDN subsystem
512#
513# CONFIG_ISDN is not set
514
515#
516# Telephony Support
517#
518# CONFIG_PHONE is not set
519
520#
521# Input device support
522#
523# CONFIG_INPUT is not set
524
525#
526# Userland interfaces
527#
528
529#
530# Input I/O drivers
531#
532# CONFIG_GAMEPORT is not set
533CONFIG_SOUND_GAMEPORT=y
534# CONFIG_SERIO is not set
535# CONFIG_SERIO_I8042 is not set
536
537#
538# Input Device Drivers
539#
540
541#
542# Character devices
543#
544# CONFIG_VT is not set
545# CONFIG_SERIAL_NONSTANDARD is not set
546
547#
548# Serial drivers
549#
550CONFIG_SERIAL_8250=y
551CONFIG_SERIAL_8250_CONSOLE=y
552CONFIG_SERIAL_8250_NR_UARTS=4
553# CONFIG_SERIAL_8250_EXTENDED is not set
554
555#
556# Non-8250 serial port support
557#
558CONFIG_SERIAL_CORE=y
559CONFIG_SERIAL_CORE_CONSOLE=y
560CONFIG_UNIX98_PTYS=y
561CONFIG_LEGACY_PTYS=y
562CONFIG_LEGACY_PTY_COUNT=256
563
564#
565# IPMI
566#
567# CONFIG_IPMI_HANDLER is not set
568
569#
570# Watchdog Cards
571#
572# CONFIG_WATCHDOG is not set
573# CONFIG_NVRAM is not set
574CONFIG_GEN_RTC=y
575# CONFIG_GEN_RTC_X is not set
576# CONFIG_DTLK is not set
577# CONFIG_R3964 is not set
578# CONFIG_APPLICOM is not set
579
580#
581# Ftape, the floppy tape device driver
582#
583# CONFIG_AGP is not set
584# CONFIG_DRM is not set
585# CONFIG_RAW_DRIVER is not set
586
587#
588# I2C support
589#
590# CONFIG_I2C is not set
591
592#
593# Dallas's 1-wire bus
594#
595# CONFIG_W1 is not set
596
597#
598# Misc devices
599#
600
601#
602# Multimedia devices
603#
604# CONFIG_VIDEO_DEV is not set
605
606#
607# Digital Video Broadcasting Devices
608#
609# CONFIG_DVB is not set
610
611#
612# Graphics support
613#
614# CONFIG_FB is not set
615
616#
617# Sound
618#
619# CONFIG_SOUND is not set
620
621#
622# USB support
623#
624# CONFIG_USB is not set
625
626#
627# USB Gadget Support
628#
629# CONFIG_USB_GADGET is not set
630
631#
632# File systems
633#
634CONFIG_EXT2_FS=y
635# CONFIG_EXT2_FS_XATTR is not set
636# CONFIG_EXT3_FS is not set
637# CONFIG_JBD is not set
638# CONFIG_REISERFS_FS is not set
639# CONFIG_JFS_FS is not set
640# CONFIG_XFS_FS is not set
641# CONFIG_MINIX_FS is not set
642# CONFIG_ROMFS_FS is not set
643# CONFIG_QUOTA is not set
644# CONFIG_AUTOFS_FS is not set
645# CONFIG_AUTOFS4_FS is not set
646
647#
648# CD-ROM/DVD Filesystems
649#
650# CONFIG_ISO9660_FS is not set
651# CONFIG_UDF_FS is not set
652
653#
654# DOS/FAT/NT Filesystems
655#
656# CONFIG_MSDOS_FS is not set
657# CONFIG_VFAT_FS is not set
658# CONFIG_NTFS_FS is not set
659
660#
661# Pseudo filesystems
662#
663CONFIG_PROC_FS=y
664CONFIG_PROC_KCORE=y
665CONFIG_SYSFS=y
666# CONFIG_DEVFS_FS is not set
667# CONFIG_DEVPTS_FS_XATTR is not set
668CONFIG_TMPFS=y
669# CONFIG_HUGETLB_PAGE is not set
670CONFIG_RAMFS=y
671
672#
673# Miscellaneous filesystems
674#
675# CONFIG_ADFS_FS is not set
676# CONFIG_AFFS_FS is not set
677# CONFIG_HFS_FS is not set
678# CONFIG_HFSPLUS_FS is not set
679# CONFIG_BEFS_FS is not set
680# CONFIG_BFS_FS is not set
681# CONFIG_EFS_FS is not set
682# CONFIG_CRAMFS is not set
683# CONFIG_VXFS_FS is not set
684# CONFIG_HPFS_FS is not set
685# CONFIG_QNX4FS_FS is not set
686# CONFIG_SYSV_FS is not set
687# CONFIG_UFS_FS is not set
688
689#
690# Network File Systems
691#
692CONFIG_NFS_FS=y
693CONFIG_NFS_V3=y
694# CONFIG_NFS_V4 is not set
695# CONFIG_NFS_DIRECTIO is not set
696# CONFIG_NFSD is not set
697CONFIG_ROOT_NFS=y
698CONFIG_LOCKD=y
699CONFIG_LOCKD_V4=y
700# CONFIG_EXPORTFS is not set
701CONFIG_SUNRPC=y
702# CONFIG_RPCSEC_GSS_KRB5 is not set
703# CONFIG_RPCSEC_GSS_SPKM3 is not set
704# CONFIG_SMB_FS is not set
705# CONFIG_CIFS is not set
706# CONFIG_NCP_FS is not set
707# CONFIG_CODA_FS is not set
708# CONFIG_AFS_FS is not set
709
710#
711# Partition Types
712#
713# CONFIG_PARTITION_ADVANCED is not set
714CONFIG_MSDOS_PARTITION=y
715
716#
717# Native Language Support
718#
719# CONFIG_NLS is not set
720
721#
722# Library routines
723#
724# CONFIG_CRC_CCITT is not set
725CONFIG_CRC32=y
726# CONFIG_LIBCRC32C is not set
727
728#
729# Profiling support
730#
731# CONFIG_PROFILING is not set
732
733#
734# Kernel hacking
735#
736# CONFIG_DEBUG_KERNEL is not set
737
738#
739# Security options
740#
741# CONFIG_SECURITY is not set
742
743#
744# Cryptographic options
745#
746# CONFIG_CRYPTO is not set
diff --git a/arch/ppc/configs/ocotea_defconfig b/arch/ppc/configs/ocotea_defconfig
deleted file mode 100644
index 9dcf575c706f..000000000000
--- a/arch/ppc/configs/ocotea_defconfig
+++ /dev/null
@@ -1,599 +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
24# CONFIG_POSIX_MQUEUE is not set
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
30# CONFIG_IKCONFIG is not set
31CONFIG_EMBEDDED=y
32CONFIG_KALLSYMS=y
33# CONFIG_KALLSYMS_ALL is not set
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
47# CONFIG_MODULE_FORCE_UNLOAD is not set
48CONFIG_OBSOLETE_MODPARM=y
49# CONFIG_MODVERSIONS is not set
50CONFIG_KMOD=y
51
52#
53# Processor
54#
55# CONFIG_6xx is not set
56# CONFIG_40x is not set
57CONFIG_44x=y
58# CONFIG_POWER3 is not set
59# CONFIG_POWER4 is not set
60# CONFIG_8xx is not set
61# CONFIG_E500 is not set
62CONFIG_BOOKE=y
63CONFIG_PTE_64BIT=y
64# CONFIG_MATH_EMULATION is not set
65# CONFIG_CPU_FREQ is not set
66CONFIG_4xx=y
67
68#
69# IBM 4xx options
70#
71# CONFIG_EBONY is not set
72CONFIG_OCOTEA=y
73CONFIG_440GX=y
74CONFIG_440A=y
75CONFIG_IBM_OCP=y
76CONFIG_IBM_EMAC4=y
77# CONFIG_PM is not set
78CONFIG_NOT_COHERENT_CACHE=y
79
80#
81# Platform options
82#
83# CONFIG_PC_KEYBOARD is not set
84# CONFIG_SMP is not set
85# CONFIG_PREEMPT is not set
86# CONFIG_HIGHMEM is not set
87CONFIG_KERNEL_ELF=y
88CONFIG_BINFMT_ELF=y
89# CONFIG_BINFMT_MISC is not set
90CONFIG_CMDLINE_BOOL=y
91CONFIG_CMDLINE="ip=on console=ttyS0,115200"
92
93#
94# Bus options
95#
96CONFIG_PCI=y
97CONFIG_PCI_DOMAINS=y
98# CONFIG_PCI_LEGACY_PROC is not set
99# CONFIG_PCI_NAMES is not set
100
101#
102# Advanced setup
103#
104# CONFIG_ADVANCED_OPTIONS is not set
105
106#
107# Default settings for advanced configuration options are used
108#
109CONFIG_HIGHMEM_START=0xfe000000
110CONFIG_LOWMEM_SIZE=0x30000000
111CONFIG_KERNEL_START=0xc0000000
112CONFIG_TASK_SIZE=0x80000000
113CONFIG_CONSISTENT_START=0xff100000
114CONFIG_CONSISTENT_SIZE=0x00200000
115CONFIG_BOOT_LOAD=0x01000000
116
117#
118# Device Drivers
119#
120
121#
122# Generic Driver Options
123#
124CONFIG_PREVENT_FIRMWARE_BUILD=y
125# CONFIG_DEBUG_DRIVER is not set
126
127#
128# Memory Technology Devices (MTD)
129#
130# CONFIG_MTD is not set
131
132#
133# Parallel port support
134#
135# CONFIG_PARPORT is not set
136
137#
138# Plug and Play support
139#
140
141#
142# Block devices
143#
144# CONFIG_BLK_DEV_FD is not set
145# CONFIG_BLK_CPQ_DA is not set
146# CONFIG_BLK_CPQ_CISS_DA is not set
147# CONFIG_BLK_DEV_DAC960 is not set
148# CONFIG_BLK_DEV_UMEM is not set
149# CONFIG_BLK_DEV_LOOP is not set
150# CONFIG_BLK_DEV_NBD is not set
151# CONFIG_BLK_DEV_SX8 is not set
152# CONFIG_BLK_DEV_RAM is not set
153# CONFIG_LBD is not set
154
155#
156# ATA/ATAPI/MFM/RLL support
157#
158# CONFIG_IDE is not set
159
160#
161# SCSI device support
162#
163# CONFIG_SCSI is not set
164
165#
166# Multi-device support (RAID and LVM)
167#
168# CONFIG_MD is not set
169
170#
171# Fusion MPT device support
172#
173
174#
175# IEEE 1394 (FireWire) support
176#
177# CONFIG_IEEE1394 is not set
178
179#
180# I2O device support
181#
182# CONFIG_I2O is not set
183
184#
185# Macintosh device drivers
186#
187
188#
189# Networking support
190#
191CONFIG_NET=y
192
193#
194# Networking options
195#
196CONFIG_PACKET=y
197# CONFIG_PACKET_MMAP is not set
198# CONFIG_NETLINK_DEV is not set
199CONFIG_UNIX=y
200# CONFIG_NET_KEY is not set
201CONFIG_INET=y
202# CONFIG_IP_MULTICAST is not set
203# CONFIG_IP_ADVANCED_ROUTER is not set
204CONFIG_IP_PNP=y
205# CONFIG_IP_PNP_DHCP is not set
206CONFIG_IP_PNP_BOOTP=y
207# CONFIG_IP_PNP_RARP is not set
208# CONFIG_NET_IPIP is not set
209# CONFIG_NET_IPGRE is not set
210# CONFIG_ARPD is not set
211# CONFIG_SYN_COOKIES is not set
212# CONFIG_INET_AH is not set
213# CONFIG_INET_ESP is not set
214# CONFIG_INET_IPCOMP is not set
215
216#
217# IP: Virtual Server Configuration
218#
219# CONFIG_IP_VS is not set
220# CONFIG_IPV6 is not set
221CONFIG_NETFILTER=y
222# CONFIG_NETFILTER_DEBUG is not set
223
224#
225# IP: Netfilter Configuration
226#
227# CONFIG_IP_NF_CONNTRACK is not set
228# CONFIG_IP_NF_QUEUE is not set
229# CONFIG_IP_NF_IPTABLES is not set
230# CONFIG_IP_NF_ARPTABLES is not set
231# CONFIG_IP_NF_COMPAT_IPCHAINS is not set
232# CONFIG_IP_NF_COMPAT_IPFWADM is not set
233
234#
235# SCTP Configuration (EXPERIMENTAL)
236#
237# CONFIG_IP_SCTP is not set
238# CONFIG_ATM is not set
239# CONFIG_BRIDGE is not set
240# CONFIG_VLAN_8021Q is not set
241# CONFIG_DECNET is not set
242# CONFIG_LLC2 is not set
243# CONFIG_IPX is not set
244# CONFIG_ATALK is not set
245# CONFIG_X25 is not set
246# CONFIG_LAPB is not set
247# CONFIG_NET_DIVERT is not set
248# CONFIG_ECONET is not set
249# CONFIG_WAN_ROUTER is not set
250# CONFIG_NET_HW_FLOWCONTROL is not set
251
252#
253# QoS and/or fair queueing
254#
255# CONFIG_NET_SCHED is not set
256# CONFIG_NET_CLS_ROUTE is not set
257
258#
259# Network testing
260#
261# CONFIG_NET_PKTGEN is not set
262# CONFIG_NETPOLL is not set
263# CONFIG_NET_POLL_CONTROLLER is not set
264# CONFIG_HAMRADIO is not set
265# CONFIG_IRDA is not set
266# CONFIG_BT is not set
267CONFIG_NETDEVICES=y
268# CONFIG_DUMMY is not set
269# CONFIG_BONDING is not set
270# CONFIG_EQUALIZER is not set
271# CONFIG_TUN is not set
272
273#
274# ARCnet devices
275#
276# CONFIG_ARCNET is not set
277
278#
279# Ethernet (10 or 100Mbit)
280#
281CONFIG_NET_ETHERNET=y
282# CONFIG_MII is not set
283# CONFIG_OAKNET is not set
284# CONFIG_HAPPYMEAL is not set
285# CONFIG_SUNGEM is not set
286# CONFIG_NET_VENDOR_3COM is not set
287
288#
289# Tulip family network device support
290#
291# CONFIG_NET_TULIP is not set
292# CONFIG_HP100 is not set
293CONFIG_IBM_EMAC=y
294# CONFIG_IBM_EMAC_ERRMSG is not set
295CONFIG_IBM_EMAC_RXB=128
296CONFIG_IBM_EMAC_TXB=128
297CONFIG_IBM_EMAC_FGAP=8
298CONFIG_IBM_EMAC_SKBRES=0
299# CONFIG_NET_PCI is not set
300
301#
302# Ethernet (1000 Mbit)
303#
304# CONFIG_ACENIC is not set
305# CONFIG_DL2K is not set
306# CONFIG_E1000 is not set
307# CONFIG_NS83820 is not set
308# CONFIG_HAMACHI is not set
309# CONFIG_YELLOWFIN is not set
310# CONFIG_R8169 is not set
311# CONFIG_SK98LIN is not set
312# CONFIG_TIGON3 is not set
313
314#
315# Ethernet (10000 Mbit)
316#
317# CONFIG_IXGB is not set
318# CONFIG_S2IO is not set
319
320#
321# Token Ring devices
322#
323# CONFIG_TR is not set
324
325#
326# Wireless LAN (non-hamradio)
327#
328# CONFIG_NET_RADIO is not set
329
330#
331# Wan interfaces
332#
333# CONFIG_WAN is not set
334# CONFIG_FDDI is not set
335# CONFIG_HIPPI is not set
336# CONFIG_PPP is not set
337# CONFIG_SLIP is not set
338# CONFIG_SHAPER is not set
339# CONFIG_NETCONSOLE is not set
340
341#
342# ISDN subsystem
343#
344# CONFIG_ISDN is not set
345
346#
347# Telephony Support
348#
349# CONFIG_PHONE is not set
350
351#
352# Input device support
353#
354CONFIG_INPUT=y
355
356#
357# Userland interfaces
358#
359CONFIG_INPUT_MOUSEDEV=y
360CONFIG_INPUT_MOUSEDEV_PSAUX=y
361CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
362CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
363# CONFIG_INPUT_JOYDEV is not set
364# CONFIG_INPUT_TSDEV is not set
365# CONFIG_INPUT_EVDEV is not set
366# CONFIG_INPUT_EVBUG is not set
367
368#
369# Input I/O drivers
370#
371# CONFIG_GAMEPORT is not set
372CONFIG_SOUND_GAMEPORT=y
373CONFIG_SERIO=y
374# CONFIG_SERIO_I8042 is not set
375# CONFIG_SERIO_SERPORT is not set
376# CONFIG_SERIO_CT82C710 is not set
377# CONFIG_SERIO_PCIPS2 is not set
378
379#
380# Input Device Drivers
381#
382# CONFIG_INPUT_KEYBOARD is not set
383# CONFIG_INPUT_MOUSE is not set
384# CONFIG_INPUT_JOYSTICK is not set
385# CONFIG_INPUT_TOUCHSCREEN is not set
386# CONFIG_INPUT_MISC is not set
387
388#
389# Character devices
390#
391# CONFIG_VT is not set
392# CONFIG_SERIAL_NONSTANDARD is not set
393
394#
395# Serial drivers
396#
397CONFIG_SERIAL_8250=y
398CONFIG_SERIAL_8250_CONSOLE=y
399CONFIG_SERIAL_8250_NR_UARTS=4
400CONFIG_SERIAL_8250_EXTENDED=y
401# CONFIG_SERIAL_8250_MANY_PORTS is not set
402CONFIG_SERIAL_8250_SHARE_IRQ=y
403# CONFIG_SERIAL_8250_DETECT_IRQ is not set
404# CONFIG_SERIAL_8250_MULTIPORT is not set
405# CONFIG_SERIAL_8250_RSA is not set
406
407#
408# Non-8250 serial port support
409#
410CONFIG_SERIAL_CORE=y
411CONFIG_SERIAL_CORE_CONSOLE=y
412CONFIG_UNIX98_PTYS=y
413CONFIG_LEGACY_PTYS=y
414CONFIG_LEGACY_PTY_COUNT=256
415# CONFIG_QIC02_TAPE is not set
416
417#
418# IPMI
419#
420# CONFIG_IPMI_HANDLER is not set
421
422#
423# Watchdog Cards
424#
425# CONFIG_WATCHDOG is not set
426# CONFIG_NVRAM is not set
427# CONFIG_GEN_RTC is not set
428# CONFIG_DTLK is not set
429# CONFIG_R3964 is not set
430# CONFIG_APPLICOM is not set
431
432#
433# Ftape, the floppy tape device driver
434#
435# CONFIG_FTAPE is not set
436# CONFIG_AGP is not set
437# CONFIG_DRM is not set
438# CONFIG_RAW_DRIVER is not set
439
440#
441# I2C support
442#
443# CONFIG_I2C is not set
444
445#
446# Misc devices
447#
448
449#
450# Multimedia devices
451#
452# CONFIG_VIDEO_DEV is not set
453
454#
455# Digital Video Broadcasting Devices
456#
457# CONFIG_DVB is not set
458
459#
460# Graphics support
461#
462# CONFIG_FB is not set
463
464#
465# Sound
466#
467# CONFIG_SOUND is not set
468
469#
470# USB support
471#
472# CONFIG_USB is not set
473
474#
475# USB Gadget Support
476#
477# CONFIG_USB_GADGET is not set
478
479#
480# File systems
481#
482# CONFIG_EXT2_FS is not set
483# CONFIG_EXT3_FS is not set
484# CONFIG_JBD is not set
485# CONFIG_REISERFS_FS is not set
486# CONFIG_JFS_FS is not set
487# CONFIG_XFS_FS is not set
488# CONFIG_MINIX_FS is not set
489# CONFIG_ROMFS_FS is not set
490# CONFIG_QUOTA is not set
491# CONFIG_AUTOFS_FS is not set
492# CONFIG_AUTOFS4_FS is not set
493
494#
495# CD-ROM/DVD Filesystems
496#
497# CONFIG_ISO9660_FS is not set
498# CONFIG_UDF_FS is not set
499
500#
501# DOS/FAT/NT Filesystems
502#
503# CONFIG_FAT_FS is not set
504# CONFIG_NTFS_FS is not set
505
506#
507# Pseudo filesystems
508#
509CONFIG_PROC_FS=y
510CONFIG_PROC_KCORE=y
511CONFIG_SYSFS=y
512# CONFIG_DEVFS_FS is not set
513# CONFIG_DEVPTS_FS_XATTR is not set
514# CONFIG_TMPFS is not set
515# CONFIG_HUGETLB_PAGE is not set
516CONFIG_RAMFS=y
517
518#
519# Miscellaneous filesystems
520#
521# CONFIG_ADFS_FS is not set
522# CONFIG_AFFS_FS is not set
523# CONFIG_HFS_FS is not set
524# CONFIG_HFSPLUS_FS is not set
525# CONFIG_BEFS_FS is not set
526# CONFIG_BFS_FS is not set
527# CONFIG_EFS_FS is not set
528# CONFIG_CRAMFS is not set
529# CONFIG_VXFS_FS is not set
530# CONFIG_HPFS_FS is not set
531# CONFIG_QNX4FS_FS is not set
532# CONFIG_SYSV_FS is not set
533# CONFIG_UFS_FS is not set
534
535#
536# Network File Systems
537#
538CONFIG_NFS_FS=y
539# CONFIG_NFS_V3 is not set
540# CONFIG_NFS_V4 is not set
541# CONFIG_NFS_DIRECTIO is not set
542# CONFIG_NFSD is not set
543CONFIG_ROOT_NFS=y
544CONFIG_LOCKD=y
545# CONFIG_EXPORTFS is not set
546CONFIG_SUNRPC=y
547# CONFIG_RPCSEC_GSS_KRB5 is not set
548# CONFIG_SMB_FS is not set
549# CONFIG_CIFS is not set
550# CONFIG_NCP_FS is not set
551# CONFIG_CODA_FS is not set
552# CONFIG_AFS_FS is not set
553
554#
555# Partition Types
556#
557# CONFIG_PARTITION_ADVANCED is not set
558CONFIG_MSDOS_PARTITION=y
559
560#
561# Native Language Support
562#
563# CONFIG_NLS is not set
564
565#
566# Library routines
567#
568CONFIG_CRC32=y
569# CONFIG_LIBCRC32C is not set
570
571#
572# Profiling support
573#
574# CONFIG_PROFILING is not set
575
576#
577# Kernel hacking
578#
579CONFIG_DEBUG_KERNEL=y
580# CONFIG_DEBUG_SLAB is not set
581# CONFIG_MAGIC_SYSRQ is not set
582# CONFIG_DEBUG_SPINLOCK is not set
583# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
584# CONFIG_KGDB is not set
585# CONFIG_XMON is not set
586CONFIG_BDI_SWITCH=y
587CONFIG_DEBUG_INFO=y
588# CONFIG_SERIAL_TEXT_DEBUG is not set
589CONFIG_PPC_OCP=y
590
591#
592# Security options
593#
594# CONFIG_SECURITY is not set
595
596#
597# Cryptographic options
598#
599# CONFIG_CRYPTO is not set
diff --git a/arch/ppc/configs/pplus_defconfig b/arch/ppc/configs/pplus_defconfig
deleted file mode 100644
index 5e459bcbf591..000000000000
--- a/arch/ppc/configs/pplus_defconfig
+++ /dev/null
@@ -1,720 +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
16CONFIG_STANDALONE=y
17CONFIG_BROKEN_ON_SMP=y
18
19#
20# General setup
21#
22CONFIG_SWAP=y
23CONFIG_SYSVIPC=y
24# CONFIG_BSD_PROCESS_ACCT is not set
25CONFIG_SYSCTL=y
26CONFIG_LOG_BUF_SHIFT=14
27# CONFIG_HOTPLUG is not set
28# CONFIG_IKCONFIG is not set
29CONFIG_EMBEDDED=y
30CONFIG_KALLSYMS=y
31CONFIG_FUTEX=y
32CONFIG_EPOLL=y
33CONFIG_IOSCHED_NOOP=y
34CONFIG_IOSCHED_AS=y
35CONFIG_IOSCHED_DEADLINE=y
36# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
37
38#
39# Loadable module support
40#
41CONFIG_MODULES=y
42CONFIG_MODULE_UNLOAD=y
43# CONFIG_MODULE_FORCE_UNLOAD is not set
44CONFIG_OBSOLETE_MODPARM=y
45# CONFIG_MODVERSIONS is not set
46CONFIG_KMOD=y
47
48#
49# Processor
50#
51CONFIG_6xx=y
52# CONFIG_40x is not set
53# CONFIG_44x is not set
54# CONFIG_POWER3 is not set
55# CONFIG_POWER4 is not set
56# CONFIG_8xx is not set
57# CONFIG_ALTIVEC is not set
58# CONFIG_TAU is not set
59# CONFIG_CPU_FREQ is not set
60CONFIG_PPC_STD_MMU=y
61
62#
63# Platform options
64#
65# CONFIG_PPC_MULTIPLATFORM is not set
66# CONFIG_APUS is not set
67# CONFIG_WILLOW is not set
68# CONFIG_PCORE is not set
69# CONFIG_POWERPMC250 is not set
70# CONFIG_EV64260 is not set
71# CONFIG_SPRUCE is not set
72# CONFIG_LOPEC is not set
73# CONFIG_MCPN765 is not set
74# CONFIG_MVME5100 is not set
75CONFIG_PPLUS=y
76# CONFIG_PRPMC750 is not set
77# CONFIG_PRPMC800 is not set
78# CONFIG_SANDPOINT is not set
79# CONFIG_ADIR is not set
80# CONFIG_K2 is not set
81# CONFIG_PAL4 is not set
82# CONFIG_GEMINI is not set
83# CONFIG_EST8260 is not set
84# CONFIG_SBS8260 is not set
85# CONFIG_RPX6 is not set
86# CONFIG_TQM8260 is not set
87CONFIG_PPC_GEN550=y
88# CONFIG_PPCBUG_NVRAM is not set
89# CONFIG_SMP is not set
90# CONFIG_PREEMPT is not set
91# CONFIG_HIGHMEM is not set
92CONFIG_KERNEL_ELF=y
93CONFIG_BINFMT_ELF=y
94# CONFIG_BINFMT_MISC is not set
95CONFIG_CMDLINE_BOOL=y
96CONFIG_CMDLINE="ip=on"
97
98#
99# Bus options
100#
101CONFIG_GENERIC_ISA_DMA=y
102CONFIG_PCI=y
103CONFIG_PCI_DOMAINS=y
104# CONFIG_PCI_LEGACY_PROC is not set
105# CONFIG_PCI_NAMES is not set
106
107#
108# Advanced setup
109#
110# CONFIG_ADVANCED_OPTIONS is not set
111
112#
113# Default settings for advanced configuration options are used
114#
115CONFIG_HIGHMEM_START=0xfe000000
116CONFIG_LOWMEM_SIZE=0x30000000
117CONFIG_KERNEL_START=0xc0000000
118CONFIG_TASK_SIZE=0x80000000
119CONFIG_BOOT_LOAD=0x00800000
120
121#
122# Device Drivers
123#
124
125#
126# Generic Driver Options
127#
128
129#
130# Memory Technology Devices (MTD)
131#
132# CONFIG_MTD is not set
133
134#
135# Parallel port support
136#
137# CONFIG_PARPORT is not set
138
139#
140# Plug and Play support
141#
142
143#
144# Block devices
145#
146CONFIG_BLK_DEV_FD=y
147# CONFIG_BLK_CPQ_DA is not set
148# CONFIG_BLK_CPQ_CISS_DA is not set
149# CONFIG_BLK_DEV_DAC960 is not set
150# CONFIG_BLK_DEV_UMEM is not set
151# CONFIG_BLK_DEV_LOOP is not set
152# CONFIG_BLK_DEV_NBD is not set
153# CONFIG_BLK_DEV_RAM is not set
154# CONFIG_BLK_DEV_INITRD is not set
155# CONFIG_LBD is not set
156
157#
158# ATA/ATAPI/MFM/RLL support
159#
160CONFIG_IDE=y
161CONFIG_BLK_DEV_IDE=y
162
163#
164# Please see Documentation/ide.txt for help/info on IDE drives
165#
166CONFIG_BLK_DEV_IDEDISK=y
167# CONFIG_IDEDISK_MULTI_MODE is not set
168# CONFIG_IDEDISK_STROKE is not set
169CONFIG_BLK_DEV_IDECD=y
170# CONFIG_BLK_DEV_IDETAPE is not set
171CONFIG_BLK_DEV_IDEFLOPPY=y
172CONFIG_BLK_DEV_IDESCSI=y
173# CONFIG_IDE_TASK_IOCTL is not set
174# CONFIG_IDE_TASKFILE_IO is not set
175
176#
177# IDE chipset support/bugfixes
178#
179CONFIG_IDE_GENERIC=y
180# CONFIG_BLK_DEV_IDEPCI is not set
181# CONFIG_BLK_DEV_IDEDMA is not set
182# CONFIG_IDEDMA_AUTO is not set
183# CONFIG_BLK_DEV_HD is not set
184
185#
186# SCSI device support
187#
188CONFIG_SCSI=y
189CONFIG_SCSI_PROC_FS=y
190
191#
192# SCSI support type (disk, tape, CD-ROM)
193#
194CONFIG_BLK_DEV_SD=y
195CONFIG_CHR_DEV_ST=y
196# CONFIG_CHR_DEV_OSST is not set
197CONFIG_BLK_DEV_SR=y
198CONFIG_BLK_DEV_SR_VENDOR=y
199CONFIG_CHR_DEV_SG=y
200
201#
202# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
203#
204# CONFIG_SCSI_MULTI_LUN is not set
205# CONFIG_SCSI_REPORT_LUNS is not set
206CONFIG_SCSI_CONSTANTS=y
207# CONFIG_SCSI_LOGGING is not set
208
209#
210# SCSI low-level drivers
211#
212# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
213# CONFIG_SCSI_ACARD is not set
214# CONFIG_SCSI_AACRAID is not set
215# CONFIG_SCSI_AIC7XXX is not set
216# CONFIG_SCSI_AIC7XXX_OLD is not set
217# CONFIG_SCSI_AIC79XX is not set
218# CONFIG_SCSI_ADVANSYS is not set
219# CONFIG_SCSI_MEGARAID is not set
220# CONFIG_SCSI_SATA is not set
221# CONFIG_SCSI_BUSLOGIC is not set
222# CONFIG_SCSI_CPQFCTS is not set
223# CONFIG_SCSI_DMX3191D is not set
224# CONFIG_SCSI_EATA is not set
225# CONFIG_SCSI_EATA_PIO is not set
226# CONFIG_SCSI_FUTURE_DOMAIN is not set
227# CONFIG_SCSI_GDTH is not set
228# CONFIG_SCSI_IPS is not set
229# CONFIG_SCSI_INIA100 is not set
230# CONFIG_SCSI_SYM53C8XX_2 is not set
231# CONFIG_SCSI_QLOGIC_ISP is not set
232# CONFIG_SCSI_QLOGIC_FC is not set
233# CONFIG_SCSI_QLOGIC_1280 is not set
234CONFIG_SCSI_QLA2XXX=y
235# CONFIG_SCSI_QLA21XX is not set
236# CONFIG_SCSI_QLA22XX is not set
237# CONFIG_SCSI_QLA2300 is not set
238# CONFIG_SCSI_QLA2322 is not set
239# CONFIG_SCSI_QLA6312 is not set
240# CONFIG_SCSI_QLA6322 is not set
241# CONFIG_SCSI_DC395x is not set
242# CONFIG_SCSI_DC390T is not set
243# CONFIG_SCSI_NSP32 is not set
244# CONFIG_SCSI_DEBUG is not set
245
246#
247# Multi-device support (RAID and LVM)
248#
249# CONFIG_MD is not set
250
251#
252# Fusion MPT device support
253#
254# CONFIG_FUSION is not set
255
256#
257# IEEE 1394 (FireWire) support
258#
259# CONFIG_IEEE1394 is not set
260
261#
262# I2O device support
263#
264# CONFIG_I2O is not set
265
266#
267# Macintosh device drivers
268#
269
270#
271# Networking support
272#
273CONFIG_NET=y
274
275#
276# Networking options
277#
278CONFIG_PACKET=y
279# CONFIG_PACKET_MMAP is not set
280# CONFIG_NETLINK_DEV is not set
281CONFIG_UNIX=y
282# CONFIG_NET_KEY is not set
283CONFIG_INET=y
284CONFIG_IP_MULTICAST=y
285# CONFIG_IP_ADVANCED_ROUTER is not set
286CONFIG_IP_PNP=y
287CONFIG_IP_PNP_DHCP=y
288# CONFIG_IP_PNP_BOOTP is not set
289# CONFIG_IP_PNP_RARP is not set
290# CONFIG_NET_IPIP is not set
291# CONFIG_NET_IPGRE is not set
292# CONFIG_IP_MROUTE is not set
293# CONFIG_ARPD is not set
294# CONFIG_INET_ECN is not set
295CONFIG_SYN_COOKIES=y
296# CONFIG_INET_AH is not set
297# CONFIG_INET_ESP is not set
298# CONFIG_INET_IPCOMP is not set
299
300#
301# IP: Virtual Server Configuration
302#
303# CONFIG_IP_VS is not set
304# CONFIG_IPV6 is not set
305# CONFIG_DECNET is not set
306# CONFIG_BRIDGE is not set
307CONFIG_NETFILTER=y
308# CONFIG_NETFILTER_DEBUG is not set
309
310#
311# IP: Netfilter Configuration
312#
313CONFIG_IP_NF_CONNTRACK=m
314CONFIG_IP_NF_FTP=m
315# CONFIG_IP_NF_IRC is not set
316# CONFIG_IP_NF_TFTP is not set
317# CONFIG_IP_NF_AMANDA is not set
318# CONFIG_IP_NF_QUEUE is not set
319CONFIG_IP_NF_IPTABLES=m
320CONFIG_IP_NF_MATCH_LIMIT=m
321# CONFIG_IP_NF_MATCH_IPRANGE is not set
322CONFIG_IP_NF_MATCH_MAC=m
323CONFIG_IP_NF_MATCH_PKTTYPE=m
324CONFIG_IP_NF_MATCH_MARK=m
325CONFIG_IP_NF_MATCH_MULTIPORT=m
326CONFIG_IP_NF_MATCH_TOS=m
327# CONFIG_IP_NF_MATCH_RECENT is not set
328CONFIG_IP_NF_MATCH_ECN=m
329CONFIG_IP_NF_MATCH_DSCP=m
330CONFIG_IP_NF_MATCH_AH_ESP=m
331# CONFIG_IP_NF_MATCH_LENGTH is not set
332# CONFIG_IP_NF_MATCH_TTL is not set
333# CONFIG_IP_NF_MATCH_TCPMSS is not set
334CONFIG_IP_NF_MATCH_HELPER=m
335CONFIG_IP_NF_MATCH_STATE=m
336CONFIG_IP_NF_MATCH_CONNTRACK=m
337CONFIG_IP_NF_MATCH_OWNER=m
338CONFIG_IP_NF_FILTER=m
339CONFIG_IP_NF_TARGET_REJECT=m
340CONFIG_IP_NF_NAT=m
341CONFIG_IP_NF_NAT_NEEDED=y
342CONFIG_IP_NF_TARGET_MASQUERADE=m
343CONFIG_IP_NF_TARGET_REDIRECT=m
344# CONFIG_IP_NF_TARGET_NETMAP is not set
345# CONFIG_IP_NF_TARGET_SAME is not set
346# CONFIG_IP_NF_NAT_SNMP_BASIC is not set
347CONFIG_IP_NF_NAT_FTP=m
348# CONFIG_IP_NF_MANGLE is not set
349# CONFIG_IP_NF_TARGET_LOG is not set
350CONFIG_IP_NF_TARGET_ULOG=m
351# CONFIG_IP_NF_TARGET_TCPMSS is not set
352CONFIG_IP_NF_ARPTABLES=m
353CONFIG_IP_NF_ARPFILTER=m
354# CONFIG_IP_NF_ARP_MANGLE is not set
355CONFIG_IP_NF_COMPAT_IPCHAINS=m
356# CONFIG_IP_NF_COMPAT_IPFWADM is not set
357
358#
359# SCTP Configuration (EXPERIMENTAL)
360#
361CONFIG_IPV6_SCTP__=y
362# CONFIG_IP_SCTP is not set
363# CONFIG_ATM is not set
364# CONFIG_VLAN_8021Q is not set
365# CONFIG_LLC2 is not set
366# CONFIG_IPX is not set
367# CONFIG_ATALK is not set
368# CONFIG_X25 is not set
369# CONFIG_LAPB is not set
370# CONFIG_NET_DIVERT is not set
371# CONFIG_ECONET is not set
372# CONFIG_WAN_ROUTER is not set
373# CONFIG_NET_HW_FLOWCONTROL is not set
374
375#
376# QoS and/or fair queueing
377#
378# CONFIG_NET_SCHED is not set
379
380#
381# Network testing
382#
383# CONFIG_NET_PKTGEN is not set
384CONFIG_NETDEVICES=y
385
386#
387# ARCnet devices
388#
389# CONFIG_ARCNET is not set
390# CONFIG_DUMMY is not set
391# CONFIG_BONDING is not set
392# CONFIG_EQUALIZER is not set
393# CONFIG_TUN is not set
394
395#
396# Ethernet (10 or 100Mbit)
397#
398CONFIG_NET_ETHERNET=y
399CONFIG_MII=y
400CONFIG_CRC32=y
401# CONFIG_OAKNET is not set
402# CONFIG_HAPPYMEAL is not set
403# CONFIG_SUNGEM is not set
404# CONFIG_NET_VENDOR_3COM is not set
405
406#
407# Tulip family network device support
408#
409CONFIG_NET_TULIP=y
410# CONFIG_DE2104X is not set
411CONFIG_TULIP=y
412# CONFIG_TULIP_MWI is not set
413# CONFIG_TULIP_MMIO is not set
414# CONFIG_TULIP_NAPI is not set
415# CONFIG_DE4X5 is not set
416# CONFIG_WINBOND_840 is not set
417# CONFIG_DM9102 is not set
418# CONFIG_HP100 is not set
419CONFIG_NET_PCI=y
420# CONFIG_PCNET32 is not set
421# CONFIG_AMD8111_ETH is not set
422# CONFIG_ADAPTEC_STARFIRE is not set
423# CONFIG_B44 is not set
424# CONFIG_FORCEDETH is not set
425# CONFIG_DGRS is not set
426CONFIG_EEPRO100=y
427# CONFIG_EEPRO100_PIO is not set
428# CONFIG_E100 is not set
429# CONFIG_FEALNX is not set
430# CONFIG_NATSEMI is not set
431# CONFIG_NE2K_PCI is not set
432# CONFIG_8139CP is not set
433# CONFIG_8139TOO is not set
434# CONFIG_SIS900 is not set
435# CONFIG_EPIC100 is not set
436# CONFIG_SUNDANCE is not set
437# CONFIG_TLAN is not set
438# CONFIG_VIA_RHINE is not set
439
440#
441# Ethernet (1000 Mbit)
442#
443# CONFIG_ACENIC is not set
444# CONFIG_DL2K is not set
445# CONFIG_E1000 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_SIS190 is not set
451# CONFIG_SK98LIN is not set
452# CONFIG_TIGON3 is not set
453
454#
455# Ethernet (10000 Mbit)
456#
457# CONFIG_IXGB is not set
458# CONFIG_FDDI is not set
459# CONFIG_HIPPI is not set
460# CONFIG_PPP is not set
461# CONFIG_SLIP is not set
462
463#
464# Wireless LAN (non-hamradio)
465#
466# CONFIG_NET_RADIO is not set
467
468#
469# Token Ring devices
470#
471# CONFIG_TR is not set
472# CONFIG_NET_FC is not set
473# CONFIG_RCPCI is not set
474# CONFIG_SHAPER is not set
475
476#
477# Wan interfaces
478#
479# CONFIG_WAN is not set
480
481#
482# Amateur Radio support
483#
484# CONFIG_HAMRADIO is not set
485
486#
487# IrDA (infrared) support
488#
489# CONFIG_IRDA is not set
490
491#
492# Bluetooth support
493#
494# CONFIG_BT is not set
495
496#
497# ISDN subsystem
498#
499# CONFIG_ISDN is not set
500
501#
502# Telephony Support
503#
504# CONFIG_PHONE is not set
505
506#
507# Input device support
508#
509# CONFIG_INPUT is not set
510
511#
512# Userland interfaces
513#
514
515#
516# Input I/O drivers
517#
518# CONFIG_GAMEPORT is not set
519CONFIG_SOUND_GAMEPORT=y
520# CONFIG_SERIO is not set
521# CONFIG_SERIO_I8042 is not set
522
523#
524# Input Device Drivers
525#
526
527#
528# Character devices
529#
530# CONFIG_VT is not set
531# CONFIG_SERIAL_NONSTANDARD is not set
532
533#
534# Serial drivers
535#
536CONFIG_SERIAL_8250=y
537CONFIG_SERIAL_8250_CONSOLE=y
538CONFIG_SERIAL_8250_NR_UARTS=4
539# CONFIG_SERIAL_8250_EXTENDED is not set
540
541#
542# Non-8250 serial port support
543#
544CONFIG_SERIAL_CORE=y
545CONFIG_SERIAL_CORE_CONSOLE=y
546CONFIG_UNIX98_PTYS=y
547CONFIG_LEGACY_PTYS=y
548CONFIG_LEGACY_PTY_COUNT=256
549
550#
551# Mice
552#
553# CONFIG_BUSMOUSE is not set
554# CONFIG_QIC02_TAPE is not set
555
556#
557# IPMI
558#
559# CONFIG_IPMI_HANDLER is not set
560
561#
562# Watchdog Cards
563#
564# CONFIG_WATCHDOG is not set
565# CONFIG_NVRAM is not set
566CONFIG_GEN_RTC=y
567# CONFIG_GEN_RTC_X is not set
568# CONFIG_DTLK is not set
569# CONFIG_R3964 is not set
570# CONFIG_APPLICOM is not set
571
572#
573# Ftape, the floppy tape device driver
574#
575# CONFIG_FTAPE is not set
576# CONFIG_AGP is not set
577# CONFIG_DRM is not set
578# CONFIG_RAW_DRIVER is not set
579
580#
581# I2C support
582#
583# CONFIG_I2C is not set
584
585#
586# Multimedia devices
587#
588# CONFIG_VIDEO_DEV is not set
589
590#
591# Digital Video Broadcasting Devices
592#
593# CONFIG_DVB is not set
594
595#
596# Graphics support
597#
598# CONFIG_FB is not set
599
600#
601# Sound
602#
603# CONFIG_SOUND is not set
604
605#
606# USB support
607#
608# CONFIG_USB is not set
609
610#
611# USB Gadget Support
612#
613# CONFIG_USB_GADGET is not set
614
615#
616# File systems
617#
618CONFIG_EXT2_FS=y
619# CONFIG_EXT2_FS_XATTR is not set
620# CONFIG_EXT3_FS is not set
621# CONFIG_JBD is not set
622# CONFIG_REISERFS_FS is not set
623# CONFIG_JFS_FS is not set
624# CONFIG_XFS_FS is not set
625# CONFIG_MINIX_FS is not set
626# CONFIG_ROMFS_FS is not set
627# CONFIG_QUOTA is not set
628# CONFIG_AUTOFS_FS is not set
629# CONFIG_AUTOFS4_FS is not set
630
631#
632# CD-ROM/DVD Filesystems
633#
634CONFIG_ISO9660_FS=y
635# CONFIG_JOLIET is not set
636# CONFIG_ZISOFS is not set
637# CONFIG_UDF_FS is not set
638
639#
640# DOS/FAT/NT Filesystems
641#
642# CONFIG_FAT_FS is not set
643# CONFIG_NTFS_FS is not set
644
645#
646# Pseudo filesystems
647#
648CONFIG_PROC_FS=y
649CONFIG_PROC_KCORE=y
650# CONFIG_DEVFS_FS is not set
651# CONFIG_DEVPTS_FS_XATTR is not set
652# CONFIG_TMPFS is not set
653# CONFIG_HUGETLB_PAGE is not set
654CONFIG_RAMFS=y
655
656#
657# Miscellaneous filesystems
658#
659# CONFIG_ADFS_FS is not set
660# CONFIG_AFFS_FS is not set
661# CONFIG_HFS_FS is not set
662# CONFIG_BEFS_FS is not set
663# CONFIG_BFS_FS is not set
664# CONFIG_EFS_FS is not set
665# CONFIG_CRAMFS is not set
666# CONFIG_VXFS_FS is not set
667# CONFIG_HPFS_FS is not set
668# CONFIG_QNX4FS_FS is not set
669# CONFIG_SYSV_FS is not set
670# CONFIG_UFS_FS is not set
671
672#
673# Network File Systems
674#
675CONFIG_NFS_FS=y
676# CONFIG_NFS_V3 is not set
677# CONFIG_NFS_V4 is not set
678# CONFIG_NFS_DIRECTIO is not set
679# CONFIG_NFSD is not set
680CONFIG_ROOT_NFS=y
681CONFIG_LOCKD=y
682# CONFIG_EXPORTFS is not set
683CONFIG_SUNRPC=y
684# CONFIG_SUNRPC_GSS is not set
685# CONFIG_SMB_FS is not set
686# CONFIG_CIFS is not set
687# CONFIG_NCP_FS is not set
688# CONFIG_CODA_FS is not set
689# CONFIG_AFS_FS is not set
690
691#
692# Partition Types
693#
694# CONFIG_PARTITION_ADVANCED is not set
695CONFIG_MSDOS_PARTITION=y
696
697#
698# Native Language Support
699#
700# CONFIG_NLS is not set
701
702#
703# Library routines
704#
705
706#
707# Kernel hacking
708#
709# CONFIG_DEBUG_KERNEL is not set
710# CONFIG_SERIAL_TEXT_DEBUG is not set
711
712#
713# Security options
714#
715# CONFIG_SECURITY is not set
716
717#
718# Cryptographic options
719#
720# CONFIG_CRYPTO is not set
diff --git a/arch/ppc/configs/prep_defconfig b/arch/ppc/configs/prep_defconfig
deleted file mode 100644
index b7cee2d71405..000000000000
--- a/arch/ppc/configs/prep_defconfig
+++ /dev/null
@@ -1,1679 +0,0 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.18-rc6
4# Wed Sep 6 15:09:32 2006
5#
6CONFIG_MMU=y
7CONFIG_GENERIC_HARDIRQS=y
8CONFIG_RWSEM_XCHGADD_ALGORITHM=y
9CONFIG_GENERIC_HWEIGHT=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_PPC=y
12CONFIG_PPC32=y
13CONFIG_GENERIC_NVRAM=y
14CONFIG_GENERIC_FIND_NEXT_BIT=y
15CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
16CONFIG_ARCH_MAY_HAVE_PC_FDC=y
17CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
18
19#
20# Code maturity level options
21#
22CONFIG_EXPERIMENTAL=y
23CONFIG_BROKEN_ON_SMP=y
24CONFIG_INIT_ENV_ARG_LIMIT=32
25
26#
27# General setup
28#
29CONFIG_LOCALVERSION="-prep"
30CONFIG_LOCALVERSION_AUTO=y
31CONFIG_SWAP=y
32CONFIG_SYSVIPC=y
33CONFIG_POSIX_MQUEUE=y
34# CONFIG_BSD_PROCESS_ACCT is not set
35# CONFIG_TASKSTATS is not set
36CONFIG_SYSCTL=y
37# CONFIG_AUDIT is not set
38CONFIG_IKCONFIG=y
39CONFIG_IKCONFIG_PROC=y
40# CONFIG_RELAY is not set
41CONFIG_INITRAMFS_SOURCE=""
42CONFIG_CC_OPTIMIZE_FOR_SIZE=y
43# CONFIG_EMBEDDED is not set
44CONFIG_KALLSYMS=y
45# CONFIG_KALLSYMS_ALL is not set
46# CONFIG_KALLSYMS_EXTRA_PASS is not set
47CONFIG_HOTPLUG=y
48CONFIG_PRINTK=y
49CONFIG_BUG=y
50CONFIG_ELF_CORE=y
51CONFIG_BASE_FULL=y
52CONFIG_RT_MUTEXES=y
53CONFIG_FUTEX=y
54CONFIG_EPOLL=y
55CONFIG_SHMEM=y
56CONFIG_SLAB=y
57CONFIG_VM_EVENT_COUNTERS=y
58# CONFIG_TINY_SHMEM is not set
59CONFIG_BASE_SMALL=0
60# CONFIG_SLOB is not set
61
62#
63# Loadable module support
64#
65CONFIG_MODULES=y
66CONFIG_MODULE_UNLOAD=y
67# CONFIG_MODULE_FORCE_UNLOAD is not set
68CONFIG_MODVERSIONS=y
69# CONFIG_MODULE_SRCVERSION_ALL is not set
70CONFIG_KMOD=y
71
72#
73# Block layer
74#
75CONFIG_LBD=y
76# CONFIG_BLK_DEV_IO_TRACE is not set
77# CONFIG_LSF is not set
78
79#
80# IO Schedulers
81#
82CONFIG_IOSCHED_NOOP=y
83CONFIG_IOSCHED_AS=y
84CONFIG_IOSCHED_DEADLINE=y
85CONFIG_IOSCHED_CFQ=y
86# CONFIG_DEFAULT_AS is not set
87# CONFIG_DEFAULT_DEADLINE is not set
88CONFIG_DEFAULT_CFQ=y
89# CONFIG_DEFAULT_NOOP is not set
90CONFIG_DEFAULT_IOSCHED="cfq"
91
92#
93# Processor
94#
95CONFIG_6xx=y
96# CONFIG_40x is not set
97# CONFIG_44x is not set
98# CONFIG_8xx is not set
99# CONFIG_E200 is not set
100# CONFIG_E500 is not set
101CONFIG_PPC_FPU=y
102# CONFIG_ALTIVEC is not set
103# CONFIG_TAU is not set
104# CONFIG_KEXEC is not set
105# CONFIG_CPU_FREQ is not set
106CONFIG_PPC601_SYNC_FIX=y
107# CONFIG_WANT_EARLY_SERIAL is not set
108CONFIG_PPC_STD_MMU=y
109
110#
111# Platform options
112#
113CONFIG_PPC_PREP=y
114# CONFIG_APUS is not set
115# CONFIG_KATANA is not set
116# CONFIG_WILLOW is not set
117# CONFIG_CPCI690 is not set
118# CONFIG_POWERPMC250 is not set
119# CONFIG_CHESTNUT is not set
120# CONFIG_SPRUCE is not set
121# CONFIG_HDPU is not set
122# CONFIG_EV64260 is not set
123# CONFIG_LOPEC is not set
124# CONFIG_MVME5100 is not set
125# CONFIG_PPLUS is not set
126# CONFIG_PRPMC750 is not set
127# CONFIG_PRPMC800 is not set
128# CONFIG_SANDPOINT is not set
129# CONFIG_RADSTONE_PPC7D is not set
130# CONFIG_PAL4 is not set
131# CONFIG_GEMINI is not set
132# CONFIG_EST8260 is not set
133# CONFIG_SBC82xx is not set
134# CONFIG_SBS8260 is not set
135# CONFIG_RPX8260 is not set
136# CONFIG_TQM8260 is not set
137# CONFIG_ADS8272 is not set
138# CONFIG_PQ2FADS is not set
139# CONFIG_LITE5200 is not set
140# CONFIG_MPC834x_SYS is not set
141# CONFIG_EV64360 is not set
142CONFIG_PPCBUG_NVRAM=y
143# CONFIG_SMP is not set
144# CONFIG_HIGHMEM is not set
145# CONFIG_HZ_100 is not set
146CONFIG_HZ_250=y
147# CONFIG_HZ_1000 is not set
148CONFIG_HZ=250
149CONFIG_PREEMPT_NONE=y
150# CONFIG_PREEMPT_VOLUNTARY is not set
151# CONFIG_PREEMPT is not set
152CONFIG_SELECT_MEMORY_MODEL=y
153CONFIG_FLATMEM_MANUAL=y
154# CONFIG_DISCONTIGMEM_MANUAL is not set
155# CONFIG_SPARSEMEM_MANUAL is not set
156CONFIG_FLATMEM=y
157CONFIG_FLAT_NODE_MEM_MAP=y
158# CONFIG_SPARSEMEM_STATIC is not set
159CONFIG_SPLIT_PTLOCK_CPUS=4
160# CONFIG_RESOURCES_64BIT is not set
161CONFIG_BINFMT_ELF=y
162CONFIG_BINFMT_MISC=m
163CONFIG_PREP_RESIDUAL=y
164CONFIG_PROC_PREPRESIDUAL=y
165# CONFIG_CMDLINE_BOOL is not set
166CONFIG_PM=y
167# CONFIG_PM_LEGACY is not set
168# CONFIG_PM_DEBUG is not set
169CONFIG_HIBERNATION=y
170CONFIG_PM_STD_PARTITION=""
171# CONFIG_SECCOMP is not set
172CONFIG_ISA_DMA_API=y
173
174#
175# Bus options
176#
177CONFIG_ISA=y
178CONFIG_GENERIC_ISA_DMA=y
179CONFIG_PPC_I8259=y
180CONFIG_PPC_INDIRECT_PCI=y
181CONFIG_PCI=y
182CONFIG_PCI_DOMAINS=y
183# CONFIG_PCI_DEBUG is not set
184
185#
186# PCCARD (PCMCIA/CardBus) support
187#
188CONFIG_PCCARD=m
189# CONFIG_PCMCIA_DEBUG is not set
190# CONFIG_PCMCIA is not set
191CONFIG_CARDBUS=y
192
193#
194# PC-card bridges
195#
196CONFIG_YENTA=m
197CONFIG_YENTA_O2=y
198CONFIG_YENTA_RICOH=y
199CONFIG_YENTA_TI=y
200CONFIG_YENTA_ENE_TUNE=y
201CONFIG_YENTA_TOSHIBA=y
202CONFIG_PCMCIA_PROBE=y
203CONFIG_PCCARD_NONSTATIC=m
204
205#
206# Advanced setup
207#
208# CONFIG_ADVANCED_OPTIONS is not set
209
210#
211# Default settings for advanced configuration options are used
212#
213CONFIG_HIGHMEM_START=0xfe000000
214CONFIG_LOWMEM_SIZE=0x30000000
215CONFIG_KERNEL_START=0xc0000000
216CONFIG_TASK_SIZE=0x80000000
217CONFIG_BOOT_LOAD=0x00800000
218
219#
220# Networking
221#
222CONFIG_NET=y
223
224#
225# Networking options
226#
227# CONFIG_NETDEBUG is not set
228CONFIG_PACKET=y
229# CONFIG_PACKET_MMAP is not set
230CONFIG_UNIX=y
231# CONFIG_NET_KEY is not set
232CONFIG_INET=y
233CONFIG_IP_MULTICAST=y
234# CONFIG_IP_ADVANCED_ROUTER is not set
235CONFIG_IP_FIB_HASH=y
236# CONFIG_IP_PNP is not set
237# CONFIG_NET_IPIP is not set
238# CONFIG_NET_IPGRE is not set
239# CONFIG_IP_MROUTE is not set
240# CONFIG_ARPD is not set
241CONFIG_SYN_COOKIES=y
242# CONFIG_INET_AH is not set
243# CONFIG_INET_ESP is not set
244# CONFIG_INET_IPCOMP is not set
245# CONFIG_INET_XFRM_TUNNEL is not set
246# CONFIG_INET_TUNNEL is not set
247# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
248# CONFIG_INET_XFRM_MODE_TUNNEL is not set
249# CONFIG_INET_DIAG is not set
250# CONFIG_TCP_CONG_ADVANCED is not set
251CONFIG_TCP_CONG_BIC=y
252
253#
254# IP: Virtual Server Configuration
255#
256# CONFIG_IP_VS is not set
257# CONFIG_IPV6 is not set
258# CONFIG_INET6_XFRM_TUNNEL is not set
259# CONFIG_INET6_TUNNEL is not set
260# CONFIG_NETWORK_SECMARK is not set
261CONFIG_NETFILTER=y
262# CONFIG_NETFILTER_DEBUG is not set
263
264#
265# Core Netfilter Configuration
266#
267CONFIG_NETFILTER_NETLINK=m
268CONFIG_NETFILTER_NETLINK_QUEUE=m
269CONFIG_NETFILTER_NETLINK_LOG=m
270CONFIG_NETFILTER_XTABLES=m
271CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
272CONFIG_NETFILTER_XT_TARGET_MARK=m
273CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
274CONFIG_NETFILTER_XT_MATCH_COMMENT=m
275CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
276CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
277CONFIG_NETFILTER_XT_MATCH_DCCP=m
278CONFIG_NETFILTER_XT_MATCH_ESP=m
279CONFIG_NETFILTER_XT_MATCH_HELPER=m
280CONFIG_NETFILTER_XT_MATCH_LENGTH=m
281CONFIG_NETFILTER_XT_MATCH_LIMIT=m
282CONFIG_NETFILTER_XT_MATCH_MAC=m
283CONFIG_NETFILTER_XT_MATCH_MARK=m
284CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
285CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
286CONFIG_NETFILTER_XT_MATCH_QUOTA=m
287CONFIG_NETFILTER_XT_MATCH_REALM=m
288CONFIG_NETFILTER_XT_MATCH_SCTP=m
289CONFIG_NETFILTER_XT_MATCH_STATE=m
290CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
291CONFIG_NETFILTER_XT_MATCH_STRING=m
292CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
293
294#
295# IP: Netfilter Configuration
296#
297CONFIG_IP_NF_CONNTRACK=m
298# CONFIG_IP_NF_CT_ACCT is not set
299CONFIG_IP_NF_CONNTRACK_MARK=y
300# CONFIG_IP_NF_CONNTRACK_EVENTS is not set
301# CONFIG_IP_NF_CONNTRACK_NETLINK is not set
302# CONFIG_IP_NF_CT_PROTO_SCTP is not set
303CONFIG_IP_NF_FTP=m
304CONFIG_IP_NF_IRC=m
305# CONFIG_IP_NF_NETBIOS_NS is not set
306CONFIG_IP_NF_TFTP=m
307CONFIG_IP_NF_AMANDA=m
308# CONFIG_IP_NF_PPTP is not set
309# CONFIG_IP_NF_H323 is not set
310# CONFIG_IP_NF_SIP is not set
311CONFIG_IP_NF_QUEUE=m
312# CONFIG_IP_NF_IPTABLES is not set
313# CONFIG_IP_NF_ARPTABLES is not set
314
315#
316# DCCP Configuration (EXPERIMENTAL)
317#
318# CONFIG_IP_DCCP is not set
319
320#
321# SCTP Configuration (EXPERIMENTAL)
322#
323# CONFIG_IP_SCTP is not set
324
325#
326# TIPC Configuration (EXPERIMENTAL)
327#
328# CONFIG_TIPC is not set
329# CONFIG_ATM is not set
330# CONFIG_BRIDGE is not set
331# CONFIG_VLAN_8021Q is not set
332# CONFIG_DECNET is not set
333# CONFIG_LLC2 is not set
334# CONFIG_IPX is not set
335# CONFIG_ATALK is not set
336# CONFIG_X25 is not set
337# CONFIG_LAPB is not set
338# CONFIG_NET_DIVERT is not set
339# CONFIG_ECONET is not set
340# CONFIG_WAN_ROUTER is not set
341
342#
343# QoS and/or fair queueing
344#
345# CONFIG_NET_SCHED is not set
346CONFIG_NET_CLS_ROUTE=y
347
348#
349# Network testing
350#
351# CONFIG_NET_PKTGEN is not set
352# CONFIG_HAMRADIO is not set
353# CONFIG_IRDA is not set
354# CONFIG_BT is not set
355# CONFIG_IEEE80211 is not set
356CONFIG_WIRELESS_EXT=y
357
358#
359# Device Drivers
360#
361
362#
363# Generic Driver Options
364#
365# CONFIG_STANDALONE is not set
366CONFIG_PREVENT_FIRMWARE_BUILD=y
367CONFIG_FW_LOADER=m
368# CONFIG_DEBUG_DRIVER is not set
369# CONFIG_SYS_HYPERVISOR is not set
370
371#
372# Connector - unified userspace <-> kernelspace linker
373#
374# CONFIG_CONNECTOR is not set
375
376#
377# Memory Technology Devices (MTD)
378#
379# CONFIG_MTD is not set
380
381#
382# Parallel port support
383#
384CONFIG_PARPORT=m
385CONFIG_PARPORT_PC=m
386CONFIG_PARPORT_SERIAL=m
387CONFIG_PARPORT_PC_FIFO=y
388CONFIG_PARPORT_PC_SUPERIO=y
389# CONFIG_PARPORT_GSC is not set
390# CONFIG_PARPORT_AX88796 is not set
391CONFIG_PARPORT_1284=y
392
393#
394# Plug and Play support
395#
396# CONFIG_PNP is not set
397
398#
399# Block devices
400#
401CONFIG_BLK_DEV_FD=m
402# CONFIG_BLK_DEV_XD is not set
403# CONFIG_PARIDE is not set
404# CONFIG_BLK_CPQ_DA is not set
405# CONFIG_BLK_CPQ_CISS_DA is not set
406# CONFIG_BLK_DEV_DAC960 is not set
407# CONFIG_BLK_DEV_UMEM is not set
408# CONFIG_BLK_DEV_COW_COMMON is not set
409CONFIG_BLK_DEV_LOOP=y
410# CONFIG_BLK_DEV_CRYPTOLOOP is not set
411# CONFIG_BLK_DEV_NBD is not set
412# CONFIG_BLK_DEV_SX8 is not set
413# CONFIG_BLK_DEV_UB is not set
414CONFIG_BLK_DEV_RAM=y
415CONFIG_BLK_DEV_RAM_COUNT=16
416CONFIG_BLK_DEV_RAM_SIZE=4096
417CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
418CONFIG_BLK_DEV_INITRD=y
419# CONFIG_CDROM_PKTCDVD is not set
420# CONFIG_ATA_OVER_ETH is not set
421
422#
423# ATA/ATAPI/MFM/RLL support
424#
425CONFIG_IDE=y
426CONFIG_BLK_DEV_IDE=y
427
428#
429# Please see Documentation/ide.txt for help/info on IDE drives
430#
431# CONFIG_BLK_DEV_IDE_SATA is not set
432CONFIG_BLK_DEV_IDEDISK=y
433# CONFIG_IDEDISK_MULTI_MODE is not set
434CONFIG_BLK_DEV_IDECD=y
435# CONFIG_BLK_DEV_IDETAPE is not set
436# CONFIG_BLK_DEV_IDEFLOPPY is not set
437CONFIG_BLK_DEV_IDESCSI=y
438# CONFIG_IDE_TASK_IOCTL is not set
439
440#
441# IDE chipset support/bugfixes
442#
443CONFIG_IDE_GENERIC=y
444CONFIG_BLK_DEV_IDEPCI=y
445CONFIG_IDEPCI_SHARE_IRQ=y
446# CONFIG_BLK_DEV_OFFBOARD is not set
447CONFIG_BLK_DEV_GENERIC=y
448# CONFIG_BLK_DEV_OPTI621 is not set
449CONFIG_BLK_DEV_SL82C105=y
450CONFIG_BLK_DEV_IDEDMA_PCI=y
451# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
452CONFIG_IDEDMA_PCI_AUTO=y
453# CONFIG_IDEDMA_ONLYDISK is not set
454# CONFIG_BLK_DEV_AEC62XX is not set
455# CONFIG_BLK_DEV_ALI15X3 is not set
456# CONFIG_BLK_DEV_AMD74XX is not set
457# CONFIG_BLK_DEV_CMD64X is not set
458# CONFIG_BLK_DEV_TRIFLEX is not set
459# CONFIG_BLK_DEV_CY82C693 is not set
460# CONFIG_BLK_DEV_CS5520 is not set
461# CONFIG_BLK_DEV_CS5530 is not set
462# CONFIG_BLK_DEV_HPT34X is not set
463# CONFIG_BLK_DEV_HPT366 is not set
464# CONFIG_BLK_DEV_SC1200 is not set
465# CONFIG_BLK_DEV_PIIX is not set
466# CONFIG_BLK_DEV_IT821X is not set
467# CONFIG_BLK_DEV_NS87415 is not set
468# CONFIG_BLK_DEV_PDC202XX_OLD is not set
469# CONFIG_BLK_DEV_PDC202XX_NEW is not set
470# CONFIG_BLK_DEV_SVWKS is not set
471# CONFIG_BLK_DEV_SIIMAGE is not set
472# CONFIG_BLK_DEV_SLC90E66 is not set
473# CONFIG_BLK_DEV_TRM290 is not set
474# CONFIG_BLK_DEV_VIA82CXXX is not set
475# CONFIG_IDE_ARM is not set
476# CONFIG_IDE_CHIPSETS is not set
477CONFIG_BLK_DEV_IDEDMA=y
478# CONFIG_IDEDMA_IVB is not set
479CONFIG_IDEDMA_AUTO=y
480# CONFIG_BLK_DEV_HD is not set
481
482#
483# SCSI device support
484#
485# CONFIG_RAID_ATTRS is not set
486CONFIG_SCSI=y
487CONFIG_SCSI_PROC_FS=y
488
489#
490# SCSI support type (disk, tape, CD-ROM)
491#
492CONFIG_BLK_DEV_SD=y
493CONFIG_CHR_DEV_ST=y
494# CONFIG_CHR_DEV_OSST is not set
495CONFIG_BLK_DEV_SR=y
496CONFIG_BLK_DEV_SR_VENDOR=y
497CONFIG_CHR_DEV_SG=y
498# CONFIG_CHR_DEV_SCH is not set
499
500#
501# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
502#
503# CONFIG_SCSI_MULTI_LUN is not set
504CONFIG_SCSI_CONSTANTS=y
505CONFIG_SCSI_LOGGING=y
506
507#
508# SCSI Transport Attributes
509#
510CONFIG_SCSI_SPI_ATTRS=y
511# CONFIG_SCSI_FC_ATTRS is not set
512# CONFIG_SCSI_ISCSI_ATTRS is not set
513# CONFIG_SCSI_SAS_ATTRS is not set
514
515#
516# SCSI low-level drivers
517#
518# CONFIG_ISCSI_TCP is not set
519# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
520# CONFIG_SCSI_3W_9XXX is not set
521# CONFIG_SCSI_7000FASST is not set
522# CONFIG_SCSI_ACARD is not set
523# CONFIG_SCSI_AHA152X is not set
524# CONFIG_SCSI_AHA1542 is not set
525# CONFIG_SCSI_AACRAID is not set
526# CONFIG_SCSI_AIC7XXX is not set
527# CONFIG_SCSI_AIC7XXX_OLD is not set
528# CONFIG_SCSI_AIC79XX is not set
529# CONFIG_SCSI_DPT_I2O is not set
530# CONFIG_SCSI_IN2000 is not set
531# CONFIG_MEGARAID_NEWGEN is not set
532# CONFIG_MEGARAID_LEGACY is not set
533# CONFIG_MEGARAID_SAS is not set
534# CONFIG_SCSI_SATA is not set
535# CONFIG_SCSI_HPTIOP is not set
536# CONFIG_SCSI_BUSLOGIC is not set
537# CONFIG_SCSI_DMX3191D is not set
538# CONFIG_SCSI_DTC3280 is not set
539# CONFIG_SCSI_EATA is not set
540# CONFIG_SCSI_FUTURE_DOMAIN is not set
541# CONFIG_SCSI_GDTH is not set
542# CONFIG_SCSI_GENERIC_NCR5380 is not set
543# CONFIG_SCSI_GENERIC_NCR5380_MMIO is not set
544# CONFIG_SCSI_IPS is not set
545# CONFIG_SCSI_INITIO is not set
546# CONFIG_SCSI_INIA100 is not set
547# CONFIG_SCSI_PPA is not set
548# CONFIG_SCSI_IMM is not set
549# CONFIG_SCSI_NCR53C406A is not set
550CONFIG_SCSI_SYM53C8XX_2=y
551CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=0
552CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
553CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
554CONFIG_SCSI_SYM53C8XX_MMIO=y
555# CONFIG_SCSI_IPR is not set
556# CONFIG_SCSI_PAS16 is not set
557# CONFIG_SCSI_PSI240I is not set
558# CONFIG_SCSI_QLOGIC_FAS is not set
559# CONFIG_SCSI_QLOGIC_1280 is not set
560# CONFIG_SCSI_QLA_FC is not set
561# CONFIG_SCSI_LPFC is not set
562# CONFIG_SCSI_SYM53C416 is not set
563# CONFIG_SCSI_DC395x is not set
564# CONFIG_SCSI_DC390T is not set
565# CONFIG_SCSI_T128 is not set
566# CONFIG_SCSI_U14_34F is not set
567# CONFIG_SCSI_NSP32 is not set
568# CONFIG_SCSI_DEBUG is not set
569
570#
571# Old CD-ROM drivers (not SCSI, not IDE)
572#
573# CONFIG_CD_NO_IDESCSI is not set
574
575#
576# Multi-device support (RAID and LVM)
577#
578# CONFIG_MD is not set
579
580#
581# Fusion MPT device support
582#
583# CONFIG_FUSION is not set
584# CONFIG_FUSION_SPI is not set
585# CONFIG_FUSION_FC is not set
586# CONFIG_FUSION_SAS is not set
587
588#
589# IEEE 1394 (FireWire) support
590#
591CONFIG_IEEE1394=m
592
593#
594# Subsystem Options
595#
596# CONFIG_IEEE1394_VERBOSEDEBUG is not set
597CONFIG_IEEE1394_OUI_DB=y
598CONFIG_IEEE1394_EXTRA_CONFIG_ROMS=y
599CONFIG_IEEE1394_CONFIG_ROM_IP1394=y
600# CONFIG_IEEE1394_EXPORT_FULL_API is not set
601
602#
603# Device Drivers
604#
605# CONFIG_IEEE1394_PCILYNX is not set
606CONFIG_IEEE1394_OHCI1394=m
607
608#
609# Protocol Drivers
610#
611CONFIG_IEEE1394_VIDEO1394=m
612CONFIG_IEEE1394_SBP2=m
613CONFIG_IEEE1394_ETH1394=m
614CONFIG_IEEE1394_DV1394=m
615CONFIG_IEEE1394_RAWIO=m
616
617#
618# I2O device support
619#
620# CONFIG_I2O is not set
621
622#
623# Macintosh device drivers
624#
625# CONFIG_WINDFARM is not set
626
627#
628# Network device support
629#
630CONFIG_NETDEVICES=y
631# CONFIG_DUMMY is not set
632# CONFIG_BONDING is not set
633# CONFIG_EQUALIZER is not set
634CONFIG_TUN=m
635
636#
637# ARCnet devices
638#
639# CONFIG_ARCNET is not set
640
641#
642# PHY device support
643#
644# CONFIG_PHYLIB is not set
645
646#
647# Ethernet (10 or 100Mbit)
648#
649CONFIG_NET_ETHERNET=y
650CONFIG_MII=y
651# CONFIG_HAPPYMEAL is not set
652# CONFIG_SUNGEM is not set
653# CONFIG_CASSINI is not set
654# CONFIG_NET_VENDOR_3COM is not set
655# CONFIG_LANCE is not set
656# CONFIG_NET_VENDOR_SMC is not set
657# CONFIG_NET_VENDOR_RACAL is not set
658
659#
660# Tulip family network device support
661#
662CONFIG_NET_TULIP=y
663CONFIG_DE2104X=y
664CONFIG_TULIP=y
665# CONFIG_TULIP_MWI is not set
666CONFIG_TULIP_MMIO=y
667# CONFIG_TULIP_NAPI is not set
668CONFIG_DE4X5=m
669# CONFIG_WINBOND_840 is not set
670# CONFIG_DM9102 is not set
671# CONFIG_ULI526X is not set
672# CONFIG_PCMCIA_XIRCOM is not set
673# CONFIG_PCMCIA_XIRTULIP is not set
674# CONFIG_AT1700 is not set
675# CONFIG_DEPCA is not set
676# CONFIG_HP100 is not set
677# CONFIG_NET_ISA is not set
678CONFIG_NET_PCI=y
679CONFIG_PCNET32=y
680# CONFIG_AMD8111_ETH is not set
681# CONFIG_ADAPTEC_STARFIRE is not set
682# CONFIG_AC3200 is not set
683# CONFIG_APRICOT is not set
684# CONFIG_B44 is not set
685# CONFIG_FORCEDETH is not set
686# CONFIG_CS89x0 is not set
687# CONFIG_DGRS is not set
688# CONFIG_EEPRO100 is not set
689# CONFIG_E100 is not set
690# CONFIG_FEALNX is not set
691# CONFIG_NATSEMI is not set
692# CONFIG_NE2K_PCI is not set
693# CONFIG_8139CP is not set
694# CONFIG_8139TOO is not set
695# CONFIG_SIS900 is not set
696# CONFIG_EPIC100 is not set
697# CONFIG_SUNDANCE is not set
698# CONFIG_TLAN is not set
699# CONFIG_VIA_RHINE is not set
700# CONFIG_NET_POCKET is not set
701
702#
703# Ethernet (1000 Mbit)
704#
705# CONFIG_ACENIC is not set
706# CONFIG_DL2K is not set
707# CONFIG_E1000 is not set
708# CONFIG_NS83820 is not set
709# CONFIG_HAMACHI is not set
710# CONFIG_YELLOWFIN is not set
711# CONFIG_R8169 is not set
712# CONFIG_SIS190 is not set
713# CONFIG_SKGE is not set
714# CONFIG_SKY2 is not set
715# CONFIG_SK98LIN is not set
716# CONFIG_VIA_VELOCITY is not set
717# CONFIG_TIGON3 is not set
718# CONFIG_BNX2 is not set
719
720#
721# Ethernet (10000 Mbit)
722#
723# CONFIG_CHELSIO_T1 is not set
724# CONFIG_IXGB is not set
725# CONFIG_S2IO is not set
726# CONFIG_MYRI10GE is not set
727
728#
729# Token Ring devices
730#
731# CONFIG_TR is not set
732
733#
734# Wireless LAN (non-hamradio)
735#
736CONFIG_NET_RADIO=y
737# CONFIG_NET_WIRELESS_RTNETLINK is not set
738
739#
740# Obsolete Wireless cards support (pre-802.11)
741#
742# CONFIG_STRIP is not set
743# CONFIG_ARLAN is not set
744# CONFIG_WAVELAN is not set
745
746#
747# Wireless 802.11b ISA/PCI cards support
748#
749# CONFIG_IPW2100 is not set
750# CONFIG_IPW2200 is not set
751# CONFIG_AIRO is not set
752CONFIG_HERMES=m
753# CONFIG_PLX_HERMES is not set
754# CONFIG_TMD_HERMES is not set
755# CONFIG_NORTEL_HERMES is not set
756# CONFIG_PCI_HERMES is not set
757# CONFIG_ATMEL is not set
758
759#
760# Prism GT/Duette 802.11(a/b/g) PCI/Cardbus support
761#
762# CONFIG_PRISM54 is not set
763# CONFIG_USB_ZD1201 is not set
764# CONFIG_HOSTAP is not set
765CONFIG_NET_WIRELESS=y
766
767#
768# Wan interfaces
769#
770# CONFIG_WAN is not set
771# CONFIG_FDDI is not set
772# CONFIG_HIPPI is not set
773# CONFIG_PLIP is not set
774CONFIG_PPP=y
775CONFIG_PPP_MULTILINK=y
776CONFIG_PPP_FILTER=y
777CONFIG_PPP_ASYNC=y
778# CONFIG_PPP_SYNC_TTY is not set
779CONFIG_PPP_DEFLATE=y
780CONFIG_PPP_BSDCOMP=m
781# CONFIG_PPP_MPPE is not set
782CONFIG_PPPOE=m
783# CONFIG_SLIP is not set
784# CONFIG_NET_FC is not set
785# CONFIG_SHAPER is not set
786CONFIG_NETCONSOLE=m
787CONFIG_NETPOLL=y
788# CONFIG_NETPOLL_RX is not set
789# CONFIG_NETPOLL_TRAP is not set
790CONFIG_NET_POLL_CONTROLLER=y
791
792#
793# ISDN subsystem
794#
795# CONFIG_ISDN is not set
796
797#
798# Telephony Support
799#
800# CONFIG_PHONE is not set
801
802#
803# Input device support
804#
805CONFIG_INPUT=y
806
807#
808# Userland interfaces
809#
810CONFIG_INPUT_MOUSEDEV=y
811# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
812CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
813CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
814# CONFIG_INPUT_JOYDEV is not set
815# CONFIG_INPUT_TSDEV is not set
816CONFIG_INPUT_EVDEV=y
817CONFIG_INPUT_EVBUG=m
818
819#
820# Input Device Drivers
821#
822CONFIG_INPUT_KEYBOARD=y
823CONFIG_KEYBOARD_ATKBD=y
824# CONFIG_KEYBOARD_SUNKBD is not set
825# CONFIG_KEYBOARD_LKKBD is not set
826# CONFIG_KEYBOARD_XTKBD is not set
827# CONFIG_KEYBOARD_NEWTON is not set
828CONFIG_INPUT_MOUSE=y
829CONFIG_MOUSE_PS2=y
830# CONFIG_MOUSE_SERIAL is not set
831# CONFIG_MOUSE_INPORT is not set
832# CONFIG_MOUSE_LOGIBM is not set
833# CONFIG_MOUSE_PC110PAD is not set
834# CONFIG_MOUSE_VSXXXAA is not set
835# CONFIG_INPUT_JOYSTICK is not set
836# CONFIG_INPUT_TOUCHSCREEN is not set
837CONFIG_INPUT_MISC=y
838CONFIG_INPUT_PCSPKR=m
839CONFIG_INPUT_UINPUT=m
840
841#
842# Hardware I/O ports
843#
844CONFIG_SERIO=y
845CONFIG_SERIO_I8042=y
846# CONFIG_SERIO_SERPORT is not set
847# CONFIG_SERIO_PARKBD is not set
848# CONFIG_SERIO_PCIPS2 is not set
849CONFIG_SERIO_LIBPS2=y
850# CONFIG_SERIO_RAW is not set
851# CONFIG_GAMEPORT is not set
852
853#
854# Character devices
855#
856CONFIG_VT=y
857CONFIG_VT_CONSOLE=y
858CONFIG_HW_CONSOLE=y
859# CONFIG_VT_HW_CONSOLE_BINDING is not set
860# CONFIG_SERIAL_NONSTANDARD is not set
861
862#
863# Serial drivers
864#
865CONFIG_SERIAL_8250=y
866CONFIG_SERIAL_8250_CONSOLE=y
867CONFIG_SERIAL_8250_PCI=y
868CONFIG_SERIAL_8250_NR_UARTS=4
869CONFIG_SERIAL_8250_RUNTIME_UARTS=4
870# CONFIG_SERIAL_8250_EXTENDED is not set
871
872#
873# Non-8250 serial port support
874#
875CONFIG_SERIAL_CORE=y
876CONFIG_SERIAL_CORE_CONSOLE=y
877# CONFIG_SERIAL_JSM is not set
878CONFIG_UNIX98_PTYS=y
879CONFIG_LEGACY_PTYS=y
880CONFIG_LEGACY_PTY_COUNT=256
881# CONFIG_PRINTER is not set
882# CONFIG_PPDEV is not set
883# CONFIG_TIPAR is not set
884
885#
886# IPMI
887#
888# CONFIG_IPMI_HANDLER is not set
889
890#
891# Watchdog Cards
892#
893# CONFIG_WATCHDOG is not set
894# CONFIG_HW_RANDOM is not set
895CONFIG_NVRAM=y
896CONFIG_GEN_RTC=y
897# CONFIG_GEN_RTC_X is not set
898# CONFIG_DTLK is not set
899# CONFIG_R3964 is not set
900# CONFIG_APPLICOM is not set
901
902#
903# Ftape, the floppy tape device driver
904#
905# CONFIG_AGP is not set
906# CONFIG_DRM is not set
907# CONFIG_RAW_DRIVER is not set
908
909#
910# TPM devices
911#
912# CONFIG_TCG_TPM is not set
913# CONFIG_TELCLOCK is not set
914
915#
916# I2C support
917#
918CONFIG_I2C=y
919CONFIG_I2C_CHARDEV=m
920
921#
922# I2C Algorithms
923#
924CONFIG_I2C_ALGOBIT=y
925# CONFIG_I2C_ALGOPCF is not set
926# CONFIG_I2C_ALGOPCA is not set
927
928#
929# I2C Hardware Bus support
930#
931# CONFIG_I2C_ALI1535 is not set
932# CONFIG_I2C_ALI1563 is not set
933# CONFIG_I2C_ALI15X3 is not set
934# CONFIG_I2C_AMD756 is not set
935# CONFIG_I2C_AMD8111 is not set
936# CONFIG_I2C_ELEKTOR is not set
937# CONFIG_I2C_I801 is not set
938# CONFIG_I2C_I810 is not set
939# CONFIG_I2C_PIIX4 is not set
940# CONFIG_I2C_MPC is not set
941# CONFIG_I2C_NFORCE2 is not set
942# CONFIG_I2C_OCORES is not set
943# CONFIG_I2C_PARPORT is not set
944# CONFIG_I2C_PARPORT_LIGHT is not set
945# CONFIG_I2C_PROSAVAGE is not set
946# CONFIG_I2C_SAVAGE4 is not set
947# CONFIG_I2C_SIS5595 is not set
948# CONFIG_I2C_SIS630 is not set
949# CONFIG_I2C_SIS96X is not set
950# CONFIG_I2C_STUB is not set
951# CONFIG_I2C_VIA is not set
952# CONFIG_I2C_VIAPRO is not set
953# CONFIG_I2C_VOODOO3 is not set
954# CONFIG_I2C_PCA_ISA is not set
955
956#
957# Miscellaneous I2C Chip support
958#
959# CONFIG_SENSORS_DS1337 is not set
960# CONFIG_SENSORS_DS1374 is not set
961# CONFIG_SENSORS_EEPROM is not set
962# CONFIG_SENSORS_PCF8574 is not set
963# CONFIG_SENSORS_PCA9539 is not set
964# CONFIG_SENSORS_PCF8591 is not set
965# CONFIG_SENSORS_M41T00 is not set
966# CONFIG_SENSORS_MAX6875 is not set
967# CONFIG_I2C_DEBUG_CORE is not set
968# CONFIG_I2C_DEBUG_ALGO is not set
969# CONFIG_I2C_DEBUG_BUS is not set
970# CONFIG_I2C_DEBUG_CHIP is not set
971
972#
973# SPI support
974#
975# CONFIG_SPI is not set
976# CONFIG_SPI_MASTER is not set
977
978#
979# Dallas's 1-wire bus
980#
981
982#
983# Hardware Monitoring support
984#
985# CONFIG_HWMON is not set
986# CONFIG_HWMON_VID is not set
987
988#
989# Misc devices
990#
991
992#
993# Multimedia devices
994#
995# CONFIG_VIDEO_DEV is not set
996CONFIG_VIDEO_V4L2=y
997
998#
999# Digital Video Broadcasting Devices
1000#
1001# CONFIG_DVB is not set
1002# CONFIG_USB_DABUSB is not set
1003
1004#
1005# Graphics support
1006#
1007# CONFIG_FIRMWARE_EDID is not set
1008CONFIG_FB=y
1009CONFIG_FB_CFB_FILLRECT=y
1010CONFIG_FB_CFB_COPYAREA=y
1011CONFIG_FB_CFB_IMAGEBLIT=y
1012# CONFIG_FB_MACMODES is not set
1013# CONFIG_FB_BACKLIGHT is not set
1014CONFIG_FB_MODE_HELPERS=y
1015CONFIG_FB_TILEBLITTING=y
1016# CONFIG_FB_CIRRUS is not set
1017# CONFIG_FB_PM2 is not set
1018# CONFIG_FB_CYBER2000 is not set
1019# CONFIG_FB_CT65550 is not set
1020# CONFIG_FB_ASILIANT is not set
1021# CONFIG_FB_IMSTT is not set
1022# CONFIG_FB_VGA16 is not set
1023# CONFIG_FB_S1D13XXX is not set
1024# CONFIG_FB_NVIDIA is not set
1025# CONFIG_FB_RIVA is not set
1026CONFIG_FB_MATROX=y
1027CONFIG_FB_MATROX_MILLENIUM=y
1028CONFIG_FB_MATROX_MYSTIQUE=y
1029CONFIG_FB_MATROX_G=y
1030CONFIG_FB_MATROX_I2C=y
1031CONFIG_FB_MATROX_MAVEN=m
1032# CONFIG_FB_MATROX_MULTIHEAD is not set
1033# CONFIG_FB_RADEON is not set
1034# CONFIG_FB_ATY128 is not set
1035# CONFIG_FB_ATY is not set
1036# CONFIG_FB_SAVAGE is not set
1037# CONFIG_FB_SIS is not set
1038# CONFIG_FB_NEOMAGIC is not set
1039# CONFIG_FB_KYRO is not set
1040# CONFIG_FB_3DFX is not set
1041# CONFIG_FB_VOODOO1 is not set
1042# CONFIG_FB_TRIDENT is not set
1043# CONFIG_FB_VIRTUAL is not set
1044
1045#
1046# Console display driver support
1047#
1048CONFIG_VGA_CONSOLE=y
1049# CONFIG_VGACON_SOFT_SCROLLBACK is not set
1050# CONFIG_MDA_CONSOLE is not set
1051CONFIG_DUMMY_CONSOLE=y
1052CONFIG_FRAMEBUFFER_CONSOLE=y
1053# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
1054# CONFIG_FONTS is not set
1055CONFIG_FONT_8x8=y
1056CONFIG_FONT_8x16=y
1057
1058#
1059# Logo configuration
1060#
1061CONFIG_LOGO=y
1062# CONFIG_LOGO_LINUX_MONO is not set
1063# CONFIG_LOGO_LINUX_VGA16 is not set
1064CONFIG_LOGO_LINUX_CLUT224=y
1065# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
1066
1067#
1068# Sound
1069#
1070CONFIG_SOUND=m
1071
1072#
1073# Advanced Linux Sound Architecture
1074#
1075CONFIG_SND=m
1076CONFIG_SND_TIMER=m
1077CONFIG_SND_PCM=m
1078CONFIG_SND_HWDEP=m
1079CONFIG_SND_RAWMIDI=m
1080CONFIG_SND_SEQUENCER=m
1081# CONFIG_SND_SEQ_DUMMY is not set
1082CONFIG_SND_OSSEMUL=y
1083CONFIG_SND_MIXER_OSS=m
1084CONFIG_SND_PCM_OSS=m
1085CONFIG_SND_PCM_OSS_PLUGINS=y
1086CONFIG_SND_SEQUENCER_OSS=y
1087# CONFIG_SND_DYNAMIC_MINORS is not set
1088CONFIG_SND_SUPPORT_OLD_API=y
1089CONFIG_SND_VERBOSE_PROCFS=y
1090# CONFIG_SND_VERBOSE_PRINTK is not set
1091# CONFIG_SND_DEBUG is not set
1092
1093#
1094# Generic devices
1095#
1096CONFIG_SND_MPU401_UART=m
1097CONFIG_SND_OPL3_LIB=m
1098# CONFIG_SND_DUMMY is not set
1099# CONFIG_SND_VIRMIDI is not set
1100# CONFIG_SND_MTPAV is not set
1101# CONFIG_SND_SERIAL_U16550 is not set
1102# CONFIG_SND_MPU401 is not set
1103
1104#
1105# ISA devices
1106#
1107CONFIG_SND_CS4231_LIB=m
1108# CONFIG_SND_ADLIB is not set
1109# CONFIG_SND_AD1848 is not set
1110# CONFIG_SND_CMI8330 is not set
1111# CONFIG_SND_CS4231 is not set
1112CONFIG_SND_CS4232=m
1113# CONFIG_SND_CS4236 is not set
1114# CONFIG_SND_ES1688 is not set
1115# CONFIG_SND_ES18XX is not set
1116# CONFIG_SND_GUSCLASSIC is not set
1117# CONFIG_SND_GUSEXTREME is not set
1118# CONFIG_SND_GUSMAX is not set
1119# CONFIG_SND_OPL3SA2 is not set
1120# CONFIG_SND_OPTI92X_AD1848 is not set
1121# CONFIG_SND_OPTI92X_CS4231 is not set
1122# CONFIG_SND_OPTI93X is not set
1123# CONFIG_SND_MIRO is not set
1124# CONFIG_SND_SB8 is not set
1125# CONFIG_SND_SB16 is not set
1126# CONFIG_SND_SBAWE is not set
1127# CONFIG_SND_SGALAXY is not set
1128# CONFIG_SND_SSCAPE is not set
1129# CONFIG_SND_WAVEFRONT is not set
1130
1131#
1132# PCI devices
1133#
1134# CONFIG_SND_AD1889 is not set
1135# CONFIG_SND_ALS300 is not set
1136# CONFIG_SND_ALS4000 is not set
1137# CONFIG_SND_ALI5451 is not set
1138# CONFIG_SND_ATIIXP is not set
1139# CONFIG_SND_ATIIXP_MODEM is not set
1140# CONFIG_SND_AU8810 is not set
1141# CONFIG_SND_AU8820 is not set
1142# CONFIG_SND_AU8830 is not set
1143# CONFIG_SND_AZT3328 is not set
1144# CONFIG_SND_BT87X is not set
1145# CONFIG_SND_CA0106 is not set
1146# CONFIG_SND_CMIPCI is not set
1147# CONFIG_SND_CS4281 is not set
1148# CONFIG_SND_CS46XX is not set
1149# CONFIG_SND_DARLA20 is not set
1150# CONFIG_SND_GINA20 is not set
1151# CONFIG_SND_LAYLA20 is not set
1152# CONFIG_SND_DARLA24 is not set
1153# CONFIG_SND_GINA24 is not set
1154# CONFIG_SND_LAYLA24 is not set
1155# CONFIG_SND_MONA is not set
1156# CONFIG_SND_MIA is not set
1157# CONFIG_SND_ECHO3G is not set
1158# CONFIG_SND_INDIGO is not set
1159# CONFIG_SND_INDIGOIO is not set
1160# CONFIG_SND_INDIGODJ is not set
1161# CONFIG_SND_EMU10K1 is not set
1162# CONFIG_SND_EMU10K1X is not set
1163# CONFIG_SND_ENS1370 is not set
1164# CONFIG_SND_ENS1371 is not set
1165# CONFIG_SND_ES1938 is not set
1166# CONFIG_SND_ES1968 is not set
1167# CONFIG_SND_FM801 is not set
1168# CONFIG_SND_HDA_INTEL is not set
1169# CONFIG_SND_HDSP is not set
1170# CONFIG_SND_HDSPM is not set
1171# CONFIG_SND_ICE1712 is not set
1172# CONFIG_SND_ICE1724 is not set
1173# CONFIG_SND_INTEL8X0 is not set
1174# CONFIG_SND_INTEL8X0M is not set
1175# CONFIG_SND_KORG1212 is not set
1176# CONFIG_SND_MAESTRO3 is not set
1177# CONFIG_SND_MIXART is not set
1178# CONFIG_SND_NM256 is not set
1179# CONFIG_SND_PCXHR is not set
1180# CONFIG_SND_RIPTIDE is not set
1181# CONFIG_SND_RME32 is not set
1182# CONFIG_SND_RME96 is not set
1183# CONFIG_SND_RME9652 is not set
1184# CONFIG_SND_SONICVIBES is not set
1185# CONFIG_SND_TRIDENT is not set
1186# CONFIG_SND_VIA82XX is not set
1187# CONFIG_SND_VIA82XX_MODEM is not set
1188# CONFIG_SND_VX222 is not set
1189# CONFIG_SND_YMFPCI is not set
1190
1191#
1192# ALSA PowerMac devices
1193#
1194
1195#
1196# Apple Onboard Audio driver
1197#
1198# CONFIG_SND_AOA is not set
1199# CONFIG_SND_AOA_SOUNDBUS is not set
1200
1201#
1202# USB devices
1203#
1204CONFIG_SND_USB_AUDIO=m
1205# CONFIG_SND_USB_USX2Y is not set
1206
1207#
1208# Open Sound System
1209#
1210# CONFIG_SOUND_PRIME is not set
1211
1212#
1213# USB support
1214#
1215CONFIG_USB_ARCH_HAS_HCD=y
1216CONFIG_USB_ARCH_HAS_OHCI=y
1217CONFIG_USB_ARCH_HAS_EHCI=y
1218CONFIG_USB=y
1219# CONFIG_USB_DEBUG is not set
1220
1221#
1222# Miscellaneous USB options
1223#
1224CONFIG_USB_DEVICEFS=y
1225# CONFIG_USB_BANDWIDTH is not set
1226# CONFIG_USB_DYNAMIC_MINORS is not set
1227# CONFIG_USB_SUSPEND is not set
1228# CONFIG_USB_OTG is not set
1229
1230#
1231# USB Host Controller Drivers
1232#
1233CONFIG_USB_EHCI_HCD=m
1234CONFIG_USB_EHCI_SPLIT_ISO=y
1235CONFIG_USB_EHCI_ROOT_HUB_TT=y
1236# CONFIG_USB_EHCI_TT_NEWSCHED is not set
1237# CONFIG_USB_ISP116X_HCD is not set
1238CONFIG_USB_OHCI_HCD=y
1239# CONFIG_USB_OHCI_BIG_ENDIAN is not set
1240CONFIG_USB_OHCI_LITTLE_ENDIAN=y
1241CONFIG_USB_UHCI_HCD=m
1242# CONFIG_USB_SL811_HCD is not set
1243
1244#
1245# USB Device Class drivers
1246#
1247CONFIG_USB_ACM=m
1248CONFIG_USB_PRINTER=m
1249
1250#
1251# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
1252#
1253
1254#
1255# may also be needed; see USB_STORAGE Help for more information
1256#
1257CONFIG_USB_STORAGE=m
1258# CONFIG_USB_STORAGE_DEBUG is not set
1259CONFIG_USB_STORAGE_DATAFAB=y
1260CONFIG_USB_STORAGE_FREECOM=y
1261CONFIG_USB_STORAGE_ISD200=y
1262CONFIG_USB_STORAGE_DPCM=y
1263CONFIG_USB_STORAGE_USBAT=y
1264CONFIG_USB_STORAGE_SDDR09=y
1265CONFIG_USB_STORAGE_SDDR55=y
1266CONFIG_USB_STORAGE_JUMPSHOT=y
1267# CONFIG_USB_STORAGE_ALAUDA is not set
1268# CONFIG_USB_LIBUSUAL is not set
1269
1270#
1271# USB Input Devices
1272#
1273CONFIG_USB_HID=y
1274CONFIG_USB_HIDINPUT=y
1275# CONFIG_USB_HIDINPUT_POWERBOOK is not set
1276# CONFIG_HID_FF is not set
1277CONFIG_USB_HIDDEV=y
1278# CONFIG_USB_AIPTEK is not set
1279# CONFIG_USB_WACOM is not set
1280# CONFIG_USB_ACECAD is not set
1281# CONFIG_USB_KBTAB is not set
1282# CONFIG_USB_POWERMATE is not set
1283# CONFIG_USB_TOUCHSCREEN is not set
1284# CONFIG_USB_YEALINK is not set
1285# CONFIG_USB_XPAD is not set
1286# CONFIG_USB_ATI_REMOTE is not set
1287# CONFIG_USB_ATI_REMOTE2 is not set
1288# CONFIG_USB_KEYSPAN_REMOTE is not set
1289# CONFIG_USB_APPLETOUCH is not set
1290
1291#
1292# USB Imaging devices
1293#
1294# CONFIG_USB_MDC800 is not set
1295# CONFIG_USB_MICROTEK is not set
1296
1297#
1298# USB Network Adapters
1299#
1300# CONFIG_USB_CATC is not set
1301# CONFIG_USB_KAWETH is not set
1302CONFIG_USB_PEGASUS=m
1303# CONFIG_USB_RTL8150 is not set
1304# CONFIG_USB_USBNET is not set
1305# CONFIG_USB_MON is not set
1306
1307#
1308# USB port drivers
1309#
1310# CONFIG_USB_USS720 is not set
1311
1312#
1313# USB Serial Converter support
1314#
1315CONFIG_USB_SERIAL=m
1316# CONFIG_USB_SERIAL_GENERIC is not set
1317# CONFIG_USB_SERIAL_AIRPRIME is not set
1318# CONFIG_USB_SERIAL_ARK3116 is not set
1319# CONFIG_USB_SERIAL_BELKIN is not set
1320# CONFIG_USB_SERIAL_WHITEHEAT is not set
1321# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
1322# CONFIG_USB_SERIAL_CP2101 is not set
1323# CONFIG_USB_SERIAL_CYPRESS_M8 is not set
1324# CONFIG_USB_SERIAL_EMPEG is not set
1325# CONFIG_USB_SERIAL_FTDI_SIO is not set
1326# CONFIG_USB_SERIAL_FUNSOFT is not set
1327CONFIG_USB_SERIAL_VISOR=m
1328# CONFIG_USB_SERIAL_IPAQ is not set
1329# CONFIG_USB_SERIAL_IR is not set
1330# CONFIG_USB_SERIAL_EDGEPORT is not set
1331# CONFIG_USB_SERIAL_EDGEPORT_TI is not set
1332# CONFIG_USB_SERIAL_GARMIN is not set
1333# CONFIG_USB_SERIAL_IPW is not set
1334# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
1335CONFIG_USB_SERIAL_KEYSPAN=m
1336CONFIG_USB_SERIAL_KEYSPAN_MPR=y
1337CONFIG_USB_SERIAL_KEYSPAN_USA28=y
1338CONFIG_USB_SERIAL_KEYSPAN_USA28X=y
1339CONFIG_USB_SERIAL_KEYSPAN_USA28XA=y
1340CONFIG_USB_SERIAL_KEYSPAN_USA28XB=y
1341CONFIG_USB_SERIAL_KEYSPAN_USA19=y
1342CONFIG_USB_SERIAL_KEYSPAN_USA18X=y
1343CONFIG_USB_SERIAL_KEYSPAN_USA19W=y
1344CONFIG_USB_SERIAL_KEYSPAN_USA19QW=y
1345CONFIG_USB_SERIAL_KEYSPAN_USA19QI=y
1346CONFIG_USB_SERIAL_KEYSPAN_USA49W=y
1347CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y
1348# CONFIG_USB_SERIAL_KLSI is not set
1349# CONFIG_USB_SERIAL_KOBIL_SCT is not set
1350# CONFIG_USB_SERIAL_MCT_U232 is not set
1351# CONFIG_USB_SERIAL_NAVMAN is not set
1352# CONFIG_USB_SERIAL_PL2303 is not set
1353# CONFIG_USB_SERIAL_HP4X is not set
1354# CONFIG_USB_SERIAL_SAFE is not set
1355# CONFIG_USB_SERIAL_SIERRAWIRELESS is not set
1356# CONFIG_USB_SERIAL_TI is not set
1357# CONFIG_USB_SERIAL_CYBERJACK is not set
1358# CONFIG_USB_SERIAL_XIRCOM is not set
1359# CONFIG_USB_SERIAL_OPTION is not set
1360# CONFIG_USB_SERIAL_OMNINET is not set
1361CONFIG_USB_EZUSB=y
1362
1363#
1364# USB Miscellaneous drivers
1365#
1366# CONFIG_USB_EMI62 is not set
1367# CONFIG_USB_EMI26 is not set
1368# CONFIG_USB_AUERSWALD is not set
1369# CONFIG_USB_RIO500 is not set
1370# CONFIG_USB_LEGOTOWER is not set
1371# CONFIG_USB_LCD is not set
1372# CONFIG_USB_LED is not set
1373# CONFIG_USB_CYPRESS_CY7C63 is not set
1374# CONFIG_USB_CYTHERM is not set
1375# CONFIG_USB_PHIDGETKIT is not set
1376# CONFIG_USB_PHIDGETSERVO is not set
1377# CONFIG_USB_IDMOUSE is not set
1378# CONFIG_USB_APPLEDISPLAY is not set
1379# CONFIG_USB_SISUSBVGA is not set
1380# CONFIG_USB_LD is not set
1381# CONFIG_USB_TEST is not set
1382
1383#
1384# USB DSL modem support
1385#
1386
1387#
1388# USB Gadget Support
1389#
1390# CONFIG_USB_GADGET is not set
1391
1392#
1393# MMC/SD Card support
1394#
1395# CONFIG_MMC is not set
1396
1397#
1398# LED devices
1399#
1400# CONFIG_NEW_LEDS is not set
1401
1402#
1403# LED drivers
1404#
1405
1406#
1407# LED Triggers
1408#
1409
1410#
1411# InfiniBand support
1412#
1413# CONFIG_INFINIBAND is not set
1414
1415#
1416# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
1417#
1418
1419#
1420# Real Time Clock
1421#
1422# CONFIG_RTC_CLASS is not set
1423
1424#
1425# DMA Engine support
1426#
1427# CONFIG_DMA_ENGINE is not set
1428
1429#
1430# DMA Clients
1431#
1432
1433#
1434# DMA Devices
1435#
1436
1437#
1438# File systems
1439#
1440CONFIG_EXT2_FS=y
1441CONFIG_EXT2_FS_XATTR=y
1442CONFIG_EXT2_FS_POSIX_ACL=y
1443CONFIG_EXT2_FS_SECURITY=y
1444# CONFIG_EXT2_FS_XIP is not set
1445CONFIG_EXT3_FS=y
1446CONFIG_EXT3_FS_XATTR=y
1447CONFIG_EXT3_FS_POSIX_ACL=y
1448CONFIG_EXT3_FS_SECURITY=y
1449CONFIG_JBD=y
1450# CONFIG_JBD_DEBUG is not set
1451CONFIG_FS_MBCACHE=y
1452CONFIG_REISERFS_FS=y
1453# CONFIG_REISERFS_CHECK is not set
1454# CONFIG_REISERFS_PROC_INFO is not set
1455CONFIG_REISERFS_FS_XATTR=y
1456CONFIG_REISERFS_FS_POSIX_ACL=y
1457CONFIG_REISERFS_FS_SECURITY=y
1458CONFIG_JFS_FS=m
1459CONFIG_JFS_POSIX_ACL=y
1460CONFIG_JFS_SECURITY=y
1461# CONFIG_JFS_DEBUG is not set
1462# CONFIG_JFS_STATISTICS is not set
1463CONFIG_FS_POSIX_ACL=y
1464CONFIG_XFS_FS=m
1465# CONFIG_XFS_QUOTA is not set
1466CONFIG_XFS_SECURITY=y
1467CONFIG_XFS_POSIX_ACL=y
1468# CONFIG_XFS_RT is not set
1469# CONFIG_OCFS2_FS is not set
1470# CONFIG_MINIX_FS is not set
1471# CONFIG_ROMFS_FS is not set
1472CONFIG_INOTIFY=y
1473CONFIG_INOTIFY_USER=y
1474# CONFIG_QUOTA is not set
1475CONFIG_DNOTIFY=y
1476# CONFIG_AUTOFS_FS is not set
1477CONFIG_AUTOFS4_FS=m
1478# CONFIG_FUSE_FS is not set
1479
1480#
1481# CD-ROM/DVD Filesystems
1482#
1483CONFIG_ISO9660_FS=y
1484# CONFIG_JOLIET is not set
1485# CONFIG_ZISOFS is not set
1486CONFIG_UDF_FS=m
1487CONFIG_UDF_NLS=y
1488
1489#
1490# DOS/FAT/NT Filesystems
1491#
1492CONFIG_FAT_FS=m
1493CONFIG_MSDOS_FS=m
1494CONFIG_VFAT_FS=m
1495CONFIG_FAT_DEFAULT_CODEPAGE=437
1496CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
1497# CONFIG_NTFS_FS is not set
1498
1499#
1500# Pseudo filesystems
1501#
1502CONFIG_PROC_FS=y
1503CONFIG_PROC_KCORE=y
1504CONFIG_SYSFS=y
1505CONFIG_TMPFS=y
1506# CONFIG_HUGETLB_PAGE is not set
1507CONFIG_RAMFS=y
1508# CONFIG_CONFIGFS_FS is not set
1509
1510#
1511# Miscellaneous filesystems
1512#
1513# CONFIG_ADFS_FS is not set
1514# CONFIG_AFFS_FS is not set
1515CONFIG_HFS_FS=m
1516CONFIG_HFSPLUS_FS=m
1517# CONFIG_BEFS_FS is not set
1518# CONFIG_BFS_FS is not set
1519# CONFIG_EFS_FS is not set
1520CONFIG_CRAMFS=m
1521# CONFIG_VXFS_FS is not set
1522# CONFIG_HPFS_FS is not set
1523# CONFIG_QNX4FS_FS is not set
1524# CONFIG_SYSV_FS is not set
1525CONFIG_UFS_FS=m
1526# CONFIG_UFS_FS_WRITE is not set
1527# CONFIG_UFS_DEBUG is not set
1528
1529#
1530# Network File Systems
1531#
1532CONFIG_NFS_FS=y
1533CONFIG_NFS_V3=y
1534CONFIG_NFS_V3_ACL=y
1535# CONFIG_NFS_V4 is not set
1536# CONFIG_NFS_DIRECTIO is not set
1537CONFIG_NFSD=y
1538CONFIG_NFSD_V2_ACL=y
1539CONFIG_NFSD_V3=y
1540CONFIG_NFSD_V3_ACL=y
1541# CONFIG_NFSD_V4 is not set
1542CONFIG_NFSD_TCP=y
1543CONFIG_LOCKD=y
1544CONFIG_LOCKD_V4=y
1545CONFIG_EXPORTFS=y
1546CONFIG_NFS_ACL_SUPPORT=y
1547CONFIG_NFS_COMMON=y
1548CONFIG_SUNRPC=y
1549# CONFIG_RPCSEC_GSS_KRB5 is not set
1550# CONFIG_RPCSEC_GSS_SPKM3 is not set
1551# CONFIG_SMB_FS is not set
1552# CONFIG_CIFS is not set
1553# CONFIG_NCP_FS is not set
1554# CONFIG_CODA_FS is not set
1555# CONFIG_AFS_FS is not set
1556# CONFIG_9P_FS is not set
1557
1558#
1559# Partition Types
1560#
1561CONFIG_PARTITION_ADVANCED=y
1562# CONFIG_ACORN_PARTITION is not set
1563# CONFIG_OSF_PARTITION is not set
1564# CONFIG_AMIGA_PARTITION is not set
1565# CONFIG_ATARI_PARTITION is not set
1566CONFIG_MAC_PARTITION=y
1567CONFIG_MSDOS_PARTITION=y
1568# CONFIG_BSD_DISKLABEL is not set
1569# CONFIG_MINIX_SUBPARTITION is not set
1570# CONFIG_SOLARIS_X86_PARTITION is not set
1571# CONFIG_UNIXWARE_DISKLABEL is not set
1572# CONFIG_LDM_PARTITION is not set
1573# CONFIG_SGI_PARTITION is not set
1574# CONFIG_ULTRIX_PARTITION is not set
1575# CONFIG_SUN_PARTITION is not set
1576# CONFIG_KARMA_PARTITION is not set
1577# CONFIG_EFI_PARTITION is not set
1578
1579#
1580# Native Language Support
1581#
1582CONFIG_NLS=m
1583CONFIG_NLS_DEFAULT="iso8859-1"
1584CONFIG_NLS_CODEPAGE_437=m
1585CONFIG_NLS_CODEPAGE_737=m
1586CONFIG_NLS_CODEPAGE_775=m
1587CONFIG_NLS_CODEPAGE_850=m
1588CONFIG_NLS_CODEPAGE_852=m
1589CONFIG_NLS_CODEPAGE_855=m
1590CONFIG_NLS_CODEPAGE_857=m
1591CONFIG_NLS_CODEPAGE_860=m
1592CONFIG_NLS_CODEPAGE_861=m
1593CONFIG_NLS_CODEPAGE_862=m
1594CONFIG_NLS_CODEPAGE_863=m
1595CONFIG_NLS_CODEPAGE_864=m
1596CONFIG_NLS_CODEPAGE_865=m
1597CONFIG_NLS_CODEPAGE_866=m
1598CONFIG_NLS_CODEPAGE_869=m
1599CONFIG_NLS_CODEPAGE_936=m
1600CONFIG_NLS_CODEPAGE_950=m
1601CONFIG_NLS_CODEPAGE_932=m
1602CONFIG_NLS_CODEPAGE_949=m
1603CONFIG_NLS_CODEPAGE_874=m
1604CONFIG_NLS_ISO8859_8=m
1605CONFIG_NLS_CODEPAGE_1250=m
1606CONFIG_NLS_CODEPAGE_1251=m
1607CONFIG_NLS_ASCII=m
1608CONFIG_NLS_ISO8859_1=m
1609CONFIG_NLS_ISO8859_2=m
1610CONFIG_NLS_ISO8859_3=m
1611CONFIG_NLS_ISO8859_4=m
1612CONFIG_NLS_ISO8859_5=m
1613CONFIG_NLS_ISO8859_6=m
1614CONFIG_NLS_ISO8859_7=m
1615CONFIG_NLS_ISO8859_9=m
1616CONFIG_NLS_ISO8859_13=m
1617CONFIG_NLS_ISO8859_14=m
1618CONFIG_NLS_ISO8859_15=m
1619CONFIG_NLS_KOI8_R=m
1620CONFIG_NLS_KOI8_U=m
1621CONFIG_NLS_UTF8=m
1622
1623#
1624# Library routines
1625#
1626CONFIG_CRC_CCITT=y
1627# CONFIG_CRC16 is not set
1628CONFIG_CRC32=y
1629# CONFIG_LIBCRC32C is not set
1630CONFIG_ZLIB_INFLATE=y
1631CONFIG_ZLIB_DEFLATE=y
1632CONFIG_TEXTSEARCH=y
1633CONFIG_TEXTSEARCH_KMP=m
1634CONFIG_TEXTSEARCH_BM=m
1635CONFIG_TEXTSEARCH_FSM=m
1636CONFIG_PLIST=y
1637# CONFIG_PROFILING is not set
1638
1639#
1640# Kernel hacking
1641#
1642# CONFIG_PRINTK_TIME is not set
1643CONFIG_MAGIC_SYSRQ=y
1644# CONFIG_UNUSED_SYMBOLS is not set
1645CONFIG_DEBUG_KERNEL=y
1646CONFIG_LOG_BUF_SHIFT=14
1647CONFIG_DETECT_SOFTLOCKUP=y
1648# CONFIG_SCHEDSTATS is not set
1649# CONFIG_DEBUG_SLAB is not set
1650# CONFIG_DEBUG_RT_MUTEXES is not set
1651# CONFIG_RT_MUTEX_TESTER is not set
1652# CONFIG_DEBUG_SPINLOCK is not set
1653# CONFIG_DEBUG_MUTEXES is not set
1654# CONFIG_DEBUG_RWSEMS is not set
1655# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1656# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1657# CONFIG_DEBUG_KOBJECT is not set
1658# CONFIG_DEBUG_INFO is not set
1659# CONFIG_DEBUG_FS is not set
1660# CONFIG_DEBUG_VM is not set
1661CONFIG_FORCED_INLINING=y
1662# CONFIG_RCU_TORTURE_TEST is not set
1663# CONFIG_XMON is not set
1664# CONFIG_BDI_SWITCH is not set
1665
1666#
1667# Security options
1668#
1669# CONFIG_KEYS is not set
1670# CONFIG_SECURITY is not set
1671
1672#
1673# Cryptographic options
1674#
1675# CONFIG_CRYPTO is not set
1676
1677#
1678# Hardware crypto devices
1679#
diff --git a/arch/ppc/configs/prpmc750_defconfig b/arch/ppc/configs/prpmc750_defconfig
deleted file mode 100644
index 82d52f66b742..000000000000
--- a/arch/ppc/configs/prpmc750_defconfig
+++ /dev/null
@@ -1,594 +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
16CONFIG_STANDALONE=y
17CONFIG_BROKEN_ON_SMP=y
18
19#
20# General setup
21#
22CONFIG_SWAP=y
23CONFIG_SYSVIPC=y
24# CONFIG_POSIX_MQUEUE is not set
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
30# CONFIG_IKCONFIG is not set
31CONFIG_EMBEDDED=y
32# CONFIG_KALLSYMS is not set
33CONFIG_FUTEX=y
34# CONFIG_EPOLL is not set
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
46# CONFIG_MODULE_FORCE_UNLOAD is not set
47CONFIG_OBSOLETE_MODPARM=y
48# CONFIG_MODVERSIONS is not set
49CONFIG_KMOD=y
50
51#
52# Processor
53#
54CONFIG_6xx=y
55# CONFIG_40x is not set
56# CONFIG_44x is not set
57# CONFIG_POWER3 is not set
58# CONFIG_POWER4 is not set
59# CONFIG_8xx is not set
60# CONFIG_ALTIVEC is not set
61# CONFIG_TAU is not set
62# CONFIG_CPU_FREQ is not set
63CONFIG_PPC_STD_MMU=y
64
65#
66# Platform options
67#
68# CONFIG_PPC_MULTIPLATFORM is not set
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
79CONFIG_PRPMC750=y
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_GEN550=y
91# CONFIG_SMP is not set
92# CONFIG_PREEMPT is not set
93# CONFIG_HIGHMEM is not set
94CONFIG_KERNEL_ELF=y
95CONFIG_BINFMT_ELF=y
96# CONFIG_BINFMT_MISC is not set
97CONFIG_CMDLINE_BOOL=y
98CONFIG_CMDLINE="ip=on"
99
100#
101# Bus options
102#
103CONFIG_GENERIC_ISA_DMA=y
104CONFIG_PCI=y
105CONFIG_PCI_DOMAINS=y
106# CONFIG_PCI_LEGACY_PROC is not set
107# CONFIG_PCI_NAMES is not set
108
109#
110# Advanced setup
111#
112# CONFIG_ADVANCED_OPTIONS is not set
113
114#
115# Default settings for advanced configuration options are used
116#
117CONFIG_HIGHMEM_START=0xfe000000
118CONFIG_LOWMEM_SIZE=0x30000000
119CONFIG_KERNEL_START=0xc0000000
120CONFIG_TASK_SIZE=0x80000000
121CONFIG_BOOT_LOAD=0x00800000
122
123#
124# Device Drivers
125#
126
127#
128# Generic Driver Options
129#
130
131#
132# Memory Technology Devices (MTD)
133#
134# CONFIG_MTD is not set
135
136#
137# Parallel port support
138#
139# CONFIG_PARPORT is not set
140
141#
142# Plug and Play support
143#
144
145#
146# Block devices
147#
148# CONFIG_BLK_DEV_FD is not set
149# CONFIG_BLK_CPQ_DA is not set
150# CONFIG_BLK_CPQ_CISS_DA is not set
151# CONFIG_BLK_DEV_DAC960 is not set
152# CONFIG_BLK_DEV_UMEM is not set
153# CONFIG_BLK_DEV_LOOP is not set
154# CONFIG_BLK_DEV_NBD is not set
155# CONFIG_BLK_DEV_CARMEL is not set
156CONFIG_BLK_DEV_RAM=y
157CONFIG_BLK_DEV_RAM_SIZE=4096
158CONFIG_BLK_DEV_INITRD=y
159# CONFIG_LBD is not set
160
161#
162# ATA/ATAPI/MFM/RLL support
163#
164# CONFIG_IDE is not set
165
166#
167# SCSI device support
168#
169# CONFIG_SCSI is not set
170
171#
172# Multi-device support (RAID and LVM)
173#
174# CONFIG_MD is not set
175
176#
177# Fusion MPT device support
178#
179# CONFIG_FUSION is not set
180
181#
182# IEEE 1394 (FireWire) support
183#
184# CONFIG_IEEE1394 is not set
185
186#
187# I2O device support
188#
189# CONFIG_I2O is not set
190
191#
192# Macintosh device drivers
193#
194
195#
196# Networking support
197#
198CONFIG_NET=y
199
200#
201# Networking options
202#
203CONFIG_PACKET=y
204# CONFIG_PACKET_MMAP is not set
205# CONFIG_NETLINK_DEV is not set
206CONFIG_UNIX=y
207# CONFIG_NET_KEY is not set
208CONFIG_INET=y
209CONFIG_IP_MULTICAST=y
210# CONFIG_IP_ADVANCED_ROUTER is not set
211CONFIG_IP_PNP=y
212CONFIG_IP_PNP_DHCP=y
213# CONFIG_IP_PNP_BOOTP is not set
214# CONFIG_IP_PNP_RARP is not set
215# CONFIG_NET_IPIP is not set
216# CONFIG_NET_IPGRE is not set
217# CONFIG_IP_MROUTE is not set
218# CONFIG_ARPD is not set
219# CONFIG_SYN_COOKIES is not set
220# CONFIG_INET_AH is not set
221# CONFIG_INET_ESP is not set
222# CONFIG_INET_IPCOMP is not set
223# CONFIG_IPV6 is not set
224# CONFIG_NETFILTER is not set
225
226#
227# SCTP Configuration (EXPERIMENTAL)
228#
229# CONFIG_IP_SCTP is not set
230# CONFIG_ATM is not set
231# CONFIG_BRIDGE is not set
232# CONFIG_VLAN_8021Q is not set
233# CONFIG_DECNET is not set
234# CONFIG_LLC2 is not set
235# CONFIG_IPX is not set
236# CONFIG_ATALK is not set
237# CONFIG_X25 is not set
238# CONFIG_LAPB is not set
239# CONFIG_NET_DIVERT is not set
240# CONFIG_ECONET is not set
241# CONFIG_WAN_ROUTER is not set
242# CONFIG_NET_HW_FLOWCONTROL is not set
243
244#
245# QoS and/or fair queueing
246#
247# CONFIG_NET_SCHED is not set
248
249#
250# Network testing
251#
252# CONFIG_NET_PKTGEN is not set
253# CONFIG_NETPOLL is not set
254# CONFIG_NET_POLL_CONTROLLER is not set
255# CONFIG_HAMRADIO is not set
256# CONFIG_IRDA is not set
257# CONFIG_BT is not set
258CONFIG_NETDEVICES=y
259# CONFIG_DUMMY is not set
260# CONFIG_BONDING is not set
261# CONFIG_EQUALIZER is not set
262# CONFIG_TUN is not set
263
264#
265# ARCnet devices
266#
267# CONFIG_ARCNET is not set
268
269#
270# Ethernet (10 or 100Mbit)
271#
272CONFIG_NET_ETHERNET=y
273CONFIG_MII=y
274# CONFIG_OAKNET is not set
275# CONFIG_HAPPYMEAL is not set
276# CONFIG_SUNGEM is not set
277# CONFIG_NET_VENDOR_3COM is not set
278
279#
280# Tulip family network device support
281#
282CONFIG_NET_TULIP=y
283# CONFIG_DE2104X is not set
284CONFIG_TULIP=y
285# CONFIG_TULIP_MWI is not set
286CONFIG_TULIP_MMIO=y
287# CONFIG_TULIP_NAPI is not set
288# CONFIG_DE4X5 is not set
289# CONFIG_WINBOND_840 is not set
290# CONFIG_DM9102 is not set
291# CONFIG_HP100 is not set
292CONFIG_NET_PCI=y
293# CONFIG_PCNET32 is not set
294# CONFIG_AMD8111_ETH is not set
295# CONFIG_ADAPTEC_STARFIRE is not set
296# CONFIG_B44 is not set
297# CONFIG_FORCEDETH is not set
298# CONFIG_DGRS is not set
299CONFIG_EEPRO100=y
300# CONFIG_EEPRO100_PIO is not set
301# CONFIG_E100 is not set
302# CONFIG_FEALNX is not set
303# CONFIG_NATSEMI is not set
304# CONFIG_NE2K_PCI is not set
305# CONFIG_8139CP is not set
306# CONFIG_8139TOO is not set
307# CONFIG_SIS900 is not set
308# CONFIG_EPIC100 is not set
309# CONFIG_SUNDANCE is not set
310# CONFIG_TLAN is not set
311# CONFIG_VIA_RHINE is not set
312
313#
314# Ethernet (1000 Mbit)
315#
316# CONFIG_ACENIC is not set
317# CONFIG_DL2K is not set
318# CONFIG_E1000 is not set
319# CONFIG_NS83820 is not set
320# CONFIG_HAMACHI is not set
321# CONFIG_YELLOWFIN is not set
322# CONFIG_R8169 is not set
323# CONFIG_SK98LIN is not set
324# CONFIG_TIGON3 is not set
325
326#
327# Ethernet (10000 Mbit)
328#
329# CONFIG_IXGB is not set
330# CONFIG_S2IO is not set
331
332#
333# Token Ring devices
334#
335# CONFIG_TR is not set
336
337#
338# Wireless LAN (non-hamradio)
339#
340# CONFIG_NET_RADIO is not set
341
342#
343# Wan interfaces
344#
345# CONFIG_WAN is not set
346# CONFIG_FDDI is not set
347# CONFIG_HIPPI is not set
348# CONFIG_PPP is not set
349# CONFIG_SLIP is not set
350# CONFIG_RCPCI is not set
351# CONFIG_SHAPER is not set
352# CONFIG_NETCONSOLE is not set
353
354#
355# ISDN subsystem
356#
357# CONFIG_ISDN is not set
358
359#
360# Telephony Support
361#
362# CONFIG_PHONE is not set
363
364#
365# Input device support
366#
367CONFIG_INPUT=y
368
369#
370# Userland interfaces
371#
372# CONFIG_INPUT_MOUSEDEV is not set
373# CONFIG_INPUT_JOYDEV is not set
374# CONFIG_INPUT_TSDEV is not set
375# CONFIG_INPUT_EVDEV is not set
376# CONFIG_INPUT_EVBUG is not set
377
378#
379# Input I/O drivers
380#
381# CONFIG_GAMEPORT is not set
382CONFIG_SOUND_GAMEPORT=y
383# CONFIG_SERIO is not set
384# CONFIG_SERIO_I8042 is not set
385
386#
387# Input Device Drivers
388#
389# CONFIG_INPUT_KEYBOARD is not set
390# CONFIG_INPUT_MOUSE is not set
391# CONFIG_INPUT_JOYSTICK is not set
392# CONFIG_INPUT_TOUCHSCREEN is not set
393# CONFIG_INPUT_MISC is not set
394
395#
396# Character devices
397#
398# CONFIG_VT is not set
399# CONFIG_SERIAL_NONSTANDARD is not set
400
401#
402# Serial drivers
403#
404CONFIG_SERIAL_8250=y
405CONFIG_SERIAL_8250_CONSOLE=y
406CONFIG_SERIAL_8250_NR_UARTS=4
407# CONFIG_SERIAL_8250_EXTENDED is not set
408
409#
410# Non-8250 serial port support
411#
412CONFIG_SERIAL_CORE=y
413CONFIG_SERIAL_CORE_CONSOLE=y
414CONFIG_UNIX98_PTYS=y
415CONFIG_LEGACY_PTYS=y
416CONFIG_LEGACY_PTY_COUNT=256
417# CONFIG_QIC02_TAPE is not set
418
419#
420# IPMI
421#
422# CONFIG_IPMI_HANDLER is not set
423
424#
425# Watchdog Cards
426#
427# CONFIG_WATCHDOG is not set
428# CONFIG_NVRAM is not set
429CONFIG_GEN_RTC=y
430# CONFIG_GEN_RTC_X is not set
431# CONFIG_DTLK is not set
432# CONFIG_R3964 is not set
433# CONFIG_APPLICOM is not set
434
435#
436# Ftape, the floppy tape device driver
437#
438# CONFIG_FTAPE is not set
439# CONFIG_AGP is not set
440# CONFIG_DRM is not set
441# CONFIG_RAW_DRIVER is not set
442
443#
444# I2C support
445#
446# CONFIG_I2C is not set
447
448#
449# Misc devices
450#
451
452#
453# Multimedia devices
454#
455# CONFIG_VIDEO_DEV is not set
456
457#
458# Digital Video Broadcasting Devices
459#
460# CONFIG_DVB is not set
461
462#
463# Graphics support
464#
465# CONFIG_FB is not set
466
467#
468# Sound
469#
470# CONFIG_SOUND is not set
471
472#
473# USB support
474#
475# CONFIG_USB is not set
476
477#
478# USB Gadget Support
479#
480# CONFIG_USB_GADGET is not set
481
482#
483# File systems
484#
485CONFIG_EXT2_FS=y
486# CONFIG_EXT2_FS_XATTR is not set
487CONFIG_EXT3_FS=y
488CONFIG_EXT3_FS_XATTR=y
489# CONFIG_EXT3_FS_POSIX_ACL is not set
490# CONFIG_EXT3_FS_SECURITY is not set
491CONFIG_JBD=y
492# CONFIG_JBD_DEBUG is not set
493CONFIG_FS_MBCACHE=y
494# CONFIG_REISERFS_FS is not set
495# CONFIG_JFS_FS is not set
496# CONFIG_XFS_FS is not set
497# CONFIG_MINIX_FS is not set
498# CONFIG_ROMFS_FS is not set
499# CONFIG_QUOTA is not set
500# CONFIG_AUTOFS_FS is not set
501# CONFIG_AUTOFS4_FS is not set
502
503#
504# CD-ROM/DVD Filesystems
505#
506# CONFIG_ISO9660_FS is not set
507# CONFIG_UDF_FS is not set
508
509#
510# DOS/FAT/NT Filesystems
511#
512# CONFIG_FAT_FS is not set
513# CONFIG_NTFS_FS is not set
514
515#
516# Pseudo filesystems
517#
518CONFIG_PROC_FS=y
519CONFIG_PROC_KCORE=y
520CONFIG_SYSFS=y
521# CONFIG_DEVFS_FS is not set
522# CONFIG_DEVPTS_FS_XATTR is not set
523CONFIG_TMPFS=y
524# CONFIG_HUGETLB_PAGE is not set
525CONFIG_RAMFS=y
526
527#
528# Miscellaneous filesystems
529#
530# CONFIG_ADFS_FS is not set
531# CONFIG_AFFS_FS is not set
532# CONFIG_HFS_FS is not set
533# CONFIG_HFSPLUS_FS is not set
534# CONFIG_BEFS_FS is not set
535# CONFIG_BFS_FS is not set
536# CONFIG_EFS_FS is not set
537# CONFIG_CRAMFS is not set
538# CONFIG_VXFS_FS is not set
539# CONFIG_HPFS_FS is not set
540# CONFIG_QNX4FS_FS is not set
541# CONFIG_SYSV_FS is not set
542# CONFIG_UFS_FS is not set
543
544#
545# Network File Systems
546#
547CONFIG_NFS_FS=y
548# CONFIG_NFS_V3 is not set
549# CONFIG_NFS_V4 is not set
550# CONFIG_NFS_DIRECTIO is not set
551# CONFIG_NFSD is not set
552CONFIG_ROOT_NFS=y
553CONFIG_LOCKD=y
554# CONFIG_EXPORTFS is not set
555CONFIG_SUNRPC=y
556# CONFIG_RPCSEC_GSS_KRB5 is not set
557# CONFIG_SMB_FS is not set
558# CONFIG_CIFS is not set
559# CONFIG_NCP_FS is not set
560# CONFIG_CODA_FS is not set
561# CONFIG_INTERMEZZO_FS is not set
562# CONFIG_AFS_FS is not set
563
564#
565# Partition Types
566#
567# CONFIG_PARTITION_ADVANCED is not set
568CONFIG_MSDOS_PARTITION=y
569
570#
571# Native Language Support
572#
573# CONFIG_NLS is not set
574
575#
576# Library routines
577#
578CONFIG_CRC32=y
579
580#
581# Kernel hacking
582#
583# CONFIG_DEBUG_KERNEL is not set
584# CONFIG_SERIAL_TEXT_DEBUG is not set
585
586#
587# Security options
588#
589# CONFIG_SECURITY is not set
590
591#
592# Cryptographic options
593#
594# CONFIG_CRYPTO is not set
diff --git a/arch/ppc/configs/prpmc800_defconfig b/arch/ppc/configs/prpmc800_defconfig
deleted file mode 100644
index 613c2664d3e8..000000000000
--- a/arch/ppc/configs/prpmc800_defconfig
+++ /dev/null
@@ -1,656 +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
16CONFIG_STANDALONE=y
17CONFIG_BROKEN_ON_SMP=y
18
19#
20# General setup
21#
22CONFIG_SWAP=y
23CONFIG_SYSVIPC=y
24# CONFIG_POSIX_MQUEUE is not set
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
30# CONFIG_IKCONFIG is not set
31CONFIG_EMBEDDED=y
32# CONFIG_KALLSYMS is not set
33CONFIG_FUTEX=y
34# CONFIG_EPOLL is not set
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
46# CONFIG_MODULE_FORCE_UNLOAD is not set
47CONFIG_OBSOLETE_MODPARM=y
48# CONFIG_MODVERSIONS is not set
49CONFIG_KMOD=y
50
51#
52# Processor
53#
54CONFIG_6xx=y
55# CONFIG_40x is not set
56# CONFIG_44x is not set
57# CONFIG_POWER3 is not set
58# CONFIG_POWER4 is not set
59# CONFIG_8xx is not set
60CONFIG_ALTIVEC=y
61# CONFIG_TAU is not set
62# CONFIG_CPU_FREQ is not set
63CONFIG_PPC_STD_MMU=y
64
65#
66# Platform options
67#
68# CONFIG_PPC_MULTIPLATFORM is not set
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
80CONFIG_PRPMC800=y
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_GEN550=y
91# CONFIG_NONMONARCH_SUPPORT is not set
92CONFIG_HARRIER=y
93# CONFIG_HARRIER_STORE_GATHERING is not set
94# CONFIG_SMP is not set
95# CONFIG_PREEMPT is not set
96# CONFIG_HIGHMEM is not set
97CONFIG_KERNEL_ELF=y
98CONFIG_BINFMT_ELF=y
99# CONFIG_BINFMT_MISC is not set
100CONFIG_CMDLINE_BOOL=y
101CONFIG_CMDLINE="ip=on"
102
103#
104# Bus options
105#
106CONFIG_GENERIC_ISA_DMA=y
107CONFIG_PCI=y
108CONFIG_PCI_DOMAINS=y
109# CONFIG_PCI_LEGACY_PROC is not set
110# CONFIG_PCI_NAMES is not set
111
112#
113# Advanced setup
114#
115# CONFIG_ADVANCED_OPTIONS is not set
116
117#
118# Default settings for advanced configuration options are used
119#
120CONFIG_HIGHMEM_START=0xfe000000
121CONFIG_LOWMEM_SIZE=0x30000000
122CONFIG_KERNEL_START=0xc0000000
123CONFIG_TASK_SIZE=0x80000000
124CONFIG_BOOT_LOAD=0x00800000
125
126#
127# Device Drivers
128#
129
130#
131# Generic Driver Options
132#
133
134#
135# Memory Technology Devices (MTD)
136#
137# CONFIG_MTD is not set
138
139#
140# Parallel port support
141#
142# CONFIG_PARPORT is not set
143
144#
145# Plug and Play support
146#
147
148#
149# Block devices
150#
151# CONFIG_BLK_DEV_FD is not set
152# CONFIG_BLK_CPQ_DA is not set
153# CONFIG_BLK_CPQ_CISS_DA is not set
154# CONFIG_BLK_DEV_DAC960 is not set
155# CONFIG_BLK_DEV_UMEM is not set
156# CONFIG_BLK_DEV_LOOP is not set
157# CONFIG_BLK_DEV_NBD is not set
158# CONFIG_BLK_DEV_CARMEL is not set
159CONFIG_BLK_DEV_RAM=y
160CONFIG_BLK_DEV_RAM_SIZE=4096
161CONFIG_BLK_DEV_INITRD=y
162# CONFIG_LBD is not set
163
164#
165# ATA/ATAPI/MFM/RLL support
166#
167# CONFIG_IDE is not set
168
169#
170# SCSI device support
171#
172CONFIG_SCSI=y
173CONFIG_SCSI_PROC_FS=y
174
175#
176# SCSI support type (disk, tape, CD-ROM)
177#
178CONFIG_BLK_DEV_SD=y
179CONFIG_CHR_DEV_ST=y
180# CONFIG_CHR_DEV_OSST is not set
181CONFIG_BLK_DEV_SR=y
182# CONFIG_BLK_DEV_SR_VENDOR is not set
183# CONFIG_CHR_DEV_SG is not set
184
185#
186# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
187#
188# CONFIG_SCSI_MULTI_LUN is not set
189# CONFIG_SCSI_REPORT_LUNS is not set
190# CONFIG_SCSI_CONSTANTS is not set
191# CONFIG_SCSI_LOGGING is not set
192
193#
194# SCSI Transport Attributes
195#
196CONFIG_SCSI_SPI_ATTRS=y
197# CONFIG_SCSI_FC_ATTRS is not set
198
199#
200# SCSI low-level drivers
201#
202# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
203# CONFIG_SCSI_ACARD is not set
204# CONFIG_SCSI_AACRAID is not set
205# CONFIG_SCSI_AIC7XXX is not set
206# CONFIG_SCSI_AIC7XXX_OLD is not set
207# CONFIG_SCSI_AIC79XX is not set
208# CONFIG_SCSI_ADVANSYS is not set
209# CONFIG_SCSI_MEGARAID is not set
210# CONFIG_SCSI_SATA is not set
211# CONFIG_SCSI_BUSLOGIC is not set
212# CONFIG_SCSI_CPQFCTS is not set
213# CONFIG_SCSI_DMX3191D is not set
214# CONFIG_SCSI_EATA is not set
215# CONFIG_SCSI_EATA_PIO is not set
216# CONFIG_SCSI_FUTURE_DOMAIN is not set
217# CONFIG_SCSI_GDTH is not set
218# CONFIG_SCSI_IPS is not set
219# CONFIG_SCSI_INIA100 is not set
220CONFIG_SCSI_SYM53C8XX_2=y
221CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1
222CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
223CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
224# CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set
225# CONFIG_SCSI_QLOGIC_ISP is not set
226# CONFIG_SCSI_QLOGIC_FC is not set
227# CONFIG_SCSI_QLOGIC_1280 is not set
228CONFIG_SCSI_QLA2XXX=y
229# CONFIG_SCSI_QLA21XX is not set
230# CONFIG_SCSI_QLA22XX is not set
231# CONFIG_SCSI_QLA2300 is not set
232# CONFIG_SCSI_QLA2322 is not set
233# CONFIG_SCSI_QLA6312 is not set
234# CONFIG_SCSI_QLA6322 is not set
235# CONFIG_SCSI_DC395x is not set
236# CONFIG_SCSI_DC390T is not set
237# CONFIG_SCSI_NSP32 is not set
238# CONFIG_SCSI_DEBUG is not set
239
240#
241# Multi-device support (RAID and LVM)
242#
243# CONFIG_MD is not set
244
245#
246# Fusion MPT device support
247#
248# CONFIG_FUSION is not set
249
250#
251# IEEE 1394 (FireWire) support
252#
253# CONFIG_IEEE1394 is not set
254
255#
256# I2O device support
257#
258# CONFIG_I2O is not set
259
260#
261# Macintosh device drivers
262#
263
264#
265# Networking support
266#
267CONFIG_NET=y
268
269#
270# Networking options
271#
272CONFIG_PACKET=y
273# CONFIG_PACKET_MMAP is not set
274# CONFIG_NETLINK_DEV is not set
275CONFIG_UNIX=y
276# CONFIG_NET_KEY is not set
277CONFIG_INET=y
278CONFIG_IP_MULTICAST=y
279# CONFIG_IP_ADVANCED_ROUTER is not set
280CONFIG_IP_PNP=y
281CONFIG_IP_PNP_DHCP=y
282# CONFIG_IP_PNP_BOOTP is not set
283# CONFIG_IP_PNP_RARP is not set
284# CONFIG_NET_IPIP is not set
285# CONFIG_NET_IPGRE is not set
286# CONFIG_IP_MROUTE is not set
287# CONFIG_ARPD is not set
288# CONFIG_SYN_COOKIES is not set
289# CONFIG_INET_AH is not set
290# CONFIG_INET_ESP is not set
291# CONFIG_INET_IPCOMP is not set
292# CONFIG_IPV6 is not set
293# CONFIG_NETFILTER is not set
294
295#
296# SCTP Configuration (EXPERIMENTAL)
297#
298# CONFIG_IP_SCTP is not set
299# CONFIG_ATM is not set
300# CONFIG_BRIDGE is not set
301# CONFIG_VLAN_8021Q is not set
302# CONFIG_DECNET is not set
303# CONFIG_LLC2 is not set
304# CONFIG_IPX is not set
305# CONFIG_ATALK is not set
306# CONFIG_X25 is not set
307# CONFIG_LAPB is not set
308# CONFIG_NET_DIVERT is not set
309# CONFIG_ECONET is not set
310# CONFIG_WAN_ROUTER is not set
311# CONFIG_NET_HW_FLOWCONTROL is not set
312
313#
314# QoS and/or fair queueing
315#
316# CONFIG_NET_SCHED is not set
317
318#
319# Network testing
320#
321# CONFIG_NET_PKTGEN is not set
322# CONFIG_NETPOLL is not set
323# CONFIG_NET_POLL_CONTROLLER is not set
324# CONFIG_HAMRADIO is not set
325# CONFIG_IRDA is not set
326# CONFIG_BT is not set
327CONFIG_NETDEVICES=y
328# CONFIG_DUMMY is not set
329# CONFIG_BONDING is not set
330# CONFIG_EQUALIZER is not set
331# CONFIG_TUN is not set
332
333#
334# ARCnet devices
335#
336# CONFIG_ARCNET is not set
337
338#
339# Ethernet (10 or 100Mbit)
340#
341CONFIG_NET_ETHERNET=y
342CONFIG_MII=y
343# CONFIG_OAKNET is not set
344# CONFIG_HAPPYMEAL is not set
345# CONFIG_SUNGEM is not set
346# CONFIG_NET_VENDOR_3COM is not set
347
348#
349# Tulip family network device support
350#
351# CONFIG_NET_TULIP is not set
352# CONFIG_HP100 is not set
353CONFIG_NET_PCI=y
354# CONFIG_PCNET32 is not set
355# CONFIG_AMD8111_ETH is not set
356# CONFIG_ADAPTEC_STARFIRE is not set
357# CONFIG_B44 is not set
358# CONFIG_FORCEDETH is not set
359# CONFIG_DGRS is not set
360CONFIG_EEPRO100=y
361# CONFIG_EEPRO100_PIO is not set
362# CONFIG_E100 is not set
363# CONFIG_FEALNX is not set
364# CONFIG_NATSEMI is not set
365# CONFIG_NE2K_PCI is not set
366# CONFIG_8139CP is not set
367# CONFIG_8139TOO is not set
368# CONFIG_SIS900 is not set
369# CONFIG_EPIC100 is not set
370# CONFIG_SUNDANCE is not set
371# CONFIG_TLAN is not set
372# CONFIG_VIA_RHINE is not set
373
374#
375# Ethernet (1000 Mbit)
376#
377# CONFIG_ACENIC is not set
378# CONFIG_DL2K is not set
379# CONFIG_E1000 is not set
380# CONFIG_NS83820 is not set
381# CONFIG_HAMACHI is not set
382# CONFIG_YELLOWFIN is not set
383# CONFIG_R8169 is not set
384# CONFIG_SK98LIN is not set
385# CONFIG_TIGON3 is not set
386
387#
388# Ethernet (10000 Mbit)
389#
390# CONFIG_IXGB is not set
391# CONFIG_S2IO is not set
392
393#
394# Token Ring devices
395#
396# CONFIG_TR is not set
397
398#
399# Wireless LAN (non-hamradio)
400#
401# CONFIG_NET_RADIO is not set
402
403#
404# Wan interfaces
405#
406# CONFIG_WAN is not set
407# CONFIG_FDDI is not set
408# CONFIG_HIPPI is not set
409# CONFIG_PPP is not set
410# CONFIG_SLIP is not set
411# CONFIG_NET_FC is not set
412# CONFIG_RCPCI is not set
413# CONFIG_SHAPER is not set
414# CONFIG_NETCONSOLE is not set
415
416#
417# ISDN subsystem
418#
419# CONFIG_ISDN is not set
420
421#
422# Telephony Support
423#
424# CONFIG_PHONE is not set
425
426#
427# Input device support
428#
429CONFIG_INPUT=y
430
431#
432# Userland interfaces
433#
434# CONFIG_INPUT_MOUSEDEV is not set
435# CONFIG_INPUT_JOYDEV is not set
436# CONFIG_INPUT_TSDEV is not set
437# CONFIG_INPUT_EVDEV is not set
438# CONFIG_INPUT_EVBUG is not set
439
440#
441# Input I/O drivers
442#
443# CONFIG_GAMEPORT is not set
444CONFIG_SOUND_GAMEPORT=y
445# CONFIG_SERIO is not set
446# CONFIG_SERIO_I8042 is not set
447
448#
449# Input Device Drivers
450#
451# CONFIG_INPUT_KEYBOARD is not set
452# CONFIG_INPUT_MOUSE is not set
453# CONFIG_INPUT_JOYSTICK is not set
454# CONFIG_INPUT_TOUCHSCREEN is not set
455# CONFIG_INPUT_MISC is not set
456
457#
458# Character devices
459#
460# CONFIG_VT is not set
461# CONFIG_SERIAL_NONSTANDARD is not set
462
463#
464# Serial drivers
465#
466CONFIG_SERIAL_8250=y
467CONFIG_SERIAL_8250_CONSOLE=y
468CONFIG_SERIAL_8250_NR_UARTS=4
469# CONFIG_SERIAL_8250_EXTENDED is not set
470
471#
472# Non-8250 serial port support
473#
474CONFIG_SERIAL_CORE=y
475CONFIG_SERIAL_CORE_CONSOLE=y
476CONFIG_UNIX98_PTYS=y
477CONFIG_LEGACY_PTYS=y
478CONFIG_LEGACY_PTY_COUNT=256
479# CONFIG_QIC02_TAPE is not set
480
481#
482# IPMI
483#
484# CONFIG_IPMI_HANDLER is not set
485
486#
487# Watchdog Cards
488#
489# CONFIG_WATCHDOG is not set
490# CONFIG_NVRAM is not set
491CONFIG_GEN_RTC=y
492# CONFIG_GEN_RTC_X is not set
493# CONFIG_DTLK is not set
494# CONFIG_R3964 is not set
495# CONFIG_APPLICOM is not set
496
497#
498# Ftape, the floppy tape device driver
499#
500# CONFIG_FTAPE is not set
501# CONFIG_AGP is not set
502# CONFIG_DRM is not set
503# CONFIG_RAW_DRIVER is not set
504
505#
506# I2C support
507#
508# CONFIG_I2C is not set
509
510#
511# Misc devices
512#
513
514#
515# Multimedia devices
516#
517# CONFIG_VIDEO_DEV is not set
518
519#
520# Digital Video Broadcasting Devices
521#
522# CONFIG_DVB is not set
523
524#
525# Graphics support
526#
527# CONFIG_FB is not set
528
529#
530# Sound
531#
532# CONFIG_SOUND is not set
533
534#
535# USB support
536#
537# CONFIG_USB is not set
538
539#
540# USB Gadget Support
541#
542# CONFIG_USB_GADGET is not set
543
544#
545# File systems
546#
547CONFIG_EXT2_FS=y
548# CONFIG_EXT2_FS_XATTR is not set
549CONFIG_EXT3_FS=y
550CONFIG_EXT3_FS_XATTR=y
551# CONFIG_EXT3_FS_POSIX_ACL is not set
552# CONFIG_EXT3_FS_SECURITY is not set
553CONFIG_JBD=y
554# CONFIG_JBD_DEBUG is not set
555CONFIG_FS_MBCACHE=y
556# CONFIG_REISERFS_FS is not set
557# CONFIG_JFS_FS is not set
558# CONFIG_XFS_FS is not set
559# CONFIG_MINIX_FS is not set
560# CONFIG_ROMFS_FS is not set
561# CONFIG_QUOTA is not set
562# CONFIG_AUTOFS_FS is not set
563# CONFIG_AUTOFS4_FS is not set
564
565#
566# CD-ROM/DVD Filesystems
567#
568# CONFIG_ISO9660_FS is not set
569# CONFIG_UDF_FS is not set
570
571#
572# DOS/FAT/NT Filesystems
573#
574# CONFIG_FAT_FS is not set
575# CONFIG_NTFS_FS is not set
576
577#
578# Pseudo filesystems
579#
580CONFIG_PROC_FS=y
581CONFIG_PROC_KCORE=y
582CONFIG_SYSFS=y
583# CONFIG_DEVFS_FS is not set
584# CONFIG_DEVPTS_FS_XATTR is not set
585CONFIG_TMPFS=y
586# CONFIG_HUGETLB_PAGE is not set
587CONFIG_RAMFS=y
588
589#
590# Miscellaneous filesystems
591#
592# CONFIG_ADFS_FS is not set
593# CONFIG_AFFS_FS is not set
594# CONFIG_HFS_FS is not set
595# CONFIG_HFSPLUS_FS is not set
596# CONFIG_BEFS_FS is not set
597# CONFIG_BFS_FS is not set
598# CONFIG_EFS_FS is not set
599# CONFIG_CRAMFS is not set
600# CONFIG_VXFS_FS is not set
601# CONFIG_HPFS_FS is not set
602# CONFIG_QNX4FS_FS is not set
603# CONFIG_SYSV_FS is not set
604# CONFIG_UFS_FS is not set
605
606#
607# Network File Systems
608#
609CONFIG_NFS_FS=y
610# CONFIG_NFS_V3 is not set
611# CONFIG_NFS_V4 is not set
612# CONFIG_NFS_DIRECTIO is not set
613# CONFIG_NFSD is not set
614CONFIG_ROOT_NFS=y
615CONFIG_LOCKD=y
616# CONFIG_EXPORTFS is not set
617CONFIG_SUNRPC=y
618# CONFIG_RPCSEC_GSS_KRB5 is not set
619# CONFIG_SMB_FS is not set
620# CONFIG_CIFS is not set
621# CONFIG_NCP_FS is not set
622# CONFIG_CODA_FS is not set
623# CONFIG_INTERMEZZO_FS is not set
624# CONFIG_AFS_FS is not set
625
626#
627# Partition Types
628#
629# CONFIG_PARTITION_ADVANCED is not set
630CONFIG_MSDOS_PARTITION=y
631
632#
633# Native Language Support
634#
635# CONFIG_NLS is not set
636
637#
638# Library routines
639#
640# CONFIG_CRC32 is not set
641
642#
643# Kernel hacking
644#
645# CONFIG_DEBUG_KERNEL is not set
646# CONFIG_SERIAL_TEXT_DEBUG is not set
647
648#
649# Security options
650#
651# CONFIG_SECURITY is not set
652
653#
654# Cryptographic options
655#
656# CONFIG_CRYPTO is not set
diff --git a/arch/ppc/configs/radstone_ppc7d_defconfig b/arch/ppc/configs/radstone_ppc7d_defconfig
deleted file mode 100644
index 9f64532f2a81..000000000000
--- a/arch/ppc/configs/radstone_ppc7d_defconfig
+++ /dev/null
@@ -1,991 +0,0 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.13-rc3
4# Tue Jul 26 00:02:09 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
30# CONFIG_POSIX_MQUEUE is not set
31# CONFIG_BSD_PROCESS_ACCT is not set
32CONFIG_SYSCTL=y
33# CONFIG_AUDIT is not set
34# CONFIG_HOTPLUG is not set
35CONFIG_KOBJECT_UEVENT=y
36# CONFIG_IKCONFIG is not set
37CONFIG_EMBEDDED=y
38CONFIG_KALLSYMS=y
39CONFIG_KALLSYMS_EXTRA_PASS=y
40CONFIG_PRINTK=y
41CONFIG_BUG=y
42CONFIG_BASE_FULL=y
43CONFIG_FUTEX=y
44CONFIG_EPOLL=y
45# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
46CONFIG_SHMEM=y
47CONFIG_CC_ALIGN_FUNCTIONS=0
48CONFIG_CC_ALIGN_LABELS=0
49CONFIG_CC_ALIGN_LOOPS=0
50CONFIG_CC_ALIGN_JUMPS=0
51# CONFIG_TINY_SHMEM is not set
52CONFIG_BASE_SMALL=0
53
54#
55# Loadable module support
56#
57CONFIG_MODULES=y
58CONFIG_MODULE_UNLOAD=y
59# CONFIG_MODULE_FORCE_UNLOAD is not set
60CONFIG_OBSOLETE_MODPARM=y
61# CONFIG_MODVERSIONS is not set
62# CONFIG_MODULE_SRCVERSION_ALL is not set
63CONFIG_KMOD=y
64
65#
66# Processor
67#
68CONFIG_6xx=y
69# CONFIG_40x is not set
70# CONFIG_44x is not set
71# CONFIG_POWER3 is not set
72# CONFIG_POWER4 is not set
73# CONFIG_8xx is not set
74# CONFIG_E200 is not set
75# CONFIG_E500 is not set
76CONFIG_PPC_FPU=y
77CONFIG_ALTIVEC=y
78# CONFIG_TAU is not set
79# CONFIG_KEXEC is not set
80# CONFIG_CPU_FREQ is not set
81CONFIG_PPC_GEN550=y
82# CONFIG_PM is not set
83CONFIG_PPC_STD_MMU=y
84# CONFIG_NOT_COHERENT_CACHE is not set
85
86#
87# Platform options
88#
89# CONFIG_PPC_MULTIPLATFORM is not set
90# CONFIG_APUS is not set
91# CONFIG_KATANA is not set
92# CONFIG_WILLOW is not set
93# CONFIG_CPCI690 is not set
94# CONFIG_POWERPMC250 is not set
95# CONFIG_CHESTNUT is not set
96# CONFIG_SPRUCE is not set
97# CONFIG_HDPU is not set
98# CONFIG_EV64260 is not set
99# CONFIG_LOPEC is not set
100# CONFIG_MVME5100 is not set
101# CONFIG_PPLUS is not set
102# CONFIG_PRPMC750 is not set
103# CONFIG_PRPMC800 is not set
104# CONFIG_SANDPOINT is not set
105CONFIG_RADSTONE_PPC7D=y
106# CONFIG_PAL4 is not set
107# CONFIG_GEMINI is not set
108# CONFIG_EST8260 is not set
109# CONFIG_SBC82xx is not set
110# CONFIG_SBS8260 is not set
111# CONFIG_RPX8260 is not set
112# CONFIG_TQM8260 is not set
113# CONFIG_ADS8272 is not set
114# CONFIG_PQ2FADS is not set
115# CONFIG_LITE5200 is not set
116# CONFIG_MPC834x_SYS is not set
117CONFIG_MV64360=y
118CONFIG_MV64X60=y
119
120#
121# Set bridge options
122#
123CONFIG_MV64X60_BASE=0xfef00000
124CONFIG_MV64X60_NEW_BASE=0xfef00000
125# CONFIG_SMP is not set
126# CONFIG_PREEMPT is not set
127# CONFIG_HIGHMEM is not set
128CONFIG_SELECT_MEMORY_MODEL=y
129CONFIG_FLATMEM_MANUAL=y
130# CONFIG_DISCONTIGMEM_MANUAL is not set
131# CONFIG_SPARSEMEM_MANUAL is not set
132CONFIG_FLATMEM=y
133CONFIG_FLAT_NODE_MEM_MAP=y
134CONFIG_BINFMT_ELF=y
135CONFIG_BINFMT_MISC=y
136CONFIG_CMDLINE_BOOL=y
137CONFIG_CMDLINE="console=ttyS0,9600"
138CONFIG_SECCOMP=y
139CONFIG_ISA_DMA_API=y
140
141#
142# Bus options
143#
144CONFIG_GENERIC_ISA_DMA=y
145CONFIG_PCI=y
146CONFIG_PCI_DOMAINS=y
147CONFIG_PCI_LEGACY_PROC=y
148CONFIG_PCI_NAMES=y
149
150#
151# PCCARD (PCMCIA/CardBus) support
152#
153# CONFIG_PCCARD is not set
154
155#
156# Advanced setup
157#
158CONFIG_ADVANCED_OPTIONS=y
159CONFIG_HIGHMEM_START=0xfe000000
160# CONFIG_LOWMEM_SIZE_BOOL is not set
161CONFIG_LOWMEM_SIZE=0x30000000
162# CONFIG_KERNEL_START_BOOL is not set
163CONFIG_KERNEL_START=0xc0000000
164# CONFIG_TASK_SIZE_BOOL is not set
165CONFIG_TASK_SIZE=0x80000000
166# CONFIG_BOOT_LOAD_BOOL is not set
167CONFIG_BOOT_LOAD=0x00800000
168
169#
170# Networking
171#
172CONFIG_NET=y
173
174#
175# Networking options
176#
177CONFIG_PACKET=y
178# CONFIG_PACKET_MMAP is not set
179CONFIG_UNIX=y
180# CONFIG_NET_KEY is not set
181CONFIG_INET=y
182CONFIG_IP_MULTICAST=y
183# CONFIG_IP_ADVANCED_ROUTER is not set
184CONFIG_IP_FIB_HASH=y
185CONFIG_IP_PNP=y
186CONFIG_IP_PNP_DHCP=y
187CONFIG_IP_PNP_BOOTP=y
188# CONFIG_IP_PNP_RARP is not set
189# CONFIG_NET_IPIP is not set
190# CONFIG_NET_IPGRE is not set
191# CONFIG_IP_MROUTE is not set
192# CONFIG_ARPD is not set
193CONFIG_SYN_COOKIES=y
194# CONFIG_INET_AH is not set
195# CONFIG_INET_ESP is not set
196# CONFIG_INET_IPCOMP is not set
197# CONFIG_INET_TUNNEL is not set
198CONFIG_IP_TCPDIAG=y
199# CONFIG_IP_TCPDIAG_IPV6 is not set
200# CONFIG_TCP_CONG_ADVANCED is not set
201CONFIG_TCP_CONG_BIC=y
202# CONFIG_IPV6 is not set
203# CONFIG_NETFILTER is not set
204
205#
206# SCTP Configuration (EXPERIMENTAL)
207#
208# CONFIG_IP_SCTP is not set
209# CONFIG_ATM is not set
210CONFIG_BRIDGE=y
211# CONFIG_VLAN_8021Q is not set
212# CONFIG_DECNET is not set
213# CONFIG_LLC2 is not set
214# CONFIG_IPX is not set
215# CONFIG_ATALK is not set
216# CONFIG_X25 is not set
217# CONFIG_LAPB is not set
218# CONFIG_NET_DIVERT is not set
219# CONFIG_ECONET is not set
220# CONFIG_WAN_ROUTER is not set
221# CONFIG_NET_SCHED is not set
222# CONFIG_NET_CLS_ROUTE is not set
223
224#
225# Network testing
226#
227# CONFIG_NET_PKTGEN is not set
228# CONFIG_HAMRADIO is not set
229# CONFIG_IRDA is not set
230# CONFIG_BT is not set
231
232#
233# Device Drivers
234#
235
236#
237# Generic Driver Options
238#
239CONFIG_STANDALONE=y
240CONFIG_PREVENT_FIRMWARE_BUILD=y
241# CONFIG_FW_LOADER is not set
242
243#
244# Memory Technology Devices (MTD)
245#
246CONFIG_MTD=y
247# CONFIG_MTD_DEBUG is not set
248# CONFIG_MTD_CONCAT is not set
249# CONFIG_MTD_PARTITIONS is not set
250
251#
252# User Modules And Translation Layers
253#
254CONFIG_MTD_CHAR=y
255CONFIG_MTD_BLOCK=y
256CONFIG_FTL=y
257# CONFIG_NFTL is not set
258# CONFIG_INFTL is not set
259
260#
261# RAM/ROM/Flash chip drivers
262#
263CONFIG_MTD_CFI=y
264# CONFIG_MTD_JEDECPROBE is not set
265CONFIG_MTD_GEN_PROBE=y
266CONFIG_MTD_CFI_ADV_OPTIONS=y
267CONFIG_MTD_CFI_NOSWAP=y
268# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set
269# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set
270# CONFIG_MTD_CFI_GEOMETRY is not set
271CONFIG_MTD_MAP_BANK_WIDTH_1=y
272CONFIG_MTD_MAP_BANK_WIDTH_2=y
273CONFIG_MTD_MAP_BANK_WIDTH_4=y
274# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
275# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
276# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
277CONFIG_MTD_CFI_I1=y
278CONFIG_MTD_CFI_I2=y
279# CONFIG_MTD_CFI_I4 is not set
280# CONFIG_MTD_CFI_I8 is not set
281# CONFIG_MTD_OTP is not set
282CONFIG_MTD_CFI_INTELEXT=y
283# CONFIG_MTD_CFI_AMDSTD is not set
284# CONFIG_MTD_CFI_STAA is not set
285CONFIG_MTD_CFI_UTIL=y
286# CONFIG_MTD_RAM is not set
287# CONFIG_MTD_ROM is not set
288# CONFIG_MTD_ABSENT is not set
289
290#
291# Mapping drivers for chip access
292#
293# CONFIG_MTD_COMPLEX_MAPPINGS is not set
294# CONFIG_MTD_PHYSMAP is not set
295# CONFIG_MTD_PLATRAM is not set
296
297#
298# Self-contained MTD device drivers
299#
300# CONFIG_MTD_PMC551 is not set
301# CONFIG_MTD_SLRAM is not set
302# CONFIG_MTD_PHRAM is not set
303# CONFIG_MTD_MTDRAM is not set
304# CONFIG_MTD_BLKMTD is not set
305# CONFIG_MTD_BLOCK2MTD is not set
306
307#
308# Disk-On-Chip Device Drivers
309#
310# CONFIG_MTD_DOC2000 is not set
311# CONFIG_MTD_DOC2001 is not set
312# CONFIG_MTD_DOC2001PLUS is not set
313
314#
315# NAND Flash Device Drivers
316#
317# CONFIG_MTD_NAND is not set
318
319#
320# Parallel port support
321#
322# CONFIG_PARPORT is not set
323
324#
325# Plug and Play support
326#
327
328#
329# Block devices
330#
331# CONFIG_BLK_DEV_FD is not set
332# CONFIG_BLK_CPQ_DA is not set
333# CONFIG_BLK_CPQ_CISS_DA is not set
334# CONFIG_BLK_DEV_DAC960 is not set
335# CONFIG_BLK_DEV_UMEM is not set
336# CONFIG_BLK_DEV_COW_COMMON is not set
337CONFIG_BLK_DEV_LOOP=y
338# CONFIG_BLK_DEV_CRYPTOLOOP is not set
339# CONFIG_BLK_DEV_NBD is not set
340# CONFIG_BLK_DEV_SX8 is not set
341CONFIG_BLK_DEV_RAM=y
342CONFIG_BLK_DEV_RAM_COUNT=16
343CONFIG_BLK_DEV_RAM_SIZE=8192
344CONFIG_BLK_DEV_INITRD=y
345CONFIG_INITRAMFS_SOURCE=""
346# CONFIG_LBD is not set
347# CONFIG_CDROM_PKTCDVD is not set
348
349#
350# IO Schedulers
351#
352CONFIG_IOSCHED_NOOP=y
353CONFIG_IOSCHED_AS=y
354CONFIG_IOSCHED_DEADLINE=y
355CONFIG_IOSCHED_CFQ=y
356# CONFIG_ATA_OVER_ETH is not set
357
358#
359# ATA/ATAPI/MFM/RLL support
360#
361# CONFIG_IDE is not set
362
363#
364# SCSI device support
365#
366CONFIG_SCSI=y
367CONFIG_SCSI_PROC_FS=y
368
369#
370# SCSI support type (disk, tape, CD-ROM)
371#
372CONFIG_BLK_DEV_SD=y
373# CONFIG_CHR_DEV_ST is not set
374# CONFIG_CHR_DEV_OSST is not set
375CONFIG_BLK_DEV_SR=y
376CONFIG_BLK_DEV_SR_VENDOR=y
377CONFIG_CHR_DEV_SG=y
378# CONFIG_CHR_DEV_SCH is not set
379
380#
381# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
382#
383CONFIG_SCSI_MULTI_LUN=y
384CONFIG_SCSI_CONSTANTS=y
385CONFIG_SCSI_LOGGING=y
386
387#
388# SCSI Transport Attributes
389#
390CONFIG_SCSI_SPI_ATTRS=y
391# CONFIG_SCSI_FC_ATTRS is not set
392# CONFIG_SCSI_ISCSI_ATTRS is not set
393
394#
395# SCSI low-level drivers
396#
397# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
398# CONFIG_SCSI_3W_9XXX is not set
399# CONFIG_SCSI_ACARD is not set
400# CONFIG_SCSI_AACRAID is not set
401# CONFIG_SCSI_AIC7XXX is not set
402# CONFIG_SCSI_AIC7XXX_OLD is not set
403# CONFIG_SCSI_AIC79XX is not set
404# CONFIG_SCSI_DPT_I2O is not set
405# CONFIG_MEGARAID_NEWGEN is not set
406# CONFIG_MEGARAID_LEGACY is not set
407# CONFIG_SCSI_SATA is not set
408# CONFIG_SCSI_BUSLOGIC is not set
409# CONFIG_SCSI_DMX3191D is not set
410# CONFIG_SCSI_EATA is not set
411# CONFIG_SCSI_FUTURE_DOMAIN is not set
412# CONFIG_SCSI_GDTH is not set
413# CONFIG_SCSI_IPS is not set
414# CONFIG_SCSI_INITIO is not set
415# CONFIG_SCSI_INIA100 is not set
416CONFIG_SCSI_SYM53C8XX_2=y
417CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1
418CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
419CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
420# CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set
421# CONFIG_SCSI_IPR is not set
422# CONFIG_SCSI_QLOGIC_FC is not set
423# CONFIG_SCSI_QLOGIC_1280 is not set
424CONFIG_SCSI_QLA2XXX=y
425# CONFIG_SCSI_QLA21XX is not set
426# CONFIG_SCSI_QLA22XX is not set
427# CONFIG_SCSI_QLA2300 is not set
428# CONFIG_SCSI_QLA2322 is not set
429# CONFIG_SCSI_QLA6312 is not set
430# CONFIG_SCSI_LPFC is not set
431# CONFIG_SCSI_DC395x is not set
432# CONFIG_SCSI_DC390T is not set
433# CONFIG_SCSI_NSP32 is not set
434# CONFIG_SCSI_DEBUG is not set
435
436#
437# Multi-device support (RAID and LVM)
438#
439# CONFIG_MD is not set
440
441#
442# Fusion MPT device support
443#
444# CONFIG_FUSION is not set
445# CONFIG_FUSION_SPI is not set
446# CONFIG_FUSION_FC is not set
447
448#
449# IEEE 1394 (FireWire) support
450#
451# CONFIG_IEEE1394 is not set
452
453#
454# I2O device support
455#
456# CONFIG_I2O is not set
457
458#
459# Macintosh device drivers
460#
461
462#
463# Network device support
464#
465CONFIG_NETDEVICES=y
466# CONFIG_DUMMY is not set
467# CONFIG_BONDING is not set
468# CONFIG_EQUALIZER is not set
469# CONFIG_TUN is not set
470
471#
472# ARCnet devices
473#
474# CONFIG_ARCNET is not set
475
476#
477# Ethernet (10 or 100Mbit)
478#
479CONFIG_NET_ETHERNET=y
480CONFIG_MII=y
481# CONFIG_HAPPYMEAL is not set
482# CONFIG_SUNGEM is not set
483# CONFIG_NET_VENDOR_3COM is not set
484
485#
486# Tulip family network device support
487#
488CONFIG_NET_TULIP=y
489# CONFIG_DE2104X is not set
490CONFIG_TULIP=y
491# CONFIG_TULIP_MWI is not set
492# CONFIG_TULIP_MMIO is not set
493# CONFIG_TULIP_NAPI is not set
494# CONFIG_DE4X5 is not set
495# CONFIG_WINBOND_840 is not set
496# CONFIG_DM9102 is not set
497# CONFIG_HP100 is not set
498CONFIG_NET_PCI=y
499# CONFIG_PCNET32 is not set
500# CONFIG_AMD8111_ETH is not set
501# CONFIG_ADAPTEC_STARFIRE is not set
502# CONFIG_B44 is not set
503# CONFIG_FORCEDETH is not set
504# CONFIG_DGRS is not set
505# CONFIG_EEPRO100 is not set
506CONFIG_E100=y
507# CONFIG_FEALNX is not set
508# CONFIG_NATSEMI is not set
509# CONFIG_NE2K_PCI is not set
510# CONFIG_8139CP is not set
511# CONFIG_8139TOO is not set
512# CONFIG_SIS900 is not set
513# CONFIG_EPIC100 is not set
514# CONFIG_SUNDANCE is not set
515# CONFIG_TLAN is not set
516# CONFIG_VIA_RHINE is not set
517
518#
519# Ethernet (1000 Mbit)
520#
521# CONFIG_ACENIC is not set
522# CONFIG_DL2K is not set
523# CONFIG_E1000 is not set
524# CONFIG_NS83820 is not set
525# CONFIG_HAMACHI is not set
526# CONFIG_YELLOWFIN is not set
527CONFIG_R8169=y
528CONFIG_R8169_NAPI=y
529# CONFIG_SKGE is not set
530CONFIG_SK98LIN=y
531# CONFIG_VIA_VELOCITY is not set
532CONFIG_TIGON3=y
533# CONFIG_BNX2 is not set
534CONFIG_MV643XX_ETH=y
535CONFIG_MV643XX_ETH_0=y
536CONFIG_MV643XX_ETH_1=y
537# CONFIG_MV643XX_ETH_2 is not set
538
539#
540# Ethernet (10000 Mbit)
541#
542# CONFIG_IXGB is not set
543# CONFIG_S2IO is not set
544
545#
546# Token Ring devices
547#
548# CONFIG_TR is not set
549
550#
551# Wireless LAN (non-hamradio)
552#
553# CONFIG_NET_RADIO is not set
554
555#
556# Wan interfaces
557#
558# CONFIG_WAN is not set
559# CONFIG_FDDI is not set
560# CONFIG_HIPPI is not set
561# CONFIG_PPP is not set
562# CONFIG_SLIP is not set
563# CONFIG_NET_FC is not set
564# CONFIG_SHAPER is not set
565# CONFIG_NETCONSOLE is not set
566# CONFIG_NETPOLL is not set
567# CONFIG_NET_POLL_CONTROLLER is not set
568
569#
570# ISDN subsystem
571#
572# CONFIG_ISDN is not set
573
574#
575# Telephony Support
576#
577# CONFIG_PHONE is not set
578
579#
580# Input device support
581#
582CONFIG_INPUT=y
583
584#
585# Userland interfaces
586#
587CONFIG_INPUT_MOUSEDEV=y
588CONFIG_INPUT_MOUSEDEV_PSAUX=y
589CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
590CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
591# CONFIG_INPUT_JOYDEV is not set
592# CONFIG_INPUT_TSDEV is not set
593# CONFIG_INPUT_EVDEV is not set
594# CONFIG_INPUT_EVBUG is not set
595
596#
597# Input Device Drivers
598#
599CONFIG_INPUT_KEYBOARD=y
600CONFIG_KEYBOARD_ATKBD=y
601# CONFIG_KEYBOARD_SUNKBD is not set
602# CONFIG_KEYBOARD_LKKBD is not set
603CONFIG_KEYBOARD_XTKBD=y
604# CONFIG_KEYBOARD_NEWTON is not set
605# CONFIG_INPUT_MOUSE is not set
606# CONFIG_INPUT_JOYSTICK is not set
607# CONFIG_INPUT_TOUCHSCREEN is not set
608# CONFIG_INPUT_MISC is not set
609
610#
611# Hardware I/O ports
612#
613CONFIG_SERIO=y
614CONFIG_SERIO_I8042=y
615CONFIG_SERIO_SERPORT=y
616# CONFIG_SERIO_PCIPS2 is not set
617CONFIG_SERIO_LIBPS2=y
618# CONFIG_SERIO_RAW is not set
619# CONFIG_GAMEPORT is not set
620
621#
622# Character devices
623#
624CONFIG_VT=y
625# CONFIG_VT_CONSOLE is not set
626CONFIG_HW_CONSOLE=y
627# CONFIG_SERIAL_NONSTANDARD is not set
628
629#
630# Serial drivers
631#
632CONFIG_SERIAL_8250=y
633CONFIG_SERIAL_8250_CONSOLE=y
634CONFIG_SERIAL_8250_NR_UARTS=4
635# CONFIG_SERIAL_8250_EXTENDED is not set
636
637#
638# Non-8250 serial port support
639#
640CONFIG_SERIAL_MPSC=y
641# CONFIG_SERIAL_MPSC_CONSOLE is not set
642CONFIG_SERIAL_CORE=y
643CONFIG_SERIAL_CORE_CONSOLE=y
644# CONFIG_SERIAL_JSM is not set
645CONFIG_UNIX98_PTYS=y
646CONFIG_LEGACY_PTYS=y
647CONFIG_LEGACY_PTY_COUNT=256
648
649#
650# IPMI
651#
652# CONFIG_IPMI_HANDLER is not set
653
654#
655# Watchdog Cards
656#
657CONFIG_WATCHDOG=y
658CONFIG_WATCHDOG_NOWAYOUT=y
659
660#
661# Watchdog Device Drivers
662#
663# CONFIG_SOFT_WATCHDOG is not set
664
665#
666# PCI-based Watchdog Cards
667#
668# CONFIG_PCIPCWATCHDOG is not set
669# CONFIG_WDTPCI is not set
670# CONFIG_NVRAM is not set
671CONFIG_GEN_RTC=y
672# CONFIG_GEN_RTC_X is not set
673# CONFIG_DTLK is not set
674# CONFIG_R3964 is not set
675# CONFIG_APPLICOM is not set
676
677#
678# Ftape, the floppy tape device driver
679#
680# CONFIG_AGP is not set
681# CONFIG_DRM is not set
682# CONFIG_RAW_DRIVER is not set
683
684#
685# TPM devices
686#
687# CONFIG_TCG_TPM is not set
688
689#
690# I2C support
691#
692CONFIG_I2C=y
693CONFIG_I2C_CHARDEV=y
694
695#
696# I2C Algorithms
697#
698# CONFIG_I2C_ALGOBIT is not set
699# CONFIG_I2C_ALGOPCF is not set
700# CONFIG_I2C_ALGOPCA is not set
701
702#
703# I2C Hardware Bus support
704#
705# CONFIG_I2C_ALI1535 is not set
706# CONFIG_I2C_ALI1563 is not set
707# CONFIG_I2C_ALI15X3 is not set
708# CONFIG_I2C_AMD756 is not set
709# CONFIG_I2C_AMD8111 is not set
710# CONFIG_I2C_I801 is not set
711# CONFIG_I2C_I810 is not set
712# CONFIG_I2C_PIIX4 is not set
713# CONFIG_I2C_MPC is not set
714# CONFIG_I2C_NFORCE2 is not set
715# CONFIG_I2C_PARPORT_LIGHT is not set
716# CONFIG_I2C_PROSAVAGE is not set
717# CONFIG_I2C_SAVAGE4 is not set
718# CONFIG_SCx200_ACB is not set
719# CONFIG_I2C_SIS5595 is not set
720# CONFIG_I2C_SIS630 is not set
721# CONFIG_I2C_SIS96X is not set
722# CONFIG_I2C_STUB is not set
723# CONFIG_I2C_VIA is not set
724# CONFIG_I2C_VIAPRO is not set
725# CONFIG_I2C_VOODOO3 is not set
726# CONFIG_I2C_PCA_ISA is not set
727CONFIG_I2C_MV64XXX=y
728CONFIG_I2C_SENSOR=y
729
730#
731# Miscellaneous I2C Chip support
732#
733CONFIG_SENSORS_DS1337=y
734# CONFIG_SENSORS_DS1374 is not set
735# CONFIG_SENSORS_EEPROM is not set
736# CONFIG_SENSORS_PCF8574 is not set
737# CONFIG_SENSORS_PCA9539 is not set
738# CONFIG_SENSORS_PCF8591 is not set
739# CONFIG_SENSORS_RTC8564 is not set
740# CONFIG_SENSORS_M41T00 is not set
741# CONFIG_SENSORS_MAX6875 is not set
742# CONFIG_I2C_DEBUG_CORE is not set
743# CONFIG_I2C_DEBUG_ALGO is not set
744# CONFIG_I2C_DEBUG_BUS is not set
745# CONFIG_I2C_DEBUG_CHIP is not set
746
747#
748# Dallas's 1-wire bus
749#
750# CONFIG_W1 is not set
751
752#
753# Hardware Monitoring support
754#
755CONFIG_HWMON=y
756# CONFIG_SENSORS_ADM1021 is not set
757# CONFIG_SENSORS_ADM1025 is not set
758# CONFIG_SENSORS_ADM1026 is not set
759# CONFIG_SENSORS_ADM1031 is not set
760# CONFIG_SENSORS_ADM9240 is not set
761# CONFIG_SENSORS_ASB100 is not set
762# CONFIG_SENSORS_ATXP1 is not set
763# CONFIG_SENSORS_DS1621 is not set
764# CONFIG_SENSORS_FSCHER is not set
765# CONFIG_SENSORS_FSCPOS is not set
766# CONFIG_SENSORS_GL518SM is not set
767# CONFIG_SENSORS_GL520SM is not set
768# CONFIG_SENSORS_IT87 is not set
769# CONFIG_SENSORS_LM63 is not set
770# CONFIG_SENSORS_LM75 is not set
771# CONFIG_SENSORS_LM77 is not set
772# CONFIG_SENSORS_LM78 is not set
773# CONFIG_SENSORS_LM80 is not set
774# CONFIG_SENSORS_LM83 is not set
775# CONFIG_SENSORS_LM85 is not set
776# CONFIG_SENSORS_LM87 is not set
777CONFIG_SENSORS_LM90=y
778# CONFIG_SENSORS_LM92 is not set
779# CONFIG_SENSORS_MAX1619 is not set
780# CONFIG_SENSORS_PC87360 is not set
781# CONFIG_SENSORS_SIS5595 is not set
782# CONFIG_SENSORS_SMSC47M1 is not set
783# CONFIG_SENSORS_SMSC47B397 is not set
784# CONFIG_SENSORS_VIA686A is not set
785# CONFIG_SENSORS_W83781D is not set
786# CONFIG_SENSORS_W83L785TS is not set
787# CONFIG_SENSORS_W83627HF is not set
788# CONFIG_SENSORS_W83627EHF is not set
789# CONFIG_HWMON_DEBUG_CHIP is not set
790
791#
792# Misc devices
793#
794
795#
796# Multimedia devices
797#
798# CONFIG_VIDEO_DEV is not set
799
800#
801# Digital Video Broadcasting Devices
802#
803# CONFIG_DVB is not set
804
805#
806# Graphics support
807#
808# CONFIG_FB is not set
809
810#
811# Console display driver support
812#
813# CONFIG_VGA_CONSOLE is not set
814CONFIG_DUMMY_CONSOLE=y
815
816#
817# Sound
818#
819# CONFIG_SOUND is not set
820
821#
822# USB support
823#
824CONFIG_USB_ARCH_HAS_HCD=y
825CONFIG_USB_ARCH_HAS_OHCI=y
826# CONFIG_USB is not set
827
828#
829# USB Gadget Support
830#
831# CONFIG_USB_GADGET is not set
832
833#
834# MMC/SD Card support
835#
836# CONFIG_MMC is not set
837
838#
839# InfiniBand support
840#
841# CONFIG_INFINIBAND is not set
842
843#
844# SN Devices
845#
846
847#
848# File systems
849#
850CONFIG_EXT2_FS=y
851# CONFIG_EXT2_FS_XATTR is not set
852# CONFIG_EXT2_FS_XIP is not set
853# CONFIG_EXT3_FS is not set
854# CONFIG_JBD is not set
855# CONFIG_REISERFS_FS is not set
856# CONFIG_JFS_FS is not set
857# CONFIG_FS_POSIX_ACL is not set
858
859#
860# XFS support
861#
862# CONFIG_XFS_FS is not set
863# CONFIG_MINIX_FS is not set
864# CONFIG_ROMFS_FS is not set
865CONFIG_INOTIFY=y
866# CONFIG_QUOTA is not set
867CONFIG_DNOTIFY=y
868# CONFIG_AUTOFS_FS is not set
869# CONFIG_AUTOFS4_FS is not set
870
871#
872# CD-ROM/DVD Filesystems
873#
874CONFIG_ISO9660_FS=y
875# CONFIG_JOLIET is not set
876# CONFIG_ZISOFS is not set
877# CONFIG_UDF_FS is not set
878
879#
880# DOS/FAT/NT Filesystems
881#
882# CONFIG_MSDOS_FS is not set
883# CONFIG_VFAT_FS is not set
884# CONFIG_NTFS_FS is not set
885
886#
887# Pseudo filesystems
888#
889CONFIG_PROC_FS=y
890CONFIG_PROC_KCORE=y
891CONFIG_SYSFS=y
892# CONFIG_DEVPTS_FS_XATTR is not set
893CONFIG_TMPFS=y
894# CONFIG_TMPFS_XATTR is not set
895# CONFIG_HUGETLB_PAGE is not set
896CONFIG_RAMFS=y
897
898#
899# Miscellaneous filesystems
900#
901# CONFIG_ADFS_FS is not set
902# CONFIG_AFFS_FS is not set
903# CONFIG_HFS_FS is not set
904# CONFIG_HFSPLUS_FS is not set
905# CONFIG_BEFS_FS is not set
906# CONFIG_BFS_FS is not set
907# CONFIG_EFS_FS is not set
908# CONFIG_JFFS_FS is not set
909CONFIG_JFFS2_FS=y
910CONFIG_JFFS2_FS_DEBUG=0
911CONFIG_JFFS2_FS_WRITEBUFFER=y
912# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
913CONFIG_JFFS2_ZLIB=y
914CONFIG_JFFS2_RTIME=y
915# CONFIG_JFFS2_RUBIN is not set
916# CONFIG_CRAMFS is not set
917# CONFIG_VXFS_FS is not set
918# CONFIG_HPFS_FS is not set
919# CONFIG_QNX4FS_FS is not set
920# CONFIG_SYSV_FS is not set
921# CONFIG_UFS_FS is not set
922
923#
924# Network File Systems
925#
926CONFIG_NFS_FS=y
927CONFIG_NFS_V3=y
928# CONFIG_NFS_V3_ACL is not set
929# CONFIG_NFS_V4 is not set
930# CONFIG_NFS_DIRECTIO is not set
931# CONFIG_NFSD is not set
932CONFIG_ROOT_NFS=y
933CONFIG_LOCKD=y
934CONFIG_LOCKD_V4=y
935CONFIG_NFS_COMMON=y
936CONFIG_SUNRPC=y
937# CONFIG_RPCSEC_GSS_KRB5 is not set
938# CONFIG_RPCSEC_GSS_SPKM3 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#
954# CONFIG_NLS is not set
955
956#
957# Library routines
958#
959CONFIG_CRC_CCITT=y
960CONFIG_CRC32=y
961# CONFIG_LIBCRC32C is not set
962CONFIG_ZLIB_INFLATE=y
963CONFIG_ZLIB_DEFLATE=y
964
965#
966# Profiling support
967#
968# CONFIG_PROFILING is not set
969
970#
971# Kernel hacking
972#
973# CONFIG_PRINTK_TIME is not set
974# CONFIG_DEBUG_KERNEL is not set
975CONFIG_LOG_BUF_SHIFT=14
976# CONFIG_SERIAL_TEXT_DEBUG is not set
977
978#
979# Security options
980#
981# CONFIG_KEYS is not set
982# CONFIG_SECURITY is not set
983
984#
985# Cryptographic options
986#
987# CONFIG_CRYPTO is not set
988
989#
990# Hardware crypto devices
991#
diff --git a/arch/ppc/configs/redwood5_defconfig b/arch/ppc/configs/redwood5_defconfig
deleted file mode 100644
index 4c5486da4139..000000000000
--- a/arch/ppc/configs/redwood5_defconfig
+++ /dev/null
@@ -1,557 +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
24# CONFIG_BSD_PROCESS_ACCT is not set
25CONFIG_SYSCTL=y
26CONFIG_LOG_BUF_SHIFT=14
27# CONFIG_HOTPLUG is not set
28# CONFIG_IKCONFIG is not set
29CONFIG_EMBEDDED=y
30# CONFIG_KALLSYMS is not set
31CONFIG_FUTEX=y
32# CONFIG_EPOLL is not set
33CONFIG_IOSCHED_NOOP=y
34CONFIG_IOSCHED_AS=y
35CONFIG_IOSCHED_DEADLINE=y
36# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
37
38#
39# Loadable module support
40#
41CONFIG_MODULES=y
42CONFIG_MODULE_UNLOAD=y
43# CONFIG_MODULE_FORCE_UNLOAD is not set
44CONFIG_OBSOLETE_MODPARM=y
45# CONFIG_MODVERSIONS is not set
46CONFIG_KMOD=y
47
48#
49# Processor
50#
51# CONFIG_6xx is not set
52CONFIG_40x=y
53# CONFIG_44x is not set
54# CONFIG_POWER3 is not set
55# CONFIG_POWER4 is not set
56# CONFIG_8xx is not set
57# CONFIG_MATH_EMULATION is not set
58# CONFIG_CPU_FREQ is not set
59CONFIG_4xx=y
60
61#
62# IBM 4xx options
63#
64# CONFIG_ASH is not set
65# CONFIG_CPCI405 is not set
66# CONFIG_EP405 is not set
67# CONFIG_OAK is not set
68CONFIG_REDWOOD_5=y
69# CONFIG_REDWOOD_6 is not set
70# CONFIG_SYCAMORE is not set
71# CONFIG_WALNUT is not set
72CONFIG_IBM405_ERR77=y
73CONFIG_IBM405_ERR51=y
74CONFIG_IBM_OCP=y
75CONFIG_PPC_OCP=y
76CONFIG_STB03xxx=y
77CONFIG_IBM_OPENBIOS=y
78# CONFIG_PM is not set
79CONFIG_UART0_TTYS0=y
80# CONFIG_UART0_TTYS1 is not set
81# CONFIG_SERIAL_SICC is not set
82CONFIG_NOT_COHERENT_CACHE=y
83
84#
85# Platform options
86#
87# CONFIG_PC_KEYBOARD is not set
88# CONFIG_SMP is not set
89# CONFIG_PREEMPT is not set
90# CONFIG_HIGHMEM is not set
91CONFIG_KERNEL_ELF=y
92CONFIG_BINFMT_ELF=y
93# CONFIG_BINFMT_MISC is not set
94CONFIG_CMDLINE_BOOL=y
95CONFIG_CMDLINE="ip=on"
96
97#
98# Bus options
99#
100# CONFIG_PCI is not set
101# CONFIG_PCI_DOMAINS is not set
102
103#
104# Advanced setup
105#
106# CONFIG_ADVANCED_OPTIONS is not set
107
108#
109# Default settings for advanced configuration options are used
110#
111CONFIG_HIGHMEM_START=0xfe000000
112CONFIG_LOWMEM_SIZE=0x30000000
113CONFIG_KERNEL_START=0xc0000000
114CONFIG_TASK_SIZE=0x80000000
115CONFIG_BOOT_LOAD=0x00400000
116
117#
118# Device Drivers
119#
120
121#
122# Generic Driver Options
123#
124
125#
126# Memory Technology Devices (MTD)
127#
128# CONFIG_MTD is not set
129
130#
131# Parallel port support
132#
133# CONFIG_PARPORT is not set
134
135#
136# Plug and Play support
137#
138
139#
140# Block devices
141#
142# CONFIG_BLK_DEV_FD is not set
143CONFIG_BLK_DEV_LOOP=y
144# CONFIG_BLK_DEV_CRYPTOLOOP is not set
145# CONFIG_BLK_DEV_NBD is not set
146CONFIG_BLK_DEV_RAM=y
147CONFIG_BLK_DEV_RAM_SIZE=4096
148CONFIG_BLK_DEV_INITRD=y
149# CONFIG_LBD is not set
150
151#
152# ATA/ATAPI/MFM/RLL support
153#
154CONFIG_IDE=y
155CONFIG_BLK_DEV_IDE=y
156
157#
158# Please see Documentation/ide.txt for help/info on IDE drives
159#
160CONFIG_BLK_DEV_IDEDISK=y
161# CONFIG_IDEDISK_MULTI_MODE is not set
162# CONFIG_IDEDISK_STROKE is not set
163# CONFIG_BLK_DEV_IDECD is not set
164# CONFIG_BLK_DEV_IDETAPE is not set
165# CONFIG_BLK_DEV_IDEFLOPPY is not set
166# CONFIG_IDE_TASK_IOCTL is not set
167# CONFIG_IDE_TASKFILE_IO is not set
168
169#
170# IDE chipset support/bugfixes
171#
172CONFIG_IDE_GENERIC=y
173# CONFIG_BLK_DEV_IDEDMA is not set
174# CONFIG_IDEDMA_AUTO is not set
175# CONFIG_BLK_DEV_HD is not set
176
177#
178# SCSI device support
179#
180# CONFIG_SCSI is not set
181
182#
183# Multi-device support (RAID and LVM)
184#
185# CONFIG_MD is not set
186
187#
188# Fusion MPT device support
189#
190
191#
192# IEEE 1394 (FireWire) support
193#
194# CONFIG_IEEE1394 is not set
195
196#
197# I2O device support
198#
199
200#
201# Macintosh device drivers
202#
203
204#
205# Networking support
206#
207CONFIG_NET=y
208
209#
210# Networking options
211#
212# CONFIG_PACKET is not set
213# CONFIG_NETLINK_DEV is not set
214CONFIG_UNIX=y
215# CONFIG_NET_KEY is not set
216CONFIG_INET=y
217CONFIG_IP_MULTICAST=y
218# CONFIG_IP_ADVANCED_ROUTER is not set
219CONFIG_IP_PNP=y
220CONFIG_IP_PNP_DHCP=y
221CONFIG_IP_PNP_BOOTP=y
222CONFIG_IP_PNP_RARP=y
223# CONFIG_NET_IPIP is not set
224# CONFIG_NET_IPGRE is not set
225# CONFIG_IP_MROUTE is not set
226# CONFIG_ARPD is not set
227CONFIG_SYN_COOKIES=y
228# CONFIG_INET_AH is not set
229# CONFIG_INET_ESP is not set
230# CONFIG_INET_IPCOMP is not set
231# CONFIG_IPV6 is not set
232# CONFIG_DECNET is not set
233# CONFIG_BRIDGE is not set
234# CONFIG_NETFILTER is not set
235
236#
237# SCTP Configuration (EXPERIMENTAL)
238#
239# CONFIG_IP_SCTP is not set
240# CONFIG_ATM is not set
241# CONFIG_VLAN_8021Q is not set
242# CONFIG_LLC2 is not set
243# CONFIG_IPX is not set
244# CONFIG_ATALK is not set
245# CONFIG_X25 is not set
246# CONFIG_LAPB is not set
247# CONFIG_NET_DIVERT is not set
248# CONFIG_ECONET is not set
249# CONFIG_WAN_ROUTER is not set
250# CONFIG_NET_HW_FLOWCONTROL is not set
251
252#
253# QoS and/or fair queueing
254#
255# CONFIG_NET_SCHED is not set
256
257#
258# Network testing
259#
260# CONFIG_NET_PKTGEN is not set
261CONFIG_NETDEVICES=y
262# CONFIG_DUMMY is not set
263# CONFIG_BONDING is not set
264# CONFIG_EQUALIZER is not set
265# CONFIG_TUN is not set
266
267#
268# Ethernet (10 or 100Mbit)
269#
270CONFIG_NET_ETHERNET=y
271CONFIG_MII=y
272# CONFIG_OAKNET is not set
273
274#
275# Ethernet (1000 Mbit)
276#
277
278#
279# Ethernet (10000 Mbit)
280#
281# CONFIG_IBM_EMAC is not set
282# CONFIG_PPP is not set
283# CONFIG_SLIP is not set
284
285#
286# Wireless LAN (non-hamradio)
287#
288# CONFIG_NET_RADIO is not set
289
290#
291# Token Ring devices
292#
293# CONFIG_SHAPER is not set
294# CONFIG_NETCONSOLE is not set
295
296#
297# Wan interfaces
298#
299# CONFIG_WAN is not set
300
301#
302# Amateur Radio support
303#
304# CONFIG_HAMRADIO is not set
305
306#
307# IrDA (infrared) support
308#
309# CONFIG_IRDA is not set
310
311#
312# Bluetooth support
313#
314# CONFIG_BT is not set
315# CONFIG_NETPOLL is not set
316# CONFIG_NET_POLL_CONTROLLER is not set
317
318#
319# ISDN subsystem
320#
321# CONFIG_ISDN is not set
322
323#
324# Telephony Support
325#
326# CONFIG_PHONE is not set
327
328#
329# Input device support
330#
331CONFIG_INPUT=y
332
333#
334# Userland interfaces
335#
336# CONFIG_INPUT_MOUSEDEV is not set
337# CONFIG_INPUT_JOYDEV is not set
338# CONFIG_INPUT_TSDEV is not set
339# CONFIG_INPUT_EVDEV is not set
340# CONFIG_INPUT_EVBUG is not set
341
342#
343# Input I/O drivers
344#
345# CONFIG_GAMEPORT is not set
346CONFIG_SOUND_GAMEPORT=y
347CONFIG_SERIO=y
348# CONFIG_SERIO_I8042 is not set
349# CONFIG_SERIO_SERPORT is not set
350# CONFIG_SERIO_CT82C710 is not set
351
352#
353# Input Device Drivers
354#
355# CONFIG_INPUT_KEYBOARD is not set
356# CONFIG_INPUT_MOUSE is not set
357# CONFIG_INPUT_JOYSTICK is not set
358# CONFIG_INPUT_TOUCHSCREEN is not set
359# CONFIG_INPUT_MISC is not set
360
361#
362# Character devices
363#
364# CONFIG_VT is not set
365# CONFIG_SERIAL_NONSTANDARD is not set
366
367#
368# Serial drivers
369#
370CONFIG_SERIAL_8250=y
371CONFIG_SERIAL_8250_CONSOLE=y
372CONFIG_SERIAL_8250_NR_UARTS=4
373# CONFIG_SERIAL_8250_EXTENDED is not set
374
375#
376# Non-8250 serial port support
377#
378CONFIG_SERIAL_CORE=y
379CONFIG_SERIAL_CORE_CONSOLE=y
380# CONFIG_UNIX98_PTYS is not set
381CONFIG_LEGACY_PTYS=y
382CONFIG_LEGACY_PTY_COUNT=256
383# CONFIG_QIC02_TAPE is not set
384
385#
386# IPMI
387#
388# CONFIG_IPMI_HANDLER is not set
389
390#
391# Watchdog Cards
392#
393# CONFIG_WATCHDOG is not set
394# CONFIG_NVRAM is not set
395CONFIG_GEN_RTC=y
396# CONFIG_GEN_RTC_X is not set
397# CONFIG_DTLK is not set
398# CONFIG_R3964 is not set
399# CONFIG_APPLICOM is not set
400
401#
402# Ftape, the floppy tape device driver
403#
404# CONFIG_FTAPE is not set
405# CONFIG_AGP is not set
406# CONFIG_DRM is not set
407# CONFIG_RAW_DRIVER is not set
408
409#
410# I2C support
411#
412# CONFIG_I2C is not set
413
414#
415# Misc devices
416#
417
418#
419# Multimedia devices
420#
421# CONFIG_VIDEO_DEV is not set
422
423#
424# Digital Video Broadcasting Devices
425#
426# CONFIG_DVB is not set
427
428#
429# Graphics support
430#
431# CONFIG_FB is not set
432
433#
434# Sound
435#
436# CONFIG_SOUND is not set
437
438#
439# USB support
440#
441
442#
443# USB Gadget Support
444#
445# CONFIG_USB_GADGET is not set
446
447#
448# File systems
449#
450CONFIG_EXT2_FS=y
451# CONFIG_EXT2_FS_XATTR is not set
452# CONFIG_EXT3_FS is not set
453# CONFIG_JBD is not set
454# CONFIG_REISERFS_FS is not set
455# CONFIG_JFS_FS is not set
456# CONFIG_XFS_FS is not set
457# CONFIG_MINIX_FS is not set
458# CONFIG_ROMFS_FS is not set
459# CONFIG_QUOTA is not set
460# CONFIG_AUTOFS_FS is not set
461# CONFIG_AUTOFS4_FS is not set
462
463#
464# CD-ROM/DVD Filesystems
465#
466# CONFIG_ISO9660_FS is not set
467# CONFIG_UDF_FS is not set
468
469#
470# DOS/FAT/NT Filesystems
471#
472# CONFIG_FAT_FS is not set
473# CONFIG_NTFS_FS is not set
474
475#
476# Pseudo filesystems
477#
478CONFIG_PROC_FS=y
479CONFIG_PROC_KCORE=y
480# CONFIG_DEVFS_FS is not set
481CONFIG_TMPFS=y
482# CONFIG_HUGETLB_PAGE is not set
483CONFIG_RAMFS=y
484
485#
486# Miscellaneous filesystems
487#
488# CONFIG_ADFS_FS is not set
489# CONFIG_AFFS_FS is not set
490# CONFIG_HFS_FS is not set
491# CONFIG_HFSPLUS_FS is not set
492# CONFIG_BEFS_FS is not set
493# CONFIG_BFS_FS is not set
494# CONFIG_EFS_FS is not set
495# CONFIG_CRAMFS is not set
496# CONFIG_VXFS_FS is not set
497# CONFIG_HPFS_FS is not set
498# CONFIG_QNX4FS_FS is not set
499# CONFIG_SYSV_FS is not set
500# CONFIG_UFS_FS is not set
501
502#
503# Network File Systems
504#
505CONFIG_NFS_FS=y
506# CONFIG_NFS_V3 is not set
507# CONFIG_NFS_V4 is not set
508# CONFIG_NFS_DIRECTIO is not set
509# CONFIG_NFSD is not set
510CONFIG_ROOT_NFS=y
511CONFIG_LOCKD=y
512# CONFIG_EXPORTFS is not set
513CONFIG_SUNRPC=y
514# CONFIG_RPCSEC_GSS_KRB5 is not set
515# CONFIG_SMB_FS is not set
516# CONFIG_CIFS is not set
517# CONFIG_NCP_FS is not set
518# CONFIG_CODA_FS is not set
519# CONFIG_INTERMEZZO_FS is not set
520# CONFIG_AFS_FS is not set
521
522#
523# Partition Types
524#
525# CONFIG_PARTITION_ADVANCED is not set
526CONFIG_MSDOS_PARTITION=y
527
528#
529# Native Language Support
530#
531# CONFIG_NLS is not set
532
533#
534# IBM 40x options
535#
536
537#
538# Library routines
539#
540# CONFIG_CRC32 is not set
541
542#
543# Kernel hacking
544#
545# CONFIG_DEBUG_KERNEL is not set
546# CONFIG_SERIAL_TEXT_DEBUG is not set
547CONFIG_OCP=y
548
549#
550# Security options
551#
552# CONFIG_SECURITY is not set
553
554#
555# Cryptographic options
556#
557# CONFIG_CRYPTO is not set
diff --git a/arch/ppc/configs/redwood6_defconfig b/arch/ppc/configs/redwood6_defconfig
deleted file mode 100644
index 5752845c2601..000000000000
--- a/arch/ppc/configs/redwood6_defconfig
+++ /dev/null
@@ -1,535 +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#
22# CONFIG_SWAP is not set
23CONFIG_SYSVIPC=y
24# CONFIG_BSD_PROCESS_ACCT is not set
25CONFIG_SYSCTL=y
26CONFIG_LOG_BUF_SHIFT=14
27# CONFIG_HOTPLUG is not set
28# CONFIG_IKCONFIG is not set
29CONFIG_EMBEDDED=y
30# CONFIG_KALLSYMS is not set
31CONFIG_FUTEX=y
32# CONFIG_EPOLL is not set
33CONFIG_IOSCHED_NOOP=y
34CONFIG_IOSCHED_AS=y
35CONFIG_IOSCHED_DEADLINE=y
36# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
37
38#
39# Loadable module support
40#
41CONFIG_MODULES=y
42# CONFIG_MODULE_UNLOAD is not set
43CONFIG_OBSOLETE_MODPARM=y
44# CONFIG_MODVERSIONS is not set
45CONFIG_KMOD=y
46
47#
48# Processor
49#
50# CONFIG_6xx is not set
51CONFIG_40x=y
52# CONFIG_44x is not set
53# CONFIG_POWER3 is not set
54# CONFIG_POWER4 is not set
55# CONFIG_8xx is not set
56# CONFIG_MATH_EMULATION is not set
57# CONFIG_CPU_FREQ is not set
58CONFIG_4xx=y
59
60#
61# IBM 4xx options
62#
63# CONFIG_ASH is not set
64# CONFIG_CPCI405 is not set
65# CONFIG_EP405 is not set
66# CONFIG_OAK is not set
67# CONFIG_REDWOOD_5 is not set
68CONFIG_REDWOOD_6=y
69# CONFIG_SYCAMORE is not set
70# CONFIG_WALNUT is not set
71CONFIG_IBM405_ERR77=y
72CONFIG_IBM405_ERR51=y
73CONFIG_IBM_OCP=y
74CONFIG_PPC_OCP=y
75CONFIG_STB03xxx=y
76CONFIG_IBM_OPENBIOS=y
77# CONFIG_PM is not set
78CONFIG_UART0_TTYS0=y
79# CONFIG_UART0_TTYS1 is not set
80# CONFIG_SERIAL_SICC is not set
81CONFIG_NOT_COHERENT_CACHE=y
82
83#
84# Platform options
85#
86# CONFIG_PC_KEYBOARD is not set
87# CONFIG_SMP is not set
88# CONFIG_PREEMPT is not set
89# CONFIG_HIGHMEM is not set
90CONFIG_KERNEL_ELF=y
91CONFIG_BINFMT_ELF=y
92# CONFIG_BINFMT_MISC is not set
93CONFIG_CMDLINE_BOOL=y
94CONFIG_CMDLINE="ip=on"
95
96#
97# Bus options
98#
99# CONFIG_PCI is not set
100# CONFIG_PCI_DOMAINS is not set
101
102#
103# Advanced setup
104#
105# CONFIG_ADVANCED_OPTIONS is not set
106
107#
108# Default settings for advanced configuration options are used
109#
110CONFIG_HIGHMEM_START=0xfe000000
111CONFIG_LOWMEM_SIZE=0x30000000
112CONFIG_KERNEL_START=0xc0000000
113CONFIG_TASK_SIZE=0x80000000
114CONFIG_BOOT_LOAD=0x00400000
115
116#
117# Device Drivers
118#
119
120#
121# Generic Driver Options
122#
123
124#
125# Memory Technology Devices (MTD)
126#
127# CONFIG_MTD is not set
128
129#
130# Parallel port support
131#
132# CONFIG_PARPORT is not set
133
134#
135# Plug and Play support
136#
137
138#
139# Block devices
140#
141# CONFIG_BLK_DEV_FD is not set
142CONFIG_BLK_DEV_LOOP=y
143# CONFIG_BLK_DEV_CRYPTOLOOP is not set
144# CONFIG_BLK_DEV_NBD is not set
145CONFIG_BLK_DEV_RAM=y
146CONFIG_BLK_DEV_RAM_SIZE=4096
147CONFIG_BLK_DEV_INITRD=y
148# CONFIG_LBD is not set
149
150#
151# ATA/ATAPI/MFM/RLL support
152#
153# CONFIG_IDE is not set
154
155#
156# SCSI device support
157#
158# CONFIG_SCSI is not set
159
160#
161# Multi-device support (RAID and LVM)
162#
163# CONFIG_MD is not set
164
165#
166# Fusion MPT device support
167#
168
169#
170# IEEE 1394 (FireWire) support
171#
172# CONFIG_IEEE1394 is not set
173
174#
175# I2O device support
176#
177
178#
179# Macintosh device drivers
180#
181
182#
183# Networking support
184#
185CONFIG_NET=y
186
187#
188# Networking options
189#
190# CONFIG_PACKET is not set
191# CONFIG_NETLINK_DEV is not set
192CONFIG_UNIX=y
193# CONFIG_NET_KEY is not set
194CONFIG_INET=y
195CONFIG_IP_MULTICAST=y
196# CONFIG_IP_ADVANCED_ROUTER is not set
197CONFIG_IP_PNP=y
198# CONFIG_IP_PNP_DHCP is not set
199CONFIG_IP_PNP_BOOTP=y
200CONFIG_IP_PNP_RARP=y
201# CONFIG_NET_IPIP is not set
202# CONFIG_NET_IPGRE is not set
203# CONFIG_IP_MROUTE is not set
204# CONFIG_ARPD is not set
205CONFIG_SYN_COOKIES=y
206# CONFIG_INET_AH is not set
207# CONFIG_INET_ESP is not set
208# CONFIG_INET_IPCOMP is not set
209# CONFIG_IPV6 is not set
210# CONFIG_DECNET is not set
211# CONFIG_BRIDGE is not set
212# CONFIG_NETFILTER is not set
213
214#
215# SCTP Configuration (EXPERIMENTAL)
216#
217# CONFIG_IP_SCTP is not set
218# CONFIG_ATM is not set
219# CONFIG_VLAN_8021Q is not set
220# CONFIG_LLC2 is not set
221# CONFIG_IPX is not set
222# CONFIG_ATALK is not set
223# CONFIG_X25 is not set
224# CONFIG_LAPB is not set
225# CONFIG_NET_DIVERT is not set
226# CONFIG_ECONET is not set
227# CONFIG_WAN_ROUTER is not set
228# CONFIG_NET_HW_FLOWCONTROL is not set
229
230#
231# QoS and/or fair queueing
232#
233# CONFIG_NET_SCHED is not set
234
235#
236# Network testing
237#
238# CONFIG_NET_PKTGEN is not set
239CONFIG_NETDEVICES=y
240# CONFIG_DUMMY is not set
241# CONFIG_BONDING is not set
242# CONFIG_EQUALIZER is not set
243# CONFIG_TUN is not set
244
245#
246# Ethernet (10 or 100Mbit)
247#
248CONFIG_NET_ETHERNET=y
249CONFIG_MII=y
250# CONFIG_OAKNET is not set
251
252#
253# Ethernet (1000 Mbit)
254#
255
256#
257# Ethernet (10000 Mbit)
258#
259# CONFIG_IBM_EMAC is not set
260# CONFIG_PPP is not set
261# CONFIG_SLIP is not set
262
263#
264# Wireless LAN (non-hamradio)
265#
266# CONFIG_NET_RADIO is not set
267
268#
269# Token Ring devices
270#
271# CONFIG_SHAPER is not set
272# CONFIG_NETCONSOLE is not set
273
274#
275# Wan interfaces
276#
277# CONFIG_WAN is not set
278
279#
280# Amateur Radio support
281#
282# CONFIG_HAMRADIO is not set
283
284#
285# IrDA (infrared) support
286#
287# CONFIG_IRDA is not set
288
289#
290# Bluetooth support
291#
292# CONFIG_BT is not set
293# CONFIG_NETPOLL is not set
294# CONFIG_NET_POLL_CONTROLLER is not set
295
296#
297# ISDN subsystem
298#
299# CONFIG_ISDN is not set
300
301#
302# Telephony Support
303#
304# CONFIG_PHONE is not set
305
306#
307# Input device support
308#
309CONFIG_INPUT=y
310
311#
312# Userland interfaces
313#
314# CONFIG_INPUT_MOUSEDEV is not set
315# CONFIG_INPUT_JOYDEV is not set
316# CONFIG_INPUT_TSDEV is not set
317# CONFIG_INPUT_EVDEV is not set
318# CONFIG_INPUT_EVBUG is not set
319
320#
321# Input I/O drivers
322#
323# CONFIG_GAMEPORT is not set
324CONFIG_SOUND_GAMEPORT=y
325CONFIG_SERIO=y
326# CONFIG_SERIO_I8042 is not set
327# CONFIG_SERIO_SERPORT is not set
328# CONFIG_SERIO_CT82C710 is not set
329
330#
331# Input Device Drivers
332#
333# CONFIG_INPUT_KEYBOARD is not set
334# CONFIG_INPUT_MOUSE is not set
335# CONFIG_INPUT_JOYSTICK is not set
336# CONFIG_INPUT_TOUCHSCREEN is not set
337# CONFIG_INPUT_MISC is not set
338
339#
340# Character devices
341#
342# CONFIG_VT is not set
343# CONFIG_SERIAL_NONSTANDARD is not set
344
345#
346# Serial drivers
347#
348CONFIG_SERIAL_8250=y
349CONFIG_SERIAL_8250_CONSOLE=y
350CONFIG_SERIAL_8250_NR_UARTS=4
351# CONFIG_SERIAL_8250_EXTENDED is not set
352
353#
354# Non-8250 serial port support
355#
356CONFIG_SERIAL_CORE=y
357CONFIG_SERIAL_CORE_CONSOLE=y
358CONFIG_UNIX98_PTYS=y
359CONFIG_LEGACY_PTYS=y
360CONFIG_LEGACY_PTY_COUNT=256
361# CONFIG_QIC02_TAPE is not set
362
363#
364# IPMI
365#
366# CONFIG_IPMI_HANDLER is not set
367
368#
369# Watchdog Cards
370#
371# CONFIG_WATCHDOG is not set
372# CONFIG_NVRAM is not set
373# CONFIG_GEN_RTC is not set
374# CONFIG_DTLK is not set
375# CONFIG_R3964 is not set
376# CONFIG_APPLICOM is not set
377
378#
379# Ftape, the floppy tape device driver
380#
381# CONFIG_FTAPE is not set
382# CONFIG_AGP is not set
383# CONFIG_DRM is not set
384# CONFIG_RAW_DRIVER is not set
385
386#
387# I2C support
388#
389# CONFIG_I2C is not set
390
391#
392# Misc devices
393#
394
395#
396# Multimedia devices
397#
398# CONFIG_VIDEO_DEV is not set
399
400#
401# Digital Video Broadcasting Devices
402#
403# CONFIG_DVB is not set
404
405#
406# Graphics support
407#
408# CONFIG_FB is not set
409
410#
411# Sound
412#
413# CONFIG_SOUND is not set
414
415#
416# USB support
417#
418
419#
420# USB Gadget Support
421#
422# CONFIG_USB_GADGET is not set
423
424#
425# File systems
426#
427CONFIG_EXT2_FS=y
428# CONFIG_EXT2_FS_XATTR is not set
429# CONFIG_EXT3_FS is not set
430# CONFIG_JBD is not set
431# CONFIG_REISERFS_FS is not set
432# CONFIG_JFS_FS is not set
433# CONFIG_XFS_FS is not set
434# CONFIG_MINIX_FS is not set
435# CONFIG_ROMFS_FS is not set
436# CONFIG_QUOTA is not set
437# CONFIG_AUTOFS_FS is not set
438# CONFIG_AUTOFS4_FS is not set
439
440#
441# CD-ROM/DVD Filesystems
442#
443# CONFIG_ISO9660_FS is not set
444# CONFIG_UDF_FS is not set
445
446#
447# DOS/FAT/NT Filesystems
448#
449# CONFIG_FAT_FS is not set
450# CONFIG_NTFS_FS is not set
451
452#
453# Pseudo filesystems
454#
455CONFIG_PROC_FS=y
456CONFIG_PROC_KCORE=y
457# CONFIG_DEVFS_FS is not set
458# CONFIG_DEVPTS_FS_XATTR is not set
459CONFIG_TMPFS=y
460# CONFIG_HUGETLB_PAGE is not set
461CONFIG_RAMFS=y
462
463#
464# Miscellaneous filesystems
465#
466# CONFIG_ADFS_FS is not set
467# CONFIG_AFFS_FS is not set
468# CONFIG_HFS_FS is not set
469# CONFIG_HFSPLUS_FS is not set
470# CONFIG_BEFS_FS is not set
471# CONFIG_BFS_FS is not set
472# CONFIG_EFS_FS is not set
473# CONFIG_CRAMFS is not set
474# CONFIG_VXFS_FS is not set
475# CONFIG_HPFS_FS is not set
476# CONFIG_QNX4FS_FS is not set
477# CONFIG_SYSV_FS is not set
478# CONFIG_UFS_FS is not set
479
480#
481# Network File Systems
482#
483CONFIG_NFS_FS=y
484# CONFIG_NFS_V3 is not set
485# CONFIG_NFS_V4 is not set
486# CONFIG_NFS_DIRECTIO is not set
487# CONFIG_NFSD is not set
488CONFIG_ROOT_NFS=y
489CONFIG_LOCKD=y
490# CONFIG_EXPORTFS is not set
491CONFIG_SUNRPC=y
492# CONFIG_RPCSEC_GSS_KRB5 is not set
493# CONFIG_SMB_FS is not set
494# CONFIG_CIFS is not set
495# CONFIG_NCP_FS is not set
496# CONFIG_CODA_FS is not set
497# CONFIG_INTERMEZZO_FS is not set
498# CONFIG_AFS_FS is not set
499
500#
501# Partition Types
502#
503# CONFIG_PARTITION_ADVANCED is not set
504CONFIG_MSDOS_PARTITION=y
505
506#
507# Native Language Support
508#
509# CONFIG_NLS is not set
510
511#
512# IBM 40x options
513#
514
515#
516# Library routines
517#
518# CONFIG_CRC32 is not set
519
520#
521# Kernel hacking
522#
523# CONFIG_DEBUG_KERNEL is not set
524# CONFIG_SERIAL_TEXT_DEBUG is not set
525CONFIG_OCP=y
526
527#
528# Security options
529#
530# CONFIG_SECURITY is not set
531
532#
533# Cryptographic options
534#
535# CONFIG_CRYPTO is not set
diff --git a/arch/ppc/configs/rpx8260_defconfig b/arch/ppc/configs/rpx8260_defconfig
deleted file mode 100644
index a9c4544ae560..000000000000
--- a/arch/ppc/configs/rpx8260_defconfig
+++ /dev/null
@@ -1,555 +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
16CONFIG_STANDALONE=y
17CONFIG_BROKEN_ON_SMP=y
18
19#
20# General setup
21#
22# CONFIG_SWAP is not set
23CONFIG_SYSVIPC=y
24# CONFIG_POSIX_MQUEUE is not set
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
30# CONFIG_IKCONFIG is not set
31CONFIG_EMBEDDED=y
32# CONFIG_KALLSYMS is not set
33CONFIG_FUTEX=y
34# CONFIG_EPOLL is not set
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#
44# CONFIG_MODULES is not set
45
46#
47# Processor
48#
49CONFIG_6xx=y
50# CONFIG_40x is not set
51# CONFIG_44x is not set
52# CONFIG_POWER3 is not set
53# CONFIG_POWER4 is not set
54# CONFIG_8xx is not set
55# CONFIG_E500 is not set
56# CONFIG_CPU_FREQ is not set
57CONFIG_EMBEDDEDBOOT=y
58CONFIG_PPC_STD_MMU=y
59
60#
61# Platform options
62#
63# CONFIG_PPC_MULTIPLATFORM is not set
64# CONFIG_APUS is not set
65# CONFIG_WILLOW is not set
66# CONFIG_PCORE is not set
67# CONFIG_POWERPMC250 is not set
68# CONFIG_EV64260 is not set
69# CONFIG_SPRUCE is not set
70# CONFIG_LOPEC is not set
71# CONFIG_MCPN765 is not set
72# CONFIG_MVME5100 is not set
73# CONFIG_PPLUS is not set
74# CONFIG_PRPMC750 is not set
75# CONFIG_PRPMC800 is not set
76# CONFIG_SANDPOINT is not set
77# CONFIG_ADIR is not set
78# CONFIG_K2 is not set
79# CONFIG_PAL4 is not set
80# CONFIG_GEMINI is not set
81# CONFIG_EST8260 is not set
82# CONFIG_SBC82xx is not set
83# CONFIG_SBS8260 is not set
84CONFIG_RPX8260=y
85# CONFIG_TQM8260 is not set
86# CONFIG_ADS8272 is not set
87CONFIG_8260=y
88CONFIG_CPM2=y
89# CONFIG_PC_KEYBOARD is not set
90# CONFIG_SMP is not set
91# CONFIG_PREEMPT is not set
92# CONFIG_HIGHMEM is not set
93CONFIG_KERNEL_ELF=y
94CONFIG_BINFMT_ELF=y
95# CONFIG_BINFMT_MISC is not set
96# CONFIG_CMDLINE_BOOL is not set
97
98#
99# Bus options
100#
101# CONFIG_PCI is not set
102# CONFIG_PCI_DOMAINS is not set
103
104#
105# Advanced setup
106#
107# CONFIG_ADVANCED_OPTIONS is not set
108
109#
110# Default settings for advanced configuration options are used
111#
112CONFIG_HIGHMEM_START=0xfe000000
113CONFIG_LOWMEM_SIZE=0x30000000
114CONFIG_KERNEL_START=0xc0000000
115CONFIG_TASK_SIZE=0x80000000
116CONFIG_BOOT_LOAD=0x00400000
117
118#
119# Device Drivers
120#
121
122#
123# Generic Driver Options
124#
125CONFIG_PREVENT_FIRMWARE_BUILD=y
126
127#
128# Memory Technology Devices (MTD)
129#
130# CONFIG_MTD is not set
131
132#
133# Parallel port support
134#
135# CONFIG_PARPORT is not set
136
137#
138# Plug and Play support
139#
140
141#
142# Block devices
143#
144# CONFIG_BLK_DEV_FD is not set
145CONFIG_BLK_DEV_LOOP=y
146# CONFIG_BLK_DEV_CRYPTOLOOP is not set
147# CONFIG_BLK_DEV_NBD is not set
148CONFIG_BLK_DEV_RAM=y
149CONFIG_BLK_DEV_RAM_SIZE=4096
150CONFIG_BLK_DEV_INITRD=y
151# CONFIG_LBD is not set
152
153#
154# ATA/ATAPI/MFM/RLL support
155#
156# CONFIG_IDE is not set
157
158#
159# SCSI device support
160#
161# CONFIG_SCSI is not set
162
163#
164# Multi-device support (RAID and LVM)
165#
166# CONFIG_MD is not set
167
168#
169# Fusion MPT device support
170#
171
172#
173# IEEE 1394 (FireWire) support
174#
175# CONFIG_IEEE1394 is not set
176
177#
178# I2O device support
179#
180
181#
182# Macintosh device drivers
183#
184
185#
186# Networking support
187#
188CONFIG_NET=y
189
190#
191# Networking options
192#
193CONFIG_PACKET=y
194# CONFIG_PACKET_MMAP is not set
195# CONFIG_NETLINK_DEV is not set
196CONFIG_UNIX=y
197# CONFIG_NET_KEY is not set
198CONFIG_INET=y
199CONFIG_IP_MULTICAST=y
200# CONFIG_IP_ADVANCED_ROUTER is not set
201CONFIG_IP_PNP=y
202# CONFIG_IP_PNP_DHCP is not set
203CONFIG_IP_PNP_BOOTP=y
204# CONFIG_IP_PNP_RARP is not set
205# CONFIG_NET_IPIP is not set
206# CONFIG_NET_IPGRE is not set
207# CONFIG_IP_MROUTE is not set
208# CONFIG_ARPD is not set
209CONFIG_SYN_COOKIES=y
210# CONFIG_INET_AH is not set
211# CONFIG_INET_ESP is not set
212# CONFIG_INET_IPCOMP is not set
213# CONFIG_IPV6 is not set
214# CONFIG_NETFILTER is not set
215
216#
217# SCTP Configuration (EXPERIMENTAL)
218#
219# CONFIG_IP_SCTP is not set
220# CONFIG_ATM is not set
221# CONFIG_BRIDGE is not set
222# CONFIG_VLAN_8021Q is not set
223# CONFIG_DECNET is not set
224# CONFIG_LLC2 is not set
225# CONFIG_IPX is not set
226# CONFIG_ATALK is not set
227# CONFIG_X25 is not set
228# CONFIG_LAPB is not set
229# CONFIG_NET_DIVERT is not set
230# CONFIG_ECONET is not set
231# CONFIG_WAN_ROUTER is not set
232# CONFIG_NET_HW_FLOWCONTROL is not set
233
234#
235# QoS and/or fair queueing
236#
237# CONFIG_NET_SCHED is not set
238# CONFIG_NET_CLS_ROUTE is not set
239
240#
241# Network testing
242#
243# CONFIG_NET_PKTGEN is not set
244# CONFIG_NETPOLL is not set
245# CONFIG_NET_POLL_CONTROLLER is not set
246# CONFIG_HAMRADIO is not set
247# CONFIG_IRDA is not set
248# CONFIG_BT is not set
249CONFIG_NETDEVICES=y
250# CONFIG_DUMMY is not set
251# CONFIG_BONDING is not set
252# CONFIG_EQUALIZER is not set
253# CONFIG_TUN is not set
254
255#
256# Ethernet (10 or 100Mbit)
257#
258CONFIG_NET_ETHERNET=y
259# CONFIG_MII is not set
260# CONFIG_OAKNET is not set
261
262#
263# Ethernet (1000 Mbit)
264#
265
266#
267# Ethernet (10000 Mbit)
268#
269
270#
271# Token Ring devices
272#
273
274#
275# Wireless LAN (non-hamradio)
276#
277# CONFIG_NET_RADIO is not set
278
279#
280# Wan interfaces
281#
282# CONFIG_WAN is not set
283# CONFIG_PPP is not set
284# CONFIG_SLIP is not set
285# CONFIG_SHAPER is not set
286# CONFIG_NETCONSOLE is not set
287
288#
289# ISDN subsystem
290#
291# CONFIG_ISDN is not set
292
293#
294# Telephony Support
295#
296# CONFIG_PHONE is not set
297
298#
299# Input device support
300#
301# CONFIG_INPUT is not set
302
303#
304# Userland interfaces
305#
306
307#
308# Input I/O drivers
309#
310# CONFIG_GAMEPORT is not set
311CONFIG_SOUND_GAMEPORT=y
312# CONFIG_SERIO is not set
313# CONFIG_SERIO_I8042 is not set
314
315#
316# Input Device Drivers
317#
318
319#
320# Character devices
321#
322# CONFIG_VT is not set
323# CONFIG_SERIAL_NONSTANDARD is not set
324
325#
326# Serial drivers
327#
328# CONFIG_SERIAL_8250 is not set
329
330#
331# Non-8250 serial port support
332#
333CONFIG_SERIAL_CORE=y
334CONFIG_SERIAL_CORE_CONSOLE=y
335CONFIG_SERIAL_CPM=y
336CONFIG_SERIAL_CPM_CONSOLE=y
337# CONFIG_SERIAL_CPM_SCC1 is not set
338# CONFIG_SERIAL_CPM_SCC2 is not set
339# CONFIG_SERIAL_CPM_SCC3 is not set
340# CONFIG_SERIAL_CPM_SCC4 is not set
341CONFIG_SERIAL_CPM_SMC1=y
342# CONFIG_SERIAL_CPM_SMC2 is not set
343CONFIG_UNIX98_PTYS=y
344CONFIG_LEGACY_PTYS=y
345CONFIG_LEGACY_PTY_COUNT=256
346# CONFIG_QIC02_TAPE is not set
347
348#
349# IPMI
350#
351# CONFIG_IPMI_HANDLER is not set
352
353#
354# Watchdog Cards
355#
356# CONFIG_WATCHDOG is not set
357# CONFIG_NVRAM is not set
358# CONFIG_GEN_RTC is not set
359# CONFIG_DTLK is not set
360# CONFIG_R3964 is not set
361# CONFIG_APPLICOM is not set
362
363#
364# Ftape, the floppy tape device driver
365#
366# CONFIG_FTAPE is not set
367# CONFIG_AGP is not set
368# CONFIG_DRM is not set
369# CONFIG_RAW_DRIVER is not set
370
371#
372# I2C support
373#
374# CONFIG_I2C is not set
375
376#
377# Dallas's 1-wire bus
378#
379# CONFIG_W1 is not set
380
381#
382# Misc devices
383#
384
385#
386# Multimedia devices
387#
388# CONFIG_VIDEO_DEV is not set
389
390#
391# Digital Video Broadcasting Devices
392#
393# CONFIG_DVB is not set
394
395#
396# Graphics support
397#
398# CONFIG_FB is not set
399
400#
401# Sound
402#
403# CONFIG_SOUND is not set
404
405#
406# USB support
407#
408
409#
410# USB Gadget Support
411#
412# CONFIG_USB_GADGET is not set
413
414#
415# File systems
416#
417CONFIG_EXT2_FS=y
418# CONFIG_EXT2_FS_XATTR is not set
419CONFIG_EXT3_FS=y
420CONFIG_EXT3_FS_XATTR=y
421# CONFIG_EXT3_FS_POSIX_ACL is not set
422# CONFIG_EXT3_FS_SECURITY is not set
423CONFIG_JBD=y
424# CONFIG_JBD_DEBUG is not set
425CONFIG_FS_MBCACHE=y
426# CONFIG_REISERFS_FS is not set
427# CONFIG_JFS_FS is not set
428# CONFIG_XFS_FS is not set
429# CONFIG_MINIX_FS is not set
430# CONFIG_ROMFS_FS is not set
431# CONFIG_QUOTA is not set
432# CONFIG_AUTOFS_FS is not set
433# CONFIG_AUTOFS4_FS is not set
434
435#
436# CD-ROM/DVD Filesystems
437#
438# CONFIG_ISO9660_FS is not set
439# CONFIG_UDF_FS is not set
440
441#
442# DOS/FAT/NT Filesystems
443#
444# CONFIG_MSDOS_FS is not set
445# CONFIG_VFAT_FS is not set
446# CONFIG_NTFS_FS is not set
447
448#
449# Pseudo filesystems
450#
451CONFIG_PROC_FS=y
452CONFIG_PROC_KCORE=y
453CONFIG_SYSFS=y
454# CONFIG_DEVFS_FS is not set
455# CONFIG_DEVPTS_FS_XATTR is not set
456CONFIG_TMPFS=y
457# CONFIG_HUGETLB_PAGE is not set
458CONFIG_RAMFS=y
459
460#
461# Miscellaneous filesystems
462#
463# CONFIG_ADFS_FS is not set
464# CONFIG_AFFS_FS is not set
465# CONFIG_HFS_FS is not set
466# CONFIG_HFSPLUS_FS is not set
467# CONFIG_BEFS_FS is not set
468# CONFIG_BFS_FS is not set
469# CONFIG_EFS_FS is not set
470# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
471# CONFIG_CRAMFS is not set
472# CONFIG_VXFS_FS is not set
473# CONFIG_HPFS_FS is not set
474# CONFIG_QNX4FS_FS is not set
475# CONFIG_SYSV_FS is not set
476# CONFIG_UFS_FS is not set
477
478#
479# Network File Systems
480#
481CONFIG_NFS_FS=y
482CONFIG_NFS_V3=y
483# CONFIG_NFS_V4 is not set
484# CONFIG_NFS_DIRECTIO is not set
485# CONFIG_NFSD is not set
486CONFIG_ROOT_NFS=y
487CONFIG_LOCKD=y
488CONFIG_LOCKD_V4=y
489# CONFIG_EXPORTFS is not set
490CONFIG_SUNRPC=y
491# CONFIG_RPCSEC_GSS_KRB5 is not set
492# CONFIG_SMB_FS is not set
493# CONFIG_CIFS is not set
494# CONFIG_NCP_FS is not set
495# CONFIG_CODA_FS is not set
496# CONFIG_AFS_FS is not set
497
498#
499# Partition Types
500#
501CONFIG_PARTITION_ADVANCED=y
502# CONFIG_ACORN_PARTITION is not set
503# CONFIG_OSF_PARTITION is not set
504# CONFIG_AMIGA_PARTITION is not set
505# CONFIG_ATARI_PARTITION is not set
506# CONFIG_MAC_PARTITION is not set
507# CONFIG_MSDOS_PARTITION is not set
508# CONFIG_LDM_PARTITION is not set
509# CONFIG_SGI_PARTITION is not set
510# CONFIG_ULTRIX_PARTITION is not set
511# CONFIG_SUN_PARTITION is not set
512# CONFIG_EFI_PARTITION is not set
513
514#
515# Native Language Support
516#
517# CONFIG_NLS is not set
518# CONFIG_SCC_ENET is not set
519CONFIG_FEC_ENET=y
520# CONFIG_USE_MDIO is not set
521
522#
523# CPM2 Options
524#
525# CONFIG_FCC1_ENET is not set
526# CONFIG_FCC2_ENET is not set
527CONFIG_FCC3_ENET=y
528
529#
530# Library routines
531#
532# CONFIG_CRC_CCITT is not set
533# CONFIG_CRC32 is not set
534# CONFIG_LIBCRC32C is not set
535
536#
537# Profiling support
538#
539# CONFIG_PROFILING is not set
540
541#
542# Kernel hacking
543#
544# CONFIG_DEBUG_KERNEL is not set
545# CONFIG_KGDB_CONSOLE is not set
546
547#
548# Security options
549#
550# CONFIG_SECURITY is not set
551
552#
553# Cryptographic options
554#
555# CONFIG_CRYPTO is not set
diff --git a/arch/ppc/configs/rpxcllf_defconfig b/arch/ppc/configs/rpxcllf_defconfig
deleted file mode 100644
index cf932f13fa86..000000000000
--- a/arch/ppc/configs/rpxcllf_defconfig
+++ /dev/null
@@ -1,582 +0,0 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.10-rc1
4# Mon Nov 1 16:41:04 2004
5#
6CONFIG_MMU=y
7CONFIG_GENERIC_HARDIRQS=y
8CONFIG_RWSEM_XCHGADD_ALGORITHM=y
9CONFIG_HAVE_DEC_LOCK=y
10CONFIG_PPC=y
11CONFIG_PPC32=y
12CONFIG_GENERIC_NVRAM=y
13
14#
15# Code maturity level options
16#
17CONFIG_EXPERIMENTAL=y
18# CONFIG_CLEAN_COMPILE is not set
19CONFIG_BROKEN=y
20CONFIG_BROKEN_ON_SMP=y
21
22#
23# General setup
24#
25CONFIG_LOCALVERSION=""
26# CONFIG_SWAP is not set
27CONFIG_SYSVIPC=y
28# CONFIG_POSIX_MQUEUE is not set
29# CONFIG_BSD_PROCESS_ACCT is not set
30CONFIG_SYSCTL=y
31# CONFIG_AUDIT is not set
32CONFIG_LOG_BUF_SHIFT=14
33# CONFIG_HOTPLUG is not set
34# CONFIG_KOBJECT_UEVENT is not set
35# CONFIG_IKCONFIG is not set
36CONFIG_EMBEDDED=y
37# CONFIG_KALLSYMS is not set
38# CONFIG_FUTEX is not set
39# CONFIG_EPOLL is not set
40# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
41# CONFIG_SHMEM is not set
42CONFIG_CC_ALIGN_FUNCTIONS=0
43CONFIG_CC_ALIGN_LABELS=0
44CONFIG_CC_ALIGN_LOOPS=0
45CONFIG_CC_ALIGN_JUMPS=0
46CONFIG_TINY_SHMEM=y
47
48#
49# Loadable module support
50#
51# CONFIG_MODULES is not set
52
53#
54# Processor
55#
56# CONFIG_6xx is not set
57# CONFIG_40x is not set
58# CONFIG_44x is not set
59# CONFIG_POWER3 is not set
60# CONFIG_POWER4 is not set
61CONFIG_8xx=y
62# CONFIG_E500 is not set
63CONFIG_MATH_EMULATION=y
64# CONFIG_CPU_FREQ is not set
65CONFIG_EMBEDDEDBOOT=y
66CONFIG_NOT_COHERENT_CACHE=y
67
68#
69# Platform options
70#
71# CONFIG_RPXLITE is not set
72CONFIG_RPXCLASSIC=y
73# CONFIG_BSEIP is not set
74# CONFIG_FADS is not set
75# CONFIG_TQM823L is not set
76# CONFIG_TQM850L is not set
77# CONFIG_TQM855L is not set
78# CONFIG_TQM860L is not set
79# CONFIG_FPS850L is not set
80# CONFIG_SPD823TS is not set
81# CONFIG_IVMS8 is not set
82# CONFIG_IVML24 is not set
83# CONFIG_SM850 is not set
84# CONFIG_HERMES_PRO is not set
85# CONFIG_IP860 is not set
86# CONFIG_LWMON is not set
87# CONFIG_PCU_E is not set
88# CONFIG_CCM is not set
89# CONFIG_LANTEC is not set
90# CONFIG_MBX is not set
91# CONFIG_WINCEPT is not set
92# CONFIG_SMP is not set
93# CONFIG_PREEMPT is not set
94# CONFIG_HIGHMEM is not set
95CONFIG_BINFMT_ELF=y
96# CONFIG_BINFMT_MISC is not set
97# CONFIG_CMDLINE_BOOL is not set
98
99#
100# Bus options
101#
102# CONFIG_PCI is not set
103# CONFIG_PCI_DOMAINS is not set
104# CONFIG_PCI_QSPAN is not set
105
106#
107# Advanced setup
108#
109# CONFIG_ADVANCED_OPTIONS is not set
110
111#
112# Default settings for advanced configuration options are used
113#
114CONFIG_HIGHMEM_START=0xfe000000
115CONFIG_LOWMEM_SIZE=0x30000000
116CONFIG_KERNEL_START=0xc0000000
117CONFIG_TASK_SIZE=0x80000000
118CONFIG_CONSISTENT_START=0xff100000
119CONFIG_CONSISTENT_SIZE=0x00200000
120CONFIG_BOOT_LOAD=0x00400000
121
122#
123# Device Drivers
124#
125
126#
127# Generic Driver Options
128#
129CONFIG_STANDALONE=y
130CONFIG_PREVENT_FIRMWARE_BUILD=y
131
132#
133# Memory Technology Devices (MTD)
134#
135# CONFIG_MTD is not set
136
137#
138# Parallel port support
139#
140# CONFIG_PARPORT is not set
141
142#
143# Plug and Play support
144#
145
146#
147# Block devices
148#
149# CONFIG_BLK_DEV_FD is not set
150CONFIG_BLK_DEV_LOOP=y
151# CONFIG_BLK_DEV_CRYPTOLOOP is not set
152# CONFIG_BLK_DEV_NBD is not set
153CONFIG_BLK_DEV_RAM=y
154CONFIG_BLK_DEV_RAM_SIZE=4096
155CONFIG_BLK_DEV_INITRD=y
156CONFIG_INITRAMFS_SOURCE=""
157# CONFIG_LBD is not set
158# CONFIG_CDROM_PKTCDVD is not set
159
160#
161# IO Schedulers
162#
163CONFIG_IOSCHED_NOOP=y
164CONFIG_IOSCHED_AS=y
165CONFIG_IOSCHED_DEADLINE=y
166CONFIG_IOSCHED_CFQ=y
167
168#
169# ATA/ATAPI/MFM/RLL support
170#
171# CONFIG_IDE is not set
172
173#
174# SCSI device support
175#
176# CONFIG_SCSI is not set
177
178#
179# Multi-device support (RAID and LVM)
180#
181# CONFIG_MD is not set
182
183#
184# Fusion MPT device support
185#
186
187#
188# IEEE 1394 (FireWire) support
189#
190# CONFIG_IEEE1394 is not set
191
192#
193# I2O device support
194#
195
196#
197# Macintosh device drivers
198#
199
200#
201# Networking support
202#
203CONFIG_NET=y
204
205#
206# Networking options
207#
208CONFIG_PACKET=y
209# CONFIG_PACKET_MMAP is not set
210# CONFIG_NETLINK_DEV is not set
211CONFIG_UNIX=y
212# CONFIG_NET_KEY is not set
213CONFIG_INET=y
214CONFIG_IP_MULTICAST=y
215# CONFIG_IP_ADVANCED_ROUTER is not set
216CONFIG_IP_PNP=y
217# CONFIG_IP_PNP_DHCP is not set
218CONFIG_IP_PNP_BOOTP=y
219# CONFIG_IP_PNP_RARP is not set
220# CONFIG_NET_IPIP is not set
221# CONFIG_NET_IPGRE is not set
222# CONFIG_IP_MROUTE is not set
223# CONFIG_ARPD is not set
224# CONFIG_SYN_COOKIES is not set
225# CONFIG_INET_AH is not set
226# CONFIG_INET_ESP is not set
227# CONFIG_INET_IPCOMP is not set
228# CONFIG_INET_TUNNEL is not set
229# CONFIG_IPV6 is not set
230# CONFIG_NETFILTER is not set
231
232#
233# SCTP Configuration (EXPERIMENTAL)
234#
235# CONFIG_IP_SCTP is not set
236# CONFIG_ATM is not set
237# CONFIG_BRIDGE is not set
238# CONFIG_VLAN_8021Q is not set
239# CONFIG_DECNET is not set
240# CONFIG_LLC2 is not set
241# CONFIG_IPX is not set
242# CONFIG_ATALK is not set
243# CONFIG_X25 is not set
244# CONFIG_LAPB is not set
245# CONFIG_NET_DIVERT is not set
246# CONFIG_ECONET is not set
247# CONFIG_WAN_ROUTER is not set
248
249#
250# QoS and/or fair queueing
251#
252# CONFIG_NET_SCHED is not set
253# CONFIG_NET_CLS_ROUTE is not set
254
255#
256# Network testing
257#
258# CONFIG_NET_PKTGEN is not set
259# CONFIG_NETPOLL is not set
260# CONFIG_NET_POLL_CONTROLLER is not set
261# CONFIG_HAMRADIO is not set
262# CONFIG_IRDA is not set
263# CONFIG_BT is not set
264CONFIG_NETDEVICES=y
265# CONFIG_DUMMY is not set
266# CONFIG_BONDING is not set
267# CONFIG_EQUALIZER is not set
268# CONFIG_TUN is not set
269
270#
271# Ethernet (10 or 100Mbit)
272#
273CONFIG_NET_ETHERNET=y
274# CONFIG_MII is not set
275# CONFIG_OAKNET is not set
276
277#
278# Ethernet (1000 Mbit)
279#
280
281#
282# Ethernet (10000 Mbit)
283#
284
285#
286# Token Ring devices
287#
288
289#
290# Wireless LAN (non-hamradio)
291#
292# CONFIG_NET_RADIO is not set
293
294#
295# Wan interfaces
296#
297# CONFIG_WAN is not set
298# CONFIG_PPP is not set
299# CONFIG_SLIP is not set
300# CONFIG_SHAPER is not set
301# CONFIG_NETCONSOLE is not set
302
303#
304# ISDN subsystem
305#
306# CONFIG_ISDN is not set
307
308#
309# Telephony Support
310#
311# CONFIG_PHONE is not set
312
313#
314# Input device support
315#
316# CONFIG_INPUT is not set
317
318#
319# Userland interfaces
320#
321
322#
323# Input I/O drivers
324#
325# CONFIG_GAMEPORT is not set
326CONFIG_SOUND_GAMEPORT=y
327# CONFIG_SERIO is not set
328# CONFIG_SERIO_I8042 is not set
329
330#
331# Input Device Drivers
332#
333
334#
335# Character devices
336#
337# CONFIG_VT is not set
338# CONFIG_SERIAL_NONSTANDARD is not set
339
340#
341# Serial drivers
342#
343# CONFIG_SERIAL_8250 is not set
344
345#
346# Non-8250 serial port support
347#
348CONFIG_SERIAL_CORE=y
349CONFIG_SERIAL_CORE_CONSOLE=y
350CONFIG_SERIAL_CPM=y
351CONFIG_SERIAL_CPM_CONSOLE=y
352# CONFIG_SERIAL_CPM_SCC1 is not set
353CONFIG_SERIAL_CPM_SCC2=y
354CONFIG_SERIAL_CPM_SCC3=y
355# CONFIG_SERIAL_CPM_SCC4 is not set
356CONFIG_SERIAL_CPM_SMC1=y
357CONFIG_SERIAL_CPM_SMC2=y
358CONFIG_UNIX98_PTYS=y
359# CONFIG_LEGACY_PTYS is not set
360
361#
362# IPMI
363#
364# CONFIG_IPMI_HANDLER is not set
365
366#
367# Watchdog Cards
368#
369# CONFIG_WATCHDOG is not set
370# CONFIG_NVRAM is not set
371CONFIG_GEN_RTC=y
372# CONFIG_GEN_RTC_X is not set
373# CONFIG_DTLK is not set
374# CONFIG_R3964 is not set
375
376#
377# Ftape, the floppy tape device driver
378#
379# CONFIG_AGP is not set
380# CONFIG_DRM is not set
381# CONFIG_RAW_DRIVER is not set
382
383#
384# I2C support
385#
386# CONFIG_I2C is not set
387
388#
389# Dallas's 1-wire bus
390#
391# CONFIG_W1 is not set
392
393#
394# Misc devices
395#
396
397#
398# Multimedia devices
399#
400# CONFIG_VIDEO_DEV is not set
401
402#
403# Digital Video Broadcasting Devices
404#
405# CONFIG_DVB is not set
406
407#
408# Graphics support
409#
410# CONFIG_FB is not set
411
412#
413# Sound
414#
415# CONFIG_SOUND is not set
416
417#
418# USB support
419#
420# CONFIG_USB_ARCH_HAS_HCD is not set
421# CONFIG_USB_ARCH_HAS_OHCI is not set
422
423#
424# USB Gadget Support
425#
426# CONFIG_USB_GADGET is not set
427
428#
429# File systems
430#
431CONFIG_EXT2_FS=y
432# CONFIG_EXT2_FS_XATTR is not set
433CONFIG_EXT3_FS=y
434CONFIG_EXT3_FS_XATTR=y
435# CONFIG_EXT3_FS_POSIX_ACL is not set
436# CONFIG_EXT3_FS_SECURITY is not set
437CONFIG_JBD=y
438# CONFIG_JBD_DEBUG is not set
439CONFIG_FS_MBCACHE=y
440# CONFIG_REISERFS_FS is not set
441# CONFIG_JFS_FS is not set
442# CONFIG_XFS_FS is not set
443# CONFIG_MINIX_FS is not set
444# CONFIG_ROMFS_FS is not set
445# CONFIG_QUOTA is not set
446CONFIG_DNOTIFY=y
447# CONFIG_AUTOFS_FS is not set
448# CONFIG_AUTOFS4_FS is not set
449
450#
451# CD-ROM/DVD Filesystems
452#
453# CONFIG_ISO9660_FS is not set
454# CONFIG_UDF_FS is not set
455
456#
457# DOS/FAT/NT Filesystems
458#
459# CONFIG_MSDOS_FS is not set
460# CONFIG_VFAT_FS is not set
461# CONFIG_NTFS_FS is not set
462
463#
464# Pseudo filesystems
465#
466CONFIG_PROC_FS=y
467CONFIG_PROC_KCORE=y
468CONFIG_SYSFS=y
469# CONFIG_DEVFS_FS is not set
470# CONFIG_DEVPTS_FS_XATTR is not set
471CONFIG_TMPFS=y
472# CONFIG_TMPFS_XATTR is not set
473# CONFIG_HUGETLBFS is not set
474# CONFIG_HUGETLB_PAGE is not set
475CONFIG_RAMFS=y
476
477#
478# Miscellaneous filesystems
479#
480# CONFIG_ADFS_FS is not set
481# CONFIG_AFFS_FS is not set
482# CONFIG_HFS_FS is not set
483# CONFIG_HFSPLUS_FS is not set
484# CONFIG_BEFS_FS is not set
485# CONFIG_BFS_FS is not set
486# CONFIG_EFS_FS is not set
487# CONFIG_CRAMFS is not set
488# CONFIG_VXFS_FS is not set
489# CONFIG_HPFS_FS is not set
490# CONFIG_QNX4FS_FS is not set
491# CONFIG_SYSV_FS is not set
492# CONFIG_UFS_FS is not set
493
494#
495# Network File Systems
496#
497CONFIG_NFS_FS=y
498# CONFIG_NFS_V3 is not set
499# CONFIG_NFS_V4 is not set
500# CONFIG_NFS_DIRECTIO is not set
501# CONFIG_NFSD is not set
502CONFIG_ROOT_NFS=y
503CONFIG_LOCKD=y
504# CONFIG_EXPORTFS is not set
505CONFIG_SUNRPC=y
506# CONFIG_RPCSEC_GSS_KRB5 is not set
507# CONFIG_RPCSEC_GSS_SPKM3 is not set
508# CONFIG_SMB_FS is not set
509# CONFIG_CIFS is not set
510# CONFIG_NCP_FS is not set
511# CONFIG_CODA_FS is not set
512# CONFIG_AFS_FS is not set
513
514#
515# Partition Types
516#
517CONFIG_PARTITION_ADVANCED=y
518# CONFIG_ACORN_PARTITION is not set
519# CONFIG_OSF_PARTITION is not set
520# CONFIG_AMIGA_PARTITION is not set
521# CONFIG_ATARI_PARTITION is not set
522# CONFIG_MAC_PARTITION is not set
523# CONFIG_MSDOS_PARTITION is not set
524# CONFIG_LDM_PARTITION is not set
525# CONFIG_SGI_PARTITION is not set
526# CONFIG_ULTRIX_PARTITION is not set
527# CONFIG_SUN_PARTITION is not set
528# CONFIG_EFI_PARTITION is not set
529
530#
531# Native Language Support
532#
533# CONFIG_NLS is not set
534
535#
536# MPC8xx CPM Options
537#
538CONFIG_SCC_ENET=y
539CONFIG_SCC1_ENET=y
540# CONFIG_SCC2_ENET is not set
541# CONFIG_SCC3_ENET is not set
542CONFIG_FEC_ENET=y
543# CONFIG_USE_MDIO is not set
544CONFIG_ENET_BIG_BUFFERS=y
545
546#
547# Generic MPC8xx Options
548#
549CONFIG_8xx_COPYBACK=y
550# CONFIG_8xx_CPU6 is not set
551CONFIG_NO_UCODE_PATCH=y
552# CONFIG_USB_SOF_UCODE_PATCH is not set
553# CONFIG_I2C_SPI_UCODE_PATCH is not set
554# CONFIG_I2C_SPI_SMC1_UCODE_PATCH is not set
555
556#
557# Library routines
558#
559# CONFIG_CRC_CCITT is not set
560# CONFIG_CRC32 is not set
561# CONFIG_LIBCRC32C is not set
562
563#
564# Profiling support
565#
566# CONFIG_PROFILING is not set
567
568#
569# Kernel hacking
570#
571# CONFIG_DEBUG_KERNEL is not set
572
573#
574# Security options
575#
576# CONFIG_KEYS is not set
577# CONFIG_SECURITY is not set
578
579#
580# Cryptographic options
581#
582# CONFIG_CRYPTO is not set
diff --git a/arch/ppc/configs/rpxlite_defconfig b/arch/ppc/configs/rpxlite_defconfig
deleted file mode 100644
index 828dd6eb5b43..000000000000
--- a/arch/ppc/configs/rpxlite_defconfig
+++ /dev/null
@@ -1,581 +0,0 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.10-rc1
4# Mon Nov 1 16:41:09 2004
5#
6CONFIG_MMU=y
7CONFIG_GENERIC_HARDIRQS=y
8CONFIG_RWSEM_XCHGADD_ALGORITHM=y
9CONFIG_HAVE_DEC_LOCK=y
10CONFIG_PPC=y
11CONFIG_PPC32=y
12CONFIG_GENERIC_NVRAM=y
13
14#
15# Code maturity level options
16#
17CONFIG_EXPERIMENTAL=y
18# CONFIG_CLEAN_COMPILE is not set
19CONFIG_BROKEN=y
20CONFIG_BROKEN_ON_SMP=y
21
22#
23# General setup
24#
25CONFIG_LOCALVERSION=""
26# CONFIG_SWAP is not set
27CONFIG_SYSVIPC=y
28# CONFIG_POSIX_MQUEUE is not set
29# CONFIG_BSD_PROCESS_ACCT is not set
30CONFIG_SYSCTL=y
31# CONFIG_AUDIT is not set
32CONFIG_LOG_BUF_SHIFT=14
33# CONFIG_HOTPLUG is not set
34# CONFIG_KOBJECT_UEVENT is not set
35# CONFIG_IKCONFIG is not set
36CONFIG_EMBEDDED=y
37# CONFIG_KALLSYMS is not set
38# CONFIG_FUTEX is not set
39# CONFIG_EPOLL is not set
40# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
41# CONFIG_SHMEM is not set
42CONFIG_CC_ALIGN_FUNCTIONS=0
43CONFIG_CC_ALIGN_LABELS=0
44CONFIG_CC_ALIGN_LOOPS=0
45CONFIG_CC_ALIGN_JUMPS=0
46CONFIG_TINY_SHMEM=y
47
48#
49# Loadable module support
50#
51# CONFIG_MODULES is not set
52
53#
54# Processor
55#
56# CONFIG_6xx is not set
57# CONFIG_40x is not set
58# CONFIG_44x is not set
59# CONFIG_POWER3 is not set
60# CONFIG_POWER4 is not set
61CONFIG_8xx=y
62# CONFIG_E500 is not set
63CONFIG_MATH_EMULATION=y
64# CONFIG_CPU_FREQ is not set
65CONFIG_EMBEDDEDBOOT=y
66CONFIG_NOT_COHERENT_CACHE=y
67
68#
69# Platform options
70#
71CONFIG_RPXLITE=y
72# CONFIG_RPXCLASSIC is not set
73# CONFIG_BSEIP is not set
74# CONFIG_FADS is not set
75# CONFIG_TQM823L is not set
76# CONFIG_TQM850L is not set
77# CONFIG_TQM855L is not set
78# CONFIG_TQM860L is not set
79# CONFIG_FPS850L is not set
80# CONFIG_SPD823TS is not set
81# CONFIG_IVMS8 is not set
82# CONFIG_IVML24 is not set
83# CONFIG_SM850 is not set
84# CONFIG_HERMES_PRO is not set
85# CONFIG_IP860 is not set
86# CONFIG_LWMON is not set
87# CONFIG_PCU_E is not set
88# CONFIG_CCM is not set
89# CONFIG_LANTEC is not set
90# CONFIG_MBX is not set
91# CONFIG_WINCEPT is not set
92# CONFIG_SMP is not set
93# CONFIG_PREEMPT is not set
94# CONFIG_HIGHMEM is not set
95CONFIG_BINFMT_ELF=y
96# CONFIG_BINFMT_MISC is not set
97# CONFIG_CMDLINE_BOOL is not set
98
99#
100# Bus options
101#
102# CONFIG_PCI is not set
103# CONFIG_PCI_DOMAINS is not set
104# CONFIG_PCI_QSPAN is not set
105
106#
107# Advanced setup
108#
109# CONFIG_ADVANCED_OPTIONS is not set
110
111#
112# Default settings for advanced configuration options are used
113#
114CONFIG_HIGHMEM_START=0xfe000000
115CONFIG_LOWMEM_SIZE=0x30000000
116CONFIG_KERNEL_START=0xc0000000
117CONFIG_TASK_SIZE=0x80000000
118CONFIG_CONSISTENT_START=0xff100000
119CONFIG_CONSISTENT_SIZE=0x00200000
120CONFIG_BOOT_LOAD=0x00400000
121
122#
123# Device Drivers
124#
125
126#
127# Generic Driver Options
128#
129CONFIG_STANDALONE=y
130CONFIG_PREVENT_FIRMWARE_BUILD=y
131
132#
133# Memory Technology Devices (MTD)
134#
135# CONFIG_MTD is not set
136
137#
138# Parallel port support
139#
140# CONFIG_PARPORT is not set
141
142#
143# Plug and Play support
144#
145
146#
147# Block devices
148#
149# CONFIG_BLK_DEV_FD is not set
150CONFIG_BLK_DEV_LOOP=y
151# CONFIG_BLK_DEV_CRYPTOLOOP is not set
152# CONFIG_BLK_DEV_NBD is not set
153CONFIG_BLK_DEV_RAM=y
154CONFIG_BLK_DEV_RAM_SIZE=4096
155CONFIG_BLK_DEV_INITRD=y
156CONFIG_INITRAMFS_SOURCE=""
157# CONFIG_LBD is not set
158# CONFIG_CDROM_PKTCDVD is not set
159
160#
161# IO Schedulers
162#
163CONFIG_IOSCHED_NOOP=y
164CONFIG_IOSCHED_AS=y
165CONFIG_IOSCHED_DEADLINE=y
166CONFIG_IOSCHED_CFQ=y
167
168#
169# ATA/ATAPI/MFM/RLL support
170#
171# CONFIG_IDE is not set
172
173#
174# SCSI device support
175#
176# CONFIG_SCSI is not set
177
178#
179# Multi-device support (RAID and LVM)
180#
181# CONFIG_MD is not set
182
183#
184# Fusion MPT device support
185#
186
187#
188# IEEE 1394 (FireWire) support
189#
190# CONFIG_IEEE1394 is not set
191
192#
193# I2O device support
194#
195
196#
197# Macintosh device drivers
198#
199
200#
201# Networking support
202#
203CONFIG_NET=y
204
205#
206# Networking options
207#
208CONFIG_PACKET=y
209# CONFIG_PACKET_MMAP is not set
210# CONFIG_NETLINK_DEV is not set
211CONFIG_UNIX=y
212# CONFIG_NET_KEY is not set
213CONFIG_INET=y
214CONFIG_IP_MULTICAST=y
215# CONFIG_IP_ADVANCED_ROUTER is not set
216CONFIG_IP_PNP=y
217# CONFIG_IP_PNP_DHCP is not set
218CONFIG_IP_PNP_BOOTP=y
219# CONFIG_IP_PNP_RARP is not set
220# CONFIG_NET_IPIP is not set
221# CONFIG_NET_IPGRE is not set
222# CONFIG_IP_MROUTE is not set
223# CONFIG_ARPD is not set
224# CONFIG_SYN_COOKIES is not set
225# CONFIG_INET_AH is not set
226# CONFIG_INET_ESP is not set
227# CONFIG_INET_IPCOMP is not set
228# CONFIG_INET_TUNNEL is not set
229# CONFIG_IPV6 is not set
230# CONFIG_NETFILTER is not set
231
232#
233# SCTP Configuration (EXPERIMENTAL)
234#
235# CONFIG_IP_SCTP is not set
236# CONFIG_ATM is not set
237# CONFIG_BRIDGE is not set
238# CONFIG_VLAN_8021Q is not set
239# CONFIG_DECNET is not set
240# CONFIG_LLC2 is not set
241# CONFIG_IPX is not set
242# CONFIG_ATALK is not set
243# CONFIG_X25 is not set
244# CONFIG_LAPB is not set
245# CONFIG_NET_DIVERT is not set
246# CONFIG_ECONET is not set
247# CONFIG_WAN_ROUTER is not set
248
249#
250# QoS and/or fair queueing
251#
252# CONFIG_NET_SCHED is not set
253# CONFIG_NET_CLS_ROUTE is not set
254
255#
256# Network testing
257#
258# CONFIG_NET_PKTGEN is not set
259# CONFIG_NETPOLL is not set
260# CONFIG_NET_POLL_CONTROLLER is not set
261# CONFIG_HAMRADIO is not set
262# CONFIG_IRDA is not set
263# CONFIG_BT is not set
264CONFIG_NETDEVICES=y
265# CONFIG_DUMMY is not set
266# CONFIG_BONDING is not set
267# CONFIG_EQUALIZER is not set
268# CONFIG_TUN is not set
269
270#
271# Ethernet (10 or 100Mbit)
272#
273CONFIG_NET_ETHERNET=y
274# CONFIG_MII is not set
275# CONFIG_OAKNET is not set
276
277#
278# Ethernet (1000 Mbit)
279#
280
281#
282# Ethernet (10000 Mbit)
283#
284
285#
286# Token Ring devices
287#
288
289#
290# Wireless LAN (non-hamradio)
291#
292# CONFIG_NET_RADIO is not set
293
294#
295# Wan interfaces
296#
297# CONFIG_WAN is not set
298# CONFIG_PPP is not set
299# CONFIG_SLIP is not set
300# CONFIG_SHAPER is not set
301# CONFIG_NETCONSOLE is not set
302
303#
304# ISDN subsystem
305#
306# CONFIG_ISDN is not set
307
308#
309# Telephony Support
310#
311# CONFIG_PHONE is not set
312
313#
314# Input device support
315#
316# CONFIG_INPUT is not set
317
318#
319# Userland interfaces
320#
321
322#
323# Input I/O drivers
324#
325# CONFIG_GAMEPORT is not set
326CONFIG_SOUND_GAMEPORT=y
327# CONFIG_SERIO is not set
328# CONFIG_SERIO_I8042 is not set
329
330#
331# Input Device Drivers
332#
333
334#
335# Character devices
336#
337# CONFIG_VT is not set
338# CONFIG_SERIAL_NONSTANDARD is not set
339
340#
341# Serial drivers
342#
343# CONFIG_SERIAL_8250 is not set
344
345#
346# Non-8250 serial port support
347#
348CONFIG_SERIAL_CORE=y
349CONFIG_SERIAL_CORE_CONSOLE=y
350CONFIG_SERIAL_CPM=y
351CONFIG_SERIAL_CPM_CONSOLE=y
352# CONFIG_SERIAL_CPM_SCC1 is not set
353# CONFIG_SERIAL_CPM_SCC2 is not set
354# CONFIG_SERIAL_CPM_SCC3 is not set
355# CONFIG_SERIAL_CPM_SCC4 is not set
356CONFIG_SERIAL_CPM_SMC1=y
357# CONFIG_SERIAL_CPM_SMC2 is not set
358CONFIG_UNIX98_PTYS=y
359# CONFIG_LEGACY_PTYS is not set
360
361#
362# IPMI
363#
364# CONFIG_IPMI_HANDLER is not set
365
366#
367# Watchdog Cards
368#
369# CONFIG_WATCHDOG is not set
370# CONFIG_NVRAM is not set
371CONFIG_GEN_RTC=y
372# CONFIG_GEN_RTC_X is not set
373# CONFIG_DTLK is not set
374# CONFIG_R3964 is not set
375
376#
377# Ftape, the floppy tape device driver
378#
379# CONFIG_AGP is not set
380# CONFIG_DRM is not set
381# CONFIG_RAW_DRIVER is not set
382
383#
384# I2C support
385#
386# CONFIG_I2C is not set
387
388#
389# Dallas's 1-wire bus
390#
391# CONFIG_W1 is not set
392
393#
394# Misc devices
395#
396
397#
398# Multimedia devices
399#
400# CONFIG_VIDEO_DEV is not set
401
402#
403# Digital Video Broadcasting Devices
404#
405# CONFIG_DVB is not set
406
407#
408# Graphics support
409#
410# CONFIG_FB is not set
411
412#
413# Sound
414#
415# CONFIG_SOUND is not set
416
417#
418# USB support
419#
420# CONFIG_USB_ARCH_HAS_HCD is not set
421# CONFIG_USB_ARCH_HAS_OHCI is not set
422
423#
424# USB Gadget Support
425#
426# CONFIG_USB_GADGET is not set
427
428#
429# File systems
430#
431CONFIG_EXT2_FS=y
432# CONFIG_EXT2_FS_XATTR is not set
433CONFIG_EXT3_FS=y
434CONFIG_EXT3_FS_XATTR=y
435# CONFIG_EXT3_FS_POSIX_ACL is not set
436# CONFIG_EXT3_FS_SECURITY is not set
437CONFIG_JBD=y
438# CONFIG_JBD_DEBUG is not set
439CONFIG_FS_MBCACHE=y
440# CONFIG_REISERFS_FS is not set
441# CONFIG_JFS_FS is not set
442# CONFIG_XFS_FS is not set
443# CONFIG_MINIX_FS is not set
444# CONFIG_ROMFS_FS is not set
445# CONFIG_QUOTA is not set
446CONFIG_DNOTIFY=y
447# CONFIG_AUTOFS_FS is not set
448# CONFIG_AUTOFS4_FS is not set
449
450#
451# CD-ROM/DVD Filesystems
452#
453# CONFIG_ISO9660_FS is not set
454# CONFIG_UDF_FS is not set
455
456#
457# DOS/FAT/NT Filesystems
458#
459# CONFIG_MSDOS_FS is not set
460# CONFIG_VFAT_FS is not set
461# CONFIG_NTFS_FS is not set
462
463#
464# Pseudo filesystems
465#
466CONFIG_PROC_FS=y
467CONFIG_PROC_KCORE=y
468CONFIG_SYSFS=y
469# CONFIG_DEVFS_FS is not set
470# CONFIG_DEVPTS_FS_XATTR is not set
471CONFIG_TMPFS=y
472# CONFIG_TMPFS_XATTR is not set
473# CONFIG_HUGETLBFS is not set
474# CONFIG_HUGETLB_PAGE is not set
475CONFIG_RAMFS=y
476
477#
478# Miscellaneous filesystems
479#
480# CONFIG_ADFS_FS is not set
481# CONFIG_AFFS_FS is not set
482# CONFIG_HFS_FS is not set
483# CONFIG_HFSPLUS_FS is not set
484# CONFIG_BEFS_FS is not set
485# CONFIG_BFS_FS is not set
486# CONFIG_EFS_FS is not set
487# CONFIG_CRAMFS is not set
488# CONFIG_VXFS_FS is not set
489# CONFIG_HPFS_FS is not set
490# CONFIG_QNX4FS_FS is not set
491# CONFIG_SYSV_FS is not set
492# CONFIG_UFS_FS is not set
493
494#
495# Network File Systems
496#
497CONFIG_NFS_FS=y
498# CONFIG_NFS_V3 is not set
499# CONFIG_NFS_V4 is not set
500# CONFIG_NFS_DIRECTIO is not set
501# CONFIG_NFSD is not set
502CONFIG_ROOT_NFS=y
503CONFIG_LOCKD=y
504# CONFIG_EXPORTFS is not set
505CONFIG_SUNRPC=y
506# CONFIG_RPCSEC_GSS_KRB5 is not set
507# CONFIG_RPCSEC_GSS_SPKM3 is not set
508# CONFIG_SMB_FS is not set
509# CONFIG_CIFS is not set
510# CONFIG_NCP_FS is not set
511# CONFIG_CODA_FS is not set
512# CONFIG_AFS_FS is not set
513
514#
515# Partition Types
516#
517CONFIG_PARTITION_ADVANCED=y
518# CONFIG_ACORN_PARTITION is not set
519# CONFIG_OSF_PARTITION is not set
520# CONFIG_AMIGA_PARTITION is not set
521# CONFIG_ATARI_PARTITION is not set
522# CONFIG_MAC_PARTITION is not set
523# CONFIG_MSDOS_PARTITION is not set
524# CONFIG_LDM_PARTITION is not set
525# CONFIG_SGI_PARTITION is not set
526# CONFIG_ULTRIX_PARTITION is not set
527# CONFIG_SUN_PARTITION is not set
528# CONFIG_EFI_PARTITION is not set
529
530#
531# Native Language Support
532#
533# CONFIG_NLS is not set
534
535#
536# MPC8xx CPM Options
537#
538CONFIG_SCC_ENET=y
539# CONFIG_SCC1_ENET is not set
540CONFIG_SCC2_ENET=y
541# CONFIG_SCC3_ENET is not set
542# CONFIG_FEC_ENET is not set
543# CONFIG_ENET_BIG_BUFFERS is not set
544
545#
546# Generic MPC8xx Options
547#
548CONFIG_8xx_COPYBACK=y
549# CONFIG_8xx_CPU6 is not set
550CONFIG_NO_UCODE_PATCH=y
551# CONFIG_USB_SOF_UCODE_PATCH is not set
552# CONFIG_I2C_SPI_UCODE_PATCH is not set
553# CONFIG_I2C_SPI_SMC1_UCODE_PATCH is not set
554
555#
556# Library routines
557#
558# CONFIG_CRC_CCITT is not set
559# CONFIG_CRC32 is not set
560# CONFIG_LIBCRC32C is not set
561
562#
563# Profiling support
564#
565# CONFIG_PROFILING is not set
566
567#
568# Kernel hacking
569#
570# CONFIG_DEBUG_KERNEL is not set
571
572#
573# Security options
574#
575# CONFIG_KEYS is not set
576# CONFIG_SECURITY is not set
577
578#
579# Cryptographic options
580#
581# CONFIG_CRYPTO is not set
diff --git a/arch/ppc/configs/sandpoint_defconfig b/arch/ppc/configs/sandpoint_defconfig
deleted file mode 100644
index 9525e34138fc..000000000000
--- a/arch/ppc/configs/sandpoint_defconfig
+++ /dev/null
@@ -1,737 +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
16CONFIG_STANDALONE=y
17CONFIG_BROKEN_ON_SMP=y
18
19#
20# General setup
21#
22# CONFIG_SWAP is not set
23CONFIG_SYSVIPC=y
24# CONFIG_POSIX_MQUEUE is not set
25# CONFIG_BSD_PROCESS_ACCT is not set
26CONFIG_SYSCTL=y
27# CONFIG_AUDIT is not set
28CONFIG_LOG_BUF_SHIFT=14
29CONFIG_HOTPLUG=y
30# CONFIG_IKCONFIG is not set
31CONFIG_EMBEDDED=y
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
46# CONFIG_MODULE_FORCE_UNLOAD is not set
47CONFIG_OBSOLETE_MODPARM=y
48# CONFIG_MODVERSIONS is not set
49CONFIG_KMOD=y
50
51#
52# Processor
53#
54CONFIG_6xx=y
55# CONFIG_40x is not set
56# CONFIG_44x is not set
57# CONFIG_POWER3 is not set
58# CONFIG_POWER4 is not set
59# CONFIG_8xx is not set
60CONFIG_ALTIVEC=y
61# CONFIG_TAU is not set
62# CONFIG_CPU_FREQ is not set
63CONFIG_PPC_STD_MMU=y
64
65#
66# Platform options
67#
68# CONFIG_PPC_MULTIPLATFORM is not set
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
81CONFIG_SANDPOINT=y
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_GEN550=y
91CONFIG_EPIC_SERIAL_MODE=y
92CONFIG_MPC10X_BRIDGE=y
93# CONFIG_MPC10X_STORE_GATHERING is not set
94# CONFIG_SMP is not set
95# CONFIG_PREEMPT is not set
96# CONFIG_HIGHMEM is not set
97CONFIG_KERNEL_ELF=y
98CONFIG_BINFMT_ELF=y
99CONFIG_BINFMT_MISC=m
100CONFIG_CMDLINE_BOOL=y
101CONFIG_CMDLINE="ip=on"
102
103#
104# Bus options
105#
106CONFIG_GENERIC_ISA_DMA=y
107CONFIG_PCI=y
108CONFIG_PCI_DOMAINS=y
109# CONFIG_PCI_LEGACY_PROC is not set
110# CONFIG_PCI_NAMES is not set
111
112#
113# PCMCIA/CardBus support
114#
115# CONFIG_PCMCIA is not set
116
117#
118# Advanced setup
119#
120# CONFIG_ADVANCED_OPTIONS is not set
121
122#
123# Default settings for advanced configuration options are used
124#
125CONFIG_HIGHMEM_START=0xfe000000
126CONFIG_LOWMEM_SIZE=0x30000000
127CONFIG_KERNEL_START=0xc0000000
128CONFIG_TASK_SIZE=0x80000000
129CONFIG_BOOT_LOAD=0x00800000
130
131#
132# Device Drivers
133#
134
135#
136# Generic Driver Options
137#
138# CONFIG_FW_LOADER is not set
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
154#
155# Block devices
156#
157# CONFIG_BLK_DEV_FD is not set
158# CONFIG_BLK_CPQ_DA is not set
159# CONFIG_BLK_CPQ_CISS_DA is not set
160# CONFIG_BLK_DEV_DAC960 is not set
161# CONFIG_BLK_DEV_UMEM is not set
162CONFIG_BLK_DEV_LOOP=y
163# CONFIG_BLK_DEV_CRYPTOLOOP is not set
164# CONFIG_BLK_DEV_NBD is not set
165# CONFIG_BLK_DEV_CARMEL is not set
166CONFIG_BLK_DEV_RAM=y
167CONFIG_BLK_DEV_RAM_SIZE=4096
168CONFIG_BLK_DEV_INITRD=y
169# CONFIG_LBD is not set
170
171#
172# ATA/ATAPI/MFM/RLL support
173#
174CONFIG_IDE=y
175CONFIG_BLK_DEV_IDE=y
176
177#
178# Please see Documentation/ide.txt for help/info on IDE drives
179#
180CONFIG_BLK_DEV_IDEDISK=y
181# CONFIG_IDEDISK_MULTI_MODE is not set
182# CONFIG_IDEDISK_STROKE is not set
183CONFIG_BLK_DEV_IDECD=y
184# CONFIG_BLK_DEV_IDETAPE is not set
185# CONFIG_BLK_DEV_IDEFLOPPY is not set
186# CONFIG_IDE_TASK_IOCTL is not set
187CONFIG_IDE_TASKFILE_IO=y
188
189#
190# IDE chipset support/bugfixes
191#
192CONFIG_BLK_DEV_SL82C105=y
193# CONFIG_BLK_DEV_IDEPCI is not set
194# CONFIG_BLK_DEV_IDEDMA is not set
195# CONFIG_IDEDMA_AUTO is not set
196# CONFIG_BLK_DEV_HD is not set
197
198#
199# SCSI device support
200#
201# CONFIG_SCSI is not set
202
203#
204# Multi-device support (RAID and LVM)
205#
206# CONFIG_MD is not set
207
208#
209# Fusion MPT device support
210#
211
212#
213# IEEE 1394 (FireWire) support
214#
215# CONFIG_IEEE1394 is not set
216
217#
218# I2O device support
219#
220# CONFIG_I2O is not set
221
222#
223# Macintosh device drivers
224#
225
226#
227# Networking support
228#
229CONFIG_NET=y
230
231#
232# Networking options
233#
234CONFIG_PACKET=y
235# CONFIG_PACKET_MMAP is not set
236# CONFIG_NETLINK_DEV is not set
237CONFIG_UNIX=y
238# CONFIG_NET_KEY is not set
239CONFIG_INET=y
240CONFIG_IP_MULTICAST=y
241# CONFIG_IP_ADVANCED_ROUTER is not set
242CONFIG_IP_PNP=y
243# CONFIG_IP_PNP_DHCP is not set
244CONFIG_IP_PNP_BOOTP=y
245# CONFIG_IP_PNP_RARP is not set
246# CONFIG_NET_IPIP is not set
247# CONFIG_NET_IPGRE is not set
248# CONFIG_IP_MROUTE is not set
249# CONFIG_ARPD is not set
250# CONFIG_SYN_COOKIES is not set
251# CONFIG_INET_AH is not set
252# CONFIG_INET_ESP is not set
253# CONFIG_INET_IPCOMP is not set
254# CONFIG_IPV6 is not set
255# CONFIG_NETFILTER is not set
256
257#
258# SCTP Configuration (EXPERIMENTAL)
259#
260# CONFIG_IP_SCTP is not set
261# CONFIG_ATM is not set
262# CONFIG_BRIDGE is not set
263# CONFIG_VLAN_8021Q is not set
264# CONFIG_DECNET is not set
265# CONFIG_LLC2 is not set
266# CONFIG_IPX is not set
267# CONFIG_ATALK is not set
268# CONFIG_X25 is not set
269# CONFIG_LAPB is not set
270# CONFIG_NET_DIVERT is not set
271# CONFIG_ECONET is not set
272# CONFIG_WAN_ROUTER is not set
273# CONFIG_NET_HW_FLOWCONTROL is not set
274
275#
276# QoS and/or fair queueing
277#
278# CONFIG_NET_SCHED is not set
279
280#
281# Network testing
282#
283# CONFIG_NET_PKTGEN is not set
284# CONFIG_NETPOLL is not set
285# CONFIG_NET_POLL_CONTROLLER is not set
286# CONFIG_HAMRADIO is not set
287# CONFIG_IRDA is not set
288# CONFIG_BT is not set
289CONFIG_NETDEVICES=y
290CONFIG_DUMMY=m
291# CONFIG_BONDING is not set
292# CONFIG_EQUALIZER is not set
293# CONFIG_TUN is not set
294
295#
296# ARCnet devices
297#
298# CONFIG_ARCNET is not set
299
300#
301# Ethernet (10 or 100Mbit)
302#
303CONFIG_NET_ETHERNET=y
304CONFIG_MII=y
305# CONFIG_OAKNET is not set
306# CONFIG_HAPPYMEAL is not set
307# CONFIG_SUNGEM is not set
308CONFIG_NET_VENDOR_3COM=y
309CONFIG_VORTEX=y
310# CONFIG_TYPHOON is not set
311
312#
313# Tulip family network device support
314#
315CONFIG_NET_TULIP=y
316# CONFIG_DE2104X is not set
317CONFIG_TULIP=y
318# CONFIG_TULIP_MWI is not set
319# CONFIG_TULIP_MMIO is not set
320# CONFIG_TULIP_NAPI is not set
321# CONFIG_DE4X5 is not set
322# CONFIG_WINBOND_840 is not set
323# CONFIG_DM9102 is not set
324# CONFIG_HP100 is not set
325CONFIG_NET_PCI=y
326# CONFIG_PCNET32 is not set
327# CONFIG_AMD8111_ETH is not set
328# CONFIG_ADAPTEC_STARFIRE is not set
329# CONFIG_B44 is not set
330# CONFIG_FORCEDETH is not set
331# CONFIG_DGRS is not set
332# CONFIG_EEPRO100 is not set
333CONFIG_E100=y
334# CONFIG_E100_NAPI is not set
335# CONFIG_FEALNX is not set
336# CONFIG_NATSEMI is not set
337# CONFIG_NE2K_PCI is not set
338# CONFIG_8139CP is not set
339CONFIG_8139TOO=y
340CONFIG_8139TOO_PIO=y
341# CONFIG_8139TOO_TUNE_TWISTER is not set
342# CONFIG_8139TOO_8129 is not set
343# CONFIG_8139_OLD_RX_RESET is not set
344# CONFIG_SIS900 is not set
345# CONFIG_EPIC100 is not set
346# CONFIG_SUNDANCE is not set
347# CONFIG_TLAN is not set
348# CONFIG_VIA_RHINE is not set
349
350#
351# Ethernet (1000 Mbit)
352#
353# CONFIG_ACENIC is not set
354# CONFIG_DL2K is not set
355# CONFIG_E1000 is not set
356# CONFIG_NS83820 is not set
357# CONFIG_HAMACHI is not set
358# CONFIG_YELLOWFIN is not set
359# CONFIG_R8169 is not set
360# CONFIG_SK98LIN is not set
361# CONFIG_TIGON3 is not set
362
363#
364# Ethernet (10000 Mbit)
365#
366# CONFIG_IXGB is not set
367# CONFIG_S2IO is not set
368
369#
370# Token Ring devices
371#
372# CONFIG_TR is not set
373
374#
375# Wireless LAN (non-hamradio)
376#
377# CONFIG_NET_RADIO is not set
378
379#
380# Wan interfaces
381#
382# CONFIG_WAN is not set
383# CONFIG_FDDI is not set
384# CONFIG_HIPPI is not set
385CONFIG_PPP=m
386# CONFIG_PPP_MULTILINK is not set
387# CONFIG_PPP_FILTER is not set
388CONFIG_PPP_ASYNC=m
389CONFIG_PPP_SYNC_TTY=m
390CONFIG_PPP_DEFLATE=m
391CONFIG_PPP_BSDCOMP=m
392# CONFIG_PPPOE is not set
393# CONFIG_SLIP is not set
394# CONFIG_RCPCI is not set
395# CONFIG_SHAPER is not set
396# CONFIG_NETCONSOLE is not set
397
398#
399# ISDN subsystem
400#
401# CONFIG_ISDN is not set
402
403#
404# Telephony Support
405#
406# CONFIG_PHONE is not set
407
408#
409# Input device support
410#
411# CONFIG_INPUT is not set
412
413#
414# Userland interfaces
415#
416
417#
418# Input I/O drivers
419#
420# CONFIG_GAMEPORT is not set
421CONFIG_SOUND_GAMEPORT=y
422# CONFIG_SERIO is not set
423# CONFIG_SERIO_I8042 is not set
424
425#
426# Input Device Drivers
427#
428
429#
430# Character devices
431#
432# CONFIG_VT is not set
433# CONFIG_SERIAL_NONSTANDARD is not set
434
435#
436# Serial drivers
437#
438CONFIG_SERIAL_8250=y
439CONFIG_SERIAL_8250_CONSOLE=y
440CONFIG_SERIAL_8250_NR_UARTS=4
441# CONFIG_SERIAL_8250_EXTENDED is not set
442
443#
444# Non-8250 serial port support
445#
446CONFIG_SERIAL_CORE=y
447CONFIG_SERIAL_CORE_CONSOLE=y
448CONFIG_UNIX98_PTYS=y
449CONFIG_LEGACY_PTYS=y
450CONFIG_LEGACY_PTY_COUNT=256
451# CONFIG_QIC02_TAPE is not set
452
453#
454# IPMI
455#
456# CONFIG_IPMI_HANDLER is not set
457
458#
459# Watchdog Cards
460#
461# CONFIG_WATCHDOG is not set
462# CONFIG_NVRAM is not set
463CONFIG_GEN_RTC=y
464# CONFIG_GEN_RTC_X is not set
465# CONFIG_DTLK is not set
466# CONFIG_R3964 is not set
467# CONFIG_APPLICOM is not set
468
469#
470# Ftape, the floppy tape device driver
471#
472# CONFIG_FTAPE is not set
473# CONFIG_AGP is not set
474# CONFIG_DRM is not set
475# CONFIG_RAW_DRIVER is not set
476
477#
478# I2C support
479#
480# CONFIG_I2C is not set
481
482#
483# Misc devices
484#
485
486#
487# Multimedia devices
488#
489# CONFIG_VIDEO_DEV is not set
490
491#
492# Digital Video Broadcasting Devices
493#
494# CONFIG_DVB is not set
495
496#
497# Graphics support
498#
499# CONFIG_FB is not set
500
501#
502# Sound
503#
504# CONFIG_SOUND is not set
505
506#
507# USB support
508#
509CONFIG_USB=y
510# CONFIG_USB_DEBUG is not set
511
512#
513# Miscellaneous USB options
514#
515CONFIG_USB_DEVICEFS=y
516# CONFIG_USB_BANDWIDTH is not set
517# CONFIG_USB_DYNAMIC_MINORS is not set
518
519#
520# USB Host Controller Drivers
521#
522# CONFIG_USB_EHCI_HCD is not set
523CONFIG_USB_OHCI_HCD=y
524# CONFIG_USB_UHCI_HCD is not set
525
526#
527# USB Device Class drivers
528#
529# CONFIG_USB_BLUETOOTH_TTY is not set
530CONFIG_USB_ACM=m
531# CONFIG_USB_PRINTER is not set
532# CONFIG_USB_STORAGE is not set
533
534#
535# USB Human Interface Devices (HID)
536#
537# CONFIG_USB_HID is not set
538
539#
540# Input core support is needed for USB HID input layer or HIDBP support
541#
542
543#
544# USB HID Boot Protocol drivers
545#
546
547#
548# USB Imaging devices
549#
550# CONFIG_USB_MDC800 is not set
551
552#
553# USB Multimedia devices
554#
555# CONFIG_USB_DABUSB is not set
556
557#
558# Video4Linux support is needed for USB Multimedia device support
559#
560
561#
562# USB Network adaptors
563#
564# CONFIG_USB_CATC is not set
565# CONFIG_USB_KAWETH is not set
566# CONFIG_USB_PEGASUS is not set
567# CONFIG_USB_RTL8150 is not set
568# CONFIG_USB_USBNET is not set
569
570#
571# USB port drivers
572#
573
574#
575# USB Serial Converter support
576#
577CONFIG_USB_SERIAL=m
578# CONFIG_USB_SERIAL_GENERIC is not set
579# CONFIG_USB_SERIAL_BELKIN is not set
580# CONFIG_USB_SERIAL_WHITEHEAT is not set
581# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
582# CONFIG_USB_SERIAL_EMPEG is not set
583# CONFIG_USB_SERIAL_FTDI_SIO is not set
584CONFIG_USB_SERIAL_VISOR=m
585# CONFIG_USB_SERIAL_IPAQ is not set
586# CONFIG_USB_SERIAL_IR is not set
587# CONFIG_USB_SERIAL_EDGEPORT is not set
588# CONFIG_USB_SERIAL_EDGEPORT_TI is not set
589# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
590# CONFIG_USB_SERIAL_KEYSPAN is not set
591# CONFIG_USB_SERIAL_KLSI is not set
592# CONFIG_USB_SERIAL_KOBIL_SCT is not set
593# CONFIG_USB_SERIAL_MCT_U232 is not set
594# CONFIG_USB_SERIAL_PL2303 is not set
595# CONFIG_USB_SERIAL_SAFE is not set
596# CONFIG_USB_SERIAL_CYBERJACK is not set
597# CONFIG_USB_SERIAL_XIRCOM is not set
598# CONFIG_USB_SERIAL_OMNINET is not set
599
600#
601# USB Miscellaneous drivers
602#
603# CONFIG_USB_EMI62 is not set
604# CONFIG_USB_EMI26 is not set
605# CONFIG_USB_TIGL is not set
606# CONFIG_USB_AUERSWALD is not set
607# CONFIG_USB_RIO500 is not set
608# CONFIG_USB_LEGOTOWER is not set
609# CONFIG_USB_LCD is not set
610# CONFIG_USB_LED is not set
611# CONFIG_USB_CYTHERM is not set
612# CONFIG_USB_PHIDGETSERVO is not set
613# CONFIG_USB_TEST is not set
614
615#
616# USB Gadget Support
617#
618# CONFIG_USB_GADGET is not set
619
620#
621# File systems
622#
623CONFIG_EXT2_FS=y
624# CONFIG_EXT2_FS_XATTR is not set
625CONFIG_EXT3_FS=y
626CONFIG_EXT3_FS_XATTR=y
627# CONFIG_EXT3_FS_POSIX_ACL is not set
628# CONFIG_EXT3_FS_SECURITY is not set
629CONFIG_JBD=y
630# CONFIG_JBD_DEBUG is not set
631CONFIG_FS_MBCACHE=y
632# CONFIG_REISERFS_FS is not set
633# CONFIG_JFS_FS is not set
634# CONFIG_XFS_FS is not set
635# CONFIG_MINIX_FS is not set
636# CONFIG_ROMFS_FS is not set
637# CONFIG_QUOTA is not set
638# CONFIG_AUTOFS_FS is not set
639# CONFIG_AUTOFS4_FS is not set
640
641#
642# CD-ROM/DVD Filesystems
643#
644CONFIG_ISO9660_FS=y
645# CONFIG_JOLIET is not set
646# CONFIG_ZISOFS is not set
647# CONFIG_UDF_FS is not set
648
649#
650# DOS/FAT/NT Filesystems
651#
652# CONFIG_FAT_FS is not set
653# CONFIG_NTFS_FS is not set
654
655#
656# Pseudo filesystems
657#
658CONFIG_PROC_FS=y
659CONFIG_PROC_KCORE=y
660CONFIG_SYSFS=y
661# CONFIG_DEVFS_FS is not set
662# CONFIG_DEVPTS_FS_XATTR is not set
663CONFIG_TMPFS=y
664# CONFIG_HUGETLB_PAGE is not set
665CONFIG_RAMFS=y
666
667#
668# Miscellaneous filesystems
669#
670# CONFIG_ADFS_FS is not set
671# CONFIG_AFFS_FS is not set
672# CONFIG_HFS_FS is not set
673# CONFIG_HFSPLUS_FS is not set
674# CONFIG_BEFS_FS is not set
675# CONFIG_BFS_FS is not set
676# CONFIG_EFS_FS is not set
677# CONFIG_CRAMFS is not set
678# CONFIG_VXFS_FS is not set
679# CONFIG_HPFS_FS is not set
680# CONFIG_QNX4FS_FS is not set
681# CONFIG_SYSV_FS is not set
682# CONFIG_UFS_FS is not set
683
684#
685# Network File Systems
686#
687CONFIG_NFS_FS=y
688CONFIG_NFS_V3=y
689# CONFIG_NFS_V4 is not set
690# CONFIG_NFS_DIRECTIO is not set
691# CONFIG_NFSD is not set
692CONFIG_ROOT_NFS=y
693CONFIG_LOCKD=y
694CONFIG_LOCKD_V4=y
695# CONFIG_EXPORTFS is not set
696CONFIG_SUNRPC=y
697# CONFIG_RPCSEC_GSS_KRB5 is not set
698# CONFIG_SMB_FS is not set
699# CONFIG_CIFS is not set
700# CONFIG_NCP_FS is not set
701# CONFIG_CODA_FS is not set
702# CONFIG_AFS_FS is not set
703
704#
705# Partition Types
706#
707# CONFIG_PARTITION_ADVANCED is not set
708CONFIG_MSDOS_PARTITION=y
709
710#
711# Native Language Support
712#
713# CONFIG_NLS is not set
714
715#
716# Library routines
717#
718CONFIG_CRC32=y
719# CONFIG_LIBCRC32C is not set
720CONFIG_ZLIB_INFLATE=m
721CONFIG_ZLIB_DEFLATE=m
722
723#
724# Kernel hacking
725#
726# CONFIG_DEBUG_KERNEL is not set
727# CONFIG_SERIAL_TEXT_DEBUG is not set
728
729#
730# Security options
731#
732# CONFIG_SECURITY is not set
733
734#
735# Cryptographic options
736#
737# CONFIG_CRYPTO is not set
diff --git a/arch/ppc/configs/spruce_defconfig b/arch/ppc/configs/spruce_defconfig
deleted file mode 100644
index 430dd9c59feb..000000000000
--- a/arch/ppc/configs/spruce_defconfig
+++ /dev/null
@@ -1,577 +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
16CONFIG_STANDALONE=y
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
30# CONFIG_IKCONFIG is not set
31CONFIG_EMBEDDED=y
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
46# CONFIG_MODULE_FORCE_UNLOAD is not set
47CONFIG_OBSOLETE_MODPARM=y
48# CONFIG_MODVERSIONS is not set
49CONFIG_KMOD=y
50
51#
52# Processor
53#
54CONFIG_6xx=y
55# CONFIG_40x is not set
56# CONFIG_44x is not set
57# CONFIG_POWER3 is not set
58# CONFIG_POWER4 is not set
59# CONFIG_8xx is not set
60# CONFIG_ALTIVEC is not set
61# CONFIG_TAU is not set
62# CONFIG_CPU_FREQ is not set
63CONFIG_PPC_STD_MMU=y
64
65#
66# Platform options
67#
68# CONFIG_PPC_MULTIPLATFORM is not set
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
74CONFIG_SPRUCE=y
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_GEN550=y
91CONFIG_SPRUCE_BAUD_33M=y
92# CONFIG_SMP is not set
93# CONFIG_PREEMPT is not set
94# CONFIG_HIGHMEM is not set
95CONFIG_KERNEL_ELF=y
96CONFIG_BINFMT_ELF=y
97# CONFIG_BINFMT_MISC is not set
98CONFIG_CMDLINE_BOOL=y
99CONFIG_CMDLINE="ip=on"
100
101#
102# Bus options
103#
104CONFIG_GENERIC_ISA_DMA=y
105CONFIG_PCI=y
106CONFIG_PCI_DOMAINS=y
107CONFIG_PCI_LEGACY_PROC=y
108# CONFIG_PCI_NAMES is not set
109
110#
111# Advanced setup
112#
113# CONFIG_ADVANCED_OPTIONS is not set
114
115#
116# Default settings for advanced configuration options are used
117#
118CONFIG_HIGHMEM_START=0xfe000000
119CONFIG_LOWMEM_SIZE=0x30000000
120CONFIG_KERNEL_START=0xc0000000
121CONFIG_TASK_SIZE=0x80000000
122CONFIG_BOOT_LOAD=0x00800000
123
124#
125# Device Drivers
126#
127
128#
129# Generic Driver Options
130#
131
132#
133# Memory Technology Devices (MTD)
134#
135# CONFIG_MTD is not set
136
137#
138# Parallel port support
139#
140# CONFIG_PARPORT is not set
141
142#
143# Plug and Play support
144#
145
146#
147# Block devices
148#
149# CONFIG_BLK_DEV_FD is not set
150# CONFIG_BLK_CPQ_DA is not set
151# CONFIG_BLK_CPQ_CISS_DA is not set
152# CONFIG_BLK_DEV_DAC960 is not set
153# CONFIG_BLK_DEV_UMEM is not set
154# CONFIG_BLK_DEV_LOOP is not set
155# CONFIG_BLK_DEV_NBD is not set
156# CONFIG_BLK_DEV_CARMEL is not set
157# CONFIG_BLK_DEV_RAM is not set
158# CONFIG_LBD is not set
159
160#
161# ATA/ATAPI/MFM/RLL support
162#
163# CONFIG_IDE is not set
164
165#
166# SCSI device support
167#
168# CONFIG_SCSI is not set
169
170#
171# Multi-device support (RAID and LVM)
172#
173# CONFIG_MD is not set
174
175#
176# Fusion MPT device support
177#
178
179#
180# IEEE 1394 (FireWire) support
181#
182# CONFIG_IEEE1394 is not set
183
184#
185# I2O device support
186#
187# CONFIG_I2O is not set
188
189#
190# Macintosh device drivers
191#
192
193#
194# Networking support
195#
196CONFIG_NET=y
197
198#
199# Networking options
200#
201CONFIG_PACKET=y
202# CONFIG_PACKET_MMAP is not set
203# CONFIG_NETLINK_DEV is not set
204CONFIG_UNIX=y
205# CONFIG_NET_KEY is not set
206CONFIG_INET=y
207# CONFIG_IP_MULTICAST is not set
208# CONFIG_IP_ADVANCED_ROUTER is not set
209CONFIG_IP_PNP=y
210CONFIG_IP_PNP_DHCP=y
211# CONFIG_IP_PNP_BOOTP is not set
212# CONFIG_IP_PNP_RARP is not set
213# CONFIG_NET_IPIP is not set
214# CONFIG_NET_IPGRE is not set
215# CONFIG_ARPD is not set
216# CONFIG_SYN_COOKIES is not set
217# CONFIG_INET_AH is not set
218# CONFIG_INET_ESP is not set
219# CONFIG_INET_IPCOMP is not set
220# CONFIG_IPV6 is not set
221# CONFIG_NETFILTER is not set
222
223#
224# SCTP Configuration (EXPERIMENTAL)
225#
226# CONFIG_IP_SCTP is not set
227# CONFIG_ATM is not set
228# CONFIG_BRIDGE is not set
229# CONFIG_VLAN_8021Q is not set
230# CONFIG_DECNET is not set
231# CONFIG_LLC2 is not set
232# CONFIG_IPX is not set
233# CONFIG_ATALK is not set
234# CONFIG_X25 is not set
235# CONFIG_LAPB is not set
236# CONFIG_NET_DIVERT is not set
237# CONFIG_ECONET is not set
238# CONFIG_WAN_ROUTER is not set
239# CONFIG_NET_HW_FLOWCONTROL is not set
240
241#
242# QoS and/or fair queueing
243#
244# CONFIG_NET_SCHED is not set
245
246#
247# Network testing
248#
249# CONFIG_NET_PKTGEN is not set
250# CONFIG_NETPOLL is not set
251# CONFIG_NET_POLL_CONTROLLER is not set
252# CONFIG_HAMRADIO is not set
253# CONFIG_IRDA is not set
254# CONFIG_BT is not set
255CONFIG_NETDEVICES=y
256# CONFIG_DUMMY is not set
257# CONFIG_BONDING is not set
258# CONFIG_EQUALIZER is not set
259# CONFIG_TUN is not set
260
261#
262# ARCnet devices
263#
264# CONFIG_ARCNET is not set
265
266#
267# Ethernet (10 or 100Mbit)
268#
269CONFIG_NET_ETHERNET=y
270CONFIG_MII=y
271# CONFIG_OAKNET is not set
272# CONFIG_HAPPYMEAL is not set
273# CONFIG_SUNGEM is not set
274# CONFIG_NET_VENDOR_3COM is not set
275
276#
277# Tulip family network device support
278#
279# CONFIG_NET_TULIP is not set
280# CONFIG_HP100 is not set
281CONFIG_NET_PCI=y
282CONFIG_PCNET32=y
283# CONFIG_AMD8111_ETH is not set
284# CONFIG_ADAPTEC_STARFIRE is not set
285# CONFIG_B44 is not set
286# CONFIG_FORCEDETH is not set
287# CONFIG_DGRS is not set
288# CONFIG_EEPRO100 is not set
289# CONFIG_E100 is not set
290# CONFIG_FEALNX is not set
291# CONFIG_NATSEMI is not set
292# CONFIG_NE2K_PCI is not set
293# CONFIG_8139CP is not set
294# CONFIG_8139TOO is not set
295# CONFIG_SIS900 is not set
296# CONFIG_EPIC100 is not set
297# CONFIG_SUNDANCE is not set
298# CONFIG_TLAN is not set
299# CONFIG_VIA_RHINE is not set
300
301#
302# Ethernet (1000 Mbit)
303#
304# CONFIG_ACENIC is not set
305# CONFIG_DL2K is not set
306# CONFIG_E1000 is not set
307# CONFIG_NS83820 is not set
308# CONFIG_HAMACHI is not set
309# CONFIG_YELLOWFIN is not set
310# CONFIG_R8169 is not set
311# CONFIG_SK98LIN is not set
312# CONFIG_TIGON3 is not set
313
314#
315# Ethernet (10000 Mbit)
316#
317# CONFIG_IXGB is not set
318# CONFIG_S2IO is not set
319
320#
321# Token Ring devices
322#
323# CONFIG_TR is not set
324
325#
326# Wireless LAN (non-hamradio)
327#
328# CONFIG_NET_RADIO is not set
329
330#
331# Wan interfaces
332#
333# CONFIG_WAN is not set
334# CONFIG_FDDI is not set
335# CONFIG_HIPPI is not set
336# CONFIG_PPP is not set
337# CONFIG_SLIP is not set
338# CONFIG_RCPCI is not set
339# CONFIG_SHAPER is not set
340# CONFIG_NETCONSOLE is not set
341
342#
343# ISDN subsystem
344#
345# CONFIG_ISDN is not set
346
347#
348# Telephony Support
349#
350# CONFIG_PHONE is not set
351
352#
353# Input device support
354#
355# CONFIG_INPUT is not set
356
357#
358# Userland interfaces
359#
360
361#
362# Input I/O drivers
363#
364# CONFIG_GAMEPORT is not set
365CONFIG_SOUND_GAMEPORT=y
366CONFIG_SERIO=y
367CONFIG_SERIO_I8042=y
368CONFIG_SERIO_SERPORT=y
369# CONFIG_SERIO_CT82C710 is not set
370CONFIG_SERIO_PCIPS2=y
371
372#
373# Input Device Drivers
374#
375
376#
377# Character devices
378#
379# CONFIG_VT is not set
380# CONFIG_SERIAL_NONSTANDARD is not set
381
382#
383# Serial drivers
384#
385CONFIG_SERIAL_8250=y
386CONFIG_SERIAL_8250_CONSOLE=y
387CONFIG_SERIAL_8250_NR_UARTS=2
388# CONFIG_SERIAL_8250_EXTENDED is not set
389
390#
391# Non-8250 serial port support
392#
393CONFIG_SERIAL_CORE=y
394CONFIG_SERIAL_CORE_CONSOLE=y
395CONFIG_UNIX98_PTYS=y
396CONFIG_LEGACY_PTYS=y
397CONFIG_LEGACY_PTY_COUNT=256
398# CONFIG_QIC02_TAPE is not set
399
400#
401# IPMI
402#
403# CONFIG_IPMI_HANDLER is not set
404
405#
406# Watchdog Cards
407#
408# CONFIG_WATCHDOG is not set
409# CONFIG_NVRAM is not set
410CONFIG_GEN_RTC=y
411# CONFIG_GEN_RTC_X is not set
412# CONFIG_DTLK is not set
413# CONFIG_R3964 is not set
414# CONFIG_APPLICOM is not set
415
416#
417# Ftape, the floppy tape device driver
418#
419# CONFIG_FTAPE is not set
420# CONFIG_AGP is not set
421# CONFIG_DRM is not set
422# CONFIG_RAW_DRIVER is not set
423
424#
425# I2C support
426#
427# CONFIG_I2C is not set
428
429#
430# Misc devices
431#
432
433#
434# Multimedia devices
435#
436# CONFIG_VIDEO_DEV is not set
437
438#
439# Digital Video Broadcasting Devices
440#
441# CONFIG_DVB is not set
442
443#
444# Graphics support
445#
446# CONFIG_FB is not set
447
448#
449# Sound
450#
451# CONFIG_SOUND is not set
452
453#
454# USB support
455#
456# CONFIG_USB is not set
457
458#
459# USB Gadget Support
460#
461# CONFIG_USB_GADGET is not set
462
463#
464# File systems
465#
466CONFIG_EXT2_FS=y
467# CONFIG_EXT2_FS_XATTR is not set
468CONFIG_EXT3_FS=y
469CONFIG_EXT3_FS_XATTR=y
470# CONFIG_EXT3_FS_POSIX_ACL is not set
471# CONFIG_EXT3_FS_SECURITY is not set
472CONFIG_JBD=y
473# CONFIG_JBD_DEBUG is not set
474CONFIG_FS_MBCACHE=y
475# CONFIG_REISERFS_FS is not set
476# CONFIG_JFS_FS is not set
477# CONFIG_XFS_FS is not set
478# CONFIG_MINIX_FS is not set
479# CONFIG_ROMFS_FS is not set
480# CONFIG_QUOTA is not set
481# CONFIG_AUTOFS_FS is not set
482# CONFIG_AUTOFS4_FS is not set
483
484#
485# CD-ROM/DVD Filesystems
486#
487CONFIG_ISO9660_FS=y
488# CONFIG_JOLIET is not set
489# CONFIG_ZISOFS is not set
490# CONFIG_UDF_FS is not set
491
492#
493# DOS/FAT/NT Filesystems
494#
495# CONFIG_FAT_FS is not set
496# CONFIG_NTFS_FS is not set
497
498#
499# Pseudo filesystems
500#
501CONFIG_PROC_FS=y
502CONFIG_PROC_KCORE=y
503CONFIG_SYSFS=y
504# CONFIG_DEVFS_FS is not set
505# CONFIG_DEVPTS_FS_XATTR is not set
506CONFIG_TMPFS=y
507# CONFIG_HUGETLB_PAGE is not set
508CONFIG_RAMFS=y
509
510#
511# Miscellaneous filesystems
512#
513# CONFIG_ADFS_FS is not set
514# CONFIG_AFFS_FS is not set
515# CONFIG_HFS_FS is not set
516# CONFIG_HFSPLUS_FS is not set
517# CONFIG_BEFS_FS is not set
518# CONFIG_BFS_FS is not set
519# CONFIG_EFS_FS is not set
520# CONFIG_CRAMFS is not set
521# CONFIG_VXFS_FS is not set
522# CONFIG_HPFS_FS is not set
523# CONFIG_QNX4FS_FS is not set
524# CONFIG_SYSV_FS is not set
525# CONFIG_UFS_FS is not set
526
527#
528# Network File Systems
529#
530CONFIG_NFS_FS=y
531# CONFIG_NFS_V3 is not set
532# CONFIG_NFS_V4 is not set
533# CONFIG_NFS_DIRECTIO is not set
534# CONFIG_NFSD is not set
535CONFIG_ROOT_NFS=y
536CONFIG_LOCKD=y
537# CONFIG_EXPORTFS is not set
538CONFIG_SUNRPC=y
539# CONFIG_RPCSEC_GSS_KRB5 is not set
540# CONFIG_SMB_FS is not set
541# CONFIG_CIFS is not set
542# CONFIG_NCP_FS is not set
543# CONFIG_CODA_FS is not set
544# CONFIG_AFS_FS is not set
545
546#
547# Partition Types
548#
549# CONFIG_PARTITION_ADVANCED is not set
550CONFIG_MSDOS_PARTITION=y
551
552#
553# Native Language Support
554#
555# CONFIG_NLS is not set
556
557#
558# Library routines
559#
560CONFIG_CRC32=y
561# CONFIG_LIBCRC32C is not set
562
563#
564# Kernel hacking
565#
566# CONFIG_DEBUG_KERNEL is not set
567# CONFIG_SERIAL_TEXT_DEBUG is not set
568
569#
570# Security options
571#
572# CONFIG_SECURITY is not set
573
574#
575# Cryptographic options
576#
577# CONFIG_CRYPTO is not set
diff --git a/arch/ppc/configs/sycamore_defconfig b/arch/ppc/configs/sycamore_defconfig
deleted file mode 100644
index 6996cca18f3e..000000000000
--- a/arch/ppc/configs/sycamore_defconfig
+++ /dev/null
@@ -1,663 +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
16CONFIG_STANDALONE=y
17CONFIG_BROKEN_ON_SMP=y
18
19#
20# General setup
21#
22# CONFIG_SWAP is not set
23CONFIG_SYSVIPC=y
24# CONFIG_BSD_PROCESS_ACCT is not set
25CONFIG_SYSCTL=y
26CONFIG_LOG_BUF_SHIFT=14
27# CONFIG_HOTPLUG is not set
28# CONFIG_IKCONFIG is not set
29CONFIG_EMBEDDED=y
30# CONFIG_KALLSYMS is not set
31CONFIG_FUTEX=y
32# CONFIG_EPOLL is not set
33CONFIG_IOSCHED_NOOP=y
34CONFIG_IOSCHED_AS=y
35CONFIG_IOSCHED_DEADLINE=y
36# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
37
38#
39# Loadable module support
40#
41CONFIG_MODULES=y
42CONFIG_MODULE_UNLOAD=y
43# CONFIG_MODULE_FORCE_UNLOAD is not set
44CONFIG_OBSOLETE_MODPARM=y
45CONFIG_MODVERSIONS=y
46CONFIG_KMOD=y
47
48#
49# Processor
50#
51# CONFIG_6xx is not set
52CONFIG_40x=y
53# CONFIG_44x is not set
54# CONFIG_POWER3 is not set
55# CONFIG_POWER4 is not set
56# CONFIG_8xx is not set
57# CONFIG_MATH_EMULATION is not set
58# CONFIG_CPU_FREQ is not set
59CONFIG_4xx=y
60
61#
62# IBM 4xx options
63#
64# CONFIG_ASH is not set
65# CONFIG_CPCI405 is not set
66# CONFIG_EP405 is not set
67# CONFIG_EVB405EP is not set
68# CONFIG_OAK is not set
69# CONFIG_REDWOOD_5 is not set
70# CONFIG_REDWOOD_6 is not set
71CONFIG_SYCAMORE=y
72# CONFIG_WALNUT is not set
73CONFIG_IBM_OCP=y
74CONFIG_PPC_OCP=y
75CONFIG_BIOS_FIXUP=y
76CONFIG_405GPR=y
77CONFIG_IBM_OPENBIOS=y
78# CONFIG_PM is not set
79CONFIG_UART0_TTYS0=y
80# CONFIG_UART0_TTYS1 is not set
81CONFIG_NOT_COHERENT_CACHE=y
82
83#
84# Platform options
85#
86# CONFIG_PC_KEYBOARD is not set
87# CONFIG_SMP is not set
88# CONFIG_PREEMPT is not set
89# CONFIG_HIGHMEM is not set
90CONFIG_KERNEL_ELF=y
91CONFIG_BINFMT_ELF=y
92# CONFIG_BINFMT_MISC is not set
93CONFIG_CMDLINE_BOOL=y
94CONFIG_CMDLINE="ip=on"
95
96#
97# Bus options
98#
99CONFIG_PCI=y
100CONFIG_PCI_DOMAINS=y
101# CONFIG_PCI_LEGACY_PROC is not set
102# CONFIG_PCI_NAMES is not set
103
104#
105# Advanced setup
106#
107# CONFIG_ADVANCED_OPTIONS is not set
108
109#
110# Default settings for advanced configuration options are used
111#
112CONFIG_HIGHMEM_START=0xfe000000
113CONFIG_LOWMEM_SIZE=0x30000000
114CONFIG_KERNEL_START=0xc0000000
115CONFIG_TASK_SIZE=0x80000000
116CONFIG_BOOT_LOAD=0x00400000
117
118#
119# Device Drivers
120#
121
122#
123# Generic Driver Options
124#
125
126#
127# Memory Technology Devices (MTD)
128#
129# CONFIG_MTD is not set
130
131#
132# Parallel port support
133#
134# CONFIG_PARPORT is not set
135
136#
137# Plug and Play support
138#
139
140#
141# Block devices
142#
143# CONFIG_BLK_DEV_FD is not set
144# CONFIG_BLK_CPQ_DA is not set
145# CONFIG_BLK_CPQ_CISS_DA is not set
146# CONFIG_BLK_DEV_DAC960 is not set
147# CONFIG_BLK_DEV_UMEM is not set
148CONFIG_BLK_DEV_LOOP=y
149# CONFIG_BLK_DEV_CRYPTOLOOP is not set
150# CONFIG_BLK_DEV_NBD is not set
151# CONFIG_BLK_DEV_CARMEL is not set
152CONFIG_BLK_DEV_RAM=y
153CONFIG_BLK_DEV_RAM_SIZE=4096
154CONFIG_BLK_DEV_INITRD=y
155# CONFIG_LBD is not set
156
157#
158# ATA/ATAPI/MFM/RLL support
159#
160# CONFIG_IDE is not set
161
162#
163# SCSI device support
164#
165# CONFIG_SCSI is not set
166
167#
168# Multi-device support (RAID and LVM)
169#
170# CONFIG_MD is not set
171
172#
173# Fusion MPT device support
174#
175# CONFIG_FUSION is not set
176
177#
178# IEEE 1394 (FireWire) support
179#
180# CONFIG_IEEE1394 is not set
181
182#
183# I2O device support
184#
185# CONFIG_I2O is not set
186
187#
188# Macintosh device drivers
189#
190
191#
192# Networking support
193#
194CONFIG_NET=y
195
196#
197# Networking options
198#
199# CONFIG_PACKET is not set
200# CONFIG_NETLINK_DEV is not set
201CONFIG_UNIX=y
202# CONFIG_NET_KEY is not set
203CONFIG_INET=y
204CONFIG_IP_MULTICAST=y
205# CONFIG_IP_ADVANCED_ROUTER is not set
206CONFIG_IP_PNP=y
207# CONFIG_IP_PNP_DHCP is not set
208CONFIG_IP_PNP_BOOTP=y
209# CONFIG_IP_PNP_RARP is not set
210# CONFIG_NET_IPIP is not set
211# CONFIG_NET_IPGRE is not set
212# CONFIG_IP_MROUTE is not set
213# CONFIG_ARPD is not set
214CONFIG_SYN_COOKIES=y
215# CONFIG_INET_AH is not set
216# CONFIG_INET_ESP is not set
217# CONFIG_INET_IPCOMP is not set
218# CONFIG_IPV6 is not set
219# CONFIG_DECNET is not set
220# CONFIG_BRIDGE is not set
221# CONFIG_NETFILTER is not set
222
223#
224# SCTP Configuration (EXPERIMENTAL)
225#
226# CONFIG_IP_SCTP is not set
227# CONFIG_ATM is not set
228# CONFIG_VLAN_8021Q is not set
229# CONFIG_LLC2 is not set
230# CONFIG_IPX is not set
231# CONFIG_ATALK is not set
232# CONFIG_X25 is not set
233# CONFIG_LAPB is not set
234# CONFIG_NET_DIVERT is not set
235# CONFIG_ECONET is not set
236# CONFIG_WAN_ROUTER is not set
237# CONFIG_NET_HW_FLOWCONTROL is not set
238
239#
240# QoS and/or fair queueing
241#
242# CONFIG_NET_SCHED is not set
243
244#
245# Network testing
246#
247# CONFIG_NET_PKTGEN is not set
248CONFIG_NETDEVICES=y
249
250#
251# ARCnet devices
252#
253# CONFIG_ARCNET is not set
254# CONFIG_DUMMY is not set
255# CONFIG_BONDING is not set
256# CONFIG_EQUALIZER is not set
257# CONFIG_TUN is not set
258
259#
260# Ethernet (10 or 100Mbit)
261#
262CONFIG_NET_ETHERNET=y
263CONFIG_MII=y
264# CONFIG_OAKNET is not set
265# CONFIG_HAPPYMEAL is not set
266# CONFIG_SUNGEM is not set
267# CONFIG_NET_VENDOR_3COM is not set
268
269#
270# Tulip family network device support
271#
272# CONFIG_NET_TULIP is not set
273# CONFIG_HP100 is not set
274# CONFIG_NET_PCI is not set
275
276#
277# Ethernet (1000 Mbit)
278#
279# CONFIG_ACENIC is not set
280# CONFIG_DL2K is not set
281# CONFIG_E1000 is not set
282# CONFIG_NS83820 is not set
283# CONFIG_HAMACHI is not set
284# CONFIG_YELLOWFIN is not set
285# CONFIG_R8169 is not set
286# CONFIG_SIS190 is not set
287# CONFIG_SK98LIN is not set
288# CONFIG_TIGON3 is not set
289
290#
291# Ethernet (10000 Mbit)
292#
293# CONFIG_IXGB is not set
294CONFIG_IBM_EMAC=y
295# CONFIG_IBM_EMAC_ERRMSG is not set
296CONFIG_IBM_EMAC_RXB=64
297CONFIG_IBM_EMAC_TXB=8
298CONFIG_IBM_EMAC_FGAP=8
299CONFIG_IBM_EMAC_SKBRES=0
300# CONFIG_FDDI is not set
301# CONFIG_HIPPI is not set
302# CONFIG_PPP is not set
303# CONFIG_SLIP is not set
304
305#
306# Wireless LAN (non-hamradio)
307#
308# CONFIG_NET_RADIO is not set
309
310#
311# Token Ring devices
312#
313# CONFIG_TR is not set
314# CONFIG_RCPCI is not set
315# CONFIG_SHAPER is not set
316# CONFIG_NETCONSOLE is not set
317
318#
319# Wan interfaces
320#
321# CONFIG_WAN is not set
322
323#
324# Amateur Radio support
325#
326# CONFIG_HAMRADIO is not set
327
328#
329# IrDA (infrared) support
330#
331# CONFIG_IRDA is not set
332
333#
334# Bluetooth support
335#
336# CONFIG_BT is not set
337# CONFIG_NETPOLL is not set
338# CONFIG_NET_POLL_CONTROLLER is not set
339
340#
341# ISDN subsystem
342#
343# CONFIG_ISDN is not set
344
345#
346# Telephony Support
347#
348# CONFIG_PHONE is not set
349
350#
351# Input device support
352#
353CONFIG_INPUT=y
354
355#
356# Userland interfaces
357#
358CONFIG_INPUT_MOUSEDEV=y
359CONFIG_INPUT_MOUSEDEV_PSAUX=y
360CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
361CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
362# CONFIG_INPUT_JOYDEV is not set
363# CONFIG_INPUT_TSDEV is not set
364# CONFIG_INPUT_EVDEV is not set
365# CONFIG_INPUT_EVBUG is not set
366
367#
368# Input I/O drivers
369#
370# CONFIG_GAMEPORT is not set
371CONFIG_SOUND_GAMEPORT=y
372CONFIG_SERIO=y
373CONFIG_SERIO_I8042=y
374CONFIG_SERIO_SERPORT=y
375# CONFIG_SERIO_CT82C710 is not set
376# CONFIG_SERIO_PCIPS2 is not set
377
378#
379# Input Device Drivers
380#
381CONFIG_INPUT_KEYBOARD=y
382CONFIG_KEYBOARD_ATKBD=y
383# CONFIG_KEYBOARD_SUNKBD is not set
384# CONFIG_KEYBOARD_LKKBD is not set
385# CONFIG_KEYBOARD_XTKBD is not set
386# CONFIG_KEYBOARD_NEWTON is not set
387CONFIG_INPUT_MOUSE=y
388CONFIG_MOUSE_PS2=y
389# CONFIG_MOUSE_SERIAL is not set
390# CONFIG_MOUSE_VSXXXAA is not set
391# CONFIG_INPUT_JOYSTICK is not set
392# CONFIG_INPUT_TOUCHSCREEN is not set
393# CONFIG_INPUT_MISC is not set
394
395#
396# Character devices
397#
398# CONFIG_VT is not set
399# CONFIG_SERIAL_NONSTANDARD is not set
400
401#
402# Serial drivers
403#
404CONFIG_SERIAL_8250=y
405CONFIG_SERIAL_8250_CONSOLE=y
406CONFIG_SERIAL_8250_NR_UARTS=4
407# CONFIG_SERIAL_8250_EXTENDED is not set
408
409#
410# Non-8250 serial port support
411#
412CONFIG_SERIAL_CORE=y
413CONFIG_SERIAL_CORE_CONSOLE=y
414CONFIG_UNIX98_PTYS=y
415CONFIG_LEGACY_PTYS=y
416CONFIG_LEGACY_PTY_COUNT=256
417# CONFIG_QIC02_TAPE is not set
418
419#
420# IPMI
421#
422# CONFIG_IPMI_HANDLER is not set
423
424#
425# Watchdog Cards
426#
427# CONFIG_WATCHDOG is not set
428# CONFIG_NVRAM is not set
429# CONFIG_GEN_RTC is not set
430# CONFIG_DTLK is not set
431# CONFIG_R3964 is not set
432# CONFIG_APPLICOM is not set
433
434#
435# Ftape, the floppy tape device driver
436#
437# CONFIG_FTAPE is not set
438# CONFIG_AGP is not set
439# CONFIG_DRM is not set
440# CONFIG_RAW_DRIVER is not set
441
442#
443# I2C support
444#
445CONFIG_I2C=y
446CONFIG_I2C_CHARDEV=y
447
448#
449# I2C Algorithms
450#
451# CONFIG_I2C_ALGOBIT is not set
452# CONFIG_I2C_ALGOPCF is not set
453
454#
455# I2C Hardware Bus support
456#
457# CONFIG_I2C_ALI1535 is not set
458# CONFIG_I2C_ALI15X3 is not set
459# CONFIG_I2C_AMD756 is not set
460# CONFIG_I2C_AMD8111 is not set
461# CONFIG_I2C_I801 is not set
462# CONFIG_I2C_I810 is not set
463# CONFIG_I2C_IBM_IIC is not set
464# CONFIG_I2C_NFORCE2 is not set
465# CONFIG_I2C_PARPORT_LIGHT is not set
466# CONFIG_I2C_PIIX4 is not set
467# CONFIG_I2C_PROSAVAGE is not set
468# CONFIG_I2C_SAVAGE4 is not set
469# CONFIG_SCx200_ACB is not set
470# CONFIG_I2C_SIS5595 is not set
471# CONFIG_I2C_SIS630 is not set
472# CONFIG_I2C_SIS96X is not set
473# CONFIG_I2C_VIA is not set
474# CONFIG_I2C_VIAPRO is not set
475# CONFIG_I2C_VOODOO3 is not set
476
477#
478# Hardware Sensors Chip support
479#
480# CONFIG_I2C_SENSOR is not set
481# CONFIG_SENSORS_ADM1021 is not set
482# CONFIG_SENSORS_ASB100 is not set
483# CONFIG_SENSORS_DS1621 is not set
484# CONFIG_SENSORS_FSCHER is not set
485# CONFIG_SENSORS_GL518SM is not set
486# CONFIG_SENSORS_IT87 is not set
487# CONFIG_SENSORS_LM75 is not set
488# CONFIG_SENSORS_LM78 is not set
489# CONFIG_SENSORS_LM80 is not set
490# CONFIG_SENSORS_LM83 is not set
491# CONFIG_SENSORS_LM85 is not set
492# CONFIG_SENSORS_LM90 is not set
493# CONFIG_SENSORS_VIA686A is not set
494# CONFIG_SENSORS_W83781D is not set
495# CONFIG_SENSORS_W83L785TS is not set
496# CONFIG_SENSORS_W83627HF is not set
497
498#
499# Other I2C Chip support
500#
501# CONFIG_SENSORS_EEPROM is not set
502# CONFIG_I2C_DEBUG_CORE is not set
503# CONFIG_I2C_DEBUG_ALGO is not set
504# CONFIG_I2C_DEBUG_BUS is not set
505# CONFIG_I2C_DEBUG_CHIP is not set
506
507#
508# Misc devices
509#
510
511#
512# Multimedia devices
513#
514# CONFIG_VIDEO_DEV is not set
515
516#
517# Digital Video Broadcasting Devices
518#
519# CONFIG_DVB is not set
520
521#
522# Graphics support
523#
524# CONFIG_FB is not set
525
526#
527# Sound
528#
529# CONFIG_SOUND is not set
530
531#
532# USB support
533#
534# CONFIG_USB is not set
535
536#
537# USB Gadget Support
538#
539# CONFIG_USB_GADGET is not set
540
541#
542# File systems
543#
544CONFIG_EXT2_FS=y
545# CONFIG_EXT2_FS_XATTR is not set
546# CONFIG_EXT3_FS is not set
547# CONFIG_JBD is not set
548# CONFIG_REISERFS_FS is not set
549# CONFIG_JFS_FS is not set
550# CONFIG_XFS_FS is not set
551# CONFIG_MINIX_FS is not set
552# CONFIG_ROMFS_FS is not set
553# CONFIG_QUOTA is not set
554# CONFIG_AUTOFS_FS is not set
555# CONFIG_AUTOFS4_FS is not set
556
557#
558# CD-ROM/DVD Filesystems
559#
560# CONFIG_ISO9660_FS is not set
561# CONFIG_UDF_FS is not set
562
563#
564# DOS/FAT/NT Filesystems
565#
566# CONFIG_FAT_FS is not set
567# CONFIG_NTFS_FS is not set
568
569#
570# Pseudo filesystems
571#
572CONFIG_PROC_FS=y
573CONFIG_PROC_KCORE=y
574# CONFIG_DEVFS_FS is not set
575# CONFIG_DEVPTS_FS_XATTR is not set
576CONFIG_TMPFS=y
577# CONFIG_HUGETLB_PAGE is not set
578CONFIG_RAMFS=y
579
580#
581# Miscellaneous filesystems
582#
583# CONFIG_ADFS_FS is not set
584# CONFIG_AFFS_FS is not set
585# CONFIG_HFS_FS is not set
586# CONFIG_HFSPLUS_FS is not set
587# CONFIG_BEFS_FS is not set
588# CONFIG_BFS_FS is not set
589# CONFIG_EFS_FS is not set
590# CONFIG_CRAMFS is not set
591# CONFIG_VXFS_FS is not set
592# CONFIG_HPFS_FS is not set
593# CONFIG_QNX4FS_FS is not set
594# CONFIG_SYSV_FS is not set
595# CONFIG_UFS_FS is not set
596
597#
598# Network File Systems
599#
600CONFIG_NFS_FS=y
601# CONFIG_NFS_V3 is not set
602# CONFIG_NFS_V4 is not set
603# CONFIG_NFS_DIRECTIO is not set
604# CONFIG_NFSD is not set
605CONFIG_ROOT_NFS=y
606CONFIG_LOCKD=y
607# CONFIG_EXPORTFS is not set
608CONFIG_SUNRPC=y
609# CONFIG_RPCSEC_GSS_KRB5 is not set
610# CONFIG_SMB_FS is not set
611# CONFIG_CIFS is not set
612# CONFIG_NCP_FS is not set
613# CONFIG_CODA_FS is not set
614# CONFIG_INTERMEZZO_FS is not set
615# CONFIG_AFS_FS is not set
616
617#
618# Partition Types
619#
620CONFIG_PARTITION_ADVANCED=y
621# CONFIG_ACORN_PARTITION is not set
622# CONFIG_OSF_PARTITION is not set
623# CONFIG_AMIGA_PARTITION is not set
624# CONFIG_ATARI_PARTITION is not set
625# CONFIG_MAC_PARTITION is not set
626# CONFIG_MSDOS_PARTITION is not set
627# CONFIG_LDM_PARTITION is not set
628# CONFIG_NEC98_PARTITION is not set
629# CONFIG_SGI_PARTITION is not set
630# CONFIG_ULTRIX_PARTITION is not set
631# CONFIG_SUN_PARTITION is not set
632# CONFIG_EFI_PARTITION is not set
633
634#
635# Native Language Support
636#
637# CONFIG_NLS is not set
638
639#
640# IBM 40x options
641#
642
643#
644# Library routines
645#
646CONFIG_CRC32=y
647
648#
649# Kernel hacking
650#
651# CONFIG_DEBUG_KERNEL is not set
652# CONFIG_SERIAL_TEXT_DEBUG is not set
653CONFIG_OCP=y
654
655#
656# Security options
657#
658# CONFIG_SECURITY is not set
659
660#
661# Cryptographic options
662#
663# CONFIG_CRYPTO is not set
diff --git a/arch/ppc/configs/taishan_defconfig b/arch/ppc/configs/taishan_defconfig
deleted file mode 100644
index 1ca0204267b1..000000000000
--- a/arch/ppc/configs/taishan_defconfig
+++ /dev/null
@@ -1,1077 +0,0 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.20
4# Mon Feb 12 11:11:58 2007
5#
6CONFIG_MMU=y
7CONFIG_GENERIC_HARDIRQS=y
8CONFIG_RWSEM_XCHGADD_ALGORITHM=y
9CONFIG_ARCH_HAS_ILOG2_U32=y
10# CONFIG_ARCH_HAS_ILOG2_U64 is not set
11CONFIG_GENERIC_HWEIGHT=y
12CONFIG_GENERIC_CALIBRATE_DELAY=y
13CONFIG_PPC=y
14CONFIG_PPC32=y
15CONFIG_GENERIC_NVRAM=y
16CONFIG_GENERIC_FIND_NEXT_BIT=y
17CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
18CONFIG_ARCH_MAY_HAVE_PC_FDC=y
19CONFIG_GENERIC_BUG=y
20CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
21
22#
23# Code maturity level options
24#
25CONFIG_EXPERIMENTAL=y
26CONFIG_BROKEN_ON_SMP=y
27CONFIG_INIT_ENV_ARG_LIMIT=32
28
29#
30# General setup
31#
32CONFIG_LOCALVERSION=""
33CONFIG_LOCALVERSION_AUTO=y
34CONFIG_SWAP=y
35CONFIG_SYSVIPC=y
36# CONFIG_IPC_NS is not set
37# CONFIG_POSIX_MQUEUE is not set
38# CONFIG_BSD_PROCESS_ACCT is not set
39# CONFIG_TASKSTATS is not set
40# CONFIG_UTS_NS is not set
41# CONFIG_AUDIT is not set
42# CONFIG_IKCONFIG is not set
43CONFIG_SYSFS_DEPRECATED=y
44# CONFIG_RELAY is not set
45CONFIG_INITRAMFS_SOURCE=""
46# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
47CONFIG_SYSCTL=y
48CONFIG_EMBEDDED=y
49CONFIG_SYSCTL_SYSCALL=y
50CONFIG_KALLSYMS=y
51# CONFIG_KALLSYMS_ALL is not set
52# CONFIG_KALLSYMS_EXTRA_PASS is not set
53# CONFIG_HOTPLUG is not set
54CONFIG_PRINTK=y
55CONFIG_BUG=y
56CONFIG_ELF_CORE=y
57CONFIG_BASE_FULL=y
58CONFIG_FUTEX=y
59CONFIG_EPOLL=y
60CONFIG_SHMEM=y
61CONFIG_SLAB=y
62CONFIG_VM_EVENT_COUNTERS=y
63CONFIG_RT_MUTEXES=y
64# CONFIG_TINY_SHMEM is not set
65CONFIG_BASE_SMALL=0
66# CONFIG_SLOB is not set
67
68#
69# Loadable module support
70#
71CONFIG_MODULES=y
72CONFIG_MODULE_UNLOAD=y
73# CONFIG_MODULE_FORCE_UNLOAD is not set
74# CONFIG_MODVERSIONS is not set
75# CONFIG_MODULE_SRCVERSION_ALL is not set
76CONFIG_KMOD=y
77
78#
79# Block layer
80#
81CONFIG_BLOCK=y
82# CONFIG_LBD is not set
83# CONFIG_BLK_DEV_IO_TRACE is not set
84# CONFIG_LSF is not set
85
86#
87# IO Schedulers
88#
89CONFIG_IOSCHED_NOOP=y
90CONFIG_IOSCHED_AS=y
91CONFIG_IOSCHED_DEADLINE=y
92CONFIG_IOSCHED_CFQ=y
93CONFIG_DEFAULT_AS=y
94# CONFIG_DEFAULT_DEADLINE is not set
95# CONFIG_DEFAULT_CFQ is not set
96# CONFIG_DEFAULT_NOOP is not set
97CONFIG_DEFAULT_IOSCHED="anticipatory"
98
99#
100# Processor
101#
102# CONFIG_6xx is not set
103# CONFIG_40x is not set
104CONFIG_44x=y
105# CONFIG_8xx is not set
106# CONFIG_E200 is not set
107# CONFIG_E500 is not set
108CONFIG_PPC_DCR_NATIVE=y
109CONFIG_PPC_DCR=y
110CONFIG_BOOKE=y
111CONFIG_PTE_64BIT=y
112CONFIG_PHYS_64BIT=y
113# CONFIG_MATH_EMULATION is not set
114# CONFIG_KEXEC is not set
115# CONFIG_CPU_FREQ is not set
116CONFIG_4xx=y
117CONFIG_WANT_EARLY_SERIAL=y
118
119#
120# IBM 4xx options
121#
122# CONFIG_BAMBOO is not set
123# CONFIG_EBONY is not set
124# CONFIG_LUAN is not set
125# CONFIG_YUCCA is not set
126# CONFIG_OCOTEA is not set
127CONFIG_TAISHAN=y
128CONFIG_440GX=y
129CONFIG_440A=y
130CONFIG_IBM_OCP=y
131CONFIG_IBM_EMAC4=y
132CONFIG_PPC4xx_DMA=y
133CONFIG_PPC4xx_EDMA=y
134CONFIG_PPC_GEN550=y
135CONFIG_NOT_COHERENT_CACHE=y
136
137#
138# Platform options
139#
140# CONFIG_PC_KEYBOARD is not set
141# CONFIG_HIGHMEM is not set
142CONFIG_ARCH_POPULATES_NODE_MAP=y
143# CONFIG_HZ_100 is not set
144CONFIG_HZ_250=y
145# CONFIG_HZ_300 is not set
146# CONFIG_HZ_1000 is not set
147CONFIG_HZ=250
148CONFIG_PREEMPT_NONE=y
149# CONFIG_PREEMPT_VOLUNTARY is not set
150# CONFIG_PREEMPT is not set
151CONFIG_SELECT_MEMORY_MODEL=y
152CONFIG_FLATMEM_MANUAL=y
153# CONFIG_DISCONTIGMEM_MANUAL is not set
154# CONFIG_SPARSEMEM_MANUAL is not set
155CONFIG_FLATMEM=y
156CONFIG_FLAT_NODE_MEM_MAP=y
157# CONFIG_SPARSEMEM_STATIC is not set
158CONFIG_SPLIT_PTLOCK_CPUS=4
159CONFIG_RESOURCES_64BIT=y
160CONFIG_ZONE_DMA_FLAG=1
161CONFIG_BINFMT_ELF=y
162# CONFIG_BINFMT_MISC is not set
163CONFIG_CMDLINE_BOOL=y
164CONFIG_CMDLINE="ip=on console=ttyS0,115200"
165CONFIG_SECCOMP=y
166CONFIG_ISA_DMA_API=y
167
168#
169# Bus options
170#
171CONFIG_ZONE_DMA=y
172# CONFIG_PPC_I8259 is not set
173CONFIG_PPC_INDIRECT_PCI=y
174CONFIG_PCI=y
175CONFIG_PCI_DOMAINS=y
176# CONFIG_PCI_DEBUG is not set
177
178#
179# PCCARD (PCMCIA/CardBus) support
180#
181
182#
183# Advanced setup
184#
185# CONFIG_ADVANCED_OPTIONS is not set
186
187#
188# Default settings for advanced configuration options are used
189#
190CONFIG_HIGHMEM_START=0xfe000000
191CONFIG_LOWMEM_SIZE=0x30000000
192CONFIG_KERNEL_START=0xc0000000
193CONFIG_TASK_SIZE=0x80000000
194CONFIG_CONSISTENT_START=0xff100000
195CONFIG_CONSISTENT_SIZE=0x00200000
196CONFIG_BOOT_LOAD=0x01000000
197
198#
199# Networking
200#
201CONFIG_NET=y
202
203#
204# Networking options
205#
206# CONFIG_NETDEBUG is not set
207CONFIG_PACKET=y
208# CONFIG_PACKET_MMAP is not set
209CONFIG_UNIX=y
210CONFIG_XFRM=y
211# CONFIG_XFRM_USER is not set
212# CONFIG_XFRM_SUB_POLICY is not set
213# CONFIG_XFRM_MIGRATE is not set
214# CONFIG_NET_KEY is not set
215CONFIG_INET=y
216# CONFIG_IP_MULTICAST is not set
217CONFIG_IP_ADVANCED_ROUTER=y
218CONFIG_ASK_IP_FIB_HASH=y
219# CONFIG_IP_FIB_TRIE is not set
220CONFIG_IP_FIB_HASH=y
221# CONFIG_IP_MULTIPLE_TABLES is not set
222# CONFIG_IP_ROUTE_MULTIPATH is not set
223# CONFIG_IP_ROUTE_VERBOSE is not set
224CONFIG_IP_PNP=y
225# CONFIG_IP_PNP_DHCP is not set
226CONFIG_IP_PNP_BOOTP=y
227# CONFIG_IP_PNP_RARP is not set
228# CONFIG_NET_IPIP is not set
229# CONFIG_NET_IPGRE is not set
230# CONFIG_ARPD is not set
231# CONFIG_SYN_COOKIES is not set
232# CONFIG_INET_AH is not set
233# CONFIG_INET_ESP is not set
234# CONFIG_INET_IPCOMP is not set
235# CONFIG_INET_XFRM_TUNNEL is not set
236# CONFIG_INET_TUNNEL is not set
237CONFIG_INET_XFRM_MODE_TRANSPORT=y
238CONFIG_INET_XFRM_MODE_TUNNEL=y
239CONFIG_INET_XFRM_MODE_BEET=y
240CONFIG_INET_DIAG=y
241CONFIG_INET_TCP_DIAG=y
242# CONFIG_TCP_CONG_ADVANCED is not set
243CONFIG_TCP_CONG_CUBIC=y
244CONFIG_DEFAULT_TCP_CONG="cubic"
245# CONFIG_TCP_MD5SIG is not set
246# CONFIG_IPV6 is not set
247# CONFIG_INET6_XFRM_TUNNEL is not set
248# CONFIG_INET6_TUNNEL is not set
249# CONFIG_NETWORK_SECMARK is not set
250# CONFIG_NETFILTER is not set
251
252#
253# DCCP Configuration (EXPERIMENTAL)
254#
255# CONFIG_IP_DCCP is not set
256
257#
258# SCTP Configuration (EXPERIMENTAL)
259#
260# CONFIG_IP_SCTP is not set
261
262#
263# TIPC Configuration (EXPERIMENTAL)
264#
265# CONFIG_TIPC is not set
266# CONFIG_ATM is not set
267CONFIG_BRIDGE=y
268# CONFIG_VLAN_8021Q is not set
269# CONFIG_DECNET is not set
270CONFIG_LLC=y
271# CONFIG_LLC2 is not set
272# CONFIG_IPX is not set
273# CONFIG_ATALK is not set
274# CONFIG_X25 is not set
275# CONFIG_LAPB is not set
276# CONFIG_ECONET is not set
277# CONFIG_WAN_ROUTER is not set
278
279#
280# QoS and/or fair queueing
281#
282# CONFIG_NET_SCHED is not set
283
284#
285# Network testing
286#
287# CONFIG_NET_PKTGEN is not set
288# CONFIG_HAMRADIO is not set
289# CONFIG_IRDA is not set
290# CONFIG_BT is not set
291# CONFIG_IEEE80211 is not set
292
293#
294# Device Drivers
295#
296
297#
298# Generic Driver Options
299#
300# CONFIG_STANDALONE is not set
301CONFIG_PREVENT_FIRMWARE_BUILD=y
302# CONFIG_DEBUG_DRIVER is not set
303# CONFIG_DEBUG_DEVRES is not set
304# CONFIG_SYS_HYPERVISOR is not set
305
306#
307# Connector - unified userspace <-> kernelspace linker
308#
309# CONFIG_CONNECTOR is not set
310
311#
312# Memory Technology Devices (MTD)
313#
314CONFIG_MTD=y
315# CONFIG_MTD_DEBUG is not set
316CONFIG_MTD_CONCAT=y
317CONFIG_MTD_PARTITIONS=y
318# CONFIG_MTD_REDBOOT_PARTS is not set
319CONFIG_MTD_CMDLINE_PARTS=y
320
321#
322# User Modules And Translation Layers
323#
324CONFIG_MTD_CHAR=y
325CONFIG_MTD_BLKDEVS=y
326CONFIG_MTD_BLOCK=y
327# CONFIG_FTL is not set
328# CONFIG_NFTL is not set
329# CONFIG_INFTL is not set
330# CONFIG_RFD_FTL is not set
331# CONFIG_SSFDC is not set
332
333#
334# RAM/ROM/Flash chip drivers
335#
336CONFIG_MTD_CFI=y
337CONFIG_MTD_JEDECPROBE=y
338CONFIG_MTD_GEN_PROBE=y
339CONFIG_MTD_CFI_ADV_OPTIONS=y
340CONFIG_MTD_CFI_NOSWAP=y
341# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set
342# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set
343# CONFIG_MTD_CFI_GEOMETRY is not set
344CONFIG_MTD_MAP_BANK_WIDTH_1=y
345CONFIG_MTD_MAP_BANK_WIDTH_2=y
346CONFIG_MTD_MAP_BANK_WIDTH_4=y
347# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
348# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
349# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
350CONFIG_MTD_CFI_I1=y
351CONFIG_MTD_CFI_I2=y
352# CONFIG_MTD_CFI_I4 is not set
353# CONFIG_MTD_CFI_I8 is not set
354# CONFIG_MTD_OTP is not set
355# CONFIG_MTD_CFI_INTELEXT is not set
356CONFIG_MTD_CFI_AMDSTD=y
357# CONFIG_MTD_CFI_STAA is not set
358CONFIG_MTD_CFI_UTIL=y
359# CONFIG_MTD_RAM is not set
360# CONFIG_MTD_ROM is not set
361# CONFIG_MTD_ABSENT is not set
362# CONFIG_MTD_OBSOLETE_CHIPS is not set
363
364#
365# Mapping drivers for chip access
366#
367CONFIG_MTD_COMPLEX_MAPPINGS=y
368CONFIG_MTD_PHYSMAP=y
369CONFIG_MTD_PHYSMAP_START=0x8000000
370CONFIG_MTD_PHYSMAP_LEN=0x0
371CONFIG_MTD_PHYSMAP_BANKWIDTH=2
372# CONFIG_MTD_PCI is not set
373# CONFIG_MTD_PLATRAM is not set
374
375#
376# Self-contained MTD device drivers
377#
378# CONFIG_MTD_PMC551 is not set
379# CONFIG_MTD_SLRAM is not set
380# CONFIG_MTD_PHRAM is not set
381# CONFIG_MTD_MTDRAM is not set
382# CONFIG_MTD_BLOCK2MTD is not set
383
384#
385# Disk-On-Chip Device Drivers
386#
387# CONFIG_MTD_DOC2000 is not set
388# CONFIG_MTD_DOC2001 is not set
389# CONFIG_MTD_DOC2001PLUS is not set
390
391#
392# NAND Flash Device Drivers
393#
394# CONFIG_MTD_NAND is not set
395# CONFIG_MTD_NAND_CAFE is not set
396
397#
398# OneNAND Flash Device Drivers
399#
400# CONFIG_MTD_ONENAND is not set
401
402#
403# Parallel port support
404#
405# CONFIG_PARPORT is not set
406
407#
408# Plug and Play support
409#
410
411#
412# Block devices
413#
414# CONFIG_BLK_DEV_FD is not set
415# CONFIG_BLK_CPQ_DA is not set
416# CONFIG_BLK_CPQ_CISS_DA is not set
417# CONFIG_BLK_DEV_DAC960 is not set
418# CONFIG_BLK_DEV_UMEM is not set
419# CONFIG_BLK_DEV_COW_COMMON is not set
420# CONFIG_BLK_DEV_LOOP is not set
421# CONFIG_BLK_DEV_NBD is not set
422# CONFIG_BLK_DEV_SX8 is not set
423CONFIG_BLK_DEV_RAM=y
424CONFIG_BLK_DEV_RAM_COUNT=16
425CONFIG_BLK_DEV_RAM_SIZE=65536
426CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
427CONFIG_BLK_DEV_INITRD=y
428# CONFIG_CDROM_PKTCDVD is not set
429# CONFIG_ATA_OVER_ETH is not set
430
431#
432# Misc devices
433#
434# CONFIG_SGI_IOC4 is not set
435# CONFIG_TIFM_CORE is not set
436
437#
438# ATA/ATAPI/MFM/RLL support
439#
440# CONFIG_IDE is not set
441
442#
443# SCSI device support
444#
445# CONFIG_RAID_ATTRS is not set
446# CONFIG_SCSI is not set
447# CONFIG_SCSI_NETLINK is not set
448
449#
450# Serial ATA (prod) and Parallel ATA (experimental) drivers
451#
452# CONFIG_ATA is not set
453
454#
455# Multi-device support (RAID and LVM)
456#
457# CONFIG_MD is not set
458
459#
460# Fusion MPT device support
461#
462# CONFIG_FUSION is not set
463
464#
465# IEEE 1394 (FireWire) support
466#
467# CONFIG_IEEE1394 is not set
468
469#
470# I2O device support
471#
472# CONFIG_I2O is not set
473
474#
475# Macintosh device drivers
476#
477# CONFIG_MAC_EMUMOUSEBTN is not set
478# CONFIG_WINDFARM is not set
479
480#
481# Network device support
482#
483CONFIG_NETDEVICES=y
484# CONFIG_DUMMY is not set
485# CONFIG_BONDING is not set
486# CONFIG_EQUALIZER is not set
487# CONFIG_TUN is not set
488
489#
490# ARCnet devices
491#
492# CONFIG_ARCNET is not set
493
494#
495# PHY device support
496#
497# CONFIG_PHYLIB is not set
498
499#
500# Ethernet (10 or 100Mbit)
501#
502CONFIG_NET_ETHERNET=y
503CONFIG_MII=y
504# CONFIG_HAPPYMEAL is not set
505# CONFIG_SUNGEM is not set
506# CONFIG_CASSINI is not set
507# CONFIG_NET_VENDOR_3COM is not set
508
509#
510# Tulip family network device support
511#
512# CONFIG_NET_TULIP is not set
513# CONFIG_HP100 is not set
514CONFIG_IBM_EMAC=y
515CONFIG_IBM_EMAC_RXB=128
516CONFIG_IBM_EMAC_TXB=128
517CONFIG_IBM_EMAC_POLL_WEIGHT=32
518CONFIG_IBM_EMAC_RX_COPY_THRESHOLD=256
519CONFIG_IBM_EMAC_RX_SKB_HEADROOM=0
520CONFIG_IBM_EMAC_PHY_RX_CLK_FIX=y
521# CONFIG_IBM_EMAC_DEBUG is not set
522CONFIG_IBM_EMAC_ZMII=y
523CONFIG_IBM_EMAC_RGMII=y
524CONFIG_IBM_EMAC_TAH=y
525CONFIG_NET_PCI=y
526# CONFIG_PCNET32 is not set
527# CONFIG_AMD8111_ETH is not set
528# CONFIG_ADAPTEC_STARFIRE is not set
529# CONFIG_B44 is not set
530# CONFIG_FORCEDETH is not set
531# CONFIG_DGRS is not set
532# CONFIG_EEPRO100 is not set
533CONFIG_E100=y
534# CONFIG_FEALNX is not set
535# CONFIG_NATSEMI is not set
536# CONFIG_NE2K_PCI is not set
537# CONFIG_8139CP is not set
538# CONFIG_8139TOO is not set
539# CONFIG_SIS900 is not set
540# CONFIG_EPIC100 is not set
541# CONFIG_SUNDANCE is not set
542# CONFIG_TLAN is not set
543# CONFIG_VIA_RHINE is not set
544# CONFIG_SC92031 is not set
545
546#
547# Ethernet (1000 Mbit)
548#
549# CONFIG_ACENIC is not set
550# CONFIG_DL2K is not set
551# CONFIG_E1000 is not set
552# CONFIG_NS83820 is not set
553# CONFIG_HAMACHI is not set
554# CONFIG_YELLOWFIN is not set
555# CONFIG_R8169 is not set
556# CONFIG_SIS190 is not set
557# CONFIG_SKGE is not set
558# CONFIG_SKY2 is not set
559# CONFIG_SK98LIN is not set
560# CONFIG_VIA_VELOCITY is not set
561# CONFIG_TIGON3 is not set
562# CONFIG_BNX2 is not set
563# CONFIG_QLA3XXX is not set
564# CONFIG_ATL1 is not set
565
566#
567# Ethernet (10000 Mbit)
568#
569# CONFIG_CHELSIO_T1 is not set
570# CONFIG_CHELSIO_T3 is not set
571# CONFIG_IXGB is not set
572# CONFIG_S2IO is not set
573# CONFIG_MYRI10GE is not set
574# CONFIG_NETXEN_NIC is not set
575
576#
577# Token Ring devices
578#
579# CONFIG_TR is not set
580
581#
582# Wireless LAN (non-hamradio)
583#
584# CONFIG_NET_RADIO is not set
585
586#
587# Wan interfaces
588#
589# CONFIG_WAN is not set
590# CONFIG_FDDI is not set
591# CONFIG_HIPPI is not set
592CONFIG_PPP=y
593# CONFIG_PPP_MULTILINK is not set
594# CONFIG_PPP_FILTER is not set
595# CONFIG_PPP_ASYNC is not set
596# CONFIG_PPP_SYNC_TTY is not set
597# CONFIG_PPP_DEFLATE is not set
598# CONFIG_PPP_BSDCOMP is not set
599# CONFIG_PPP_MPPE is not set
600CONFIG_PPPOE=y
601# CONFIG_SLIP is not set
602CONFIG_SLHC=y
603# CONFIG_SHAPER is not set
604# CONFIG_NETCONSOLE is not set
605# CONFIG_NETPOLL is not set
606# CONFIG_NET_POLL_CONTROLLER is not set
607
608#
609# ISDN subsystem
610#
611# CONFIG_ISDN is not set
612
613#
614# Telephony Support
615#
616# CONFIG_PHONE is not set
617
618#
619# Input device support
620#
621# CONFIG_INPUT is not set
622
623#
624# Hardware I/O ports
625#
626CONFIG_SERIO=y
627# CONFIG_SERIO_I8042 is not set
628# CONFIG_SERIO_SERPORT is not set
629# CONFIG_SERIO_PCIPS2 is not set
630# CONFIG_SERIO_LIBPS2 is not set
631# CONFIG_SERIO_RAW is not set
632# CONFIG_GAMEPORT is not set
633
634#
635# Character devices
636#
637# CONFIG_VT is not set
638# CONFIG_SERIAL_NONSTANDARD is not set
639
640#
641# Serial drivers
642#
643CONFIG_SERIAL_8250=y
644CONFIG_SERIAL_8250_CONSOLE=y
645CONFIG_SERIAL_8250_PCI=y
646CONFIG_SERIAL_8250_NR_UARTS=4
647CONFIG_SERIAL_8250_RUNTIME_UARTS=4
648CONFIG_SERIAL_8250_EXTENDED=y
649# CONFIG_SERIAL_8250_MANY_PORTS is not set
650CONFIG_SERIAL_8250_SHARE_IRQ=y
651# CONFIG_SERIAL_8250_DETECT_IRQ is not set
652# CONFIG_SERIAL_8250_RSA is not set
653
654#
655# Non-8250 serial port support
656#
657# CONFIG_SERIAL_UARTLITE is not set
658CONFIG_SERIAL_CORE=y
659CONFIG_SERIAL_CORE_CONSOLE=y
660# CONFIG_SERIAL_JSM is not set
661CONFIG_UNIX98_PTYS=y
662CONFIG_LEGACY_PTYS=y
663CONFIG_LEGACY_PTY_COUNT=256
664
665#
666# IPMI
667#
668# CONFIG_IPMI_HANDLER is not set
669
670#
671# Watchdog Cards
672#
673# CONFIG_WATCHDOG is not set
674CONFIG_HW_RANDOM=m
675# CONFIG_NVRAM is not set
676# CONFIG_GEN_RTC is not set
677# CONFIG_DTLK is not set
678# CONFIG_R3964 is not set
679# CONFIG_APPLICOM is not set
680# CONFIG_AGP is not set
681# CONFIG_DRM is not set
682# CONFIG_RAW_DRIVER is not set
683
684#
685# TPM devices
686#
687# CONFIG_TCG_TPM is not set
688
689#
690# I2C support
691#
692CONFIG_I2C=y
693CONFIG_I2C_CHARDEV=y
694
695#
696# I2C Algorithms
697#
698# CONFIG_I2C_ALGOBIT is not set
699# CONFIG_I2C_ALGOPCF is not set
700# CONFIG_I2C_ALGOPCA is not set
701
702#
703# I2C Hardware Bus support
704#
705# CONFIG_I2C_ALI1535 is not set
706# CONFIG_I2C_ALI1563 is not set
707# CONFIG_I2C_ALI15X3 is not set
708# CONFIG_I2C_AMD756 is not set
709# CONFIG_I2C_AMD8111 is not set
710# CONFIG_I2C_I801 is not set
711# CONFIG_I2C_I810 is not set
712# CONFIG_I2C_PIIX4 is not set
713CONFIG_I2C_IBM_IIC=y
714# CONFIG_I2C_MPC is not set
715# CONFIG_I2C_NFORCE2 is not set
716# CONFIG_I2C_OCORES is not set
717# CONFIG_I2C_PARPORT_LIGHT is not set
718# CONFIG_I2C_PROSAVAGE is not set
719# CONFIG_I2C_SAVAGE4 is not set
720# CONFIG_I2C_SIS5595 is not set
721# CONFIG_I2C_SIS630 is not set
722# CONFIG_I2C_SIS96X is not set
723# CONFIG_I2C_STUB is not set
724# CONFIG_I2C_VIA is not set
725# CONFIG_I2C_VIAPRO is not set
726# CONFIG_I2C_VOODOO3 is not set
727# CONFIG_I2C_PCA_ISA is not set
728
729#
730# Miscellaneous I2C Chip support
731#
732# CONFIG_SENSORS_DS1337 is not set
733# CONFIG_SENSORS_DS1374 is not set
734CONFIG_SENSORS_EEPROM=y
735# CONFIG_SENSORS_PCF8574 is not set
736# CONFIG_SENSORS_PCA9539 is not set
737# CONFIG_SENSORS_PCF8591 is not set
738# CONFIG_SENSORS_M41T00 is not set
739# CONFIG_SENSORS_MAX6875 is not set
740# CONFIG_I2C_DEBUG_CORE is not set
741# CONFIG_I2C_DEBUG_ALGO is not set
742# CONFIG_I2C_DEBUG_BUS is not set
743# CONFIG_I2C_DEBUG_CHIP is not set
744
745#
746# SPI support
747#
748# CONFIG_SPI is not set
749# CONFIG_SPI_MASTER is not set
750
751#
752# Dallas's 1-wire bus
753#
754# CONFIG_W1 is not set
755
756#
757# Hardware Monitoring support
758#
759CONFIG_HWMON=y
760# CONFIG_HWMON_VID is not set
761# CONFIG_SENSORS_ABITUGURU is not set
762# CONFIG_SENSORS_ADM1021 is not set
763# CONFIG_SENSORS_ADM1025 is not set
764# CONFIG_SENSORS_ADM1026 is not set
765# CONFIG_SENSORS_ADM1031 is not set
766# CONFIG_SENSORS_ADM9240 is not set
767# CONFIG_SENSORS_ASB100 is not set
768# CONFIG_SENSORS_ATXP1 is not set
769# CONFIG_SENSORS_DS1621 is not set
770# CONFIG_SENSORS_F71805F is not set
771# CONFIG_SENSORS_FSCHER is not set
772# CONFIG_SENSORS_FSCPOS is not set
773# CONFIG_SENSORS_GL518SM is not set
774# CONFIG_SENSORS_GL520SM is not set
775# CONFIG_SENSORS_IT87 is not set
776# CONFIG_SENSORS_LM63 is not set
777# CONFIG_SENSORS_LM75 is not set
778# CONFIG_SENSORS_LM77 is not set
779# CONFIG_SENSORS_LM78 is not set
780# CONFIG_SENSORS_LM80 is not set
781# CONFIG_SENSORS_LM83 is not set
782# CONFIG_SENSORS_LM85 is not set
783# CONFIG_SENSORS_LM87 is not set
784# CONFIG_SENSORS_LM90 is not set
785# CONFIG_SENSORS_LM92 is not set
786# CONFIG_SENSORS_MAX1619 is not set
787# CONFIG_SENSORS_PC87360 is not set
788# CONFIG_SENSORS_PC87427 is not set
789# CONFIG_SENSORS_SIS5595 is not set
790# CONFIG_SENSORS_SMSC47M1 is not set
791# CONFIG_SENSORS_SMSC47M192 is not set
792# CONFIG_SENSORS_SMSC47B397 is not set
793# CONFIG_SENSORS_VIA686A is not set
794# CONFIG_SENSORS_VT1211 is not set
795# CONFIG_SENSORS_VT8231 is not set
796# CONFIG_SENSORS_W83781D is not set
797# CONFIG_SENSORS_W83791D is not set
798# CONFIG_SENSORS_W83792D is not set
799# CONFIG_SENSORS_W83793 is not set
800# CONFIG_SENSORS_W83L785TS is not set
801# CONFIG_SENSORS_W83627HF is not set
802# CONFIG_SENSORS_W83627EHF is not set
803# CONFIG_HWMON_DEBUG_CHIP is not set
804
805#
806# Multimedia devices
807#
808# CONFIG_VIDEO_DEV is not set
809
810#
811# Digital Video Broadcasting Devices
812#
813# CONFIG_DVB is not set
814
815#
816# Graphics support
817#
818CONFIG_FIRMWARE_EDID=y
819# CONFIG_FB is not set
820# CONFIG_FB_IBM_GXT4500 is not set
821# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
822
823#
824# Sound
825#
826# CONFIG_SOUND is not set
827
828#
829# USB support
830#
831CONFIG_USB_ARCH_HAS_HCD=y
832CONFIG_USB_ARCH_HAS_OHCI=y
833CONFIG_USB_ARCH_HAS_EHCI=y
834# CONFIG_USB is not set
835
836#
837# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
838#
839
840#
841# USB Gadget Support
842#
843# CONFIG_USB_GADGET is not set
844
845#
846# MMC/SD Card support
847#
848# CONFIG_MMC is not set
849
850#
851# LED devices
852#
853# CONFIG_NEW_LEDS is not set
854
855#
856# LED drivers
857#
858
859#
860# LED Triggers
861#
862
863#
864# InfiniBand support
865#
866# CONFIG_INFINIBAND is not set
867
868#
869# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
870#
871
872#
873# Real Time Clock
874#
875# CONFIG_RTC_CLASS is not set
876
877#
878# DMA Engine support
879#
880# CONFIG_DMA_ENGINE is not set
881
882#
883# DMA Clients
884#
885
886#
887# DMA Devices
888#
889
890#
891# Auxiliary Display support
892#
893
894#
895# Virtualization
896#
897
898#
899# File systems
900#
901CONFIG_EXT2_FS=y
902CONFIG_EXT2_FS_XATTR=y
903CONFIG_EXT2_FS_POSIX_ACL=y
904CONFIG_EXT2_FS_SECURITY=y
905CONFIG_EXT2_FS_XIP=y
906CONFIG_FS_XIP=y
907CONFIG_EXT3_FS=y
908CONFIG_EXT3_FS_XATTR=y
909CONFIG_EXT3_FS_POSIX_ACL=y
910CONFIG_EXT3_FS_SECURITY=y
911# CONFIG_EXT4DEV_FS is not set
912CONFIG_JBD=y
913CONFIG_JBD_DEBUG=y
914CONFIG_FS_MBCACHE=y
915# CONFIG_REISERFS_FS is not set
916# CONFIG_JFS_FS is not set
917CONFIG_FS_POSIX_ACL=y
918# CONFIG_XFS_FS is not set
919# CONFIG_GFS2_FS is not set
920# CONFIG_OCFS2_FS is not set
921# CONFIG_MINIX_FS is not set
922# CONFIG_ROMFS_FS is not set
923CONFIG_INOTIFY=y
924CONFIG_INOTIFY_USER=y
925# CONFIG_QUOTA is not set
926CONFIG_DNOTIFY=y
927# CONFIG_AUTOFS_FS is not set
928# CONFIG_AUTOFS4_FS is not set
929# CONFIG_FUSE_FS is not set
930
931#
932# CD-ROM/DVD Filesystems
933#
934# CONFIG_ISO9660_FS is not set
935# CONFIG_UDF_FS is not set
936
937#
938# DOS/FAT/NT Filesystems
939#
940# CONFIG_MSDOS_FS is not set
941# CONFIG_VFAT_FS is not set
942# CONFIG_NTFS_FS is not set
943
944#
945# Pseudo filesystems
946#
947CONFIG_PROC_FS=y
948CONFIG_PROC_KCORE=y
949CONFIG_PROC_SYSCTL=y
950CONFIG_SYSFS=y
951CONFIG_TMPFS=y
952# CONFIG_TMPFS_POSIX_ACL is not set
953# CONFIG_HUGETLB_PAGE is not set
954CONFIG_RAMFS=y
955# CONFIG_CONFIGFS_FS is not set
956
957#
958# Miscellaneous filesystems
959#
960# CONFIG_ADFS_FS is not set
961# CONFIG_AFFS_FS is not set
962# CONFIG_HFS_FS is not set
963# CONFIG_HFSPLUS_FS is not set
964# CONFIG_BEFS_FS is not set
965# CONFIG_BFS_FS is not set
966# CONFIG_EFS_FS is not set
967CONFIG_JFFS2_FS=y
968CONFIG_JFFS2_FS_DEBUG=0
969CONFIG_JFFS2_FS_WRITEBUFFER=y
970CONFIG_JFFS2_SUMMARY=y
971# CONFIG_JFFS2_FS_XATTR is not set
972# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
973CONFIG_JFFS2_ZLIB=y
974CONFIG_JFFS2_RTIME=y
975# CONFIG_JFFS2_RUBIN is not set
976# CONFIG_CRAMFS is not set
977# CONFIG_VXFS_FS is not set
978# CONFIG_HPFS_FS is not set
979# CONFIG_QNX4FS_FS is not set
980# CONFIG_SYSV_FS is not set
981# CONFIG_UFS_FS is not set
982
983#
984# Network File Systems
985#
986CONFIG_NFS_FS=y
987# CONFIG_NFS_V3 is not set
988# CONFIG_NFS_V4 is not set
989# CONFIG_NFS_DIRECTIO is not set
990# CONFIG_NFSD is not set
991CONFIG_ROOT_NFS=y
992CONFIG_LOCKD=y
993CONFIG_NFS_COMMON=y
994CONFIG_SUNRPC=y
995# CONFIG_RPCSEC_GSS_KRB5 is not set
996# CONFIG_RPCSEC_GSS_SPKM3 is not set
997# CONFIG_SMB_FS is not set
998# CONFIG_CIFS is not set
999# CONFIG_NCP_FS is not set
1000# CONFIG_CODA_FS is not set
1001# CONFIG_AFS_FS is not set
1002# CONFIG_9P_FS is not set
1003
1004#
1005# Partition Types
1006#
1007# CONFIG_PARTITION_ADVANCED is not set
1008CONFIG_MSDOS_PARTITION=y
1009
1010#
1011# Native Language Support
1012#
1013# CONFIG_NLS is not set
1014
1015#
1016# Distributed Lock Manager
1017#
1018# CONFIG_DLM is not set
1019
1020#
1021# Library routines
1022#
1023CONFIG_BITREVERSE=y
1024# CONFIG_CRC_CCITT is not set
1025# CONFIG_CRC16 is not set
1026CONFIG_CRC32=y
1027# CONFIG_LIBCRC32C is not set
1028CONFIG_ZLIB_INFLATE=y
1029CONFIG_ZLIB_DEFLATE=y
1030CONFIG_PLIST=y
1031CONFIG_HAS_IOMEM=y
1032CONFIG_HAS_IOPORT=y
1033# CONFIG_PROFILING is not set
1034
1035#
1036# Kernel hacking
1037#
1038# CONFIG_PRINTK_TIME is not set
1039CONFIG_ENABLE_MUST_CHECK=y
1040# CONFIG_MAGIC_SYSRQ is not set
1041# CONFIG_UNUSED_SYMBOLS is not set
1042CONFIG_DEBUG_FS=y
1043# CONFIG_HEADERS_CHECK is not set
1044CONFIG_DEBUG_KERNEL=y
1045CONFIG_LOG_BUF_SHIFT=14
1046CONFIG_DETECT_SOFTLOCKUP=y
1047# CONFIG_SCHEDSTATS is not set
1048# CONFIG_DEBUG_SLAB is not set
1049# CONFIG_DEBUG_RT_MUTEXES is not set
1050# CONFIG_RT_MUTEX_TESTER is not set
1051# CONFIG_DEBUG_SPINLOCK is not set
1052CONFIG_DEBUG_MUTEXES=y
1053# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1054# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1055# CONFIG_DEBUG_KOBJECT is not set
1056# CONFIG_DEBUG_BUGVERBOSE is not set
1057CONFIG_DEBUG_INFO=y
1058# CONFIG_DEBUG_VM is not set
1059# CONFIG_DEBUG_LIST is not set
1060CONFIG_FORCED_INLINING=y
1061# CONFIG_RCU_TORTURE_TEST is not set
1062# CONFIG_KGDB is not set
1063# CONFIG_XMON is not set
1064CONFIG_BDI_SWITCH=y
1065# CONFIG_SERIAL_TEXT_DEBUG is not set
1066CONFIG_PPC_OCP=y
1067
1068#
1069# Security options
1070#
1071# CONFIG_KEYS is not set
1072# CONFIG_SECURITY is not set
1073
1074#
1075# Cryptographic options
1076#
1077# CONFIG_CRYPTO is not set
diff --git a/arch/ppc/configs/walnut_defconfig b/arch/ppc/configs/walnut_defconfig
deleted file mode 100644
index bf9721a7a818..000000000000
--- a/arch/ppc/configs/walnut_defconfig
+++ /dev/null
@@ -1,578 +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
30# CONFIG_IKCONFIG is not set
31CONFIG_EMBEDDED=y
32# CONFIG_KALLSYMS is not set
33CONFIG_FUTEX=y
34# CONFIG_EPOLL is not set
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
46# CONFIG_MODULE_FORCE_UNLOAD is not set
47CONFIG_OBSOLETE_MODPARM=y
48# CONFIG_MODVERSIONS is not set
49CONFIG_KMOD=y
50
51#
52# Processor
53#
54# CONFIG_6xx is not set
55CONFIG_40x=y
56# CONFIG_44x is not set
57# CONFIG_POWER3 is not set
58# CONFIG_POWER4 is not set
59# CONFIG_8xx is not set
60# CONFIG_MATH_EMULATION is not set
61# CONFIG_CPU_FREQ is not set
62CONFIG_4xx=y
63
64#
65# IBM 4xx options
66#
67# CONFIG_ASH is not set
68# CONFIG_BUBINGA is not set
69# CONFIG_CPCI405 is not set
70# CONFIG_EP405 is not set
71# CONFIG_OAK is not set
72# CONFIG_REDWOOD_5 is not set
73# CONFIG_REDWOOD_6 is not set
74# CONFIG_SYCAMORE is not set
75CONFIG_WALNUT=y
76CONFIG_IBM405_ERR77=y
77CONFIG_IBM405_ERR51=y
78CONFIG_IBM_OCP=y
79CONFIG_BIOS_FIXUP=y
80CONFIG_405GP=y
81CONFIG_IBM_OPENBIOS=y
82# CONFIG_PM is not set
83CONFIG_UART0_TTYS0=y
84# CONFIG_UART0_TTYS1 is not set
85CONFIG_NOT_COHERENT_CACHE=y
86
87#
88# Platform options
89#
90# CONFIG_PC_KEYBOARD is not set
91# CONFIG_SMP is not set
92# CONFIG_PREEMPT is not set
93# CONFIG_HIGHMEM is not set
94CONFIG_KERNEL_ELF=y
95CONFIG_BINFMT_ELF=y
96# CONFIG_BINFMT_MISC is not set
97CONFIG_CMDLINE_BOOL=y
98CONFIG_CMDLINE="ip=on"
99
100#
101# Bus options
102#
103CONFIG_PCI=y
104CONFIG_PCI_DOMAINS=y
105CONFIG_PCI_LEGACY_PROC=y
106# CONFIG_PCI_NAMES is not set
107
108#
109# Advanced setup
110#
111# CONFIG_ADVANCED_OPTIONS is not set
112
113#
114# Default settings for advanced configuration options are used
115#
116CONFIG_HIGHMEM_START=0xfe000000
117CONFIG_LOWMEM_SIZE=0x30000000
118CONFIG_KERNEL_START=0xc0000000
119CONFIG_TASK_SIZE=0x80000000
120CONFIG_BOOT_LOAD=0x00400000
121
122#
123# Device Drivers
124#
125
126#
127# Generic Driver Options
128#
129
130#
131# Memory Technology Devices (MTD)
132#
133# CONFIG_MTD is not set
134
135#
136# Parallel port support
137#
138# CONFIG_PARPORT is not set
139
140#
141# Plug and Play support
142#
143
144#
145# Block devices
146#
147# CONFIG_BLK_DEV_FD is not set
148# CONFIG_BLK_CPQ_DA is not set
149# CONFIG_BLK_CPQ_CISS_DA is not set
150# CONFIG_BLK_DEV_DAC960 is not set
151# CONFIG_BLK_DEV_UMEM is not set
152CONFIG_BLK_DEV_LOOP=y
153# CONFIG_BLK_DEV_CRYPTOLOOP is not set
154# CONFIG_BLK_DEV_NBD is not set
155# CONFIG_BLK_DEV_CARMEL is not set
156CONFIG_BLK_DEV_RAM=y
157CONFIG_BLK_DEV_RAM_SIZE=4096
158CONFIG_BLK_DEV_INITRD=y
159# CONFIG_LBD is not set
160
161#
162# ATA/ATAPI/MFM/RLL support
163#
164# CONFIG_IDE is not set
165
166#
167# SCSI device support
168#
169# CONFIG_SCSI is not set
170
171#
172# Multi-device support (RAID and LVM)
173#
174# CONFIG_MD is not set
175
176#
177# Fusion MPT device support
178#
179
180#
181# IEEE 1394 (FireWire) support
182#
183# CONFIG_IEEE1394 is not set
184
185#
186# I2O device support
187#
188# CONFIG_I2O is not set
189
190#
191# Macintosh device drivers
192#
193
194#
195# Networking support
196#
197CONFIG_NET=y
198
199#
200# Networking options
201#
202# CONFIG_PACKET is not set
203# CONFIG_NETLINK_DEV is not set
204CONFIG_UNIX=y
205# CONFIG_NET_KEY is not set
206CONFIG_INET=y
207CONFIG_IP_MULTICAST=y
208# CONFIG_IP_ADVANCED_ROUTER is not set
209CONFIG_IP_PNP=y
210# CONFIG_IP_PNP_DHCP is not set
211CONFIG_IP_PNP_BOOTP=y
212# CONFIG_IP_PNP_RARP is not set
213# CONFIG_NET_IPIP is not set
214# CONFIG_NET_IPGRE is not set
215# CONFIG_IP_MROUTE is not set
216# CONFIG_ARPD is not set
217CONFIG_SYN_COOKIES=y
218# CONFIG_INET_AH is not set
219# CONFIG_INET_ESP is not set
220# CONFIG_INET_IPCOMP is not set
221# CONFIG_IPV6 is not set
222# CONFIG_NETFILTER is not set
223
224#
225# SCTP Configuration (EXPERIMENTAL)
226#
227# CONFIG_IP_SCTP is not set
228# CONFIG_ATM is not set
229# CONFIG_BRIDGE is not set
230# CONFIG_VLAN_8021Q is not set
231# CONFIG_DECNET is not set
232# CONFIG_LLC2 is not set
233# CONFIG_IPX is not set
234# CONFIG_ATALK is not set
235# CONFIG_X25 is not set
236# CONFIG_LAPB is not set
237# CONFIG_NET_DIVERT is not set
238# CONFIG_ECONET is not set
239# CONFIG_WAN_ROUTER is not set
240# CONFIG_NET_HW_FLOWCONTROL is not set
241
242#
243# QoS and/or fair queueing
244#
245# CONFIG_NET_SCHED is not set
246
247#
248# Network testing
249#
250# CONFIG_NET_PKTGEN is not set
251# CONFIG_NETPOLL is not set
252# CONFIG_NET_POLL_CONTROLLER is not set
253# CONFIG_HAMRADIO is not set
254# CONFIG_IRDA is not set
255# CONFIG_BT is not set
256CONFIG_NETDEVICES=y
257# CONFIG_DUMMY is not set
258# CONFIG_BONDING is not set
259# CONFIG_EQUALIZER is not set
260# CONFIG_TUN is not set
261
262#
263# ARCnet devices
264#
265# CONFIG_ARCNET is not set
266
267#
268# Ethernet (10 or 100Mbit)
269#
270CONFIG_NET_ETHERNET=y
271CONFIG_MII=y
272# CONFIG_OAKNET is not set
273# CONFIG_HAPPYMEAL is not set
274# CONFIG_SUNGEM is not set
275# CONFIG_NET_VENDOR_3COM is not set
276
277#
278# Tulip family network device support
279#
280# CONFIG_NET_TULIP is not set
281# CONFIG_HP100 is not set
282# CONFIG_NET_PCI is not set
283
284#
285# Ethernet (1000 Mbit)
286#
287# CONFIG_ACENIC is not set
288# CONFIG_DL2K is not set
289# CONFIG_E1000 is not set
290# CONFIG_NS83820 is not set
291# CONFIG_HAMACHI is not set
292# CONFIG_YELLOWFIN is not set
293# CONFIG_R8169 is not set
294# CONFIG_SK98LIN is not set
295# CONFIG_TIGON3 is not set
296
297#
298# Ethernet (10000 Mbit)
299#
300# CONFIG_IXGB is not set
301# CONFIG_S2IO is not set
302
303#
304# Token Ring devices
305#
306# CONFIG_TR is not set
307
308#
309# Wireless LAN (non-hamradio)
310#
311# CONFIG_NET_RADIO is not set
312
313#
314# Wan interfaces
315#
316# CONFIG_WAN is not set
317# CONFIG_FDDI is not set
318# CONFIG_HIPPI is not set
319# CONFIG_PPP is not set
320# CONFIG_SLIP is not set
321# CONFIG_RCPCI is not set
322# CONFIG_SHAPER is not set
323# CONFIG_NETCONSOLE is not set
324
325#
326# ISDN subsystem
327#
328# CONFIG_ISDN is not set
329
330#
331# Telephony Support
332#
333# CONFIG_PHONE is not set
334
335#
336# Input device support
337#
338CONFIG_INPUT=y
339
340#
341# Userland interfaces
342#
343# CONFIG_INPUT_MOUSEDEV is not set
344# CONFIG_INPUT_JOYDEV is not set
345# CONFIG_INPUT_TSDEV is not set
346# CONFIG_INPUT_EVDEV is not set
347# CONFIG_INPUT_EVBUG is not set
348
349#
350# Input I/O drivers
351#
352# CONFIG_GAMEPORT is not set
353CONFIG_SOUND_GAMEPORT=y
354CONFIG_SERIO=y
355# CONFIG_SERIO_I8042 is not set
356# CONFIG_SERIO_SERPORT is not set
357# CONFIG_SERIO_CT82C710 is not set
358# CONFIG_SERIO_PCIPS2 is not set
359
360#
361# Input Device Drivers
362#
363# CONFIG_INPUT_KEYBOARD is not set
364# CONFIG_INPUT_MOUSE is not set
365# CONFIG_INPUT_JOYSTICK is not set
366# CONFIG_INPUT_TOUCHSCREEN is not set
367# CONFIG_INPUT_MISC is not set
368
369#
370# Character devices
371#
372# CONFIG_VT is not set
373# CONFIG_SERIAL_NONSTANDARD is not set
374
375#
376# Serial drivers
377#
378CONFIG_SERIAL_8250=y
379CONFIG_SERIAL_8250_CONSOLE=y
380CONFIG_SERIAL_8250_NR_UARTS=4
381# CONFIG_SERIAL_8250_EXTENDED is not set
382
383#
384# Non-8250 serial port support
385#
386CONFIG_SERIAL_CORE=y
387CONFIG_SERIAL_CORE_CONSOLE=y
388CONFIG_UNIX98_PTYS=y
389CONFIG_LEGACY_PTYS=y
390CONFIG_LEGACY_PTY_COUNT=256
391# CONFIG_QIC02_TAPE is not set
392
393#
394# IPMI
395#
396# CONFIG_IPMI_HANDLER is not set
397
398#
399# Watchdog Cards
400#
401# CONFIG_WATCHDOG is not set
402# CONFIG_NVRAM is not set
403# CONFIG_GEN_RTC is not set
404# CONFIG_DTLK is not set
405# CONFIG_R3964 is not set
406# CONFIG_APPLICOM is not set
407
408#
409# Ftape, the floppy tape device driver
410#
411# CONFIG_FTAPE is not set
412# CONFIG_AGP is not set
413# CONFIG_DRM is not set
414# CONFIG_RAW_DRIVER is not set
415
416#
417# I2C support
418#
419# CONFIG_I2C is not set
420
421#
422# Misc devices
423#
424
425#
426# Multimedia devices
427#
428# CONFIG_VIDEO_DEV is not set
429
430#
431# Digital Video Broadcasting Devices
432#
433# CONFIG_DVB is not set
434
435#
436# Graphics support
437#
438# CONFIG_FB is not set
439
440#
441# Sound
442#
443# CONFIG_SOUND is not set
444
445#
446# USB support
447#
448# CONFIG_USB is not set
449
450#
451# USB Gadget Support
452#
453# CONFIG_USB_GADGET is not set
454
455#
456# File systems
457#
458CONFIG_EXT2_FS=y
459# CONFIG_EXT2_FS_XATTR is not set
460# CONFIG_EXT3_FS is not set
461# CONFIG_JBD is not set
462# CONFIG_REISERFS_FS is not set
463# CONFIG_JFS_FS is not set
464# CONFIG_XFS_FS is not set
465# CONFIG_MINIX_FS is not set
466# CONFIG_ROMFS_FS is not set
467# CONFIG_QUOTA is not set
468# CONFIG_AUTOFS_FS is not set
469# CONFIG_AUTOFS4_FS is not set
470
471#
472# CD-ROM/DVD Filesystems
473#
474# CONFIG_ISO9660_FS is not set
475# CONFIG_UDF_FS is not set
476
477#
478# DOS/FAT/NT Filesystems
479#
480# CONFIG_FAT_FS is not set
481# CONFIG_NTFS_FS is not set
482
483#
484# Pseudo filesystems
485#
486CONFIG_PROC_FS=y
487CONFIG_PROC_KCORE=y
488CONFIG_SYSFS=y
489# CONFIG_DEVFS_FS is not set
490# CONFIG_DEVPTS_FS_XATTR is not set
491CONFIG_TMPFS=y
492# CONFIG_HUGETLB_PAGE is not set
493CONFIG_RAMFS=y
494
495#
496# Miscellaneous filesystems
497#
498# CONFIG_ADFS_FS is not set
499# CONFIG_AFFS_FS is not set
500# CONFIG_HFS_FS is not set
501# CONFIG_HFSPLUS_FS is not set
502# CONFIG_BEFS_FS is not set
503# CONFIG_BFS_FS is not set
504# CONFIG_EFS_FS is not set
505# CONFIG_CRAMFS is not set
506# CONFIG_VXFS_FS is not set
507# CONFIG_HPFS_FS is not set
508# CONFIG_QNX4FS_FS is not set
509# CONFIG_SYSV_FS is not set
510# CONFIG_UFS_FS is not set
511
512#
513# Network File Systems
514#
515CONFIG_NFS_FS=y
516# CONFIG_NFS_V3 is not set
517# CONFIG_NFS_V4 is not set
518# CONFIG_NFS_DIRECTIO is not set
519# CONFIG_NFSD is not set
520CONFIG_ROOT_NFS=y
521CONFIG_LOCKD=y
522# CONFIG_EXPORTFS is not set
523CONFIG_SUNRPC=y
524# CONFIG_RPCSEC_GSS_KRB5 is not set
525# CONFIG_SMB_FS is not set
526# CONFIG_CIFS is not set
527# CONFIG_NCP_FS is not set
528# CONFIG_CODA_FS is not set
529# CONFIG_AFS_FS is not set
530
531#
532# Partition Types
533#
534CONFIG_PARTITION_ADVANCED=y
535# CONFIG_ACORN_PARTITION is not set
536# CONFIG_OSF_PARTITION is not set
537# CONFIG_AMIGA_PARTITION is not set
538# CONFIG_ATARI_PARTITION is not set
539# CONFIG_MAC_PARTITION is not set
540# CONFIG_MSDOS_PARTITION is not set
541# CONFIG_LDM_PARTITION is not set
542# CONFIG_NEC98_PARTITION is not set
543# CONFIG_SGI_PARTITION is not set
544# CONFIG_ULTRIX_PARTITION is not set
545# CONFIG_SUN_PARTITION is not set
546# CONFIG_EFI_PARTITION is not set
547
548#
549# Native Language Support
550#
551# CONFIG_NLS is not set
552
553#
554# IBM 40x options
555#
556
557#
558# Library routines
559#
560CONFIG_CRC32=y
561# CONFIG_LIBCRC32C is not set
562
563#
564# Kernel hacking
565#
566# CONFIG_DEBUG_KERNEL is not set
567# CONFIG_SERIAL_TEXT_DEBUG is not set
568CONFIG_PPC_OCP=y
569
570#
571# Security options
572#
573# CONFIG_SECURITY is not set
574
575#
576# Cryptographic options
577#
578# CONFIG_CRYPTO is not set
diff --git a/arch/ppc/kernel/Makefile b/arch/ppc/kernel/Makefile
deleted file mode 100644
index 7b739054968f..000000000000
--- a/arch/ppc/kernel/Makefile
+++ /dev/null
@@ -1,21 +0,0 @@
1#
2# Makefile for the linux kernel.
3#
4extra-$(CONFIG_PPC_STD_MMU) := head.o
5extra-$(CONFIG_40x) := head_4xx.o
6extra-$(CONFIG_44x) := head_44x.o
7extra-$(CONFIG_8xx) := head_8xx.o
8extra-y += vmlinux.lds
9
10obj-y := entry.o traps.o time.o misc.o \
11 setup.o \
12 ppc_htab.o
13obj-$(CONFIG_MODULES) += ppc_ksyms.o
14obj-$(CONFIG_PCI) += pci.o
15obj-$(CONFIG_KGDB) += ppc-stub.o
16obj-$(CONFIG_SMP) += smp.o smp-tbsync.o
17obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o
18
19ifndef CONFIG_MATH_EMULATION
20obj-$(CONFIG_8xx) += softemu8xx.o
21endif
diff --git a/arch/ppc/kernel/asm-offsets.c b/arch/ppc/kernel/asm-offsets.c
deleted file mode 100644
index 8dcbdd6c2d2c..000000000000
--- a/arch/ppc/kernel/asm-offsets.c
+++ /dev/null
@@ -1,164 +0,0 @@
1/*
2 * This program is used to generate definitions needed by
3 * assembly language modules.
4 *
5 * We use the technique used in the OSF Mach kernel code:
6 * generate asm statements containing #defines,
7 * compile this file to assembler, and then extract the
8 * #defines from the assembly-language output.
9 */
10
11#include <linux/signal.h>
12#include <linux/sched.h>
13#include <linux/kernel.h>
14#include <linux/errno.h>
15#include <linux/string.h>
16#include <linux/types.h>
17#include <linux/ptrace.h>
18#include <linux/suspend.h>
19#include <linux/mman.h>
20#include <linux/mm.h>
21#include <linux/kbuild.h>
22
23#include <asm/io.h>
24#include <asm/page.h>
25#include <asm/pgtable.h>
26#include <asm/processor.h>
27#include <asm/cputable.h>
28#include <asm/thread_info.h>
29#include <asm/vdso_datapage.h>
30
31int
32main(void)
33{
34 DEFINE(THREAD, offsetof(struct task_struct, thread));
35 DEFINE(THREAD_INFO, offsetof(struct task_struct, stack));
36 DEFINE(MM, offsetof(struct task_struct, mm));
37 DEFINE(PTRACE, offsetof(struct task_struct, ptrace));
38 DEFINE(KSP, offsetof(struct thread_struct, ksp));
39 DEFINE(PGDIR, offsetof(struct thread_struct, pgdir));
40 DEFINE(PT_REGS, offsetof(struct thread_struct, regs));
41 DEFINE(THREAD_FPEXC_MODE, offsetof(struct thread_struct, fpexc_mode));
42 DEFINE(THREAD_FPR0, offsetof(struct thread_struct, fpr[0]));
43 DEFINE(THREAD_FPSCR, offsetof(struct thread_struct, fpscr));
44#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE)
45 DEFINE(THREAD_DBCR0, offsetof(struct thread_struct, dbcr0));
46 DEFINE(PT_PTRACED, PT_PTRACED);
47#endif
48#ifdef CONFIG_ALTIVEC
49 DEFINE(THREAD_VR0, offsetof(struct thread_struct, vr[0]));
50 DEFINE(THREAD_VRSAVE, offsetof(struct thread_struct, vrsave));
51 DEFINE(THREAD_VSCR, offsetof(struct thread_struct, vscr));
52 DEFINE(THREAD_USED_VR, offsetof(struct thread_struct, used_vr));
53#endif /* CONFIG_ALTIVEC */
54 /* Interrupt register frame */
55 DEFINE(STACK_FRAME_OVERHEAD, STACK_FRAME_OVERHEAD);
56 DEFINE(INT_FRAME_SIZE, STACK_FRAME_OVERHEAD + sizeof(struct pt_regs));
57 /* in fact we only use gpr0 - gpr9 and gpr20 - gpr23 */
58 DEFINE(GPR0, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[0]));
59 DEFINE(GPR1, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[1]));
60 DEFINE(GPR2, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[2]));
61 DEFINE(GPR3, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[3]));
62 DEFINE(GPR4, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[4]));
63 DEFINE(GPR5, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[5]));
64 DEFINE(GPR6, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[6]));
65 DEFINE(GPR7, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[7]));
66 DEFINE(GPR8, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[8]));
67 DEFINE(GPR9, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[9]));
68 DEFINE(GPR10, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[10]));
69 DEFINE(GPR11, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[11]));
70 DEFINE(GPR12, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[12]));
71 DEFINE(GPR13, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[13]));
72 DEFINE(GPR14, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[14]));
73 DEFINE(GPR15, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[15]));
74 DEFINE(GPR16, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[16]));
75 DEFINE(GPR17, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[17]));
76 DEFINE(GPR18, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[18]));
77 DEFINE(GPR19, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[19]));
78 DEFINE(GPR20, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[20]));
79 DEFINE(GPR21, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[21]));
80 DEFINE(GPR22, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[22]));
81 DEFINE(GPR23, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[23]));
82 DEFINE(GPR24, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[24]));
83 DEFINE(GPR25, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[25]));
84 DEFINE(GPR26, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[26]));
85 DEFINE(GPR27, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[27]));
86 DEFINE(GPR28, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[28]));
87 DEFINE(GPR29, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[29]));
88 DEFINE(GPR30, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[30]));
89 DEFINE(GPR31, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[31]));
90 /* Note: these symbols include _ because they overlap with special
91 * register names
92 */
93 DEFINE(_NIP, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, nip));
94 DEFINE(_MSR, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, msr));
95 DEFINE(_CTR, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, ctr));
96 DEFINE(_LINK, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, link));
97 DEFINE(_CCR, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, ccr));
98 DEFINE(_MQ, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, mq));
99 DEFINE(_XER, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, xer));
100 DEFINE(_DAR, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, dar));
101 DEFINE(_DSISR, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, dsisr));
102 /* The PowerPC 400-class & Book-E processors have neither the DAR nor the DSISR
103 * SPRs. Hence, we overload them to hold the similar DEAR and ESR SPRs
104 * for such processors. For critical interrupts we use them to
105 * hold SRR0 and SRR1.
106 */
107 DEFINE(_DEAR, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, dar));
108 DEFINE(_ESR, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, dsisr));
109 DEFINE(ORIG_GPR3, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, orig_gpr3));
110 DEFINE(RESULT, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, result));
111 DEFINE(TRAP, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, trap));
112 DEFINE(CLONE_VM, CLONE_VM);
113 DEFINE(CLONE_UNTRACED, CLONE_UNTRACED);
114 DEFINE(MM_PGD, offsetof(struct mm_struct, pgd));
115
116 /* About the CPU features table */
117 DEFINE(CPU_SPEC_ENTRY_SIZE, sizeof(struct cpu_spec));
118 DEFINE(CPU_SPEC_PVR_MASK, offsetof(struct cpu_spec, pvr_mask));
119 DEFINE(CPU_SPEC_PVR_VALUE, offsetof(struct cpu_spec, pvr_value));
120 DEFINE(CPU_SPEC_FEATURES, offsetof(struct cpu_spec, cpu_features));
121 DEFINE(CPU_SPEC_SETUP, offsetof(struct cpu_spec, cpu_setup));
122
123 DEFINE(TI_TASK, offsetof(struct thread_info, task));
124 DEFINE(TI_EXECDOMAIN, offsetof(struct thread_info, exec_domain));
125 DEFINE(TI_FLAGS, offsetof(struct thread_info, flags));
126 DEFINE(TI_LOCAL_FLAGS, offsetof(struct thread_info, local_flags));
127 DEFINE(TI_CPU, offsetof(struct thread_info, cpu));
128 DEFINE(TI_PREEMPT, offsetof(struct thread_info, preempt_count));
129
130 DEFINE(pbe_address, offsetof(struct pbe, address));
131 DEFINE(pbe_orig_address, offsetof(struct pbe, orig_address));
132 DEFINE(pbe_next, offsetof(struct pbe, next));
133
134 DEFINE(TASK_SIZE, TASK_SIZE);
135 DEFINE(NUM_USER_SEGMENTS, TASK_SIZE>>28);
136
137 /* datapage offsets for use by vdso */
138 DEFINE(CFG_TB_ORIG_STAMP, offsetof(struct vdso_data, tb_orig_stamp));
139 DEFINE(CFG_TB_TICKS_PER_SEC, offsetof(struct vdso_data, tb_ticks_per_sec));
140 DEFINE(CFG_TB_TO_XS, offsetof(struct vdso_data, tb_to_xs));
141 DEFINE(CFG_STAMP_XSEC, offsetof(struct vdso_data, stamp_xsec));
142 DEFINE(CFG_TB_UPDATE_COUNT, offsetof(struct vdso_data, tb_update_count));
143 DEFINE(CFG_TZ_MINUTEWEST, offsetof(struct vdso_data, tz_minuteswest));
144 DEFINE(CFG_TZ_DSTTIME, offsetof(struct vdso_data, tz_dsttime));
145 DEFINE(CFG_SYSCALL_MAP32, offsetof(struct vdso_data, syscall_map_32));
146 DEFINE(WTOM_CLOCK_SEC, offsetof(struct vdso_data, wtom_clock_sec));
147 DEFINE(WTOM_CLOCK_NSEC, offsetof(struct vdso_data, wtom_clock_nsec));
148 DEFINE(TVAL32_TV_SEC, offsetof(struct timeval, tv_sec));
149 DEFINE(TVAL32_TV_USEC, offsetof(struct timeval, tv_usec));
150 DEFINE(TSPEC32_TV_SEC, offsetof(struct timespec, tv_sec));
151 DEFINE(TSPEC32_TV_NSEC, offsetof(struct timespec, tv_nsec));
152
153 /* timeval/timezone offsets for use by vdso */
154 DEFINE(TZONE_TZ_MINWEST, offsetof(struct timezone, tz_minuteswest));
155 DEFINE(TZONE_TZ_DSTTIME, offsetof(struct timezone, tz_dsttime));
156
157 /* Other bits used by the vdso */
158 DEFINE(CLOCK_REALTIME, CLOCK_REALTIME);
159 DEFINE(CLOCK_MONOTONIC, CLOCK_MONOTONIC);
160 DEFINE(NSEC_PER_SEC, NSEC_PER_SEC);
161 DEFINE(CLOCK_REALTIME_RES, TICK_NSEC);
162
163 return 0;
164}
diff --git a/arch/ppc/kernel/cpu_setup_power4.S b/arch/ppc/kernel/cpu_setup_power4.S
deleted file mode 100644
index 6a674e834eeb..000000000000
--- a/arch/ppc/kernel/cpu_setup_power4.S
+++ /dev/null
@@ -1,197 +0,0 @@
1/*
2 * This file contains low level CPU setup functions.
3 * Copyright (C) 2003 Benjamin Herrenschmidt (benh@kernel.crashing.org)
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version
8 * 2 of the License, or (at your option) any later version.
9 *
10 */
11
12#include <asm/processor.h>
13#include <asm/page.h>
14#include <asm/ppc_asm.h>
15#include <asm/cputable.h>
16#include <asm/asm-offsets.h>
17#include <asm/cache.h>
18
19_GLOBAL(__970_cpu_preinit)
20 /*
21 * Deal only with PPC970 and PPC970FX.
22 */
23 mfspr r0,SPRN_PVR
24 srwi r0,r0,16
25 cmpwi cr0,r0,0x39
26 cmpwi cr1,r0,0x3c
27 cror 4*cr0+eq,4*cr0+eq,4*cr1+eq
28 bnelr
29
30 /* Make sure HID4:rm_ci is off before MMU is turned off, that large
31 * pages are enabled with HID4:61 and clear HID5:DCBZ_size and
32 * HID5:DCBZ32_ill
33 */
34 li r0,0
35 mfspr r11,SPRN_HID4
36 rldimi r11,r0,40,23 /* clear bit 23 (rm_ci) */
37 rldimi r11,r0,2,61 /* clear bit 61 (lg_pg_en) */
38 sync
39 mtspr SPRN_HID4,r11
40 isync
41 sync
42 mfspr r11,SPRN_HID5
43 rldimi r11,r0,6,56 /* clear bits 56 & 57 (DCBZ*) */
44 sync
45 mtspr SPRN_HID5,r11
46 isync
47 sync
48
49 /* Setup some basic HID1 features */
50 mfspr r0,SPRN_HID1
51 li r11,0x1200 /* enable i-fetch cacheability */
52 sldi r11,r11,44 /* and prefetch */
53 or r0,r0,r11
54 mtspr SPRN_HID1,r0
55 mtspr SPRN_HID1,r0
56 isync
57
58 /* Clear HIOR */
59 li r0,0
60 sync
61 mtspr SPRN_HIOR,0 /* Clear interrupt prefix */
62 isync
63 blr
64
65_GLOBAL(__setup_cpu_ppc970)
66 mfspr r0,SPRN_HID0
67 li r11,5 /* clear DOZE and SLEEP */
68 rldimi r0,r11,52,8 /* set NAP and DPM */
69 mtspr SPRN_HID0,r0
70 mfspr r0,SPRN_HID0
71 mfspr r0,SPRN_HID0
72 mfspr r0,SPRN_HID0
73 mfspr r0,SPRN_HID0
74 mfspr r0,SPRN_HID0
75 mfspr r0,SPRN_HID0
76 sync
77 isync
78 blr
79
80/* Definitions for the table use to save CPU states */
81#define CS_HID0 0
82#define CS_HID1 8
83#define CS_HID4 16
84#define CS_HID5 24
85#define CS_SIZE 32
86
87 .data
88 .balign L1_CACHE_BYTES
89cpu_state_storage:
90 .space CS_SIZE
91 .balign L1_CACHE_BYTES,0
92 .text
93
94/* Called in normal context to backup CPU 0 state. This
95 * does not include cache settings. This function is also
96 * called for machine sleep. This does not include the MMU
97 * setup, BATs, etc... but rather the "special" registers
98 * like HID0, HID1, HID4, etc...
99 */
100_GLOBAL(__save_cpu_setup)
101 /* Some CR fields are volatile, we back it up all */
102 mfcr r7
103
104 /* Get storage ptr */
105 lis r5,cpu_state_storage@h
106 ori r5,r5,cpu_state_storage@l
107
108 /* We only deal with 970 for now */
109 mfspr r0,SPRN_PVR
110 srwi r0,r0,16
111 cmpwi cr0,r0,0x39
112 cmpwi cr1,r0,0x3c
113 cror 4*cr0+eq,4*cr0+eq,4*cr1+eq
114 bne 1f
115
116 /* Save HID0,1,4 and 5 */
117 mfspr r3,SPRN_HID0
118 std r3,CS_HID0(r5)
119 mfspr r3,SPRN_HID1
120 std r3,CS_HID1(r5)
121 mfspr r3,SPRN_HID4
122 std r3,CS_HID4(r5)
123 mfspr r3,SPRN_HID5
124 std r3,CS_HID5(r5)
125
1261:
127 mtcr r7
128 blr
129
130/* Called with no MMU context (typically MSR:IR/DR off) to
131 * restore CPU state as backed up by the previous
132 * function. This does not include cache setting
133 */
134_GLOBAL(__restore_cpu_setup)
135 /* Some CR fields are volatile, we back it up all */
136 mfcr r7
137
138 /* Get storage ptr */
139 lis r5,(cpu_state_storage-KERNELBASE)@h
140 ori r5,r5,cpu_state_storage@l
141
142 /* We only deal with 970 for now */
143 mfspr r0,SPRN_PVR
144 srwi r0,r0,16
145 cmpwi cr0,r0,0x39
146 cmpwi cr1,r0,0x3c
147 cror 4*cr0+eq,4*cr0+eq,4*cr1+eq
148 bne 1f
149
150 /* Clear interrupt prefix */
151 li r0,0
152 sync
153 mtspr SPRN_HIOR,0
154 isync
155
156 /* Restore HID0 */
157 ld r3,CS_HID0(r5)
158 sync
159 isync
160 mtspr SPRN_HID0,r3
161 mfspr r3,SPRN_HID0
162 mfspr r3,SPRN_HID0
163 mfspr r3,SPRN_HID0
164 mfspr r3,SPRN_HID0
165 mfspr r3,SPRN_HID0
166 mfspr r3,SPRN_HID0
167 sync
168 isync
169
170 /* Restore HID1 */
171 ld r3,CS_HID1(r5)
172 sync
173 isync
174 mtspr SPRN_HID1,r3
175 mtspr SPRN_HID1,r3
176 sync
177 isync
178
179 /* Restore HID4 */
180 ld r3,CS_HID4(r5)
181 sync
182 isync
183 mtspr SPRN_HID4,r3
184 sync
185 isync
186
187 /* Restore HID5 */
188 ld r3,CS_HID5(r5)
189 sync
190 isync
191 mtspr SPRN_HID5,r3
192 sync
193 isync
1941:
195 mtcr r7
196 blr
197
diff --git a/arch/ppc/kernel/entry.S b/arch/ppc/kernel/entry.S
deleted file mode 100644
index fcd830a292e2..000000000000
--- a/arch/ppc/kernel/entry.S
+++ /dev/null
@@ -1,960 +0,0 @@
1/*
2 * PowerPC version
3 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
4 * Rewritten by Cort Dougan (cort@fsmlabs.com) for PReP
5 * Copyright (C) 1996 Cort Dougan <cort@fsmlabs.com>
6 * Adapted for Power Macintosh by Paul Mackerras.
7 * Low-level exception handlers and MMU support
8 * rewritten by Paul Mackerras.
9 * Copyright (C) 1996 Paul Mackerras.
10 * MPC8xx modifications Copyright (C) 1997 Dan Malek (dmalek@jlc.net).
11 *
12 * This file contains the system call entry code, context switch
13 * code, and exception/interrupt return code for PowerPC.
14 *
15 * This program is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public License
17 * as published by the Free Software Foundation; either version
18 * 2 of the License, or (at your option) any later version.
19 *
20 */
21
22#include <linux/errno.h>
23#include <linux/sys.h>
24#include <linux/threads.h>
25#include <asm/processor.h>
26#include <asm/page.h>
27#include <asm/mmu.h>
28#include <asm/cputable.h>
29#include <asm/thread_info.h>
30#include <asm/ppc_asm.h>
31#include <asm/asm-offsets.h>
32#include <asm/unistd.h>
33
34#undef SHOW_SYSCALLS
35#undef SHOW_SYSCALLS_TASK
36
37/*
38 * MSR_KERNEL is > 0x10000 on 4xx/Book-E since it include MSR_CE.
39 */
40#if MSR_KERNEL >= 0x10000
41#define LOAD_MSR_KERNEL(r, x) lis r,(x)@h; ori r,r,(x)@l
42#else
43#define LOAD_MSR_KERNEL(r, x) li r,(x)
44#endif
45
46#ifdef CONFIG_BOOKE
47#include "head_booke.h"
48#define TRANSFER_TO_HANDLER_EXC_LEVEL(exc_level) \
49 mtspr exc_level##_SPRG,r8; \
50 BOOKE_LOAD_EXC_LEVEL_STACK(exc_level); \
51 lwz r0,GPR10-INT_FRAME_SIZE(r8); \
52 stw r0,GPR10(r11); \
53 lwz r0,GPR11-INT_FRAME_SIZE(r8); \
54 stw r0,GPR11(r11); \
55 mfspr r8,exc_level##_SPRG
56
57 .globl mcheck_transfer_to_handler
58mcheck_transfer_to_handler:
59 TRANSFER_TO_HANDLER_EXC_LEVEL(MCHECK)
60 b transfer_to_handler_full
61
62 .globl debug_transfer_to_handler
63debug_transfer_to_handler:
64 TRANSFER_TO_HANDLER_EXC_LEVEL(DEBUG)
65 b transfer_to_handler_full
66
67 .globl crit_transfer_to_handler
68crit_transfer_to_handler:
69 TRANSFER_TO_HANDLER_EXC_LEVEL(CRIT)
70 /* fall through */
71#endif
72
73#ifdef CONFIG_40x
74 .globl crit_transfer_to_handler
75crit_transfer_to_handler:
76 lwz r0,crit_r10@l(0)
77 stw r0,GPR10(r11)
78 lwz r0,crit_r11@l(0)
79 stw r0,GPR11(r11)
80 /* fall through */
81#endif
82
83/*
84 * This code finishes saving the registers to the exception frame
85 * and jumps to the appropriate handler for the exception, turning
86 * on address translation.
87 * Note that we rely on the caller having set cr0.eq iff the exception
88 * occurred in kernel mode (i.e. MSR:PR = 0).
89 */
90 .globl transfer_to_handler_full
91transfer_to_handler_full:
92 SAVE_NVGPRS(r11)
93 /* fall through */
94
95 .globl transfer_to_handler
96transfer_to_handler:
97 stw r2,GPR2(r11)
98 stw r12,_NIP(r11)
99 stw r9,_MSR(r11)
100 andi. r2,r9,MSR_PR
101 mfctr r12
102 mfspr r2,SPRN_XER
103 stw r12,_CTR(r11)
104 stw r2,_XER(r11)
105 mfspr r12,SPRN_SPRG3
106 addi r2,r12,-THREAD
107 tovirt(r2,r2) /* set r2 to current */
108 beq 2f /* if from user, fix up THREAD.regs */
109 addi r11,r1,STACK_FRAME_OVERHEAD
110 stw r11,PT_REGS(r12)
111#if defined(CONFIG_40x) || defined(CONFIG_BOOKE)
112 /* Check to see if the dbcr0 register is set up to debug. Use the
113 single-step bit to do this. */
114 lwz r12,THREAD_DBCR0(r12)
115 andis. r12,r12,DBCR0_IC@h
116 beq+ 3f
117 /* From user and task is ptraced - load up global dbcr0 */
118 li r12,-1 /* clear all pending debug events */
119 mtspr SPRN_DBSR,r12
120 lis r11,global_dbcr0@ha
121 tophys(r11,r11)
122 addi r11,r11,global_dbcr0@l
123 lwz r12,0(r11)
124 mtspr SPRN_DBCR0,r12
125 lwz r12,4(r11)
126 addi r12,r12,-1
127 stw r12,4(r11)
128#endif
129 b 3f
130
1312: /* if from kernel, check interrupted DOZE/NAP mode and
132 * check for stack overflow
133 */
134 lwz r9,THREAD_INFO-THREAD(r12)
135 cmplw r1,r9 /* if r1 <= current->thread_info */
136 ble- stack_ovf /* then the kernel stack overflowed */
1375:
138#ifdef CONFIG_6xx
139 tophys(r9,r9) /* check local flags */
140 lwz r12,TI_LOCAL_FLAGS(r9)
141 mtcrf 0x01,r12
142 bt- 31-TLF_NAPPING,4f
143#endif /* CONFIG_6xx */
144 .globl transfer_to_handler_cont
145transfer_to_handler_cont:
1463:
147 mflr r9
148 lwz r11,0(r9) /* virtual address of handler */
149 lwz r9,4(r9) /* where to go when done */
150 mtspr SPRN_SRR0,r11
151 mtspr SPRN_SRR1,r10
152 mtlr r9
153 SYNC
154 RFI /* jump to handler, enable MMU */
155
156#ifdef CONFIG_6xx
1574: rlwinm r12,r12,0,~_TLF_NAPPING
158 stw r12,TI_LOCAL_FLAGS(r9)
159 b power_save_6xx_restore
160#endif
161
162/*
163 * On kernel stack overflow, load up an initial stack pointer
164 * and call StackOverflow(regs), which should not return.
165 */
166stack_ovf:
167 /* sometimes we use a statically-allocated stack, which is OK. */
168 lis r12,_end@h
169 ori r12,r12,_end@l
170 cmplw r1,r12
171 ble 5b /* r1 <= &_end is OK */
172 SAVE_NVGPRS(r11)
173 addi r3,r1,STACK_FRAME_OVERHEAD
174 lis r1,init_thread_union@ha
175 addi r1,r1,init_thread_union@l
176 addi r1,r1,THREAD_SIZE-STACK_FRAME_OVERHEAD
177 lis r9,StackOverflow@ha
178 addi r9,r9,StackOverflow@l
179 LOAD_MSR_KERNEL(r10,MSR_KERNEL)
180 FIX_SRR1(r10,r12)
181 mtspr SPRN_SRR0,r9
182 mtspr SPRN_SRR1,r10
183 SYNC
184 RFI
185
186/*
187 * Handle a system call.
188 */
189 .stabs "arch/ppc/kernel/",N_SO,0,0,0f
190 .stabs "entry.S",N_SO,0,0,0f
1910:
192
193_GLOBAL(DoSyscall)
194 stw r3,ORIG_GPR3(r1)
195 li r12,0
196 stw r12,RESULT(r1)
197 lwz r11,_CCR(r1) /* Clear SO bit in CR */
198 rlwinm r11,r11,0,4,2
199 stw r11,_CCR(r1)
200#ifdef SHOW_SYSCALLS
201 bl do_show_syscall
202#endif /* SHOW_SYSCALLS */
203 rlwinm r10,r1,0,0,18 /* current_thread_info() */
204 lwz r11,TI_FLAGS(r10)
205 andi. r11,r11,_TIF_SYSCALL_T_OR_A
206 bne- syscall_dotrace
207syscall_dotrace_cont:
208 cmplwi 0,r0,NR_syscalls
209 lis r10,sys_call_table@h
210 ori r10,r10,sys_call_table@l
211 slwi r0,r0,2
212 bge- 66f
213 lwzx r10,r10,r0 /* Fetch system call handler [ptr] */
214 mtlr r10
215 addi r9,r1,STACK_FRAME_OVERHEAD
216 PPC440EP_ERR42
217 blrl /* Call handler */
218 .globl ret_from_syscall
219ret_from_syscall:
220#ifdef SHOW_SYSCALLS
221 bl do_show_syscall_exit
222#endif
223 mr r6,r3
224 rlwinm r12,r1,0,0,18 /* current_thread_info() */
225 /* disable interrupts so current_thread_info()->flags can't change */
226 LOAD_MSR_KERNEL(r10,MSR_KERNEL) /* doesn't include MSR_EE */
227 SYNC
228 MTMSRD(r10)
229 lwz r9,TI_FLAGS(r12)
230 li r8,-_LAST_ERRNO
231 andi. r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SINGLESTEP|_TIF_USER_WORK_MASK|_TIF_PERSYSCALL_MASK)
232 bne- syscall_exit_work
233 cmplw 0,r3,r8
234 blt+ syscall_exit_cont
235 lwz r11,_CCR(r1) /* Load CR */
236 neg r3,r3
237 oris r11,r11,0x1000 /* Set SO bit in CR */
238 stw r11,_CCR(r1)
239syscall_exit_cont:
240#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE)
241 /* If the process has its own DBCR0 value, load it up. The single
242 step bit tells us that dbcr0 should be loaded. */
243 lwz r0,THREAD+THREAD_DBCR0(r2)
244 andis. r10,r0,DBCR0_IC@h
245 bnel- load_dbcr0
246#endif
247#ifdef CONFIG_44x
248 lis r4,icache_44x_need_flush@ha
249 lwz r5,icache_44x_need_flush@l(r4)
250 cmplwi cr0,r5,0
251 bne- 2f
2521:
253#endif /* CONFIG_44x */
254BEGIN_FTR_SECTION
255 lwarx r7,0,r1
256END_FTR_SECTION_IFSET(CPU_FTR_NEED_PAIRED_STWCX)
257 stwcx. r0,0,r1 /* to clear the reservation */
258 lwz r4,_LINK(r1)
259 lwz r5,_CCR(r1)
260 mtlr r4
261 mtcr r5
262 lwz r7,_NIP(r1)
263 lwz r8,_MSR(r1)
264 FIX_SRR1(r8, r0)
265 lwz r2,GPR2(r1)
266 lwz r1,GPR1(r1)
267 mtspr SPRN_SRR0,r7
268 mtspr SPRN_SRR1,r8
269 SYNC
270 RFI
271#ifdef CONFIG_44x
2722: li r7,0
273 iccci r0,r0
274 stw r7,icache_44x_need_flush@l(r4)
275 b 1b
276#endif /* CONFIG_44x */
277
27866: li r3,-ENOSYS
279 b ret_from_syscall
280
281 .globl ret_from_fork
282ret_from_fork:
283 REST_NVGPRS(r1)
284 bl schedule_tail
285 li r3,0
286 b ret_from_syscall
287
288/* Traced system call support */
289syscall_dotrace:
290 SAVE_NVGPRS(r1)
291 li r0,0xc00
292 stw r0,TRAP(r1)
293 addi r3,r1,STACK_FRAME_OVERHEAD
294 bl do_syscall_trace_enter
295 lwz r0,GPR0(r1) /* Restore original registers */
296 lwz r3,GPR3(r1)
297 lwz r4,GPR4(r1)
298 lwz r5,GPR5(r1)
299 lwz r6,GPR6(r1)
300 lwz r7,GPR7(r1)
301 lwz r8,GPR8(r1)
302 REST_NVGPRS(r1)
303 b syscall_dotrace_cont
304
305syscall_exit_work:
306 andi. r0,r9,_TIF_RESTOREALL
307 beq+ 0f
308 REST_NVGPRS(r1)
309 b 2f
3100: cmplw 0,r3,r8
311 blt+ 1f
312 andi. r0,r9,_TIF_NOERROR
313 bne- 1f
314 lwz r11,_CCR(r1) /* Load CR */
315 neg r3,r3
316 oris r11,r11,0x1000 /* Set SO bit in CR */
317 stw r11,_CCR(r1)
318
3191: stw r6,RESULT(r1) /* Save result */
320 stw r3,GPR3(r1) /* Update return value */
3212: andi. r0,r9,(_TIF_PERSYSCALL_MASK)
322 beq 4f
323
324 /* Clear per-syscall TIF flags if any are set. */
325
326 li r11,_TIF_PERSYSCALL_MASK
327 addi r12,r12,TI_FLAGS
3283: lwarx r8,0,r12
329 andc r8,r8,r11
330#ifdef CONFIG_IBM405_ERR77
331 dcbt 0,r12
332#endif
333 stwcx. r8,0,r12
334 bne- 3b
335 subi r12,r12,TI_FLAGS
336
3374: /* Anything which requires enabling interrupts? */
338 andi. r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SINGLESTEP)
339 beq ret_from_except
340
341 /* Re-enable interrupts */
342 ori r10,r10,MSR_EE
343 SYNC
344 MTMSRD(r10)
345
346 /* Save NVGPRS if they're not saved already */
347 lwz r4,TRAP(r1)
348 andi. r4,r4,1
349 beq 5f
350 SAVE_NVGPRS(r1)
351 li r4,0xc00
352 stw r4,TRAP(r1)
3535:
354 addi r3,r1,STACK_FRAME_OVERHEAD
355 bl do_syscall_trace_leave
356 b ret_from_except_full
357
358#ifdef SHOW_SYSCALLS
359do_show_syscall:
360#ifdef SHOW_SYSCALLS_TASK
361 lis r11,show_syscalls_task@ha
362 lwz r11,show_syscalls_task@l(r11)
363 cmp 0,r2,r11
364 bnelr
365#endif
366 stw r31,GPR31(r1)
367 mflr r31
368 lis r3,7f@ha
369 addi r3,r3,7f@l
370 lwz r4,GPR0(r1)
371 lwz r5,GPR3(r1)
372 lwz r6,GPR4(r1)
373 lwz r7,GPR5(r1)
374 lwz r8,GPR6(r1)
375 lwz r9,GPR7(r1)
376 bl printk
377 lis r3,77f@ha
378 addi r3,r3,77f@l
379 lwz r4,GPR8(r1)
380 mr r5,r2
381 bl printk
382 lwz r0,GPR0(r1)
383 lwz r3,GPR3(r1)
384 lwz r4,GPR4(r1)
385 lwz r5,GPR5(r1)
386 lwz r6,GPR6(r1)
387 lwz r7,GPR7(r1)
388 lwz r8,GPR8(r1)
389 mtlr r31
390 lwz r31,GPR31(r1)
391 blr
392
393do_show_syscall_exit:
394#ifdef SHOW_SYSCALLS_TASK
395 lis r11,show_syscalls_task@ha
396 lwz r11,show_syscalls_task@l(r11)
397 cmp 0,r2,r11
398 bnelr
399#endif
400 stw r31,GPR31(r1)
401 mflr r31
402 stw r3,RESULT(r1) /* Save result */
403 mr r4,r3
404 lis r3,79f@ha
405 addi r3,r3,79f@l
406 bl printk
407 lwz r3,RESULT(r1)
408 mtlr r31
409 lwz r31,GPR31(r1)
410 blr
411
4127: .string "syscall %d(%x, %x, %x, %x, %x, "
41377: .string "%x), current=%p\n"
41479: .string " -> %x\n"
415 .align 2,0
416
417#ifdef SHOW_SYSCALLS_TASK
418 .data
419 .globl show_syscalls_task
420show_syscalls_task:
421 .long -1
422 .text
423#endif
424#endif /* SHOW_SYSCALLS */
425
426/*
427 * The fork/clone functions need to copy the full register set into
428 * the child process. Therefore we need to save all the nonvolatile
429 * registers (r13 - r31) before calling the C code.
430 */
431 .globl ppc_fork
432ppc_fork:
433 SAVE_NVGPRS(r1)
434 lwz r0,TRAP(r1)
435 rlwinm r0,r0,0,0,30 /* clear LSB to indicate full */
436 stw r0,TRAP(r1) /* register set saved */
437 b sys_fork
438
439 .globl ppc_vfork
440ppc_vfork:
441 SAVE_NVGPRS(r1)
442 lwz r0,TRAP(r1)
443 rlwinm r0,r0,0,0,30 /* clear LSB to indicate full */
444 stw r0,TRAP(r1) /* register set saved */
445 b sys_vfork
446
447 .globl ppc_clone
448ppc_clone:
449 SAVE_NVGPRS(r1)
450 lwz r0,TRAP(r1)
451 rlwinm r0,r0,0,0,30 /* clear LSB to indicate full */
452 stw r0,TRAP(r1) /* register set saved */
453 b sys_clone
454
455 .globl ppc_swapcontext
456ppc_swapcontext:
457 SAVE_NVGPRS(r1)
458 lwz r0,TRAP(r1)
459 rlwinm r0,r0,0,0,30 /* clear LSB to indicate full */
460 stw r0,TRAP(r1) /* register set saved */
461 b sys_swapcontext
462
463/*
464 * Top-level page fault handling.
465 * This is in assembler because if do_page_fault tells us that
466 * it is a bad kernel page fault, we want to save the non-volatile
467 * registers before calling bad_page_fault.
468 */
469 .globl handle_page_fault
470handle_page_fault:
471 stw r4,_DAR(r1)
472 addi r3,r1,STACK_FRAME_OVERHEAD
473 bl do_page_fault
474 cmpwi r3,0
475 beq+ ret_from_except
476 SAVE_NVGPRS(r1)
477 lwz r0,TRAP(r1)
478 clrrwi r0,r0,1
479 stw r0,TRAP(r1)
480 mr r5,r3
481 addi r3,r1,STACK_FRAME_OVERHEAD
482 lwz r4,_DAR(r1)
483 bl bad_page_fault
484 b ret_from_except_full
485
486/*
487 * This routine switches between two different tasks. The process
488 * state of one is saved on its kernel stack. Then the state
489 * of the other is restored from its kernel stack. The memory
490 * management hardware is updated to the second process's state.
491 * Finally, we can return to the second process.
492 * On entry, r3 points to the THREAD for the current task, r4
493 * points to the THREAD for the new task.
494 *
495 * This routine is always called with interrupts disabled.
496 *
497 * Note: there are two ways to get to the "going out" portion
498 * of this code; either by coming in via the entry (_switch)
499 * or via "fork" which must set up an environment equivalent
500 * to the "_switch" path. If you change this , you'll have to
501 * change the fork code also.
502 *
503 * The code which creates the new task context is in 'copy_thread'
504 * in arch/ppc/kernel/process.c
505 */
506_GLOBAL(_switch)
507 stwu r1,-INT_FRAME_SIZE(r1)
508 mflr r0
509 stw r0,INT_FRAME_SIZE+4(r1)
510 /* r3-r12 are caller saved -- Cort */
511 SAVE_NVGPRS(r1)
512 stw r0,_NIP(r1) /* Return to switch caller */
513 mfmsr r11
514 li r0,MSR_FP /* Disable floating-point */
515#ifdef CONFIG_ALTIVEC
516BEGIN_FTR_SECTION
517 oris r0,r0,MSR_VEC@h /* Disable altivec */
518 mfspr r12,SPRN_VRSAVE /* save vrsave register value */
519 stw r12,THREAD+THREAD_VRSAVE(r2)
520END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
521#endif /* CONFIG_ALTIVEC */
522 and. r0,r0,r11 /* FP or altivec enabled? */
523 beq+ 1f
524 andc r11,r11,r0
525 MTMSRD(r11)
526 isync
5271: stw r11,_MSR(r1)
528 mfcr r10
529 stw r10,_CCR(r1)
530 stw r1,KSP(r3) /* Set old stack pointer */
531
532#ifdef CONFIG_SMP
533 /* We need a sync somewhere here to make sure that if the
534 * previous task gets rescheduled on another CPU, it sees all
535 * stores it has performed on this one.
536 */
537 sync
538#endif /* CONFIG_SMP */
539
540 tophys(r0,r4)
541 CLR_TOP32(r0)
542 mtspr SPRN_SPRG3,r0 /* Update current THREAD phys addr */
543 lwz r1,KSP(r4) /* Load new stack pointer */
544
545 /* save the old current 'last' for return value */
546 mr r3,r2
547 addi r2,r4,-THREAD /* Update current */
548
549#ifdef CONFIG_ALTIVEC
550BEGIN_FTR_SECTION
551 lwz r0,THREAD+THREAD_VRSAVE(r2)
552 mtspr SPRN_VRSAVE,r0 /* if G4, restore VRSAVE reg */
553END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
554#endif /* CONFIG_ALTIVEC */
555 lwz r0,_CCR(r1)
556 mtcrf 0xFF,r0
557 /* r3-r12 are destroyed -- Cort */
558 REST_NVGPRS(r1)
559
560 lwz r4,_NIP(r1) /* Return to _switch caller in new task */
561 mtlr r4
562 addi r1,r1,INT_FRAME_SIZE
563 blr
564
565 .globl fast_exception_return
566fast_exception_return:
567#if !(defined(CONFIG_4xx) || defined(CONFIG_BOOKE))
568 andi. r10,r9,MSR_RI /* check for recoverable interrupt */
569 beq 1f /* if not, we've got problems */
570#endif
571
5722: REST_4GPRS(3, r11)
573 lwz r10,_CCR(r11)
574 REST_GPR(1, r11)
575 mtcr r10
576 lwz r10,_LINK(r11)
577 mtlr r10
578 REST_GPR(10, r11)
579 mtspr SPRN_SRR1,r9
580 mtspr SPRN_SRR0,r12
581 REST_GPR(9, r11)
582 REST_GPR(12, r11)
583 lwz r11,GPR11(r11)
584 SYNC
585 RFI
586
587#if !(defined(CONFIG_4xx) || defined(CONFIG_BOOKE))
588/* check if the exception happened in a restartable section */
5891: lis r3,exc_exit_restart_end@ha
590 addi r3,r3,exc_exit_restart_end@l
591 cmplw r12,r3
592 bge 3f
593 lis r4,exc_exit_restart@ha
594 addi r4,r4,exc_exit_restart@l
595 cmplw r12,r4
596 blt 3f
597 lis r3,fee_restarts@ha
598 tophys(r3,r3)
599 lwz r5,fee_restarts@l(r3)
600 addi r5,r5,1
601 stw r5,fee_restarts@l(r3)
602 mr r12,r4 /* restart at exc_exit_restart */
603 b 2b
604
605 .section .bss
606 .align 2
607fee_restarts:
608 .space 4
609 .previous
610
611/* aargh, a nonrecoverable interrupt, panic */
612/* aargh, we don't know which trap this is */
613/* but the 601 doesn't implement the RI bit, so assume it's OK */
6143:
615BEGIN_FTR_SECTION
616 b 2b
617END_FTR_SECTION_IFSET(CPU_FTR_601)
618 li r10,-1
619 stw r10,TRAP(r11)
620 addi r3,r1,STACK_FRAME_OVERHEAD
621 lis r10,MSR_KERNEL@h
622 ori r10,r10,MSR_KERNEL@l
623 bl transfer_to_handler_full
624 .long nonrecoverable_exception
625 .long ret_from_except
626#endif
627
628 .globl ret_from_except_full
629ret_from_except_full:
630 REST_NVGPRS(r1)
631 /* fall through */
632
633 .globl ret_from_except
634ret_from_except:
635 /* Hard-disable interrupts so that current_thread_info()->flags
636 * can't change between when we test it and when we return
637 * from the interrupt. */
638 LOAD_MSR_KERNEL(r10,MSR_KERNEL)
639 SYNC /* Some chip revs have problems here... */
640 MTMSRD(r10) /* disable interrupts */
641
642 lwz r3,_MSR(r1) /* Returning to user mode? */
643 andi. r0,r3,MSR_PR
644 beq resume_kernel
645
646user_exc_return: /* r10 contains MSR_KERNEL here */
647 /* Check current_thread_info()->flags */
648 rlwinm r9,r1,0,0,18
649 lwz r9,TI_FLAGS(r9)
650 andi. r0,r9,_TIF_USER_WORK_MASK
651 bne do_work
652
653restore_user:
654#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE)
655 /* Check whether this process has its own DBCR0 value. The single
656 step bit tells us that dbcr0 should be loaded. */
657 lwz r0,THREAD+THREAD_DBCR0(r2)
658 andis. r10,r0,DBCR0_IC@h
659 bnel- load_dbcr0
660#endif
661
662#ifdef CONFIG_PREEMPT
663 b restore
664
665/* N.B. the only way to get here is from the beq following ret_from_except. */
666resume_kernel:
667 /* check current_thread_info->preempt_count */
668 rlwinm r9,r1,0,0,18
669 lwz r0,TI_PREEMPT(r9)
670 cmpwi 0,r0,0 /* if non-zero, just restore regs and return */
671 bne restore
672 lwz r0,TI_FLAGS(r9)
673 andi. r0,r0,_TIF_NEED_RESCHED
674 beq+ restore
675 andi. r0,r3,MSR_EE /* interrupts off? */
676 beq restore /* don't schedule if so */
6771: bl preempt_schedule_irq
678 rlwinm r9,r1,0,0,18
679 lwz r3,TI_FLAGS(r9)
680 andi. r0,r3,_TIF_NEED_RESCHED
681 bne- 1b
682#else
683resume_kernel:
684#endif /* CONFIG_PREEMPT */
685
686 /* interrupts are hard-disabled at this point */
687restore:
688#ifdef CONFIG_44x
689 lis r4,icache_44x_need_flush@ha
690 lwz r5,icache_44x_need_flush@l(r4)
691 cmplwi cr0,r5,0
692 beq+ 1f
693 li r6,0
694 iccci r0,r0
695 stw r6,icache_44x_need_flush@l(r4)
6961:
697#endif /* CONFIG_44x */
698 lwz r0,GPR0(r1)
699 lwz r2,GPR2(r1)
700 REST_4GPRS(3, r1)
701 REST_2GPRS(7, r1)
702
703 lwz r10,_XER(r1)
704 lwz r11,_CTR(r1)
705 mtspr SPRN_XER,r10
706 mtctr r11
707
708 PPC405_ERR77(0,r1)
709BEGIN_FTR_SECTION
710 lwarx r11,0,r1
711END_FTR_SECTION_IFSET(CPU_FTR_NEED_PAIRED_STWCX)
712 stwcx. r0,0,r1 /* to clear the reservation */
713
714#if !(defined(CONFIG_4xx) || defined(CONFIG_BOOKE))
715 lwz r9,_MSR(r1)
716 andi. r10,r9,MSR_RI /* check if this exception occurred */
717 beql nonrecoverable /* at a bad place (MSR:RI = 0) */
718
719 lwz r10,_CCR(r1)
720 lwz r11,_LINK(r1)
721 mtcrf 0xFF,r10
722 mtlr r11
723
724 /*
725 * Once we put values in SRR0 and SRR1, we are in a state
726 * where exceptions are not recoverable, since taking an
727 * exception will trash SRR0 and SRR1. Therefore we clear the
728 * MSR:RI bit to indicate this. If we do take an exception,
729 * we can't return to the point of the exception but we
730 * can restart the exception exit path at the label
731 * exc_exit_restart below. -- paulus
732 */
733 LOAD_MSR_KERNEL(r10,MSR_KERNEL & ~MSR_RI)
734 SYNC
735 MTMSRD(r10) /* clear the RI bit */
736 .globl exc_exit_restart
737exc_exit_restart:
738 lwz r9,_MSR(r1)
739 lwz r12,_NIP(r1)
740 FIX_SRR1(r9,r10)
741 mtspr SPRN_SRR0,r12
742 mtspr SPRN_SRR1,r9
743 REST_4GPRS(9, r1)
744 lwz r1,GPR1(r1)
745 .globl exc_exit_restart_end
746exc_exit_restart_end:
747 SYNC
748 RFI
749
750#else /* !(CONFIG_4xx || CONFIG_BOOKE) */
751 /*
752 * This is a bit different on 4xx/Book-E because it doesn't have
753 * the RI bit in the MSR.
754 * The TLB miss handler checks if we have interrupted
755 * the exception exit path and restarts it if so
756 * (well maybe one day it will... :).
757 */
758 lwz r11,_LINK(r1)
759 mtlr r11
760 lwz r10,_CCR(r1)
761 mtcrf 0xff,r10
762 REST_2GPRS(9, r1)
763 .globl exc_exit_restart
764exc_exit_restart:
765 lwz r11,_NIP(r1)
766 lwz r12,_MSR(r1)
767exc_exit_start:
768 mtspr SPRN_SRR0,r11
769 mtspr SPRN_SRR1,r12
770 REST_2GPRS(11, r1)
771 lwz r1,GPR1(r1)
772 .globl exc_exit_restart_end
773exc_exit_restart_end:
774 PPC405_ERR77_SYNC
775 rfi
776 b . /* prevent prefetch past rfi */
777
778/*
779 * Returning from a critical interrupt in user mode doesn't need
780 * to be any different from a normal exception. For a critical
781 * interrupt in the kernel, we just return (without checking for
782 * preemption) since the interrupt may have happened at some crucial
783 * place (e.g. inside the TLB miss handler), and because we will be
784 * running with r1 pointing into critical_stack, not the current
785 * process's kernel stack (and therefore current_thread_info() will
786 * give the wrong answer).
787 * We have to restore various SPRs that may have been in use at the
788 * time of the critical interrupt.
789 *
790 */
791#ifdef CONFIG_40x
792#define PPC_40x_TURN_OFF_MSR_DR \
793 /* avoid any possible TLB misses here by turning off MSR.DR, we \
794 * assume the instructions here are mapped by a pinned TLB entry */ \
795 li r10,MSR_IR; \
796 mtmsr r10; \
797 isync; \
798 tophys(r1, r1);
799#else
800#define PPC_40x_TURN_OFF_MSR_DR
801#endif
802
803#define RET_FROM_EXC_LEVEL(exc_lvl_srr0, exc_lvl_srr1, exc_lvl_rfi) \
804 REST_NVGPRS(r1); \
805 lwz r3,_MSR(r1); \
806 andi. r3,r3,MSR_PR; \
807 LOAD_MSR_KERNEL(r10,MSR_KERNEL); \
808 bne user_exc_return; \
809 lwz r0,GPR0(r1); \
810 lwz r2,GPR2(r1); \
811 REST_4GPRS(3, r1); \
812 REST_2GPRS(7, r1); \
813 lwz r10,_XER(r1); \
814 lwz r11,_CTR(r1); \
815 mtspr SPRN_XER,r10; \
816 mtctr r11; \
817 PPC405_ERR77(0,r1); \
818 stwcx. r0,0,r1; /* to clear the reservation */ \
819 lwz r11,_LINK(r1); \
820 mtlr r11; \
821 lwz r10,_CCR(r1); \
822 mtcrf 0xff,r10; \
823 PPC_40x_TURN_OFF_MSR_DR; \
824 lwz r9,_DEAR(r1); \
825 lwz r10,_ESR(r1); \
826 mtspr SPRN_DEAR,r9; \
827 mtspr SPRN_ESR,r10; \
828 lwz r11,_NIP(r1); \
829 lwz r12,_MSR(r1); \
830 mtspr exc_lvl_srr0,r11; \
831 mtspr exc_lvl_srr1,r12; \
832 lwz r9,GPR9(r1); \
833 lwz r12,GPR12(r1); \
834 lwz r10,GPR10(r1); \
835 lwz r11,GPR11(r1); \
836 lwz r1,GPR1(r1); \
837 PPC405_ERR77_SYNC; \
838 exc_lvl_rfi; \
839 b .; /* prevent prefetch past exc_lvl_rfi */
840
841 .globl ret_from_crit_exc
842ret_from_crit_exc:
843 RET_FROM_EXC_LEVEL(SPRN_CSRR0, SPRN_CSRR1, RFCI)
844
845#ifdef CONFIG_BOOKE
846 .globl ret_from_debug_exc
847ret_from_debug_exc:
848 RET_FROM_EXC_LEVEL(SPRN_DSRR0, SPRN_DSRR1, RFDI)
849
850 .globl ret_from_mcheck_exc
851ret_from_mcheck_exc:
852 RET_FROM_EXC_LEVEL(SPRN_MCSRR0, SPRN_MCSRR1, RFMCI)
853#endif /* CONFIG_BOOKE */
854
855/*
856 * Load the DBCR0 value for a task that is being ptraced,
857 * having first saved away the global DBCR0. Note that r0
858 * has the dbcr0 value to set upon entry to this.
859 */
860load_dbcr0:
861 mfmsr r10 /* first disable debug exceptions */
862 rlwinm r10,r10,0,~MSR_DE
863 mtmsr r10
864 isync
865 mfspr r10,SPRN_DBCR0
866 lis r11,global_dbcr0@ha
867 addi r11,r11,global_dbcr0@l
868 stw r10,0(r11)
869 mtspr SPRN_DBCR0,r0
870 lwz r10,4(r11)
871 addi r10,r10,1
872 stw r10,4(r11)
873 li r11,-1
874 mtspr SPRN_DBSR,r11 /* clear all pending debug events */
875 blr
876
877 .section .bss
878 .align 4
879global_dbcr0:
880 .space 8
881 .previous
882#endif /* !(CONFIG_4xx || CONFIG_BOOKE) */
883
884do_work: /* r10 contains MSR_KERNEL here */
885 andi. r0,r9,_TIF_NEED_RESCHED
886 beq do_user_signal
887
888do_resched: /* r10 contains MSR_KERNEL here */
889 ori r10,r10,MSR_EE
890 SYNC
891 MTMSRD(r10) /* hard-enable interrupts */
892 bl schedule
893recheck:
894 LOAD_MSR_KERNEL(r10,MSR_KERNEL)
895 SYNC
896 MTMSRD(r10) /* disable interrupts */
897 rlwinm r9,r1,0,0,18
898 lwz r9,TI_FLAGS(r9)
899 andi. r0,r9,_TIF_NEED_RESCHED
900 bne- do_resched
901 andi. r0,r9,_TIF_USER_WORK_MASK
902 beq restore_user
903do_user_signal: /* r10 contains MSR_KERNEL here */
904 ori r10,r10,MSR_EE
905 SYNC
906 MTMSRD(r10) /* hard-enable interrupts */
907 /* save r13-r31 in the exception frame, if not already done */
908 lwz r3,TRAP(r1)
909 andi. r0,r3,1
910 beq 2f
911 SAVE_NVGPRS(r1)
912 rlwinm r3,r3,0,0,30
913 stw r3,TRAP(r1)
9142: li r3,0
915 addi r4,r1,STACK_FRAME_OVERHEAD
916 bl do_signal
917 REST_NVGPRS(r1)
918 b recheck
919
920/*
921 * We come here when we are at the end of handling an exception
922 * that occurred at a place where taking an exception will lose
923 * state information, such as the contents of SRR0 and SRR1.
924 */
925nonrecoverable:
926 lis r10,exc_exit_restart_end@ha
927 addi r10,r10,exc_exit_restart_end@l
928 cmplw r12,r10
929 bge 3f
930 lis r11,exc_exit_restart@ha
931 addi r11,r11,exc_exit_restart@l
932 cmplw r12,r11
933 blt 3f
934 lis r10,ee_restarts@ha
935 lwz r12,ee_restarts@l(r10)
936 addi r12,r12,1
937 stw r12,ee_restarts@l(r10)
938 mr r12,r11 /* restart at exc_exit_restart */
939 blr
9403: /* OK, we can't recover, kill this process */
941 /* but the 601 doesn't implement the RI bit, so assume it's OK */
942BEGIN_FTR_SECTION
943 blr
944END_FTR_SECTION_IFSET(CPU_FTR_601)
945 lwz r3,TRAP(r1)
946 andi. r0,r3,1
947 beq 4f
948 SAVE_NVGPRS(r1)
949 rlwinm r3,r3,0,0,30
950 stw r3,TRAP(r1)
9514: addi r3,r1,STACK_FRAME_OVERHEAD
952 bl nonrecoverable_exception
953 /* shouldn't return */
954 b 4b
955
956 .section .bss
957 .align 2
958ee_restarts:
959 .space 4
960 .previous
diff --git a/arch/ppc/kernel/head.S b/arch/ppc/kernel/head.S
deleted file mode 100644
index e7e642b95138..000000000000
--- a/arch/ppc/kernel/head.S
+++ /dev/null
@@ -1,1220 +0,0 @@
1/*
2 * PowerPC version
3 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
4 *
5 * Rewritten by Cort Dougan (cort@cs.nmt.edu) for PReP
6 * Copyright (C) 1996 Cort Dougan <cort@cs.nmt.edu>
7 * Adapted for Power Macintosh by Paul Mackerras.
8 * Low-level exception handlers and MMU support
9 * rewritten by Paul Mackerras.
10 * Copyright (C) 1996 Paul Mackerras.
11 * MPC8xx modifications Copyright (C) 1997 Dan Malek (dmalek@jlc.net).
12 * Amiga/APUS changes by Jesper Skov (jskov@cygnus.co.uk).
13 *
14 * This file contains the low-level support and setup for the
15 * PowerPC platform, including trap and interrupt dispatch.
16 * (The PPC 8xx embedded CPUs use head_8xx.S instead.)
17 *
18 * This program is free software; you can redistribute it and/or
19 * modify it under the terms of the GNU General Public License
20 * as published by the Free Software Foundation; either version
21 * 2 of the License, or (at your option) any later version.
22 *
23 */
24
25#include <asm/processor.h>
26#include <asm/page.h>
27#include <asm/mmu.h>
28#include <asm/pgtable.h>
29#include <asm/cputable.h>
30#include <asm/cache.h>
31#include <asm/thread_info.h>
32#include <asm/ppc_asm.h>
33#include <asm/asm-offsets.h>
34
35/* 601 only have IBAT; cr0.eq is set on 601 when using this macro */
36#define LOAD_BAT(n, reg, RA, RB) \
37 /* see the comment for clear_bats() -- Cort */ \
38 li RA,0; \
39 mtspr SPRN_IBAT##n##U,RA; \
40 mtspr SPRN_DBAT##n##U,RA; \
41 lwz RA,(n*16)+0(reg); \
42 lwz RB,(n*16)+4(reg); \
43 mtspr SPRN_IBAT##n##U,RA; \
44 mtspr SPRN_IBAT##n##L,RB; \
45 beq 1f; \
46 lwz RA,(n*16)+8(reg); \
47 lwz RB,(n*16)+12(reg); \
48 mtspr SPRN_DBAT##n##U,RA; \
49 mtspr SPRN_DBAT##n##L,RB; \
501:
51
52 .text
53 .stabs "arch/ppc/kernel/",N_SO,0,0,0f
54 .stabs "head.S",N_SO,0,0,0f
550:
56 .globl _stext
57_stext:
58
59/*
60 * _start is defined this way because the XCOFF loader in the OpenFirmware
61 * on the powermac expects the entry point to be a procedure descriptor.
62 */
63 .text
64 .globl _start
65_start:
66 /*
67 * These are here for legacy reasons, the kernel used to
68 * need to look like a coff function entry for the pmac
69 * but we're always started by some kind of bootloader now.
70 * -- Cort
71 */
72 nop /* used by __secondary_hold on prep (mtx) and chrp smp */
73 nop /* used by __secondary_hold on prep (mtx) and chrp smp */
74 nop
75
76/* PMAC
77 * Enter here with the kernel text, data and bss loaded starting at
78 * 0, running with virtual == physical mapping.
79 * r5 points to the prom entry point (the client interface handler
80 * address). Address translation is turned on, with the prom
81 * managing the hash table. Interrupts are disabled. The stack
82 * pointer (r1) points to just below the end of the half-meg region
83 * from 0x380000 - 0x400000, which is mapped in already.
84 *
85 * If we are booted from MacOS via BootX, we enter with the kernel
86 * image loaded somewhere, and the following values in registers:
87 * r3: 'BooX' (0x426f6f58)
88 * r4: virtual address of boot_infos_t
89 * r5: 0
90 *
91 * APUS
92 * r3: 'APUS'
93 * r4: physical address of memory base
94 * Linux/m68k style BootInfo structure at &_end.
95 *
96 * PREP
97 * This is jumped to on prep systems right after the kernel is relocated
98 * to its proper place in memory by the boot loader. The expected layout
99 * of the regs is:
100 * r3: ptr to residual data
101 * r4: initrd_start or if no initrd then 0
102 * r5: initrd_end - unused if r4 is 0
103 * r6: Start of command line string
104 * r7: End of command line string
105 *
106 * This just gets a minimal mmu environment setup so we can call
107 * start_here() to do the real work.
108 * -- Cort
109 */
110
111 .globl __start
112__start:
113 mr r31,r3 /* save parameters */
114 mr r30,r4
115 mr r29,r5
116 mr r28,r6
117 mr r27,r7
118 li r24,0 /* cpu # */
119
120/*
121 * early_init() does the early machine identification and does
122 * the necessary low-level setup and clears the BSS
123 * -- Cort <cort@fsmlabs.com>
124 */
125 bl early_init
126
127/* Switch MMU off, clear BATs and flush TLB. At this point, r3 contains
128 * the physical address we are running at, returned by early_init()
129 */
130 bl mmu_off
131__after_mmu_off:
132 bl clear_bats
133 bl flush_tlbs
134
135 bl initial_bats
136#ifdef CONFIG_BOOTX_TEXT
137 bl setup_disp_bat
138#endif
139
140/*
141 * Call setup_cpu for CPU 0 and initialize 6xx Idle
142 */
143 bl reloc_offset
144 li r24,0 /* cpu# */
145 bl call_setup_cpu /* Call setup_cpu for this CPU */
146#ifdef CONFIG_6xx
147 bl reloc_offset
148 bl init_idle_6xx
149#endif /* CONFIG_6xx */
150
151
152/*
153 * We need to run with _start at physical address 0.
154 * If the MMU is already turned on, we copy stuff to KERNELBASE,
155 * otherwise we copy it to 0.
156 */
157 bl reloc_offset
158 mr r26,r3
159 addis r4,r3,KERNELBASE@h /* current address of _start */
160 cmpwi 0,r4,0 /* are we already running at 0? */
161 bne relocate_kernel
162
163/*
164 * we now have the 1st 16M of ram mapped with the bats.
165 * prep needs the mmu to be turned on here, but pmac already has it on.
166 * this shouldn't bother the pmac since it just gets turned on again
167 * as we jump to our code at KERNELBASE. -- Cort
168 * Actually no, pmac doesn't have it on any more. BootX enters with MMU
169 * off, and in other cases, we now turn it off before changing BATs above.
170 */
171turn_on_mmu:
172 mfmsr r0
173 ori r0,r0,MSR_DR|MSR_IR
174 mtspr SPRN_SRR1,r0
175 lis r0,start_here@h
176 ori r0,r0,start_here@l
177 mtspr SPRN_SRR0,r0
178 SYNC
179 RFI /* enables MMU */
180
181/*
182 * We need __secondary_hold as a place to hold the other cpus on
183 * an SMP machine, even when we are running a UP kernel.
184 */
185 . = 0xc0 /* for prep bootloader */
186 li r3,1 /* MTX only has 1 cpu */
187 .globl __secondary_hold
188__secondary_hold:
189 /* tell the master we're here */
190 stw r3,4(0)
191#ifdef CONFIG_SMP
192100: lwz r4,0(0)
193 /* wait until we're told to start */
194 cmpw 0,r4,r3
195 bne 100b
196 /* our cpu # was at addr 0 - go */
197 mr r24,r3 /* cpu # */
198 b __secondary_start
199#else
200 b .
201#endif /* CONFIG_SMP */
202
203/*
204 * Exception entry code. This code runs with address translation
205 * turned off, i.e. using physical addresses.
206 * We assume sprg3 has the physical address of the current
207 * task's thread_struct.
208 */
209#define EXCEPTION_PROLOG \
210 mtspr SPRN_SPRG0,r10; \
211 mtspr SPRN_SPRG1,r11; \
212 mfcr r10; \
213 EXCEPTION_PROLOG_1; \
214 EXCEPTION_PROLOG_2
215
216#define EXCEPTION_PROLOG_1 \
217 mfspr r11,SPRN_SRR1; /* check whether user or kernel */ \
218 andi. r11,r11,MSR_PR; \
219 tophys(r11,r1); /* use tophys(r1) if kernel */ \
220 beq 1f; \
221 mfspr r11,SPRN_SPRG3; \
222 lwz r11,THREAD_INFO-THREAD(r11); \
223 addi r11,r11,THREAD_SIZE; \
224 tophys(r11,r11); \
2251: subi r11,r11,INT_FRAME_SIZE /* alloc exc. frame */
226
227
228#define EXCEPTION_PROLOG_2 \
229 CLR_TOP32(r11); \
230 stw r10,_CCR(r11); /* save registers */ \
231 stw r12,GPR12(r11); \
232 stw r9,GPR9(r11); \
233 mfspr r10,SPRN_SPRG0; \
234 stw r10,GPR10(r11); \
235 mfspr r12,SPRN_SPRG1; \
236 stw r12,GPR11(r11); \
237 mflr r10; \
238 stw r10,_LINK(r11); \
239 mfspr r12,SPRN_SRR0; \
240 mfspr r9,SPRN_SRR1; \
241 stw r1,GPR1(r11); \
242 stw r1,0(r11); \
243 tovirt(r1,r11); /* set new kernel sp */ \
244 li r10,MSR_KERNEL & ~(MSR_IR|MSR_DR); /* can take exceptions */ \
245 MTMSRD(r10); /* (except for mach check in rtas) */ \
246 stw r0,GPR0(r11); \
247 SAVE_4GPRS(3, r11); \
248 SAVE_2GPRS(7, r11)
249
250/*
251 * Note: code which follows this uses cr0.eq (set if from kernel),
252 * r11, r12 (SRR0), and r9 (SRR1).
253 *
254 * Note2: once we have set r1 we are in a position to take exceptions
255 * again, and we could thus set MSR:RI at that point.
256 */
257
258/*
259 * Exception vectors.
260 */
261#define EXCEPTION(n, label, hdlr, xfer) \
262 . = n; \
263label: \
264 EXCEPTION_PROLOG; \
265 addi r3,r1,STACK_FRAME_OVERHEAD; \
266 xfer(n, hdlr)
267
268#define EXC_XFER_TEMPLATE(n, hdlr, trap, copyee, tfer, ret) \
269 li r10,trap; \
270 stw r10,TRAP(r11); \
271 li r10,MSR_KERNEL; \
272 copyee(r10, r9); \
273 bl tfer; \
274i##n: \
275 .long hdlr; \
276 .long ret
277
278#define COPY_EE(d, s) rlwimi d,s,0,16,16
279#define NOCOPY(d, s)
280
281#define EXC_XFER_STD(n, hdlr) \
282 EXC_XFER_TEMPLATE(n, hdlr, n, NOCOPY, transfer_to_handler_full, \
283 ret_from_except_full)
284
285#define EXC_XFER_LITE(n, hdlr) \
286 EXC_XFER_TEMPLATE(n, hdlr, n+1, NOCOPY, transfer_to_handler, \
287 ret_from_except)
288
289#define EXC_XFER_EE(n, hdlr) \
290 EXC_XFER_TEMPLATE(n, hdlr, n, COPY_EE, transfer_to_handler_full, \
291 ret_from_except_full)
292
293#define EXC_XFER_EE_LITE(n, hdlr) \
294 EXC_XFER_TEMPLATE(n, hdlr, n+1, COPY_EE, transfer_to_handler, \
295 ret_from_except)
296
297/* System reset */
298/* core99 pmac starts the seconary here by changing the vector, and
299 putting it back to what it was (unknown_exception) when done. */
300 EXCEPTION(0x100, Reset, unknown_exception, EXC_XFER_STD)
301
302/* Machine check */
303 . = 0x200
304 mtspr SPRN_SPRG0,r10
305 mtspr SPRN_SPRG1,r11
306 mfcr r10
307 EXCEPTION_PROLOG_1
3087: EXCEPTION_PROLOG_2
309 addi r3,r1,STACK_FRAME_OVERHEAD
310 EXC_XFER_STD(0x200, machine_check_exception)
311
312/* Data access exception. */
313 . = 0x300
314DataAccess:
315 EXCEPTION_PROLOG
316 mfspr r10,SPRN_DSISR
317 andis. r0,r10,0xa470 /* weird error? */
318 bne 1f /* if not, try to put a PTE */
319 mfspr r4,SPRN_DAR /* into the hash table */
320 rlwinm r3,r10,32-15,21,21 /* DSISR_STORE -> _PAGE_RW */
321 bl hash_page
3221: stw r10,_DSISR(r11)
323 mr r5,r10
324 mfspr r4,SPRN_DAR
325 EXC_XFER_EE_LITE(0x300, handle_page_fault)
326
327/* Instruction access exception. */
328 . = 0x400
329InstructionAccess:
330 EXCEPTION_PROLOG
331 andis. r0,r9,0x4000 /* no pte found? */
332 beq 1f /* if so, try to put a PTE */
333 li r3,0 /* into the hash table */
334 mr r4,r12 /* SRR0 is fault address */
335 bl hash_page
3361: mr r4,r12
337 mr r5,r9
338 EXC_XFER_EE_LITE(0x400, handle_page_fault)
339
340/* External interrupt */
341 EXCEPTION(0x500, HardwareInterrupt, do_IRQ, EXC_XFER_LITE)
342
343/* Alignment exception */
344 . = 0x600
345Alignment:
346 EXCEPTION_PROLOG
347 mfspr r4,SPRN_DAR
348 stw r4,_DAR(r11)
349 mfspr r5,SPRN_DSISR
350 stw r5,_DSISR(r11)
351 addi r3,r1,STACK_FRAME_OVERHEAD
352 EXC_XFER_EE(0x600, alignment_exception)
353
354/* Program check exception */
355 EXCEPTION(0x700, ProgramCheck, program_check_exception, EXC_XFER_STD)
356
357/* Floating-point unavailable */
358 . = 0x800
359FPUnavailable:
360 EXCEPTION_PROLOG
361 bne load_up_fpu /* if from user, just load it up */
362 addi r3,r1,STACK_FRAME_OVERHEAD
363 EXC_XFER_EE_LITE(0x800, kernel_fp_unavailable_exception)
364
365/* Decrementer */
366 EXCEPTION(0x900, Decrementer, timer_interrupt, EXC_XFER_LITE)
367
368 EXCEPTION(0xa00, Trap_0a, unknown_exception, EXC_XFER_EE)
369 EXCEPTION(0xb00, Trap_0b, unknown_exception, EXC_XFER_EE)
370
371/* System call */
372 . = 0xc00
373SystemCall:
374 EXCEPTION_PROLOG
375 EXC_XFER_EE_LITE(0xc00, DoSyscall)
376
377/* Single step - not used on 601 */
378 EXCEPTION(0xd00, SingleStep, single_step_exception, EXC_XFER_STD)
379 EXCEPTION(0xe00, Trap_0e, unknown_exception, EXC_XFER_EE)
380
381/*
382 * The Altivec unavailable trap is at 0x0f20. Foo.
383 * We effectively remap it to 0x3000.
384 * We include an altivec unavailable exception vector even if
385 * not configured for Altivec, so that you can't panic a
386 * non-altivec kernel running on a machine with altivec just
387 * by executing an altivec instruction.
388 */
389 . = 0xf00
390 b Trap_0f
391
392 . = 0xf20
393 b AltiVecUnavailable
394
395Trap_0f:
396 EXCEPTION_PROLOG
397 addi r3,r1,STACK_FRAME_OVERHEAD
398 EXC_XFER_EE(0xf00, unknown_exception)
399
400/*
401 * Handle TLB miss for instruction on 603/603e.
402 * Note: we get an alternate set of r0 - r3 to use automatically.
403 */
404 . = 0x1000
405InstructionTLBMiss:
406/*
407 * r0: stored ctr
408 * r1: linux style pte ( later becomes ppc hardware pte )
409 * r2: ptr to linux-style pte
410 * r3: scratch
411 */
412 mfctr r0
413 /* Get PTE (linux-style) and check access */
414 mfspr r3,SPRN_IMISS
415 lis r1,KERNELBASE@h /* check if kernel address */
416 cmplw 0,r3,r1
417 mfspr r2,SPRN_SPRG3
418 li r1,_PAGE_USER|_PAGE_PRESENT /* low addresses tested as user */
419 lwz r2,PGDIR(r2)
420 blt+ 112f
421 lis r2,swapper_pg_dir@ha /* if kernel address, use */
422 addi r2,r2,swapper_pg_dir@l /* kernel page table */
423 mfspr r1,SPRN_SRR1 /* and MSR_PR bit from SRR1 */
424 rlwinm r1,r1,32-12,29,29 /* shift MSR_PR to _PAGE_USER posn */
425112: tophys(r2,r2)
426 rlwimi r2,r3,12,20,29 /* insert top 10 bits of address */
427 lwz r2,0(r2) /* get pmd entry */
428 rlwinm. r2,r2,0,0,19 /* extract address of pte page */
429 beq- InstructionAddressInvalid /* return if no mapping */
430 rlwimi r2,r3,22,20,29 /* insert next 10 bits of address */
431 lwz r3,0(r2) /* get linux-style pte */
432 andc. r1,r1,r3 /* check access & ~permission */
433 bne- InstructionAddressInvalid /* return if access not permitted */
434 ori r3,r3,_PAGE_ACCESSED /* set _PAGE_ACCESSED in pte */
435 /*
436 * NOTE! We are assuming this is not an SMP system, otherwise
437 * we would need to update the pte atomically with lwarx/stwcx.
438 */
439 stw r3,0(r2) /* update PTE (accessed bit) */
440 /* Convert linux-style PTE to low word of PPC-style PTE */
441 rlwinm r1,r3,32-10,31,31 /* _PAGE_RW -> PP lsb */
442 rlwinm r2,r3,32-7,31,31 /* _PAGE_DIRTY -> PP lsb */
443 and r1,r1,r2 /* writable if _RW and _DIRTY */
444 rlwimi r3,r3,32-1,30,30 /* _PAGE_USER -> PP msb */
445 rlwimi r3,r3,32-1,31,31 /* _PAGE_USER -> PP lsb */
446 ori r1,r1,0xe14 /* clear out reserved bits and M */
447 andc r1,r3,r1 /* PP = user? (rw&dirty? 2: 3): 0 */
448 mtspr SPRN_RPA,r1
449 mfspr r3,SPRN_IMISS
450 tlbli r3
451 mfspr r3,SPRN_SRR1 /* Need to restore CR0 */
452 mtcrf 0x80,r3
453 rfi
454InstructionAddressInvalid:
455 mfspr r3,SPRN_SRR1
456 rlwinm r1,r3,9,6,6 /* Get load/store bit */
457
458 addis r1,r1,0x2000
459 mtspr SPRN_DSISR,r1 /* (shouldn't be needed) */
460 mtctr r0 /* Restore CTR */
461 andi. r2,r3,0xFFFF /* Clear upper bits of SRR1 */
462 or r2,r2,r1
463 mtspr SPRN_SRR1,r2
464 mfspr r1,SPRN_IMISS /* Get failing address */
465 rlwinm. r2,r2,0,31,31 /* Check for little endian access */
466 rlwimi r2,r2,1,30,30 /* change 1 -> 3 */
467 xor r1,r1,r2
468 mtspr SPRN_DAR,r1 /* Set fault address */
469 mfmsr r0 /* Restore "normal" registers */
470 xoris r0,r0,MSR_TGPR>>16
471 mtcrf 0x80,r3 /* Restore CR0 */
472 mtmsr r0
473 b InstructionAccess
474
475/*
476 * Handle TLB miss for DATA Load operation on 603/603e
477 */
478 . = 0x1100
479DataLoadTLBMiss:
480/*
481 * r0: stored ctr
482 * r1: linux style pte ( later becomes ppc hardware pte )
483 * r2: ptr to linux-style pte
484 * r3: scratch
485 */
486 mfctr r0
487 /* Get PTE (linux-style) and check access */
488 mfspr r3,SPRN_DMISS
489 lis r1,KERNELBASE@h /* check if kernel address */
490 cmplw 0,r3,r1
491 mfspr r2,SPRN_SPRG3
492 li r1,_PAGE_USER|_PAGE_PRESENT /* low addresses tested as user */
493 lwz r2,PGDIR(r2)
494 blt+ 112f
495 lis r2,swapper_pg_dir@ha /* if kernel address, use */
496 addi r2,r2,swapper_pg_dir@l /* kernel page table */
497 mfspr r1,SPRN_SRR1 /* and MSR_PR bit from SRR1 */
498 rlwinm r1,r1,32-12,29,29 /* shift MSR_PR to _PAGE_USER posn */
499112: tophys(r2,r2)
500 rlwimi r2,r3,12,20,29 /* insert top 10 bits of address */
501 lwz r2,0(r2) /* get pmd entry */
502 rlwinm. r2,r2,0,0,19 /* extract address of pte page */
503 beq- DataAddressInvalid /* return if no mapping */
504 rlwimi r2,r3,22,20,29 /* insert next 10 bits of address */
505 lwz r3,0(r2) /* get linux-style pte */
506 andc. r1,r1,r3 /* check access & ~permission */
507 bne- DataAddressInvalid /* return if access not permitted */
508 ori r3,r3,_PAGE_ACCESSED /* set _PAGE_ACCESSED in pte */
509 /*
510 * NOTE! We are assuming this is not an SMP system, otherwise
511 * we would need to update the pte atomically with lwarx/stwcx.
512 */
513 stw r3,0(r2) /* update PTE (accessed bit) */
514 /* Convert linux-style PTE to low word of PPC-style PTE */
515 rlwinm r1,r3,32-10,31,31 /* _PAGE_RW -> PP lsb */
516 rlwinm r2,r3,32-7,31,31 /* _PAGE_DIRTY -> PP lsb */
517 and r1,r1,r2 /* writable if _RW and _DIRTY */
518 rlwimi r3,r3,32-1,30,30 /* _PAGE_USER -> PP msb */
519 rlwimi r3,r3,32-1,31,31 /* _PAGE_USER -> PP lsb */
520 ori r1,r1,0xe14 /* clear out reserved bits and M */
521 andc r1,r3,r1 /* PP = user? (rw&dirty? 2: 3): 0 */
522 mtspr SPRN_RPA,r1
523 mfspr r3,SPRN_DMISS
524 tlbld r3
525 mfspr r3,SPRN_SRR1 /* Need to restore CR0 */
526 mtcrf 0x80,r3
527 rfi
528DataAddressInvalid:
529 mfspr r3,SPRN_SRR1
530 rlwinm r1,r3,9,6,6 /* Get load/store bit */
531 addis r1,r1,0x2000
532 mtspr SPRN_DSISR,r1
533 mtctr r0 /* Restore CTR */
534 andi. r2,r3,0xFFFF /* Clear upper bits of SRR1 */
535 mtspr SPRN_SRR1,r2
536 mfspr r1,SPRN_DMISS /* Get failing address */
537 rlwinm. r2,r2,0,31,31 /* Check for little endian access */
538 beq 20f /* Jump if big endian */
539 xori r1,r1,3
54020: mtspr SPRN_DAR,r1 /* Set fault address */
541 mfmsr r0 /* Restore "normal" registers */
542 xoris r0,r0,MSR_TGPR>>16
543 mtcrf 0x80,r3 /* Restore CR0 */
544 mtmsr r0
545 b DataAccess
546
547/*
548 * Handle TLB miss for DATA Store on 603/603e
549 */
550 . = 0x1200
551DataStoreTLBMiss:
552/*
553 * r0: stored ctr
554 * r1: linux style pte ( later becomes ppc hardware pte )
555 * r2: ptr to linux-style pte
556 * r3: scratch
557 */
558 mfctr r0
559 /* Get PTE (linux-style) and check access */
560 mfspr r3,SPRN_DMISS
561 lis r1,KERNELBASE@h /* check if kernel address */
562 cmplw 0,r3,r1
563 mfspr r2,SPRN_SPRG3
564 li r1,_PAGE_RW|_PAGE_USER|_PAGE_PRESENT /* access flags */
565 lwz r2,PGDIR(r2)
566 blt+ 112f
567 lis r2,swapper_pg_dir@ha /* if kernel address, use */
568 addi r2,r2,swapper_pg_dir@l /* kernel page table */
569 mfspr r1,SPRN_SRR1 /* and MSR_PR bit from SRR1 */
570 rlwinm r1,r1,32-12,29,29 /* shift MSR_PR to _PAGE_USER posn */
571112: tophys(r2,r2)
572 rlwimi r2,r3,12,20,29 /* insert top 10 bits of address */
573 lwz r2,0(r2) /* get pmd entry */
574 rlwinm. r2,r2,0,0,19 /* extract address of pte page */
575 beq- DataAddressInvalid /* return if no mapping */
576 rlwimi r2,r3,22,20,29 /* insert next 10 bits of address */
577 lwz r3,0(r2) /* get linux-style pte */
578 andc. r1,r1,r3 /* check access & ~permission */
579 bne- DataAddressInvalid /* return if access not permitted */
580 ori r3,r3,_PAGE_ACCESSED|_PAGE_DIRTY
581 /*
582 * NOTE! We are assuming this is not an SMP system, otherwise
583 * we would need to update the pte atomically with lwarx/stwcx.
584 */
585 stw r3,0(r2) /* update PTE (accessed/dirty bits) */
586 /* Convert linux-style PTE to low word of PPC-style PTE */
587 rlwimi r3,r3,32-1,30,30 /* _PAGE_USER -> PP msb */
588 li r1,0xe15 /* clear out reserved bits and M */
589 andc r1,r3,r1 /* PP = user? 2: 0 */
590 mtspr SPRN_RPA,r1
591 mfspr r3,SPRN_DMISS
592 tlbld r3
593 mfspr r3,SPRN_SRR1 /* Need to restore CR0 */
594 mtcrf 0x80,r3
595 rfi
596
597#ifndef CONFIG_ALTIVEC
598#define altivec_assist_exception unknown_exception
599#endif
600
601 EXCEPTION(0x1300, Trap_13, instruction_breakpoint_exception, EXC_XFER_EE)
602 EXCEPTION(0x1400, SMI, SMIException, EXC_XFER_EE)
603 EXCEPTION(0x1500, Trap_15, unknown_exception, EXC_XFER_EE)
604 EXCEPTION(0x1600, Trap_16, altivec_assist_exception, EXC_XFER_EE)
605 EXCEPTION(0x1700, Trap_17, TAUException, EXC_XFER_STD)
606 EXCEPTION(0x1800, Trap_18, unknown_exception, EXC_XFER_EE)
607 EXCEPTION(0x1900, Trap_19, unknown_exception, EXC_XFER_EE)
608 EXCEPTION(0x1a00, Trap_1a, unknown_exception, EXC_XFER_EE)
609 EXCEPTION(0x1b00, Trap_1b, unknown_exception, EXC_XFER_EE)
610 EXCEPTION(0x1c00, Trap_1c, unknown_exception, EXC_XFER_EE)
611 EXCEPTION(0x1d00, Trap_1d, unknown_exception, EXC_XFER_EE)
612 EXCEPTION(0x1e00, Trap_1e, unknown_exception, EXC_XFER_EE)
613 EXCEPTION(0x1f00, Trap_1f, unknown_exception, EXC_XFER_EE)
614 EXCEPTION(0x2000, RunMode, RunModeException, EXC_XFER_EE)
615 EXCEPTION(0x2100, Trap_21, unknown_exception, EXC_XFER_EE)
616 EXCEPTION(0x2200, Trap_22, unknown_exception, EXC_XFER_EE)
617 EXCEPTION(0x2300, Trap_23, unknown_exception, EXC_XFER_EE)
618 EXCEPTION(0x2400, Trap_24, unknown_exception, EXC_XFER_EE)
619 EXCEPTION(0x2500, Trap_25, unknown_exception, EXC_XFER_EE)
620 EXCEPTION(0x2600, Trap_26, unknown_exception, EXC_XFER_EE)
621 EXCEPTION(0x2700, Trap_27, unknown_exception, EXC_XFER_EE)
622 EXCEPTION(0x2800, Trap_28, unknown_exception, EXC_XFER_EE)
623 EXCEPTION(0x2900, Trap_29, unknown_exception, EXC_XFER_EE)
624 EXCEPTION(0x2a00, Trap_2a, unknown_exception, EXC_XFER_EE)
625 EXCEPTION(0x2b00, Trap_2b, unknown_exception, EXC_XFER_EE)
626 EXCEPTION(0x2c00, Trap_2c, unknown_exception, EXC_XFER_EE)
627 EXCEPTION(0x2d00, Trap_2d, unknown_exception, EXC_XFER_EE)
628 EXCEPTION(0x2e00, Trap_2e, unknown_exception, EXC_XFER_EE)
629 EXCEPTION(0x2f00, MOLTrampoline, unknown_exception, EXC_XFER_EE_LITE)
630
631 .globl mol_trampoline
632 .set mol_trampoline, i0x2f00
633
634 . = 0x3000
635
636AltiVecUnavailable:
637 EXCEPTION_PROLOG
638#ifdef CONFIG_ALTIVEC
639 bne load_up_altivec /* if from user, just load it up */
640#endif /* CONFIG_ALTIVEC */
641 addi r3,r1,STACK_FRAME_OVERHEAD
642 EXC_XFER_EE_LITE(0xf20, altivec_unavailable_exception)
643
644#ifdef CONFIG_ALTIVEC
645/* Note that the AltiVec support is closely modeled after the FP
646 * support. Changes to one are likely to be applicable to the
647 * other! */
648load_up_altivec:
649/*
650 * Disable AltiVec for the task which had AltiVec previously,
651 * and save its AltiVec registers in its thread_struct.
652 * Enables AltiVec for use in the kernel on return.
653 * On SMP we know the AltiVec units are free, since we give it up every
654 * switch. -- Kumar
655 */
656 mfmsr r5
657 oris r5,r5,MSR_VEC@h
658 MTMSRD(r5) /* enable use of AltiVec now */
659 isync
660/*
661 * For SMP, we don't do lazy AltiVec switching because it just gets too
662 * horrendously complex, especially when a task switches from one CPU
663 * to another. Instead we call giveup_altivec in switch_to.
664 */
665#ifndef CONFIG_SMP
666 tophys(r6,0)
667 addis r3,r6,last_task_used_altivec@ha
668 lwz r4,last_task_used_altivec@l(r3)
669 cmpwi 0,r4,0
670 beq 1f
671 add r4,r4,r6
672 addi r4,r4,THREAD /* want THREAD of last_task_used_altivec */
673 SAVE_32VRS(0,r10,r4)
674 mfvscr vr0
675 li r10,THREAD_VSCR
676 stvx vr0,r10,r4
677 lwz r5,PT_REGS(r4)
678 add r5,r5,r6
679 lwz r4,_MSR-STACK_FRAME_OVERHEAD(r5)
680 lis r10,MSR_VEC@h
681 andc r4,r4,r10 /* disable altivec for previous task */
682 stw r4,_MSR-STACK_FRAME_OVERHEAD(r5)
6831:
684#endif /* CONFIG_SMP */
685 /* enable use of AltiVec after return */
686 oris r9,r9,MSR_VEC@h
687 mfspr r5,SPRN_SPRG3 /* current task's THREAD (phys) */
688 li r4,1
689 li r10,THREAD_VSCR
690 stw r4,THREAD_USED_VR(r5)
691 lvx vr0,r10,r5
692 mtvscr vr0
693 REST_32VRS(0,r10,r5)
694#ifndef CONFIG_SMP
695 subi r4,r5,THREAD
696 sub r4,r4,r6
697 stw r4,last_task_used_altivec@l(r3)
698#endif /* CONFIG_SMP */
699 /* restore registers and return */
700 /* we haven't used ctr or xer or lr */
701 b fast_exception_return
702
703/*
704 * giveup_altivec(tsk)
705 * Disable AltiVec for the task given as the argument,
706 * and save the AltiVec registers in its thread_struct.
707 * Enables AltiVec for use in the kernel on return.
708 */
709
710 .globl giveup_altivec
711giveup_altivec:
712 mfmsr r5
713 oris r5,r5,MSR_VEC@h
714 SYNC
715 MTMSRD(r5) /* enable use of AltiVec now */
716 isync
717 cmpwi 0,r3,0
718 beqlr- /* if no previous owner, done */
719 addi r3,r3,THREAD /* want THREAD of task */
720 lwz r5,PT_REGS(r3)
721 cmpwi 0,r5,0
722 SAVE_32VRS(0, r4, r3)
723 mfvscr vr0
724 li r4,THREAD_VSCR
725 stvx vr0,r4,r3
726 beq 1f
727 lwz r4,_MSR-STACK_FRAME_OVERHEAD(r5)
728 lis r3,MSR_VEC@h
729 andc r4,r4,r3 /* disable AltiVec for previous task */
730 stw r4,_MSR-STACK_FRAME_OVERHEAD(r5)
7311:
732#ifndef CONFIG_SMP
733 li r5,0
734 lis r4,last_task_used_altivec@ha
735 stw r5,last_task_used_altivec@l(r4)
736#endif /* CONFIG_SMP */
737 blr
738#endif /* CONFIG_ALTIVEC */
739
740/*
741 * This code is jumped to from the startup code to copy
742 * the kernel image to physical address 0.
743 */
744relocate_kernel:
745 addis r9,r26,klimit@ha /* fetch klimit */
746 lwz r25,klimit@l(r9)
747 addis r25,r25,-KERNELBASE@h
748 li r3,0 /* Destination base address */
749 li r6,0 /* Destination offset */
750 li r5,0x4000 /* # bytes of memory to copy */
751 bl copy_and_flush /* copy the first 0x4000 bytes */
752 addi r0,r3,4f@l /* jump to the address of 4f */
753 mtctr r0 /* in copy and do the rest. */
754 bctr /* jump to the copy */
7554: mr r5,r25
756 bl copy_and_flush /* copy the rest */
757 b turn_on_mmu
758
759/*
760 * Copy routine used to copy the kernel to start at physical address 0
761 * and flush and invalidate the caches as needed.
762 * r3 = dest addr, r4 = source addr, r5 = copy limit, r6 = start offset
763 * on exit, r3, r4, r5 are unchanged, r6 is updated to be >= r5.
764 */
765copy_and_flush:
766 addi r5,r5,-4
767 addi r6,r6,-4
7684: li r0,L1_CACHE_BYTES/4
769 mtctr r0
7703: addi r6,r6,4 /* copy a cache line */
771 lwzx r0,r6,r4
772 stwx r0,r6,r3
773 bdnz 3b
774 dcbst r6,r3 /* write it to memory */
775 sync
776 icbi r6,r3 /* flush the icache line */
777 cmplw 0,r6,r5
778 blt 4b
779 sync /* additional sync needed on g4 */
780 isync
781 addi r5,r5,4
782 addi r6,r6,4
783 blr
784
785#ifdef CONFIG_SMP
786 .globl __secondary_start_pmac_0
787__secondary_start_pmac_0:
788 /* NB the entries for cpus 0, 1, 2 must each occupy 8 bytes. */
789 li r24,0
790 b 1f
791 li r24,1
792 b 1f
793 li r24,2
794 b 1f
795 li r24,3
7961:
797 /* on powersurge, we come in here with IR=0 and DR=1, and DBAT 0
798 set to map the 0xf0000000 - 0xffffffff region */
799 mfmsr r0
800 rlwinm r0,r0,0,28,26 /* clear DR (0x10) */
801 SYNC
802 mtmsr r0
803 isync
804
805 .globl __secondary_start
806__secondary_start:
807 /* Copy some CPU settings from CPU 0 */
808 bl __restore_cpu_setup
809
810 lis r3,-KERNELBASE@h
811 mr r4,r24
812 bl call_setup_cpu /* Call setup_cpu for this CPU */
813#ifdef CONFIG_6xx
814 lis r3,-KERNELBASE@h
815 bl init_idle_6xx
816#endif /* CONFIG_6xx */
817
818 /* get current_thread_info and current */
819 lis r1,secondary_ti@ha
820 tophys(r1,r1)
821 lwz r1,secondary_ti@l(r1)
822 tophys(r2,r1)
823 lwz r2,TI_TASK(r2)
824
825 /* stack */
826 addi r1,r1,THREAD_SIZE-STACK_FRAME_OVERHEAD
827 li r0,0
828 tophys(r3,r1)
829 stw r0,0(r3)
830
831 /* load up the MMU */
832 bl load_up_mmu
833
834 /* ptr to phys current thread */
835 tophys(r4,r2)
836 addi r4,r4,THREAD /* phys address of our thread_struct */
837 CLR_TOP32(r4)
838 mtspr SPRN_SPRG3,r4
839 li r3,0
840 mtspr SPRN_SPRG2,r3 /* 0 => not in RTAS */
841
842 /* enable MMU and jump to start_secondary */
843 li r4,MSR_KERNEL
844 FIX_SRR1(r4,r5)
845 lis r3,start_secondary@h
846 ori r3,r3,start_secondary@l
847 mtspr SPRN_SRR0,r3
848 mtspr SPRN_SRR1,r4
849 SYNC
850 RFI
851#endif /* CONFIG_SMP */
852
853/*
854 * Those generic dummy functions are kept for CPUs not
855 * included in CONFIG_6xx
856 */
857#if !defined(CONFIG_6xx)
858_GLOBAL(__save_cpu_setup)
859 blr
860_GLOBAL(__restore_cpu_setup)
861 blr
862#endif /* !defined(CONFIG_6xx) */
863
864
865/*
866 * Load stuff into the MMU. Intended to be called with
867 * IR=0 and DR=0.
868 */
869load_up_mmu:
870 sync /* Force all PTE updates to finish */
871 isync
872 tlbia /* Clear all TLB entries */
873 sync /* wait for tlbia/tlbie to finish */
874 TLBSYNC /* ... on all CPUs */
875 /* Load the SDR1 register (hash table base & size) */
876 lis r6,_SDR1@ha
877 tophys(r6,r6)
878 lwz r6,_SDR1@l(r6)
879 mtspr SPRN_SDR1,r6
880 li r0,16 /* load up segment register values */
881 mtctr r0 /* for context 0 */
882 lis r3,0x2000 /* Ku = 1, VSID = 0 */
883 li r4,0
8843: mtsrin r3,r4
885 addi r3,r3,0x111 /* increment VSID */
886 addis r4,r4,0x1000 /* address of next segment */
887 bdnz 3b
888
889/* Load the BAT registers with the values set up by MMU_init.
890 MMU_init takes care of whether we're on a 601 or not. */
891 mfpvr r3
892 srwi r3,r3,16
893 cmpwi r3,1
894 lis r3,BATS@ha
895 addi r3,r3,BATS@l
896 tophys(r3,r3)
897 LOAD_BAT(0,r3,r4,r5)
898 LOAD_BAT(1,r3,r4,r5)
899 LOAD_BAT(2,r3,r4,r5)
900 LOAD_BAT(3,r3,r4,r5)
901
902 blr
903
904/*
905 * This is where the main kernel code starts.
906 */
907start_here:
908 /* ptr to current */
909 lis r2,init_task@h
910 ori r2,r2,init_task@l
911 /* Set up for using our exception vectors */
912 /* ptr to phys current thread */
913 tophys(r4,r2)
914 addi r4,r4,THREAD /* init task's THREAD */
915 CLR_TOP32(r4)
916 mtspr SPRN_SPRG3,r4
917 li r3,0
918 mtspr SPRN_SPRG2,r3 /* 0 => not in RTAS */
919
920 /* stack */
921 lis r1,init_thread_union@ha
922 addi r1,r1,init_thread_union@l
923 li r0,0
924 stwu r0,THREAD_SIZE-STACK_FRAME_OVERHEAD(r1)
925/*
926 * Do early bootinfo parsing, platform-specific initialization,
927 * and set up the MMU.
928 */
929 mr r3,r31
930 mr r4,r30
931 mr r5,r29
932 mr r6,r28
933 mr r7,r27
934 bl machine_init
935 bl MMU_init
936
937/*
938 * Go back to running unmapped so we can load up new values
939 * for SDR1 (hash table pointer) and the segment registers
940 * and change to using our exception vectors.
941 */
942 lis r4,2f@h
943 ori r4,r4,2f@l
944 tophys(r4,r4)
945 li r3,MSR_KERNEL & ~(MSR_IR|MSR_DR)
946 FIX_SRR1(r3,r5)
947 mtspr SPRN_SRR0,r4
948 mtspr SPRN_SRR1,r3
949 SYNC
950 RFI
951/* Load up the kernel context */
9522: bl load_up_mmu
953
954#ifdef CONFIG_BDI_SWITCH
955 /* Add helper information for the Abatron bdiGDB debugger.
956 * We do this here because we know the mmu is disabled, and
957 * will be enabled for real in just a few instructions.
958 */
959 lis r5, abatron_pteptrs@h
960 ori r5, r5, abatron_pteptrs@l
961 stw r5, 0xf0(r0) /* This much match your Abatron config */
962 lis r6, swapper_pg_dir@h
963 ori r6, r6, swapper_pg_dir@l
964 tophys(r5, r5)
965 stw r6, 0(r5)
966#endif /* CONFIG_BDI_SWITCH */
967
968/* Now turn on the MMU for real! */
969 li r4,MSR_KERNEL
970 FIX_SRR1(r4,r5)
971 lis r3,start_kernel@h
972 ori r3,r3,start_kernel@l
973 mtspr SPRN_SRR0,r3
974 mtspr SPRN_SRR1,r4
975 SYNC
976 RFI
977
978/*
979 * Set up the segment registers for a new context.
980 */
981_GLOBAL(set_context)
982 mulli r3,r3,897 /* multiply context by skew factor */
983 rlwinm r3,r3,4,8,27 /* VSID = (context & 0xfffff) << 4 */
984 addis r3,r3,0x6000 /* Set Ks, Ku bits */
985 li r0,NUM_USER_SEGMENTS
986 mtctr r0
987
988#ifdef CONFIG_BDI_SWITCH
989 /* Context switch the PTE pointer for the Abatron BDI2000.
990 * The PGDIR is passed as second argument.
991 */
992 lis r5, KERNELBASE@h
993 lwz r5, 0xf0(r5)
994 stw r4, 0x4(r5)
995#endif
996 li r4,0
997 isync
9983:
999 mtsrin r3,r4
1000 addi r3,r3,0x111 /* next VSID */
1001 rlwinm r3,r3,0,8,3 /* clear out any overflow from VSID field */
1002 addis r4,r4,0x1000 /* address of next segment */
1003 bdnz 3b
1004 sync
1005 isync
1006 blr
1007
1008/*
1009 * An undocumented "feature" of 604e requires that the v bit
1010 * be cleared before changing BAT values.
1011 *
1012 * Also, newer IBM firmware does not clear bat3 and 4 so
1013 * this makes sure it's done.
1014 * -- Cort
1015 */
1016clear_bats:
1017 li r10,0
1018 mfspr r9,SPRN_PVR
1019 rlwinm r9,r9,16,16,31 /* r9 = 1 for 601, 4 for 604 */
1020 cmpwi r9, 1
1021 beq 1f
1022
1023 mtspr SPRN_DBAT0U,r10
1024 mtspr SPRN_DBAT0L,r10
1025 mtspr SPRN_DBAT1U,r10
1026 mtspr SPRN_DBAT1L,r10
1027 mtspr SPRN_DBAT2U,r10
1028 mtspr SPRN_DBAT2L,r10
1029 mtspr SPRN_DBAT3U,r10
1030 mtspr SPRN_DBAT3L,r10
10311:
1032 mtspr SPRN_IBAT0U,r10
1033 mtspr SPRN_IBAT0L,r10
1034 mtspr SPRN_IBAT1U,r10
1035 mtspr SPRN_IBAT1L,r10
1036 mtspr SPRN_IBAT2U,r10
1037 mtspr SPRN_IBAT2L,r10
1038 mtspr SPRN_IBAT3U,r10
1039 mtspr SPRN_IBAT3L,r10
1040BEGIN_FTR_SECTION
1041 /* Here's a tweak: at this point, CPU setup have
1042 * not been called yet, so HIGH_BAT_EN may not be
1043 * set in HID0 for the 745x processors. However, it
1044 * seems that doesn't affect our ability to actually
1045 * write to these SPRs.
1046 */
1047 mtspr SPRN_DBAT4U,r10
1048 mtspr SPRN_DBAT4L,r10
1049 mtspr SPRN_DBAT5U,r10
1050 mtspr SPRN_DBAT5L,r10
1051 mtspr SPRN_DBAT6U,r10
1052 mtspr SPRN_DBAT6L,r10
1053 mtspr SPRN_DBAT7U,r10
1054 mtspr SPRN_DBAT7L,r10
1055 mtspr SPRN_IBAT4U,r10
1056 mtspr SPRN_IBAT4L,r10
1057 mtspr SPRN_IBAT5U,r10
1058 mtspr SPRN_IBAT5L,r10
1059 mtspr SPRN_IBAT6U,r10
1060 mtspr SPRN_IBAT6L,r10
1061 mtspr SPRN_IBAT7U,r10
1062 mtspr SPRN_IBAT7L,r10
1063END_FTR_SECTION_IFSET(CPU_FTR_HAS_HIGH_BATS)
1064 blr
1065
1066flush_tlbs:
1067 lis r10, 0x40
10681: addic. r10, r10, -0x1000
1069 tlbie r10
1070 blt 1b
1071 sync
1072 blr
1073
1074mmu_off:
1075 addi r4, r3, __after_mmu_off - _start
1076 mfmsr r3
1077 andi. r0,r3,MSR_DR|MSR_IR /* MMU enabled? */
1078 beqlr
1079 andc r3,r3,r0
1080 mtspr SPRN_SRR0,r4
1081 mtspr SPRN_SRR1,r3
1082 sync
1083 RFI
1084
1085/*
1086 * Use the first pair of BAT registers to map the 1st 16MB
1087 * of RAM to KERNELBASE. From this point on we can't safely
1088 * call OF any more.
1089 */
1090initial_bats:
1091 lis r11,KERNELBASE@h
1092 mfspr r9,SPRN_PVR
1093 rlwinm r9,r9,16,16,31 /* r9 = 1 for 601, 4 for 604 */
1094 cmpwi 0,r9,1
1095 bne 4f
1096 ori r11,r11,4 /* set up BAT registers for 601 */
1097 li r8,0x7f /* valid, block length = 8MB */
1098 oris r9,r11,0x800000@h /* set up BAT reg for 2nd 8M */
1099 oris r10,r8,0x800000@h /* set up BAT reg for 2nd 8M */
1100 mtspr SPRN_IBAT0U,r11 /* N.B. 601 has valid bit in */
1101 mtspr SPRN_IBAT0L,r8 /* lower BAT register */
1102 mtspr SPRN_IBAT1U,r9
1103 mtspr SPRN_IBAT1L,r10
1104 isync
1105 blr
1106
11074: tophys(r8,r11)
1108#ifdef CONFIG_SMP
1109 ori r8,r8,0x12 /* R/W access, M=1 */
1110#else
1111 ori r8,r8,2 /* R/W access */
1112#endif /* CONFIG_SMP */
1113 ori r11,r11,BL_256M<<2|0x2 /* set up BAT registers for 604 */
1114
1115 mtspr SPRN_DBAT0L,r8 /* N.B. 6xx (not 601) have valid */
1116 mtspr SPRN_DBAT0U,r11 /* bit in upper BAT register */
1117 mtspr SPRN_IBAT0L,r8
1118 mtspr SPRN_IBAT0U,r11
1119 isync
1120 blr
1121
1122#ifdef CONFIG_BOOTX_TEXT
1123setup_disp_bat:
1124 /*
1125 * setup the display bat prepared for us in prom.c
1126 */
1127 mflr r8
1128 bl reloc_offset
1129 mtlr r8
1130 addis r8,r3,disp_BAT@ha
1131 addi r8,r8,disp_BAT@l
1132 lwz r11,0(r8)
1133 lwz r8,4(r8)
1134 mfspr r9,SPRN_PVR
1135 rlwinm r9,r9,16,16,31 /* r9 = 1 for 601, 4 for 604 */
1136 cmpwi 0,r9,1
1137 beq 1f
1138 mtspr SPRN_DBAT3L,r8
1139 mtspr SPRN_DBAT3U,r11
1140 blr
11411: mtspr SPRN_IBAT3L,r8
1142 mtspr SPRN_IBAT3U,r11
1143 blr
1144
1145#endif /* defined(CONFIG_BOOTX_TEXT) */
1146
1147#ifdef CONFIG_8260
1148/* Jump into the system reset for the rom.
1149 * We first disable the MMU, and then jump to the ROM reset address.
1150 *
1151 * r3 is the board info structure, r4 is the location for starting.
1152 * I use this for building a small kernel that can load other kernels,
1153 * rather than trying to write or rely on a rom monitor that can tftp load.
1154 */
1155 .globl m8260_gorom
1156m8260_gorom:
1157 mfmsr r0
1158 rlwinm r0,r0,0,17,15 /* clear MSR_EE in r0 */
1159 sync
1160 mtmsr r0
1161 sync
1162 mfspr r11, SPRN_HID0
1163 lis r10, 0
1164 ori r10,r10,HID0_ICE|HID0_DCE
1165 andc r11, r11, r10
1166 mtspr SPRN_HID0, r11
1167 isync
1168 li r5, MSR_ME|MSR_RI
1169 lis r6,2f@h
1170 addis r6,r6,-KERNELBASE@h
1171 ori r6,r6,2f@l
1172 mtspr SPRN_SRR0,r6
1173 mtspr SPRN_SRR1,r5
1174 isync
1175 sync
1176 rfi
11772:
1178 mtlr r4
1179 blr
1180#endif
1181
1182
1183/*
1184 * We put a few things here that have to be page-aligned.
1185 * This stuff goes at the beginning of the data segment,
1186 * which is page-aligned.
1187 */
1188 .data
1189 .globl sdata
1190sdata:
1191 .globl empty_zero_page
1192empty_zero_page:
1193 .space 4096
1194
1195 .globl swapper_pg_dir
1196swapper_pg_dir:
1197 .space 4096
1198
1199/*
1200 * This space gets a copy of optional info passed to us by the bootstrap
1201 * Used to pass parameters into the kernel like root=/dev/sda1, etc.
1202 */
1203 .globl cmd_line
1204cmd_line:
1205 .space 512
1206
1207 .globl intercept_table
1208intercept_table:
1209 .long 0, 0, i0x200, i0x300, i0x400, 0, i0x600, i0x700
1210 .long i0x800, 0, 0, 0, 0, i0xd00, 0, 0
1211 .long 0, 0, 0, i0x1300, 0, 0, 0, 0
1212 .long 0, 0, 0, 0, 0, 0, 0, 0
1213 .long 0, 0, 0, 0, 0, 0, 0, 0
1214 .long 0, 0, 0, 0, 0, 0, 0, 0
1215
1216/* Room for two PTE pointers, usually the kernel and current user pointers
1217 * to their respective root page table.
1218 */
1219abatron_pteptrs:
1220 .space 8
diff --git a/arch/ppc/kernel/head_44x.S b/arch/ppc/kernel/head_44x.S
deleted file mode 100644
index ebb5a403829f..000000000000
--- a/arch/ppc/kernel/head_44x.S
+++ /dev/null
@@ -1,769 +0,0 @@
1/*
2 * Kernel execution entry point code.
3 *
4 * Copyright (c) 1995-1996 Gary Thomas <gdt@linuxppc.org>
5 * Initial PowerPC version.
6 * Copyright (c) 1996 Cort Dougan <cort@cs.nmt.edu>
7 * Rewritten for PReP
8 * Copyright (c) 1996 Paul Mackerras <paulus@cs.anu.edu.au>
9 * Low-level exception handers, MMU support, and rewrite.
10 * Copyright (c) 1997 Dan Malek <dmalek@jlc.net>
11 * PowerPC 8xx modifications.
12 * Copyright (c) 1998-1999 TiVo, Inc.
13 * PowerPC 403GCX modifications.
14 * Copyright (c) 1999 Grant Erickson <grant@lcse.umn.edu>
15 * PowerPC 403GCX/405GP modifications.
16 * Copyright 2000 MontaVista Software Inc.
17 * PPC405 modifications
18 * PowerPC 403GCX/405GP modifications.
19 * Author: MontaVista Software, Inc.
20 * frank_rowand@mvista.com or source@mvista.com
21 * debbie_chu@mvista.com
22 * Copyright 2002-2005 MontaVista Software, Inc.
23 * PowerPC 44x support, Matt Porter <mporter@kernel.crashing.org>
24 *
25 * This program is free software; you can redistribute it and/or modify it
26 * under the terms of the GNU General Public License as published by the
27 * Free Software Foundation; either version 2 of the License, or (at your
28 * option) any later version.
29 */
30
31#include <asm/processor.h>
32#include <asm/page.h>
33#include <asm/mmu.h>
34#include <asm/pgtable.h>
35#include <asm/ibm4xx.h>
36#include <asm/ibm44x.h>
37#include <asm/cputable.h>
38#include <asm/thread_info.h>
39#include <asm/ppc_asm.h>
40#include <asm/asm-offsets.h>
41#include "head_booke.h"
42
43
44/* As with the other PowerPC ports, it is expected that when code
45 * execution begins here, the following registers contain valid, yet
46 * optional, information:
47 *
48 * r3 - Board info structure pointer (DRAM, frequency, MAC address, etc.)
49 * r4 - Starting address of the init RAM disk
50 * r5 - Ending address of the init RAM disk
51 * r6 - Start of kernel command line string (e.g. "mem=128")
52 * r7 - End of kernel command line string
53 *
54 */
55 .text
56_GLOBAL(_stext)
57_GLOBAL(_start)
58 /*
59 * Reserve a word at a fixed location to store the address
60 * of abatron_pteptrs
61 */
62 nop
63/*
64 * Save parameters we are passed
65 */
66 mr r31,r3
67 mr r30,r4
68 mr r29,r5
69 mr r28,r6
70 mr r27,r7
71 li r24,0 /* CPU number */
72
73/*
74 * Set up the initial MMU state
75 *
76 * We are still executing code at the virtual address
77 * mappings set by the firmware for the base of RAM.
78 *
79 * We first invalidate all TLB entries but the one
80 * we are running from. We then load the KERNELBASE
81 * mappings so we can begin to use kernel addresses
82 * natively and so the interrupt vector locations are
83 * permanently pinned (necessary since Book E
84 * implementations always have translation enabled).
85 *
86 * TODO: Use the known TLB entry we are running from to
87 * determine which physical region we are located
88 * in. This can be used to determine where in RAM
89 * (on a shared CPU system) or PCI memory space
90 * (on a DRAMless system) we are located.
91 * For now, we assume a perfect world which means
92 * we are located at the base of DRAM (physical 0).
93 */
94
95/*
96 * Search TLB for entry that we are currently using.
97 * Invalidate all entries but the one we are using.
98 */
99 /* Load our current PID->MMUCR TID and MSR IS->MMUCR STS */
100 mfspr r3,SPRN_PID /* Get PID */
101 mfmsr r4 /* Get MSR */
102 andi. r4,r4,MSR_IS@l /* TS=1? */
103 beq wmmucr /* If not, leave STS=0 */
104 oris r3,r3,PPC44x_MMUCR_STS@h /* Set STS=1 */
105wmmucr: mtspr SPRN_MMUCR,r3 /* Put MMUCR */
106 sync
107
108 bl invstr /* Find our address */
109invstr: mflr r5 /* Make it accessible */
110 tlbsx r23,0,r5 /* Find entry we are in */
111 li r4,0 /* Start at TLB entry 0 */
112 li r3,0 /* Set PAGEID inval value */
1131: cmpw r23,r4 /* Is this our entry? */
114 beq skpinv /* If so, skip the inval */
115 tlbwe r3,r4,PPC44x_TLB_PAGEID /* If not, inval the entry */
116skpinv: addi r4,r4,1 /* Increment */
117 cmpwi r4,64 /* Are we done? */
118 bne 1b /* If not, repeat */
119 isync /* If so, context change */
120
121/*
122 * Configure and load pinned entry into TLB slot 63.
123 */
124
125 lis r3,KERNELBASE@h /* Load the kernel virtual address */
126 ori r3,r3,KERNELBASE@l
127
128 /* Kernel is at the base of RAM */
129 li r4, 0 /* Load the kernel physical address */
130
131 /* Load the kernel PID = 0 */
132 li r0,0
133 mtspr SPRN_PID,r0
134 sync
135
136 /* Initialize MMUCR */
137 li r5,0
138 mtspr SPRN_MMUCR,r5
139 sync
140
141 /* pageid fields */
142 clrrwi r3,r3,10 /* Mask off the effective page number */
143 ori r3,r3,PPC44x_TLB_VALID | PPC44x_TLB_256M
144
145 /* xlat fields */
146 clrrwi r4,r4,10 /* Mask off the real page number */
147 /* ERPN is 0 for first 4GB page */
148
149 /* attrib fields */
150 /* Added guarded bit to protect against speculative loads/stores */
151 li r5,0
152 ori r5,r5,(PPC44x_TLB_SW | PPC44x_TLB_SR | PPC44x_TLB_SX | PPC44x_TLB_G)
153
154 li r0,63 /* TLB slot 63 */
155
156 tlbwe r3,r0,PPC44x_TLB_PAGEID /* Load the pageid fields */
157 tlbwe r4,r0,PPC44x_TLB_XLAT /* Load the translation fields */
158 tlbwe r5,r0,PPC44x_TLB_ATTRIB /* Load the attrib/access fields */
159
160 /* Force context change */
161 mfmsr r0
162 mtspr SPRN_SRR1, r0
163 lis r0,3f@h
164 ori r0,r0,3f@l
165 mtspr SPRN_SRR0,r0
166 sync
167 rfi
168
169 /* If necessary, invalidate original entry we used */
1703: cmpwi r23,63
171 beq 4f
172 li r6,0
173 tlbwe r6,r23,PPC44x_TLB_PAGEID
174 isync
175
1764:
177#ifdef CONFIG_SERIAL_TEXT_DEBUG
178 /*
179 * Add temporary UART mapping for early debug.
180 * We can map UART registers wherever we want as long as they don't
181 * interfere with other system mappings (e.g. with pinned entries).
182 * For an example of how we handle this - see ocotea.h. --ebs
183 */
184 /* pageid fields */
185 lis r3,UART0_IO_BASE@h
186 ori r3,r3,PPC44x_TLB_VALID | PPC44x_TLB_4K
187
188 /* xlat fields */
189 lis r4,UART0_PHYS_IO_BASE@h /* RPN depends on SoC */
190#ifdef UART0_PHYS_ERPN
191 ori r4,r4,UART0_PHYS_ERPN /* Add ERPN if above 4GB */
192#endif
193
194 /* attrib fields */
195 li r5,0
196 ori r5,r5,(PPC44x_TLB_SW | PPC44x_TLB_SR | PPC44x_TLB_I | PPC44x_TLB_G)
197
198 li r0,62 /* TLB slot 62 */
199
200 tlbwe r3,r0,PPC44x_TLB_PAGEID /* Load the pageid fields */
201 tlbwe r4,r0,PPC44x_TLB_XLAT /* Load the translation fields */
202 tlbwe r5,r0,PPC44x_TLB_ATTRIB /* Load the attrib/access fields */
203
204 /* Force context change */
205 isync
206#endif /* CONFIG_SERIAL_TEXT_DEBUG */
207
208 /* Establish the interrupt vector offsets */
209 SET_IVOR(0, CriticalInput);
210 SET_IVOR(1, MachineCheck);
211 SET_IVOR(2, DataStorage);
212 SET_IVOR(3, InstructionStorage);
213 SET_IVOR(4, ExternalInput);
214 SET_IVOR(5, Alignment);
215 SET_IVOR(6, Program);
216 SET_IVOR(7, FloatingPointUnavailable);
217 SET_IVOR(8, SystemCall);
218 SET_IVOR(9, AuxillaryProcessorUnavailable);
219 SET_IVOR(10, Decrementer);
220 SET_IVOR(11, FixedIntervalTimer);
221 SET_IVOR(12, WatchdogTimer);
222 SET_IVOR(13, DataTLBError);
223 SET_IVOR(14, InstructionTLBError);
224 SET_IVOR(15, Debug);
225
226 /* Establish the interrupt vector base */
227 lis r4,interrupt_base@h /* IVPR only uses the high 16-bits */
228 mtspr SPRN_IVPR,r4
229
230 /*
231 * This is where the main kernel code starts.
232 */
233
234 /* ptr to current */
235 lis r2,init_task@h
236 ori r2,r2,init_task@l
237
238 /* ptr to current thread */
239 addi r4,r2,THREAD /* init task's THREAD */
240 mtspr SPRN_SPRG3,r4
241
242 /* stack */
243 lis r1,init_thread_union@h
244 ori r1,r1,init_thread_union@l
245 li r0,0
246 stwu r0,THREAD_SIZE-STACK_FRAME_OVERHEAD(r1)
247
248 bl early_init
249
250/*
251 * Decide what sort of machine this is and initialize the MMU.
252 */
253 mr r3,r31
254 mr r4,r30
255 mr r5,r29
256 mr r6,r28
257 mr r7,r27
258 bl machine_init
259 bl MMU_init
260
261 /* Setup PTE pointers for the Abatron bdiGDB */
262 lis r6, swapper_pg_dir@h
263 ori r6, r6, swapper_pg_dir@l
264 lis r5, abatron_pteptrs@h
265 ori r5, r5, abatron_pteptrs@l
266 lis r4, KERNELBASE@h
267 ori r4, r4, KERNELBASE@l
268 stw r5, 0(r4) /* Save abatron_pteptrs at a fixed location */
269 stw r6, 0(r5)
270
271 /* Let's move on */
272 lis r4,start_kernel@h
273 ori r4,r4,start_kernel@l
274 lis r3,MSR_KERNEL@h
275 ori r3,r3,MSR_KERNEL@l
276 mtspr SPRN_SRR0,r4
277 mtspr SPRN_SRR1,r3
278 rfi /* change context and jump to start_kernel */
279
280/*
281 * Interrupt vector entry code
282 *
283 * The Book E MMUs are always on so we don't need to handle
284 * interrupts in real mode as with previous PPC processors. In
285 * this case we handle interrupts in the kernel virtual address
286 * space.
287 *
288 * Interrupt vectors are dynamically placed relative to the
289 * interrupt prefix as determined by the address of interrupt_base.
290 * The interrupt vectors offsets are programmed using the labels
291 * for each interrupt vector entry.
292 *
293 * Interrupt vectors must be aligned on a 16 byte boundary.
294 * We align on a 32 byte cache line boundary for good measure.
295 */
296
297interrupt_base:
298 /* Critical Input Interrupt */
299 CRITICAL_EXCEPTION(0x0100, CriticalInput, unknown_exception)
300
301 /* Machine Check Interrupt */
302#ifdef CONFIG_440A
303 MCHECK_EXCEPTION(0x0200, MachineCheck, machine_check_exception)
304#else
305 CRITICAL_EXCEPTION(0x0200, MachineCheck, machine_check_exception)
306#endif
307
308 /* Data Storage Interrupt */
309 START_EXCEPTION(DataStorage)
310 mtspr SPRN_SPRG0, r10 /* Save some working registers */
311 mtspr SPRN_SPRG1, r11
312 mtspr SPRN_SPRG4W, r12
313 mtspr SPRN_SPRG5W, r13
314 mfcr r11
315 mtspr SPRN_SPRG7W, r11
316
317 /*
318 * Check if it was a store fault, if not then bail
319 * because a user tried to access a kernel or
320 * read-protected page. Otherwise, get the
321 * offending address and handle it.
322 */
323 mfspr r10, SPRN_ESR
324 andis. r10, r10, ESR_ST@h
325 beq 2f
326
327 mfspr r10, SPRN_DEAR /* Get faulting address */
328
329 /* If we are faulting a kernel address, we have to use the
330 * kernel page tables.
331 */
332 lis r11, TASK_SIZE@h
333 cmplw r10, r11
334 blt+ 3f
335 lis r11, swapper_pg_dir@h
336 ori r11, r11, swapper_pg_dir@l
337
338 mfspr r12,SPRN_MMUCR
339 rlwinm r12,r12,0,0,23 /* Clear TID */
340
341 b 4f
342
343 /* Get the PGD for the current thread */
3443:
345 mfspr r11,SPRN_SPRG3
346 lwz r11,PGDIR(r11)
347
348 /* Load PID into MMUCR TID */
349 mfspr r12,SPRN_MMUCR /* Get MMUCR */
350 mfspr r13,SPRN_PID /* Get PID */
351 rlwimi r12,r13,0,24,31 /* Set TID */
352
3534:
354 mtspr SPRN_MMUCR,r12
355
356 rlwinm r12, r10, 13, 19, 29 /* Compute pgdir/pmd offset */
357 lwzx r11, r12, r11 /* Get pgd/pmd entry */
358 rlwinm. r12, r11, 0, 0, 20 /* Extract pt base address */
359 beq 2f /* Bail if no table */
360
361 rlwimi r12, r10, 23, 20, 28 /* Compute pte address */
362 lwz r11, 4(r12) /* Get pte entry */
363
364 andi. r13, r11, _PAGE_RW /* Is it writeable? */
365 beq 2f /* Bail if not */
366
367 /* Update 'changed'.
368 */
369 ori r11, r11, _PAGE_DIRTY|_PAGE_ACCESSED|_PAGE_HWWRITE
370 stw r11, 4(r12) /* Update Linux page table */
371
372 li r13, PPC44x_TLB_SR@l /* Set SR */
373 rlwimi r13, r11, 29, 29, 29 /* SX = _PAGE_HWEXEC */
374 rlwimi r13, r11, 0, 30, 30 /* SW = _PAGE_RW */
375 rlwimi r13, r11, 29, 28, 28 /* UR = _PAGE_USER */
376 rlwimi r12, r11, 31, 26, 26 /* (_PAGE_USER>>1)->r12 */
377 rlwimi r12, r11, 29, 30, 30 /* (_PAGE_USER>>3)->r12 */
378 and r12, r12, r11 /* HWEXEC/RW & USER */
379 rlwimi r13, r12, 0, 26, 26 /* UX = HWEXEC & USER */
380 rlwimi r13, r12, 3, 27, 27 /* UW = RW & USER */
381
382 rlwimi r11,r13,0,26,31 /* Insert static perms */
383
384 rlwinm r11,r11,0,20,15 /* Clear U0-U3 */
385
386 /* find the TLB index that caused the fault. It has to be here. */
387 tlbsx r10, 0, r10
388
389 tlbwe r11, r10, PPC44x_TLB_ATTRIB /* Write ATTRIB */
390
391 /* Done...restore registers and get out of here.
392 */
393 mfspr r11, SPRN_SPRG7R
394 mtcr r11
395 mfspr r13, SPRN_SPRG5R
396 mfspr r12, SPRN_SPRG4R
397
398 mfspr r11, SPRN_SPRG1
399 mfspr r10, SPRN_SPRG0
400 rfi /* Force context change */
401
4022:
403 /*
404 * The bailout. Restore registers to pre-exception conditions
405 * and call the heavyweights to help us out.
406 */
407 mfspr r11, SPRN_SPRG7R
408 mtcr r11
409 mfspr r13, SPRN_SPRG5R
410 mfspr r12, SPRN_SPRG4R
411
412 mfspr r11, SPRN_SPRG1
413 mfspr r10, SPRN_SPRG0
414 b data_access
415
416 /* Instruction Storage Interrupt */
417 INSTRUCTION_STORAGE_EXCEPTION
418
419 /* External Input Interrupt */
420 EXCEPTION(0x0500, ExternalInput, do_IRQ, EXC_XFER_LITE)
421
422 /* Alignment Interrupt */
423 ALIGNMENT_EXCEPTION
424
425 /* Program Interrupt */
426 PROGRAM_EXCEPTION
427
428 /* Floating Point Unavailable Interrupt */
429#ifdef CONFIG_PPC_FPU
430 FP_UNAVAILABLE_EXCEPTION
431#else
432 EXCEPTION(0x2010, FloatingPointUnavailable, unknown_exception, EXC_XFER_EE)
433#endif
434
435 /* System Call Interrupt */
436 START_EXCEPTION(SystemCall)
437 NORMAL_EXCEPTION_PROLOG
438 EXC_XFER_EE_LITE(0x0c00, DoSyscall)
439
440 /* Auxillary Processor Unavailable Interrupt */
441 EXCEPTION(0x2020, AuxillaryProcessorUnavailable, unknown_exception, EXC_XFER_EE)
442
443 /* Decrementer Interrupt */
444 DECREMENTER_EXCEPTION
445
446 /* Fixed Internal Timer Interrupt */
447 /* TODO: Add FIT support */
448 EXCEPTION(0x1010, FixedIntervalTimer, unknown_exception, EXC_XFER_EE)
449
450 /* Watchdog Timer Interrupt */
451 /* TODO: Add watchdog support */
452#ifdef CONFIG_BOOKE_WDT
453 CRITICAL_EXCEPTION(0x1020, WatchdogTimer, WatchdogException)
454#else
455 CRITICAL_EXCEPTION(0x1020, WatchdogTimer, unknown_exception)
456#endif
457
458 /* Data TLB Error Interrupt */
459 START_EXCEPTION(DataTLBError)
460 mtspr SPRN_SPRG0, r10 /* Save some working registers */
461 mtspr SPRN_SPRG1, r11
462 mtspr SPRN_SPRG4W, r12
463 mtspr SPRN_SPRG5W, r13
464 mfcr r11
465 mtspr SPRN_SPRG7W, r11
466 mfspr r10, SPRN_DEAR /* Get faulting address */
467
468 /* If we are faulting a kernel address, we have to use the
469 * kernel page tables.
470 */
471 lis r11, TASK_SIZE@h
472 cmplw r10, r11
473 blt+ 3f
474 lis r11, swapper_pg_dir@h
475 ori r11, r11, swapper_pg_dir@l
476
477 mfspr r12,SPRN_MMUCR
478 rlwinm r12,r12,0,0,23 /* Clear TID */
479
480 b 4f
481
482 /* Get the PGD for the current thread */
4833:
484 mfspr r11,SPRN_SPRG3
485 lwz r11,PGDIR(r11)
486
487 /* Load PID into MMUCR TID */
488 mfspr r12,SPRN_MMUCR
489 mfspr r13,SPRN_PID /* Get PID */
490 rlwimi r12,r13,0,24,31 /* Set TID */
491
4924:
493 mtspr SPRN_MMUCR,r12
494
495 rlwinm r12, r10, 13, 19, 29 /* Compute pgdir/pmd offset */
496 lwzx r11, r12, r11 /* Get pgd/pmd entry */
497 rlwinm. r12, r11, 0, 0, 20 /* Extract pt base address */
498 beq 2f /* Bail if no table */
499
500 rlwimi r12, r10, 23, 20, 28 /* Compute pte address */
501 lwz r11, 4(r12) /* Get pte entry */
502 andi. r13, r11, _PAGE_PRESENT /* Is the page present? */
503 beq 2f /* Bail if not present */
504
505 ori r11, r11, _PAGE_ACCESSED
506 stw r11, 4(r12)
507
508 /* Jump to common tlb load */
509 b finish_tlb_load
510
5112:
512 /* The bailout. Restore registers to pre-exception conditions
513 * and call the heavyweights to help us out.
514 */
515 mfspr r11, SPRN_SPRG7R
516 mtcr r11
517 mfspr r13, SPRN_SPRG5R
518 mfspr r12, SPRN_SPRG4R
519 mfspr r11, SPRN_SPRG1
520 mfspr r10, SPRN_SPRG0
521 b data_access
522
523 /* Instruction TLB Error Interrupt */
524 /*
525 * Nearly the same as above, except we get our
526 * information from different registers and bailout
527 * to a different point.
528 */
529 START_EXCEPTION(InstructionTLBError)
530 mtspr SPRN_SPRG0, r10 /* Save some working registers */
531 mtspr SPRN_SPRG1, r11
532 mtspr SPRN_SPRG4W, r12
533 mtspr SPRN_SPRG5W, r13
534 mfcr r11
535 mtspr SPRN_SPRG7W, r11
536 mfspr r10, SPRN_SRR0 /* Get faulting address */
537
538 /* If we are faulting a kernel address, we have to use the
539 * kernel page tables.
540 */
541 lis r11, TASK_SIZE@h
542 cmplw r10, r11
543 blt+ 3f
544 lis r11, swapper_pg_dir@h
545 ori r11, r11, swapper_pg_dir@l
546
547 mfspr r12,SPRN_MMUCR
548 rlwinm r12,r12,0,0,23 /* Clear TID */
549
550 b 4f
551
552 /* Get the PGD for the current thread */
5533:
554 mfspr r11,SPRN_SPRG3
555 lwz r11,PGDIR(r11)
556
557 /* Load PID into MMUCR TID */
558 mfspr r12,SPRN_MMUCR
559 mfspr r13,SPRN_PID /* Get PID */
560 rlwimi r12,r13,0,24,31 /* Set TID */
561
5624:
563 mtspr SPRN_MMUCR,r12
564
565 rlwinm r12, r10, 13, 19, 29 /* Compute pgdir/pmd offset */
566 lwzx r11, r12, r11 /* Get pgd/pmd entry */
567 rlwinm. r12, r11, 0, 0, 20 /* Extract pt base address */
568 beq 2f /* Bail if no table */
569
570 rlwimi r12, r10, 23, 20, 28 /* Compute pte address */
571 lwz r11, 4(r12) /* Get pte entry */
572 andi. r13, r11, _PAGE_PRESENT /* Is the page present? */
573 beq 2f /* Bail if not present */
574
575 ori r11, r11, _PAGE_ACCESSED
576 stw r11, 4(r12)
577
578 /* Jump to common TLB load point */
579 b finish_tlb_load
580
5812:
582 /* The bailout. Restore registers to pre-exception conditions
583 * and call the heavyweights to help us out.
584 */
585 mfspr r11, SPRN_SPRG7R
586 mtcr r11
587 mfspr r13, SPRN_SPRG5R
588 mfspr r12, SPRN_SPRG4R
589 mfspr r11, SPRN_SPRG1
590 mfspr r10, SPRN_SPRG0
591 b InstructionStorage
592
593 /* Debug Interrupt */
594 DEBUG_EXCEPTION
595
596/*
597 * Local functions
598 */
599 /*
600 * Data TLB exceptions will bail out to this point
601 * if they can't resolve the lightweight TLB fault.
602 */
603data_access:
604 NORMAL_EXCEPTION_PROLOG
605 mfspr r5,SPRN_ESR /* Grab the ESR, save it, pass arg3 */
606 stw r5,_ESR(r11)
607 mfspr r4,SPRN_DEAR /* Grab the DEAR, save it, pass arg2 */
608 EXC_XFER_EE_LITE(0x0300, handle_page_fault)
609
610/*
611
612 * Both the instruction and data TLB miss get to this
613 * point to load the TLB.
614 * r10 - EA of fault
615 * r11 - available to use
616 * r12 - Pointer to the 64-bit PTE
617 * r13 - available to use
618 * MMUCR - loaded with proper value when we get here
619 * Upon exit, we reload everything and RFI.
620 */
621finish_tlb_load:
622 /*
623 * We set execute, because we don't have the granularity to
624 * properly set this at the page level (Linux problem).
625 * If shared is set, we cause a zero PID->TID load.
626 * Many of these bits are software only. Bits we don't set
627 * here we (properly should) assume have the appropriate value.
628 */
629
630 /* Load the next available TLB index */
631 lis r13, tlb_44x_index@ha
632 lwz r13, tlb_44x_index@l(r13)
633 /* Load the TLB high watermark */
634 lis r11, tlb_44x_hwater@ha
635 lwz r11, tlb_44x_hwater@l(r11)
636
637 /* Increment, rollover, and store TLB index */
638 addi r13, r13, 1
639 cmpw 0, r13, r11 /* reserve entries */
640 ble 7f
641 li r13, 0
6427:
643 /* Store the next available TLB index */
644 lis r11, tlb_44x_index@ha
645 stw r13, tlb_44x_index@l(r11)
646
647 lwz r11, 0(r12) /* Get MS word of PTE */
648 lwz r12, 4(r12) /* Get LS word of PTE */
649 rlwimi r11, r12, 0, 0 , 19 /* Insert RPN */
650 tlbwe r11, r13, PPC44x_TLB_XLAT /* Write XLAT */
651
652 /*
653 * Create PAGEID. This is the faulting address,
654 * page size, and valid flag.
655 */
656 li r11, PPC44x_TLB_VALID | PPC44x_TLB_4K
657 rlwimi r10, r11, 0, 20, 31 /* Insert valid and page size */
658 tlbwe r10, r13, PPC44x_TLB_PAGEID /* Write PAGEID */
659
660 li r10, PPC44x_TLB_SR@l /* Set SR */
661 rlwimi r10, r12, 0, 30, 30 /* Set SW = _PAGE_RW */
662 rlwimi r10, r12, 29, 29, 29 /* SX = _PAGE_HWEXEC */
663 rlwimi r10, r12, 29, 28, 28 /* UR = _PAGE_USER */
664 rlwimi r11, r12, 31, 26, 26 /* (_PAGE_USER>>1)->r12 */
665 and r11, r12, r11 /* HWEXEC & USER */
666 rlwimi r10, r11, 0, 26, 26 /* UX = HWEXEC & USER */
667
668 rlwimi r12, r10, 0, 26, 31 /* Insert static perms */
669 rlwinm r12, r12, 0, 20, 15 /* Clear U0-U3 */
670 tlbwe r12, r13, PPC44x_TLB_ATTRIB /* Write ATTRIB */
671
672 /* Done...restore registers and get out of here.
673 */
674 mfspr r11, SPRN_SPRG7R
675 mtcr r11
676 mfspr r13, SPRN_SPRG5R
677 mfspr r12, SPRN_SPRG4R
678 mfspr r11, SPRN_SPRG1
679 mfspr r10, SPRN_SPRG0
680 rfi /* Force context change */
681
682/*
683 * Global functions
684 */
685
686/*
687 * extern void giveup_altivec(struct task_struct *prev)
688 *
689 * The 44x core does not have an AltiVec unit.
690 */
691_GLOBAL(giveup_altivec)
692 blr
693
694/*
695 * extern void giveup_fpu(struct task_struct *prev)
696 *
697 * The 44x core does not have an FPU.
698 */
699#ifndef CONFIG_PPC_FPU
700_GLOBAL(giveup_fpu)
701 blr
702#endif
703
704/*
705 * extern void abort(void)
706 *
707 * At present, this routine just applies a system reset.
708 */
709_GLOBAL(abort)
710 mfspr r13,SPRN_DBCR0
711 oris r13,r13,DBCR0_RST_SYSTEM@h
712 mtspr SPRN_DBCR0,r13
713
714_GLOBAL(set_context)
715
716#ifdef CONFIG_BDI_SWITCH
717 /* Context switch the PTE pointer for the Abatron BDI2000.
718 * The PGDIR is the second parameter.
719 */
720 lis r5, abatron_pteptrs@h
721 ori r5, r5, abatron_pteptrs@l
722 stw r4, 0x4(r5)
723#endif
724 mtspr SPRN_PID,r3
725 isync /* Force context change */
726 blr
727
728/*
729 * We put a few things here that have to be page-aligned. This stuff
730 * goes at the beginning of the data segment, which is page-aligned.
731 */
732 .data
733 .align 12
734 .globl sdata
735sdata:
736 .globl empty_zero_page
737empty_zero_page:
738 .space 4096
739
740/*
741 * To support >32-bit physical addresses, we use an 8KB pgdir.
742 */
743 .globl swapper_pg_dir
744swapper_pg_dir:
745 .space 8192
746
747/* Reserved 4k for the critical exception stack & 4k for the machine
748 * check stack per CPU for kernel mode exceptions */
749 .section .bss
750 .align 12
751exception_stack_bottom:
752 .space BOOKE_EXCEPTION_STACK_SIZE
753 .globl exception_stack_top
754exception_stack_top:
755
756/*
757 * This space gets a copy of optional info passed to us by the bootstrap
758 * which is used to pass parameters into the kernel like root=/dev/sda1, etc.
759 */
760 .globl cmd_line
761cmd_line:
762 .space 512
763
764/*
765 * Room for two PTE pointers, usually the kernel and current user pointers
766 * to their respective root page table.
767 */
768abatron_pteptrs:
769 .space 8
diff --git a/arch/ppc/kernel/head_4xx.S b/arch/ppc/kernel/head_4xx.S
deleted file mode 100644
index 51da157a629e..000000000000
--- a/arch/ppc/kernel/head_4xx.S
+++ /dev/null
@@ -1,1021 +0,0 @@
1/*
2 * Copyright (c) 1995-1996 Gary Thomas <gdt@linuxppc.org>
3 * Initial PowerPC version.
4 * Copyright (c) 1996 Cort Dougan <cort@cs.nmt.edu>
5 * Rewritten for PReP
6 * Copyright (c) 1996 Paul Mackerras <paulus@cs.anu.edu.au>
7 * Low-level exception handers, MMU support, and rewrite.
8 * Copyright (c) 1997 Dan Malek <dmalek@jlc.net>
9 * PowerPC 8xx modifications.
10 * Copyright (c) 1998-1999 TiVo, Inc.
11 * PowerPC 403GCX modifications.
12 * Copyright (c) 1999 Grant Erickson <grant@lcse.umn.edu>
13 * PowerPC 403GCX/405GP modifications.
14 * Copyright 2000 MontaVista Software Inc.
15 * PPC405 modifications
16 * PowerPC 403GCX/405GP modifications.
17 * Author: MontaVista Software, Inc.
18 * frank_rowand@mvista.com or source@mvista.com
19 * debbie_chu@mvista.com
20 *
21 *
22 * Module name: head_4xx.S
23 *
24 * Description:
25 * Kernel execution entry point code.
26 *
27 * This program is free software; you can redistribute it and/or
28 * modify it under the terms of the GNU General Public License
29 * as published by the Free Software Foundation; either version
30 * 2 of the License, or (at your option) any later version.
31 *
32 */
33
34#include <asm/processor.h>
35#include <asm/page.h>
36#include <asm/mmu.h>
37#include <asm/pgtable.h>
38#include <asm/ibm4xx.h>
39#include <asm/cputable.h>
40#include <asm/thread_info.h>
41#include <asm/ppc_asm.h>
42#include <asm/asm-offsets.h>
43
44/* As with the other PowerPC ports, it is expected that when code
45 * execution begins here, the following registers contain valid, yet
46 * optional, information:
47 *
48 * r3 - Board info structure pointer (DRAM, frequency, MAC address, etc.)
49 * r4 - Starting address of the init RAM disk
50 * r5 - Ending address of the init RAM disk
51 * r6 - Start of kernel command line string (e.g. "mem=96m")
52 * r7 - End of kernel command line string
53 *
54 * This is all going to change RSN when we add bi_recs....... -- Dan
55 */
56 .text
57_GLOBAL(_stext)
58_GLOBAL(_start)
59
60 /* Save parameters we are passed.
61 */
62 mr r31,r3
63 mr r30,r4
64 mr r29,r5
65 mr r28,r6
66 mr r27,r7
67
68 /* We have to turn on the MMU right away so we get cache modes
69 * set correctly.
70 */
71 bl initial_mmu
72
73/* We now have the lower 16 Meg mapped into TLB entries, and the caches
74 * ready to work.
75 */
76turn_on_mmu:
77 lis r0,MSR_KERNEL@h
78 ori r0,r0,MSR_KERNEL@l
79 mtspr SPRN_SRR1,r0
80 lis r0,start_here@h
81 ori r0,r0,start_here@l
82 mtspr SPRN_SRR0,r0
83 SYNC
84 rfi /* enables MMU */
85 b . /* prevent prefetch past rfi */
86
87/*
88 * This area is used for temporarily saving registers during the
89 * critical exception prolog.
90 */
91 . = 0xc0
92crit_save:
93_GLOBAL(crit_r10)
94 .space 4
95_GLOBAL(crit_r11)
96 .space 4
97
98/*
99 * Exception vector entry code. This code runs with address translation
100 * turned off (i.e. using physical addresses). We assume SPRG3 has the
101 * physical address of the current task thread_struct.
102 * Note that we have to have decremented r1 before we write to any fields
103 * of the exception frame, since a critical interrupt could occur at any
104 * time, and it will write to the area immediately below the current r1.
105 */
106#define NORMAL_EXCEPTION_PROLOG \
107 mtspr SPRN_SPRG0,r10; /* save two registers to work with */\
108 mtspr SPRN_SPRG1,r11; \
109 mtspr SPRN_SPRG2,r1; \
110 mfcr r10; /* save CR in r10 for now */\
111 mfspr r11,SPRN_SRR1; /* check whether user or kernel */\
112 andi. r11,r11,MSR_PR; \
113 beq 1f; \
114 mfspr r1,SPRN_SPRG3; /* if from user, start at top of */\
115 lwz r1,THREAD_INFO-THREAD(r1); /* this thread's kernel stack */\
116 addi r1,r1,THREAD_SIZE; \
1171: subi r1,r1,INT_FRAME_SIZE; /* Allocate an exception frame */\
118 tophys(r11,r1); \
119 stw r10,_CCR(r11); /* save various registers */\
120 stw r12,GPR12(r11); \
121 stw r9,GPR9(r11); \
122 mfspr r10,SPRN_SPRG0; \
123 stw r10,GPR10(r11); \
124 mfspr r12,SPRN_SPRG1; \
125 stw r12,GPR11(r11); \
126 mflr r10; \
127 stw r10,_LINK(r11); \
128 mfspr r10,SPRN_SPRG2; \
129 mfspr r12,SPRN_SRR0; \
130 stw r10,GPR1(r11); \
131 mfspr r9,SPRN_SRR1; \
132 stw r10,0(r11); \
133 rlwinm r9,r9,0,14,12; /* clear MSR_WE (necessary?) */\
134 stw r0,GPR0(r11); \
135 SAVE_4GPRS(3, r11); \
136 SAVE_2GPRS(7, r11)
137
138/*
139 * Exception prolog for critical exceptions. This is a little different
140 * from the normal exception prolog above since a critical exception
141 * can potentially occur at any point during normal exception processing.
142 * Thus we cannot use the same SPRG registers as the normal prolog above.
143 * Instead we use a couple of words of memory at low physical addresses.
144 * This is OK since we don't support SMP on these processors.
145 */
146#define CRITICAL_EXCEPTION_PROLOG \
147 stw r10,crit_r10@l(0); /* save two registers to work with */\
148 stw r11,crit_r11@l(0); \
149 mfcr r10; /* save CR in r10 for now */\
150 mfspr r11,SPRN_SRR3; /* check whether user or kernel */\
151 andi. r11,r11,MSR_PR; \
152 lis r11,critical_stack_top@h; \
153 ori r11,r11,critical_stack_top@l; \
154 beq 1f; \
155 /* COMING FROM USER MODE */ \
156 mfspr r11,SPRN_SPRG3; /* if from user, start at top of */\
157 lwz r11,THREAD_INFO-THREAD(r11); /* this thread's kernel stack */\
158 addi r11,r11,THREAD_SIZE; \
1591: subi r11,r11,INT_FRAME_SIZE; /* Allocate an exception frame */\
160 tophys(r11,r11); \
161 stw r10,_CCR(r11); /* save various registers */\
162 stw r12,GPR12(r11); \
163 stw r9,GPR9(r11); \
164 mflr r10; \
165 stw r10,_LINK(r11); \
166 mfspr r12,SPRN_DEAR; /* save DEAR and ESR in the frame */\
167 stw r12,_DEAR(r11); /* since they may have had stuff */\
168 mfspr r9,SPRN_ESR; /* in them at the point where the */\
169 stw r9,_ESR(r11); /* exception was taken */\
170 mfspr r12,SPRN_SRR2; \
171 stw r1,GPR1(r11); \
172 mfspr r9,SPRN_SRR3; \
173 stw r1,0(r11); \
174 tovirt(r1,r11); \
175 rlwinm r9,r9,0,14,12; /* clear MSR_WE (necessary?) */\
176 stw r0,GPR0(r11); \
177 SAVE_4GPRS(3, r11); \
178 SAVE_2GPRS(7, r11)
179
180 /*
181 * State at this point:
182 * r9 saved in stack frame, now saved SRR3 & ~MSR_WE
183 * r10 saved in crit_r10 and in stack frame, trashed
184 * r11 saved in crit_r11 and in stack frame,
185 * now phys stack/exception frame pointer
186 * r12 saved in stack frame, now saved SRR2
187 * CR saved in stack frame, CR0.EQ = !SRR3.PR
188 * LR, DEAR, ESR in stack frame
189 * r1 saved in stack frame, now virt stack/excframe pointer
190 * r0, r3-r8 saved in stack frame
191 */
192
193/*
194 * Exception vectors.
195 */
196#define START_EXCEPTION(n, label) \
197 . = n; \
198label:
199
200#define EXCEPTION(n, label, hdlr, xfer) \
201 START_EXCEPTION(n, label); \
202 NORMAL_EXCEPTION_PROLOG; \
203 addi r3,r1,STACK_FRAME_OVERHEAD; \
204 xfer(n, hdlr)
205
206#define CRITICAL_EXCEPTION(n, label, hdlr) \
207 START_EXCEPTION(n, label); \
208 CRITICAL_EXCEPTION_PROLOG; \
209 addi r3,r1,STACK_FRAME_OVERHEAD; \
210 EXC_XFER_TEMPLATE(hdlr, n+2, (MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)), \
211 NOCOPY, crit_transfer_to_handler, \
212 ret_from_crit_exc)
213
214#define EXC_XFER_TEMPLATE(hdlr, trap, msr, copyee, tfer, ret) \
215 li r10,trap; \
216 stw r10,TRAP(r11); \
217 lis r10,msr@h; \
218 ori r10,r10,msr@l; \
219 copyee(r10, r9); \
220 bl tfer; \
221 .long hdlr; \
222 .long ret
223
224#define COPY_EE(d, s) rlwimi d,s,0,16,16
225#define NOCOPY(d, s)
226
227#define EXC_XFER_STD(n, hdlr) \
228 EXC_XFER_TEMPLATE(hdlr, n, MSR_KERNEL, NOCOPY, transfer_to_handler_full, \
229 ret_from_except_full)
230
231#define EXC_XFER_LITE(n, hdlr) \
232 EXC_XFER_TEMPLATE(hdlr, n+1, MSR_KERNEL, NOCOPY, transfer_to_handler, \
233 ret_from_except)
234
235#define EXC_XFER_EE(n, hdlr) \
236 EXC_XFER_TEMPLATE(hdlr, n, MSR_KERNEL, COPY_EE, transfer_to_handler_full, \
237 ret_from_except_full)
238
239#define EXC_XFER_EE_LITE(n, hdlr) \
240 EXC_XFER_TEMPLATE(hdlr, n+1, MSR_KERNEL, COPY_EE, transfer_to_handler, \
241 ret_from_except)
242
243
244/*
245 * 0x0100 - Critical Interrupt Exception
246 */
247 CRITICAL_EXCEPTION(0x0100, CriticalInterrupt, unknown_exception)
248
249/*
250 * 0x0200 - Machine Check Exception
251 */
252 CRITICAL_EXCEPTION(0x0200, MachineCheck, machine_check_exception)
253
254/*
255 * 0x0300 - Data Storage Exception
256 * This happens for just a few reasons. U0 set (but we don't do that),
257 * or zone protection fault (user violation, write to protected page).
258 * If this is just an update of modified status, we do that quickly
259 * and exit. Otherwise, we call heavywight functions to do the work.
260 */
261 START_EXCEPTION(0x0300, DataStorage)
262 mtspr SPRN_SPRG0, r10 /* Save some working registers */
263 mtspr SPRN_SPRG1, r11
264#ifdef CONFIG_403GCX
265 stw r12, 0(r0)
266 stw r9, 4(r0)
267 mfcr r11
268 mfspr r12, SPRN_PID
269 stw r11, 8(r0)
270 stw r12, 12(r0)
271#else
272 mtspr SPRN_SPRG4, r12
273 mtspr SPRN_SPRG5, r9
274 mfcr r11
275 mfspr r12, SPRN_PID
276 mtspr SPRN_SPRG7, r11
277 mtspr SPRN_SPRG6, r12
278#endif
279
280 /* First, check if it was a zone fault (which means a user
281 * tried to access a kernel or read-protected page - always
282 * a SEGV). All other faults here must be stores, so no
283 * need to check ESR_DST as well. */
284 mfspr r10, SPRN_ESR
285 andis. r10, r10, ESR_DIZ@h
286 bne 2f
287
288 mfspr r10, SPRN_DEAR /* Get faulting address */
289
290 /* If we are faulting a kernel address, we have to use the
291 * kernel page tables.
292 */
293 lis r11, TASK_SIZE@h
294 cmplw r10, r11
295 blt+ 3f
296 lis r11, swapper_pg_dir@h
297 ori r11, r11, swapper_pg_dir@l
298 li r9, 0
299 mtspr SPRN_PID, r9 /* TLB will have 0 TID */
300 b 4f
301
302 /* Get the PGD for the current thread.
303 */
3043:
305 mfspr r11,SPRN_SPRG3
306 lwz r11,PGDIR(r11)
3074:
308 tophys(r11, r11)
309 rlwimi r11, r10, 12, 20, 29 /* Create L1 (pgdir/pmd) address */
310 lwz r11, 0(r11) /* Get L1 entry */
311 rlwinm. r12, r11, 0, 0, 19 /* Extract L2 (pte) base address */
312 beq 2f /* Bail if no table */
313
314 rlwimi r12, r10, 22, 20, 29 /* Compute PTE address */
315 lwz r11, 0(r12) /* Get Linux PTE */
316
317 andi. r9, r11, _PAGE_RW /* Is it writeable? */
318 beq 2f /* Bail if not */
319
320 /* Update 'changed'.
321 */
322 ori r11, r11, _PAGE_DIRTY|_PAGE_ACCESSED|_PAGE_HWWRITE
323 stw r11, 0(r12) /* Update Linux page table */
324
325 /* Most of the Linux PTE is ready to load into the TLB LO.
326 * We set ZSEL, where only the LS-bit determines user access.
327 * We set execute, because we don't have the granularity to
328 * properly set this at the page level (Linux problem).
329 * If shared is set, we cause a zero PID->TID load.
330 * Many of these bits are software only. Bits we don't set
331 * here we (properly should) assume have the appropriate value.
332 */
333 li r12, 0x0ce2
334 andc r11, r11, r12 /* Make sure 20, 21 are zero */
335
336 /* find the TLB index that caused the fault. It has to be here.
337 */
338 tlbsx r9, 0, r10
339
340 tlbwe r11, r9, TLB_DATA /* Load TLB LO */
341
342 /* Done...restore registers and get out of here.
343 */
344#ifdef CONFIG_403GCX
345 lwz r12, 12(r0)
346 lwz r11, 8(r0)
347 mtspr SPRN_PID, r12
348 mtcr r11
349 lwz r9, 4(r0)
350 lwz r12, 0(r0)
351#else
352 mfspr r12, SPRN_SPRG6
353 mfspr r11, SPRN_SPRG7
354 mtspr SPRN_PID, r12
355 mtcr r11
356 mfspr r9, SPRN_SPRG5
357 mfspr r12, SPRN_SPRG4
358#endif
359 mfspr r11, SPRN_SPRG1
360 mfspr r10, SPRN_SPRG0
361 PPC405_ERR77_SYNC
362 rfi /* Should sync shadow TLBs */
363 b . /* prevent prefetch past rfi */
364
3652:
366 /* The bailout. Restore registers to pre-exception conditions
367 * and call the heavyweights to help us out.
368 */
369#ifdef CONFIG_403GCX
370 lwz r12, 12(r0)
371 lwz r11, 8(r0)
372 mtspr SPRN_PID, r12
373 mtcr r11
374 lwz r9, 4(r0)
375 lwz r12, 0(r0)
376#else
377 mfspr r12, SPRN_SPRG6
378 mfspr r11, SPRN_SPRG7
379 mtspr SPRN_PID, r12
380 mtcr r11
381 mfspr r9, SPRN_SPRG5
382 mfspr r12, SPRN_SPRG4
383#endif
384 mfspr r11, SPRN_SPRG1
385 mfspr r10, SPRN_SPRG0
386 b DataAccess
387
388/*
389 * 0x0400 - Instruction Storage Exception
390 * This is caused by a fetch from non-execute or guarded pages.
391 */
392 START_EXCEPTION(0x0400, InstructionAccess)
393 NORMAL_EXCEPTION_PROLOG
394 mr r4,r12 /* Pass SRR0 as arg2 */
395 li r5,0 /* Pass zero as arg3 */
396 EXC_XFER_EE_LITE(0x400, handle_page_fault)
397
398/* 0x0500 - External Interrupt Exception */
399 EXCEPTION(0x0500, HardwareInterrupt, do_IRQ, EXC_XFER_LITE)
400
401/* 0x0600 - Alignment Exception */
402 START_EXCEPTION(0x0600, Alignment)
403 NORMAL_EXCEPTION_PROLOG
404 mfspr r4,SPRN_DEAR /* Grab the DEAR and save it */
405 stw r4,_DEAR(r11)
406 addi r3,r1,STACK_FRAME_OVERHEAD
407 EXC_XFER_EE(0x600, alignment_exception)
408
409/* 0x0700 - Program Exception */
410 START_EXCEPTION(0x0700, ProgramCheck)
411 NORMAL_EXCEPTION_PROLOG
412 mfspr r4,SPRN_ESR /* Grab the ESR and save it */
413 stw r4,_ESR(r11)
414 addi r3,r1,STACK_FRAME_OVERHEAD
415 EXC_XFER_STD(0x700, program_check_exception)
416
417 EXCEPTION(0x0800, Trap_08, unknown_exception, EXC_XFER_EE)
418 EXCEPTION(0x0900, Trap_09, unknown_exception, EXC_XFER_EE)
419 EXCEPTION(0x0A00, Trap_0A, unknown_exception, EXC_XFER_EE)
420 EXCEPTION(0x0B00, Trap_0B, unknown_exception, EXC_XFER_EE)
421
422/* 0x0C00 - System Call Exception */
423 START_EXCEPTION(0x0C00, SystemCall)
424 NORMAL_EXCEPTION_PROLOG
425 EXC_XFER_EE_LITE(0xc00, DoSyscall)
426
427 EXCEPTION(0x0D00, Trap_0D, unknown_exception, EXC_XFER_EE)
428 EXCEPTION(0x0E00, Trap_0E, unknown_exception, EXC_XFER_EE)
429 EXCEPTION(0x0F00, Trap_0F, unknown_exception, EXC_XFER_EE)
430
431/* 0x1000 - Programmable Interval Timer (PIT) Exception */
432 START_EXCEPTION(0x1000, Decrementer)
433 NORMAL_EXCEPTION_PROLOG
434 lis r0,TSR_PIS@h
435 mtspr SPRN_TSR,r0 /* Clear the PIT exception */
436 addi r3,r1,STACK_FRAME_OVERHEAD
437 EXC_XFER_LITE(0x1000, timer_interrupt)
438
439#if 0
440/* NOTE:
441 * FIT and WDT handlers are not implemented yet.
442 */
443
444/* 0x1010 - Fixed Interval Timer (FIT) Exception
445*/
446 STND_EXCEPTION(0x1010, FITException, unknown_exception)
447
448/* 0x1020 - Watchdog Timer (WDT) Exception
449*/
450#ifdef CONFIG_BOOKE_WDT
451 CRITICAL_EXCEPTION(0x1020, WDTException, WatchdogException)
452#else
453 CRITICAL_EXCEPTION(0x1020, WDTException, unknown_exception)
454#endif
455#endif
456
457/* 0x1100 - Data TLB Miss Exception
458 * As the name implies, translation is not in the MMU, so search the
459 * page tables and fix it. The only purpose of this function is to
460 * load TLB entries from the page table if they exist.
461 */
462 START_EXCEPTION(0x1100, DTLBMiss)
463 mtspr SPRN_SPRG0, r10 /* Save some working registers */
464 mtspr SPRN_SPRG1, r11
465#ifdef CONFIG_403GCX
466 stw r12, 0(r0)
467 stw r9, 4(r0)
468 mfcr r11
469 mfspr r12, SPRN_PID
470 stw r11, 8(r0)
471 stw r12, 12(r0)
472#else
473 mtspr SPRN_SPRG4, r12
474 mtspr SPRN_SPRG5, r9
475 mfcr r11
476 mfspr r12, SPRN_PID
477 mtspr SPRN_SPRG7, r11
478 mtspr SPRN_SPRG6, r12
479#endif
480 mfspr r10, SPRN_DEAR /* Get faulting address */
481
482 /* If we are faulting a kernel address, we have to use the
483 * kernel page tables.
484 */
485 lis r11, TASK_SIZE@h
486 cmplw r10, r11
487 blt+ 3f
488 lis r11, swapper_pg_dir@h
489 ori r11, r11, swapper_pg_dir@l
490 li r9, 0
491 mtspr SPRN_PID, r9 /* TLB will have 0 TID */
492 b 4f
493
494 /* Get the PGD for the current thread.
495 */
4963:
497 mfspr r11,SPRN_SPRG3
498 lwz r11,PGDIR(r11)
4994:
500 tophys(r11, r11)
501 rlwimi r11, r10, 12, 20, 29 /* Create L1 (pgdir/pmd) address */
502 lwz r12, 0(r11) /* Get L1 entry */
503 andi. r9, r12, _PMD_PRESENT /* Check if it points to a PTE page */
504 beq 2f /* Bail if no table */
505
506 rlwimi r12, r10, 22, 20, 29 /* Compute PTE address */
507 lwz r11, 0(r12) /* Get Linux PTE */
508 andi. r9, r11, _PAGE_PRESENT
509 beq 5f
510
511 ori r11, r11, _PAGE_ACCESSED
512 stw r11, 0(r12)
513
514 /* Create TLB tag. This is the faulting address plus a static
515 * set of bits. These are size, valid, E, U0.
516 */
517 li r12, 0x00c0
518 rlwimi r10, r12, 0, 20, 31
519
520 b finish_tlb_load
521
5222: /* Check for possible large-page pmd entry */
523 rlwinm. r9, r12, 2, 22, 24
524 beq 5f
525
526 /* Create TLB tag. This is the faulting address, plus a static
527 * set of bits (valid, E, U0) plus the size from the PMD.
528 */
529 ori r9, r9, 0x40
530 rlwimi r10, r9, 0, 20, 31
531 mr r11, r12
532
533 b finish_tlb_load
534
5355:
536 /* The bailout. Restore registers to pre-exception conditions
537 * and call the heavyweights to help us out.
538 */
539#ifdef CONFIG_403GCX
540 lwz r12, 12(r0)
541 lwz r11, 8(r0)
542 mtspr SPRN_PID, r12
543 mtcr r11
544 lwz r9, 4(r0)
545 lwz r12, 0(r0)
546#else
547 mfspr r12, SPRN_SPRG6
548 mfspr r11, SPRN_SPRG7
549 mtspr SPRN_PID, r12
550 mtcr r11
551 mfspr r9, SPRN_SPRG5
552 mfspr r12, SPRN_SPRG4
553#endif
554 mfspr r11, SPRN_SPRG1
555 mfspr r10, SPRN_SPRG0
556 b DataAccess
557
558/* 0x1200 - Instruction TLB Miss Exception
559 * Nearly the same as above, except we get our information from different
560 * registers and bailout to a different point.
561 */
562 START_EXCEPTION(0x1200, ITLBMiss)
563 mtspr SPRN_SPRG0, r10 /* Save some working registers */
564 mtspr SPRN_SPRG1, r11
565#ifdef CONFIG_403GCX
566 stw r12, 0(r0)
567 stw r9, 4(r0)
568 mfcr r11
569 mfspr r12, SPRN_PID
570 stw r11, 8(r0)
571 stw r12, 12(r0)
572#else
573 mtspr SPRN_SPRG4, r12
574 mtspr SPRN_SPRG5, r9
575 mfcr r11
576 mfspr r12, SPRN_PID
577 mtspr SPRN_SPRG7, r11
578 mtspr SPRN_SPRG6, r12
579#endif
580 mfspr r10, SPRN_SRR0 /* Get faulting address */
581
582 /* If we are faulting a kernel address, we have to use the
583 * kernel page tables.
584 */
585 lis r11, TASK_SIZE@h
586 cmplw r10, r11
587 blt+ 3f
588 lis r11, swapper_pg_dir@h
589 ori r11, r11, swapper_pg_dir@l
590 li r9, 0
591 mtspr SPRN_PID, r9 /* TLB will have 0 TID */
592 b 4f
593
594 /* Get the PGD for the current thread.
595 */
5963:
597 mfspr r11,SPRN_SPRG3
598 lwz r11,PGDIR(r11)
5994:
600 tophys(r11, r11)
601 rlwimi r11, r10, 12, 20, 29 /* Create L1 (pgdir/pmd) address */
602 lwz r12, 0(r11) /* Get L1 entry */
603 andi. r9, r12, _PMD_PRESENT /* Check if it points to a PTE page */
604 beq 2f /* Bail if no table */
605
606 rlwimi r12, r10, 22, 20, 29 /* Compute PTE address */
607 lwz r11, 0(r12) /* Get Linux PTE */
608 andi. r9, r11, _PAGE_PRESENT
609 beq 5f
610
611 ori r11, r11, _PAGE_ACCESSED
612 stw r11, 0(r12)
613
614 /* Create TLB tag. This is the faulting address plus a static
615 * set of bits. These are size, valid, E, U0.
616 */
617 li r12, 0x00c0
618 rlwimi r10, r12, 0, 20, 31
619
620 b finish_tlb_load
621
6222: /* Check for possible large-page pmd entry */
623 rlwinm. r9, r12, 2, 22, 24
624 beq 5f
625
626 /* Create TLB tag. This is the faulting address, plus a static
627 * set of bits (valid, E, U0) plus the size from the PMD.
628 */
629 ori r9, r9, 0x40
630 rlwimi r10, r9, 0, 20, 31
631 mr r11, r12
632
633 b finish_tlb_load
634
6355:
636 /* The bailout. Restore registers to pre-exception conditions
637 * and call the heavyweights to help us out.
638 */
639#ifdef CONFIG_403GCX
640 lwz r12, 12(r0)
641 lwz r11, 8(r0)
642 mtspr SPRN_PID, r12
643 mtcr r11
644 lwz r9, 4(r0)
645 lwz r12, 0(r0)
646#else
647 mfspr r12, SPRN_SPRG6
648 mfspr r11, SPRN_SPRG7
649 mtspr SPRN_PID, r12
650 mtcr r11
651 mfspr r9, SPRN_SPRG5
652 mfspr r12, SPRN_SPRG4
653#endif
654 mfspr r11, SPRN_SPRG1
655 mfspr r10, SPRN_SPRG0
656 b InstructionAccess
657
658 EXCEPTION(0x1300, Trap_13, unknown_exception, EXC_XFER_EE)
659 EXCEPTION(0x1400, Trap_14, unknown_exception, EXC_XFER_EE)
660 EXCEPTION(0x1500, Trap_15, unknown_exception, EXC_XFER_EE)
661 EXCEPTION(0x1600, Trap_16, unknown_exception, EXC_XFER_EE)
662#ifdef CONFIG_IBM405_ERR51
663 /* 405GP errata 51 */
664 START_EXCEPTION(0x1700, Trap_17)
665 b DTLBMiss
666#else
667 EXCEPTION(0x1700, Trap_17, unknown_exception, EXC_XFER_EE)
668#endif
669 EXCEPTION(0x1800, Trap_18, unknown_exception, EXC_XFER_EE)
670 EXCEPTION(0x1900, Trap_19, unknown_exception, EXC_XFER_EE)
671 EXCEPTION(0x1A00, Trap_1A, unknown_exception, EXC_XFER_EE)
672 EXCEPTION(0x1B00, Trap_1B, unknown_exception, EXC_XFER_EE)
673 EXCEPTION(0x1C00, Trap_1C, unknown_exception, EXC_XFER_EE)
674 EXCEPTION(0x1D00, Trap_1D, unknown_exception, EXC_XFER_EE)
675 EXCEPTION(0x1E00, Trap_1E, unknown_exception, EXC_XFER_EE)
676 EXCEPTION(0x1F00, Trap_1F, unknown_exception, EXC_XFER_EE)
677
678/* Check for a single step debug exception while in an exception
679 * handler before state has been saved. This is to catch the case
680 * where an instruction that we are trying to single step causes
681 * an exception (eg ITLB/DTLB miss) and thus the first instruction of
682 * the exception handler generates a single step debug exception.
683 *
684 * If we get a debug trap on the first instruction of an exception handler,
685 * we reset the MSR_DE in the _exception handler's_ MSR (the debug trap is
686 * a critical exception, so we are using SPRN_CSRR1 to manipulate the MSR).
687 * The exception handler was handling a non-critical interrupt, so it will
688 * save (and later restore) the MSR via SPRN_SRR1, which will still have
689 * the MSR_DE bit set.
690 */
691 /* 0x2000 - Debug Exception */
692 START_EXCEPTION(0x2000, DebugTrap)
693 CRITICAL_EXCEPTION_PROLOG
694
695 /*
696 * If this is a single step or branch-taken exception in an
697 * exception entry sequence, it was probably meant to apply to
698 * the code where the exception occurred (since exception entry
699 * doesn't turn off DE automatically). We simulate the effect
700 * of turning off DE on entry to an exception handler by turning
701 * off DE in the SRR3 value and clearing the debug status.
702 */
703 mfspr r10,SPRN_DBSR /* check single-step/branch taken */
704 andis. r10,r10,DBSR_IC@h
705 beq+ 2f
706
707 andi. r10,r9,MSR_IR|MSR_PR /* check supervisor + MMU off */
708 beq 1f /* branch and fix it up */
709
710 mfspr r10,SPRN_SRR2 /* Faulting instruction address */
711 cmplwi r10,0x2100
712 bgt+ 2f /* address above exception vectors */
713
714 /* here it looks like we got an inappropriate debug exception. */
7151: rlwinm r9,r9,0,~MSR_DE /* clear DE in the SRR3 value */
716 lis r10,DBSR_IC@h /* clear the IC event */
717 mtspr SPRN_DBSR,r10
718 /* restore state and get out */
719 lwz r10,_CCR(r11)
720 lwz r0,GPR0(r11)
721 lwz r1,GPR1(r11)
722 mtcrf 0x80,r10
723 mtspr SPRN_SRR2,r12
724 mtspr SPRN_SRR3,r9
725 lwz r9,GPR9(r11)
726 lwz r12,GPR12(r11)
727 lwz r10,crit_r10@l(0)
728 lwz r11,crit_r11@l(0)
729 PPC405_ERR77_SYNC
730 rfci
731 b .
732
733 /* continue normal handling for a critical exception... */
7342: mfspr r4,SPRN_DBSR
735 addi r3,r1,STACK_FRAME_OVERHEAD
736 EXC_XFER_TEMPLATE(DebugException, 0x2002, \
737 (MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)), \
738 NOCOPY, crit_transfer_to_handler, ret_from_crit_exc)
739
740/*
741 * The other Data TLB exceptions bail out to this point
742 * if they can't resolve the lightweight TLB fault.
743 */
744DataAccess:
745 NORMAL_EXCEPTION_PROLOG
746 mfspr r5,SPRN_ESR /* Grab the ESR, save it, pass arg3 */
747 stw r5,_ESR(r11)
748 mfspr r4,SPRN_DEAR /* Grab the DEAR, save it, pass arg2 */
749 EXC_XFER_EE_LITE(0x300, handle_page_fault)
750
751/* Other PowerPC processors, namely those derived from the 6xx-series
752 * have vectors from 0x2100 through 0x2F00 defined, but marked as reserved.
753 * However, for the 4xx-series processors these are neither defined nor
754 * reserved.
755 */
756
757 /* Damn, I came up one instruction too many to fit into the
758 * exception space :-). Both the instruction and data TLB
759 * miss get to this point to load the TLB.
760 * r10 - TLB_TAG value
761 * r11 - Linux PTE
762 * r12, r9 - avilable to use
763 * PID - loaded with proper value when we get here
764 * Upon exit, we reload everything and RFI.
765 * Actually, it will fit now, but oh well.....a common place
766 * to load the TLB.
767 */
768tlb_4xx_index:
769 .long 0
770finish_tlb_load:
771 /* load the next available TLB index.
772 */
773 lwz r9, tlb_4xx_index@l(0)
774 addi r9, r9, 1
775 andi. r9, r9, (PPC4XX_TLB_SIZE-1)
776 stw r9, tlb_4xx_index@l(0)
777
7786:
779 /*
780 * Clear out the software-only bits in the PTE to generate the
781 * TLB_DATA value. These are the bottom 2 bits of the RPM, the
782 * top 3 bits of the zone field, and M.
783 */
784 li r12, 0x0ce2
785 andc r11, r11, r12
786
787 tlbwe r11, r9, TLB_DATA /* Load TLB LO */
788 tlbwe r10, r9, TLB_TAG /* Load TLB HI */
789
790 /* Done...restore registers and get out of here.
791 */
792#ifdef CONFIG_403GCX
793 lwz r12, 12(r0)
794 lwz r11, 8(r0)
795 mtspr SPRN_PID, r12
796 mtcr r11
797 lwz r9, 4(r0)
798 lwz r12, 0(r0)
799#else
800 mfspr r12, SPRN_SPRG6
801 mfspr r11, SPRN_SPRG7
802 mtspr SPRN_PID, r12
803 mtcr r11
804 mfspr r9, SPRN_SPRG5
805 mfspr r12, SPRN_SPRG4
806#endif
807 mfspr r11, SPRN_SPRG1
808 mfspr r10, SPRN_SPRG0
809 PPC405_ERR77_SYNC
810 rfi /* Should sync shadow TLBs */
811 b . /* prevent prefetch past rfi */
812
813/* extern void giveup_fpu(struct task_struct *prev)
814 *
815 * The PowerPC 4xx family of processors do not have an FPU, so this just
816 * returns.
817 */
818_GLOBAL(giveup_fpu)
819 blr
820
821/* This is where the main kernel code starts.
822 */
823start_here:
824
825 /* ptr to current */
826 lis r2,init_task@h
827 ori r2,r2,init_task@l
828
829 /* ptr to phys current thread */
830 tophys(r4,r2)
831 addi r4,r4,THREAD /* init task's THREAD */
832 mtspr SPRN_SPRG3,r4
833
834 /* stack */
835 lis r1,init_thread_union@ha
836 addi r1,r1,init_thread_union@l
837 li r0,0
838 stwu r0,THREAD_SIZE-STACK_FRAME_OVERHEAD(r1)
839
840 bl early_init /* We have to do this with MMU on */
841
842/*
843 * Decide what sort of machine this is and initialize the MMU.
844 */
845 mr r3,r31
846 mr r4,r30
847 mr r5,r29
848 mr r6,r28
849 mr r7,r27
850 bl machine_init
851 bl MMU_init
852
853/* Go back to running unmapped so we can load up new values
854 * and change to using our exception vectors.
855 * On the 4xx, all we have to do is invalidate the TLB to clear
856 * the old 16M byte TLB mappings.
857 */
858 lis r4,2f@h
859 ori r4,r4,2f@l
860 tophys(r4,r4)
861 lis r3,(MSR_KERNEL & ~(MSR_IR|MSR_DR))@h
862 ori r3,r3,(MSR_KERNEL & ~(MSR_IR|MSR_DR))@l
863 mtspr SPRN_SRR0,r4
864 mtspr SPRN_SRR1,r3
865 rfi
866 b . /* prevent prefetch past rfi */
867
868/* Load up the kernel context */
8692:
870 sync /* Flush to memory before changing TLB */
871 tlbia
872 isync /* Flush shadow TLBs */
873
874 /* set up the PTE pointers for the Abatron bdiGDB.
875 */
876 lis r6, swapper_pg_dir@h
877 ori r6, r6, swapper_pg_dir@l
878 lis r5, abatron_pteptrs@h
879 ori r5, r5, abatron_pteptrs@l
880 stw r5, 0xf0(r0) /* Must match your Abatron config file */
881 tophys(r5,r5)
882 stw r6, 0(r5)
883
884/* Now turn on the MMU for real! */
885 lis r4,MSR_KERNEL@h
886 ori r4,r4,MSR_KERNEL@l
887 lis r3,start_kernel@h
888 ori r3,r3,start_kernel@l
889 mtspr SPRN_SRR0,r3
890 mtspr SPRN_SRR1,r4
891 rfi /* enable MMU and jump to start_kernel */
892 b . /* prevent prefetch past rfi */
893
894/* Set up the initial MMU state so we can do the first level of
895 * kernel initialization. This maps the first 16 MBytes of memory 1:1
896 * virtual to physical and more importantly sets the cache mode.
897 */
898initial_mmu:
899 tlbia /* Invalidate all TLB entries */
900 isync
901
902 /* We should still be executing code at physical address 0x0000xxxx
903 * at this point. However, start_here is at virtual address
904 * 0xC000xxxx. So, set up a TLB mapping to cover this once
905 * translation is enabled.
906 */
907
908 lis r3,KERNELBASE@h /* Load the kernel virtual address */
909 ori r3,r3,KERNELBASE@l
910 tophys(r4,r3) /* Load the kernel physical address */
911
912 iccci r0,r3 /* Invalidate the i-cache before use */
913
914 /* Load the kernel PID.
915 */
916 li r0,0
917 mtspr SPRN_PID,r0
918 sync
919
920 /* Configure and load two entries into TLB slots 62 and 63.
921 * In case we are pinning TLBs, these are reserved in by the
922 * other TLB functions. If not reserving, then it doesn't
923 * matter where they are loaded.
924 */
925 clrrwi r4,r4,10 /* Mask off the real page number */
926 ori r4,r4,(TLB_WR | TLB_EX) /* Set the write and execute bits */
927
928 clrrwi r3,r3,10 /* Mask off the effective page number */
929 ori r3,r3,(TLB_VALID | TLB_PAGESZ(PAGESZ_16M))
930
931 li r0,63 /* TLB slot 63 */
932
933 tlbwe r4,r0,TLB_DATA /* Load the data portion of the entry */
934 tlbwe r3,r0,TLB_TAG /* Load the tag portion of the entry */
935
936#if defined(CONFIG_SERIAL_TEXT_DEBUG) && defined(SERIAL_DEBUG_IO_BASE)
937
938 /* Load a TLB entry for the UART, so that ppc4xx_progress() can use
939 * the UARTs nice and early. We use a 4k real==virtual mapping. */
940
941 lis r3,SERIAL_DEBUG_IO_BASE@h
942 ori r3,r3,SERIAL_DEBUG_IO_BASE@l
943 mr r4,r3
944 clrrwi r4,r4,12
945 ori r4,r4,(TLB_WR|TLB_I|TLB_M|TLB_G)
946
947 clrrwi r3,r3,12
948 ori r3,r3,(TLB_VALID | TLB_PAGESZ(PAGESZ_4K))
949
950 li r0,0 /* TLB slot 0 */
951 tlbwe r4,r0,TLB_DATA
952 tlbwe r3,r0,TLB_TAG
953#endif /* CONFIG_SERIAL_DEBUG_TEXT && SERIAL_DEBUG_IO_BASE */
954
955 isync
956
957 /* Establish the exception vector base
958 */
959 lis r4,KERNELBASE@h /* EVPR only uses the high 16-bits */
960 tophys(r0,r4) /* Use the physical address */
961 mtspr SPRN_EVPR,r0
962
963 blr
964
965_GLOBAL(abort)
966 mfspr r13,SPRN_DBCR0
967 oris r13,r13,DBCR0_RST_SYSTEM@h
968 mtspr SPRN_DBCR0,r13
969
970_GLOBAL(set_context)
971
972#ifdef CONFIG_BDI_SWITCH
973 /* Context switch the PTE pointer for the Abatron BDI2000.
974 * The PGDIR is the second parameter.
975 */
976 lis r5, KERNELBASE@h
977 lwz r5, 0xf0(r5)
978 stw r4, 0x4(r5)
979#endif
980 sync
981 mtspr SPRN_PID,r3
982 isync /* Need an isync to flush shadow */
983 /* TLBs after changing PID */
984 blr
985
986/* We put a few things here that have to be page-aligned. This stuff
987 * goes at the beginning of the data segment, which is page-aligned.
988 */
989 .data
990 .align 12
991 .globl sdata
992sdata:
993 .globl empty_zero_page
994empty_zero_page:
995 .space 4096
996 .globl swapper_pg_dir
997swapper_pg_dir:
998 .space 4096
999
1000
1001/* Stack for handling critical exceptions from kernel mode */
1002 .section .bss
1003 .align 12
1004exception_stack_bottom:
1005 .space 4096
1006critical_stack_top:
1007 .globl exception_stack_top
1008exception_stack_top:
1009
1010/* This space gets a copy of optional info passed to us by the bootstrap
1011 * which is used to pass parameters into the kernel like root=/dev/sda1, etc.
1012 */
1013 .globl cmd_line
1014cmd_line:
1015 .space 512
1016
1017/* Room for two PTE pointers, usually the kernel and current user pointers
1018 * to their respective root page table.
1019 */
1020abatron_pteptrs:
1021 .space 8
diff --git a/arch/ppc/kernel/head_8xx.S b/arch/ppc/kernel/head_8xx.S
deleted file mode 100644
index 321bda2de2cb..000000000000
--- a/arch/ppc/kernel/head_8xx.S
+++ /dev/null
@@ -1,959 +0,0 @@
1/*
2 * PowerPC version
3 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
4 * Rewritten by Cort Dougan (cort@cs.nmt.edu) for PReP
5 * Copyright (C) 1996 Cort Dougan <cort@cs.nmt.edu>
6 * Low-level exception handlers and MMU support
7 * rewritten by Paul Mackerras.
8 * Copyright (C) 1996 Paul Mackerras.
9 * MPC8xx modifications by Dan Malek
10 * Copyright (C) 1997 Dan Malek (dmalek@jlc.net).
11 *
12 * This file contains low-level support and setup for PowerPC 8xx
13 * embedded processors, including trap and interrupt dispatch.
14 *
15 * This program is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public License
17 * as published by the Free Software Foundation; either version
18 * 2 of the License, or (at your option) any later version.
19 *
20 */
21
22#include <asm/processor.h>
23#include <asm/page.h>
24#include <asm/mmu.h>
25#include <asm/cache.h>
26#include <asm/pgtable.h>
27#include <asm/cputable.h>
28#include <asm/thread_info.h>
29#include <asm/ppc_asm.h>
30#include <asm/asm-offsets.h>
31
32/* Macro to make the code more readable. */
33#ifdef CONFIG_8xx_CPU6
34#define DO_8xx_CPU6(val, reg) \
35 li reg, val; \
36 stw reg, 12(r0); \
37 lwz reg, 12(r0);
38#else
39#define DO_8xx_CPU6(val, reg)
40#endif
41 .text
42 .globl _stext
43_stext:
44 .text
45 .globl _start
46_start:
47
48/* MPC8xx
49 * This port was done on an MBX board with an 860. Right now I only
50 * support an ELF compressed (zImage) boot from EPPC-Bug because the
51 * code there loads up some registers before calling us:
52 * r3: ptr to board info data
53 * r4: initrd_start or if no initrd then 0
54 * r5: initrd_end - unused if r4 is 0
55 * r6: Start of command line string
56 * r7: End of command line string
57 *
58 * I decided to use conditional compilation instead of checking PVR and
59 * adding more processor specific branches around code I don't need.
60 * Since this is an embedded processor, I also appreciate any memory
61 * savings I can get.
62 *
63 * The MPC8xx does not have any BATs, but it supports large page sizes.
64 * We first initialize the MMU to support 8M byte pages, then load one
65 * entry into each of the instruction and data TLBs to map the first
66 * 8M 1:1. I also mapped an additional I/O space 1:1 so we can get to
67 * the "internal" processor registers before MMU_init is called.
68 *
69 * The TLB code currently contains a major hack. Since I use the condition
70 * code register, I have to save and restore it. I am out of registers, so
71 * I just store it in memory location 0 (the TLB handlers are not reentrant).
72 * To avoid making any decisions, I need to use the "segment" valid bit
73 * in the first level table, but that would require many changes to the
74 * Linux page directory/table functions that I don't want to do right now.
75 *
76 * I used to use SPRG2 for a temporary register in the TLB handler, but it
77 * has since been put to other uses. I now use a hack to save a register
78 * and the CCR at memory location 0.....Someday I'll fix this.....
79 * -- Dan
80 */
81 .globl __start
82__start:
83 mr r31,r3 /* save parameters */
84 mr r30,r4
85 mr r29,r5
86 mr r28,r6
87 mr r27,r7
88
89 /* We have to turn on the MMU right away so we get cache modes
90 * set correctly.
91 */
92 bl initial_mmu
93
94/* We now have the lower 8 Meg mapped into TLB entries, and the caches
95 * ready to work.
96 */
97
98turn_on_mmu:
99 mfmsr r0
100 ori r0,r0,MSR_DR|MSR_IR
101 mtspr SPRN_SRR1,r0
102 lis r0,start_here@h
103 ori r0,r0,start_here@l
104 mtspr SPRN_SRR0,r0
105 SYNC
106 rfi /* enables MMU */
107
108/*
109 * Exception entry code. This code runs with address translation
110 * turned off, i.e. using physical addresses.
111 * We assume sprg3 has the physical address of the current
112 * task's thread_struct.
113 */
114#define EXCEPTION_PROLOG \
115 mtspr SPRN_SPRG0,r10; \
116 mtspr SPRN_SPRG1,r11; \
117 mfcr r10; \
118 EXCEPTION_PROLOG_1; \
119 EXCEPTION_PROLOG_2
120
121#define EXCEPTION_PROLOG_1 \
122 mfspr r11,SPRN_SRR1; /* check whether user or kernel */ \
123 andi. r11,r11,MSR_PR; \
124 tophys(r11,r1); /* use tophys(r1) if kernel */ \
125 beq 1f; \
126 mfspr r11,SPRN_SPRG3; \
127 lwz r11,THREAD_INFO-THREAD(r11); \
128 addi r11,r11,THREAD_SIZE; \
129 tophys(r11,r11); \
1301: subi r11,r11,INT_FRAME_SIZE /* alloc exc. frame */
131
132
133#define EXCEPTION_PROLOG_2 \
134 CLR_TOP32(r11); \
135 stw r10,_CCR(r11); /* save registers */ \
136 stw r12,GPR12(r11); \
137 stw r9,GPR9(r11); \
138 mfspr r10,SPRN_SPRG0; \
139 stw r10,GPR10(r11); \
140 mfspr r12,SPRN_SPRG1; \
141 stw r12,GPR11(r11); \
142 mflr r10; \
143 stw r10,_LINK(r11); \
144 mfspr r12,SPRN_SRR0; \
145 mfspr r9,SPRN_SRR1; \
146 stw r1,GPR1(r11); \
147 stw r1,0(r11); \
148 tovirt(r1,r11); /* set new kernel sp */ \
149 li r10,MSR_KERNEL & ~(MSR_IR|MSR_DR); /* can take exceptions */ \
150 MTMSRD(r10); /* (except for mach check in rtas) */ \
151 stw r0,GPR0(r11); \
152 SAVE_4GPRS(3, r11); \
153 SAVE_2GPRS(7, r11)
154
155/*
156 * Note: code which follows this uses cr0.eq (set if from kernel),
157 * r11, r12 (SRR0), and r9 (SRR1).
158 *
159 * Note2: once we have set r1 we are in a position to take exceptions
160 * again, and we could thus set MSR:RI at that point.
161 */
162
163/*
164 * Exception vectors.
165 */
166#define EXCEPTION(n, label, hdlr, xfer) \
167 . = n; \
168label: \
169 EXCEPTION_PROLOG; \
170 addi r3,r1,STACK_FRAME_OVERHEAD; \
171 xfer(n, hdlr)
172
173#define EXC_XFER_TEMPLATE(n, hdlr, trap, copyee, tfer, ret) \
174 li r10,trap; \
175 stw r10,TRAP(r11); \
176 li r10,MSR_KERNEL; \
177 copyee(r10, r9); \
178 bl tfer; \
179i##n: \
180 .long hdlr; \
181 .long ret
182
183#define COPY_EE(d, s) rlwimi d,s,0,16,16
184#define NOCOPY(d, s)
185
186#define EXC_XFER_STD(n, hdlr) \
187 EXC_XFER_TEMPLATE(n, hdlr, n, NOCOPY, transfer_to_handler_full, \
188 ret_from_except_full)
189
190#define EXC_XFER_LITE(n, hdlr) \
191 EXC_XFER_TEMPLATE(n, hdlr, n+1, NOCOPY, transfer_to_handler, \
192 ret_from_except)
193
194#define EXC_XFER_EE(n, hdlr) \
195 EXC_XFER_TEMPLATE(n, hdlr, n, COPY_EE, transfer_to_handler_full, \
196 ret_from_except_full)
197
198#define EXC_XFER_EE_LITE(n, hdlr) \
199 EXC_XFER_TEMPLATE(n, hdlr, n+1, COPY_EE, transfer_to_handler, \
200 ret_from_except)
201
202/* System reset */
203 EXCEPTION(0x100, Reset, unknown_exception, EXC_XFER_STD)
204
205/* Machine check */
206 . = 0x200
207MachineCheck:
208 EXCEPTION_PROLOG
209 mfspr r4,SPRN_DAR
210 stw r4,_DAR(r11)
211 mfspr r5,SPRN_DSISR
212 stw r5,_DSISR(r11)
213 addi r3,r1,STACK_FRAME_OVERHEAD
214 EXC_XFER_STD(0x200, machine_check_exception)
215
216/* Data access exception.
217 * This is "never generated" by the MPC8xx. We jump to it for other
218 * translation errors.
219 */
220 . = 0x300
221DataAccess:
222 EXCEPTION_PROLOG
223 mfspr r10,SPRN_DSISR
224 stw r10,_DSISR(r11)
225 mr r5,r10
226 mfspr r4,SPRN_DAR
227 EXC_XFER_EE_LITE(0x300, handle_page_fault)
228
229/* Instruction access exception.
230 * This is "never generated" by the MPC8xx. We jump to it for other
231 * translation errors.
232 */
233 . = 0x400
234InstructionAccess:
235 EXCEPTION_PROLOG
236 mr r4,r12
237 mr r5,r9
238 EXC_XFER_EE_LITE(0x400, handle_page_fault)
239
240/* External interrupt */
241 EXCEPTION(0x500, HardwareInterrupt, do_IRQ, EXC_XFER_LITE)
242
243/* Alignment exception */
244 . = 0x600
245Alignment:
246 EXCEPTION_PROLOG
247 mfspr r4,SPRN_DAR
248 stw r4,_DAR(r11)
249 mfspr r5,SPRN_DSISR
250 stw r5,_DSISR(r11)
251 addi r3,r1,STACK_FRAME_OVERHEAD
252 EXC_XFER_EE(0x600, alignment_exception)
253
254/* Program check exception */
255 EXCEPTION(0x700, ProgramCheck, program_check_exception, EXC_XFER_STD)
256
257/* No FPU on MPC8xx. This exception is not supposed to happen.
258*/
259 EXCEPTION(0x800, FPUnavailable, unknown_exception, EXC_XFER_STD)
260
261/* Decrementer */
262 EXCEPTION(0x900, Decrementer, timer_interrupt, EXC_XFER_LITE)
263
264 EXCEPTION(0xa00, Trap_0a, unknown_exception, EXC_XFER_EE)
265 EXCEPTION(0xb00, Trap_0b, unknown_exception, EXC_XFER_EE)
266
267/* System call */
268 . = 0xc00
269SystemCall:
270 EXCEPTION_PROLOG
271 EXC_XFER_EE_LITE(0xc00, DoSyscall)
272
273/* Single step - not used on 601 */
274 EXCEPTION(0xd00, SingleStep, single_step_exception, EXC_XFER_STD)
275 EXCEPTION(0xe00, Trap_0e, unknown_exception, EXC_XFER_EE)
276 EXCEPTION(0xf00, Trap_0f, unknown_exception, EXC_XFER_EE)
277
278/* On the MPC8xx, this is a software emulation interrupt. It occurs
279 * for all unimplemented and illegal instructions.
280 */
281 EXCEPTION(0x1000, SoftEmu, SoftwareEmulation, EXC_XFER_STD)
282
283 . = 0x1100
284/*
285 * For the MPC8xx, this is a software tablewalk to load the instruction
286 * TLB. It is modelled after the example in the Motorola manual. The task
287 * switch loads the M_TWB register with the pointer to the first level table.
288 * If we discover there is no second level table (value is zero) or if there
289 * is an invalid pte, we load that into the TLB, which causes another fault
290 * into the TLB Error interrupt where we can handle such problems.
291 * We have to use the MD_xxx registers for the tablewalk because the
292 * equivalent MI_xxx registers only perform the attribute functions.
293 */
294InstructionTLBMiss:
295#ifdef CONFIG_8xx_CPU6
296 stw r3, 8(r0)
297#endif
298 DO_8xx_CPU6(0x3f80, r3)
299 mtspr SPRN_M_TW, r10 /* Save a couple of working registers */
300 mfcr r10
301 stw r10, 0(r0)
302 stw r11, 4(r0)
303 mfspr r10, SPRN_SRR0 /* Get effective address of fault */
304 DO_8xx_CPU6(0x3780, r3)
305 mtspr SPRN_MD_EPN, r10 /* Have to use MD_EPN for walk, MI_EPN can't */
306 mfspr r10, SPRN_M_TWB /* Get level 1 table entry address */
307
308 /* If we are faulting a kernel address, we have to use the
309 * kernel page tables.
310 */
311 andi. r11, r10, 0x0800 /* Address >= 0x80000000 */
312 beq 3f
313 lis r11, swapper_pg_dir@h
314 ori r11, r11, swapper_pg_dir@l
315 rlwimi r10, r11, 0, 2, 19
3163:
317 lwz r11, 0(r10) /* Get the level 1 entry */
318 rlwinm. r10, r11,0,0,19 /* Extract page descriptor page address */
319 beq 2f /* If zero, don't try to find a pte */
320
321 /* We have a pte table, so load the MI_TWC with the attributes
322 * for this "segment."
323 */
324 ori r11,r11,1 /* Set valid bit */
325 DO_8xx_CPU6(0x2b80, r3)
326 mtspr SPRN_MI_TWC, r11 /* Set segment attributes */
327 DO_8xx_CPU6(0x3b80, r3)
328 mtspr SPRN_MD_TWC, r11 /* Load pte table base address */
329 mfspr r11, SPRN_MD_TWC /* ....and get the pte address */
330 lwz r10, 0(r11) /* Get the pte */
331
332#ifdef CONFIG_SWAP
333 /* do not set the _PAGE_ACCESSED bit of a non-present page */
334 andi. r11, r10, _PAGE_PRESENT
335 beq 4f
336 ori r10, r10, _PAGE_ACCESSED
337 mfspr r11, SPRN_MD_TWC /* get the pte address again */
338 stw r10, 0(r11)
3394:
340#else
341 ori r10, r10, _PAGE_ACCESSED
342 stw r10, 0(r11)
343#endif
344
345 /* The Linux PTE won't go exactly into the MMU TLB.
346 * Software indicator bits 21, 22 and 28 must be clear.
347 * Software indicator bits 24, 25, 26, and 27 must be
348 * set. All other Linux PTE bits control the behavior
349 * of the MMU.
350 */
3512: li r11, 0x00f0
352 rlwimi r10, r11, 0, 24, 28 /* Set 24-27, clear 28 */
353 DO_8xx_CPU6(0x2d80, r3)
354 mtspr SPRN_MI_RPN, r10 /* Update TLB entry */
355
356 mfspr r10, SPRN_M_TW /* Restore registers */
357 lwz r11, 0(r0)
358 mtcr r11
359 lwz r11, 4(r0)
360#ifdef CONFIG_8xx_CPU6
361 lwz r3, 8(r0)
362#endif
363 rfi
364
365 . = 0x1200
366DataStoreTLBMiss:
367 stw r3, 8(r0)
368 DO_8xx_CPU6(0x3f80, r3)
369 mtspr SPRN_M_TW, r10 /* Save a couple of working registers */
370 mfcr r10
371 stw r10, 0(r0)
372 stw r11, 4(r0)
373 mfspr r10, SPRN_M_TWB /* Get level 1 table entry address */
374
375 /* If we are faulting a kernel address, we have to use the
376 * kernel page tables.
377 */
378 andi. r11, r10, 0x0800
379 beq 3f
380 lis r11, swapper_pg_dir@h
381 ori r11, r11, swapper_pg_dir@l
382 rlwimi r10, r11, 0, 2, 19
383 stw r12, 16(r0)
384 b LoadLargeDTLB
3853:
386 lwz r11, 0(r10) /* Get the level 1 entry */
387 rlwinm. r10, r11,0,0,19 /* Extract page descriptor page address */
388 beq 2f /* If zero, don't try to find a pte */
389
390 /* We have a pte table, so load fetch the pte from the table.
391 */
392 ori r11, r11, 1 /* Set valid bit in physical L2 page */
393 DO_8xx_CPU6(0x3b80, r3)
394 mtspr SPRN_MD_TWC, r11 /* Load pte table base address */
395 mfspr r10, SPRN_MD_TWC /* ....and get the pte address */
396 lwz r10, 0(r10) /* Get the pte */
397
398 /* Insert the Guarded flag into the TWC from the Linux PTE.
399 * It is bit 27 of both the Linux PTE and the TWC (at least
400 * I got that right :-). It will be better when we can put
401 * this into the Linux pgd/pmd and load it in the operation
402 * above.
403 */
404 rlwimi r11, r10, 0, 27, 27
405 DO_8xx_CPU6(0x3b80, r3)
406 mtspr SPRN_MD_TWC, r11
407
408#ifdef CONFIG_SWAP
409 /* do not set the _PAGE_ACCESSED bit of a non-present page */
410 andi. r11, r10, _PAGE_PRESENT
411 beq 4f
412 ori r10, r10, _PAGE_ACCESSED
4134:
414 /* and update pte in table */
415#else
416 ori r10, r10, _PAGE_ACCESSED
417#endif
418 mfspr r11, SPRN_MD_TWC /* get the pte address again */
419 stw r10, 0(r11)
420
421 /* The Linux PTE won't go exactly into the MMU TLB.
422 * Software indicator bits 21, 22 and 28 must be clear.
423 * Software indicator bits 24, 25, 26, and 27 must be
424 * set. All other Linux PTE bits control the behavior
425 * of the MMU.
426 */
4272: li r11, 0x00f0
428 rlwimi r10, r11, 0, 24, 28 /* Set 24-27, clear 28 */
429 DO_8xx_CPU6(0x3d80, r3)
430 mtspr SPRN_MD_RPN, r10 /* Update TLB entry */
431
432 mfspr r10, SPRN_M_TW /* Restore registers */
433 lwz r11, 0(r0)
434 mtcr r11
435 lwz r11, 4(r0)
436 lwz r3, 8(r0)
437 rfi
438
439/* This is an instruction TLB error on the MPC8xx. This could be due
440 * to many reasons, such as executing guarded memory or illegal instruction
441 * addresses. There is nothing to do but handle a big time error fault.
442 */
443 . = 0x1300
444InstructionTLBError:
445 b InstructionAccess
446
447LoadLargeDTLB:
448 li r12, 0
449 lwz r11, 0(r10) /* Get the level 1 entry */
450 rlwinm. r10, r11,0,0,19 /* Extract page descriptor page address */
451 beq 3f /* If zero, don't try to find a pte */
452
453 /* We have a pte table, so load fetch the pte from the table.
454 */
455 ori r11, r11, 1 /* Set valid bit in physical L2 page */
456 DO_8xx_CPU6(0x3b80, r3)
457 mtspr SPRN_MD_TWC, r11 /* Load pte table base address */
458 mfspr r10, SPRN_MD_TWC /* ....and get the pte address */
459 lwz r10, 0(r10) /* Get the pte */
460
461 /* Insert the Guarded flag into the TWC from the Linux PTE.
462 * It is bit 27 of both the Linux PTE and the TWC (at least
463 * I got that right :-). It will be better when we can put
464 * this into the Linux pgd/pmd and load it in the operation
465 * above.
466 */
467 rlwimi r11, r10, 0, 27, 27
468
469 rlwimi r12, r10, 0, 0, 9 /* extract phys. addr */
470 mfspr r3, SPRN_MD_EPN
471 rlwinm r3, r3, 0, 0, 9 /* extract virtual address */
472 tophys(r3, r3)
473 cmpw r3, r12 /* only use 8M page if it is a direct
474 kernel mapping */
475 bne 1f
476 ori r11, r11, MD_PS8MEG
477 li r12, 1
478 b 2f
4791:
480 li r12, 0 /* can't use 8MB TLB, so zero r12. */
4812:
482 DO_8xx_CPU6(0x3b80, r3)
483 mtspr SPRN_MD_TWC, r11
484
485 /* The Linux PTE won't go exactly into the MMU TLB.
486 * Software indicator bits 21, 22 and 28 must be clear.
487 * Software indicator bits 24, 25, 26, and 27 must be
488 * set. All other Linux PTE bits control the behavior
489 * of the MMU.
490 */
4913: li r11, 0x00f0
492 rlwimi r10, r11, 0, 24, 28 /* Set 24-27, clear 28 */
493 cmpwi r12, 1
494 bne 4f
495 ori r10, r10, 0x8
496
497 mfspr r12, SPRN_MD_EPN
498 lis r3, 0xff80 /* 10-19 must be clear for 8MB TLB */
499 ori r3, r3, 0x0fff
500 and r12, r3, r12
501 DO_8xx_CPU6(0x3780, r3)
502 mtspr SPRN_MD_EPN, r12
503
504 lis r3, 0xff80 /* 10-19 must be clear for 8MB TLB */
505 ori r3, r3, 0x0fff
506 and r10, r3, r10
5074:
508 DO_8xx_CPU6(0x3d80, r3)
509 mtspr SPRN_MD_RPN, r10 /* Update TLB entry */
510
511 mfspr r10, SPRN_M_TW /* Restore registers */
512 lwz r11, 0(r0)
513 mtcr r11
514 lwz r11, 4(r0)
515
516 lwz r12, 16(r0)
517 lwz r3, 8(r0)
518 rfi
519
520/* This is the data TLB error on the MPC8xx. This could be due to
521 * many reasons, including a dirty update to a pte. We can catch that
522 * one here, but anything else is an error. First, we track down the
523 * Linux pte. If it is valid, write access is allowed, but the
524 * page dirty bit is not set, we will set it and reload the TLB. For
525 * any other case, we bail out to a higher level function that can
526 * handle it.
527 */
528 . = 0x1400
529DataTLBError:
530#ifdef CONFIG_8xx_CPU6
531 stw r3, 8(r0)
532#endif
533 DO_8xx_CPU6(0x3f80, r3)
534 mtspr SPRN_M_TW, r10 /* Save a couple of working registers */
535 mfcr r10
536 stw r10, 0(r0)
537 stw r11, 4(r0)
538
539 /* First, make sure this was a store operation.
540 */
541 mfspr r10, SPRN_DSISR
542 andis. r11, r10, 0x0200 /* If set, indicates store op */
543 beq 2f
544
545 /* The EA of a data TLB miss is automatically stored in the MD_EPN
546 * register. The EA of a data TLB error is automatically stored in
547 * the DAR, but not the MD_EPN register. We must copy the 20 most
548 * significant bits of the EA from the DAR to MD_EPN before we
549 * start walking the page tables. We also need to copy the CASID
550 * value from the M_CASID register.
551 * Addendum: The EA of a data TLB error is _supposed_ to be stored
552 * in DAR, but it seems that this doesn't happen in some cases, such
553 * as when the error is due to a dcbi instruction to a page with a
554 * TLB that doesn't have the changed bit set. In such cases, there
555 * does not appear to be any way to recover the EA of the error
556 * since it is neither in DAR nor MD_EPN. As a workaround, the
557 * _PAGE_HWWRITE bit is set for all kernel data pages when the PTEs
558 * are initialized in mapin_ram(). This will avoid the problem,
559 * assuming we only use the dcbi instruction on kernel addresses.
560 */
561 mfspr r10, SPRN_DAR
562 rlwinm r11, r10, 0, 0, 19
563 ori r11, r11, MD_EVALID
564 mfspr r10, SPRN_M_CASID
565 rlwimi r11, r10, 0, 28, 31
566 DO_8xx_CPU6(0x3780, r3)
567 mtspr SPRN_MD_EPN, r11
568
569 mfspr r10, SPRN_M_TWB /* Get level 1 table entry address */
570
571 /* If we are faulting a kernel address, we have to use the
572 * kernel page tables.
573 */
574 andi. r11, r10, 0x0800
575 beq 3f
576 lis r11, swapper_pg_dir@h
577 ori r11, r11, swapper_pg_dir@l
578 rlwimi r10, r11, 0, 2, 19
5793:
580 lwz r11, 0(r10) /* Get the level 1 entry */
581 rlwinm. r10, r11,0,0,19 /* Extract page descriptor page address */
582 beq 2f /* If zero, bail */
583
584 /* We have a pte table, so fetch the pte from the table.
585 */
586 ori r11, r11, 1 /* Set valid bit in physical L2 page */
587 DO_8xx_CPU6(0x3b80, r3)
588 mtspr SPRN_MD_TWC, r11 /* Load pte table base address */
589 mfspr r11, SPRN_MD_TWC /* ....and get the pte address */
590 lwz r10, 0(r11) /* Get the pte */
591
592 andi. r11, r10, _PAGE_RW /* Is it writeable? */
593 beq 2f /* Bail out if not */
594
595 /* Update 'changed', among others.
596 */
597#ifdef CONFIG_SWAP
598 ori r10, r10, _PAGE_DIRTY|_PAGE_HWWRITE
599 /* do not set the _PAGE_ACCESSED bit of a non-present page */
600 andi. r11, r10, _PAGE_PRESENT
601 beq 4f
602 ori r10, r10, _PAGE_ACCESSED
6034:
604#else
605 ori r10, r10, _PAGE_DIRTY|_PAGE_ACCESSED|_PAGE_HWWRITE
606#endif
607 mfspr r11, SPRN_MD_TWC /* Get pte address again */
608 stw r10, 0(r11) /* and update pte in table */
609
610 /* The Linux PTE won't go exactly into the MMU TLB.
611 * Software indicator bits 21, 22 and 28 must be clear.
612 * Software indicator bits 24, 25, 26, and 27 must be
613 * set. All other Linux PTE bits control the behavior
614 * of the MMU.
615 */
616 li r11, 0x00f0
617 rlwimi r10, r11, 0, 24, 28 /* Set 24-27, clear 28 */
618 DO_8xx_CPU6(0x3d80, r3)
619 mtspr SPRN_MD_RPN, r10 /* Update TLB entry */
620
621 mfspr r10, SPRN_M_TW /* Restore registers */
622 lwz r11, 0(r0)
623 mtcr r11
624 lwz r11, 4(r0)
625#ifdef CONFIG_8xx_CPU6
626 lwz r3, 8(r0)
627#endif
628 rfi
6292:
630 mfspr r10, SPRN_M_TW /* Restore registers */
631 lwz r11, 0(r0)
632 mtcr r11
633 lwz r11, 4(r0)
634#ifdef CONFIG_8xx_CPU6
635 lwz r3, 8(r0)
636#endif
637 b DataAccess
638
639 EXCEPTION(0x1500, Trap_15, unknown_exception, EXC_XFER_EE)
640 EXCEPTION(0x1600, Trap_16, unknown_exception, EXC_XFER_EE)
641 EXCEPTION(0x1700, Trap_17, unknown_exception, EXC_XFER_EE)
642 EXCEPTION(0x1800, Trap_18, unknown_exception, EXC_XFER_EE)
643 EXCEPTION(0x1900, Trap_19, unknown_exception, EXC_XFER_EE)
644 EXCEPTION(0x1a00, Trap_1a, unknown_exception, EXC_XFER_EE)
645 EXCEPTION(0x1b00, Trap_1b, unknown_exception, EXC_XFER_EE)
646
647/* On the MPC8xx, these next four traps are used for development
648 * support of breakpoints and such. Someday I will get around to
649 * using them.
650 */
651 EXCEPTION(0x1c00, Trap_1c, unknown_exception, EXC_XFER_EE)
652 EXCEPTION(0x1d00, Trap_1d, unknown_exception, EXC_XFER_EE)
653 EXCEPTION(0x1e00, Trap_1e, unknown_exception, EXC_XFER_EE)
654 EXCEPTION(0x1f00, Trap_1f, unknown_exception, EXC_XFER_EE)
655
656 . = 0x2000
657
658 .globl giveup_fpu
659giveup_fpu:
660 blr
661
662/*
663 * This is where the main kernel code starts.
664 */
665start_here:
666 /* ptr to current */
667 lis r2,init_task@h
668 ori r2,r2,init_task@l
669
670 /* ptr to phys current thread */
671 tophys(r4,r2)
672 addi r4,r4,THREAD /* init task's THREAD */
673 mtspr SPRN_SPRG3,r4
674 li r3,0
675 mtspr SPRN_SPRG2,r3 /* 0 => r1 has kernel sp */
676
677 /* stack */
678 lis r1,init_thread_union@ha
679 addi r1,r1,init_thread_union@l
680 li r0,0
681 stwu r0,THREAD_SIZE-STACK_FRAME_OVERHEAD(r1)
682
683 bl early_init /* We have to do this with MMU on */
684
685/*
686 * Decide what sort of machine this is and initialize the MMU.
687 */
688 mr r3,r31
689 mr r4,r30
690 mr r5,r29
691 mr r6,r28
692 mr r7,r27
693 bl machine_init
694 bl MMU_init
695
696/*
697 * Go back to running unmapped so we can load up new values
698 * and change to using our exception vectors.
699 * On the 8xx, all we have to do is invalidate the TLB to clear
700 * the old 8M byte TLB mappings and load the page table base register.
701 */
702 /* The right way to do this would be to track it down through
703 * init's THREAD like the context switch code does, but this is
704 * easier......until someone changes init's static structures.
705 */
706 lis r6, swapper_pg_dir@h
707 ori r6, r6, swapper_pg_dir@l
708 tophys(r6,r6)
709#ifdef CONFIG_8xx_CPU6
710 lis r4, cpu6_errata_word@h
711 ori r4, r4, cpu6_errata_word@l
712 li r3, 0x3980
713 stw r3, 12(r4)
714 lwz r3, 12(r4)
715#endif
716 mtspr SPRN_M_TWB, r6
717 lis r4,2f@h
718 ori r4,r4,2f@l
719 tophys(r4,r4)
720 li r3,MSR_KERNEL & ~(MSR_IR|MSR_DR)
721 mtspr SPRN_SRR0,r4
722 mtspr SPRN_SRR1,r3
723 rfi
724/* Load up the kernel context */
7252:
726 SYNC /* Force all PTE updates to finish */
727 tlbia /* Clear all TLB entries */
728 sync /* wait for tlbia/tlbie to finish */
729 TLBSYNC /* ... on all CPUs */
730
731 /* set up the PTE pointers for the Abatron bdiGDB.
732 */
733 tovirt(r6,r6)
734 lis r5, abatron_pteptrs@h
735 ori r5, r5, abatron_pteptrs@l
736 stw r5, 0xf0(r0) /* Must match your Abatron config file */
737 tophys(r5,r5)
738 stw r6, 0(r5)
739
740/* Now turn on the MMU for real! */
741 li r4,MSR_KERNEL
742 lis r3,start_kernel@h
743 ori r3,r3,start_kernel@l
744 mtspr SPRN_SRR0,r3
745 mtspr SPRN_SRR1,r4
746 rfi /* enable MMU and jump to start_kernel */
747
748/* Set up the initial MMU state so we can do the first level of
749 * kernel initialization. This maps the first 8 MBytes of memory 1:1
750 * virtual to physical. Also, set the cache mode since that is defined
751 * by TLB entries and perform any additional mapping (like of the IMMR).
752 * If configured to pin some TLBs, we pin the first 8 Mbytes of kernel,
753 * 24 Mbytes of data, and the 8M IMMR space. Anything not covered by
754 * these mappings is mapped by page tables.
755 */
756initial_mmu:
757 tlbia /* Invalidate all TLB entries */
758#ifdef CONFIG_PIN_TLB
759 lis r8, MI_RSV4I@h
760 ori r8, r8, 0x1c00
761#else
762 li r8, 0
763#endif
764 mtspr SPRN_MI_CTR, r8 /* Set instruction MMU control */
765
766#ifdef CONFIG_PIN_TLB
767 lis r10, (MD_RSV4I | MD_RESETVAL)@h
768 ori r10, r10, 0x1c00
769 mr r8, r10
770#else
771 lis r10, MD_RESETVAL@h
772#endif
773#ifndef CONFIG_8xx_COPYBACK
774 oris r10, r10, MD_WTDEF@h
775#endif
776 mtspr SPRN_MD_CTR, r10 /* Set data TLB control */
777
778 /* Now map the lower 8 Meg into the TLBs. For this quick hack,
779 * we can load the instruction and data TLB registers with the
780 * same values.
781 */
782 lis r8, KERNELBASE@h /* Create vaddr for TLB */
783 ori r8, r8, MI_EVALID /* Mark it valid */
784 mtspr SPRN_MI_EPN, r8
785 mtspr SPRN_MD_EPN, r8
786 li r8, MI_PS8MEG /* Set 8M byte page */
787 ori r8, r8, MI_SVALID /* Make it valid */
788 mtspr SPRN_MI_TWC, r8
789 mtspr SPRN_MD_TWC, r8
790 li r8, MI_BOOTINIT /* Create RPN for address 0 */
791 mtspr SPRN_MI_RPN, r8 /* Store TLB entry */
792 mtspr SPRN_MD_RPN, r8
793 lis r8, MI_Kp@h /* Set the protection mode */
794 mtspr SPRN_MI_AP, r8
795 mtspr SPRN_MD_AP, r8
796
797 /* Map another 8 MByte at the IMMR to get the processor
798 * internal registers (among other things).
799 */
800#ifdef CONFIG_PIN_TLB
801 addi r10, r10, 0x0100
802 mtspr SPRN_MD_CTR, r10
803#endif
804 mfspr r9, 638 /* Get current IMMR */
805 andis. r9, r9, 0xff80 /* Get 8Mbyte boundary */
806
807 mr r8, r9 /* Create vaddr for TLB */
808 ori r8, r8, MD_EVALID /* Mark it valid */
809 mtspr SPRN_MD_EPN, r8
810 li r8, MD_PS8MEG /* Set 8M byte page */
811 ori r8, r8, MD_SVALID /* Make it valid */
812 mtspr SPRN_MD_TWC, r8
813 mr r8, r9 /* Create paddr for TLB */
814 ori r8, r8, MI_BOOTINIT|0x2 /* Inhibit cache -- Cort */
815 mtspr SPRN_MD_RPN, r8
816
817#ifdef CONFIG_PIN_TLB
818 /* Map two more 8M kernel data pages.
819 */
820 addi r10, r10, 0x0100
821 mtspr SPRN_MD_CTR, r10
822
823 lis r8, KERNELBASE@h /* Create vaddr for TLB */
824 addis r8, r8, 0x0080 /* Add 8M */
825 ori r8, r8, MI_EVALID /* Mark it valid */
826 mtspr SPRN_MD_EPN, r8
827 li r9, MI_PS8MEG /* Set 8M byte page */
828 ori r9, r9, MI_SVALID /* Make it valid */
829 mtspr SPRN_MD_TWC, r9
830 li r11, MI_BOOTINIT /* Create RPN for address 0 */
831 addis r11, r11, 0x0080 /* Add 8M */
832 mtspr SPRN_MD_RPN, r11
833
834 addi r10, r10, 0x0100
835 mtspr SPRN_MD_CTR, r10
836
837 addis r8, r8, 0x0080 /* Add 8M */
838 mtspr SPRN_MD_EPN, r8
839 mtspr SPRN_MD_TWC, r9
840 addis r11, r11, 0x0080 /* Add 8M */
841 mtspr SPRN_MD_RPN, r11
842#endif
843
844 /* Since the cache is enabled according to the information we
845 * just loaded into the TLB, invalidate and enable the caches here.
846 * We should probably check/set other modes....later.
847 */
848 lis r8, IDC_INVALL@h
849 mtspr SPRN_IC_CST, r8
850 mtspr SPRN_DC_CST, r8
851 lis r8, IDC_ENABLE@h
852 mtspr SPRN_IC_CST, r8
853#ifdef CONFIG_8xx_COPYBACK
854 mtspr SPRN_DC_CST, r8
855#else
856 /* For a debug option, I left this here to easily enable
857 * the write through cache mode
858 */
859 lis r8, DC_SFWT@h
860 mtspr SPRN_DC_CST, r8
861 lis r8, IDC_ENABLE@h
862 mtspr SPRN_DC_CST, r8
863#endif
864 blr
865
866
867/*
868 * Set up to use a given MMU context.
869 * r3 is context number, r4 is PGD pointer.
870 *
871 * We place the physical address of the new task page directory loaded
872 * into the MMU base register, and set the ASID compare register with
873 * the new "context."
874 */
875_GLOBAL(set_context)
876
877#ifdef CONFIG_BDI_SWITCH
878 /* Context switch the PTE pointer for the Abatron BDI2000.
879 * The PGDIR is passed as second argument.
880 */
881 lis r5, KERNELBASE@h
882 lwz r5, 0xf0(r5)
883 stw r4, 0x4(r5)
884#endif
885
886#ifdef CONFIG_8xx_CPU6
887 lis r6, cpu6_errata_word@h
888 ori r6, r6, cpu6_errata_word@l
889 tophys (r4, r4)
890 li r7, 0x3980
891 stw r7, 12(r6)
892 lwz r7, 12(r6)
893 mtspr SPRN_M_TWB, r4 /* Update MMU base address */
894 li r7, 0x3380
895 stw r7, 12(r6)
896 lwz r7, 12(r6)
897 mtspr SPRN_M_CASID, r3 /* Update context */
898#else
899 mtspr SPRN_M_CASID,r3 /* Update context */
900 tophys (r4, r4)
901 mtspr SPRN_M_TWB, r4 /* and pgd */
902#endif
903 SYNC
904 blr
905
906#ifdef CONFIG_8xx_CPU6
907/* It's here because it is unique to the 8xx.
908 * It is important we get called with interrupts disabled. I used to
909 * do that, but it appears that all code that calls this already had
910 * interrupt disabled.
911 */
912 .globl set_dec_cpu6
913set_dec_cpu6:
914 lis r7, cpu6_errata_word@h
915 ori r7, r7, cpu6_errata_word@l
916 li r4, 0x2c00
917 stw r4, 8(r7)
918 lwz r4, 8(r7)
919 mtspr 22, r3 /* Update Decrementer */
920 SYNC
921 blr
922#endif
923
924/*
925 * We put a few things here that have to be page-aligned.
926 * This stuff goes at the beginning of the data segment,
927 * which is page-aligned.
928 */
929 .data
930 .globl sdata
931sdata:
932 .globl empty_zero_page
933empty_zero_page:
934 .space 4096
935
936 .globl swapper_pg_dir
937swapper_pg_dir:
938 .space 4096
939
940/*
941 * This space gets a copy of optional info passed to us by the bootstrap
942 * Used to pass parameters into the kernel like root=/dev/sda1, etc.
943 */
944 .globl cmd_line
945cmd_line:
946 .space 512
947
948/* Room for two PTE table poiners, usually the kernel and current user
949 * pointer to their respective root page table (pgdir).
950 */
951abatron_pteptrs:
952 .space 8
953
954#ifdef CONFIG_8xx_CPU6
955 .globl cpu6_errata_word
956cpu6_errata_word:
957 .space 16
958#endif
959
diff --git a/arch/ppc/kernel/head_booke.h b/arch/ppc/kernel/head_booke.h
deleted file mode 100644
index 166d597b6db2..000000000000
--- a/arch/ppc/kernel/head_booke.h
+++ /dev/null
@@ -1,308 +0,0 @@
1#ifndef __HEAD_BOOKE_H__
2#define __HEAD_BOOKE_H__
3
4/*
5 * Macros used for common Book-e exception handling
6 */
7
8#define SET_IVOR(vector_number, vector_label) \
9 li r26,vector_label@l; \
10 mtspr SPRN_IVOR##vector_number,r26; \
11 sync
12
13#define NORMAL_EXCEPTION_PROLOG \
14 mtspr SPRN_SPRG0,r10; /* save two registers to work with */\
15 mtspr SPRN_SPRG1,r11; \
16 mtspr SPRN_SPRG4W,r1; \
17 mfcr r10; /* save CR in r10 for now */\
18 mfspr r11,SPRN_SRR1; /* check whether user or kernel */\
19 andi. r11,r11,MSR_PR; \
20 beq 1f; \
21 mfspr r1,SPRN_SPRG3; /* if from user, start at top of */\
22 lwz r1,THREAD_INFO-THREAD(r1); /* this thread's kernel stack */\
23 addi r1,r1,THREAD_SIZE; \
241: subi r1,r1,INT_FRAME_SIZE; /* Allocate an exception frame */\
25 mr r11,r1; \
26 stw r10,_CCR(r11); /* save various registers */\
27 stw r12,GPR12(r11); \
28 stw r9,GPR9(r11); \
29 mfspr r10,SPRN_SPRG0; \
30 stw r10,GPR10(r11); \
31 mfspr r12,SPRN_SPRG1; \
32 stw r12,GPR11(r11); \
33 mflr r10; \
34 stw r10,_LINK(r11); \
35 mfspr r10,SPRN_SPRG4R; \
36 mfspr r12,SPRN_SRR0; \
37 stw r10,GPR1(r11); \
38 mfspr r9,SPRN_SRR1; \
39 stw r10,0(r11); \
40 rlwinm r9,r9,0,14,12; /* clear MSR_WE (necessary?) */\
41 stw r0,GPR0(r11); \
42 SAVE_4GPRS(3, r11); \
43 SAVE_2GPRS(7, r11)
44
45/* To handle the additional exception priority levels on 40x and Book-E
46 * processors we allocate a 4k stack per additional priority level. The various
47 * head_xxx.S files allocate space (exception_stack_top) for each priority's
48 * stack times the number of CPUs
49 *
50 * On 40x critical is the only additional level
51 * On 44x/e500 we have critical and machine check
52 * On e200 we have critical and debug (machine check occurs via critical)
53 *
54 * Additionally we reserve a SPRG for each priority level so we can free up a
55 * GPR to use as the base for indirect access to the exception stacks. This
56 * is necessary since the MMU is always on, for Book-E parts, and the stacks
57 * are offset from KERNELBASE.
58 *
59 */
60#define BOOKE_EXCEPTION_STACK_SIZE (8192)
61
62/* CRIT_SPRG only used in critical exception handling */
63#define CRIT_SPRG SPRN_SPRG2
64/* MCHECK_SPRG only used in machine check exception handling */
65#define MCHECK_SPRG SPRN_SPRG6W
66
67#define MCHECK_STACK_TOP (exception_stack_top - 4096)
68#define CRIT_STACK_TOP (exception_stack_top)
69
70/* only on e200 for now */
71#define DEBUG_STACK_TOP (exception_stack_top - 4096)
72#define DEBUG_SPRG SPRN_SPRG6W
73
74#ifdef CONFIG_SMP
75#define BOOKE_LOAD_EXC_LEVEL_STACK(level) \
76 mfspr r8,SPRN_PIR; \
77 mulli r8,r8,BOOKE_EXCEPTION_STACK_SIZE; \
78 neg r8,r8; \
79 addis r8,r8,level##_STACK_TOP@ha; \
80 addi r8,r8,level##_STACK_TOP@l
81#else
82#define BOOKE_LOAD_EXC_LEVEL_STACK(level) \
83 lis r8,level##_STACK_TOP@h; \
84 ori r8,r8,level##_STACK_TOP@l
85#endif
86
87/*
88 * Exception prolog for critical/machine check exceptions. This is a
89 * little different from the normal exception prolog above since a
90 * critical/machine check exception can potentially occur at any point
91 * during normal exception processing. Thus we cannot use the same SPRG
92 * registers as the normal prolog above. Instead we use a portion of the
93 * critical/machine check exception stack at low physical addresses.
94 */
95#define EXC_LEVEL_EXCEPTION_PROLOG(exc_level, exc_level_srr0, exc_level_srr1) \
96 mtspr exc_level##_SPRG,r8; \
97 BOOKE_LOAD_EXC_LEVEL_STACK(exc_level);/* r8 points to the exc_level stack*/ \
98 stw r10,GPR10-INT_FRAME_SIZE(r8); \
99 stw r11,GPR11-INT_FRAME_SIZE(r8); \
100 mfcr r10; /* save CR in r10 for now */\
101 mfspr r11,exc_level_srr1; /* check whether user or kernel */\
102 andi. r11,r11,MSR_PR; \
103 mr r11,r8; \
104 mfspr r8,exc_level##_SPRG; \
105 beq 1f; \
106 /* COMING FROM USER MODE */ \
107 mfspr r11,SPRN_SPRG3; /* if from user, start at top of */\
108 lwz r11,THREAD_INFO-THREAD(r11); /* this thread's kernel stack */\
109 addi r11,r11,THREAD_SIZE; \
1101: subi r11,r11,INT_FRAME_SIZE; /* Allocate an exception frame */\
111 stw r10,_CCR(r11); /* save various registers */\
112 stw r12,GPR12(r11); \
113 stw r9,GPR9(r11); \
114 mflr r10; \
115 stw r10,_LINK(r11); \
116 mfspr r12,SPRN_DEAR; /* save DEAR and ESR in the frame */\
117 stw r12,_DEAR(r11); /* since they may have had stuff */\
118 mfspr r9,SPRN_ESR; /* in them at the point where the */\
119 stw r9,_ESR(r11); /* exception was taken */\
120 mfspr r12,exc_level_srr0; \
121 stw r1,GPR1(r11); \
122 mfspr r9,exc_level_srr1; \
123 stw r1,0(r11); \
124 mr r1,r11; \
125 rlwinm r9,r9,0,14,12; /* clear MSR_WE (necessary?) */\
126 stw r0,GPR0(r11); \
127 SAVE_4GPRS(3, r11); \
128 SAVE_2GPRS(7, r11)
129
130#define CRITICAL_EXCEPTION_PROLOG \
131 EXC_LEVEL_EXCEPTION_PROLOG(CRIT, SPRN_CSRR0, SPRN_CSRR1)
132#define DEBUG_EXCEPTION_PROLOG \
133 EXC_LEVEL_EXCEPTION_PROLOG(DEBUG, SPRN_DSRR0, SPRN_DSRR1)
134#define MCHECK_EXCEPTION_PROLOG \
135 EXC_LEVEL_EXCEPTION_PROLOG(MCHECK, SPRN_MCSRR0, SPRN_MCSRR1)
136
137/*
138 * Exception vectors.
139 */
140#define START_EXCEPTION(label) \
141 .align 5; \
142label:
143
144#define FINISH_EXCEPTION(func) \
145 bl transfer_to_handler_full; \
146 .long func; \
147 .long ret_from_except_full
148
149#define EXCEPTION(n, label, hdlr, xfer) \
150 START_EXCEPTION(label); \
151 NORMAL_EXCEPTION_PROLOG; \
152 addi r3,r1,STACK_FRAME_OVERHEAD; \
153 xfer(n, hdlr)
154
155#define CRITICAL_EXCEPTION(n, label, hdlr) \
156 START_EXCEPTION(label); \
157 CRITICAL_EXCEPTION_PROLOG; \
158 addi r3,r1,STACK_FRAME_OVERHEAD; \
159 EXC_XFER_TEMPLATE(hdlr, n+2, (MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)), \
160 NOCOPY, crit_transfer_to_handler, \
161 ret_from_crit_exc)
162
163#define MCHECK_EXCEPTION(n, label, hdlr) \
164 START_EXCEPTION(label); \
165 MCHECK_EXCEPTION_PROLOG; \
166 mfspr r5,SPRN_ESR; \
167 stw r5,_ESR(r11); \
168 addi r3,r1,STACK_FRAME_OVERHEAD; \
169 EXC_XFER_TEMPLATE(hdlr, n+2, (MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)), \
170 NOCOPY, mcheck_transfer_to_handler, \
171 ret_from_mcheck_exc)
172
173#define EXC_XFER_TEMPLATE(hdlr, trap, msr, copyee, tfer, ret) \
174 li r10,trap; \
175 stw r10,TRAP(r11); \
176 lis r10,msr@h; \
177 ori r10,r10,msr@l; \
178 copyee(r10, r9); \
179 bl tfer; \
180 .long hdlr; \
181 .long ret
182
183#define COPY_EE(d, s) rlwimi d,s,0,16,16
184#define NOCOPY(d, s)
185
186#define EXC_XFER_STD(n, hdlr) \
187 EXC_XFER_TEMPLATE(hdlr, n, MSR_KERNEL, NOCOPY, transfer_to_handler_full, \
188 ret_from_except_full)
189
190#define EXC_XFER_LITE(n, hdlr) \
191 EXC_XFER_TEMPLATE(hdlr, n+1, MSR_KERNEL, NOCOPY, transfer_to_handler, \
192 ret_from_except)
193
194#define EXC_XFER_EE(n, hdlr) \
195 EXC_XFER_TEMPLATE(hdlr, n, MSR_KERNEL, COPY_EE, transfer_to_handler_full, \
196 ret_from_except_full)
197
198#define EXC_XFER_EE_LITE(n, hdlr) \
199 EXC_XFER_TEMPLATE(hdlr, n+1, MSR_KERNEL, COPY_EE, transfer_to_handler, \
200 ret_from_except)
201
202/* Check for a single step debug exception while in an exception
203 * handler before state has been saved. This is to catch the case
204 * where an instruction that we are trying to single step causes
205 * an exception (eg ITLB/DTLB miss) and thus the first instruction of
206 * the exception handler generates a single step debug exception.
207 *
208 * If we get a debug trap on the first instruction of an exception handler,
209 * we reset the MSR_DE in the _exception handler's_ MSR (the debug trap is
210 * a critical exception, so we are using SPRN_CSRR1 to manipulate the MSR).
211 * The exception handler was handling a non-critical interrupt, so it will
212 * save (and later restore) the MSR via SPRN_CSRR1, which will still have
213 * the MSR_DE bit set.
214 */
215#define DEBUG_EXCEPTION \
216 START_EXCEPTION(Debug); \
217 CRITICAL_EXCEPTION_PROLOG; \
218 \
219 /* \
220 * If there is a single step or branch-taken exception in an \
221 * exception entry sequence, it was probably meant to apply to \
222 * the code where the exception occurred (since exception entry \
223 * doesn't turn off DE automatically). We simulate the effect \
224 * of turning off DE on entry to an exception handler by turning \
225 * off DE in the CSRR1 value and clearing the debug status. \
226 */ \
227 mfspr r10,SPRN_DBSR; /* check single-step/branch taken */ \
228 andis. r10,r10,DBSR_IC@h; \
229 beq+ 2f; \
230 \
231 lis r10,KERNELBASE@h; /* check if exception in vectors */ \
232 ori r10,r10,KERNELBASE@l; \
233 cmplw r12,r10; \
234 blt+ 2f; /* addr below exception vectors */ \
235 \
236 lis r10,Debug@h; \
237 ori r10,r10,Debug@l; \
238 cmplw r12,r10; \
239 bgt+ 2f; /* addr above exception vectors */ \
240 \
241 /* here it looks like we got an inappropriate debug exception. */ \
2421: rlwinm r9,r9,0,~MSR_DE; /* clear DE in the CSRR1 value */ \
243 lis r10,DBSR_IC@h; /* clear the IC event */ \
244 mtspr SPRN_DBSR,r10; \
245 /* restore state and get out */ \
246 lwz r10,_CCR(r11); \
247 lwz r0,GPR0(r11); \
248 lwz r1,GPR1(r11); \
249 mtcrf 0x80,r10; \
250 mtspr SPRN_CSRR0,r12; \
251 mtspr SPRN_CSRR1,r9; \
252 lwz r9,GPR9(r11); \
253 lwz r12,GPR12(r11); \
254 mtspr CRIT_SPRG,r8; \
255 BOOKE_LOAD_EXC_LEVEL_STACK(CRIT); /* r8 points to the debug stack */ \
256 lwz r10,GPR10-INT_FRAME_SIZE(r8); \
257 lwz r11,GPR11-INT_FRAME_SIZE(r8); \
258 mfspr r8,CRIT_SPRG; \
259 \
260 rfci; \
261 b .; \
262 \
263 /* continue normal handling for a critical exception... */ \
2642: mfspr r4,SPRN_DBSR; \
265 addi r3,r1,STACK_FRAME_OVERHEAD; \
266 EXC_XFER_TEMPLATE(DebugException, 0x2002, (MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)), NOCOPY, crit_transfer_to_handler, ret_from_crit_exc)
267
268#define INSTRUCTION_STORAGE_EXCEPTION \
269 START_EXCEPTION(InstructionStorage) \
270 NORMAL_EXCEPTION_PROLOG; \
271 mfspr r5,SPRN_ESR; /* Grab the ESR and save it */ \
272 stw r5,_ESR(r11); \
273 mr r4,r12; /* Pass SRR0 as arg2 */ \
274 li r5,0; /* Pass zero as arg3 */ \
275 EXC_XFER_EE_LITE(0x0400, handle_page_fault)
276
277#define ALIGNMENT_EXCEPTION \
278 START_EXCEPTION(Alignment) \
279 NORMAL_EXCEPTION_PROLOG; \
280 mfspr r4,SPRN_DEAR; /* Grab the DEAR and save it */ \
281 stw r4,_DEAR(r11); \
282 addi r3,r1,STACK_FRAME_OVERHEAD; \
283 EXC_XFER_EE(0x0600, alignment_exception)
284
285#define PROGRAM_EXCEPTION \
286 START_EXCEPTION(Program) \
287 NORMAL_EXCEPTION_PROLOG; \
288 mfspr r4,SPRN_ESR; /* Grab the ESR and save it */ \
289 stw r4,_ESR(r11); \
290 addi r3,r1,STACK_FRAME_OVERHEAD; \
291 EXC_XFER_STD(0x0700, program_check_exception)
292
293#define DECREMENTER_EXCEPTION \
294 START_EXCEPTION(Decrementer) \
295 NORMAL_EXCEPTION_PROLOG; \
296 lis r0,TSR_DIS@h; /* Setup the DEC interrupt mask */ \
297 mtspr SPRN_TSR,r0; /* Clear the DEC interrupt */ \
298 addi r3,r1,STACK_FRAME_OVERHEAD; \
299 EXC_XFER_LITE(0x0900, timer_interrupt)
300
301#define FP_UNAVAILABLE_EXCEPTION \
302 START_EXCEPTION(FloatingPointUnavailable) \
303 NORMAL_EXCEPTION_PROLOG; \
304 bne load_up_fpu; /* if from user, just load it up */ \
305 addi r3,r1,STACK_FRAME_OVERHEAD; \
306 EXC_XFER_EE_LITE(0x800, kernel_fp_unavailable_exception)
307
308#endif /* __HEAD_BOOKE_H__ */
diff --git a/arch/ppc/kernel/machine_kexec.c b/arch/ppc/kernel/machine_kexec.c
deleted file mode 100644
index a469ba438cbe..000000000000
--- a/arch/ppc/kernel/machine_kexec.c
+++ /dev/null
@@ -1,118 +0,0 @@
1/*
2 * machine_kexec.c - handle transition of Linux booting another kernel
3 * Copyright (C) 2002-2003 Eric Biederman <ebiederm@xmission.com>
4 *
5 * GameCube/ppc32 port Copyright (C) 2004 Albert Herranz
6 *
7 * This source code is licensed under the GNU General Public License,
8 * Version 2. See the file COPYING for more details.
9 */
10
11#include <linux/mm.h>
12#include <linux/kexec.h>
13#include <linux/delay.h>
14#include <linux/reboot.h>
15#include <asm/pgtable.h>
16#include <asm/pgalloc.h>
17#include <asm/mmu_context.h>
18#include <asm/io.h>
19#include <asm/hw_irq.h>
20#include <asm/cacheflush.h>
21#include <asm/machdep.h>
22
23typedef NORET_TYPE void (*relocate_new_kernel_t)(
24 unsigned long indirection_page,
25 unsigned long reboot_code_buffer,
26 unsigned long start_address) ATTRIB_NORET;
27
28extern const unsigned char relocate_new_kernel[];
29extern const unsigned int relocate_new_kernel_size;
30
31void machine_shutdown(void)
32{
33 if (ppc_md.machine_shutdown)
34 ppc_md.machine_shutdown();
35}
36
37void machine_crash_shutdown(struct pt_regs *regs)
38{
39 if (ppc_md.machine_crash_shutdown)
40 ppc_md.machine_crash_shutdown();
41}
42
43/*
44 * Do what every setup is needed on image and the
45 * reboot code buffer to allow us to avoid allocations
46 * later.
47 */
48int machine_kexec_prepare(struct kimage *image)
49{
50 if (ppc_md.machine_kexec_prepare)
51 return ppc_md.machine_kexec_prepare(image);
52 /*
53 * Fail if platform doesn't provide its own machine_kexec_prepare
54 * implementation.
55 */
56 return -ENOSYS;
57}
58
59void machine_kexec_cleanup(struct kimage *image)
60{
61 if (ppc_md.machine_kexec_cleanup)
62 ppc_md.machine_kexec_cleanup(image);
63}
64
65/*
66 * Do not allocate memory (or fail in any way) in machine_kexec().
67 * We are past the point of no return, committed to rebooting now.
68 */
69NORET_TYPE void machine_kexec(struct kimage *image)
70{
71 if (ppc_md.machine_kexec)
72 ppc_md.machine_kexec(image);
73 else {
74 /*
75 * Fall back to normal restart if platform doesn't provide
76 * its own kexec function, and user insist to kexec...
77 */
78 machine_restart(NULL);
79 }
80 for(;;);
81}
82
83/*
84 * This is a generic machine_kexec function suitable at least for
85 * non-OpenFirmware embedded platforms.
86 * It merely copies the image relocation code to the control page and
87 * jumps to it.
88 * A platform specific function may just call this one.
89 */
90void machine_kexec_simple(struct kimage *image)
91{
92 unsigned long page_list;
93 unsigned long reboot_code_buffer, reboot_code_buffer_phys;
94 relocate_new_kernel_t rnk;
95
96 /* Interrupts aren't acceptable while we reboot */
97 local_irq_disable();
98
99 page_list = image->head;
100
101 /* we need both effective and real address here */
102 reboot_code_buffer =
103 (unsigned long)page_address(image->control_code_page);
104 reboot_code_buffer_phys = virt_to_phys((void *)reboot_code_buffer);
105
106 /* copy our kernel relocation code to the control code page */
107 memcpy((void *)reboot_code_buffer, relocate_new_kernel,
108 relocate_new_kernel_size);
109
110 flush_icache_range(reboot_code_buffer,
111 reboot_code_buffer + KEXEC_CONTROL_CODE_SIZE);
112 printk(KERN_INFO "Bye!\n");
113
114 /* now call it */
115 rnk = (relocate_new_kernel_t) reboot_code_buffer;
116 (*rnk)(page_list, reboot_code_buffer_phys, image->start);
117}
118
diff --git a/arch/ppc/kernel/misc.S b/arch/ppc/kernel/misc.S
deleted file mode 100644
index d5e0dfc9ffec..000000000000
--- a/arch/ppc/kernel/misc.S
+++ /dev/null
@@ -1,868 +0,0 @@
1/*
2 * This file contains miscellaneous low-level functions.
3 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
4 *
5 * Largely rewritten by Cort Dougan (cort@cs.nmt.edu)
6 * and Paul Mackerras.
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 */
14
15#include <linux/sys.h>
16#include <asm/unistd.h>
17#include <asm/errno.h>
18#include <asm/processor.h>
19#include <asm/page.h>
20#include <asm/cache.h>
21#include <asm/cputable.h>
22#include <asm/mmu.h>
23#include <asm/ppc_asm.h>
24#include <asm/thread_info.h>
25#include <asm/asm-offsets.h>
26
27#ifdef CONFIG_8xx
28#define ISYNC_8xx isync
29#else
30#define ISYNC_8xx
31#endif
32 .text
33
34 .align 5
35_GLOBAL(__delay)
36 cmpwi 0,r3,0
37 mtctr r3
38 beqlr
391: bdnz 1b
40 blr
41
42/*
43 * Returns (address we're running at) - (address we were linked at)
44 * for use before the text and data are mapped to KERNELBASE.
45 */
46_GLOBAL(reloc_offset)
47 mflr r0
48 bl 1f
491: mflr r3
50 lis r4,1b@ha
51 addi r4,r4,1b@l
52 subf r3,r4,r3
53 mtlr r0
54 blr
55
56/*
57 * add_reloc_offset(x) returns x + reloc_offset().
58 */
59_GLOBAL(add_reloc_offset)
60 mflr r0
61 bl 1f
621: mflr r5
63 lis r4,1b@ha
64 addi r4,r4,1b@l
65 subf r5,r4,r5
66 add r3,r3,r5
67 mtlr r0
68 blr
69
70/*
71 * sub_reloc_offset(x) returns x - reloc_offset().
72 */
73_GLOBAL(sub_reloc_offset)
74 mflr r0
75 bl 1f
761: mflr r5
77 lis r4,1b@ha
78 addi r4,r4,1b@l
79 subf r5,r4,r5
80 subf r3,r5,r3
81 mtlr r0
82 blr
83
84/*
85 * reloc_got2 runs through the .got2 section adding an offset
86 * to each entry.
87 */
88_GLOBAL(reloc_got2)
89 mflr r11
90 lis r7,__got2_start@ha
91 addi r7,r7,__got2_start@l
92 lis r8,__got2_end@ha
93 addi r8,r8,__got2_end@l
94 subf r8,r7,r8
95 srwi. r8,r8,2
96 beqlr
97 mtctr r8
98 bl 1f
991: mflr r0
100 lis r4,1b@ha
101 addi r4,r4,1b@l
102 subf r0,r4,r0
103 add r7,r0,r7
1042: lwz r0,0(r7)
105 add r0,r0,r3
106 stw r0,0(r7)
107 addi r7,r7,4
108 bdnz 2b
109 mtlr r11
110 blr
111
112/*
113 * call_setup_cpu - call the setup_cpu function for this cpu
114 * r3 = data offset, r24 = cpu number
115 *
116 * Setup function is called with:
117 * r3 = data offset
118 * r4 = ptr to CPU spec (relocated)
119 */
120_GLOBAL(call_setup_cpu)
121 addis r4,r3,cur_cpu_spec@ha
122 addi r4,r4,cur_cpu_spec@l
123 lwz r4,0(r4)
124 add r4,r4,r3
125 lwz r5,CPU_SPEC_SETUP(r4)
126 cmpi 0,r5,0
127 add r5,r5,r3
128 beqlr
129 mtctr r5
130 bctr
131
132/*
133 * complement mask on the msr then "or" some values on.
134 * _nmask_and_or_msr(nmask, value_to_or)
135 */
136_GLOBAL(_nmask_and_or_msr)
137 mfmsr r0 /* Get current msr */
138 andc r0,r0,r3 /* And off the bits set in r3 (first parm) */
139 or r0,r0,r4 /* Or on the bits in r4 (second parm) */
140 SYNC /* Some chip revs have problems here... */
141 mtmsr r0 /* Update machine state */
142 isync
143 blr /* Done */
144
145
146/*
147 * Flush MMU TLB
148 */
149_GLOBAL(_tlbia)
150#if defined(CONFIG_40x)
151 sync /* Flush to memory before changing mapping */
152 tlbia
153 isync /* Flush shadow TLB */
154#elif defined(CONFIG_44x)
155 li r3,0
156 sync
157
158 /* Load high watermark */
159 lis r4,tlb_44x_hwater@ha
160 lwz r5,tlb_44x_hwater@l(r4)
161
1621: tlbwe r3,r3,PPC44x_TLB_PAGEID
163 addi r3,r3,1
164 cmpw 0,r3,r5
165 ble 1b
166
167 isync
168#else /* !(CONFIG_40x || CONFIG_44x) */
169#if defined(CONFIG_SMP)
170 rlwinm r8,r1,0,0,18
171 lwz r8,TI_CPU(r8)
172 oris r8,r8,10
173 mfmsr r10
174 SYNC
175 rlwinm r0,r10,0,17,15 /* clear bit 16 (MSR_EE) */
176 rlwinm r0,r0,0,28,26 /* clear DR */
177 mtmsr r0
178 SYNC_601
179 isync
180 lis r9,mmu_hash_lock@h
181 ori r9,r9,mmu_hash_lock@l
182 tophys(r9,r9)
18310: lwarx r7,0,r9
184 cmpwi 0,r7,0
185 bne- 10b
186 stwcx. r8,0,r9
187 bne- 10b
188 sync
189 tlbia
190 sync
191 TLBSYNC
192 li r0,0
193 stw r0,0(r9) /* clear mmu_hash_lock */
194 mtmsr r10
195 SYNC_601
196 isync
197#else /* CONFIG_SMP */
198 sync
199 tlbia
200 sync
201#endif /* CONFIG_SMP */
202#endif /* ! defined(CONFIG_40x) */
203 blr
204
205/*
206 * Flush MMU TLB for a particular address
207 */
208_GLOBAL(_tlbie)
209#if defined(CONFIG_40x)
210 /* We run the search with interrupts disabled because we have to change
211 * the PID and I don't want to preempt when that happens.
212 */
213 mfmsr r5
214 mfspr r6,SPRN_PID
215 wrteei 0
216 mtspr SPRN_PID,r4
217 tlbsx. r3, 0, r3
218 mtspr SPRN_PID,r6
219 wrtee r5
220 bne 10f
221 sync
222 /* There are only 64 TLB entries, so r3 < 64, which means bit 25 is clear.
223 * Since 25 is the V bit in the TLB_TAG, loading this value will invalidate
224 * the TLB entry. */
225 tlbwe r3, r3, TLB_TAG
226 isync
22710:
228#elif defined(CONFIG_44x)
229 mfspr r5,SPRN_MMUCR
230 rlwimi r5,r4,0,24,31 /* Set TID */
231
232 /* We have to run the search with interrupts disabled, even critical
233 * and debug interrupts (in fact the only critical exceptions we have
234 * are debug and machine check). Otherwise an interrupt which causes
235 * a TLB miss can clobber the MMUCR between the mtspr and the tlbsx. */
236 mfmsr r4
237 lis r6,(MSR_EE|MSR_CE|MSR_ME|MSR_DE)@ha
238 addi r6,r6,(MSR_EE|MSR_CE|MSR_ME|MSR_DE)@l
239 andc r6,r4,r6
240 mtmsr r6
241 mtspr SPRN_MMUCR,r5
242 tlbsx. r3, 0, r3
243 mtmsr r4
244 bne 10f
245 sync
246 /* There are only 64 TLB entries, so r3 < 64,
247 * which means bit 22, is clear. Since 22 is
248 * the V bit in the TLB_PAGEID, loading this
249 * value will invalidate the TLB entry.
250 */
251 tlbwe r3, r3, PPC44x_TLB_PAGEID
252 isync
25310:
254#else /* !(CONFIG_40x || CONFIG_44x) */
255#if defined(CONFIG_SMP)
256 rlwinm r8,r1,0,0,18
257 lwz r8,TI_CPU(r8)
258 oris r8,r8,11
259 mfmsr r10
260 SYNC
261 rlwinm r0,r10,0,17,15 /* clear bit 16 (MSR_EE) */
262 rlwinm r0,r0,0,28,26 /* clear DR */
263 mtmsr r0
264 SYNC_601
265 isync
266 lis r9,mmu_hash_lock@h
267 ori r9,r9,mmu_hash_lock@l
268 tophys(r9,r9)
26910: lwarx r7,0,r9
270 cmpwi 0,r7,0
271 bne- 10b
272 stwcx. r8,0,r9
273 bne- 10b
274 eieio
275 tlbie r3
276 sync
277 TLBSYNC
278 li r0,0
279 stw r0,0(r9) /* clear mmu_hash_lock */
280 mtmsr r10
281 SYNC_601
282 isync
283#else /* CONFIG_SMP */
284 tlbie r3
285 sync
286#endif /* CONFIG_SMP */
287#endif /* ! CONFIG_40x */
288 blr
289
290/*
291 * Flush instruction cache.
292 * This is a no-op on the 601.
293 */
294_GLOBAL(flush_instruction_cache)
295#if defined(CONFIG_8xx)
296 isync
297 lis r5, IDC_INVALL@h
298 mtspr SPRN_IC_CST, r5
299#elif defined(CONFIG_4xx)
300#ifdef CONFIG_403GCX
301 li r3, 512
302 mtctr r3
303 lis r4, KERNELBASE@h
3041: iccci 0, r4
305 addi r4, r4, 16
306 bdnz 1b
307#else
308 lis r3, KERNELBASE@h
309 iccci 0,r3
310#endif
311#else
312 mfspr r3,SPRN_PVR
313 rlwinm r3,r3,16,16,31
314 cmpwi 0,r3,1
315 beqlr /* for 601, do nothing */
316 /* 603/604 processor - use invalidate-all bit in HID0 */
317 mfspr r3,SPRN_HID0
318 ori r3,r3,HID0_ICFI
319 mtspr SPRN_HID0,r3
320#endif /* CONFIG_8xx/4xx */
321 isync
322 blr
323
324/*
325 * Write any modified data cache blocks out to memory
326 * and invalidate the corresponding instruction cache blocks.
327 * This is a no-op on the 601.
328 *
329 * __flush_icache_range(unsigned long start, unsigned long stop)
330 */
331_GLOBAL(__flush_icache_range)
332BEGIN_FTR_SECTION
333 blr /* for 601, do nothing */
334END_FTR_SECTION_IFSET(CPU_FTR_COHERENT_ICACHE)
335 li r5,L1_CACHE_BYTES-1
336 andc r3,r3,r5
337 subf r4,r3,r4
338 add r4,r4,r5
339 srwi. r4,r4,L1_CACHE_SHIFT
340 beqlr
341 mtctr r4
342 mr r6,r3
3431: dcbst 0,r3
344 addi r3,r3,L1_CACHE_BYTES
345 bdnz 1b
346 sync /* wait for dcbst's to get to ram */
347 mtctr r4
3482: icbi 0,r6
349 addi r6,r6,L1_CACHE_BYTES
350 bdnz 2b
351 sync /* additional sync needed on g4 */
352 isync
353 blr
354/*
355 * Write any modified data cache blocks out to memory.
356 * Does not invalidate the corresponding cache lines (especially for
357 * any corresponding instruction cache).
358 *
359 * clean_dcache_range(unsigned long start, unsigned long stop)
360 */
361_GLOBAL(clean_dcache_range)
362 li r5,L1_CACHE_BYTES-1
363 andc r3,r3,r5
364 subf r4,r3,r4
365 add r4,r4,r5
366 srwi. r4,r4,L1_CACHE_SHIFT
367 beqlr
368 mtctr r4
369
3701: dcbst 0,r3
371 addi r3,r3,L1_CACHE_BYTES
372 bdnz 1b
373 sync /* wait for dcbst's to get to ram */
374 blr
375
376/*
377 * Write any modified data cache blocks out to memory and invalidate them.
378 * Does not invalidate the corresponding instruction cache blocks.
379 *
380 * flush_dcache_range(unsigned long start, unsigned long stop)
381 */
382_GLOBAL(flush_dcache_range)
383 li r5,L1_CACHE_BYTES-1
384 andc r3,r3,r5
385 subf r4,r3,r4
386 add r4,r4,r5
387 srwi. r4,r4,L1_CACHE_SHIFT
388 beqlr
389 mtctr r4
390
3911: dcbf 0,r3
392 addi r3,r3,L1_CACHE_BYTES
393 bdnz 1b
394 sync /* wait for dcbst's to get to ram */
395 blr
396
397/*
398 * Like above, but invalidate the D-cache. This is used by the 8xx
399 * to invalidate the cache so the PPC core doesn't get stale data
400 * from the CPM (no cache snooping here :-).
401 *
402 * invalidate_dcache_range(unsigned long start, unsigned long stop)
403 */
404_GLOBAL(invalidate_dcache_range)
405 li r5,L1_CACHE_BYTES-1
406 andc r3,r3,r5
407 subf r4,r3,r4
408 add r4,r4,r5
409 srwi. r4,r4,L1_CACHE_SHIFT
410 beqlr
411 mtctr r4
412
4131: dcbi 0,r3
414 addi r3,r3,L1_CACHE_BYTES
415 bdnz 1b
416 sync /* wait for dcbi's to get to ram */
417 blr
418
419#ifdef CONFIG_NOT_COHERENT_CACHE
420/*
421 * 40x cores have 8K or 16K dcache and 32 byte line size.
422 * 44x has a 32K dcache and 32 byte line size.
423 * 8xx has 1, 2, 4, 8K variants.
424 * For now, cover the worst case of the 44x.
425 * Must be called with external interrupts disabled.
426 */
427#define CACHE_NWAYS 64
428#define CACHE_NLINES 16
429
430_GLOBAL(flush_dcache_all)
431 li r4, (2 * CACHE_NWAYS * CACHE_NLINES)
432 mtctr r4
433 lis r5, KERNELBASE@h
4341: lwz r3, 0(r5) /* Load one word from every line */
435 addi r5, r5, L1_CACHE_BYTES
436 bdnz 1b
437 blr
438#endif /* CONFIG_NOT_COHERENT_CACHE */
439
440/*
441 * Flush a particular page from the data cache to RAM.
442 * Note: this is necessary because the instruction cache does *not*
443 * snoop from the data cache.
444 * This is a no-op on the 601 which has a unified cache.
445 *
446 * void __flush_dcache_icache(void *page)
447 */
448_GLOBAL(__flush_dcache_icache)
449BEGIN_FTR_SECTION
450 blr /* for 601, do nothing */
451END_FTR_SECTION_IFSET(CPU_FTR_COHERENT_ICACHE)
452 rlwinm r3,r3,0,0,19 /* Get page base address */
453 li r4,4096/L1_CACHE_BYTES /* Number of lines in a page */
454 mtctr r4
455 mr r6,r3
4560: dcbst 0,r3 /* Write line to ram */
457 addi r3,r3,L1_CACHE_BYTES
458 bdnz 0b
459 sync
460#ifndef CONFIG_44x
461 /* We don't flush the icache on 44x. Those have a virtual icache
462 * and we don't have access to the virtual address here (it's
463 * not the page vaddr but where it's mapped in user space). The
464 * flushing of the icache on these is handled elsewhere, when
465 * a change in the address space occurs, before returning to
466 * user space
467 */
468 mtctr r4
4691: icbi 0,r6
470 addi r6,r6,L1_CACHE_BYTES
471 bdnz 1b
472 sync
473 isync
474#endif /* CONFIG_44x */
475 blr
476
477/*
478 * Flush a particular page from the data cache to RAM, identified
479 * by its physical address. We turn off the MMU so we can just use
480 * the physical address (this may be a highmem page without a kernel
481 * mapping).
482 *
483 * void __flush_dcache_icache_phys(unsigned long physaddr)
484 */
485_GLOBAL(__flush_dcache_icache_phys)
486BEGIN_FTR_SECTION
487 blr /* for 601, do nothing */
488END_FTR_SECTION_IFSET(CPU_FTR_COHERENT_ICACHE)
489 mfmsr r10
490 rlwinm r0,r10,0,28,26 /* clear DR */
491 mtmsr r0
492 isync
493 rlwinm r3,r3,0,0,19 /* Get page base address */
494 li r4,4096/L1_CACHE_BYTES /* Number of lines in a page */
495 mtctr r4
496 mr r6,r3
4970: dcbst 0,r3 /* Write line to ram */
498 addi r3,r3,L1_CACHE_BYTES
499 bdnz 0b
500 sync
501 mtctr r4
5021: icbi 0,r6
503 addi r6,r6,L1_CACHE_BYTES
504 bdnz 1b
505 sync
506 mtmsr r10 /* restore DR */
507 isync
508 blr
509
510/*
511 * Clear pages using the dcbz instruction, which doesn't cause any
512 * memory traffic (except to write out any cache lines which get
513 * displaced). This only works on cacheable memory.
514 *
515 * void clear_pages(void *page, int order) ;
516 */
517_GLOBAL(clear_pages)
518 li r0,4096/L1_CACHE_BYTES
519 slw r0,r0,r4
520 mtctr r0
521#ifdef CONFIG_8xx
522 li r4, 0
5231: stw r4, 0(r3)
524 stw r4, 4(r3)
525 stw r4, 8(r3)
526 stw r4, 12(r3)
527#else
5281: dcbz 0,r3
529#endif
530 addi r3,r3,L1_CACHE_BYTES
531 bdnz 1b
532 blr
533
534/*
535 * Copy a whole page. We use the dcbz instruction on the destination
536 * to reduce memory traffic (it eliminates the unnecessary reads of
537 * the destination into cache). This requires that the destination
538 * is cacheable.
539 */
540#define COPY_16_BYTES \
541 lwz r6,4(r4); \
542 lwz r7,8(r4); \
543 lwz r8,12(r4); \
544 lwzu r9,16(r4); \
545 stw r6,4(r3); \
546 stw r7,8(r3); \
547 stw r8,12(r3); \
548 stwu r9,16(r3)
549
550_GLOBAL(copy_page)
551 addi r3,r3,-4
552 addi r4,r4,-4
553
554#ifdef CONFIG_8xx
555 /* don't use prefetch on 8xx */
556 li r0,4096/L1_CACHE_BYTES
557 mtctr r0
5581: COPY_16_BYTES
559 bdnz 1b
560 blr
561
562#else /* not 8xx, we can prefetch */
563 li r5,4
564
565#if MAX_COPY_PREFETCH > 1
566 li r0,MAX_COPY_PREFETCH
567 li r11,4
568 mtctr r0
56911: dcbt r11,r4
570 addi r11,r11,L1_CACHE_BYTES
571 bdnz 11b
572#else /* MAX_COPY_PREFETCH == 1 */
573 dcbt r5,r4
574 li r11,L1_CACHE_BYTES+4
575#endif /* MAX_COPY_PREFETCH */
576 li r0,4096/L1_CACHE_BYTES - MAX_COPY_PREFETCH
577 crclr 4*cr0+eq
5782:
579 mtctr r0
5801:
581 dcbt r11,r4
582 dcbz r5,r3
583 COPY_16_BYTES
584#if L1_CACHE_BYTES >= 32
585 COPY_16_BYTES
586#if L1_CACHE_BYTES >= 64
587 COPY_16_BYTES
588 COPY_16_BYTES
589#if L1_CACHE_BYTES >= 128
590 COPY_16_BYTES
591 COPY_16_BYTES
592 COPY_16_BYTES
593 COPY_16_BYTES
594#endif
595#endif
596#endif
597 bdnz 1b
598 beqlr
599 crnot 4*cr0+eq,4*cr0+eq
600 li r0,MAX_COPY_PREFETCH
601 li r11,4
602 b 2b
603#endif /* CONFIG_8xx */
604
605/*
606 * void atomic_clear_mask(atomic_t mask, atomic_t *addr)
607 * void atomic_set_mask(atomic_t mask, atomic_t *addr);
608 */
609_GLOBAL(atomic_clear_mask)
61010: lwarx r5,0,r4
611 andc r5,r5,r3
612 PPC405_ERR77(0,r4)
613 stwcx. r5,0,r4
614 bne- 10b
615 blr
616_GLOBAL(atomic_set_mask)
61710: lwarx r5,0,r4
618 or r5,r5,r3
619 PPC405_ERR77(0,r4)
620 stwcx. r5,0,r4
621 bne- 10b
622 blr
623
624/*
625 * I/O string operations
626 *
627 * insb(port, buf, len)
628 * outsb(port, buf, len)
629 * insw(port, buf, len)
630 * outsw(port, buf, len)
631 * insl(port, buf, len)
632 * outsl(port, buf, len)
633 * insw_ns(port, buf, len)
634 * outsw_ns(port, buf, len)
635 * insl_ns(port, buf, len)
636 * outsl_ns(port, buf, len)
637 *
638 * The *_ns versions don't do byte-swapping.
639 */
640_GLOBAL(_insb)
641 cmpwi 0,r5,0
642 mtctr r5
643 subi r4,r4,1
644 blelr-
64500: lbz r5,0(r3)
64601: eieio
64702: stbu r5,1(r4)
648 ISYNC_8xx
649 .section .fixup,"ax"
65003: blr
651 .text
652 .section __ex_table, "a"
653 .align 2
654 .long 00b, 03b
655 .long 01b, 03b
656 .long 02b, 03b
657 .text
658 bdnz 00b
659 blr
660
661_GLOBAL(_outsb)
662 cmpwi 0,r5,0
663 mtctr r5
664 subi r4,r4,1
665 blelr-
66600: lbzu r5,1(r4)
66701: stb r5,0(r3)
66802: eieio
669 ISYNC_8xx
670 .section .fixup,"ax"
67103: blr
672 .text
673 .section __ex_table, "a"
674 .align 2
675 .long 00b, 03b
676 .long 01b, 03b
677 .long 02b, 03b
678 .text
679 bdnz 00b
680 blr
681
682_GLOBAL(_insw_ns)
683 cmpwi 0,r5,0
684 mtctr r5
685 subi r4,r4,2
686 blelr-
68700: lhz r5,0(r3)
68801: eieio
68902: sthu r5,2(r4)
690 ISYNC_8xx
691 .section .fixup,"ax"
69203: blr
693 .text
694 .section __ex_table, "a"
695 .align 2
696 .long 00b, 03b
697 .long 01b, 03b
698 .long 02b, 03b
699 .text
700 bdnz 00b
701 blr
702
703_GLOBAL(_outsw_ns)
704 cmpwi 0,r5,0
705 mtctr r5
706 subi r4,r4,2
707 blelr-
70800: lhzu r5,2(r4)
70901: sth r5,0(r3)
71002: eieio
711 ISYNC_8xx
712 .section .fixup,"ax"
71303: blr
714 .text
715 .section __ex_table, "a"
716 .align 2
717 .long 00b, 03b
718 .long 01b, 03b
719 .long 02b, 03b
720 .text
721 bdnz 00b
722 blr
723
724_GLOBAL(_insl_ns)
725 cmpwi 0,r5,0
726 mtctr r5
727 subi r4,r4,4
728 blelr-
72900: lwz r5,0(r3)
73001: eieio
73102: stwu r5,4(r4)
732 ISYNC_8xx
733 .section .fixup,"ax"
73403: blr
735 .text
736 .section __ex_table, "a"
737 .align 2
738 .long 00b, 03b
739 .long 01b, 03b
740 .long 02b, 03b
741 .text
742 bdnz 00b
743 blr
744
745_GLOBAL(_outsl_ns)
746 cmpwi 0,r5,0
747 mtctr r5
748 subi r4,r4,4
749 blelr-
75000: lwzu r5,4(r4)
75101: stw r5,0(r3)
75202: eieio
753 ISYNC_8xx
754 .section .fixup,"ax"
75503: blr
756 .text
757 .section __ex_table, "a"
758 .align 2
759 .long 00b, 03b
760 .long 01b, 03b
761 .long 02b, 03b
762 .text
763 bdnz 00b
764 blr
765
766/*
767 * Extended precision shifts.
768 *
769 * Updated to be valid for shift counts from 0 to 63 inclusive.
770 * -- Gabriel
771 *
772 * R3/R4 has 64 bit value
773 * R5 has shift count
774 * result in R3/R4
775 *
776 * ashrdi3: arithmetic right shift (sign propagation)
777 * lshrdi3: logical right shift
778 * ashldi3: left shift
779 */
780_GLOBAL(__ashrdi3)
781 subfic r6,r5,32
782 srw r4,r4,r5 # LSW = count > 31 ? 0 : LSW >> count
783 addi r7,r5,32 # could be xori, or addi with -32
784 slw r6,r3,r6 # t1 = count > 31 ? 0 : MSW << (32-count)
785 rlwinm r8,r7,0,32 # t3 = (count < 32) ? 32 : 0
786 sraw r7,r3,r7 # t2 = MSW >> (count-32)
787 or r4,r4,r6 # LSW |= t1
788 slw r7,r7,r8 # t2 = (count < 32) ? 0 : t2
789 sraw r3,r3,r5 # MSW = MSW >> count
790 or r4,r4,r7 # LSW |= t2
791 blr
792
793_GLOBAL(__ashldi3)
794 subfic r6,r5,32
795 slw r3,r3,r5 # MSW = count > 31 ? 0 : MSW << count
796 addi r7,r5,32 # could be xori, or addi with -32
797 srw r6,r4,r6 # t1 = count > 31 ? 0 : LSW >> (32-count)
798 slw r7,r4,r7 # t2 = count < 32 ? 0 : LSW << (count-32)
799 or r3,r3,r6 # MSW |= t1
800 slw r4,r4,r5 # LSW = LSW << count
801 or r3,r3,r7 # MSW |= t2
802 blr
803
804_GLOBAL(__lshrdi3)
805 subfic r6,r5,32
806 srw r4,r4,r5 # LSW = count > 31 ? 0 : LSW >> count
807 addi r7,r5,32 # could be xori, or addi with -32
808 slw r6,r3,r6 # t1 = count > 31 ? 0 : MSW << (32-count)
809 srw r7,r3,r7 # t2 = count < 32 ? 0 : MSW >> (count-32)
810 or r4,r4,r6 # LSW |= t1
811 srw r3,r3,r5 # MSW = MSW >> count
812 or r4,r4,r7 # LSW |= t2
813 blr
814
815_GLOBAL(abs)
816 srawi r4,r3,31
817 xor r3,r3,r4
818 sub r3,r3,r4
819 blr
820
821_GLOBAL(_get_SP)
822 mr r3,r1 /* Close enough */
823 blr
824
825/*
826 * Create a kernel thread
827 * kernel_thread(fn, arg, flags)
828 */
829_GLOBAL(kernel_thread)
830 stwu r1,-16(r1)
831 stw r30,8(r1)
832 stw r31,12(r1)
833 mr r30,r3 /* function */
834 mr r31,r4 /* argument */
835 ori r3,r5,CLONE_VM /* flags */
836 oris r3,r3,CLONE_UNTRACED>>16
837 li r4,0 /* new sp (unused) */
838 li r0,__NR_clone
839 sc
840 cmpwi 0,r3,0 /* parent or child? */
841 bne 1f /* return if parent */
842 li r0,0 /* make top-level stack frame */
843 stwu r0,-16(r1)
844 mtlr r30 /* fn addr in lr */
845 mr r3,r31 /* load arg and call fn */
846 PPC440EP_ERR42
847 blrl
848 li r0,__NR_exit /* exit if function returns */
849 li r3,0
850 sc
8511: lwz r30,8(r1)
852 lwz r31,12(r1)
853 addi r1,r1,16
854 blr
855
856_GLOBAL(kernel_execve)
857 li r0,__NR_execve
858 sc
859 bnslr
860 neg r3,r3
861 blr
862
863/*
864 * This routine is just here to keep GCC happy - sigh...
865 */
866_GLOBAL(__main)
867 blr
868
diff --git a/arch/ppc/kernel/pci.c b/arch/ppc/kernel/pci.c
deleted file mode 100644
index df3ef6db072c..000000000000
--- a/arch/ppc/kernel/pci.c
+++ /dev/null
@@ -1,1233 +0,0 @@
1/*
2 * Common prep/chrp pci routines. -- Cort
3 */
4
5#include <linux/kernel.h>
6#include <linux/pci.h>
7#include <linux/delay.h>
8#include <linux/string.h>
9#include <linux/init.h>
10#include <linux/capability.h>
11#include <linux/sched.h>
12#include <linux/errno.h>
13#include <linux/bootmem.h>
14
15#include <asm/processor.h>
16#include <asm/io.h>
17#include <asm/prom.h>
18#include <asm/sections.h>
19#include <asm/pci-bridge.h>
20#include <asm/byteorder.h>
21#include <asm/irq.h>
22#include <asm/uaccess.h>
23#include <asm/machdep.h>
24
25#undef DEBUG
26
27#ifdef DEBUG
28#define DBG(x...) printk(x)
29#else
30#define DBG(x...)
31#endif
32
33unsigned long isa_io_base = 0;
34unsigned long isa_mem_base = 0;
35unsigned long pci_dram_offset = 0;
36int pcibios_assign_bus_offset = 1;
37
38void pcibios_make_OF_bus_map(void);
39
40static int pci_relocate_bridge_resource(struct pci_bus *bus, int i);
41static int probe_resource(struct pci_bus *parent, struct resource *pr,
42 struct resource *res, struct resource **conflict);
43static void update_bridge_base(struct pci_bus *bus, int i);
44static void pcibios_fixup_resources(struct pci_dev* dev);
45static void fixup_broken_pcnet32(struct pci_dev* dev);
46static int reparent_resources(struct resource *parent, struct resource *res);
47static void fixup_cpc710_pci64(struct pci_dev* dev);
48
49/* By default, we don't re-assign bus numbers.
50 */
51int pci_assign_all_buses;
52
53struct pci_controller* hose_head;
54struct pci_controller** hose_tail = &hose_head;
55
56static int pci_bus_count;
57
58static void
59fixup_broken_pcnet32(struct pci_dev* dev)
60{
61 if ((dev->class>>8 == PCI_CLASS_NETWORK_ETHERNET)) {
62 dev->vendor = PCI_VENDOR_ID_AMD;
63 pci_write_config_word(dev, PCI_VENDOR_ID, PCI_VENDOR_ID_AMD);
64 }
65}
66DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_TRIDENT, PCI_ANY_ID, fixup_broken_pcnet32);
67
68static void
69fixup_cpc710_pci64(struct pci_dev* dev)
70{
71 /* Hide the PCI64 BARs from the kernel as their content doesn't
72 * fit well in the resource management
73 */
74 dev->resource[0].start = dev->resource[0].end = 0;
75 dev->resource[0].flags = 0;
76 dev->resource[1].start = dev->resource[1].end = 0;
77 dev->resource[1].flags = 0;
78}
79DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_CPC710_PCI64, fixup_cpc710_pci64);
80
81static void
82pcibios_fixup_resources(struct pci_dev *dev)
83{
84 struct pci_controller* hose = (struct pci_controller *)dev->sysdata;
85 int i;
86 unsigned long offset;
87
88 if (!hose) {
89 printk(KERN_ERR "No hose for PCI dev %s!\n", pci_name(dev));
90 return;
91 }
92 for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
93 struct resource *res = dev->resource + i;
94 if (!res->flags)
95 continue;
96 if (res->end == 0xffffffff) {
97 DBG("PCI:%s Resource %d [%016llx-%016llx] is unassigned\n",
98 pci_name(dev), i,
99 (unsigned long long)res->start,
100 (unsigned long long)res->end);
101 res->end -= res->start;
102 res->start = 0;
103 res->flags |= IORESOURCE_UNSET;
104 continue;
105 }
106 offset = 0;
107 if (res->flags & IORESOURCE_MEM) {
108 offset = hose->pci_mem_offset;
109 } else if (res->flags & IORESOURCE_IO) {
110 offset = (unsigned long) hose->io_base_virt
111 - isa_io_base;
112 }
113 if (offset != 0) {
114 res->start += offset;
115 res->end += offset;
116#ifdef DEBUG
117 printk("Fixup res %d (%lx) of dev %s: %lx -> %lx\n",
118 i, res->flags, pci_name(dev),
119 res->start - offset, res->start);
120#endif
121 }
122 }
123
124 /* Call machine specific resource fixup */
125 if (ppc_md.pcibios_fixup_resources)
126 ppc_md.pcibios_fixup_resources(dev);
127}
128DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, pcibios_fixup_resources);
129
130void pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
131 struct resource *res)
132{
133 unsigned long offset = 0;
134 struct pci_controller *hose = dev->sysdata;
135
136 if (hose && res->flags & IORESOURCE_IO)
137 offset = (unsigned long)hose->io_base_virt - isa_io_base;
138 else if (hose && res->flags & IORESOURCE_MEM)
139 offset = hose->pci_mem_offset;
140 region->start = res->start - offset;
141 region->end = res->end - offset;
142}
143EXPORT_SYMBOL(pcibios_resource_to_bus);
144
145void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
146 struct pci_bus_region *region)
147{
148 unsigned long offset = 0;
149 struct pci_controller *hose = dev->sysdata;
150
151 if (hose && res->flags & IORESOURCE_IO)
152 offset = (unsigned long)hose->io_base_virt - isa_io_base;
153 else if (hose && res->flags & IORESOURCE_MEM)
154 offset = hose->pci_mem_offset;
155 res->start = region->start + offset;
156 res->end = region->end + offset;
157}
158EXPORT_SYMBOL(pcibios_bus_to_resource);
159
160/*
161 * We need to avoid collisions with `mirrored' VGA ports
162 * and other strange ISA hardware, so we always want the
163 * addresses to be allocated in the 0x000-0x0ff region
164 * modulo 0x400.
165 *
166 * Why? Because some silly external IO cards only decode
167 * the low 10 bits of the IO address. The 0x00-0xff region
168 * is reserved for motherboard devices that decode all 16
169 * bits, so it's ok to allocate at, say, 0x2800-0x28ff,
170 * but we want to try to avoid allocating at 0x2900-0x2bff
171 * which might have be mirrored at 0x0100-0x03ff..
172 */
173void pcibios_align_resource(void *data, struct resource *res,
174 resource_size_t size, resource_size_t align)
175{
176 struct pci_dev *dev = data;
177
178 if (res->flags & IORESOURCE_IO) {
179 resource_size_t start = res->start;
180
181 if (size > 0x100) {
182 printk(KERN_ERR "PCI: I/O Region %s/%d too large"
183 " (%lld bytes)\n", pci_name(dev),
184 dev->resource - res, (unsigned long long)size);
185 }
186
187 if (start & 0x300) {
188 start = (start + 0x3ff) & ~0x3ff;
189 res->start = start;
190 }
191 }
192}
193EXPORT_SYMBOL(pcibios_align_resource);
194
195/*
196 * Handle resources of PCI devices. If the world were perfect, we could
197 * just allocate all the resource regions and do nothing more. It isn't.
198 * On the other hand, we cannot just re-allocate all devices, as it would
199 * require us to know lots of host bridge internals. So we attempt to
200 * keep as much of the original configuration as possible, but tweak it
201 * when it's found to be wrong.
202 *
203 * Known BIOS problems we have to work around:
204 * - I/O or memory regions not configured
205 * - regions configured, but not enabled in the command register
206 * - bogus I/O addresses above 64K used
207 * - expansion ROMs left enabled (this may sound harmless, but given
208 * the fact the PCI specs explicitly allow address decoders to be
209 * shared between expansion ROMs and other resource regions, it's
210 * at least dangerous)
211 *
212 * Our solution:
213 * (1) Allocate resources for all buses behind PCI-to-PCI bridges.
214 * This gives us fixed barriers on where we can allocate.
215 * (2) Allocate resources for all enabled devices. If there is
216 * a collision, just mark the resource as unallocated. Also
217 * disable expansion ROMs during this step.
218 * (3) Try to allocate resources for disabled devices. If the
219 * resources were assigned correctly, everything goes well,
220 * if they weren't, they won't disturb allocation of other
221 * resources.
222 * (4) Assign new addresses to resources which were either
223 * not configured at all or misconfigured. If explicitly
224 * requested by the user, configure expansion ROM address
225 * as well.
226 */
227
228static void __init
229pcibios_allocate_bus_resources(struct list_head *bus_list)
230{
231 struct pci_bus *bus;
232 int i;
233 struct resource *res, *pr;
234
235 /* Depth-First Search on bus tree */
236 list_for_each_entry(bus, bus_list, node) {
237 for (i = 0; i < 4; ++i) {
238 if ((res = bus->resource[i]) == NULL || !res->flags
239 || res->start > res->end)
240 continue;
241 if (bus->parent == NULL)
242 pr = (res->flags & IORESOURCE_IO)?
243 &ioport_resource: &iomem_resource;
244 else {
245 pr = pci_find_parent_resource(bus->self, res);
246 if (pr == res) {
247 /* this happens when the generic PCI
248 * code (wrongly) decides that this
249 * bridge is transparent -- paulus
250 */
251 continue;
252 }
253 }
254
255 DBG("PCI: bridge rsrc %llx..%llx (%lx), parent %p\n",
256 (unsigned long long)res->start,
257 (unsigned long long)res->end, res->flags, pr);
258 if (pr) {
259 if (request_resource(pr, res) == 0)
260 continue;
261 /*
262 * Must be a conflict with an existing entry.
263 * Move that entry (or entries) under the
264 * bridge resource and try again.
265 */
266 if (reparent_resources(pr, res) == 0)
267 continue;
268 }
269 printk(KERN_ERR "PCI: Cannot allocate resource region "
270 "%d of PCI bridge %d\n", i, bus->number);
271 if (pci_relocate_bridge_resource(bus, i))
272 bus->resource[i] = NULL;
273 }
274 pcibios_allocate_bus_resources(&bus->children);
275 }
276}
277
278/*
279 * Reparent resource children of pr that conflict with res
280 * under res, and make res replace those children.
281 */
282static int __init
283reparent_resources(struct resource *parent, struct resource *res)
284{
285 struct resource *p, **pp;
286 struct resource **firstpp = NULL;
287
288 for (pp = &parent->child; (p = *pp) != NULL; pp = &p->sibling) {
289 if (p->end < res->start)
290 continue;
291 if (res->end < p->start)
292 break;
293 if (p->start < res->start || p->end > res->end)
294 return -1; /* not completely contained */
295 if (firstpp == NULL)
296 firstpp = pp;
297 }
298 if (firstpp == NULL)
299 return -1; /* didn't find any conflicting entries? */
300 res->parent = parent;
301 res->child = *firstpp;
302 res->sibling = *pp;
303 *firstpp = res;
304 *pp = NULL;
305 for (p = res->child; p != NULL; p = p->sibling) {
306 p->parent = res;
307 DBG(KERN_INFO "PCI: reparented %s [%llx..%llx] under %s\n",
308 p->name, (unsigned long long)p->start,
309 (unsigned long long)p->end, res->name);
310 }
311 return 0;
312}
313
314/*
315 * A bridge has been allocated a range which is outside the range
316 * of its parent bridge, so it needs to be moved.
317 */
318static int __init
319pci_relocate_bridge_resource(struct pci_bus *bus, int i)
320{
321 struct resource *res, *pr, *conflict;
322 unsigned long try, size;
323 int j;
324 struct pci_bus *parent = bus->parent;
325
326 if (parent == NULL) {
327 /* shouldn't ever happen */
328 printk(KERN_ERR "PCI: can't move host bridge resource\n");
329 return -1;
330 }
331 res = bus->resource[i];
332 if (res == NULL)
333 return -1;
334 pr = NULL;
335 for (j = 0; j < 4; j++) {
336 struct resource *r = parent->resource[j];
337 if (!r)
338 continue;
339 if ((res->flags ^ r->flags) & (IORESOURCE_IO | IORESOURCE_MEM))
340 continue;
341 if (!((res->flags ^ r->flags) & IORESOURCE_PREFETCH)) {
342 pr = r;
343 break;
344 }
345 if (res->flags & IORESOURCE_PREFETCH)
346 pr = r;
347 }
348 if (pr == NULL)
349 return -1;
350 size = res->end - res->start;
351 if (pr->start > pr->end || size > pr->end - pr->start)
352 return -1;
353 try = pr->end;
354 for (;;) {
355 res->start = try - size;
356 res->end = try;
357 if (probe_resource(bus->parent, pr, res, &conflict) == 0)
358 break;
359 if (conflict->start <= pr->start + size)
360 return -1;
361 try = conflict->start - 1;
362 }
363 if (request_resource(pr, res)) {
364 DBG(KERN_ERR "PCI: huh? couldn't move to %llx..%llx\n",
365 (unsigned long long)res->start,
366 (unsigned long long)res->end);
367 return -1; /* "can't happen" */
368 }
369 update_bridge_base(bus, i);
370 printk(KERN_INFO "PCI: bridge %d resource %d moved to %llx..%llx\n",
371 bus->number, i, (unsigned long long)res->start,
372 (unsigned long long)res->end);
373 return 0;
374}
375
376static int __init
377probe_resource(struct pci_bus *parent, struct resource *pr,
378 struct resource *res, struct resource **conflict)
379{
380 struct pci_bus *bus;
381 struct pci_dev *dev;
382 struct resource *r;
383 int i;
384
385 for (r = pr->child; r != NULL; r = r->sibling) {
386 if (r->end >= res->start && res->end >= r->start) {
387 *conflict = r;
388 return 1;
389 }
390 }
391 list_for_each_entry(bus, &parent->children, node) {
392 for (i = 0; i < 4; ++i) {
393 if ((r = bus->resource[i]) == NULL)
394 continue;
395 if (!r->flags || r->start > r->end || r == res)
396 continue;
397 if (pci_find_parent_resource(bus->self, r) != pr)
398 continue;
399 if (r->end >= res->start && res->end >= r->start) {
400 *conflict = r;
401 return 1;
402 }
403 }
404 }
405 list_for_each_entry(dev, &parent->devices, bus_list) {
406 for (i = 0; i < 6; ++i) {
407 r = &dev->resource[i];
408 if (!r->flags || (r->flags & IORESOURCE_UNSET))
409 continue;
410 if (pci_find_parent_resource(dev, r) != pr)
411 continue;
412 if (r->end >= res->start && res->end >= r->start) {
413 *conflict = r;
414 return 1;
415 }
416 }
417 }
418 return 0;
419}
420
421static void __init
422update_bridge_base(struct pci_bus *bus, int i)
423{
424 struct resource *res = bus->resource[i];
425 u8 io_base_lo, io_limit_lo;
426 u16 mem_base, mem_limit;
427 u16 cmd;
428 unsigned long start, end, off;
429 struct pci_dev *dev = bus->self;
430 struct pci_controller *hose = dev->sysdata;
431
432 if (!hose) {
433 printk("update_bridge_base: no hose?\n");
434 return;
435 }
436 pci_read_config_word(dev, PCI_COMMAND, &cmd);
437 pci_write_config_word(dev, PCI_COMMAND,
438 cmd & ~(PCI_COMMAND_IO | PCI_COMMAND_MEMORY));
439 if (res->flags & IORESOURCE_IO) {
440 off = (unsigned long) hose->io_base_virt - isa_io_base;
441 start = res->start - off;
442 end = res->end - off;
443 io_base_lo = (start >> 8) & PCI_IO_RANGE_MASK;
444 io_limit_lo = (end >> 8) & PCI_IO_RANGE_MASK;
445 if (end > 0xffff) {
446 pci_write_config_word(dev, PCI_IO_BASE_UPPER16,
447 start >> 16);
448 pci_write_config_word(dev, PCI_IO_LIMIT_UPPER16,
449 end >> 16);
450 io_base_lo |= PCI_IO_RANGE_TYPE_32;
451 } else
452 io_base_lo |= PCI_IO_RANGE_TYPE_16;
453 pci_write_config_byte(dev, PCI_IO_BASE, io_base_lo);
454 pci_write_config_byte(dev, PCI_IO_LIMIT, io_limit_lo);
455
456 } else if ((res->flags & (IORESOURCE_MEM | IORESOURCE_PREFETCH))
457 == IORESOURCE_MEM) {
458 off = hose->pci_mem_offset;
459 mem_base = ((res->start - off) >> 16) & PCI_MEMORY_RANGE_MASK;
460 mem_limit = ((res->end - off) >> 16) & PCI_MEMORY_RANGE_MASK;
461 pci_write_config_word(dev, PCI_MEMORY_BASE, mem_base);
462 pci_write_config_word(dev, PCI_MEMORY_LIMIT, mem_limit);
463
464 } else if ((res->flags & (IORESOURCE_MEM | IORESOURCE_PREFETCH))
465 == (IORESOURCE_MEM | IORESOURCE_PREFETCH)) {
466 off = hose->pci_mem_offset;
467 mem_base = ((res->start - off) >> 16) & PCI_PREF_RANGE_MASK;
468 mem_limit = ((res->end - off) >> 16) & PCI_PREF_RANGE_MASK;
469 pci_write_config_word(dev, PCI_PREF_MEMORY_BASE, mem_base);
470 pci_write_config_word(dev, PCI_PREF_MEMORY_LIMIT, mem_limit);
471
472 } else {
473 DBG(KERN_ERR "PCI: ugh, bridge %s res %d has flags=%lx\n",
474 pci_name(dev), i, res->flags);
475 }
476 pci_write_config_word(dev, PCI_COMMAND, cmd);
477}
478
479static inline void alloc_resource(struct pci_dev *dev, int idx)
480{
481 struct resource *pr, *r = &dev->resource[idx];
482
483 DBG("PCI:%s: Resource %d: %016llx-%016llx (f=%lx)\n",
484 pci_name(dev), idx, (unsigned long long)r->start,
485 (unsigned long long)r->end, r->flags);
486 pr = pci_find_parent_resource(dev, r);
487 if (!pr || request_resource(pr, r) < 0) {
488 printk(KERN_ERR "PCI: Cannot allocate resource region %d"
489 " of device %s\n", idx, pci_name(dev));
490 if (pr)
491 DBG("PCI: parent is %p: %016llx-%016llx (f=%lx)\n",
492 pr, (unsigned long long)pr->start,
493 (unsigned long long)pr->end, pr->flags);
494 /* We'll assign a new address later */
495 r->flags |= IORESOURCE_UNSET;
496 r->end -= r->start;
497 r->start = 0;
498 }
499}
500
501static void __init
502pcibios_allocate_resources(int pass)
503{
504 struct pci_dev *dev = NULL;
505 int idx, disabled;
506 u16 command;
507 struct resource *r;
508
509 for_each_pci_dev(dev) {
510 pci_read_config_word(dev, PCI_COMMAND, &command);
511 for (idx = 0; idx < 6; idx++) {
512 r = &dev->resource[idx];
513 if (r->parent) /* Already allocated */
514 continue;
515 if (!r->flags || (r->flags & IORESOURCE_UNSET))
516 continue; /* Not assigned at all */
517 if (r->flags & IORESOURCE_IO)
518 disabled = !(command & PCI_COMMAND_IO);
519 else
520 disabled = !(command & PCI_COMMAND_MEMORY);
521 if (pass == disabled)
522 alloc_resource(dev, idx);
523 }
524 if (pass)
525 continue;
526 r = &dev->resource[PCI_ROM_RESOURCE];
527 if (r->flags & IORESOURCE_ROM_ENABLE) {
528 /* Turn the ROM off, leave the resource region, but keep it unregistered. */
529 u32 reg;
530 DBG("PCI: Switching off ROM of %s\n", pci_name(dev));
531 r->flags &= ~IORESOURCE_ROM_ENABLE;
532 pci_read_config_dword(dev, dev->rom_base_reg, &reg);
533 pci_write_config_dword(dev, dev->rom_base_reg,
534 reg & ~PCI_ROM_ADDRESS_ENABLE);
535 }
536 }
537}
538
539static void __init
540pcibios_assign_resources(void)
541{
542 struct pci_dev *dev = NULL;
543 int idx;
544 struct resource *r;
545
546 for_each_pci_dev(dev) {
547 int class = dev->class >> 8;
548
549 /* Don't touch classless devices and host bridges */
550 if (!class || class == PCI_CLASS_BRIDGE_HOST)
551 continue;
552
553 for (idx = 0; idx < 6; idx++) {
554 r = &dev->resource[idx];
555
556 /*
557 * We shall assign a new address to this resource,
558 * either because the BIOS (sic) forgot to do so
559 * or because we have decided the old address was
560 * unusable for some reason.
561 */
562 if ((r->flags & IORESOURCE_UNSET) && r->end &&
563 (!ppc_md.pcibios_enable_device_hook ||
564 !ppc_md.pcibios_enable_device_hook(dev, 1))) {
565 r->flags &= ~IORESOURCE_UNSET;
566 pci_assign_resource(dev, idx);
567 }
568 }
569
570#if 0 /* don't assign ROMs */
571 r = &dev->resource[PCI_ROM_RESOURCE];
572 r->end -= r->start;
573 r->start = 0;
574 if (r->end)
575 pci_assign_resource(dev, PCI_ROM_RESOURCE);
576#endif
577 }
578}
579
580
581static int next_controller_index;
582
583struct pci_controller * __init
584pcibios_alloc_controller(void)
585{
586 struct pci_controller *hose;
587
588 hose = (struct pci_controller *)alloc_bootmem(sizeof(*hose));
589 memset(hose, 0, sizeof(struct pci_controller));
590
591 *hose_tail = hose;
592 hose_tail = &hose->next;
593
594 hose->index = next_controller_index++;
595
596 return hose;
597}
598
599void pcibios_make_OF_bus_map(void)
600{
601}
602
603static int __init
604pcibios_init(void)
605{
606 struct pci_controller *hose;
607 struct pci_bus *bus;
608 int next_busno;
609
610 printk(KERN_INFO "PCI: Probing PCI hardware\n");
611
612 /* Scan all of the recorded PCI controllers. */
613 for (next_busno = 0, hose = hose_head; hose; hose = hose->next) {
614 if (pci_assign_all_buses)
615 hose->first_busno = next_busno;
616 hose->last_busno = 0xff;
617 bus = pci_scan_bus(hose->first_busno, hose->ops, hose);
618 hose->last_busno = bus->subordinate;
619 if (pci_assign_all_buses || next_busno <= hose->last_busno)
620 next_busno = hose->last_busno + pcibios_assign_bus_offset;
621 }
622 pci_bus_count = next_busno;
623
624 /* OpenFirmware based machines need a map of OF bus
625 * numbers vs. kernel bus numbers since we may have to
626 * remap them.
627 */
628 if (pci_assign_all_buses && have_of)
629 pcibios_make_OF_bus_map();
630
631 /* Do machine dependent PCI interrupt routing */
632 if (ppc_md.pci_swizzle && ppc_md.pci_map_irq)
633 pci_fixup_irqs(ppc_md.pci_swizzle, ppc_md.pci_map_irq);
634
635 /* Call machine dependent fixup */
636 if (ppc_md.pcibios_fixup)
637 ppc_md.pcibios_fixup();
638
639 /* Allocate and assign resources */
640 pcibios_allocate_bus_resources(&pci_root_buses);
641 pcibios_allocate_resources(0);
642 pcibios_allocate_resources(1);
643 pcibios_assign_resources();
644
645 /* Call machine dependent post-init code */
646 if (ppc_md.pcibios_after_init)
647 ppc_md.pcibios_after_init();
648
649 return 0;
650}
651
652subsys_initcall(pcibios_init);
653
654unsigned char __init
655common_swizzle(struct pci_dev *dev, unsigned char *pinp)
656{
657 struct pci_controller *hose = dev->sysdata;
658
659 if (dev->bus->number != hose->first_busno) {
660 u8 pin = *pinp;
661 do {
662 pin = bridge_swizzle(pin, PCI_SLOT(dev->devfn));
663 /* Move up the chain of bridges. */
664 dev = dev->bus->self;
665 } while (dev->bus->self);
666 *pinp = pin;
667
668 /* The slot is the idsel of the last bridge. */
669 }
670 return PCI_SLOT(dev->devfn);
671}
672
673unsigned long resource_fixup(struct pci_dev * dev, struct resource * res,
674 unsigned long start, unsigned long size)
675{
676 return start;
677}
678
679void __init pcibios_fixup_bus(struct pci_bus *bus)
680{
681 struct pci_controller *hose = (struct pci_controller *) bus->sysdata;
682 unsigned long io_offset;
683 struct resource *res;
684 int i;
685
686 io_offset = (unsigned long)hose->io_base_virt - isa_io_base;
687 if (bus->parent == NULL) {
688 /* This is a host bridge - fill in its resources */
689 hose->bus = bus;
690
691 bus->resource[0] = res = &hose->io_resource;
692 if (!res->flags) {
693 if (io_offset)
694 printk(KERN_ERR "I/O resource not set for host"
695 " bridge %d\n", hose->index);
696 res->start = 0;
697 res->end = IO_SPACE_LIMIT;
698 res->flags = IORESOURCE_IO;
699 }
700 res->start += io_offset;
701 res->end += io_offset;
702
703 for (i = 0; i < 3; ++i) {
704 res = &hose->mem_resources[i];
705 if (!res->flags) {
706 if (i > 0)
707 continue;
708 printk(KERN_ERR "Memory resource not set for "
709 "host bridge %d\n", hose->index);
710 res->start = hose->pci_mem_offset;
711 res->end = ~0U;
712 res->flags = IORESOURCE_MEM;
713 }
714 bus->resource[i+1] = res;
715 }
716 } else {
717 /* This is a subordinate bridge */
718 pci_read_bridge_bases(bus);
719
720 for (i = 0; i < 4; ++i) {
721 if ((res = bus->resource[i]) == NULL)
722 continue;
723 if (!res->flags)
724 continue;
725 if (io_offset && (res->flags & IORESOURCE_IO)) {
726 res->start += io_offset;
727 res->end += io_offset;
728 } else if (hose->pci_mem_offset
729 && (res->flags & IORESOURCE_MEM)) {
730 res->start += hose->pci_mem_offset;
731 res->end += hose->pci_mem_offset;
732 }
733 }
734 }
735
736 if (ppc_md.pcibios_fixup_bus)
737 ppc_md.pcibios_fixup_bus(bus);
738}
739
740char __init *pcibios_setup(char *str)
741{
742 return str;
743}
744
745/* the next one is stolen from the alpha port... */
746void __init
747pcibios_update_irq(struct pci_dev *dev, int irq)
748{
749 pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq);
750 /* XXX FIXME - update OF device tree node interrupt property */
751}
752
753int pcibios_enable_device(struct pci_dev *dev, int mask)
754{
755 if (ppc_md.pcibios_enable_device_hook)
756 if (ppc_md.pcibios_enable_device_hook(dev, 0))
757 return -EINVAL;
758
759 return pci_enable_resources(dev, mask);
760}
761
762struct pci_controller*
763pci_bus_to_hose(int bus)
764{
765 struct pci_controller* hose = hose_head;
766
767 for (; hose; hose = hose->next)
768 if (bus >= hose->first_busno && bus <= hose->last_busno)
769 return hose;
770 return NULL;
771}
772
773void __iomem *
774pci_bus_io_base(unsigned int bus)
775{
776 struct pci_controller *hose;
777
778 hose = pci_bus_to_hose(bus);
779 if (!hose)
780 return NULL;
781 return hose->io_base_virt;
782}
783
784unsigned long
785pci_bus_io_base_phys(unsigned int bus)
786{
787 struct pci_controller *hose;
788
789 hose = pci_bus_to_hose(bus);
790 if (!hose)
791 return 0;
792 return hose->io_base_phys;
793}
794
795unsigned long
796pci_bus_mem_base_phys(unsigned int bus)
797{
798 struct pci_controller *hose;
799
800 hose = pci_bus_to_hose(bus);
801 if (!hose)
802 return 0;
803 return hose->pci_mem_offset;
804}
805
806unsigned long
807pci_resource_to_bus(struct pci_dev *pdev, struct resource *res)
808{
809 /* Hack alert again ! See comments in chrp_pci.c
810 */
811 struct pci_controller* hose =
812 (struct pci_controller *)pdev->sysdata;
813 if (hose && res->flags & IORESOURCE_MEM)
814 return res->start - hose->pci_mem_offset;
815 /* We may want to do something with IOs here... */
816 return res->start;
817}
818
819
820static struct resource *__pci_mmap_make_offset(struct pci_dev *dev,
821 resource_size_t *offset,
822 enum pci_mmap_state mmap_state)
823{
824 struct pci_controller *hose = pci_bus_to_hose(dev->bus->number);
825 unsigned long io_offset = 0;
826 int i, res_bit;
827
828 if (hose == 0)
829 return NULL; /* should never happen */
830
831 /* If memory, add on the PCI bridge address offset */
832 if (mmap_state == pci_mmap_mem) {
833#if 0 /* See comment in pci_resource_to_user() for why this is disabled */
834 *offset += hose->pci_mem_offset;
835#endif
836 res_bit = IORESOURCE_MEM;
837 } else {
838 io_offset = hose->io_base_virt - ___IO_BASE;
839 *offset += io_offset;
840 res_bit = IORESOURCE_IO;
841 }
842
843 /*
844 * Check that the offset requested corresponds to one of the
845 * resources of the device.
846 */
847 for (i = 0; i <= PCI_ROM_RESOURCE; i++) {
848 struct resource *rp = &dev->resource[i];
849 int flags = rp->flags;
850
851 /* treat ROM as memory (should be already) */
852 if (i == PCI_ROM_RESOURCE)
853 flags |= IORESOURCE_MEM;
854
855 /* Active and same type? */
856 if ((flags & res_bit) == 0)
857 continue;
858
859 /* In the range of this resource? */
860 if (*offset < (rp->start & PAGE_MASK) || *offset > rp->end)
861 continue;
862
863 /* found it! construct the final physical address */
864 if (mmap_state == pci_mmap_io)
865 *offset += hose->io_base_phys - io_offset;
866 return rp;
867 }
868
869 return NULL;
870}
871
872/*
873 * Set vm_page_prot of VMA, as appropriate for this architecture, for a pci
874 * device mapping.
875 */
876static pgprot_t __pci_mmap_set_pgprot(struct pci_dev *dev, struct resource *rp,
877 pgprot_t protection,
878 enum pci_mmap_state mmap_state,
879 int write_combine)
880{
881 unsigned long prot = pgprot_val(protection);
882
883 /* Write combine is always 0 on non-memory space mappings. On
884 * memory space, if the user didn't pass 1, we check for a
885 * "prefetchable" resource. This is a bit hackish, but we use
886 * this to workaround the inability of /sysfs to provide a write
887 * combine bit
888 */
889 if (mmap_state != pci_mmap_mem)
890 write_combine = 0;
891 else if (write_combine == 0) {
892 if (rp->flags & IORESOURCE_PREFETCH)
893 write_combine = 1;
894 }
895
896 /* XXX would be nice to have a way to ask for write-through */
897 prot |= _PAGE_NO_CACHE;
898 if (write_combine)
899 prot &= ~_PAGE_GUARDED;
900 else
901 prot |= _PAGE_GUARDED;
902
903 printk("PCI map for %s:%llx, prot: %lx\n", pci_name(dev),
904 (unsigned long long)rp->start, prot);
905
906 return __pgprot(prot);
907}
908
909/*
910 * This one is used by /dev/mem and fbdev who have no clue about the
911 * PCI device, it tries to find the PCI device first and calls the
912 * above routine
913 */
914pgprot_t pci_phys_mem_access_prot(struct file *file,
915 unsigned long pfn,
916 unsigned long size,
917 pgprot_t protection)
918{
919 struct pci_dev *pdev = NULL;
920 struct resource *found = NULL;
921 unsigned long prot = pgprot_val(protection);
922 unsigned long offset = pfn << PAGE_SHIFT;
923 int i;
924
925 if (page_is_ram(pfn))
926 return prot;
927
928 prot |= _PAGE_NO_CACHE | _PAGE_GUARDED;
929
930 for_each_pci_dev(pdev) {
931 for (i = 0; i <= PCI_ROM_RESOURCE; i++) {
932 struct resource *rp = &pdev->resource[i];
933 int flags = rp->flags;
934
935 /* Active and same type? */
936 if ((flags & IORESOURCE_MEM) == 0)
937 continue;
938 /* In the range of this resource? */
939 if (offset < (rp->start & PAGE_MASK) ||
940 offset > rp->end)
941 continue;
942 found = rp;
943 break;
944 }
945 if (found)
946 break;
947 }
948 if (found) {
949 if (found->flags & IORESOURCE_PREFETCH)
950 prot &= ~_PAGE_GUARDED;
951 pci_dev_put(pdev);
952 }
953
954 DBG("non-PCI map for %lx, prot: %lx\n", offset, prot);
955
956 return __pgprot(prot);
957}
958
959
960/*
961 * Perform the actual remap of the pages for a PCI device mapping, as
962 * appropriate for this architecture. The region in the process to map
963 * is described by vm_start and vm_end members of VMA, the base physical
964 * address is found in vm_pgoff.
965 * The pci device structure is provided so that architectures may make mapping
966 * decisions on a per-device or per-bus basis.
967 *
968 * Returns a negative error code on failure, zero on success.
969 */
970int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
971 enum pci_mmap_state mmap_state,
972 int write_combine)
973{
974 resource_size_t offset = vma->vm_pgoff << PAGE_SHIFT;
975 struct resource *rp;
976 int ret;
977
978 rp = __pci_mmap_make_offset(dev, &offset, mmap_state);
979 if (rp == NULL)
980 return -EINVAL;
981
982 vma->vm_pgoff = offset >> PAGE_SHIFT;
983 vma->vm_page_prot = __pci_mmap_set_pgprot(dev, rp,
984 vma->vm_page_prot,
985 mmap_state, write_combine);
986
987 ret = remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff,
988 vma->vm_end - vma->vm_start, vma->vm_page_prot);
989
990 return ret;
991}
992
993/* Obsolete functions. Should be removed once the symbios driver
994 * is fixed
995 */
996unsigned long
997phys_to_bus(unsigned long pa)
998{
999 struct pci_controller *hose;
1000 int i;
1001
1002 for (hose = hose_head; hose; hose = hose->next) {
1003 for (i = 0; i < 3; ++i) {
1004 if (pa >= hose->mem_resources[i].start
1005 && pa <= hose->mem_resources[i].end) {
1006 /*
1007 * XXX the hose->pci_mem_offset really
1008 * only applies to mem_resources[0].
1009 * We need a way to store an offset for
1010 * the others. -- paulus
1011 */
1012 if (i == 0)
1013 pa -= hose->pci_mem_offset;
1014 return pa;
1015 }
1016 }
1017 }
1018 /* hmmm, didn't find it */
1019 return 0;
1020}
1021
1022unsigned long
1023pci_phys_to_bus(unsigned long pa, int busnr)
1024{
1025 struct pci_controller* hose = pci_bus_to_hose(busnr);
1026 if (!hose)
1027 return pa;
1028 return pa - hose->pci_mem_offset;
1029}
1030
1031unsigned long
1032pci_bus_to_phys(unsigned int ba, int busnr)
1033{
1034 struct pci_controller* hose = pci_bus_to_hose(busnr);
1035 if (!hose)
1036 return ba;
1037 return ba + hose->pci_mem_offset;
1038}
1039
1040/* Provide information on locations of various I/O regions in physical
1041 * memory. Do this on a per-card basis so that we choose the right
1042 * root bridge.
1043 * Note that the returned IO or memory base is a physical address
1044 */
1045
1046long sys_pciconfig_iobase(long which, unsigned long bus, unsigned long devfn)
1047{
1048 struct pci_controller* hose;
1049 long result = -EOPNOTSUPP;
1050
1051 hose = pci_bus_to_hose(bus);
1052 if (!hose)
1053 return -ENODEV;
1054
1055 switch (which) {
1056 case IOBASE_BRIDGE_NUMBER:
1057 return (long)hose->first_busno;
1058 case IOBASE_MEMORY:
1059 return (long)hose->pci_mem_offset;
1060 case IOBASE_IO:
1061 return (long)hose->io_base_phys;
1062 case IOBASE_ISA_IO:
1063 return (long)isa_io_base;
1064 case IOBASE_ISA_MEM:
1065 return (long)isa_mem_base;
1066 }
1067
1068 return result;
1069}
1070
1071void pci_resource_to_user(const struct pci_dev *dev, int bar,
1072 const struct resource *rsrc,
1073 resource_size_t *start, resource_size_t *end)
1074{
1075 struct pci_controller *hose = pci_bus_to_hose(dev->bus->number);
1076 resource_size_t offset = 0;
1077
1078 if (hose == NULL)
1079 return;
1080
1081 if (rsrc->flags & IORESOURCE_IO)
1082 offset = (unsigned long)hose->io_base_virt - _IO_BASE;
1083
1084 /* We pass a fully fixed up address to userland for MMIO instead of
1085 * a BAR value because X is lame and expects to be able to use that
1086 * to pass to /dev/mem !
1087 *
1088 * That means that we'll have potentially 64 bits values where some
1089 * userland apps only expect 32 (like X itself since it thinks only
1090 * Sparc has 64 bits MMIO) but if we don't do that, we break it on
1091 * 32 bits CHRPs :-(
1092 *
1093 * Hopefully, the sysfs insterface is immune to that gunk. Once X
1094 * has been fixed (and the fix spread enough), we can re-enable the
1095 * 2 lines below and pass down a BAR value to userland. In that case
1096 * we'll also have to re-enable the matching code in
1097 * __pci_mmap_make_offset().
1098 *
1099 * BenH.
1100 */
1101#if 0
1102 else if (rsrc->flags & IORESOURCE_MEM)
1103 offset = hose->pci_mem_offset;
1104#endif
1105
1106 *start = rsrc->start - offset;
1107 *end = rsrc->end - offset;
1108}
1109
1110void __init pci_init_resource(struct resource *res, resource_size_t start,
1111 resource_size_t end, int flags, char *name)
1112{
1113 res->start = start;
1114 res->end = end;
1115 res->flags = flags;
1116 res->name = name;
1117 res->parent = NULL;
1118 res->sibling = NULL;
1119 res->child = NULL;
1120}
1121
1122void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max)
1123{
1124 resource_size_t start = pci_resource_start(dev, bar);
1125 resource_size_t len = pci_resource_len(dev, bar);
1126 unsigned long flags = pci_resource_flags(dev, bar);
1127
1128 if (!len)
1129 return NULL;
1130 if (max && len > max)
1131 len = max;
1132 if (flags & IORESOURCE_IO)
1133 return ioport_map(start, len);
1134 if (flags & IORESOURCE_MEM)
1135 /* Not checking IORESOURCE_CACHEABLE because PPC does
1136 * not currently distinguish between ioremap and
1137 * ioremap_nocache.
1138 */
1139 return ioremap(start, len);
1140 /* What? */
1141 return NULL;
1142}
1143
1144void pci_iounmap(struct pci_dev *dev, void __iomem *addr)
1145{
1146 /* Nothing to do */
1147}
1148EXPORT_SYMBOL(pci_iomap);
1149EXPORT_SYMBOL(pci_iounmap);
1150
1151unsigned long pci_address_to_pio(phys_addr_t address)
1152{
1153 struct pci_controller* hose = hose_head;
1154
1155 for (; hose; hose = hose->next) {
1156 unsigned int size = hose->io_resource.end -
1157 hose->io_resource.start + 1;
1158 if (address >= hose->io_base_phys &&
1159 address < (hose->io_base_phys + size)) {
1160 unsigned long base =
1161 (unsigned long)hose->io_base_virt - _IO_BASE;
1162 return base + (address - hose->io_base_phys);
1163 }
1164 }
1165 return (unsigned int)-1;
1166}
1167EXPORT_SYMBOL(pci_address_to_pio);
1168
1169/*
1170 * Null PCI config access functions, for the case when we can't
1171 * find a hose.
1172 */
1173#define NULL_PCI_OP(rw, size, type) \
1174static int \
1175null_##rw##_config_##size(struct pci_dev *dev, int offset, type val) \
1176{ \
1177 return PCIBIOS_DEVICE_NOT_FOUND; \
1178}
1179
1180static int
1181null_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
1182 int len, u32 *val)
1183{
1184 return PCIBIOS_DEVICE_NOT_FOUND;
1185}
1186
1187static int
1188null_write_config(struct pci_bus *bus, unsigned int devfn, int offset,
1189 int len, u32 val)
1190{
1191 return PCIBIOS_DEVICE_NOT_FOUND;
1192}
1193
1194static struct pci_ops null_pci_ops =
1195{
1196 null_read_config,
1197 null_write_config
1198};
1199
1200/*
1201 * These functions are used early on before PCI scanning is done
1202 * and all of the pci_dev and pci_bus structures have been created.
1203 */
1204static struct pci_bus *
1205fake_pci_bus(struct pci_controller *hose, int busnr)
1206{
1207 static struct pci_bus bus;
1208
1209 if (hose == 0) {
1210 hose = pci_bus_to_hose(busnr);
1211 if (hose == 0)
1212 printk(KERN_ERR "Can't find hose for PCI bus %d!\n", busnr);
1213 }
1214 bus.number = busnr;
1215 bus.sysdata = hose;
1216 bus.ops = hose? hose->ops: &null_pci_ops;
1217 return &bus;
1218}
1219
1220#define EARLY_PCI_OP(rw, size, type) \
1221int early_##rw##_config_##size(struct pci_controller *hose, int bus, \
1222 int devfn, int offset, type value) \
1223{ \
1224 return pci_bus_##rw##_config_##size(fake_pci_bus(hose, bus), \
1225 devfn, offset, value); \
1226}
1227
1228EARLY_PCI_OP(read, byte, u8 *)
1229EARLY_PCI_OP(read, word, u16 *)
1230EARLY_PCI_OP(read, dword, u32 *)
1231EARLY_PCI_OP(write, byte, u8)
1232EARLY_PCI_OP(write, word, u16)
1233EARLY_PCI_OP(write, dword, u32)
diff --git a/arch/ppc/kernel/ppc-stub.c b/arch/ppc/kernel/ppc-stub.c
deleted file mode 100644
index 5f9ee7bb67ec..000000000000
--- a/arch/ppc/kernel/ppc-stub.c
+++ /dev/null
@@ -1,866 +0,0 @@
1/*
2 * ppc-stub.c: KGDB support for the Linux kernel.
3 *
4 * adapted from arch/sparc/kernel/sparc-stub.c for the PowerPC
5 * some stuff borrowed from Paul Mackerras' xmon
6 * Copyright (C) 1998 Michael AK Tesch (tesch@cs.wisc.edu)
7 *
8 * Modifications to run under Linux
9 * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
10 *
11 * This file originally came from the gdb sources, and the
12 * copyright notices have been retained below.
13 */
14
15/****************************************************************************
16
17 THIS SOFTWARE IS NOT COPYRIGHTED
18
19 HP offers the following for use in the public domain. HP makes no
20 warranty with regard to the software or its performance and the
21 user accepts the software "AS IS" with all faults.
22
23 HP DISCLAIMS ANY WARRANTIES, EXPRESS OR IMPLIED, WITH REGARD
24 TO THIS SOFTWARE INCLUDING BUT NOT LIMITED TO THE WARRANTIES
25 OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
26
27****************************************************************************/
28
29/****************************************************************************
30 * Header: remcom.c,v 1.34 91/03/09 12:29:49 glenne Exp $
31 *
32 * Module name: remcom.c $
33 * Revision: 1.34 $
34 * Date: 91/03/09 12:29:49 $
35 * Contributor: Lake Stevens Instrument Division$
36 *
37 * Description: low level support for gdb debugger. $
38 *
39 * Considerations: only works on target hardware $
40 *
41 * Written by: Glenn Engel $
42 * ModuleState: Experimental $
43 *
44 * NOTES: See Below $
45 *
46 * Modified for SPARC by Stu Grossman, Cygnus Support.
47 *
48 * This code has been extensively tested on the Fujitsu SPARClite demo board.
49 *
50 * To enable debugger support, two things need to happen. One, a
51 * call to set_debug_traps() is necessary in order to allow any breakpoints
52 * or error conditions to be properly intercepted and reported to gdb.
53 * Two, a breakpoint needs to be generated to begin communication. This
54 * is most easily accomplished by a call to breakpoint(). Breakpoint()
55 * simulates a breakpoint by executing a trap #1.
56 *
57 *************
58 *
59 * The following gdb commands are supported:
60 *
61 * command function Return value
62 *
63 * g return the value of the CPU registers hex data or ENN
64 * G set the value of the CPU registers OK or ENN
65 * qOffsets Get section offsets. Reply is Text=xxx;Data=yyy;Bss=zzz
66 *
67 * mAA..AA,LLLL Read LLLL bytes at address AA..AA hex data or ENN
68 * MAA..AA,LLLL: Write LLLL bytes at address AA.AA OK or ENN
69 *
70 * c Resume at current address SNN ( signal NN)
71 * cAA..AA Continue at address AA..AA SNN
72 *
73 * s Step one instruction SNN
74 * sAA..AA Step one instruction from AA..AA SNN
75 *
76 * k kill
77 *
78 * ? What was the last sigval ? SNN (signal NN)
79 *
80 * bBB..BB Set baud rate to BB..BB OK or BNN, then sets
81 * baud rate
82 *
83 * All commands and responses are sent with a packet which includes a
84 * checksum. A packet consists of
85 *
86 * $<packet info>#<checksum>.
87 *
88 * where
89 * <packet info> :: <characters representing the command or response>
90 * <checksum> :: <two hex digits computed as modulo 256 sum of <packetinfo>>
91 *
92 * When a packet is received, it is first acknowledged with either '+' or '-'.
93 * '+' indicates a successful transfer. '-' indicates a failed transfer.
94 *
95 * Example:
96 *
97 * Host: Reply:
98 * $m0,10#2a +$00010203040506070809101112131415#42
99 *
100 ****************************************************************************/
101
102#include <linux/kernel.h>
103#include <linux/string.h>
104#include <linux/mm.h>
105#include <linux/smp.h>
106#include <linux/smp_lock.h>
107#include <linux/init.h>
108#include <linux/sysrq.h>
109
110#include <asm/cacheflush.h>
111#include <asm/system.h>
112#include <asm/signal.h>
113#include <asm/kgdb.h>
114#include <asm/pgtable.h>
115#include <asm/ptrace.h>
116
117void breakinst(void);
118
119/*
120 * BUFMAX defines the maximum number of characters in inbound/outbound buffers
121 * at least NUMREGBYTES*2 are needed for register packets
122 */
123#define BUFMAX 2048
124static char remcomInBuffer[BUFMAX];
125static char remcomOutBuffer[BUFMAX];
126
127static int initialized;
128static int kgdb_active;
129static int kgdb_started;
130static u_int fault_jmp_buf[100];
131static int kdebug;
132
133
134static const char hexchars[]="0123456789abcdef";
135
136/* Place where we save old trap entries for restoration - sparc*/
137/* struct tt_entry kgdb_savettable[256]; */
138/* typedef void (*trapfunc_t)(void); */
139
140static void kgdb_fault_handler(struct pt_regs *regs);
141static int handle_exception (struct pt_regs *regs);
142
143#if 0
144/* Install an exception handler for kgdb */
145static void exceptionHandler(int tnum, unsigned int *tfunc)
146{
147 /* We are dorking with a live trap table, all irqs off */
148}
149#endif
150
151int
152kgdb_setjmp(long *buf)
153{
154 asm ("mflr 0; stw 0,0(%0);"
155 "stw 1,4(%0); stw 2,8(%0);"
156 "mfcr 0; stw 0,12(%0);"
157 "stmw 13,16(%0)"
158 : : "r" (buf));
159 /* XXX should save fp regs as well */
160 return 0;
161}
162void
163kgdb_longjmp(long *buf, int val)
164{
165 if (val == 0)
166 val = 1;
167 asm ("lmw 13,16(%0);"
168 "lwz 0,12(%0); mtcrf 0x38,0;"
169 "lwz 0,0(%0); lwz 1,4(%0); lwz 2,8(%0);"
170 "mtlr 0; mr 3,%1"
171 : : "r" (buf), "r" (val));
172}
173/* Convert ch from a hex digit to an int */
174static int
175hex(unsigned char ch)
176{
177 if (ch >= 'a' && ch <= 'f')
178 return ch-'a'+10;
179 if (ch >= '0' && ch <= '9')
180 return ch-'0';
181 if (ch >= 'A' && ch <= 'F')
182 return ch-'A'+10;
183 return -1;
184}
185
186/* Convert the memory pointed to by mem into hex, placing result in buf.
187 * Return a pointer to the last char put in buf (null), in case of mem fault,
188 * return 0.
189 */
190static unsigned char *
191mem2hex(const char *mem, char *buf, int count)
192{
193 unsigned char ch;
194 unsigned short tmp_s;
195 unsigned long tmp_l;
196
197 if (kgdb_setjmp((long*)fault_jmp_buf) == 0) {
198 debugger_fault_handler = kgdb_fault_handler;
199
200 /* Accessing 16 bit and 32 bit objects in a single
201 ** load instruction is required to avoid bad side
202 ** effects for some IO registers.
203 */
204
205 if ((count == 2) && (((long)mem & 1) == 0)) {
206 tmp_s = *(unsigned short *)mem;
207 mem += 2;
208 *buf++ = hexchars[(tmp_s >> 12) & 0xf];
209 *buf++ = hexchars[(tmp_s >> 8) & 0xf];
210 *buf++ = hexchars[(tmp_s >> 4) & 0xf];
211 *buf++ = hexchars[tmp_s & 0xf];
212
213 } else if ((count == 4) && (((long)mem & 3) == 0)) {
214 tmp_l = *(unsigned int *)mem;
215 mem += 4;
216 *buf++ = hexchars[(tmp_l >> 28) & 0xf];
217 *buf++ = hexchars[(tmp_l >> 24) & 0xf];
218 *buf++ = hexchars[(tmp_l >> 20) & 0xf];
219 *buf++ = hexchars[(tmp_l >> 16) & 0xf];
220 *buf++ = hexchars[(tmp_l >> 12) & 0xf];
221 *buf++ = hexchars[(tmp_l >> 8) & 0xf];
222 *buf++ = hexchars[(tmp_l >> 4) & 0xf];
223 *buf++ = hexchars[tmp_l & 0xf];
224
225 } else {
226 while (count-- > 0) {
227 ch = *mem++;
228 *buf++ = hexchars[ch >> 4];
229 *buf++ = hexchars[ch & 0xf];
230 }
231 }
232
233 } else {
234 /* error condition */
235 }
236 debugger_fault_handler = NULL;
237 *buf = 0;
238 return buf;
239}
240
241/* convert the hex array pointed to by buf into binary to be placed in mem
242 * return a pointer to the character AFTER the last byte written.
243*/
244static char *
245hex2mem(char *buf, char *mem, int count)
246{
247 unsigned char ch;
248 int i;
249 char *orig_mem;
250 unsigned short tmp_s;
251 unsigned long tmp_l;
252
253 orig_mem = mem;
254
255 if (kgdb_setjmp((long*)fault_jmp_buf) == 0) {
256 debugger_fault_handler = kgdb_fault_handler;
257
258 /* Accessing 16 bit and 32 bit objects in a single
259 ** store instruction is required to avoid bad side
260 ** effects for some IO registers.
261 */
262
263 if ((count == 2) && (((long)mem & 1) == 0)) {
264 tmp_s = hex(*buf++) << 12;
265 tmp_s |= hex(*buf++) << 8;
266 tmp_s |= hex(*buf++) << 4;
267 tmp_s |= hex(*buf++);
268
269 *(unsigned short *)mem = tmp_s;
270 mem += 2;
271
272 } else if ((count == 4) && (((long)mem & 3) == 0)) {
273 tmp_l = hex(*buf++) << 28;
274 tmp_l |= hex(*buf++) << 24;
275 tmp_l |= hex(*buf++) << 20;
276 tmp_l |= hex(*buf++) << 16;
277 tmp_l |= hex(*buf++) << 12;
278 tmp_l |= hex(*buf++) << 8;
279 tmp_l |= hex(*buf++) << 4;
280 tmp_l |= hex(*buf++);
281
282 *(unsigned long *)mem = tmp_l;
283 mem += 4;
284
285 } else {
286 for (i=0; i<count; i++) {
287 ch = hex(*buf++) << 4;
288 ch |= hex(*buf++);
289 *mem++ = ch;
290 }
291 }
292
293
294 /*
295 ** Flush the data cache, invalidate the instruction cache.
296 */
297 flush_icache_range((int)orig_mem, (int)orig_mem + count - 1);
298
299 } else {
300 /* error condition */
301 }
302 debugger_fault_handler = NULL;
303 return mem;
304}
305
306/*
307 * While we find nice hex chars, build an int.
308 * Return number of chars processed.
309 */
310static int
311hexToInt(char **ptr, int *intValue)
312{
313 int numChars = 0;
314 int hexValue;
315
316 *intValue = 0;
317
318 if (kgdb_setjmp((long*)fault_jmp_buf) == 0) {
319 debugger_fault_handler = kgdb_fault_handler;
320 while (**ptr) {
321 hexValue = hex(**ptr);
322 if (hexValue < 0)
323 break;
324
325 *intValue = (*intValue << 4) | hexValue;
326 numChars ++;
327
328 (*ptr)++;
329 }
330 } else {
331 /* error condition */
332 }
333 debugger_fault_handler = NULL;
334
335 return (numChars);
336}
337
338/* scan for the sequence $<data>#<checksum> */
339static void
340getpacket(char *buffer)
341{
342 unsigned char checksum;
343 unsigned char xmitcsum;
344 int i;
345 int count;
346 unsigned char ch;
347
348 do {
349 /* wait around for the start character, ignore all other
350 * characters */
351 while ((ch = (getDebugChar() & 0x7f)) != '$') ;
352
353 checksum = 0;
354 xmitcsum = -1;
355
356 count = 0;
357
358 /* now, read until a # or end of buffer is found */
359 while (count < BUFMAX) {
360 ch = getDebugChar() & 0x7f;
361 if (ch == '#')
362 break;
363 checksum = checksum + ch;
364 buffer[count] = ch;
365 count = count + 1;
366 }
367
368 if (count >= BUFMAX)
369 continue;
370
371 buffer[count] = 0;
372
373 if (ch == '#') {
374 xmitcsum = hex(getDebugChar() & 0x7f) << 4;
375 xmitcsum |= hex(getDebugChar() & 0x7f);
376 if (checksum != xmitcsum)
377 putDebugChar('-'); /* failed checksum */
378 else {
379 putDebugChar('+'); /* successful transfer */
380 /* if a sequence char is present, reply the ID */
381 if (buffer[2] == ':') {
382 putDebugChar(buffer[0]);
383 putDebugChar(buffer[1]);
384 /* remove sequence chars from buffer */
385 count = strlen(buffer);
386 for (i=3; i <= count; i++)
387 buffer[i-3] = buffer[i];
388 }
389 }
390 }
391 } while (checksum != xmitcsum);
392}
393
394/* send the packet in buffer. */
395static void putpacket(unsigned char *buffer)
396{
397 unsigned char checksum;
398 int count;
399 unsigned char ch, recv;
400
401 /* $<packet info>#<checksum>. */
402 do {
403 putDebugChar('$');
404 checksum = 0;
405 count = 0;
406
407 while ((ch = buffer[count])) {
408 putDebugChar(ch);
409 checksum += ch;
410 count += 1;
411 }
412
413 putDebugChar('#');
414 putDebugChar(hexchars[checksum >> 4]);
415 putDebugChar(hexchars[checksum & 0xf]);
416 recv = getDebugChar();
417 } while ((recv & 0x7f) != '+');
418}
419
420static void kgdb_flush_cache_all(void)
421{
422 flush_instruction_cache();
423}
424
425/* Set up exception handlers for tracing and breakpoints
426 * [could be called kgdb_init()]
427 */
428void set_debug_traps(void)
429{
430#if 0
431 unsigned char c;
432
433 save_and_cli(flags);
434
435 /* In case GDB is started before us, ack any packets (presumably
436 * "$?#xx") sitting there.
437 *
438 * I've found this code causes more problems than it solves,
439 * so that's why it's commented out. GDB seems to work fine
440 * now starting either before or after the kernel -bwb
441 */
442
443 while((c = getDebugChar()) != '$');
444 while((c = getDebugChar()) != '#');
445 c = getDebugChar(); /* eat first csum byte */
446 c = getDebugChar(); /* eat second csum byte */
447 putDebugChar('+'); /* ack it */
448#endif
449 debugger = kgdb;
450 debugger_bpt = kgdb_bpt;
451 debugger_sstep = kgdb_sstep;
452 debugger_iabr_match = kgdb_iabr_match;
453 debugger_dabr_match = kgdb_dabr_match;
454
455 initialized = 1;
456}
457
458static void kgdb_fault_handler(struct pt_regs *regs)
459{
460 kgdb_longjmp((long*)fault_jmp_buf, 1);
461}
462
463int kgdb_bpt(struct pt_regs *regs)
464{
465 return handle_exception(regs);
466}
467
468int kgdb_sstep(struct pt_regs *regs)
469{
470 return handle_exception(regs);
471}
472
473void kgdb(struct pt_regs *regs)
474{
475 handle_exception(regs);
476}
477
478int kgdb_iabr_match(struct pt_regs *regs)
479{
480 printk(KERN_ERR "kgdb doesn't support iabr, what?!?\n");
481 return handle_exception(regs);
482}
483
484int kgdb_dabr_match(struct pt_regs *regs)
485{
486 printk(KERN_ERR "kgdb doesn't support dabr, what?!?\n");
487 return handle_exception(regs);
488}
489
490/* Convert the hardware trap type code to a unix signal number. */
491/*
492 * This table contains the mapping between PowerPC hardware trap types, and
493 * signals, which are primarily what GDB understands.
494 */
495static struct hard_trap_info
496{
497 unsigned int tt; /* Trap type code for powerpc */
498 unsigned char signo; /* Signal that we map this trap into */
499} hard_trap_info[] = {
500#if defined(CONFIG_40x) || defined(CONFIG_BOOKE)
501 { 0x100, SIGINT }, /* critical input interrupt */
502 { 0x200, SIGSEGV }, /* machine check */
503 { 0x300, SIGSEGV }, /* data storage */
504 { 0x400, SIGBUS }, /* instruction storage */
505 { 0x500, SIGINT }, /* interrupt */
506 { 0x600, SIGBUS }, /* alignment */
507 { 0x700, SIGILL }, /* program */
508 { 0x800, SIGILL }, /* reserved */
509 { 0x900, SIGILL }, /* reserved */
510 { 0xa00, SIGILL }, /* reserved */
511 { 0xb00, SIGILL }, /* reserved */
512 { 0xc00, SIGCHLD }, /* syscall */
513 { 0xd00, SIGILL }, /* reserved */
514 { 0xe00, SIGILL }, /* reserved */
515 { 0xf00, SIGILL }, /* reserved */
516 /*
517 ** 0x1000 PIT
518 ** 0x1010 FIT
519 ** 0x1020 watchdog
520 ** 0x1100 data TLB miss
521 ** 0x1200 instruction TLB miss
522 */
523 { 0x2002, SIGTRAP}, /* debug */
524#else
525 { 0x200, SIGSEGV }, /* machine check */
526 { 0x300, SIGSEGV }, /* address error (store) */
527 { 0x400, SIGBUS }, /* instruction bus error */
528 { 0x500, SIGINT }, /* interrupt */
529 { 0x600, SIGBUS }, /* alingment */
530 { 0x700, SIGTRAP }, /* breakpoint trap */
531 { 0x800, SIGFPE }, /* fpu unavail */
532 { 0x900, SIGALRM }, /* decrementer */
533 { 0xa00, SIGILL }, /* reserved */
534 { 0xb00, SIGILL }, /* reserved */
535 { 0xc00, SIGCHLD }, /* syscall */
536 { 0xd00, SIGTRAP }, /* single-step/watch */
537 { 0xe00, SIGFPE }, /* fp assist */
538#endif
539 { 0, 0} /* Must be last */
540
541};
542
543static int computeSignal(unsigned int tt)
544{
545 struct hard_trap_info *ht;
546
547 for (ht = hard_trap_info; ht->tt && ht->signo; ht++)
548 if (ht->tt == tt)
549 return ht->signo;
550
551 return SIGHUP; /* default for things we don't know about */
552}
553
554#define PC_REGNUM 64
555#define SP_REGNUM 1
556
557/*
558 * This function does all command processing for interfacing to gdb.
559 */
560static int
561handle_exception (struct pt_regs *regs)
562{
563 int sigval;
564 int addr;
565 int length;
566 char *ptr;
567 unsigned int msr;
568
569 /* We don't handle user-mode breakpoints. */
570 if (user_mode(regs))
571 return 0;
572
573 if (debugger_fault_handler) {
574 debugger_fault_handler(regs);
575 panic("kgdb longjump failed!\n");
576 }
577 if (kgdb_active) {
578 printk(KERN_ERR "interrupt while in kgdb, returning\n");
579 return 0;
580 }
581
582 kgdb_active = 1;
583 kgdb_started = 1;
584
585#ifdef KGDB_DEBUG
586 printk("kgdb: entering handle_exception; trap [0x%x]\n",
587 (unsigned int)regs->trap);
588#endif
589
590 kgdb_interruptible(0);
591 lock_kernel();
592 msr = mfmsr();
593 mtmsr(msr & ~MSR_EE); /* disable interrupts */
594
595 if (regs->nip == (unsigned long)breakinst) {
596 /* Skip over breakpoint trap insn */
597 regs->nip += 4;
598 }
599
600 /* reply to host that an exception has occurred */
601 sigval = computeSignal(regs->trap);
602 ptr = remcomOutBuffer;
603
604 *ptr++ = 'T';
605 *ptr++ = hexchars[sigval >> 4];
606 *ptr++ = hexchars[sigval & 0xf];
607 *ptr++ = hexchars[PC_REGNUM >> 4];
608 *ptr++ = hexchars[PC_REGNUM & 0xf];
609 *ptr++ = ':';
610 ptr = mem2hex((char *)&regs->nip, ptr, 4);
611 *ptr++ = ';';
612 *ptr++ = hexchars[SP_REGNUM >> 4];
613 *ptr++ = hexchars[SP_REGNUM & 0xf];
614 *ptr++ = ':';
615 ptr = mem2hex(((char *)regs) + SP_REGNUM*4, ptr, 4);
616 *ptr++ = ';';
617 *ptr++ = 0;
618
619 putpacket(remcomOutBuffer);
620 if (kdebug)
621 printk("remcomOutBuffer: %s\n", remcomOutBuffer);
622
623 /* XXX We may want to add some features dealing with poking the
624 * XXX page tables, ... (look at sparc-stub.c for more info)
625 * XXX also required hacking to the gdb sources directly...
626 */
627
628 while (1) {
629 remcomOutBuffer[0] = 0;
630
631 getpacket(remcomInBuffer);
632 switch (remcomInBuffer[0]) {
633 case '?': /* report most recent signal */
634 remcomOutBuffer[0] = 'S';
635 remcomOutBuffer[1] = hexchars[sigval >> 4];
636 remcomOutBuffer[2] = hexchars[sigval & 0xf];
637 remcomOutBuffer[3] = 0;
638 break;
639#if 0
640 case 'q': /* this screws up gdb for some reason...*/
641 {
642 extern long _start, sdata, __bss_start;
643
644 ptr = &remcomInBuffer[1];
645 if (strncmp(ptr, "Offsets", 7) != 0)
646 break;
647
648 ptr = remcomOutBuffer;
649 sprintf(ptr, "Text=%8.8x;Data=%8.8x;Bss=%8.8x",
650 &_start, &sdata, &__bss_start);
651 break;
652 }
653#endif
654 case 'd':
655 /* toggle debug flag */
656 kdebug ^= 1;
657 break;
658
659 case 'g': /* return the value of the CPU registers.
660 * some of them are non-PowerPC names :(
661 * they are stored in gdb like:
662 * struct {
663 * u32 gpr[32];
664 * f64 fpr[32];
665 * u32 pc, ps, cnd, lr; (ps=msr)
666 * u32 cnt, xer, mq;
667 * }
668 */
669 {
670 int i;
671 ptr = remcomOutBuffer;
672 /* General Purpose Regs */
673 ptr = mem2hex((char *)regs, ptr, 32 * 4);
674 /* Floating Point Regs - FIXME */
675 /*ptr = mem2hex((char *), ptr, 32 * 8);*/
676 for(i=0; i<(32*8*2); i++) { /* 2chars/byte */
677 ptr[i] = '0';
678 }
679 ptr += 32*8*2;
680 /* pc, msr, cr, lr, ctr, xer, (mq is unused) */
681 ptr = mem2hex((char *)&regs->nip, ptr, 4);
682 ptr = mem2hex((char *)&regs->msr, ptr, 4);
683 ptr = mem2hex((char *)&regs->ccr, ptr, 4);
684 ptr = mem2hex((char *)&regs->link, ptr, 4);
685 ptr = mem2hex((char *)&regs->ctr, ptr, 4);
686 ptr = mem2hex((char *)&regs->xer, ptr, 4);
687 }
688 break;
689
690 case 'G': /* set the value of the CPU registers */
691 {
692 ptr = &remcomInBuffer[1];
693
694 /*
695 * If the stack pointer has moved, you should pray.
696 * (cause only god can help you).
697 */
698
699 /* General Purpose Regs */
700 hex2mem(ptr, (char *)regs, 32 * 4);
701
702 /* Floating Point Regs - FIXME?? */
703 /*ptr = hex2mem(ptr, ??, 32 * 8);*/
704 ptr += 32*8*2;
705
706 /* pc, msr, cr, lr, ctr, xer, (mq is unused) */
707 ptr = hex2mem(ptr, (char *)&regs->nip, 4);
708 ptr = hex2mem(ptr, (char *)&regs->msr, 4);
709 ptr = hex2mem(ptr, (char *)&regs->ccr, 4);
710 ptr = hex2mem(ptr, (char *)&regs->link, 4);
711 ptr = hex2mem(ptr, (char *)&regs->ctr, 4);
712 ptr = hex2mem(ptr, (char *)&regs->xer, 4);
713
714 strcpy(remcomOutBuffer,"OK");
715 }
716 break;
717 case 'H':
718 /* don't do anything, yet, just acknowledge */
719 hexToInt(&ptr, &addr);
720 strcpy(remcomOutBuffer,"OK");
721 break;
722
723 case 'm': /* mAA..AA,LLLL Read LLLL bytes at address AA..AA */
724 /* Try to read %x,%x. */
725
726 ptr = &remcomInBuffer[1];
727
728 if (hexToInt(&ptr, &addr) && *ptr++ == ','
729 && hexToInt(&ptr, &length)) {
730 if (mem2hex((char *)addr, remcomOutBuffer,
731 length))
732 break;
733 strcpy(remcomOutBuffer, "E03");
734 } else
735 strcpy(remcomOutBuffer, "E01");
736 break;
737
738 case 'M': /* MAA..AA,LLLL: Write LLLL bytes at address AA.AA return OK */
739 /* Try to read '%x,%x:'. */
740
741 ptr = &remcomInBuffer[1];
742
743 if (hexToInt(&ptr, &addr) && *ptr++ == ','
744 && hexToInt(&ptr, &length)
745 && *ptr++ == ':') {
746 if (hex2mem(ptr, (char *)addr, length))
747 strcpy(remcomOutBuffer, "OK");
748 else
749 strcpy(remcomOutBuffer, "E03");
750 flush_icache_range(addr, addr+length);
751 } else
752 strcpy(remcomOutBuffer, "E02");
753 break;
754
755
756 case 'k': /* kill the program, actually just continue */
757 case 'c': /* cAA..AA Continue; address AA..AA optional */
758 /* try to read optional parameter, pc unchanged if no parm */
759
760 ptr = &remcomInBuffer[1];
761 if (hexToInt(&ptr, &addr))
762 regs->nip = addr;
763
764/* Need to flush the instruction cache here, as we may have deposited a
765 * breakpoint, and the icache probably has no way of knowing that a data ref to
766 * some location may have changed something that is in the instruction cache.
767 */
768 kgdb_flush_cache_all();
769 mtmsr(msr);
770
771 kgdb_interruptible(1);
772 unlock_kernel();
773 kgdb_active = 0;
774 if (kdebug) {
775 printk("remcomInBuffer: %s\n", remcomInBuffer);
776 printk("remcomOutBuffer: %s\n", remcomOutBuffer);
777 }
778 return 1;
779
780 case 's':
781 kgdb_flush_cache_all();
782#if defined(CONFIG_40x) || defined(CONFIG_BOOKE)
783 mtspr(SPRN_DBCR0, mfspr(SPRN_DBCR0) | DBCR0_IC);
784 regs->msr |= MSR_DE;
785#else
786 regs->msr |= MSR_SE;
787#endif
788 unlock_kernel();
789 kgdb_active = 0;
790 if (kdebug) {
791 printk("remcomInBuffer: %s\n", remcomInBuffer);
792 printk("remcomOutBuffer: %s\n", remcomOutBuffer);
793 }
794 return 1;
795
796 case 'r': /* Reset (if user process..exit ???)*/
797 panic("kgdb reset.");
798 break;
799 } /* switch */
800 if (remcomOutBuffer[0] && kdebug) {
801 printk("remcomInBuffer: %s\n", remcomInBuffer);
802 printk("remcomOutBuffer: %s\n", remcomOutBuffer);
803 }
804 /* reply to the request */
805 putpacket(remcomOutBuffer);
806 } /* while(1) */
807}
808
809/* This function will generate a breakpoint exception. It is used at the
810 beginning of a program to sync up with a debugger and can be used
811 otherwise as a quick means to stop program execution and "break" into
812 the debugger. */
813
814void
815breakpoint(void)
816{
817 if (!initialized) {
818 printk("breakpoint() called b4 kgdb init\n");
819 return;
820 }
821
822 asm(" .globl breakinst \n\
823 breakinst: .long 0x7d821008");
824}
825
826#ifdef CONFIG_KGDB_CONSOLE
827/* Output string in GDB O-packet format if GDB has connected. If nothing
828 output, returns 0 (caller must then handle output). */
829int
830kgdb_output_string (const char* s, unsigned int count)
831{
832 char buffer[512];
833
834 if (!kgdb_started)
835 return 0;
836
837 count = (count <= (sizeof(buffer) / 2 - 2))
838 ? count : (sizeof(buffer) / 2 - 2);
839
840 buffer[0] = 'O';
841 mem2hex (s, &buffer[1], count);
842 putpacket(buffer);
843
844 return 1;
845}
846#endif
847
848static void sysrq_handle_gdb(int key, struct pt_regs *pt_regs,
849 struct tty_struct *tty)
850{
851 printk("Entering GDB stub\n");
852 breakpoint();
853}
854static struct sysrq_key_op sysrq_gdb_op = {
855 .handler = sysrq_handle_gdb,
856 .help_msg = "Gdb",
857 .action_msg = "GDB",
858};
859
860static int gdb_register_sysrq(void)
861{
862 printk("Registering GDB sysrq handler\n");
863 register_sysrq_key('g', &sysrq_gdb_op);
864 return 0;
865}
866module_init(gdb_register_sysrq);
diff --git a/arch/ppc/kernel/ppc_htab.c b/arch/ppc/kernel/ppc_htab.c
deleted file mode 100644
index 9ed36dd9cbff..000000000000
--- a/arch/ppc/kernel/ppc_htab.c
+++ /dev/null
@@ -1,464 +0,0 @@
1/*
2 * PowerPC hash table management proc entry. Will show information
3 * about the current hash table and will allow changes to it.
4 *
5 * Written by Cort Dougan (cort@cs.nmt.edu)
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version
10 * 2 of the License, or (at your option) any later version.
11 */
12
13#include <linux/errno.h>
14#include <linux/sched.h>
15#include <linux/proc_fs.h>
16#include <linux/stat.h>
17#include <linux/sysctl.h>
18#include <linux/capability.h>
19#include <linux/ctype.h>
20#include <linux/threads.h>
21#include <linux/seq_file.h>
22#include <linux/init.h>
23#include <linux/bitops.h>
24
25#include <asm/uaccess.h>
26#include <asm/mmu.h>
27#include <asm/residual.h>
28#include <asm/io.h>
29#include <asm/pgtable.h>
30#include <asm/cputable.h>
31#include <asm/system.h>
32#include <asm/reg.h>
33
34static int ppc_htab_show(struct seq_file *m, void *v);
35static ssize_t ppc_htab_write(struct file * file, const char __user * buffer,
36 size_t count, loff_t *ppos);
37extern PTE *Hash, *Hash_end;
38extern unsigned long Hash_size, Hash_mask;
39extern unsigned long _SDR1;
40extern unsigned long htab_reloads;
41extern unsigned long htab_preloads;
42extern unsigned long htab_evicts;
43extern unsigned long pte_misses;
44extern unsigned long pte_errors;
45extern unsigned int primary_pteg_full;
46extern unsigned int htab_hash_searches;
47
48static int ppc_htab_open(struct inode *inode, struct file *file)
49{
50 return single_open(file, ppc_htab_show, NULL);
51}
52
53const struct file_operations ppc_htab_operations = {
54 .open = ppc_htab_open,
55 .read = seq_read,
56 .llseek = seq_lseek,
57 .write = ppc_htab_write,
58 .release = single_release,
59};
60
61static char *pmc1_lookup(unsigned long mmcr0)
62{
63 switch ( mmcr0 & (0x7f<<7) )
64 {
65 case 0x0:
66 return "none";
67 case MMCR0_PMC1_CYCLES:
68 return "cycles";
69 case MMCR0_PMC1_ICACHEMISS:
70 return "ic miss";
71 case MMCR0_PMC1_DTLB:
72 return "dtlb miss";
73 default:
74 return "unknown";
75 }
76}
77
78static char *pmc2_lookup(unsigned long mmcr0)
79{
80 switch ( mmcr0 & 0x3f )
81 {
82 case 0x0:
83 return "none";
84 case MMCR0_PMC2_CYCLES:
85 return "cycles";
86 case MMCR0_PMC2_DCACHEMISS:
87 return "dc miss";
88 case MMCR0_PMC2_ITLB:
89 return "itlb miss";
90 case MMCR0_PMC2_LOADMISSTIME:
91 return "load miss time";
92 default:
93 return "unknown";
94 }
95}
96
97/*
98 * print some useful info about the hash table. This function
99 * is _REALLY_ slow (see the nested for loops below) but nothing
100 * in here should be really timing critical. -- Cort
101 */
102static int ppc_htab_show(struct seq_file *m, void *v)
103{
104 unsigned long mmcr0 = 0, pmc1 = 0, pmc2 = 0;
105#if defined(CONFIG_PPC_STD_MMU)
106 unsigned int kptes = 0, uptes = 0;
107 PTE *ptr;
108#endif /* CONFIG_PPC_STD_MMU */
109
110 if (cpu_has_feature(CPU_FTR_604_PERF_MON)) {
111 mmcr0 = mfspr(SPRN_MMCR0);
112 pmc1 = mfspr(SPRN_PMC1);
113 pmc2 = mfspr(SPRN_PMC2);
114 seq_printf(m,
115 "604 Performance Monitoring\n"
116 "MMCR0\t\t: %08lx %s%s ",
117 mmcr0,
118 ( mmcr0>>28 & 0x2 ) ? "(user mode counted)" : "",
119 ( mmcr0>>28 & 0x4 ) ? "(kernel mode counted)" : "");
120 seq_printf(m,
121 "\nPMC1\t\t: %08lx (%s)\n"
122 "PMC2\t\t: %08lx (%s)\n",
123 pmc1, pmc1_lookup(mmcr0),
124 pmc2, pmc2_lookup(mmcr0));
125 }
126
127#ifdef CONFIG_PPC_STD_MMU
128 /* if we don't have a htab */
129 if ( Hash_size == 0 ) {
130 seq_printf(m, "No Hash Table used\n");
131 return 0;
132 }
133
134 for (ptr = Hash; ptr < Hash_end; ptr++) {
135 unsigned int mctx, vsid;
136
137 if (!ptr->v)
138 continue;
139 /* undo the esid skew */
140 vsid = ptr->vsid;
141 mctx = ((vsid - (vsid & 0xf) * 0x111) >> 4) & 0xfffff;
142 if (mctx == 0)
143 kptes++;
144 else
145 uptes++;
146 }
147
148 seq_printf(m,
149 "PTE Hash Table Information\n"
150 "Size\t\t: %luKb\n"
151 "Buckets\t\t: %lu\n"
152 "Address\t\t: %08lx\n"
153 "Entries\t\t: %lu\n"
154 "User ptes\t: %u\n"
155 "Kernel ptes\t: %u\n"
156 "Percent full\t: %lu%%\n"
157 , (unsigned long)(Hash_size>>10),
158 (Hash_size/(sizeof(PTE)*8)),
159 (unsigned long)Hash,
160 Hash_size/sizeof(PTE)
161 , uptes,
162 kptes,
163 ((kptes+uptes)*100) / (Hash_size/sizeof(PTE))
164 );
165
166 seq_printf(m,
167 "Reloads\t\t: %lu\n"
168 "Preloads\t: %lu\n"
169 "Searches\t: %u\n"
170 "Overflows\t: %u\n"
171 "Evicts\t\t: %lu\n",
172 htab_reloads, htab_preloads, htab_hash_searches,
173 primary_pteg_full, htab_evicts);
174#endif /* CONFIG_PPC_STD_MMU */
175
176 seq_printf(m,
177 "Non-error misses: %lu\n"
178 "Error misses\t: %lu\n",
179 pte_misses, pte_errors);
180 return 0;
181}
182
183/*
184 * Allow user to define performance counters and resize the hash table
185 */
186static ssize_t ppc_htab_write(struct file * file, const char __user * ubuffer,
187 size_t count, loff_t *ppos)
188{
189#ifdef CONFIG_PPC_STD_MMU
190 unsigned long tmp;
191 char buffer[16];
192
193 if (!capable(CAP_SYS_ADMIN))
194 return -EACCES;
195 if (strncpy_from_user(buffer, ubuffer, 15))
196 return -EFAULT;
197 buffer[15] = 0;
198
199 /* don't set the htab size for now */
200 if ( !strncmp( buffer, "size ", 5) )
201 return -EBUSY;
202
203 if ( !strncmp( buffer, "reset", 5) )
204 {
205 if (cpu_has_feature(CPU_FTR_604_PERF_MON)) {
206 /* reset PMC1 and PMC2 */
207 mtspr(SPRN_PMC1, 0);
208 mtspr(SPRN_PMC2, 0);
209 }
210 htab_reloads = 0;
211 htab_evicts = 0;
212 pte_misses = 0;
213 pte_errors = 0;
214 }
215
216 /* Everything below here requires the performance monitor feature. */
217 if (!cpu_has_feature(CPU_FTR_604_PERF_MON))
218 return count;
219
220 /* turn off performance monitoring */
221 if ( !strncmp( buffer, "off", 3) )
222 {
223 mtspr(SPRN_MMCR0, 0);
224 mtspr(SPRN_PMC1, 0);
225 mtspr(SPRN_PMC2, 0);
226 }
227
228 if ( !strncmp( buffer, "user", 4) )
229 {
230 /* setup mmcr0 and clear the correct pmc */
231 tmp = (mfspr(SPRN_MMCR0) & ~(0x60000000)) | 0x20000000;
232 mtspr(SPRN_MMCR0, tmp);
233 mtspr(SPRN_PMC1, 0);
234 mtspr(SPRN_PMC2, 0);
235 }
236
237 if ( !strncmp( buffer, "kernel", 6) )
238 {
239 /* setup mmcr0 and clear the correct pmc */
240 tmp = (mfspr(SPRN_MMCR0) & ~(0x60000000)) | 0x40000000;
241 mtspr(SPRN_MMCR0, tmp);
242 mtspr(SPRN_PMC1, 0);
243 mtspr(SPRN_PMC2, 0);
244 }
245
246 /* PMC1 values */
247 if ( !strncmp( buffer, "dtlb", 4) )
248 {
249 /* setup mmcr0 and clear the correct pmc */
250 tmp = (mfspr(SPRN_MMCR0) & ~(0x7F << 7)) | MMCR0_PMC1_DTLB;
251 mtspr(SPRN_MMCR0, tmp);
252 mtspr(SPRN_PMC1, 0);
253 }
254
255 if ( !strncmp( buffer, "ic miss", 7) )
256 {
257 /* setup mmcr0 and clear the correct pmc */
258 tmp = (mfspr(SPRN_MMCR0) & ~(0x7F<<7)) | MMCR0_PMC1_ICACHEMISS;
259 mtspr(SPRN_MMCR0, tmp);
260 mtspr(SPRN_PMC1, 0);
261 }
262
263 /* PMC2 values */
264 if ( !strncmp( buffer, "load miss time", 14) )
265 {
266 /* setup mmcr0 and clear the correct pmc */
267 asm volatile(
268 "mfspr %0,%1\n\t" /* get current mccr0 */
269 "rlwinm %0,%0,0,0,31-6\n\t" /* clear bits [26-31] */
270 "ori %0,%0,%2 \n\t" /* or in mmcr0 settings */
271 "mtspr %1,%0 \n\t" /* set new mccr0 */
272 "mtspr %3,%4 \n\t" /* reset the pmc */
273 : "=r" (tmp)
274 : "i" (SPRN_MMCR0),
275 "i" (MMCR0_PMC2_LOADMISSTIME),
276 "i" (SPRN_PMC2), "r" (0) );
277 }
278
279 if ( !strncmp( buffer, "itlb", 4) )
280 {
281 /* setup mmcr0 and clear the correct pmc */
282 asm volatile(
283 "mfspr %0,%1\n\t" /* get current mccr0 */
284 "rlwinm %0,%0,0,0,31-6\n\t" /* clear bits [26-31] */
285 "ori %0,%0,%2 \n\t" /* or in mmcr0 settings */
286 "mtspr %1,%0 \n\t" /* set new mccr0 */
287 "mtspr %3,%4 \n\t" /* reset the pmc */
288 : "=r" (tmp)
289 : "i" (SPRN_MMCR0), "i" (MMCR0_PMC2_ITLB),
290 "i" (SPRN_PMC2), "r" (0) );
291 }
292
293 if ( !strncmp( buffer, "dc miss", 7) )
294 {
295 /* setup mmcr0 and clear the correct pmc */
296 asm volatile(
297 "mfspr %0,%1\n\t" /* get current mccr0 */
298 "rlwinm %0,%0,0,0,31-6\n\t" /* clear bits [26-31] */
299 "ori %0,%0,%2 \n\t" /* or in mmcr0 settings */
300 "mtspr %1,%0 \n\t" /* set new mccr0 */
301 "mtspr %3,%4 \n\t" /* reset the pmc */
302 : "=r" (tmp)
303 : "i" (SPRN_MMCR0), "i" (MMCR0_PMC2_DCACHEMISS),
304 "i" (SPRN_PMC2), "r" (0) );
305 }
306
307 return count;
308#else /* CONFIG_PPC_STD_MMU */
309 return 0;
310#endif /* CONFIG_PPC_STD_MMU */
311}
312
313int proc_dol2crvec(ctl_table *table, int write, struct file *filp,
314 void __user *buffer_arg, size_t *lenp, loff_t *ppos)
315{
316 int vleft, first=1, len, left, val;
317 char __user *buffer = (char __user *) buffer_arg;
318 #define TMPBUFLEN 256
319 char buf[TMPBUFLEN], *p;
320 static const char *sizestrings[4] = {
321 "2MB", "256KB", "512KB", "1MB"
322 };
323 static const char *clockstrings[8] = {
324 "clock disabled", "+1 clock", "+1.5 clock", "reserved(3)",
325 "+2 clock", "+2.5 clock", "+3 clock", "reserved(7)"
326 };
327 static const char *typestrings[4] = {
328 "flow-through burst SRAM", "reserved SRAM",
329 "pipelined burst SRAM", "pipelined late-write SRAM"
330 };
331 static const char *holdstrings[4] = {
332 "0.5", "1.0", "(reserved2)", "(reserved3)"
333 };
334
335 if (!cpu_has_feature(CPU_FTR_L2CR))
336 return -EFAULT;
337
338 if ( /*!table->maxlen ||*/ (*ppos && !write)) {
339 *lenp = 0;
340 return 0;
341 }
342
343 vleft = table->maxlen / sizeof(int);
344 left = *lenp;
345
346 for (; left /*&& vleft--*/; first=0) {
347 if (write) {
348 while (left) {
349 char c;
350 if(get_user(c, buffer))
351 return -EFAULT;
352 if (!isspace(c))
353 break;
354 left--;
355 buffer++;
356 }
357 if (!left)
358 break;
359 len = left;
360 if (len > TMPBUFLEN-1)
361 len = TMPBUFLEN-1;
362 if(copy_from_user(buf, buffer, len))
363 return -EFAULT;
364 buf[len] = 0;
365 p = buf;
366 if (*p < '0' || *p > '9')
367 break;
368 val = simple_strtoul(p, &p, 0);
369 len = p-buf;
370 if ((len < left) && *p && !isspace(*p))
371 break;
372 buffer += len;
373 left -= len;
374 _set_L2CR(val);
375 } else {
376 p = buf;
377 if (!first)
378 *p++ = '\t';
379 val = _get_L2CR();
380 p += sprintf(p, "0x%08x: ", val);
381 p += sprintf(p, " %s", (val >> 31) & 1 ? "enabled" :
382 "disabled");
383 p += sprintf(p, ", %sparity", (val>>30)&1 ? "" : "no ");
384 p += sprintf(p, ", %s", sizestrings[(val >> 28) & 3]);
385 p += sprintf(p, ", %s", clockstrings[(val >> 25) & 7]);
386 p += sprintf(p, ", %s", typestrings[(val >> 23) & 2]);
387 p += sprintf(p, "%s", (val>>22)&1 ? ", data only" : "");
388 p += sprintf(p, "%s", (val>>20)&1 ? ", ZZ enabled": "");
389 p += sprintf(p, ", %s", (val>>19)&1 ? "write-through" :
390 "copy-back");
391 p += sprintf(p, "%s", (val>>18)&1 ? ", testing" : "");
392 p += sprintf(p, ", %sns hold",holdstrings[(val>>16)&3]);
393 p += sprintf(p, "%s", (val>>15)&1 ? ", DLL slow" : "");
394 p += sprintf(p, "%s", (val>>14)&1 ? ", diff clock" :"");
395 p += sprintf(p, "%s", (val>>13)&1 ? ", DLL bypass" :"");
396
397 p += sprintf(p,"\n");
398
399 len = strlen(buf);
400 if (len > left)
401 len = left;
402 if (copy_to_user(buffer, buf, len))
403 return -EFAULT;
404 left -= len;
405 buffer += len;
406 break;
407 }
408 }
409
410 if (!write && !first && left) {
411 if(put_user('\n', (char __user *) buffer))
412 return -EFAULT;
413 left--, buffer++;
414 }
415 if (write) {
416 char __user *s = (char __user *) buffer;
417 while (left) {
418 char c;
419 if(get_user(c, s++))
420 return -EFAULT;
421 if (!isspace(c))
422 break;
423 left--;
424 }
425 }
426 if (write && first)
427 return -EINVAL;
428 *lenp -= left;
429 *ppos += *lenp;
430 return 0;
431}
432
433#ifdef CONFIG_SYSCTL
434/*
435 * Register our sysctl.
436 */
437static ctl_table htab_ctl_table[]={
438 {
439 .procname = "l2cr",
440 .mode = 0644,
441 .proc_handler = &proc_dol2crvec,
442 },
443 {}
444};
445static ctl_table htab_sysctl_root[] = {
446 {
447 .ctl_name = CTL_KERN,
448 .procname = "kernel",
449 .mode = 0555,
450 .child = htab_ctl_table,
451 },
452 {}
453};
454
455static int __init
456register_ppc_htab_sysctl(void)
457{
458 register_sysctl_table(htab_sysctl_root);
459
460 return 0;
461}
462
463__initcall(register_ppc_htab_sysctl);
464#endif
diff --git a/arch/ppc/kernel/ppc_ksyms.c b/arch/ppc/kernel/ppc_ksyms.c
deleted file mode 100644
index 5d529bcbeee9..000000000000
--- a/arch/ppc/kernel/ppc_ksyms.c
+++ /dev/null
@@ -1,258 +0,0 @@
1#include <linux/module.h>
2#include <linux/threads.h>
3#include <linux/smp.h>
4#include <linux/sched.h>
5#include <linux/elfcore.h>
6#include <linux/string.h>
7#include <linux/interrupt.h>
8#include <linux/screen_info.h>
9#include <linux/vt_kern.h>
10#include <linux/nvram.h>
11#include <linux/console.h>
12#include <linux/irq.h>
13#include <linux/pci.h>
14#include <linux/delay.h>
15#include <linux/pm.h>
16#include <linux/bitops.h>
17
18#include <asm/page.h>
19#include <asm/processor.h>
20#include <asm/uaccess.h>
21#include <asm/io.h>
22#include <asm/ide.h>
23#include <asm/atomic.h>
24#include <asm/checksum.h>
25#include <asm/pgtable.h>
26#include <asm/tlbflush.h>
27#include <asm/cacheflush.h>
28#include <linux/adb.h>
29#include <linux/cuda.h>
30#include <linux/pmu.h>
31#include <asm/system.h>
32#include <asm/pci-bridge.h>
33#include <asm/irq.h>
34#include <asm/dma.h>
35#include <asm/machdep.h>
36#include <asm/hw_irq.h>
37#include <asm/nvram.h>
38#include <asm/mmu_context.h>
39#include <asm/backlight.h>
40#include <asm/time.h>
41#include <asm/cputable.h>
42#include <asm/btext.h>
43#include <asm/xmon.h>
44#include <asm/signal.h>
45#include <asm/dcr.h>
46
47#ifdef CONFIG_8xx
48#include <asm/cpm1.h>
49#endif
50
51extern void transfer_to_handler(void);
52extern void do_IRQ(struct pt_regs *regs);
53extern void machine_check_exception(struct pt_regs *regs);
54extern void alignment_exception(struct pt_regs *regs);
55extern void program_check_exception(struct pt_regs *regs);
56extern void single_step_exception(struct pt_regs *regs);
57extern int sys_sigreturn(struct pt_regs *regs);
58
59long long __ashrdi3(long long, int);
60long long __ashldi3(long long, int);
61long long __lshrdi3(long long, int);
62
63EXPORT_SYMBOL(empty_zero_page);
64EXPORT_SYMBOL(clear_pages);
65EXPORT_SYMBOL(clear_user_page);
66EXPORT_SYMBOL(copy_page);
67EXPORT_SYMBOL(transfer_to_handler);
68EXPORT_SYMBOL(do_IRQ);
69EXPORT_SYMBOL(machine_check_exception);
70EXPORT_SYMBOL(alignment_exception);
71EXPORT_SYMBOL(program_check_exception);
72EXPORT_SYMBOL(single_step_exception);
73EXPORT_SYMBOL(sys_sigreturn);
74EXPORT_SYMBOL(ppc_n_lost_interrupts);
75
76EXPORT_SYMBOL(ISA_DMA_THRESHOLD);
77EXPORT_SYMBOL(DMA_MODE_READ);
78EXPORT_SYMBOL(DMA_MODE_WRITE);
79
80#if !defined(__INLINE_BITOPS)
81EXPORT_SYMBOL(set_bit);
82EXPORT_SYMBOL(clear_bit);
83EXPORT_SYMBOL(change_bit);
84EXPORT_SYMBOL(test_and_set_bit);
85EXPORT_SYMBOL(test_and_clear_bit);
86EXPORT_SYMBOL(test_and_change_bit);
87#endif /* __INLINE_BITOPS */
88
89EXPORT_SYMBOL(strcpy);
90EXPORT_SYMBOL(strncpy);
91EXPORT_SYMBOL(strcat);
92EXPORT_SYMBOL(strlen);
93EXPORT_SYMBOL(strcmp);
94EXPORT_SYMBOL(strncmp);
95
96EXPORT_SYMBOL(csum_partial);
97EXPORT_SYMBOL(csum_partial_copy_generic);
98EXPORT_SYMBOL(ip_fast_csum);
99EXPORT_SYMBOL(csum_tcpudp_magic);
100
101EXPORT_SYMBOL(__copy_tofrom_user);
102EXPORT_SYMBOL(__clear_user);
103EXPORT_SYMBOL(__strncpy_from_user);
104EXPORT_SYMBOL(__strnlen_user);
105
106/*
107EXPORT_SYMBOL(inb);
108EXPORT_SYMBOL(inw);
109EXPORT_SYMBOL(inl);
110EXPORT_SYMBOL(outb);
111EXPORT_SYMBOL(outw);
112EXPORT_SYMBOL(outl);
113EXPORT_SYMBOL(outsl);*/
114
115EXPORT_SYMBOL(_insb);
116EXPORT_SYMBOL(_outsb);
117EXPORT_SYMBOL(_insw_ns);
118EXPORT_SYMBOL(_outsw_ns);
119EXPORT_SYMBOL(_insl_ns);
120EXPORT_SYMBOL(_outsl_ns);
121EXPORT_SYMBOL(iopa);
122EXPORT_SYMBOL(ioremap);
123#ifdef CONFIG_44x
124EXPORT_SYMBOL(ioremap64);
125#endif
126EXPORT_SYMBOL(__ioremap);
127EXPORT_SYMBOL(iounmap);
128EXPORT_SYMBOL(ioremap_bot); /* aka VMALLOC_END */
129
130#ifdef CONFIG_PCI
131EXPORT_SYMBOL(isa_io_base);
132EXPORT_SYMBOL(isa_mem_base);
133EXPORT_SYMBOL(pci_dram_offset);
134EXPORT_SYMBOL(pci_alloc_consistent);
135EXPORT_SYMBOL(pci_free_consistent);
136EXPORT_SYMBOL(pci_bus_io_base);
137EXPORT_SYMBOL(pci_bus_io_base_phys);
138EXPORT_SYMBOL(pci_bus_mem_base_phys);
139EXPORT_SYMBOL(pci_bus_to_hose);
140EXPORT_SYMBOL(pci_resource_to_bus);
141EXPORT_SYMBOL(pci_phys_to_bus);
142EXPORT_SYMBOL(pci_bus_to_phys);
143#endif /* CONFIG_PCI */
144
145#ifdef CONFIG_NOT_COHERENT_CACHE
146extern void flush_dcache_all(void);
147EXPORT_SYMBOL(flush_dcache_all);
148#endif
149
150EXPORT_SYMBOL(start_thread);
151EXPORT_SYMBOL(kernel_thread);
152
153EXPORT_SYMBOL(flush_instruction_cache);
154EXPORT_SYMBOL(giveup_fpu);
155EXPORT_SYMBOL(__flush_icache_range);
156EXPORT_SYMBOL(flush_dcache_range);
157EXPORT_SYMBOL(flush_icache_user_range);
158EXPORT_SYMBOL(flush_dcache_page);
159EXPORT_SYMBOL(flush_tlb_kernel_range);
160EXPORT_SYMBOL(flush_tlb_page);
161EXPORT_SYMBOL(_tlbie);
162#ifdef CONFIG_ALTIVEC
163#ifndef CONFIG_SMP
164EXPORT_SYMBOL(last_task_used_altivec);
165#endif
166EXPORT_SYMBOL(giveup_altivec);
167#endif /* CONFIG_ALTIVEC */
168#ifdef CONFIG_SMP
169EXPORT_SYMBOL(smp_call_function);
170EXPORT_SYMBOL(smp_hw_index);
171#endif
172
173EXPORT_SYMBOL(ppc_md);
174
175#ifdef CONFIG_ADB
176EXPORT_SYMBOL(adb_request);
177EXPORT_SYMBOL(adb_register);
178EXPORT_SYMBOL(adb_unregister);
179EXPORT_SYMBOL(adb_poll);
180EXPORT_SYMBOL(adb_try_handler_change);
181#endif /* CONFIG_ADB */
182#ifdef CONFIG_ADB_CUDA
183EXPORT_SYMBOL(cuda_request);
184EXPORT_SYMBOL(cuda_poll);
185#endif /* CONFIG_ADB_CUDA */
186#if defined(CONFIG_BOOTX_TEXT)
187EXPORT_SYMBOL(btext_update_display);
188#endif
189EXPORT_SYMBOL(to_tm);
190
191EXPORT_SYMBOL(pm_power_off);
192
193EXPORT_SYMBOL(__ashrdi3);
194EXPORT_SYMBOL(__ashldi3);
195EXPORT_SYMBOL(__lshrdi3);
196EXPORT_SYMBOL(memcpy);
197EXPORT_SYMBOL(cacheable_memcpy);
198EXPORT_SYMBOL(memset);
199EXPORT_SYMBOL(memmove);
200EXPORT_SYMBOL(memcmp);
201EXPORT_SYMBOL(memchr);
202
203#if defined(CONFIG_FB_VGA16_MODULE)
204EXPORT_SYMBOL(screen_info);
205#endif
206
207EXPORT_SYMBOL(__delay);
208EXPORT_SYMBOL(timer_interrupt);
209EXPORT_SYMBOL(irq_desc);
210EXPORT_SYMBOL(tb_ticks_per_jiffy);
211EXPORT_SYMBOL(console_drivers);
212#ifdef CONFIG_XMON
213EXPORT_SYMBOL(xmon);
214EXPORT_SYMBOL(xmon_printf);
215#endif
216
217#if defined(CONFIG_KGDB) || defined(CONFIG_XMON)
218extern void (*debugger)(struct pt_regs *regs);
219extern int (*debugger_bpt)(struct pt_regs *regs);
220extern int (*debugger_sstep)(struct pt_regs *regs);
221extern int (*debugger_iabr_match)(struct pt_regs *regs);
222extern int (*debugger_dabr_match)(struct pt_regs *regs);
223extern void (*debugger_fault_handler)(struct pt_regs *regs);
224
225EXPORT_SYMBOL(debugger);
226EXPORT_SYMBOL(debugger_bpt);
227EXPORT_SYMBOL(debugger_sstep);
228EXPORT_SYMBOL(debugger_iabr_match);
229EXPORT_SYMBOL(debugger_dabr_match);
230EXPORT_SYMBOL(debugger_fault_handler);
231#endif
232
233#ifdef CONFIG_8xx
234EXPORT_SYMBOL(cpm_install_handler);
235EXPORT_SYMBOL(cpm_free_handler);
236#endif /* CONFIG_8xx */
237#if defined(CONFIG_8xx) || defined(CONFIG_40x)
238EXPORT_SYMBOL(__res);
239#endif
240
241EXPORT_SYMBOL(next_mmu_context);
242EXPORT_SYMBOL(set_context);
243EXPORT_SYMBOL(disarm_decr);
244#ifdef CONFIG_PPC_STD_MMU
245extern long mol_trampoline;
246EXPORT_SYMBOL(mol_trampoline); /* For MOL */
247EXPORT_SYMBOL(flush_hash_pages); /* For MOL */
248#ifdef CONFIG_SMP
249extern int mmu_hash_lock;
250EXPORT_SYMBOL(mmu_hash_lock); /* For MOL */
251#endif /* CONFIG_SMP */
252extern long *intercept_table;
253EXPORT_SYMBOL(intercept_table);
254#endif /* CONFIG_PPC_STD_MMU */
255#ifdef CONFIG_PPC_DCR_NATIVE
256EXPORT_SYMBOL(__mtdcr);
257EXPORT_SYMBOL(__mfdcr);
258#endif
diff --git a/arch/ppc/kernel/relocate_kernel.S b/arch/ppc/kernel/relocate_kernel.S
deleted file mode 100644
index 9b2ad48e988c..000000000000
--- a/arch/ppc/kernel/relocate_kernel.S
+++ /dev/null
@@ -1,123 +0,0 @@
1/*
2 * relocate_kernel.S - put the kernel image in place to boot
3 * Copyright (C) 2002-2003 Eric Biederman <ebiederm@xmission.com>
4 *
5 * GameCube/ppc32 port Copyright (C) 2004 Albert Herranz
6 *
7 * This source code is licensed under the GNU General Public License,
8 * Version 2. See the file COPYING for more details.
9 */
10
11#include <asm/reg.h>
12#include <asm/ppc_asm.h>
13#include <asm/processor.h>
14
15#include <asm/kexec.h>
16
17#define PAGE_SIZE 4096 /* must be same value as in <asm/page.h> */
18
19 /*
20 * Must be relocatable PIC code callable as a C function.
21 */
22 .globl relocate_new_kernel
23relocate_new_kernel:
24 /* r3 = page_list */
25 /* r4 = reboot_code_buffer */
26 /* r5 = start_address */
27
28 li r0, 0
29
30 /*
31 * Set Machine Status Register to a known status,
32 * switch the MMU off and jump to 1: in a single step.
33 */
34
35 mr r8, r0
36 ori r8, r8, MSR_RI|MSR_ME
37 mtspr SPRN_SRR1, r8
38 addi r8, r4, 1f - relocate_new_kernel
39 mtspr SPRN_SRR0, r8
40 sync
41 rfi
42
431:
44 /* from this point address translation is turned off */
45 /* and interrupts are disabled */
46
47 /* set a new stack at the bottom of our page... */
48 /* (not really needed now) */
49 addi r1, r4, KEXEC_CONTROL_CODE_SIZE - 8 /* for LR Save+Back Chain */
50 stw r0, 0(r1)
51
52 /* Do the copies */
53 li r6, 0 /* checksum */
54 mr r0, r3
55 b 1f
56
570: /* top, read another word for the indirection page */
58 lwzu r0, 4(r3)
59
601:
61 /* is it a destination page? (r8) */
62 rlwinm. r7, r0, 0, 31, 31 /* IND_DESTINATION (1<<0) */
63 beq 2f
64
65 rlwinm r8, r0, 0, 0, 19 /* clear kexec flags, page align */
66 b 0b
67
682: /* is it an indirection page? (r3) */
69 rlwinm. r7, r0, 0, 30, 30 /* IND_INDIRECTION (1<<1) */
70 beq 2f
71
72 rlwinm r3, r0, 0, 0, 19 /* clear kexec flags, page align */
73 subi r3, r3, 4
74 b 0b
75
762: /* are we done? */
77 rlwinm. r7, r0, 0, 29, 29 /* IND_DONE (1<<2) */
78 beq 2f
79 b 3f
80
812: /* is it a source page? (r9) */
82 rlwinm. r7, r0, 0, 28, 28 /* IND_SOURCE (1<<3) */
83 beq 0b
84
85 rlwinm r9, r0, 0, 0, 19 /* clear kexec flags, page align */
86
87 li r7, PAGE_SIZE / 4
88 mtctr r7
89 subi r9, r9, 4
90 subi r8, r8, 4
919:
92 lwzu r0, 4(r9) /* do the copy */
93 xor r6, r6, r0
94 stwu r0, 4(r8)
95 dcbst 0, r8
96 sync
97 icbi 0, r8
98 bdnz 9b
99
100 addi r9, r9, 4
101 addi r8, r8, 4
102 b 0b
103
1043:
105
106 /* To be certain of avoiding problems with self-modifying code
107 * execute a serializing instruction here.
108 */
109 isync
110 sync
111
112 /* jump to the entry point, usually the setup routine */
113 mtlr r5
114 blrl
115
1161: b 1b
117
118relocate_new_kernel_end:
119
120 .globl relocate_new_kernel_size
121relocate_new_kernel_size:
122 .long relocate_new_kernel_end - relocate_new_kernel
123
diff --git a/arch/ppc/kernel/setup.c b/arch/ppc/kernel/setup.c
deleted file mode 100644
index 51e8094f52d6..000000000000
--- a/arch/ppc/kernel/setup.c
+++ /dev/null
@@ -1,572 +0,0 @@
1/*
2 * Common prep boot and setup code.
3 */
4
5#include <linux/module.h>
6#include <linux/string.h>
7#include <linux/sched.h>
8#include <linux/init.h>
9#include <linux/kernel.h>
10#include <linux/reboot.h>
11#include <linux/delay.h>
12#include <linux/initrd.h>
13#include <linux/screen_info.h>
14#include <linux/bootmem.h>
15#include <linux/seq_file.h>
16#include <linux/root_dev.h>
17#include <linux/cpu.h>
18#include <linux/console.h>
19
20#include <asm/residual.h>
21#include <asm/io.h>
22#include <asm/prom.h>
23#include <asm/processor.h>
24#include <asm/pgtable.h>
25#include <asm/bootinfo.h>
26#include <asm/setup.h>
27#include <asm/smp.h>
28#include <asm/elf.h>
29#include <asm/cputable.h>
30#include <asm/bootx.h>
31#include <asm/btext.h>
32#include <asm/machdep.h>
33#include <asm/uaccess.h>
34#include <asm/system.h>
35#include <asm/sections.h>
36#include <asm/nvram.h>
37#include <asm/xmon.h>
38#include <asm/ocp.h>
39#include <asm/irq.h>
40
41#define USES_PPC_SYS (defined(CONFIG_MPC10X_BRIDGE) || defined(CONFIG_8260) || \
42 defined(CONFIG_PPC_MPC52xx))
43
44#if USES_PPC_SYS
45#include <asm/ppc_sys.h>
46#endif
47
48#if defined CONFIG_KGDB
49#include <asm/kgdb.h>
50#endif
51
52extern void platform_init(unsigned long r3, unsigned long r4,
53 unsigned long r5, unsigned long r6, unsigned long r7);
54extern void reloc_got2(unsigned long offset);
55
56extern void ppc6xx_idle(void);
57extern void power4_idle(void);
58
59extern boot_infos_t *boot_infos;
60
61/* Used with the BI_MEMSIZE bootinfo parameter to store the memory
62 size value reported by the boot loader. */
63unsigned long boot_mem_size;
64
65unsigned long ISA_DMA_THRESHOLD;
66unsigned int DMA_MODE_READ;
67unsigned int DMA_MODE_WRITE;
68
69#ifdef CONFIG_PPC_PREP
70extern void prep_init(unsigned long r3, unsigned long r4,
71 unsigned long r5, unsigned long r6, unsigned long r7);
72
73dev_t boot_dev;
74#endif /* CONFIG_PPC_PREP */
75
76int have_of;
77EXPORT_SYMBOL(have_of);
78
79#ifdef __DO_IRQ_CANON
80int ppc_do_canonicalize_irqs;
81EXPORT_SYMBOL(ppc_do_canonicalize_irqs);
82#endif
83
84#ifdef CONFIG_VGA_CONSOLE
85unsigned long vgacon_remap_base;
86#endif
87
88struct machdep_calls ppc_md;
89
90/*
91 * These are used in binfmt_elf.c to put aux entries on the stack
92 * for each elf executable being started.
93 */
94int dcache_bsize;
95int icache_bsize;
96int ucache_bsize;
97
98#if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_FB_VGA16) || \
99 defined(CONFIG_FB_VGA16_MODULE) || defined(CONFIG_FB_VESA)
100struct screen_info screen_info = {
101 0, 25, /* orig-x, orig-y */
102 0, /* unused */
103 0, /* orig-video-page */
104 0, /* orig-video-mode */
105 80, /* orig-video-cols */
106 0,0,0, /* ega_ax, ega_bx, ega_cx */
107 25, /* orig-video-lines */
108 1, /* orig-video-isVGA */
109 16 /* orig-video-points */
110};
111#endif /* CONFIG_VGA_CONSOLE || CONFIG_FB_VGA16 || CONFIG_FB_VESA */
112
113void machine_restart(char *cmd)
114{
115#ifdef CONFIG_NVRAM
116 nvram_sync();
117#endif
118 ppc_md.restart(cmd);
119}
120
121static void ppc_generic_power_off(void)
122{
123 ppc_md.power_off();
124}
125
126void machine_halt(void)
127{
128#ifdef CONFIG_NVRAM
129 nvram_sync();
130#endif
131 ppc_md.halt();
132}
133
134void (*pm_power_off)(void) = ppc_generic_power_off;
135
136void machine_power_off(void)
137{
138#ifdef CONFIG_NVRAM
139 nvram_sync();
140#endif
141 if (pm_power_off)
142 pm_power_off();
143 ppc_generic_power_off();
144}
145
146#ifdef CONFIG_TAU
147extern u32 cpu_temp(unsigned long cpu);
148extern u32 cpu_temp_both(unsigned long cpu);
149#endif /* CONFIG_TAU */
150
151int show_cpuinfo(struct seq_file *m, void *v)
152{
153 int i = (int) v - 1;
154 int err = 0;
155 unsigned int pvr;
156 unsigned short maj, min;
157 unsigned long lpj;
158
159 if (i >= NR_CPUS) {
160 /* Show summary information */
161#ifdef CONFIG_SMP
162 unsigned long bogosum = 0;
163 for_each_online_cpu(i)
164 bogosum += cpu_data[i].loops_per_jiffy;
165 seq_printf(m, "total bogomips\t: %lu.%02lu\n",
166 bogosum/(500000/HZ), bogosum/(5000/HZ) % 100);
167#endif /* CONFIG_SMP */
168
169 if (ppc_md.show_cpuinfo != NULL)
170 err = ppc_md.show_cpuinfo(m);
171 return err;
172 }
173
174#ifdef CONFIG_SMP
175 if (!cpu_online(i))
176 return 0;
177 pvr = cpu_data[i].pvr;
178 lpj = cpu_data[i].loops_per_jiffy;
179#else
180 pvr = mfspr(SPRN_PVR);
181 lpj = loops_per_jiffy;
182#endif
183
184 seq_printf(m, "processor\t: %d\n", i);
185 seq_printf(m, "cpu\t\t: ");
186
187 if (cur_cpu_spec->pvr_mask)
188 seq_printf(m, "%s", cur_cpu_spec->cpu_name);
189 else
190 seq_printf(m, "unknown (%08x)", pvr);
191#ifdef CONFIG_ALTIVEC
192 if (cur_cpu_spec->cpu_features & CPU_FTR_ALTIVEC)
193 seq_printf(m, ", altivec supported");
194#endif
195 seq_printf(m, "\n");
196
197#ifdef CONFIG_TAU
198 if (cur_cpu_spec->cpu_features & CPU_FTR_TAU) {
199#ifdef CONFIG_TAU_AVERAGE
200 /* more straightforward, but potentially misleading */
201 seq_printf(m, "temperature \t: %u C (uncalibrated)\n",
202 cpu_temp(i));
203#else
204 /* show the actual temp sensor range */
205 u32 temp;
206 temp = cpu_temp_both(i);
207 seq_printf(m, "temperature \t: %u-%u C (uncalibrated)\n",
208 temp & 0xff, temp >> 16);
209#endif
210 }
211#endif /* CONFIG_TAU */
212
213 if (ppc_md.show_percpuinfo != NULL) {
214 err = ppc_md.show_percpuinfo(m, i);
215 if (err)
216 return err;
217 }
218
219 /* If we are a Freescale core do a simple check so
220 * we dont have to keep adding cases in the future */
221 if ((PVR_VER(pvr) & 0x8000) == 0x8000) {
222 maj = PVR_MAJ(pvr);
223 min = PVR_MIN(pvr);
224 } else {
225 switch (PVR_VER(pvr)) {
226 case 0x0020: /* 403 family */
227 maj = PVR_MAJ(pvr) + 1;
228 min = PVR_MIN(pvr);
229 break;
230 case 0x1008: /* 740P/750P ?? */
231 maj = ((pvr >> 8) & 0xFF) - 1;
232 min = pvr & 0xFF;
233 break;
234 default:
235 maj = (pvr >> 8) & 0xFF;
236 min = pvr & 0xFF;
237 break;
238 }
239 }
240
241 seq_printf(m, "revision\t: %hd.%hd (pvr %04x %04x)\n",
242 maj, min, PVR_VER(pvr), PVR_REV(pvr));
243
244 seq_printf(m, "bogomips\t: %lu.%02lu\n",
245 lpj / (500000/HZ), (lpj / (5000/HZ)) % 100);
246
247#if USES_PPC_SYS
248 if (cur_ppc_sys_spec->ppc_sys_name)
249 seq_printf(m, "chipset\t\t: %s\n",
250 cur_ppc_sys_spec->ppc_sys_name);
251#endif
252
253#ifdef CONFIG_SMP
254 seq_printf(m, "\n");
255#endif
256
257 return 0;
258}
259
260static void *c_start(struct seq_file *m, loff_t *pos)
261{
262 int i = *pos;
263
264 return i <= NR_CPUS? (void *) (i + 1): NULL;
265}
266
267static void *c_next(struct seq_file *m, void *v, loff_t *pos)
268{
269 ++*pos;
270 return c_start(m, pos);
271}
272
273static void c_stop(struct seq_file *m, void *v)
274{
275}
276
277const struct seq_operations cpuinfo_op = {
278 .start =c_start,
279 .next = c_next,
280 .stop = c_stop,
281 .show = show_cpuinfo,
282};
283
284/*
285 * We're called here very early in the boot. We determine the machine
286 * type and call the appropriate low-level setup functions.
287 * -- Cort <cort@fsmlabs.com>
288 *
289 * Note that the kernel may be running at an address which is different
290 * from the address that it was linked at, so we must use RELOC/PTRRELOC
291 * to access static data (including strings). -- paulus
292 */
293__init
294unsigned long
295early_init(int r3, int r4, int r5)
296{
297 unsigned long phys;
298 unsigned long offset = reloc_offset();
299 struct cpu_spec *spec;
300
301 /* Default */
302 phys = offset + KERNELBASE;
303
304 /* First zero the BSS -- use memset, some arches don't have
305 * caches on yet */
306 memset_io(PTRRELOC(&__bss_start), 0, _end - __bss_start);
307
308 /*
309 * Identify the CPU type and fix up code sections
310 * that depend on which cpu we have.
311 */
312#if defined(CONFIG_440EP) && defined(CONFIG_PPC_FPU)
313 /* We pass the virtual PVR here for 440EP as 440EP and 440GR have
314 * identical PVRs and there is no reliable way to check for the FPU
315 */
316 spec = identify_cpu(offset, (mfspr(SPRN_PVR) | 0x8));
317#else
318 spec = identify_cpu(offset, mfspr(SPRN_PVR));
319#endif
320 do_feature_fixups(spec->cpu_features,
321 PTRRELOC(&__start___ftr_fixup),
322 PTRRELOC(&__stop___ftr_fixup));
323
324 return phys;
325}
326
327#ifdef CONFIG_PPC_PREP
328/*
329 * The PPC_PREP version of platform_init...
330 */
331void __init
332platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
333 unsigned long r6, unsigned long r7)
334{
335#ifdef CONFIG_BOOTX_TEXT
336 if (boot_text_mapped) {
337 btext_clearscreen();
338 btext_welcome();
339 }
340#endif
341
342 parse_bootinfo(find_bootinfo());
343
344 prep_init(r3, r4, r5, r6, r7);
345}
346#endif /* CONFIG_PPC_PREP */
347
348struct bi_record *find_bootinfo(void)
349{
350 struct bi_record *rec;
351
352 rec = (struct bi_record *)_ALIGN((ulong)__bss_start+(1<<20)-1,(1<<20));
353 if ( rec->tag != BI_FIRST ) {
354 /*
355 * This 0x10000 offset is a terrible hack but it will go away when
356 * we have the bootloader handle all the relocation and
357 * prom calls -- Cort
358 */
359 rec = (struct bi_record *)_ALIGN((ulong)__bss_start+0x10000+(1<<20)-1,(1<<20));
360 if ( rec->tag != BI_FIRST )
361 return NULL;
362 }
363 return rec;
364}
365
366void parse_bootinfo(struct bi_record *rec)
367{
368 if (rec == NULL || rec->tag != BI_FIRST)
369 return;
370 while (rec->tag != BI_LAST) {
371 ulong *data = rec->data;
372 switch (rec->tag) {
373 case BI_CMD_LINE:
374 strlcpy(cmd_line, (void *)data, sizeof(cmd_line));
375 break;
376#ifdef CONFIG_BLK_DEV_INITRD
377 case BI_INITRD:
378 initrd_start = data[0] + KERNELBASE;
379 initrd_end = data[0] + data[1] + KERNELBASE;
380 break;
381#endif /* CONFIG_BLK_DEV_INITRD */
382 case BI_MEMSIZE:
383 boot_mem_size = data[0];
384 break;
385 }
386 rec = (struct bi_record *)((ulong)rec + rec->size);
387 }
388}
389
390/*
391 * Find out what kind of machine we're on and save any data we need
392 * from the early boot process (devtree is copied on pmac by prom_init()).
393 * This is called very early on the boot process, after a minimal
394 * MMU environment has been set up but before MMU_init is called.
395 */
396void __init
397machine_init(unsigned long r3, unsigned long r4, unsigned long r5,
398 unsigned long r6, unsigned long r7)
399{
400#ifdef CONFIG_CMDLINE
401 strlcpy(cmd_line, CONFIG_CMDLINE, sizeof(cmd_line));
402#endif /* CONFIG_CMDLINE */
403
404#ifdef CONFIG_6xx
405 ppc_md.power_save = ppc6xx_idle;
406#endif
407
408 platform_init(r3, r4, r5, r6, r7);
409
410 if (ppc_md.progress)
411 ppc_md.progress("id mach(): done", 0x200);
412}
413#ifdef CONFIG_BOOKE_WDT
414/* Checks wdt=x and wdt_period=xx command-line option */
415int __init early_parse_wdt(char *p)
416{
417 if (p && strncmp(p, "0", 1) != 0)
418 booke_wdt_enabled = 1;
419
420 return 0;
421}
422early_param("wdt", early_parse_wdt);
423
424int __init early_parse_wdt_period (char *p)
425{
426 if (p)
427 booke_wdt_period = simple_strtoul(p, NULL, 0);
428
429 return 0;
430}
431early_param("wdt_period", early_parse_wdt_period);
432#endif /* CONFIG_BOOKE_WDT */
433
434/* Checks "l2cr=xxxx" command-line option */
435int __init ppc_setup_l2cr(char *str)
436{
437 if (cpu_has_feature(CPU_FTR_L2CR)) {
438 unsigned long val = simple_strtoul(str, NULL, 0);
439 printk(KERN_INFO "l2cr set to %lx\n", val);
440 _set_L2CR(0); /* force invalidate by disable cache */
441 _set_L2CR(val); /* and enable it */
442 }
443 return 1;
444}
445__setup("l2cr=", ppc_setup_l2cr);
446
447#ifdef CONFIG_GENERIC_NVRAM
448
449/* Generic nvram hooks used by drivers/char/gen_nvram.c */
450unsigned char nvram_read_byte(int addr)
451{
452 if (ppc_md.nvram_read_val)
453 return ppc_md.nvram_read_val(addr);
454 return 0xff;
455}
456EXPORT_SYMBOL(nvram_read_byte);
457
458void nvram_write_byte(unsigned char val, int addr)
459{
460 if (ppc_md.nvram_write_val)
461 ppc_md.nvram_write_val(addr, val);
462}
463EXPORT_SYMBOL(nvram_write_byte);
464
465void nvram_sync(void)
466{
467 if (ppc_md.nvram_sync)
468 ppc_md.nvram_sync();
469}
470EXPORT_SYMBOL(nvram_sync);
471
472#endif /* CONFIG_NVRAM */
473
474static struct cpu cpu_devices[NR_CPUS];
475
476int __init ppc_init(void)
477{
478 int i;
479
480 /* clear the progress line */
481 if ( ppc_md.progress ) ppc_md.progress(" ", 0xffff);
482
483 /* register CPU devices */
484 for_each_possible_cpu(i)
485 register_cpu(&cpu_devices[i], i);
486
487 /* call platform init */
488 if (ppc_md.init != NULL) {
489 ppc_md.init();
490 }
491 return 0;
492}
493
494arch_initcall(ppc_init);
495
496/* Warning, IO base is not yet inited */
497void __init setup_arch(char **cmdline_p)
498{
499 extern char *klimit;
500 extern void do_init_bootmem(void);
501
502 /* so udelay does something sensible, assume <= 1000 bogomips */
503 loops_per_jiffy = 500000000 / HZ;
504
505 if (ppc_md.init_early)
506 ppc_md.init_early();
507
508#ifdef CONFIG_XMON
509 xmon_init(1);
510 if (strstr(cmd_line, "xmon"))
511 xmon(NULL);
512#endif /* CONFIG_XMON */
513 if ( ppc_md.progress ) ppc_md.progress("setup_arch: enter", 0x3eab);
514
515#if defined(CONFIG_KGDB)
516 if (ppc_md.kgdb_map_scc)
517 ppc_md.kgdb_map_scc();
518 set_debug_traps();
519 if (strstr(cmd_line, "gdb")) {
520 if (ppc_md.progress)
521 ppc_md.progress("setup_arch: kgdb breakpoint", 0x4000);
522 printk("kgdb breakpoint activated\n");
523 breakpoint();
524 }
525#endif
526
527 /*
528 * Set cache line size based on type of cpu as a default.
529 * Systems with OF can look in the properties on the cpu node(s)
530 * for a possibly more accurate value.
531 */
532 if (! cpu_has_feature(CPU_FTR_UNIFIED_ID_CACHE)) {
533 dcache_bsize = cur_cpu_spec->dcache_bsize;
534 icache_bsize = cur_cpu_spec->icache_bsize;
535 ucache_bsize = 0;
536 } else
537 ucache_bsize = dcache_bsize = icache_bsize
538 = cur_cpu_spec->dcache_bsize;
539
540 /* reboot on panic */
541 panic_timeout = 180;
542
543 init_mm.start_code = PAGE_OFFSET;
544 init_mm.end_code = (unsigned long) _etext;
545 init_mm.end_data = (unsigned long) _edata;
546 init_mm.brk = (unsigned long) klimit;
547
548 /* Save unparsed command line copy for /proc/cmdline */
549 strlcpy(boot_command_line, cmd_line, COMMAND_LINE_SIZE);
550 *cmdline_p = cmd_line;
551
552 parse_early_param();
553
554 /* set up the bootmem stuff with available memory */
555 do_init_bootmem();
556 if ( ppc_md.progress ) ppc_md.progress("setup_arch: bootmem", 0x3eab);
557
558#ifdef CONFIG_PPC_OCP
559 /* Initialize OCP device list */
560 ocp_early_init();
561 if ( ppc_md.progress ) ppc_md.progress("ocp: exit", 0x3eab);
562#endif
563
564#ifdef CONFIG_DUMMY_CONSOLE
565 conswitchp = &dummy_con;
566#endif
567
568 ppc_md.setup_arch();
569 if ( ppc_md.progress ) ppc_md.progress("arch: exit", 0x3eab);
570
571 paging_init();
572}
diff --git a/arch/ppc/kernel/smp-tbsync.c b/arch/ppc/kernel/smp-tbsync.c
deleted file mode 100644
index d0cf3f86931d..000000000000
--- a/arch/ppc/kernel/smp-tbsync.c
+++ /dev/null
@@ -1,180 +0,0 @@
1/*
2 * Smp timebase synchronization for ppc.
3 *
4 * Copyright (C) 2003 Samuel Rydh (samuel@ibrium.se)
5 *
6 */
7
8#include <linux/kernel.h>
9#include <linux/sched.h>
10#include <linux/smp.h>
11#include <linux/unistd.h>
12#include <linux/init.h>
13#include <asm/atomic.h>
14#include <asm/smp.h>
15#include <asm/time.h>
16
17#define NUM_ITER 300
18
19enum {
20 kExit=0, kSetAndTest, kTest
21};
22
23static struct {
24 volatile int tbu;
25 volatile int tbl;
26 volatile int mark;
27 volatile int cmd;
28 volatile int handshake;
29 int filler[3];
30
31 volatile int ack;
32 int filler2[7];
33
34 volatile int race_result;
35} *tbsync;
36
37static volatile int running;
38
39static void __devinit
40enter_contest( int mark, int add )
41{
42 while( (int)(get_tbl() - mark) < 0 )
43 tbsync->race_result = add;
44}
45
46void __devinit
47smp_generic_take_timebase( void )
48{
49 int cmd, tbl, tbu;
50 unsigned long flags;
51
52 local_irq_save(flags);
53 while( !running )
54 ;
55 rmb();
56
57 for( ;; ) {
58 tbsync->ack = 1;
59 while( !tbsync->handshake )
60 ;
61 rmb();
62
63 cmd = tbsync->cmd;
64 tbl = tbsync->tbl;
65 tbu = tbsync->tbu;
66 tbsync->ack = 0;
67 if( cmd == kExit )
68 break;
69
70 if( cmd == kSetAndTest ) {
71 while( tbsync->handshake )
72 ;
73 asm volatile ("mttbl %0" :: "r" (tbl) );
74 asm volatile ("mttbu %0" :: "r" (tbu) );
75 } else {
76 while( tbsync->handshake )
77 ;
78 }
79 enter_contest( tbsync->mark, -1 );
80 }
81 local_irq_restore(flags);
82}
83
84static int __devinit
85start_contest( int cmd, int offset, int num )
86{
87 int i, tbu, tbl, mark, score=0;
88
89 tbsync->cmd = cmd;
90
91 local_irq_disable();
92 for( i=-3; i<num; ) {
93 tbl = get_tbl() + 400;
94 tbsync->tbu = tbu = get_tbu();
95 tbsync->tbl = tbl + offset;
96 tbsync->mark = mark = tbl + 400;
97
98 wmb();
99
100 tbsync->handshake = 1;
101 while( tbsync->ack )
102 ;
103
104 while( (int)(get_tbl() - tbl) <= 0 )
105 ;
106 tbsync->handshake = 0;
107 enter_contest( mark, 1 );
108
109 while( !tbsync->ack )
110 ;
111
112 if( tbsync->tbu != get_tbu() || ((tbsync->tbl ^ get_tbl()) & 0x80000000) )
113 continue;
114 if( i++ > 0 )
115 score += tbsync->race_result;
116 }
117 local_irq_enable();
118 return score;
119}
120
121void __devinit
122smp_generic_give_timebase( void )
123{
124 int i, score, score2, old, min=0, max=5000, offset=1000;
125
126 printk("Synchronizing timebase\n");
127
128 /* if this fails then this kernel won't work anyway... */
129 tbsync = kzalloc( sizeof(*tbsync), GFP_KERNEL );
130 mb();
131 running = 1;
132
133 while( !tbsync->ack )
134 ;
135
136 /* binary search */
137 for( old=-1 ; old != offset ; offset=(min+max)/2 ) {
138 score = start_contest( kSetAndTest, offset, NUM_ITER );
139
140 printk("score %d, offset %d\n", score, offset );
141
142 if( score > 0 )
143 max = offset;
144 else
145 min = offset;
146 old = offset;
147 }
148 score = start_contest( kSetAndTest, min, NUM_ITER );
149 score2 = start_contest( kSetAndTest, max, NUM_ITER );
150
151 printk( "Min %d (score %d), Max %d (score %d)\n", min, score, max, score2 );
152 score = abs( score );
153 score2 = abs( score2 );
154 offset = (score < score2) ? min : max;
155
156 /* guard against inaccurate mttb */
157 for( i=0; i<10; i++ ) {
158 start_contest( kSetAndTest, offset, NUM_ITER/10 );
159
160 if( (score2=start_contest(kTest, offset, NUM_ITER)) < 0 )
161 score2 = -score2;
162 if( score2 <= score || score2 < 20 )
163 break;
164 }
165 printk("Final offset: %d (%d/%d)\n", offset, score2, NUM_ITER );
166
167 /* exiting */
168 tbsync->cmd = kExit;
169 wmb();
170 tbsync->handshake = 1;
171 while( tbsync->ack )
172 ;
173 tbsync->handshake = 0;
174 kfree( tbsync );
175 tbsync = NULL;
176 running = 0;
177
178 /* all done */
179 smp_tb_synchronized = 1;
180}
diff --git a/arch/ppc/kernel/smp.c b/arch/ppc/kernel/smp.c
deleted file mode 100644
index 055998575cb4..000000000000
--- a/arch/ppc/kernel/smp.c
+++ /dev/null
@@ -1,414 +0,0 @@
1/*
2 * Smp support for ppc.
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/kernel.h>
12#include <linux/module.h>
13#include <linux/sched.h>
14#include <linux/smp.h>
15#include <linux/interrupt.h>
16#include <linux/kernel_stat.h>
17#include <linux/delay.h>
18#include <linux/init.h>
19#include <linux/spinlock.h>
20#include <linux/cache.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/io.h>
28#include <asm/prom.h>
29#include <asm/smp.h>
30#include <asm/residual.h>
31#include <asm/time.h>
32#include <asm/thread_info.h>
33#include <asm/tlbflush.h>
34#include <asm/xmon.h>
35#include <asm/machdep.h>
36
37volatile int smp_commenced;
38int smp_tb_synchronized;
39struct cpuinfo_PPC cpu_data[NR_CPUS];
40atomic_t ipi_recv;
41atomic_t ipi_sent;
42cpumask_t cpu_online_map;
43cpumask_t cpu_possible_map;
44int smp_hw_index[NR_CPUS];
45struct thread_info *secondary_ti;
46static struct task_struct *idle_tasks[NR_CPUS];
47
48EXPORT_SYMBOL(cpu_online_map);
49EXPORT_SYMBOL(cpu_possible_map);
50
51/* SMP operations for this machine */
52struct smp_ops_t *smp_ops;
53
54/* all cpu mappings are 1-1 -- Cort */
55volatile unsigned long cpu_callin_map[NR_CPUS];
56
57int start_secondary(void *);
58void smp_call_function_interrupt(void);
59static int __smp_call_function(void (*func) (void *info), void *info,
60 int wait, int target);
61
62/* Low level assembly function used to backup CPU 0 state */
63extern void __save_cpu_setup(void);
64
65/* Since OpenPIC has only 4 IPIs, we use slightly different message numbers.
66 *
67 * Make sure this matches openpic_request_IPIs in open_pic.c, or what shows up
68 * in /proc/interrupts will be wrong!!! --Troy */
69#define PPC_MSG_CALL_FUNCTION 0
70#define PPC_MSG_RESCHEDULE 1
71#define PPC_MSG_INVALIDATE_TLB 2
72#define PPC_MSG_XMON_BREAK 3
73
74static inline void
75smp_message_pass(int target, int msg)
76{
77 if (smp_ops) {
78 atomic_inc(&ipi_sent);
79 smp_ops->message_pass(target, msg);
80 }
81}
82
83/*
84 * Common functions
85 */
86void smp_message_recv(int msg)
87{
88 atomic_inc(&ipi_recv);
89
90 switch( msg ) {
91 case PPC_MSG_CALL_FUNCTION:
92 smp_call_function_interrupt();
93 break;
94 case PPC_MSG_RESCHEDULE:
95 set_need_resched();
96 break;
97 case PPC_MSG_INVALIDATE_TLB:
98 _tlbia();
99 break;
100#ifdef CONFIG_XMON
101 case PPC_MSG_XMON_BREAK:
102 xmon(get_irq_regs());
103 break;
104#endif /* CONFIG_XMON */
105 default:
106 printk("SMP %d: smp_message_recv(): unknown msg %d\n",
107 smp_processor_id(), msg);
108 break;
109 }
110}
111
112/*
113 * 750's don't broadcast tlb invalidates so
114 * we have to emulate that behavior.
115 * -- Cort
116 */
117void smp_send_tlb_invalidate(int cpu)
118{
119 if ( PVR_VER(mfspr(SPRN_PVR)) == 8 )
120 smp_message_pass(MSG_ALL_BUT_SELF, PPC_MSG_INVALIDATE_TLB);
121}
122
123void smp_send_reschedule(int cpu)
124{
125 /*
126 * This is only used if `cpu' is running an idle task,
127 * so it will reschedule itself anyway...
128 *
129 * This isn't the case anymore since the other CPU could be
130 * sleeping and won't reschedule until the next interrupt (such
131 * as the timer).
132 * -- Cort
133 */
134 /* This is only used if `cpu' is running an idle task,
135 so it will reschedule itself anyway... */
136 smp_message_pass(cpu, PPC_MSG_RESCHEDULE);
137}
138
139#ifdef CONFIG_XMON
140void smp_send_xmon_break(int cpu)
141{
142 smp_message_pass(cpu, PPC_MSG_XMON_BREAK);
143}
144#endif /* CONFIG_XMON */
145
146static void stop_this_cpu(void *dummy)
147{
148 local_irq_disable();
149 while (1)
150 ;
151}
152
153void smp_send_stop(void)
154{
155 smp_call_function(stop_this_cpu, NULL, 1, 0);
156}
157
158/*
159 * Structure and data for smp_call_function(). This is designed to minimise
160 * static memory requirements. It also looks cleaner.
161 * Stolen from the i386 version.
162 */
163static DEFINE_SPINLOCK(call_lock);
164
165static struct call_data_struct {
166 void (*func) (void *info);
167 void *info;
168 atomic_t started;
169 atomic_t finished;
170 int wait;
171} *call_data;
172
173/*
174 * this function sends a 'generic call function' IPI to all other CPUs
175 * in the system.
176 */
177
178int smp_call_function(void (*func) (void *info), void *info, int nonatomic,
179 int wait)
180/*
181 * [SUMMARY] Run a function on all other CPUs.
182 * <func> The function to run. This must be fast and non-blocking.
183 * <info> An arbitrary pointer to pass to the function.
184 * <nonatomic> currently unused.
185 * <wait> If true, wait (atomically) until function has completed on other CPUs.
186 * [RETURNS] 0 on success, else a negative status code. Does not return until
187 * remote CPUs are nearly ready to execute <<func>> or are or have executed.
188 *
189 * You must not call this function with disabled interrupts or from a
190 * hardware interrupt handler or from a bottom half handler.
191 */
192{
193 /* FIXME: get cpu lock with hotplug cpus, or change this to
194 bitmask. --RR */
195 if (num_online_cpus() <= 1)
196 return 0;
197 /* Can deadlock when called with interrupts disabled */
198 WARN_ON(irqs_disabled());
199 return __smp_call_function(func, info, wait, MSG_ALL_BUT_SELF);
200}
201
202static int __smp_call_function(void (*func) (void *info), void *info,
203 int wait, int target)
204{
205 struct call_data_struct data;
206 int ret = -1;
207 int timeout;
208 int ncpus = 1;
209
210 if (target == MSG_ALL_BUT_SELF)
211 ncpus = num_online_cpus() - 1;
212 else if (target == MSG_ALL)
213 ncpus = num_online_cpus();
214
215 data.func = func;
216 data.info = info;
217 atomic_set(&data.started, 0);
218 data.wait = wait;
219 if (wait)
220 atomic_set(&data.finished, 0);
221
222 spin_lock(&call_lock);
223 call_data = &data;
224 /* Send a message to all other CPUs and wait for them to respond */
225 smp_message_pass(target, PPC_MSG_CALL_FUNCTION);
226
227 /* Wait for response */
228 timeout = 1000000;
229 while (atomic_read(&data.started) != ncpus) {
230 if (--timeout == 0) {
231 printk("smp_call_function on cpu %d: other cpus not responding (%d)\n",
232 smp_processor_id(), atomic_read(&data.started));
233 goto out;
234 }
235 barrier();
236 udelay(1);
237 }
238
239 if (wait) {
240 timeout = 1000000;
241 while (atomic_read(&data.finished) != ncpus) {
242 if (--timeout == 0) {
243 printk("smp_call_function on cpu %d: other cpus not finishing (%d/%d)\n",
244 smp_processor_id(), atomic_read(&data.finished), atomic_read(&data.started));
245 goto out;
246 }
247 barrier();
248 udelay(1);
249 }
250 }
251 ret = 0;
252
253 out:
254 spin_unlock(&call_lock);
255 return ret;
256}
257
258void smp_call_function_interrupt(void)
259{
260 void (*func) (void *info) = call_data->func;
261 void *info = call_data->info;
262 int wait = call_data->wait;
263
264 /*
265 * Notify initiating CPU that I've grabbed the data and am
266 * about to execute the function
267 */
268 atomic_inc(&call_data->started);
269 /*
270 * At this point the info structure may be out of scope unless wait==1
271 */
272 (*func)(info);
273 if (wait)
274 atomic_inc(&call_data->finished);
275}
276
277static void __devinit smp_store_cpu_info(int id)
278{
279 struct cpuinfo_PPC *c = &cpu_data[id];
280
281 /* assume bogomips are same for everything */
282 c->loops_per_jiffy = loops_per_jiffy;
283 c->pvr = mfspr(SPRN_PVR);
284}
285
286void __init smp_prepare_cpus(unsigned int max_cpus)
287{
288 int num_cpus, i, cpu;
289 struct task_struct *p;
290
291 /* Fixup boot cpu */
292 smp_store_cpu_info(smp_processor_id());
293 cpu_callin_map[smp_processor_id()] = 1;
294
295 if (smp_ops == NULL) {
296 printk("SMP not supported on this machine.\n");
297 return;
298 }
299
300 /* Probe platform for CPUs: always linear. */
301 num_cpus = smp_ops->probe();
302
303 if (num_cpus < 2)
304 smp_tb_synchronized = 1;
305
306 for (i = 0; i < num_cpus; ++i)
307 cpu_set(i, cpu_possible_map);
308
309 /* Backup CPU 0 state */
310 __save_cpu_setup();
311
312 for_each_possible_cpu(cpu) {
313 if (cpu == smp_processor_id())
314 continue;
315 /* create a process for the processor */
316 p = fork_idle(cpu);
317 if (IS_ERR(p))
318 panic("failed fork for CPU %u: %li", cpu, PTR_ERR(p));
319 task_thread_info(p)->cpu = cpu;
320 idle_tasks[cpu] = p;
321 }
322}
323
324void __devinit smp_prepare_boot_cpu(void)
325{
326 cpu_set(smp_processor_id(), cpu_online_map);
327 cpu_set(smp_processor_id(), cpu_possible_map);
328}
329
330int __init setup_profiling_timer(unsigned int multiplier)
331{
332 return 0;
333}
334
335/* Processor coming up starts here */
336int __devinit start_secondary(void *unused)
337{
338 int cpu;
339
340 atomic_inc(&init_mm.mm_count);
341 current->active_mm = &init_mm;
342
343 cpu = smp_processor_id();
344 smp_store_cpu_info(cpu);
345 set_dec(tb_ticks_per_jiffy);
346 preempt_disable();
347 cpu_callin_map[cpu] = 1;
348
349 printk("CPU %d done callin...\n", cpu);
350 smp_ops->setup_cpu(cpu);
351 printk("CPU %d done setup...\n", cpu);
352 smp_ops->take_timebase();
353 printk("CPU %d done timebase take...\n", cpu);
354
355 spin_lock(&call_lock);
356 cpu_set(cpu, cpu_online_map);
357 spin_unlock(&call_lock);
358
359 local_irq_enable();
360
361 cpu_idle();
362 return 0;
363}
364
365int __cpu_up(unsigned int cpu)
366{
367 char buf[32];
368 int c;
369
370 secondary_ti = task_thread_info(idle_tasks[cpu]);
371 mb();
372
373 /*
374 * There was a cache flush loop here to flush the cache
375 * to memory for the first 8MB of RAM. The cache flush
376 * has been pushed into the kick_cpu function for those
377 * platforms that need it.
378 */
379
380 /* wake up cpu */
381 smp_ops->kick_cpu(cpu);
382
383 /*
384 * wait to see if the cpu made a callin (is actually up).
385 * use this value that I found through experimentation.
386 * -- Cort
387 */
388 for (c = 1000; c && !cpu_callin_map[cpu]; c--)
389 udelay(100);
390
391 if (!cpu_callin_map[cpu]) {
392 sprintf(buf, "didn't find cpu %u", cpu);
393 if (ppc_md.progress) ppc_md.progress(buf, 0x360+cpu);
394 printk("Processor %u is stuck.\n", cpu);
395 return -ENOENT;
396 }
397
398 sprintf(buf, "found cpu %u", cpu);
399 if (ppc_md.progress) ppc_md.progress(buf, 0x350+cpu);
400 printk("Processor %d found.\n", cpu);
401
402 smp_ops->give_timebase();
403
404 /* Wait until cpu puts itself in the online map */
405 while (!cpu_online(cpu))
406 cpu_relax();
407
408 return 0;
409}
410
411void smp_cpus_done(unsigned int max_cpus)
412{
413 smp_ops->setup_cpu(0);
414}
diff --git a/arch/ppc/kernel/softemu8xx.c b/arch/ppc/kernel/softemu8xx.c
deleted file mode 100644
index 9bbb6bf7b645..000000000000
--- a/arch/ppc/kernel/softemu8xx.c
+++ /dev/null
@@ -1,147 +0,0 @@
1/*
2 * Software emulation of some PPC instructions for the 8xx core.
3 *
4 * Copyright (C) 1998 Dan Malek (dmalek@jlc.net)
5 *
6 * Software floating emuation for the MPC8xx processor. I did this mostly
7 * because it was easier than trying to get the libraries compiled for
8 * software floating point. The goal is still to get the libraries done,
9 * but I lost patience and needed some hacks to at least get init and
10 * shells running. The first problem is the setjmp/longjmp that save
11 * and restore the floating point registers.
12 *
13 * For this emulation, our working registers are found on the register
14 * save area.
15 */
16
17#include <linux/errno.h>
18#include <linux/sched.h>
19#include <linux/kernel.h>
20#include <linux/mm.h>
21#include <linux/stddef.h>
22#include <linux/unistd.h>
23#include <linux/ptrace.h>
24#include <linux/slab.h>
25#include <linux/user.h>
26#include <linux/a.out.h>
27#include <linux/interrupt.h>
28
29#include <asm/pgtable.h>
30#include <asm/uaccess.h>
31#include <asm/system.h>
32#include <asm/io.h>
33
34extern void
35print_8xx_pte(struct mm_struct *mm, unsigned long addr);
36extern int
37get_8xx_pte(struct mm_struct *mm, unsigned long addr);
38
39/* Eventually we may need a look-up table, but this works for now.
40*/
41#define LFS 48
42#define LFD 50
43#define LFDU 51
44#define STFD 54
45#define STFDU 55
46#define FMR 63
47
48/*
49 * We return 0 on success, 1 on unimplemented instruction, and EFAULT
50 * if a load/store faulted.
51 */
52int
53Soft_emulate_8xx(struct pt_regs *regs)
54{
55 uint inst, instword;
56 uint flreg, idxreg, disp;
57 uint retval;
58 signed short sdisp;
59 uint *ea, *ip;
60
61 retval = 0;
62
63 instword = *((uint *)regs->nip);
64 inst = instword >> 26;
65
66 flreg = (instword >> 21) & 0x1f;
67 idxreg = (instword >> 16) & 0x1f;
68 disp = instword & 0xffff;
69
70 ea = (uint *)(regs->gpr[idxreg] + disp);
71 ip = (uint *)&current->thread.fpr[flreg];
72
73 switch ( inst )
74 {
75 case LFD:
76 /* this is a 16 bit quantity that is sign extended
77 * so use a signed short here -- Cort
78 */
79 sdisp = (instword & 0xffff);
80 ea = (uint *)(regs->gpr[idxreg] + sdisp);
81 if (copy_from_user(ip, ea, sizeof(double)))
82 retval = -EFAULT;
83 break;
84
85 case LFDU:
86 if (copy_from_user(ip, ea, sizeof(double)))
87 retval = -EFAULT;
88 else
89 regs->gpr[idxreg] = (uint)ea;
90 break;
91 case LFS:
92 sdisp = (instword & 0xffff);
93 ea = (uint *)(regs->gpr[idxreg] + sdisp);
94 if (copy_from_user(ip, ea, sizeof(float)))
95 retval = -EFAULT;
96 break;
97 case STFD:
98 /* this is a 16 bit quantity that is sign extended
99 * so use a signed short here -- Cort
100 */
101 sdisp = (instword & 0xffff);
102 ea = (uint *)(regs->gpr[idxreg] + sdisp);
103 if (copy_to_user(ea, ip, sizeof(double)))
104 retval = -EFAULT;
105 break;
106
107 case STFDU:
108 if (copy_to_user(ea, ip, sizeof(double)))
109 retval = -EFAULT;
110 else
111 regs->gpr[idxreg] = (uint)ea;
112 break;
113 case FMR:
114 /* assume this is a fp move -- Cort */
115 memcpy( ip, &current->thread.fpr[(instword>>11)&0x1f],
116 sizeof(double) );
117 break;
118 default:
119 retval = 1;
120 printk("Bad emulation %s/%d\n"
121 " NIP: %08lx instruction: %08x opcode: %x "
122 "A: %x B: %x C: %x code: %x rc: %x\n",
123 current->comm,current->pid,
124 regs->nip,
125 instword,inst,
126 (instword>>16)&0x1f,
127 (instword>>11)&0x1f,
128 (instword>>6)&0x1f,
129 (instword>>1)&0x3ff,
130 instword&1);
131 {
132 int pa;
133 print_8xx_pte(current->mm,regs->nip);
134 pa = get_8xx_pte(current->mm,regs->nip) & PAGE_MASK;
135 pa |= (regs->nip & ~PAGE_MASK);
136 pa = (unsigned long)__va(pa);
137 printk("Kernel VA for NIP %x ", pa);
138 print_8xx_pte(current->mm,pa);
139 }
140
141 }
142
143 if (retval == 0)
144 regs->nip += 4;
145 return(retval);
146}
147
diff --git a/arch/ppc/kernel/time.c b/arch/ppc/kernel/time.c
deleted file mode 100644
index 18ee851e33e3..000000000000
--- a/arch/ppc/kernel/time.c
+++ /dev/null
@@ -1,445 +0,0 @@
1/*
2 * Common time routines among all ppc machines.
3 *
4 * Written by Cort Dougan (cort@cs.nmt.edu) to merge
5 * Paul Mackerras' version and mine for PReP and Pmac.
6 * MPC8xx/MBX changes by Dan Malek (dmalek@jlc.net).
7 *
8 * First round of bugfixes by Gabriel Paubert (paubert@iram.es)
9 * to make clock more stable (2.4.0-test5). The only thing
10 * that this code assumes is that the timebases have been synchronized
11 * by firmware on SMP and are never stopped (never do sleep
12 * on SMP then, nap and doze are OK).
13 *
14 * TODO (not necessarily in this file):
15 * - improve precision and reproducibility of timebase frequency
16 * measurement at boot time.
17 * - get rid of xtime_lock for gettimeofday (generic kernel problem
18 * to be implemented on all architectures for SMP scalability and
19 * eventually implementing gettimeofday without entering the kernel).
20 * - put all time/clock related variables in a single structure
21 * to minimize number of cache lines touched by gettimeofday()
22 * - for astronomical applications: add a new function to get
23 * non ambiguous timestamps even around leap seconds. This needs
24 * a new timestamp format and a good name.
25 *
26 *
27 * The following comment is partially obsolete (at least the long wait
28 * is no more a valid reason):
29 * Since the MPC8xx has a programmable interrupt timer, I decided to
30 * use that rather than the decrementer. Two reasons: 1.) the clock
31 * frequency is low, causing 2.) a long wait in the timer interrupt
32 * while ((d = get_dec()) == dval)
33 * loop. The MPC8xx can be driven from a variety of input clocks,
34 * so a number of assumptions have been made here because the kernel
35 * parameter HZ is a constant. We assume (correctly, today :-) that
36 * the MPC8xx on the MBX board is driven from a 32.768 kHz crystal.
37 * This is then divided by 4, providing a 8192 Hz clock into the PIT.
38 * Since it is not possible to get a nice 100 Hz clock out of this, without
39 * creating a software PLL, I have set HZ to 128. -- Dan
40 *
41 * 1997-09-10 Updated NTP code according to technical memorandum Jan '96
42 * "A Kernel Model for Precision Timekeeping" by Dave Mills
43 */
44
45#include <linux/errno.h>
46#include <linux/sched.h>
47#include <linux/kernel.h>
48#include <linux/param.h>
49#include <linux/string.h>
50#include <linux/mm.h>
51#include <linux/module.h>
52#include <linux/interrupt.h>
53#include <linux/timex.h>
54#include <linux/kernel_stat.h>
55#include <linux/mc146818rtc.h>
56#include <linux/time.h>
57#include <linux/init.h>
58#include <linux/profile.h>
59
60#include <asm/io.h>
61#include <asm/nvram.h>
62#include <asm/cache.h>
63#include <asm/8xx_immap.h>
64#include <asm/machdep.h>
65#include <asm/irq_regs.h>
66
67#include <asm/time.h>
68
69unsigned long disarm_decr[NR_CPUS];
70
71extern struct timezone sys_tz;
72
73/* keep track of when we need to update the rtc */
74time_t last_rtc_update;
75
76/* The decrementer counts down by 128 every 128ns on a 601. */
77#define DECREMENTER_COUNT_601 (1000000000 / HZ)
78
79unsigned tb_ticks_per_jiffy;
80unsigned tb_to_us;
81unsigned tb_last_stamp;
82unsigned long tb_to_ns_scale;
83
84/* used for timezone offset */
85static long timezone_offset;
86
87DEFINE_SPINLOCK(rtc_lock);
88
89EXPORT_SYMBOL(rtc_lock);
90
91/* Timer interrupt helper function */
92static inline int tb_delta(unsigned *jiffy_stamp) {
93 int delta;
94 if (__USE_RTC()) {
95 delta = get_rtcl();
96 if (delta < *jiffy_stamp) *jiffy_stamp -= 1000000000;
97 delta -= *jiffy_stamp;
98 } else {
99 delta = get_tbl() - *jiffy_stamp;
100 }
101 return delta;
102}
103
104#ifdef CONFIG_SMP
105unsigned long profile_pc(struct pt_regs *regs)
106{
107 unsigned long pc = instruction_pointer(regs);
108
109 if (in_lock_functions(pc))
110 return regs->link;
111
112 return pc;
113}
114EXPORT_SYMBOL(profile_pc);
115#endif
116
117void wakeup_decrementer(void)
118{
119 set_dec(tb_ticks_per_jiffy);
120 /* No currently-supported powerbook has a 601,
121 * so use get_tbl, not native
122 */
123 last_jiffy_stamp(0) = tb_last_stamp = get_tbl();
124}
125
126/*
127 * timer_interrupt - gets called when the decrementer overflows,
128 * with interrupts disabled.
129 * We set it up to overflow again in 1/HZ seconds.
130 */
131void timer_interrupt(struct pt_regs * regs)
132{
133 struct pt_regs *old_regs;
134 int next_dec;
135 unsigned long cpu = smp_processor_id();
136 unsigned jiffy_stamp = last_jiffy_stamp(cpu);
137 extern void do_IRQ(struct pt_regs *);
138
139 if (atomic_read(&ppc_n_lost_interrupts) != 0)
140 do_IRQ(regs);
141
142 old_regs = set_irq_regs(regs);
143 irq_enter();
144
145 while ((next_dec = tb_ticks_per_jiffy - tb_delta(&jiffy_stamp)) <= 0) {
146 jiffy_stamp += tb_ticks_per_jiffy;
147
148 profile_tick(CPU_PROFILING);
149 update_process_times(user_mode(regs));
150
151 if (smp_processor_id())
152 continue;
153
154 /* We are in an interrupt, no need to save/restore flags */
155 write_seqlock(&xtime_lock);
156 tb_last_stamp = jiffy_stamp;
157 do_timer(1);
158
159 /*
160 * update the rtc when needed, this should be performed on the
161 * right fraction of a second. Half or full second ?
162 * Full second works on mk48t59 clocks, others need testing.
163 * Note that this update is basically only used through
164 * the adjtimex system calls. Setting the HW clock in
165 * any other way is a /dev/rtc and userland business.
166 * This is still wrong by -0.5/+1.5 jiffies because of the
167 * timer interrupt resolution and possible delay, but here we
168 * hit a quantization limit which can only be solved by higher
169 * resolution timers and decoupling time management from timer
170 * interrupts. This is also wrong on the clocks
171 * which require being written at the half second boundary.
172 * We should have an rtc call that only sets the minutes and
173 * seconds like on Intel to avoid problems with non UTC clocks.
174 */
175 if ( ppc_md.set_rtc_time && ntp_synced() &&
176 xtime.tv_sec - last_rtc_update >= 659 &&
177 abs((xtime.tv_nsec / 1000) - (1000000-1000000/HZ)) < 500000/HZ) {
178 if (ppc_md.set_rtc_time(xtime.tv_sec+1 + timezone_offset) == 0)
179 last_rtc_update = xtime.tv_sec+1;
180 else
181 /* Try again one minute later */
182 last_rtc_update += 60;
183 }
184 write_sequnlock(&xtime_lock);
185 }
186 if ( !disarm_decr[smp_processor_id()] )
187 set_dec(next_dec);
188 last_jiffy_stamp(cpu) = jiffy_stamp;
189
190 if (ppc_md.heartbeat && !ppc_md.heartbeat_count--)
191 ppc_md.heartbeat();
192
193 irq_exit();
194 set_irq_regs(old_regs);
195}
196
197/*
198 * This version of gettimeofday has microsecond resolution.
199 */
200void do_gettimeofday(struct timeval *tv)
201{
202 unsigned long flags;
203 unsigned long seq;
204 unsigned delta, usec, sec;
205
206 do {
207 seq = read_seqbegin_irqsave(&xtime_lock, flags);
208 sec = xtime.tv_sec;
209 usec = (xtime.tv_nsec / 1000);
210 delta = tb_ticks_since(tb_last_stamp);
211#ifdef CONFIG_SMP
212 /* As long as timebases are not in sync, gettimeofday can only
213 * have jiffy resolution on SMP.
214 */
215 if (!smp_tb_synchronized)
216 delta = 0;
217#endif /* CONFIG_SMP */
218 } while (read_seqretry_irqrestore(&xtime_lock, seq, flags));
219
220 usec += mulhwu(tb_to_us, delta);
221 while (usec >= 1000000) {
222 sec++;
223 usec -= 1000000;
224 }
225 tv->tv_sec = sec;
226 tv->tv_usec = usec;
227}
228
229EXPORT_SYMBOL(do_gettimeofday);
230
231int do_settimeofday(struct timespec *tv)
232{
233 time_t wtm_sec, new_sec = tv->tv_sec;
234 long wtm_nsec, new_nsec = tv->tv_nsec;
235 unsigned long flags;
236 int tb_delta;
237
238 if ((unsigned long)tv->tv_nsec >= NSEC_PER_SEC)
239 return -EINVAL;
240
241 write_seqlock_irqsave(&xtime_lock, flags);
242 /* Updating the RTC is not the job of this code. If the time is
243 * stepped under NTP, the RTC will be update after STA_UNSYNC
244 * is cleared. Tool like clock/hwclock either copy the RTC
245 * to the system time, in which case there is no point in writing
246 * to the RTC again, or write to the RTC but then they don't call
247 * settimeofday to perform this operation. Note also that
248 * we don't touch the decrementer since:
249 * a) it would lose timer interrupt synchronization on SMP
250 * (if it is working one day)
251 * b) it could make one jiffy spuriously shorter or longer
252 * which would introduce another source of uncertainty potentially
253 * harmful to relatively short timers.
254 */
255
256 /* This works perfectly on SMP only if the tb are in sync but
257 * guarantees an error < 1 jiffy even if they are off by eons,
258 * still reasonable when gettimeofday resolution is 1 jiffy.
259 */
260 tb_delta = tb_ticks_since(last_jiffy_stamp(smp_processor_id()));
261
262 new_nsec -= 1000 * mulhwu(tb_to_us, tb_delta);
263
264 wtm_sec = wall_to_monotonic.tv_sec + (xtime.tv_sec - new_sec);
265 wtm_nsec = wall_to_monotonic.tv_nsec + (xtime.tv_nsec - new_nsec);
266
267 set_normalized_timespec(&xtime, new_sec, new_nsec);
268 set_normalized_timespec(&wall_to_monotonic, wtm_sec, wtm_nsec);
269
270 /* In case of a large backwards jump in time with NTP, we want the
271 * clock to be updated as soon as the PLL is again in lock.
272 */
273 last_rtc_update = new_sec - 658;
274
275 ntp_clear();
276 write_sequnlock_irqrestore(&xtime_lock, flags);
277 clock_was_set();
278 return 0;
279}
280
281EXPORT_SYMBOL(do_settimeofday);
282
283/* This function is only called on the boot processor */
284void __init time_init(void)
285{
286 time_t sec, old_sec;
287 unsigned old_stamp, stamp, elapsed;
288
289 if (ppc_md.time_init != NULL)
290 timezone_offset = ppc_md.time_init();
291
292 if (__USE_RTC()) {
293 /* 601 processor: dec counts down by 128 every 128ns */
294 tb_ticks_per_jiffy = DECREMENTER_COUNT_601;
295 /* mulhwu_scale_factor(1000000000, 1000000) is 0x418937 */
296 tb_to_us = 0x418937;
297 } else {
298 ppc_md.calibrate_decr();
299 tb_to_ns_scale = mulhwu(tb_to_us, 1000 << 10);
300 }
301
302 /* Now that the decrementer is calibrated, it can be used in case the
303 * clock is stuck, but the fact that we have to handle the 601
304 * makes things more complex. Repeatedly read the RTC until the
305 * next second boundary to try to achieve some precision. If there
306 * is no RTC, we still need to set tb_last_stamp and
307 * last_jiffy_stamp(cpu 0) to the current stamp.
308 */
309 stamp = get_native_tbl();
310 if (ppc_md.get_rtc_time) {
311 sec = ppc_md.get_rtc_time();
312 elapsed = 0;
313 do {
314 old_stamp = stamp;
315 old_sec = sec;
316 stamp = get_native_tbl();
317 if (__USE_RTC() && stamp < old_stamp)
318 old_stamp -= 1000000000;
319 elapsed += stamp - old_stamp;
320 sec = ppc_md.get_rtc_time();
321 } while ( sec == old_sec && elapsed < 2*HZ*tb_ticks_per_jiffy);
322 if (sec==old_sec)
323 printk("Warning: real time clock seems stuck!\n");
324 xtime.tv_sec = sec;
325 xtime.tv_nsec = 0;
326 /* No update now, we just read the time from the RTC ! */
327 last_rtc_update = xtime.tv_sec;
328 }
329 last_jiffy_stamp(0) = tb_last_stamp = stamp;
330
331 /* Not exact, but the timer interrupt takes care of this */
332 set_dec(tb_ticks_per_jiffy);
333
334 /* If platform provided a timezone (pmac), we correct the time */
335 if (timezone_offset) {
336 sys_tz.tz_minuteswest = -timezone_offset / 60;
337 sys_tz.tz_dsttime = 0;
338 xtime.tv_sec -= timezone_offset;
339 }
340 set_normalized_timespec(&wall_to_monotonic,
341 -xtime.tv_sec, -xtime.tv_nsec);
342}
343
344#define FEBRUARY 2
345#define STARTOFTIME 1970
346#define SECDAY 86400L
347#define SECYR (SECDAY * 365)
348
349/*
350 * Note: this is wrong for 2100, but our signed 32-bit time_t will
351 * have overflowed long before that, so who cares. -- paulus
352 */
353#define leapyear(year) ((year) % 4 == 0)
354#define days_in_year(a) (leapyear(a) ? 366 : 365)
355#define days_in_month(a) (month_days[(a) - 1])
356
357static int month_days[12] = {
358 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
359};
360
361void to_tm(int tim, struct rtc_time * tm)
362{
363 register int i;
364 register long hms, day, gday;
365
366 gday = day = tim / SECDAY;
367 hms = tim % SECDAY;
368
369 /* Hours, minutes, seconds are easy */
370 tm->tm_hour = hms / 3600;
371 tm->tm_min = (hms % 3600) / 60;
372 tm->tm_sec = (hms % 3600) % 60;
373
374 /* Number of years in days */
375 for (i = STARTOFTIME; day >= days_in_year(i); i++)
376 day -= days_in_year(i);
377 tm->tm_year = i;
378
379 /* Number of months in days left */
380 if (leapyear(tm->tm_year))
381 days_in_month(FEBRUARY) = 29;
382 for (i = 1; day >= days_in_month(i); i++)
383 day -= days_in_month(i);
384 days_in_month(FEBRUARY) = 28;
385 tm->tm_mon = i;
386
387 /* Days are what is left over (+1) from all that. */
388 tm->tm_mday = day + 1;
389
390 /*
391 * Determine the day of week. Jan. 1, 1970 was a Thursday.
392 */
393 tm->tm_wday = (gday + 4) % 7;
394}
395
396/* Auxiliary function to compute scaling factors */
397/* Actually the choice of a timebase running at 1/4 the of the bus
398 * frequency giving resolution of a few tens of nanoseconds is quite nice.
399 * It makes this computation very precise (27-28 bits typically) which
400 * is optimistic considering the stability of most processor clock
401 * oscillators and the precision with which the timebase frequency
402 * is measured but does not harm.
403 */
404unsigned mulhwu_scale_factor(unsigned inscale, unsigned outscale) {
405 unsigned mlt=0, tmp, err;
406 /* No concern for performance, it's done once: use a stupid
407 * but safe and compact method to find the multiplier.
408 */
409 for (tmp = 1U<<31; tmp != 0; tmp >>= 1) {
410 if (mulhwu(inscale, mlt|tmp) < outscale) mlt|=tmp;
411 }
412 /* We might still be off by 1 for the best approximation.
413 * A side effect of this is that if outscale is too large
414 * the returned value will be zero.
415 * Many corner cases have been checked and seem to work,
416 * some might have been forgotten in the test however.
417 */
418 err = inscale*(mlt+1);
419 if (err <= inscale/2) mlt++;
420 return mlt;
421}
422
423unsigned long long sched_clock(void)
424{
425 unsigned long lo, hi, hi2;
426 unsigned long long tb;
427
428 if (!__USE_RTC()) {
429 do {
430 hi = get_tbu();
431 lo = get_tbl();
432 hi2 = get_tbu();
433 } while (hi2 != hi);
434 tb = ((unsigned long long) hi << 32) | lo;
435 tb = (tb * tb_to_ns_scale) >> 10;
436 } else {
437 do {
438 hi = get_rtcu();
439 lo = get_rtcl();
440 hi2 = get_rtcu();
441 } while (hi2 != hi);
442 tb = ((unsigned long long) hi) * 1000000000 + lo;
443 }
444 return tb;
445}
diff --git a/arch/ppc/kernel/traps.c b/arch/ppc/kernel/traps.c
deleted file mode 100644
index a467a429c2fe..000000000000
--- a/arch/ppc/kernel/traps.c
+++ /dev/null
@@ -1,826 +0,0 @@
1/*
2 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
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 * Modified by Cort Dougan (cort@cs.nmt.edu)
10 * and Paul Mackerras (paulus@cs.anu.edu.au)
11 */
12
13/*
14 * This file handles the architecture-dependent parts of hardware exceptions
15 */
16
17#include <linux/errno.h>
18#include <linux/sched.h>
19#include <linux/kernel.h>
20#include <linux/mm.h>
21#include <linux/stddef.h>
22#include <linux/unistd.h>
23#include <linux/ptrace.h>
24#include <linux/slab.h>
25#include <linux/user.h>
26#include <linux/a.out.h>
27#include <linux/interrupt.h>
28#include <linux/init.h>
29#include <linux/module.h>
30#include <linux/prctl.h>
31#include <linux/bug.h>
32
33#include <asm/pgtable.h>
34#include <asm/uaccess.h>
35#include <asm/system.h>
36#include <asm/io.h>
37#include <asm/reg.h>
38#include <asm/xmon.h>
39#include <asm/pmc.h>
40
41#ifdef CONFIG_XMON
42extern int xmon_bpt(struct pt_regs *regs);
43extern int xmon_sstep(struct pt_regs *regs);
44extern int xmon_iabr_match(struct pt_regs *regs);
45extern int xmon_dabr_match(struct pt_regs *regs);
46
47int (*debugger)(struct pt_regs *regs) = xmon;
48int (*debugger_bpt)(struct pt_regs *regs) = xmon_bpt;
49int (*debugger_sstep)(struct pt_regs *regs) = xmon_sstep;
50int (*debugger_iabr_match)(struct pt_regs *regs) = xmon_iabr_match;
51int (*debugger_dabr_match)(struct pt_regs *regs) = xmon_dabr_match;
52void (*debugger_fault_handler)(struct pt_regs *regs);
53#else
54#ifdef CONFIG_KGDB
55int (*debugger)(struct pt_regs *regs);
56int (*debugger_bpt)(struct pt_regs *regs);
57int (*debugger_sstep)(struct pt_regs *regs);
58int (*debugger_iabr_match)(struct pt_regs *regs);
59int (*debugger_dabr_match)(struct pt_regs *regs);
60void (*debugger_fault_handler)(struct pt_regs *regs);
61#else
62#define debugger(regs) do { } while (0)
63#define debugger_bpt(regs) 0
64#define debugger_sstep(regs) 0
65#define debugger_iabr_match(regs) 0
66#define debugger_dabr_match(regs) 0
67#define debugger_fault_handler ((void (*)(struct pt_regs *))0)
68#endif
69#endif
70
71/*
72 * Trap & Exception support
73 */
74
75DEFINE_SPINLOCK(die_lock);
76
77int die(const char * str, struct pt_regs * fp, long err)
78{
79 static int die_counter;
80 int nl = 0;
81 console_verbose();
82 spin_lock_irq(&die_lock);
83 printk("Oops: %s, sig: %ld [#%d]\n", str, err, ++die_counter);
84#ifdef CONFIG_PREEMPT
85 printk("PREEMPT ");
86 nl = 1;
87#endif
88#ifdef CONFIG_SMP
89 printk("SMP NR_CPUS=%d ", NR_CPUS);
90 nl = 1;
91#endif
92 if (nl)
93 printk("\n");
94 show_regs(fp);
95 add_taint(TAINT_DIE);
96 spin_unlock_irq(&die_lock);
97 /* do_exit() should take care of panic'ing from an interrupt
98 * context so we don't handle it here
99 */
100 do_exit(err);
101}
102
103void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr)
104{
105 siginfo_t info;
106
107 if (!user_mode(regs)) {
108 debugger(regs);
109 die("Exception in kernel mode", regs, signr);
110 }
111 info.si_signo = signr;
112 info.si_errno = 0;
113 info.si_code = code;
114 info.si_addr = (void __user *) addr;
115 force_sig_info(signr, &info, current);
116
117 /*
118 * Init gets no signals that it doesn't have a handler for.
119 * That's all very well, but if it has caused a synchronous
120 * exception and we ignore the resulting signal, it will just
121 * generate the same exception over and over again and we get
122 * nowhere. Better to kill it and let the kernel panic.
123 */
124 if (is_global_init(current)) {
125 __sighandler_t handler;
126
127 spin_lock_irq(&current->sighand->siglock);
128 handler = current->sighand->action[signr-1].sa.sa_handler;
129 spin_unlock_irq(&current->sighand->siglock);
130 if (handler == SIG_DFL) {
131 /* init has generated a synchronous exception
132 and it doesn't have a handler for the signal */
133 printk(KERN_CRIT "init has generated signal %d "
134 "but has no handler for it\n", signr);
135 do_exit(signr);
136 }
137 }
138}
139
140/*
141 * I/O accesses can cause machine checks on powermacs.
142 * Check if the NIP corresponds to the address of a sync
143 * instruction for which there is an entry in the exception
144 * table.
145 * Note that the 601 only takes a machine check on TEA
146 * (transfer error ack) signal assertion, and does not
147 * set any of the top 16 bits of SRR1.
148 * -- paulus.
149 */
150static inline int check_io_access(struct pt_regs *regs)
151{
152#if defined CONFIG_8xx
153 unsigned long msr = regs->msr;
154 const struct exception_table_entry *entry;
155 unsigned int *nip = (unsigned int *)regs->nip;
156
157 if (((msr & 0xffff0000) == 0 || (msr & (0x80000 | 0x40000)))
158 && (entry = search_exception_tables(regs->nip)) != NULL) {
159 /*
160 * Check that it's a sync instruction, or somewhere
161 * in the twi; isync; nop sequence that inb/inw/inl uses.
162 * As the address is in the exception table
163 * we should be able to read the instr there.
164 * For the debug message, we look at the preceding
165 * load or store.
166 */
167 if (*nip == 0x60000000) /* nop */
168 nip -= 2;
169 else if (*nip == 0x4c00012c) /* isync */
170 --nip;
171 /* eieio from I/O string functions */
172 else if ((*nip) == 0x7c0006ac || *(nip+1) == 0x7c0006ac)
173 nip += 2;
174 if (*nip == 0x7c0004ac || (*nip >> 26) == 3 ||
175 (*(nip+1) >> 26) == 3) {
176 /* sync or twi */
177 unsigned int rb;
178
179 --nip;
180 rb = (*nip >> 11) & 0x1f;
181 printk(KERN_DEBUG "%s bad port %lx at %p\n",
182 (*nip & 0x100)? "OUT to": "IN from",
183 regs->gpr[rb] - _IO_BASE, nip);
184 regs->msr |= MSR_RI;
185 regs->nip = entry->fixup;
186 return 1;
187 }
188 }
189#endif /* CONFIG_8xx */
190 return 0;
191}
192
193#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE)
194/* On 4xx, the reason for the machine check or program exception
195 is in the ESR. */
196#define get_reason(regs) ((regs)->dsisr)
197#define get_mc_reason(regs) ((regs)->dsisr)
198#define REASON_FP ESR_FP
199#define REASON_ILLEGAL (ESR_PIL | ESR_PUO)
200#define REASON_PRIVILEGED ESR_PPR
201#define REASON_TRAP ESR_PTR
202
203/* single-step stuff */
204#define single_stepping(regs) (current->thread.dbcr0 & DBCR0_IC)
205#define clear_single_step(regs) (current->thread.dbcr0 &= ~DBCR0_IC)
206
207#else
208/* On non-4xx, the reason for the machine check or program
209 exception is in the MSR. */
210#define get_reason(regs) ((regs)->msr)
211#define get_mc_reason(regs) ((regs)->msr)
212#define REASON_FP 0x100000
213#define REASON_ILLEGAL 0x80000
214#define REASON_PRIVILEGED 0x40000
215#define REASON_TRAP 0x20000
216
217#define single_stepping(regs) ((regs)->msr & MSR_SE)
218#define clear_single_step(regs) ((regs)->msr &= ~MSR_SE)
219#endif
220
221/*
222 * This is "fall-back" implementation for configurations
223 * which don't provide platform-specific machine check info
224 */
225void __attribute__ ((weak))
226platform_machine_check(struct pt_regs *regs)
227{
228}
229
230#if defined(CONFIG_4xx)
231int machine_check_4xx(struct pt_regs *regs)
232{
233 unsigned long reason = get_mc_reason(regs);
234
235 if (reason & ESR_IMCP) {
236 printk("Instruction");
237 mtspr(SPRN_ESR, reason & ~ESR_IMCP);
238 } else
239 printk("Data");
240 printk(" machine check in kernel mode.\n");
241
242 return 0;
243}
244
245int machine_check_440A(struct pt_regs *regs)
246{
247 unsigned long reason = get_mc_reason(regs);
248
249 printk("Machine check in kernel mode.\n");
250 if (reason & ESR_IMCP){
251 printk("Instruction Synchronous Machine Check exception\n");
252 mtspr(SPRN_ESR, reason & ~ESR_IMCP);
253 }
254 else {
255 u32 mcsr = mfspr(SPRN_MCSR);
256 if (mcsr & MCSR_IB)
257 printk("Instruction Read PLB Error\n");
258 if (mcsr & MCSR_DRB)
259 printk("Data Read PLB Error\n");
260 if (mcsr & MCSR_DWB)
261 printk("Data Write PLB Error\n");
262 if (mcsr & MCSR_TLBP)
263 printk("TLB Parity Error\n");
264 if (mcsr & MCSR_ICP){
265 flush_instruction_cache();
266 printk("I-Cache Parity Error\n");
267 }
268 if (mcsr & MCSR_DCSP)
269 printk("D-Cache Search Parity Error\n");
270 if (mcsr & MCSR_DCFP)
271 printk("D-Cache Flush Parity Error\n");
272 if (mcsr & MCSR_IMPE)
273 printk("Machine Check exception is imprecise\n");
274
275 /* Clear MCSR */
276 mtspr(SPRN_MCSR, mcsr);
277 }
278 return 0;
279}
280#else
281int machine_check_generic(struct pt_regs *regs)
282{
283 unsigned long reason = get_mc_reason(regs);
284
285 printk("Machine check in kernel mode.\n");
286 printk("Caused by (from SRR1=%lx): ", reason);
287 switch (reason & 0x601F0000) {
288 case 0x80000:
289 printk("Machine check signal\n");
290 break;
291 case 0: /* for 601 */
292 case 0x40000:
293 case 0x140000: /* 7450 MSS error and TEA */
294 printk("Transfer error ack signal\n");
295 break;
296 case 0x20000:
297 printk("Data parity error signal\n");
298 break;
299 case 0x10000:
300 printk("Address parity error signal\n");
301 break;
302 case 0x20000000:
303 printk("L1 Data Cache error\n");
304 break;
305 case 0x40000000:
306 printk("L1 Instruction Cache error\n");
307 break;
308 case 0x00100000:
309 printk("L2 data cache parity error\n");
310 break;
311 default:
312 printk("Unknown values in msr\n");
313 }
314 return 0;
315}
316#endif /* everything else */
317
318void machine_check_exception(struct pt_regs *regs)
319{
320 int recover = 0;
321
322 if (cur_cpu_spec->machine_check)
323 recover = cur_cpu_spec->machine_check(regs);
324 if (recover > 0)
325 return;
326
327 if (user_mode(regs)) {
328 regs->msr |= MSR_RI;
329 _exception(SIGBUS, regs, BUS_ADRERR, regs->nip);
330 return;
331 }
332
333#if defined(CONFIG_8xx) && defined(CONFIG_PCI)
334 /* the qspan pci read routines can cause machine checks -- Cort */
335 bad_page_fault(regs, regs->dar, SIGBUS);
336 return;
337#endif
338
339 if (debugger_fault_handler) {
340 debugger_fault_handler(regs);
341 regs->msr |= MSR_RI;
342 return;
343 }
344
345 if (check_io_access(regs))
346 return;
347
348 /*
349 * Optional platform-provided routine to print out
350 * additional info, e.g. bus error registers.
351 */
352 platform_machine_check(regs);
353
354 debugger(regs);
355 die("machine check", regs, SIGBUS);
356}
357
358void SMIException(struct pt_regs *regs)
359{
360 debugger(regs);
361#if !(defined(CONFIG_XMON) || defined(CONFIG_KGDB))
362 show_regs(regs);
363 panic("System Management Interrupt");
364#endif
365}
366
367void unknown_exception(struct pt_regs *regs)
368{
369 printk("Bad trap at PC: %lx, MSR: %lx, vector=%lx %s\n",
370 regs->nip, regs->msr, regs->trap, print_tainted());
371 _exception(SIGTRAP, regs, 0, 0);
372}
373
374void instruction_breakpoint_exception(struct pt_regs *regs)
375{
376 if (debugger_iabr_match(regs))
377 return;
378 _exception(SIGTRAP, regs, TRAP_BRKPT, 0);
379}
380
381void RunModeException(struct pt_regs *regs)
382{
383 _exception(SIGTRAP, regs, 0, 0);
384}
385
386/* Illegal instruction emulation support. Originally written to
387 * provide the PVR to user applications using the mfspr rd, PVR.
388 * Return non-zero if we can't emulate, or -EFAULT if the associated
389 * memory access caused an access fault. Return zero on success.
390 *
391 * There are a couple of ways to do this, either "decode" the instruction
392 * or directly match lots of bits. In this case, matching lots of
393 * bits is faster and easier.
394 *
395 */
396#define INST_MFSPR_PVR 0x7c1f42a6
397#define INST_MFSPR_PVR_MASK 0xfc1fffff
398
399#define INST_DCBA 0x7c0005ec
400#define INST_DCBA_MASK 0x7c0007fe
401
402#define INST_MCRXR 0x7c000400
403#define INST_MCRXR_MASK 0x7c0007fe
404
405#define INST_STRING 0x7c00042a
406#define INST_STRING_MASK 0x7c0007fe
407#define INST_STRING_GEN_MASK 0x7c00067e
408#define INST_LSWI 0x7c0004aa
409#define INST_LSWX 0x7c00042a
410#define INST_STSWI 0x7c0005aa
411#define INST_STSWX 0x7c00052a
412
413static int emulate_string_inst(struct pt_regs *regs, u32 instword)
414{
415 u8 rT = (instword >> 21) & 0x1f;
416 u8 rA = (instword >> 16) & 0x1f;
417 u8 NB_RB = (instword >> 11) & 0x1f;
418 u32 num_bytes;
419 unsigned long EA;
420 int pos = 0;
421
422 /* Early out if we are an invalid form of lswx */
423 if ((instword & INST_STRING_MASK) == INST_LSWX)
424 if ((rT == rA) || (rT == NB_RB))
425 return -EINVAL;
426
427 EA = (rA == 0) ? 0 : regs->gpr[rA];
428
429 switch (instword & INST_STRING_MASK) {
430 case INST_LSWX:
431 case INST_STSWX:
432 EA += NB_RB;
433 num_bytes = regs->xer & 0x7f;
434 break;
435 case INST_LSWI:
436 case INST_STSWI:
437 num_bytes = (NB_RB == 0) ? 32 : NB_RB;
438 break;
439 default:
440 return -EINVAL;
441 }
442
443 while (num_bytes != 0)
444 {
445 u8 val;
446 u32 shift = 8 * (3 - (pos & 0x3));
447
448 switch ((instword & INST_STRING_MASK)) {
449 case INST_LSWX:
450 case INST_LSWI:
451 if (get_user(val, (u8 __user *)EA))
452 return -EFAULT;
453 /* first time updating this reg,
454 * zero it out */
455 if (pos == 0)
456 regs->gpr[rT] = 0;
457 regs->gpr[rT] |= val << shift;
458 break;
459 case INST_STSWI:
460 case INST_STSWX:
461 val = regs->gpr[rT] >> shift;
462 if (put_user(val, (u8 __user *)EA))
463 return -EFAULT;
464 break;
465 }
466 /* move EA to next address */
467 EA += 1;
468 num_bytes--;
469
470 /* manage our position within the register */
471 if (++pos == 4) {
472 pos = 0;
473 if (++rT == 32)
474 rT = 0;
475 }
476 }
477
478 return 0;
479}
480
481static int emulate_instruction(struct pt_regs *regs)
482{
483 u32 instword;
484 u32 rd;
485
486 if (!user_mode(regs))
487 return -EINVAL;
488 CHECK_FULL_REGS(regs);
489
490 if (get_user(instword, (u32 __user *)(regs->nip)))
491 return -EFAULT;
492
493 /* Emulate the mfspr rD, PVR.
494 */
495 if ((instword & INST_MFSPR_PVR_MASK) == INST_MFSPR_PVR) {
496 rd = (instword >> 21) & 0x1f;
497 regs->gpr[rd] = mfspr(SPRN_PVR);
498 return 0;
499 }
500
501 /* Emulating the dcba insn is just a no-op. */
502 if ((instword & INST_DCBA_MASK) == INST_DCBA)
503 return 0;
504
505 /* Emulate the mcrxr insn. */
506 if ((instword & INST_MCRXR_MASK) == INST_MCRXR) {
507 int shift = (instword >> 21) & 0x1c;
508 unsigned long msk = 0xf0000000UL >> shift;
509
510 regs->ccr = (regs->ccr & ~msk) | ((regs->xer >> shift) & msk);
511 regs->xer &= ~0xf0000000UL;
512 return 0;
513 }
514
515 /* Emulate load/store string insn. */
516 if ((instword & INST_STRING_GEN_MASK) == INST_STRING)
517 return emulate_string_inst(regs, instword);
518
519 return -EINVAL;
520}
521
522/*
523 * After we have successfully emulated an instruction, we have to
524 * check if the instruction was being single-stepped, and if so,
525 * pretend we got a single-step exception. This was pointed out
526 * by Kumar Gala. -- paulus
527 */
528static void emulate_single_step(struct pt_regs *regs)
529{
530 if (single_stepping(regs)) {
531 clear_single_step(regs);
532 _exception(SIGTRAP, regs, TRAP_TRACE, 0);
533 }
534}
535
536int is_valid_bugaddr(unsigned long addr)
537{
538 return addr >= PAGE_OFFSET;
539}
540
541void program_check_exception(struct pt_regs *regs)
542{
543 unsigned int reason = get_reason(regs);
544 extern int do_mathemu(struct pt_regs *regs);
545
546#ifdef CONFIG_MATH_EMULATION
547 /* (reason & REASON_ILLEGAL) would be the obvious thing here,
548 * but there seems to be a hardware bug on the 405GP (RevD)
549 * that means ESR is sometimes set incorrectly - either to
550 * ESR_DST (!?) or 0. In the process of chasing this with the
551 * hardware people - not sure if it can happen on any illegal
552 * instruction or only on FP instructions, whether there is a
553 * pattern to occurrences etc. -dgibson 31/Mar/2003 */
554 if (!(reason & REASON_TRAP) && do_mathemu(regs) == 0) {
555 emulate_single_step(regs);
556 return;
557 }
558#endif /* CONFIG_MATH_EMULATION */
559
560 if (reason & REASON_FP) {
561 /* IEEE FP exception */
562 int code = 0;
563 u32 fpscr;
564
565 /* We must make sure the FP state is consistent with
566 * our MSR_FP in regs
567 */
568 preempt_disable();
569 if (regs->msr & MSR_FP)
570 giveup_fpu(current);
571 preempt_enable();
572
573 fpscr = current->thread.fpscr.val;
574 fpscr &= fpscr << 22; /* mask summary bits with enables */
575 if (fpscr & FPSCR_VX)
576 code = FPE_FLTINV;
577 else if (fpscr & FPSCR_OX)
578 code = FPE_FLTOVF;
579 else if (fpscr & FPSCR_UX)
580 code = FPE_FLTUND;
581 else if (fpscr & FPSCR_ZX)
582 code = FPE_FLTDIV;
583 else if (fpscr & FPSCR_XX)
584 code = FPE_FLTRES;
585 _exception(SIGFPE, regs, code, regs->nip);
586 return;
587 }
588
589 if (reason & REASON_TRAP) {
590 /* trap exception */
591 if (debugger_bpt(regs))
592 return;
593
594 if (!(regs->msr & MSR_PR) && /* not user-mode */
595 report_bug(regs->nip, regs) == BUG_TRAP_TYPE_WARN) {
596 regs->nip += 4;
597 return;
598 }
599 _exception(SIGTRAP, regs, TRAP_BRKPT, 0);
600 return;
601 }
602
603 /* Try to emulate it if we should. */
604 if (reason & (REASON_ILLEGAL | REASON_PRIVILEGED)) {
605 switch (emulate_instruction(regs)) {
606 case 0:
607 regs->nip += 4;
608 emulate_single_step(regs);
609 return;
610 case -EFAULT:
611 _exception(SIGSEGV, regs, SEGV_MAPERR, regs->nip);
612 return;
613 }
614 }
615
616 if (reason & REASON_PRIVILEGED)
617 _exception(SIGILL, regs, ILL_PRVOPC, regs->nip);
618 else
619 _exception(SIGILL, regs, ILL_ILLOPC, regs->nip);
620}
621
622void single_step_exception(struct pt_regs *regs)
623{
624 regs->msr &= ~(MSR_SE | MSR_BE); /* Turn off 'trace' bits */
625 if (debugger_sstep(regs))
626 return;
627 _exception(SIGTRAP, regs, TRAP_TRACE, 0);
628}
629
630void alignment_exception(struct pt_regs *regs)
631{
632 int sig, code, fixed = 0;
633
634 fixed = fix_alignment(regs);
635 if (fixed == 1) {
636 regs->nip += 4; /* skip over emulated instruction */
637 emulate_single_step(regs);
638 return;
639 }
640 if (fixed == -EFAULT) {
641 sig = SIGSEGV;
642 code = SEGV_ACCERR;
643 } else {
644 sig = SIGBUS;
645 code = BUS_ADRALN;
646 }
647 if (user_mode(regs))
648 _exception(sig, regs, code, regs->dar);
649 else
650 bad_page_fault(regs, regs->dar, sig);
651}
652
653void StackOverflow(struct pt_regs *regs)
654{
655 printk(KERN_CRIT "Kernel stack overflow in process %p, r1=%lx\n",
656 current, regs->gpr[1]);
657 debugger(regs);
658 show_regs(regs);
659 panic("kernel stack overflow");
660}
661
662void nonrecoverable_exception(struct pt_regs *regs)
663{
664 printk(KERN_ERR "Non-recoverable exception at PC=%lx MSR=%lx\n",
665 regs->nip, regs->msr);
666 debugger(regs);
667 die("nonrecoverable exception", regs, SIGKILL);
668}
669
670void trace_syscall(struct pt_regs *regs)
671{
672 printk("Task: %p(%d), PC: %08lX/%08lX, Syscall: %3ld, Result: %s%ld %s\n",
673 current, current->pid, regs->nip, regs->link, regs->gpr[0],
674 regs->ccr&0x10000000?"Error=":"", regs->gpr[3], print_tainted());
675}
676
677#ifdef CONFIG_8xx
678void SoftwareEmulation(struct pt_regs *regs)
679{
680 extern int do_mathemu(struct pt_regs *);
681 extern int Soft_emulate_8xx(struct pt_regs *);
682 int errcode;
683
684 CHECK_FULL_REGS(regs);
685
686 if (!user_mode(regs)) {
687 debugger(regs);
688 die("Kernel Mode Software FPU Emulation", regs, SIGFPE);
689 }
690
691#ifdef CONFIG_MATH_EMULATION
692 errcode = do_mathemu(regs);
693#else
694 errcode = Soft_emulate_8xx(regs);
695#endif
696 if (errcode) {
697 if (errcode > 0)
698 _exception(SIGFPE, regs, 0, 0);
699 else if (errcode == -EFAULT)
700 _exception(SIGSEGV, regs, 0, 0);
701 else
702 _exception(SIGILL, regs, ILL_ILLOPC, regs->nip);
703 } else
704 emulate_single_step(regs);
705}
706#endif /* CONFIG_8xx */
707
708#if defined(CONFIG_40x) || defined(CONFIG_BOOKE)
709
710void DebugException(struct pt_regs *regs, unsigned long debug_status)
711{
712 if (debug_status & DBSR_IC) { /* instruction completion */
713 regs->msr &= ~MSR_DE;
714 if (user_mode(regs)) {
715 current->thread.dbcr0 &= ~DBCR0_IC;
716 } else {
717 /* Disable instruction completion */
718 mtspr(SPRN_DBCR0, mfspr(SPRN_DBCR0) & ~DBCR0_IC);
719 /* Clear the instruction completion event */
720 mtspr(SPRN_DBSR, DBSR_IC);
721 if (debugger_sstep(regs))
722 return;
723 }
724 _exception(SIGTRAP, regs, TRAP_TRACE, 0);
725 }
726}
727#endif /* CONFIG_4xx || CONFIG_BOOKE */
728
729#if !defined(CONFIG_TAU_INT)
730void TAUException(struct pt_regs *regs)
731{
732 printk("TAU trap at PC: %lx, MSR: %lx, vector=%lx %s\n",
733 regs->nip, regs->msr, regs->trap, print_tainted());
734}
735#endif /* CONFIG_INT_TAU */
736
737/*
738 * FP unavailable trap from kernel - print a message, but let
739 * the task use FP in the kernel until it returns to user mode.
740 */
741void kernel_fp_unavailable_exception(struct pt_regs *regs)
742{
743 regs->msr |= MSR_FP;
744 printk(KERN_ERR "floating point used in kernel (task=%p, pc=%lx)\n",
745 current, regs->nip);
746}
747
748void altivec_unavailable_exception(struct pt_regs *regs)
749{
750 static int kernel_altivec_count;
751
752#ifndef CONFIG_ALTIVEC
753 if (user_mode(regs)) {
754 /* A user program has executed an altivec instruction,
755 but this kernel doesn't support altivec. */
756 _exception(SIGILL, regs, ILL_ILLOPC, regs->nip);
757 return;
758 }
759#endif
760 /* The kernel has executed an altivec instruction without
761 first enabling altivec. Whinge but let it do it. */
762 if (++kernel_altivec_count < 10)
763 printk(KERN_ERR "AltiVec used in kernel (task=%p, pc=%lx)\n",
764 current, regs->nip);
765 regs->msr |= MSR_VEC;
766}
767
768#ifdef CONFIG_ALTIVEC
769void altivec_assist_exception(struct pt_regs *regs)
770{
771 int err;
772
773 preempt_disable();
774 if (regs->msr & MSR_VEC)
775 giveup_altivec(current);
776 preempt_enable();
777 if (!user_mode(regs)) {
778 printk(KERN_ERR "altivec assist exception in kernel mode"
779 " at %lx\n", regs->nip);
780 debugger(regs);
781 die("altivec assist exception", regs, SIGFPE);
782 return;
783 }
784
785 err = emulate_altivec(regs);
786 if (err == 0) {
787 regs->nip += 4; /* skip emulated instruction */
788 emulate_single_step(regs);
789 return;
790 }
791
792 if (err == -EFAULT) {
793 /* got an error reading the instruction */
794 _exception(SIGSEGV, regs, SEGV_ACCERR, regs->nip);
795 } else {
796 /* didn't recognize the instruction */
797 /* XXX quick hack for now: set the non-Java bit in the VSCR */
798 printk(KERN_ERR "unrecognized altivec instruction "
799 "in %s at %lx\n", current->comm, regs->nip);
800 current->thread.vscr.u[3] |= 0x10000;
801 }
802}
803#endif /* CONFIG_ALTIVEC */
804
805#ifdef CONFIG_BOOKE_WDT
806/*
807 * Default handler for a Watchdog exception,
808 * spins until a reboot occurs
809 */
810void __attribute__ ((weak)) WatchdogHandler(struct pt_regs *regs)
811{
812 /* Generic WatchdogHandler, implement your own */
813 mtspr(SPRN_TCR, mfspr(SPRN_TCR)&(~TCR_WIE));
814 return;
815}
816
817void WatchdogException(struct pt_regs *regs)
818{
819 printk (KERN_EMERG "PowerPC Book-E Watchdog Exception\n");
820 WatchdogHandler(regs);
821}
822#endif
823
824void __init trap_init(void)
825{
826}
diff --git a/arch/ppc/kernel/vmlinux.lds.S b/arch/ppc/kernel/vmlinux.lds.S
deleted file mode 100644
index 8a24bc47eb6c..000000000000
--- a/arch/ppc/kernel/vmlinux.lds.S
+++ /dev/null
@@ -1,164 +0,0 @@
1#include <asm-generic/vmlinux.lds.h>
2
3OUTPUT_ARCH(powerpc:common)
4jiffies = jiffies_64 + 4;
5SECTIONS
6{
7 /* Read-only sections, merged into text segment: */
8 . = + SIZEOF_HEADERS;
9 .interp : { *(.interp) }
10 .hash : { *(.hash) }
11 .gnu.hash : { *(.gnu.hash) }
12 .dynsym : { *(.dynsym) }
13 .dynstr : { *(.dynstr) }
14 .rel.text : { *(.rel.text) }
15 .rela.text : { *(.rela.text) }
16 .rel.data : { *(.rel.data) }
17 .rela.data : { *(.rela.data) }
18 .rel.rodata : { *(.rel.rodata) }
19 .rela.rodata : { *(.rela.rodata) }
20 .rel.got : { *(.rel.got) }
21 .rela.got : { *(.rela.got) }
22 .rel.ctors : { *(.rel.ctors) }
23 .rela.ctors : { *(.rela.ctors) }
24 .rel.dtors : { *(.rel.dtors) }
25 .rela.dtors : { *(.rela.dtors) }
26 .rel.bss : { *(.rel.bss) }
27 .rela.bss : { *(.rela.bss) }
28 .rel.plt : { *(.rel.plt) }
29 .rela.plt : { *(.rela.plt) }
30/* .init : { *(.init) } =0*/
31 .plt : { *(.plt) }
32 .text :
33 {
34 _text = .;
35 TEXT_TEXT
36 SCHED_TEXT
37 LOCK_TEXT
38 *(.fixup)
39 *(.got1)
40 __got2_start = .;
41 *(.got2)
42 __got2_end = .;
43 }
44 _etext = .;
45 PROVIDE (etext = .);
46
47 RODATA
48 .fini : { *(.fini) } =0
49 .ctors : { *(.ctors) }
50 .dtors : { *(.dtors) }
51
52 .fixup : { *(.fixup) }
53
54 __ex_table : {
55 __start___ex_table = .;
56 *(__ex_table)
57 __stop___ex_table = .;
58 }
59
60 __bug_table : {
61 __start___bug_table = .;
62 *(__bug_table)
63 __stop___bug_table = .;
64 }
65
66 /* Read-write section, merged into data segment: */
67 . = ALIGN(4096);
68 .data :
69 {
70 DATA_DATA
71 *(.data1)
72 *(.sdata)
73 *(.sdata2)
74 *(.got.plt) *(.got)
75 *(.dynamic)
76 CONSTRUCTORS
77 }
78
79 . = ALIGN(4096);
80 __nosave_begin = .;
81 .data_nosave : { *(.data.nosave) }
82 . = ALIGN(4096);
83 __nosave_end = .;
84
85 . = ALIGN(32);
86 .data.cacheline_aligned : { *(.data.cacheline_aligned) }
87
88 _edata = .;
89 PROVIDE (edata = .);
90
91 . = ALIGN(8192);
92 .data.init_task : { *(.data.init_task) }
93
94 NOTES
95
96 . = ALIGN(4096);
97 __init_begin = .;
98 .init.text : {
99 _sinittext = .;
100 INIT_TEXT
101 _einittext = .;
102 }
103 /* .exit.text is discarded at runtime, not link time,
104 to deal with references from __bug_table */
105 .exit.text : { EXIT_TEXT }
106 .init.data : {
107 INIT_DATA
108 __vtop_table_begin = .;
109 *(.vtop_fixup);
110 __vtop_table_end = .;
111 __ptov_table_begin = .;
112 *(.ptov_fixup);
113 __ptov_table_end = .;
114 }
115 . = ALIGN(16);
116 __setup_start = .;
117 .init.setup : { *(.init.setup) }
118 __setup_end = .;
119 __initcall_start = .;
120 .initcall.init : {
121 INITCALLS
122 }
123 __initcall_end = .;
124
125 __con_initcall_start = .;
126 .con_initcall.init : { *(.con_initcall.init) }
127 __con_initcall_end = .;
128
129 SECURITY_INIT
130
131 __start___ftr_fixup = .;
132 __ftr_fixup : { *(__ftr_fixup) }
133 __stop___ftr_fixup = .;
134
135 PERCPU(4096)
136
137#ifdef CONFIG_BLK_DEV_INITRD
138 . = ALIGN(4096);
139 __initramfs_start = .;
140 .init.ramfs : { *(.init.ramfs) }
141 __initramfs_end = .;
142#endif
143
144 . = ALIGN(4096);
145 __init_end = .;
146 __bss_start = .;
147 .bss :
148 {
149 *(.sbss) *(.scommon)
150 *(.dynbss)
151 *(.bss)
152 *(COMMON)
153 }
154 __bss_stop = .;
155
156 _end = . ;
157 PROVIDE (end = .);
158
159 /* Sections to be discarded. */
160 /DISCARD/ : {
161 *(.exitcall.exit)
162 EXIT_DATA
163 }
164}
diff --git a/arch/ppc/lib/Makefile b/arch/ppc/lib/Makefile
deleted file mode 100644
index 095e661e79dd..000000000000
--- a/arch/ppc/lib/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
1#
2# Makefile for ppc-specific library files..
3#
4
5obj-y := checksum.o string.o div64.o
diff --git a/arch/ppc/lib/checksum.S b/arch/ppc/lib/checksum.S
deleted file mode 100644
index 7874e8a80455..000000000000
--- a/arch/ppc/lib/checksum.S
+++ /dev/null
@@ -1,225 +0,0 @@
1/*
2 * This file contains assembly-language implementations
3 * of IP-style 1's complement checksum routines.
4 *
5 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version
10 * 2 of the License, or (at your option) any later version.
11 *
12 * Severely hacked about by Paul Mackerras (paulus@cs.anu.edu.au).
13 */
14
15#include <linux/sys.h>
16#include <asm/processor.h>
17#include <asm/errno.h>
18#include <asm/ppc_asm.h>
19
20 .text
21
22/*
23 * ip_fast_csum(buf, len) -- Optimized for IP header
24 * len is in words and is always >= 5.
25 */
26_GLOBAL(ip_fast_csum)
27 lwz r0,0(r3)
28 lwzu r5,4(r3)
29 addic. r4,r4,-2
30 addc r0,r0,r5
31 mtctr r4
32 blelr-
331: lwzu r4,4(r3)
34 adde r0,r0,r4
35 bdnz 1b
36 addze r0,r0 /* add in final carry */
37 rlwinm r3,r0,16,0,31 /* fold two halves together */
38 add r3,r0,r3
39 not r3,r3
40 srwi r3,r3,16
41 blr
42
43/*
44 * Compute checksum of TCP or UDP pseudo-header:
45 * csum_tcpudp_magic(saddr, daddr, len, proto, sum)
46 */
47_GLOBAL(csum_tcpudp_magic)
48 rlwimi r5,r6,16,0,15 /* put proto in upper half of len */
49 addc r0,r3,r4 /* add 4 32-bit words together */
50 adde r0,r0,r5
51 adde r0,r0,r7
52 addze r0,r0 /* add in final carry */
53 rlwinm r3,r0,16,0,31 /* fold two halves together */
54 add r3,r0,r3
55 not r3,r3
56 srwi r3,r3,16
57 blr
58
59/*
60 * computes the checksum of a memory block at buff, length len,
61 * and adds in "sum" (32-bit)
62 *
63 * csum_partial(buff, len, sum)
64 */
65_GLOBAL(csum_partial)
66 addic r0,r5,0
67 subi r3,r3,4
68 srwi. r6,r4,2
69 beq 3f /* if we're doing < 4 bytes */
70 andi. r5,r3,2 /* Align buffer to longword boundary */
71 beq+ 1f
72 lhz r5,4(r3) /* do 2 bytes to get aligned */
73 addi r3,r3,2
74 subi r4,r4,2
75 addc r0,r0,r5
76 srwi. r6,r4,2 /* # words to do */
77 beq 3f
781: mtctr r6
792: lwzu r5,4(r3) /* the bdnz has zero overhead, so it should */
80 adde r0,r0,r5 /* be unnecessary to unroll this loop */
81 bdnz 2b
82 andi. r4,r4,3
833: cmpwi 0,r4,2
84 blt+ 4f
85 lhz r5,4(r3)
86 addi r3,r3,2
87 subi r4,r4,2
88 adde r0,r0,r5
894: cmpwi 0,r4,1
90 bne+ 5f
91 lbz r5,4(r3)
92 slwi r5,r5,8 /* Upper byte of word */
93 adde r0,r0,r5
945: addze r3,r0 /* add in final carry */
95 blr
96
97/*
98 * Computes the checksum of a memory block at src, length len,
99 * and adds in "sum" (32-bit), while copying the block to dst.
100 * If an access exception occurs on src or dst, it stores -EFAULT
101 * to *src_err or *dst_err respectively, and (for an error on
102 * src) zeroes the rest of dst.
103 *
104 * csum_partial_copy_generic(src, dst, len, sum, src_err, dst_err)
105 */
106_GLOBAL(csum_partial_copy_generic)
107 addic r0,r6,0
108 subi r3,r3,4
109 subi r4,r4,4
110 srwi. r6,r5,2
111 beq 3f /* if we're doing < 4 bytes */
112 andi. r9,r4,2 /* Align dst to longword boundary */
113 beq+ 1f
11481: lhz r6,4(r3) /* do 2 bytes to get aligned */
115 addi r3,r3,2
116 subi r5,r5,2
11791: sth r6,4(r4)
118 addi r4,r4,2
119 addc r0,r0,r6
120 srwi. r6,r5,2 /* # words to do */
121 beq 3f
1221: srwi. r6,r5,4 /* # groups of 4 words to do */
123 beq 10f
124 mtctr r6
12571: lwz r6,4(r3)
12672: lwz r9,8(r3)
12773: lwz r10,12(r3)
12874: lwzu r11,16(r3)
129 adde r0,r0,r6
13075: stw r6,4(r4)
131 adde r0,r0,r9
13276: stw r9,8(r4)
133 adde r0,r0,r10
13477: stw r10,12(r4)
135 adde r0,r0,r11
13678: stwu r11,16(r4)
137 bdnz 71b
13810: rlwinm. r6,r5,30,30,31 /* # words left to do */
139 beq 13f
140 mtctr r6
14182: lwzu r9,4(r3)
14292: stwu r9,4(r4)
143 adde r0,r0,r9
144 bdnz 82b
14513: andi. r5,r5,3
1463: cmpwi 0,r5,2
147 blt+ 4f
14883: lhz r6,4(r3)
149 addi r3,r3,2
150 subi r5,r5,2
15193: sth r6,4(r4)
152 addi r4,r4,2
153 adde r0,r0,r6
1544: cmpwi 0,r5,1
155 bne+ 5f
15684: lbz r6,4(r3)
15794: stb r6,4(r4)
158 slwi r6,r6,8 /* Upper byte of word */
159 adde r0,r0,r6
1605: addze r3,r0 /* add in final carry */
161 blr
162
163/* These shouldn't go in the fixup section, since that would
164 cause the ex_table addresses to get out of order. */
165
166src_error_4:
167 mfctr r6 /* update # bytes remaining from ctr */
168 rlwimi r5,r6,4,0,27
169 b 79f
170src_error_1:
171 li r6,0
172 subi r5,r5,2
17395: sth r6,4(r4)
174 addi r4,r4,2
17579: srwi. r6,r5,2
176 beq 3f
177 mtctr r6
178src_error_2:
179 li r6,0
18096: stwu r6,4(r4)
181 bdnz 96b
1823: andi. r5,r5,3
183 beq src_error
184src_error_3:
185 li r6,0
186 mtctr r5
187 addi r4,r4,3
18897: stbu r6,1(r4)
189 bdnz 97b
190src_error:
191 cmpwi 0,r7,0
192 beq 1f
193 li r6,-EFAULT
194 stw r6,0(r7)
1951: addze r3,r0
196 blr
197
198dst_error:
199 cmpwi 0,r8,0
200 beq 1f
201 li r6,-EFAULT
202 stw r6,0(r8)
2031: addze r3,r0
204 blr
205
206.section __ex_table,"a"
207 .long 81b,src_error_1
208 .long 91b,dst_error
209 .long 71b,src_error_4
210 .long 72b,src_error_4
211 .long 73b,src_error_4
212 .long 74b,src_error_4
213 .long 75b,dst_error
214 .long 76b,dst_error
215 .long 77b,dst_error
216 .long 78b,dst_error
217 .long 82b,src_error_2
218 .long 92b,dst_error
219 .long 83b,src_error_3
220 .long 93b,dst_error
221 .long 84b,src_error_3
222 .long 94b,dst_error
223 .long 95b,dst_error
224 .long 96b,dst_error
225 .long 97b,dst_error
diff --git a/arch/ppc/lib/div64.S b/arch/ppc/lib/div64.S
deleted file mode 100644
index 3527569e9926..000000000000
--- a/arch/ppc/lib/div64.S
+++ /dev/null
@@ -1,58 +0,0 @@
1/*
2 * Divide a 64-bit unsigned number by a 32-bit unsigned number.
3 * This routine assumes that the top 32 bits of the dividend are
4 * non-zero to start with.
5 * On entry, r3 points to the dividend, which get overwritten with
6 * the 64-bit quotient, and r4 contains the divisor.
7 * On exit, r3 contains the remainder.
8 *
9 * Copyright (C) 2002 Paul Mackerras, IBM Corp.
10 *
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version
14 * 2 of the License, or (at your option) any later version.
15 */
16#include <asm/ppc_asm.h>
17#include <asm/processor.h>
18
19_GLOBAL(__div64_32)
20 lwz r5,0(r3) # get the dividend into r5/r6
21 lwz r6,4(r3)
22 cmplw r5,r4
23 li r7,0
24 li r8,0
25 blt 1f
26 divwu r7,r5,r4 # if dividend.hi >= divisor,
27 mullw r0,r7,r4 # quotient.hi = dividend.hi / divisor
28 subf. r5,r0,r5 # dividend.hi %= divisor
29 beq 3f
301: mr r11,r5 # here dividend.hi != 0
31 andis. r0,r5,0xc000
32 bne 2f
33 cntlzw r0,r5 # we are shifting the dividend right
34 li r10,-1 # to make it < 2^32, and shifting
35 srw r10,r10,r0 # the divisor right the same amount,
36 add r9,r4,r10 # rounding up (so the estimate cannot
37 andc r11,r6,r10 # ever be too large, only too small)
38 andc r9,r9,r10
39 or r11,r5,r11
40 rotlw r9,r9,r0
41 rotlw r11,r11,r0
42 divwu r11,r11,r9 # then we divide the shifted quantities
432: mullw r10,r11,r4 # to get an estimate of the quotient,
44 mulhwu r9,r11,r4 # multiply the estimate by the divisor,
45 subfc r6,r10,r6 # take the product from the divisor,
46 add r8,r8,r11 # and add the estimate to the accumulated
47 subfe. r5,r9,r5 # quotient
48 bne 1b
493: cmplw r6,r4
50 blt 4f
51 divwu r0,r6,r4 # perform the remaining 32-bit division
52 mullw r10,r0,r4 # and get the remainder
53 add r8,r8,r0
54 subf r6,r10,r6
554: stw r7,0(r3) # return the quotient in *r3
56 stw r8,4(r3)
57 mr r3,r6 # return the remainder in r3
58 blr
diff --git a/arch/ppc/lib/locks.c b/arch/ppc/lib/locks.c
deleted file mode 100644
index ea4aee6b20e6..000000000000
--- a/arch/ppc/lib/locks.c
+++ /dev/null
@@ -1,189 +0,0 @@
1/*
2 * Locks for smp ppc
3 *
4 * Written by Cort Dougan (cort@cs.nmt.edu)
5 */
6
7#include <linux/sched.h>
8#include <linux/spinlock.h>
9#include <linux/module.h>
10#include <asm/ppc_asm.h>
11#include <asm/smp.h>
12
13#ifdef CONFIG_DEBUG_SPINLOCK
14
15#undef INIT_STUCK
16#define INIT_STUCK 200000000 /*0xffffffff*/
17
18/*
19 * Try to acquire a spinlock.
20 * Only does the stwcx. if the load returned 0 - the Programming
21 * Environments Manual suggests not doing unnecessary stcwx.'s
22 * since they may inhibit forward progress by other CPUs in getting
23 * a lock.
24 */
25static inline unsigned long __spin_trylock(volatile unsigned long *lock)
26{
27 unsigned long ret;
28
29 __asm__ __volatile__ ("\n\
301: lwarx %0,0,%1\n\
31 cmpwi 0,%0,0\n\
32 bne 2f\n"
33 PPC405_ERR77(0,%1)
34" stwcx. %2,0,%1\n\
35 bne- 1b\n\
36 isync\n\
372:"
38 : "=&r"(ret)
39 : "r"(lock), "r"(1)
40 : "cr0", "memory");
41
42 return ret;
43}
44
45void _raw_spin_lock(spinlock_t *lock)
46{
47 int cpu = smp_processor_id();
48 unsigned int stuck = INIT_STUCK;
49 while (__spin_trylock(&lock->lock)) {
50 while ((unsigned volatile long)lock->lock != 0) {
51 if (!--stuck) {
52 printk("_spin_lock(%p) CPU#%d NIP %p"
53 " holder: cpu %ld pc %08lX\n",
54 lock, cpu, __builtin_return_address(0),
55 lock->owner_cpu,lock->owner_pc);
56 stuck = INIT_STUCK;
57 /* steal the lock */
58 /*xchg_u32((void *)&lock->lock,0);*/
59 }
60 }
61 }
62 lock->owner_pc = (unsigned long)__builtin_return_address(0);
63 lock->owner_cpu = cpu;
64}
65EXPORT_SYMBOL(_raw_spin_lock);
66
67int _raw_spin_trylock(spinlock_t *lock)
68{
69 if (__spin_trylock(&lock->lock))
70 return 0;
71 lock->owner_cpu = smp_processor_id();
72 lock->owner_pc = (unsigned long)__builtin_return_address(0);
73 return 1;
74}
75EXPORT_SYMBOL(_raw_spin_trylock);
76
77void _raw_spin_unlock(spinlock_t *lp)
78{
79 if ( !lp->lock )
80 printk("_spin_unlock(%p): no lock cpu %d curr PC %p %s/%d\n",
81 lp, smp_processor_id(), __builtin_return_address(0),
82 current->comm, current->pid);
83 if ( lp->owner_cpu != smp_processor_id() )
84 printk("_spin_unlock(%p): cpu %d trying clear of cpu %d pc %lx val %lx\n",
85 lp, smp_processor_id(), (int)lp->owner_cpu,
86 lp->owner_pc,lp->lock);
87 lp->owner_pc = lp->owner_cpu = 0;
88 wmb();
89 lp->lock = 0;
90}
91EXPORT_SYMBOL(_raw_spin_unlock);
92
93/*
94 * For rwlocks, zero is unlocked, -1 is write-locked,
95 * positive is read-locked.
96 */
97static __inline__ int __read_trylock(rwlock_t *rw)
98{
99 signed int tmp;
100
101 __asm__ __volatile__(
102"2: lwarx %0,0,%1 # __read_trylock\n\
103 addic. %0,%0,1\n\
104 ble- 1f\n"
105 PPC405_ERR77(0,%1)
106" stwcx. %0,0,%1\n\
107 bne- 2b\n\
108 isync\n\
1091:"
110 : "=&r"(tmp)
111 : "r"(&rw->lock)
112 : "cr0", "memory");
113
114 return tmp;
115}
116
117int _raw_read_trylock(rwlock_t *rw)
118{
119 return __read_trylock(rw) > 0;
120}
121EXPORT_SYMBOL(_raw_read_trylock);
122
123void _raw_read_lock(rwlock_t *rw)
124{
125 unsigned int stuck;
126
127 while (__read_trylock(rw) <= 0) {
128 stuck = INIT_STUCK;
129 while (!read_can_lock(rw)) {
130 if (--stuck == 0) {
131 printk("_read_lock(%p) CPU#%d lock %d\n",
132 rw, raw_smp_processor_id(), rw->lock);
133 stuck = INIT_STUCK;
134 }
135 }
136 }
137}
138EXPORT_SYMBOL(_raw_read_lock);
139
140void _raw_read_unlock(rwlock_t *rw)
141{
142 if ( rw->lock == 0 )
143 printk("_read_unlock(): %s/%d (nip %08lX) lock %d\n",
144 current->comm,current->pid,current->thread.regs->nip,
145 rw->lock);
146 wmb();
147 atomic_dec((atomic_t *) &(rw)->lock);
148}
149EXPORT_SYMBOL(_raw_read_unlock);
150
151void _raw_write_lock(rwlock_t *rw)
152{
153 unsigned int stuck;
154
155 while (cmpxchg(&rw->lock, 0, -1) != 0) {
156 stuck = INIT_STUCK;
157 while (!write_can_lock(rw)) {
158 if (--stuck == 0) {
159 printk("write_lock(%p) CPU#%d lock %d)\n",
160 rw, raw_smp_processor_id(), rw->lock);
161 stuck = INIT_STUCK;
162 }
163 }
164 }
165 wmb();
166}
167EXPORT_SYMBOL(_raw_write_lock);
168
169int _raw_write_trylock(rwlock_t *rw)
170{
171 if (cmpxchg(&rw->lock, 0, -1) != 0)
172 return 0;
173 wmb();
174 return 1;
175}
176EXPORT_SYMBOL(_raw_write_trylock);
177
178void _raw_write_unlock(rwlock_t *rw)
179{
180 if (rw->lock >= 0)
181 printk("_write_lock(): %s/%d (nip %08lX) lock %d\n",
182 current->comm,current->pid,current->thread.regs->nip,
183 rw->lock);
184 wmb();
185 rw->lock = 0;
186}
187EXPORT_SYMBOL(_raw_write_unlock);
188
189#endif
diff --git a/arch/ppc/lib/string.S b/arch/ppc/lib/string.S
deleted file mode 100644
index 927253bfc826..000000000000
--- a/arch/ppc/lib/string.S
+++ /dev/null
@@ -1,732 +0,0 @@
1/*
2 * String handling functions for PowerPC.
3 *
4 * Copyright (C) 1996 Paul Mackerras.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 */
11#include <asm/processor.h>
12#include <asm/cache.h>
13#include <asm/errno.h>
14#include <asm/ppc_asm.h>
15
16#define COPY_16_BYTES \
17 lwz r7,4(r4); \
18 lwz r8,8(r4); \
19 lwz r9,12(r4); \
20 lwzu r10,16(r4); \
21 stw r7,4(r6); \
22 stw r8,8(r6); \
23 stw r9,12(r6); \
24 stwu r10,16(r6)
25
26#define COPY_16_BYTES_WITHEX(n) \
278 ## n ## 0: \
28 lwz r7,4(r4); \
298 ## n ## 1: \
30 lwz r8,8(r4); \
318 ## n ## 2: \
32 lwz r9,12(r4); \
338 ## n ## 3: \
34 lwzu r10,16(r4); \
358 ## n ## 4: \
36 stw r7,4(r6); \
378 ## n ## 5: \
38 stw r8,8(r6); \
398 ## n ## 6: \
40 stw r9,12(r6); \
418 ## n ## 7: \
42 stwu r10,16(r6)
43
44#define COPY_16_BYTES_EXCODE(n) \
459 ## n ## 0: \
46 addi r5,r5,-(16 * n); \
47 b 104f; \
489 ## n ## 1: \
49 addi r5,r5,-(16 * n); \
50 b 105f; \
51.section __ex_table,"a"; \
52 .align 2; \
53 .long 8 ## n ## 0b,9 ## n ## 0b; \
54 .long 8 ## n ## 1b,9 ## n ## 0b; \
55 .long 8 ## n ## 2b,9 ## n ## 0b; \
56 .long 8 ## n ## 3b,9 ## n ## 0b; \
57 .long 8 ## n ## 4b,9 ## n ## 1b; \
58 .long 8 ## n ## 5b,9 ## n ## 1b; \
59 .long 8 ## n ## 6b,9 ## n ## 1b; \
60 .long 8 ## n ## 7b,9 ## n ## 1b; \
61 .text
62
63 .text
64 .stabs "arch/ppc/lib/",N_SO,0,0,0f
65 .stabs "string.S",N_SO,0,0,0f
66
67CACHELINE_BYTES = L1_CACHE_BYTES
68LG_CACHELINE_BYTES = L1_CACHE_SHIFT
69CACHELINE_MASK = (L1_CACHE_BYTES-1)
70
71_GLOBAL(strcpy)
72 addi r5,r3,-1
73 addi r4,r4,-1
741: lbzu r0,1(r4)
75 cmpwi 0,r0,0
76 stbu r0,1(r5)
77 bne 1b
78 blr
79
80/* This clears out any unused part of the destination buffer,
81 just as the libc version does. -- paulus */
82_GLOBAL(strncpy)
83 cmpwi 0,r5,0
84 beqlr
85 mtctr r5
86 addi r6,r3,-1
87 addi r4,r4,-1
881: lbzu r0,1(r4)
89 cmpwi 0,r0,0
90 stbu r0,1(r6)
91 bdnzf 2,1b /* dec ctr, branch if ctr != 0 && !cr0.eq */
92 bnelr /* if we didn't hit a null char, we're done */
93 mfctr r5
94 cmpwi 0,r5,0 /* any space left in destination buffer? */
95 beqlr /* we know r0 == 0 here */
962: stbu r0,1(r6) /* clear it out if so */
97 bdnz 2b
98 blr
99
100_GLOBAL(strcat)
101 addi r5,r3,-1
102 addi r4,r4,-1
1031: lbzu r0,1(r5)
104 cmpwi 0,r0,0
105 bne 1b
106 addi r5,r5,-1
1071: lbzu r0,1(r4)
108 cmpwi 0,r0,0
109 stbu r0,1(r5)
110 bne 1b
111 blr
112
113_GLOBAL(strcmp)
114 addi r5,r3,-1
115 addi r4,r4,-1
1161: lbzu r3,1(r5)
117 cmpwi 1,r3,0
118 lbzu r0,1(r4)
119 subf. r3,r0,r3
120 beqlr 1
121 beq 1b
122 blr
123
124_GLOBAL(strncmp)
125 PPC_LCMPI r5,0
126 beqlr
127 mtctr r5
128 addi r5,r3,-1
129 addi r4,r4,-1
1301: lbzu r3,1(r5)
131 cmpwi 1,r3,0
132 lbzu r0,1(r4)
133 subf. r3,r0,r3
134 beqlr 1
135 bdnzt eq,1b
136 blr
137
138_GLOBAL(strlen)
139 addi r4,r3,-1
1401: lbzu r0,1(r4)
141 cmpwi 0,r0,0
142 bne 1b
143 subf r3,r3,r4
144 blr
145
146/*
147 * Use dcbz on the complete cache lines in the destination
148 * to set them to zero. This requires that the destination
149 * area is cacheable. -- paulus
150 */
151_GLOBAL(cacheable_memzero)
152 mr r5,r4
153 li r4,0
154 addi r6,r3,-4
155 cmplwi 0,r5,4
156 blt 7f
157 stwu r4,4(r6)
158 beqlr
159 andi. r0,r6,3
160 add r5,r0,r5
161 subf r6,r0,r6
162 clrlwi r7,r6,32-LG_CACHELINE_BYTES
163 add r8,r7,r5
164 srwi r9,r8,LG_CACHELINE_BYTES
165 addic. r9,r9,-1 /* total number of complete cachelines */
166 ble 2f
167 xori r0,r7,CACHELINE_MASK & ~3
168 srwi. r0,r0,2
169 beq 3f
170 mtctr r0
1714: stwu r4,4(r6)
172 bdnz 4b
1733: mtctr r9
174 li r7,4
175#if !defined(CONFIG_8xx)
17610: dcbz r7,r6
177#else
17810: stw r4, 4(r6)
179 stw r4, 8(r6)
180 stw r4, 12(r6)
181 stw r4, 16(r6)
182#if CACHE_LINE_SIZE >= 32
183 stw r4, 20(r6)
184 stw r4, 24(r6)
185 stw r4, 28(r6)
186 stw r4, 32(r6)
187#endif /* CACHE_LINE_SIZE */
188#endif
189 addi r6,r6,CACHELINE_BYTES
190 bdnz 10b
191 clrlwi r5,r8,32-LG_CACHELINE_BYTES
192 addi r5,r5,4
1932: srwi r0,r5,2
194 mtctr r0
195 bdz 6f
1961: stwu r4,4(r6)
197 bdnz 1b
1986: andi. r5,r5,3
1997: cmpwi 0,r5,0
200 beqlr
201 mtctr r5
202 addi r6,r6,3
2038: stbu r4,1(r6)
204 bdnz 8b
205 blr
206
207_GLOBAL(memset)
208 rlwimi r4,r4,8,16,23
209 rlwimi r4,r4,16,0,15
210 addi r6,r3,-4
211 cmplwi 0,r5,4
212 blt 7f
213 stwu r4,4(r6)
214 beqlr
215 andi. r0,r6,3
216 add r5,r0,r5
217 subf r6,r0,r6
218 srwi r0,r5,2
219 mtctr r0
220 bdz 6f
2211: stwu r4,4(r6)
222 bdnz 1b
2236: andi. r5,r5,3
2247: cmpwi 0,r5,0
225 beqlr
226 mtctr r5
227 addi r6,r6,3
2288: stbu r4,1(r6)
229 bdnz 8b
230 blr
231
232/*
233 * This version uses dcbz on the complete cache lines in the
234 * destination area to reduce memory traffic. This requires that
235 * the destination area is cacheable.
236 * We only use this version if the source and dest don't overlap.
237 * -- paulus.
238 */
239_GLOBAL(cacheable_memcpy)
240 add r7,r3,r5 /* test if the src & dst overlap */
241 add r8,r4,r5
242 cmplw 0,r4,r7
243 cmplw 1,r3,r8
244 crand 0,0,4 /* cr0.lt &= cr1.lt */
245 blt memcpy /* if regions overlap */
246
247 addi r4,r4,-4
248 addi r6,r3,-4
249 neg r0,r3
250 andi. r0,r0,CACHELINE_MASK /* # bytes to start of cache line */
251 beq 58f
252
253 cmplw 0,r5,r0 /* is this more than total to do? */
254 blt 63f /* if not much to do */
255 andi. r8,r0,3 /* get it word-aligned first */
256 subf r5,r0,r5
257 mtctr r8
258 beq+ 61f
25970: lbz r9,4(r4) /* do some bytes */
260 stb r9,4(r6)
261 addi r4,r4,1
262 addi r6,r6,1
263 bdnz 70b
26461: srwi. r0,r0,2
265 mtctr r0
266 beq 58f
26772: lwzu r9,4(r4) /* do some words */
268 stwu r9,4(r6)
269 bdnz 72b
270
27158: srwi. r0,r5,LG_CACHELINE_BYTES /* # complete cachelines */
272 clrlwi r5,r5,32-LG_CACHELINE_BYTES
273 li r11,4
274 mtctr r0
275 beq 63f
27653:
277#if !defined(CONFIG_8xx)
278 dcbz r11,r6
279#endif
280 COPY_16_BYTES
281#if L1_CACHE_BYTES >= 32
282 COPY_16_BYTES
283#if L1_CACHE_BYTES >= 64
284 COPY_16_BYTES
285 COPY_16_BYTES
286#if L1_CACHE_BYTES >= 128
287 COPY_16_BYTES
288 COPY_16_BYTES
289 COPY_16_BYTES
290 COPY_16_BYTES
291#endif
292#endif
293#endif
294 bdnz 53b
295
29663: srwi. r0,r5,2
297 mtctr r0
298 beq 64f
29930: lwzu r0,4(r4)
300 stwu r0,4(r6)
301 bdnz 30b
302
30364: andi. r0,r5,3
304 mtctr r0
305 beq+ 65f
30640: lbz r0,4(r4)
307 stb r0,4(r6)
308 addi r4,r4,1
309 addi r6,r6,1
310 bdnz 40b
31165: blr
312
313_GLOBAL(memmove)
314 cmplw 0,r3,r4
315 bgt backwards_memcpy
316 /* fall through */
317
318_GLOBAL(memcpy)
319 srwi. r7,r5,3
320 addi r6,r3,-4
321 addi r4,r4,-4
322 beq 2f /* if less than 8 bytes to do */
323 andi. r0,r6,3 /* get dest word aligned */
324 mtctr r7
325 bne 5f
3261: lwz r7,4(r4)
327 lwzu r8,8(r4)
328 stw r7,4(r6)
329 stwu r8,8(r6)
330 bdnz 1b
331 andi. r5,r5,7
3322: cmplwi 0,r5,4
333 blt 3f
334 lwzu r0,4(r4)
335 addi r5,r5,-4
336 stwu r0,4(r6)
3373: cmpwi 0,r5,0
338 beqlr
339 mtctr r5
340 addi r4,r4,3
341 addi r6,r6,3
3424: lbzu r0,1(r4)
343 stbu r0,1(r6)
344 bdnz 4b
345 blr
3465: subfic r0,r0,4
347 mtctr r0
3486: lbz r7,4(r4)
349 addi r4,r4,1
350 stb r7,4(r6)
351 addi r6,r6,1
352 bdnz 6b
353 subf r5,r0,r5
354 rlwinm. r7,r5,32-3,3,31
355 beq 2b
356 mtctr r7
357 b 1b
358
359_GLOBAL(backwards_memcpy)
360 rlwinm. r7,r5,32-3,3,31 /* r0 = r5 >> 3 */
361 add r6,r3,r5
362 add r4,r4,r5
363 beq 2f
364 andi. r0,r6,3
365 mtctr r7
366 bne 5f
3671: lwz r7,-4(r4)
368 lwzu r8,-8(r4)
369 stw r7,-4(r6)
370 stwu r8,-8(r6)
371 bdnz 1b
372 andi. r5,r5,7
3732: cmplwi 0,r5,4
374 blt 3f
375 lwzu r0,-4(r4)
376 subi r5,r5,4
377 stwu r0,-4(r6)
3783: cmpwi 0,r5,0
379 beqlr
380 mtctr r5
3814: lbzu r0,-1(r4)
382 stbu r0,-1(r6)
383 bdnz 4b
384 blr
3855: mtctr r0
3866: lbzu r7,-1(r4)
387 stbu r7,-1(r6)
388 bdnz 6b
389 subf r5,r0,r5
390 rlwinm. r7,r5,32-3,3,31
391 beq 2b
392 mtctr r7
393 b 1b
394
395_GLOBAL(memcmp)
396 cmpwi 0,r5,0
397 ble- 2f
398 mtctr r5
399 addi r6,r3,-1
400 addi r4,r4,-1
4011: lbzu r3,1(r6)
402 lbzu r0,1(r4)
403 subf. r3,r0,r3
404 bdnzt 2,1b
405 blr
4062: li r3,0
407 blr
408
409_GLOBAL(memchr)
410 cmpwi 0,r5,0
411 ble- 2f
412 mtctr r5
413 addi r3,r3,-1
4141: lbzu r0,1(r3)
415 cmpw 0,r0,r4
416 bdnzf 2,1b
417 beqlr
4182: li r3,0
419 blr
420
421_GLOBAL(__copy_tofrom_user)
422 addi r4,r4,-4
423 addi r6,r3,-4
424 neg r0,r3
425 andi. r0,r0,CACHELINE_MASK /* # bytes to start of cache line */
426 beq 58f
427
428 cmplw 0,r5,r0 /* is this more than total to do? */
429 blt 63f /* if not much to do */
430 andi. r8,r0,3 /* get it word-aligned first */
431 mtctr r8
432 beq+ 61f
43370: lbz r9,4(r4) /* do some bytes */
43471: stb r9,4(r6)
435 addi r4,r4,1
436 addi r6,r6,1
437 bdnz 70b
43861: subf r5,r0,r5
439 srwi. r0,r0,2
440 mtctr r0
441 beq 58f
44272: lwzu r9,4(r4) /* do some words */
44373: stwu r9,4(r6)
444 bdnz 72b
445
446 .section __ex_table,"a"
447 .align 2
448 .long 70b,100f
449 .long 71b,101f
450 .long 72b,102f
451 .long 73b,103f
452 .text
453
45458: srwi. r0,r5,LG_CACHELINE_BYTES /* # complete cachelines */
455 clrlwi r5,r5,32-LG_CACHELINE_BYTES
456 li r11,4
457 beq 63f
458
459#ifdef CONFIG_8xx
460 /* Don't use prefetch on 8xx */
461 mtctr r0
462 li r0,0
46353: COPY_16_BYTES_WITHEX(0)
464 bdnz 53b
465
466#else /* not CONFIG_8xx */
467 /* Here we decide how far ahead to prefetch the source */
468 li r3,4
469 cmpwi r0,1
470 li r7,0
471 ble 114f
472 li r7,1
473#if MAX_COPY_PREFETCH > 1
474 /* Heuristically, for large transfers we prefetch
475 MAX_COPY_PREFETCH cachelines ahead. For small transfers
476 we prefetch 1 cacheline ahead. */
477 cmpwi r0,MAX_COPY_PREFETCH
478 ble 112f
479 li r7,MAX_COPY_PREFETCH
480112: mtctr r7
481111: dcbt r3,r4
482 addi r3,r3,CACHELINE_BYTES
483 bdnz 111b
484#else
485 dcbt r3,r4
486 addi r3,r3,CACHELINE_BYTES
487#endif /* MAX_COPY_PREFETCH > 1 */
488
489114: subf r8,r7,r0
490 mr r0,r7
491 mtctr r8
492
49353: dcbt r3,r4
49454: dcbz r11,r6
495 .section __ex_table,"a"
496 .align 2
497 .long 54b,105f
498 .text
499/* the main body of the cacheline loop */
500 COPY_16_BYTES_WITHEX(0)
501#if L1_CACHE_BYTES >= 32
502 COPY_16_BYTES_WITHEX(1)
503#if L1_CACHE_BYTES >= 64
504 COPY_16_BYTES_WITHEX(2)
505 COPY_16_BYTES_WITHEX(3)
506#if L1_CACHE_BYTES >= 128
507 COPY_16_BYTES_WITHEX(4)
508 COPY_16_BYTES_WITHEX(5)
509 COPY_16_BYTES_WITHEX(6)
510 COPY_16_BYTES_WITHEX(7)
511#endif
512#endif
513#endif
514 bdnz 53b
515 cmpwi r0,0
516 li r3,4
517 li r7,0
518 bne 114b
519#endif /* CONFIG_8xx */
520
52163: srwi. r0,r5,2
522 mtctr r0
523 beq 64f
52430: lwzu r0,4(r4)
52531: stwu r0,4(r6)
526 bdnz 30b
527
52864: andi. r0,r5,3
529 mtctr r0
530 beq+ 65f
53140: lbz r0,4(r4)
53241: stb r0,4(r6)
533 addi r4,r4,1
534 addi r6,r6,1
535 bdnz 40b
53665: li r3,0
537 blr
538
539/* read fault, initial single-byte copy */
540100: li r9,0
541 b 90f
542/* write fault, initial single-byte copy */
543101: li r9,1
54490: subf r5,r8,r5
545 li r3,0
546 b 99f
547/* read fault, initial word copy */
548102: li r9,0
549 b 91f
550/* write fault, initial word copy */
551103: li r9,1
55291: li r3,2
553 b 99f
554
555/*
556 * this stuff handles faults in the cacheline loop and branches to either
557 * 104f (if in read part) or 105f (if in write part), after updating r5
558 */
559 COPY_16_BYTES_EXCODE(0)
560#if L1_CACHE_BYTES >= 32
561 COPY_16_BYTES_EXCODE(1)
562#if L1_CACHE_BYTES >= 64
563 COPY_16_BYTES_EXCODE(2)
564 COPY_16_BYTES_EXCODE(3)
565#if L1_CACHE_BYTES >= 128
566 COPY_16_BYTES_EXCODE(4)
567 COPY_16_BYTES_EXCODE(5)
568 COPY_16_BYTES_EXCODE(6)
569 COPY_16_BYTES_EXCODE(7)
570#endif
571#endif
572#endif
573
574/* read fault in cacheline loop */
575104: li r9,0
576 b 92f
577/* fault on dcbz (effectively a write fault) */
578/* or write fault in cacheline loop */
579105: li r9,1
58092: li r3,LG_CACHELINE_BYTES
581 mfctr r8
582 add r0,r0,r8
583 b 106f
584/* read fault in final word loop */
585108: li r9,0
586 b 93f
587/* write fault in final word loop */
588109: li r9,1
58993: andi. r5,r5,3
590 li r3,2
591 b 99f
592/* read fault in final byte loop */
593110: li r9,0
594 b 94f
595/* write fault in final byte loop */
596111: li r9,1
59794: li r5,0
598 li r3,0
599/*
600 * At this stage the number of bytes not copied is
601 * r5 + (ctr << r3), and r9 is 0 for read or 1 for write.
602 */
60399: mfctr r0
604106: slw r3,r0,r3
605 add. r3,r3,r5
606 beq 120f /* shouldn't happen */
607 cmpwi 0,r9,0
608 bne 120f
609/* for a read fault, first try to continue the copy one byte at a time */
610 mtctr r3
611130: lbz r0,4(r4)
612131: stb r0,4(r6)
613 addi r4,r4,1
614 addi r6,r6,1
615 bdnz 130b
616/* then clear out the destination: r3 bytes starting at 4(r6) */
617132: mfctr r3
618 srwi. r0,r3,2
619 li r9,0
620 mtctr r0
621 beq 113f
622112: stwu r9,4(r6)
623 bdnz 112b
624113: andi. r0,r3,3
625 mtctr r0
626 beq 120f
627114: stb r9,4(r6)
628 addi r6,r6,1
629 bdnz 114b
630120: blr
631
632 .section __ex_table,"a"
633 .align 2
634 .long 30b,108b
635 .long 31b,109b
636 .long 40b,110b
637 .long 41b,111b
638 .long 130b,132b
639 .long 131b,120b
640 .long 112b,120b
641 .long 114b,120b
642 .text
643
644_GLOBAL(__clear_user)
645 addi r6,r3,-4
646 li r3,0
647 li r5,0
648 cmplwi 0,r4,4
649 blt 7f
650 /* clear a single word */
65111: stwu r5,4(r6)
652 beqlr
653 /* clear word sized chunks */
654 andi. r0,r6,3
655 add r4,r0,r4
656 subf r6,r0,r6
657 srwi r0,r4,2
658 andi. r4,r4,3
659 mtctr r0
660 bdz 7f
6611: stwu r5,4(r6)
662 bdnz 1b
663 /* clear byte sized chunks */
6647: cmpwi 0,r4,0
665 beqlr
666 mtctr r4
667 addi r6,r6,3
6688: stbu r5,1(r6)
669 bdnz 8b
670 blr
67190: mr r3,r4
672 blr
67391: mfctr r3
674 slwi r3,r3,2
675 add r3,r3,r4
676 blr
67792: mfctr r3
678 blr
679
680 .section __ex_table,"a"
681 .align 2
682 .long 11b,90b
683 .long 1b,91b
684 .long 8b,92b
685 .text
686
687_GLOBAL(__strncpy_from_user)
688 addi r6,r3,-1
689 addi r4,r4,-1
690 cmpwi 0,r5,0
691 beq 2f
692 mtctr r5
6931: lbzu r0,1(r4)
694 cmpwi 0,r0,0
695 stbu r0,1(r6)
696 bdnzf 2,1b /* dec ctr, branch if ctr != 0 && !cr0.eq */
697 beq 3f
6982: addi r6,r6,1
6993: subf r3,r3,r6
700 blr
70199: li r3,-EFAULT
702 blr
703
704 .section __ex_table,"a"
705 .align 2
706 .long 1b,99b
707 .text
708
709/* r3 = str, r4 = len (> 0), r5 = top (highest addr) */
710_GLOBAL(__strnlen_user)
711 addi r7,r3,-1
712 subf r6,r7,r5 /* top+1 - str */
713 cmplw 0,r4,r6
714 bge 0f
715 mr r6,r4
7160: mtctr r6 /* ctr = min(len, top - str) */
7171: lbzu r0,1(r7) /* get next byte */
718 cmpwi 0,r0,0
719 bdnzf 2,1b /* loop if --ctr != 0 && byte != 0 */
720 addi r7,r7,1
721 subf r3,r3,r7 /* number of bytes we have looked at */
722 beqlr /* return if we found a 0 byte */
723 cmpw 0,r3,r4 /* did we look at all len bytes? */
724 blt 99f /* if not, must have hit top */
725 addi r3,r4,1 /* return len + 1 to indicate no null found */
726 blr
72799: li r3,0 /* bad address, return 0 */
728 blr
729
730 .section __ex_table,"a"
731 .align 2
732 .long 1b,99b
diff --git a/arch/ppc/mm/44x_mmu.c b/arch/ppc/mm/44x_mmu.c
deleted file mode 100644
index fbb577a0d165..000000000000
--- a/arch/ppc/mm/44x_mmu.c
+++ /dev/null
@@ -1,101 +0,0 @@
1/*
2 * Modifications by Matt Porter (mporter@mvista.com) to support
3 * PPC44x Book E processors.
4 *
5 * This file contains the routines for initializing the MMU
6 * on the 4xx series of chips.
7 * -- paulus
8 *
9 * Derived from arch/ppc/mm/init.c:
10 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
11 *
12 * Modifications by Paul Mackerras (PowerMac) (paulus@cs.anu.edu.au)
13 * and Cort Dougan (PReP) (cort@cs.nmt.edu)
14 * Copyright (C) 1996 Paul Mackerras
15 * Amiga/APUS changes by Jesper Skov (jskov@cygnus.co.uk).
16 *
17 * Derived from "arch/i386/mm/init.c"
18 * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds
19 *
20 * This program is free software; you can redistribute it and/or
21 * modify it under the terms of the GNU General Public License
22 * as published by the Free Software Foundation; either version
23 * 2 of the License, or (at your option) any later version.
24 *
25 */
26
27#include <linux/signal.h>
28#include <linux/sched.h>
29#include <linux/kernel.h>
30#include <linux/errno.h>
31#include <linux/string.h>
32#include <linux/types.h>
33#include <linux/ptrace.h>
34#include <linux/mman.h>
35#include <linux/mm.h>
36#include <linux/swap.h>
37#include <linux/stddef.h>
38#include <linux/vmalloc.h>
39#include <linux/init.h>
40#include <linux/delay.h>
41#include <linux/highmem.h>
42
43#include <asm/pgalloc.h>
44#include <asm/prom.h>
45#include <asm/io.h>
46#include <asm/mmu_context.h>
47#include <asm/pgtable.h>
48#include <asm/mmu.h>
49#include <asm/uaccess.h>
50#include <asm/smp.h>
51#include <asm/bootx.h>
52#include <asm/machdep.h>
53#include <asm/setup.h>
54
55#include "mmu_decl.h"
56
57extern char etext[], _stext[];
58
59/* Used by the 44x TLB replacement exception handler.
60 * Just needed it declared someplace.
61 */
62unsigned int tlb_44x_index = 0;
63unsigned int tlb_44x_hwater = PPC4XX_TLB_SIZE - 1 - PPC44x_EARLY_TLBS;
64int icache_44x_need_flush;
65
66/*
67 * "Pins" a 256MB TLB entry in AS0 for kernel lowmem
68 */
69static void __init ppc44x_pin_tlb(unsigned int virt, unsigned int phys)
70{
71 __asm__ __volatile__(
72 "tlbwe %2,%3,%4\n"
73 "tlbwe %1,%3,%5\n"
74 "tlbwe %0,%3,%6\n"
75 :
76 : "r" (PPC44x_TLB_SW | PPC44x_TLB_SR | PPC44x_TLB_SX | PPC44x_TLB_G),
77 "r" (phys),
78 "r" (virt | PPC44x_TLB_VALID | PPC44x_TLB_256M),
79 "r" (tlb_44x_hwater--), /* slot for this TLB entry */
80 "i" (PPC44x_TLB_PAGEID),
81 "i" (PPC44x_TLB_XLAT),
82 "i" (PPC44x_TLB_ATTRIB));
83}
84
85void __init MMU_init_hw(void)
86{
87 flush_instruction_cache();
88}
89
90unsigned long __init mmu_mapin_ram(void)
91{
92 unsigned long addr;
93
94 /* Pin in enough TLBs to cover any lowmem not covered by the
95 * initial 256M mapping established in head_44x.S */
96 for (addr = PPC_PIN_SIZE; addr < total_lowmem;
97 addr += PPC_PIN_SIZE)
98 ppc44x_pin_tlb(addr + PAGE_OFFSET, addr);
99
100 return total_lowmem;
101}
diff --git a/arch/ppc/mm/4xx_mmu.c b/arch/ppc/mm/4xx_mmu.c
deleted file mode 100644
index ea785dbaac7c..000000000000
--- a/arch/ppc/mm/4xx_mmu.c
+++ /dev/null
@@ -1,135 +0,0 @@
1/*
2 * This file contains the routines for initializing the MMU
3 * on the 4xx series of chips.
4 * -- paulus
5 *
6 * Derived from arch/ppc/mm/init.c:
7 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
8 *
9 * Modifications by Paul Mackerras (PowerMac) (paulus@cs.anu.edu.au)
10 * and Cort Dougan (PReP) (cort@cs.nmt.edu)
11 * Copyright (C) 1996 Paul Mackerras
12 * Amiga/APUS changes by Jesper Skov (jskov@cygnus.co.uk).
13 *
14 * Derived from "arch/i386/mm/init.c"
15 * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds
16 *
17 * This program is free software; you can redistribute it and/or
18 * modify it under the terms of the GNU General Public License
19 * as published by the Free Software Foundation; either version
20 * 2 of the License, or (at your option) any later version.
21 *
22 */
23
24#include <linux/signal.h>
25#include <linux/sched.h>
26#include <linux/kernel.h>
27#include <linux/errno.h>
28#include <linux/string.h>
29#include <linux/types.h>
30#include <linux/ptrace.h>
31#include <linux/mman.h>
32#include <linux/mm.h>
33#include <linux/swap.h>
34#include <linux/stddef.h>
35#include <linux/vmalloc.h>
36#include <linux/init.h>
37#include <linux/delay.h>
38#include <linux/highmem.h>
39
40#include <asm/pgalloc.h>
41#include <asm/prom.h>
42#include <asm/io.h>
43#include <asm/mmu_context.h>
44#include <asm/pgtable.h>
45#include <asm/mmu.h>
46#include <asm/uaccess.h>
47#include <asm/smp.h>
48#include <asm/bootx.h>
49#include <asm/machdep.h>
50#include <asm/setup.h>
51#include "mmu_decl.h"
52
53extern int __map_without_ltlbs;
54/*
55 * MMU_init_hw does the chip-specific initialization of the MMU hardware.
56 */
57void __init MMU_init_hw(void)
58{
59 /*
60 * The Zone Protection Register (ZPR) defines how protection will
61 * be applied to every page which is a member of a given zone. At
62 * present, we utilize only two of the 4xx's zones.
63 * The zone index bits (of ZSEL) in the PTE are used for software
64 * indicators, except the LSB. For user access, zone 1 is used,
65 * for kernel access, zone 0 is used. We set all but zone 1
66 * to zero, allowing only kernel access as indicated in the PTE.
67 * For zone 1, we set a 01 binary (a value of 10 will not work)
68 * to allow user access as indicated in the PTE. This also allows
69 * kernel access as indicated in the PTE.
70 */
71
72 mtspr(SPRN_ZPR, 0x10000000);
73
74 flush_instruction_cache();
75
76 /*
77 * Set up the real-mode cache parameters for the exception vector
78 * handlers (which are run in real-mode).
79 */
80
81 mtspr(SPRN_DCWR, 0x00000000); /* All caching is write-back */
82
83 /*
84 * Cache instruction and data space where the exception
85 * vectors and the kernel live in real-mode.
86 */
87
88 mtspr(SPRN_DCCR, 0xF0000000); /* 512 MB of data space at 0x0. */
89 mtspr(SPRN_ICCR, 0xF0000000); /* 512 MB of instr. space at 0x0. */
90}
91
92#define LARGE_PAGE_SIZE_16M (1<<24)
93#define LARGE_PAGE_SIZE_4M (1<<22)
94
95unsigned long __init mmu_mapin_ram(void)
96{
97 unsigned long v, s;
98 phys_addr_t p;
99
100 v = KERNELBASE;
101 p = PPC_MEMSTART;
102 s = total_lowmem;
103
104 if (__map_without_ltlbs)
105 return 0;
106
107 while (s >= LARGE_PAGE_SIZE_16M) {
108 pmd_t *pmdp;
109 unsigned long val = p | _PMD_SIZE_16M | _PAGE_HWEXEC | _PAGE_HWWRITE;
110
111 pmdp = pmd_offset(pgd_offset_k(v), v);
112 pmd_val(*pmdp++) = val;
113 pmd_val(*pmdp++) = val;
114 pmd_val(*pmdp++) = val;
115 pmd_val(*pmdp++) = val;
116
117 v += LARGE_PAGE_SIZE_16M;
118 p += LARGE_PAGE_SIZE_16M;
119 s -= LARGE_PAGE_SIZE_16M;
120 }
121
122 while (s >= LARGE_PAGE_SIZE_4M) {
123 pmd_t *pmdp;
124 unsigned long val = p | _PMD_SIZE_4M | _PAGE_HWEXEC | _PAGE_HWWRITE;
125
126 pmdp = pmd_offset(pgd_offset_k(v), v);
127 pmd_val(*pmdp) = val;
128
129 v += LARGE_PAGE_SIZE_4M;
130 p += LARGE_PAGE_SIZE_4M;
131 s -= LARGE_PAGE_SIZE_4M;
132 }
133
134 return total_lowmem - s;
135}
diff --git a/arch/ppc/mm/Makefile b/arch/ppc/mm/Makefile
deleted file mode 100644
index 691ba2bae05d..000000000000
--- a/arch/ppc/mm/Makefile
+++ /dev/null
@@ -1,10 +0,0 @@
1#
2# Makefile for the linux ppc-specific parts of the memory manager.
3#
4
5obj-y := fault.o init.o mem_pieces.o \
6 mmu_context.o pgtable.o
7
8obj-$(CONFIG_PPC_STD_MMU) += hashtable.o ppc_mmu.o tlb.o
9obj-$(CONFIG_40x) += 4xx_mmu.o
10obj-$(CONFIG_44x) += 44x_mmu.o
diff --git a/arch/ppc/mm/fault.c b/arch/ppc/mm/fault.c
deleted file mode 100644
index 36c0e7529edb..000000000000
--- a/arch/ppc/mm/fault.c
+++ /dev/null
@@ -1,436 +0,0 @@
1/*
2 * PowerPC version
3 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
4 *
5 * Derived from "arch/i386/mm/fault.c"
6 * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds
7 *
8 * Modified by Cort Dougan and Paul Mackerras.
9 *
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version
13 * 2 of the License, or (at your option) any later version.
14 */
15
16#include <linux/signal.h>
17#include <linux/sched.h>
18#include <linux/kernel.h>
19#include <linux/errno.h>
20#include <linux/string.h>
21#include <linux/types.h>
22#include <linux/ptrace.h>
23#include <linux/mman.h>
24#include <linux/mm.h>
25#include <linux/interrupt.h>
26#include <linux/highmem.h>
27#include <linux/module.h>
28
29#include <asm/page.h>
30#include <asm/pgtable.h>
31#include <asm/mmu.h>
32#include <asm/mmu_context.h>
33#include <asm/system.h>
34#include <asm/uaccess.h>
35#include <asm/tlbflush.h>
36
37#if defined(CONFIG_XMON) || defined(CONFIG_KGDB)
38extern void (*debugger)(struct pt_regs *);
39extern void (*debugger_fault_handler)(struct pt_regs *);
40extern int (*debugger_dabr_match)(struct pt_regs *);
41int debugger_kernel_faults = 1;
42#endif
43
44unsigned long htab_reloads; /* updated by hashtable.S:hash_page() */
45unsigned long htab_evicts; /* updated by hashtable.S:hash_page() */
46unsigned long htab_preloads; /* updated by hashtable.S:add_hash_page() */
47unsigned long pte_misses; /* updated by do_page_fault() */
48unsigned long pte_errors; /* updated by do_page_fault() */
49unsigned int probingmem;
50
51/*
52 * Check whether the instruction at regs->nip is a store using
53 * an update addressing form which will update r1.
54 */
55static int store_updates_sp(struct pt_regs *regs)
56{
57 unsigned int inst;
58
59 if (get_user(inst, (unsigned int __user *)regs->nip))
60 return 0;
61 /* check for 1 in the rA field */
62 if (((inst >> 16) & 0x1f) != 1)
63 return 0;
64 /* check major opcode */
65 switch (inst >> 26) {
66 case 37: /* stwu */
67 case 39: /* stbu */
68 case 45: /* sthu */
69 case 53: /* stfsu */
70 case 55: /* stfdu */
71 return 1;
72 case 31:
73 /* check minor opcode */
74 switch ((inst >> 1) & 0x3ff) {
75 case 183: /* stwux */
76 case 247: /* stbux */
77 case 439: /* sthux */
78 case 695: /* stfsux */
79 case 759: /* stfdux */
80 return 1;
81 }
82 }
83 return 0;
84}
85
86/*
87 * For 600- and 800-family processors, the error_code parameter is DSISR
88 * for a data fault, SRR1 for an instruction fault. For 400-family processors
89 * the error_code parameter is ESR for a data fault, 0 for an instruction
90 * fault.
91 */
92int do_page_fault(struct pt_regs *regs, unsigned long address,
93 unsigned long error_code)
94{
95 struct vm_area_struct * vma;
96 struct mm_struct *mm = current->mm;
97 siginfo_t info;
98 int code = SEGV_MAPERR;
99 int fault;
100#if defined(CONFIG_4xx) || defined (CONFIG_BOOKE)
101 int is_write = error_code & ESR_DST;
102#else
103 int is_write = 0;
104
105 /*
106 * Fortunately the bit assignments in SRR1 for an instruction
107 * fault and DSISR for a data fault are mostly the same for the
108 * bits we are interested in. But there are some bits which
109 * indicate errors in DSISR but can validly be set in SRR1.
110 */
111 if (TRAP(regs) == 0x400)
112 error_code &= 0x48200000;
113 else
114 is_write = error_code & 0x02000000;
115#endif /* CONFIG_4xx || CONFIG_BOOKE */
116
117#if defined(CONFIG_XMON) || defined(CONFIG_KGDB)
118 if (debugger_fault_handler && TRAP(regs) == 0x300) {
119 debugger_fault_handler(regs);
120 return 0;
121 }
122#if !(defined(CONFIG_4xx) || defined(CONFIG_BOOKE))
123 if (error_code & 0x00400000) {
124 /* DABR match */
125 if (debugger_dabr_match(regs))
126 return 0;
127 }
128#endif /* !(CONFIG_4xx || CONFIG_BOOKE)*/
129#endif /* CONFIG_XMON || CONFIG_KGDB */
130
131 if (in_atomic() || mm == NULL)
132 return SIGSEGV;
133
134 down_read(&mm->mmap_sem);
135 vma = find_vma(mm, address);
136 if (!vma)
137 goto bad_area;
138 if (vma->vm_start <= address)
139 goto good_area;
140 if (!(vma->vm_flags & VM_GROWSDOWN))
141 goto bad_area;
142 if (!is_write)
143 goto bad_area;
144
145 /*
146 * N.B. The rs6000/xcoff ABI allows programs to access up to
147 * a few hundred bytes below the stack pointer.
148 * The kernel signal delivery code writes up to about 1.5kB
149 * below the stack pointer (r1) before decrementing it.
150 * The exec code can write slightly over 640kB to the stack
151 * before setting the user r1. Thus we allow the stack to
152 * expand to 1MB without further checks.
153 */
154 if (address + 0x100000 < vma->vm_end) {
155 /* get user regs even if this fault is in kernel mode */
156 struct pt_regs *uregs = current->thread.regs;
157 if (uregs == NULL)
158 goto bad_area;
159
160 /*
161 * A user-mode access to an address a long way below
162 * the stack pointer is only valid if the instruction
163 * is one which would update the stack pointer to the
164 * address accessed if the instruction completed,
165 * i.e. either stwu rs,n(r1) or stwux rs,r1,rb
166 * (or the byte, halfword, float or double forms).
167 *
168 * If we don't check this then any write to the area
169 * between the last mapped region and the stack will
170 * expand the stack rather than segfaulting.
171 */
172 if (address + 2048 < uregs->gpr[1]
173 && (!user_mode(regs) || !store_updates_sp(regs)))
174 goto bad_area;
175 }
176 if (expand_stack(vma, address))
177 goto bad_area;
178
179good_area:
180 code = SEGV_ACCERR;
181#if defined(CONFIG_6xx)
182 if (error_code & 0x95700000)
183 /* an error such as lwarx to I/O controller space,
184 address matching DABR, eciwx, etc. */
185 goto bad_area;
186#endif /* CONFIG_6xx */
187#if defined(CONFIG_8xx)
188 /* The MPC8xx seems to always set 0x80000000, which is
189 * "undefined". Of those that can be set, this is the only
190 * one which seems bad.
191 */
192 if (error_code & 0x10000000)
193 /* Guarded storage error. */
194 goto bad_area;
195#endif /* CONFIG_8xx */
196
197 /* a write */
198 if (is_write) {
199 if (!(vma->vm_flags & VM_WRITE))
200 goto bad_area;
201#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE)
202 /* an exec - 4xx/Book-E allows for per-page execute permission */
203 } else if (TRAP(regs) == 0x400) {
204 pte_t *ptep;
205 pmd_t *pmdp;
206
207#if 0
208 /* It would be nice to actually enforce the VM execute
209 permission on CPUs which can do so, but far too
210 much stuff in userspace doesn't get the permissions
211 right, so we let any page be executed for now. */
212 if (! (vma->vm_flags & VM_EXEC))
213 goto bad_area;
214#endif
215
216 /* Since 4xx/Book-E supports per-page execute permission,
217 * we lazily flush dcache to icache. */
218 ptep = NULL;
219 if (get_pteptr(mm, address, &ptep, &pmdp)) {
220 spinlock_t *ptl = pte_lockptr(mm, pmdp);
221 spin_lock(ptl);
222 if (pte_present(*ptep)) {
223 struct page *page = pte_page(*ptep);
224
225 if (!test_bit(PG_arch_1, &page->flags)) {
226 flush_dcache_icache_page(page);
227 set_bit(PG_arch_1, &page->flags);
228 }
229 pte_update(ptep, 0, _PAGE_HWEXEC);
230 _tlbie(address, mm->context.id);
231 pte_unmap_unlock(ptep, ptl);
232 up_read(&mm->mmap_sem);
233 return 0;
234 }
235 pte_unmap_unlock(ptep, ptl);
236 }
237#endif
238 /* a read */
239 } else {
240 /* protection fault */
241 if (error_code & 0x08000000)
242 goto bad_area;
243 if (!(vma->vm_flags & (VM_READ | VM_EXEC | VM_WRITE)))
244 goto bad_area;
245 }
246
247 /*
248 * If for any reason at all we couldn't handle the fault,
249 * make sure we exit gracefully rather than endlessly redo
250 * the fault.
251 */
252 survive:
253 fault = handle_mm_fault(mm, vma, address, is_write);
254 if (unlikely(fault & VM_FAULT_ERROR)) {
255 if (fault & VM_FAULT_OOM)
256 goto out_of_memory;
257 else if (fault & VM_FAULT_SIGBUS)
258 goto do_sigbus;
259 BUG();
260 }
261 if (fault & VM_FAULT_MAJOR)
262 current->maj_flt++;
263 else
264 current->min_flt++;
265
266 up_read(&mm->mmap_sem);
267 /*
268 * keep track of tlb+htab misses that are good addrs but
269 * just need pte's created via handle_mm_fault()
270 * -- Cort
271 */
272 pte_misses++;
273 return 0;
274
275bad_area:
276 up_read(&mm->mmap_sem);
277 pte_errors++;
278
279 /* User mode accesses cause a SIGSEGV */
280 if (user_mode(regs)) {
281 _exception(SIGSEGV, regs, code, address);
282 return 0;
283 }
284
285 return SIGSEGV;
286
287/*
288 * We ran out of memory, or some other thing happened to us that made
289 * us unable to handle the page fault gracefully.
290 */
291out_of_memory:
292 up_read(&mm->mmap_sem);
293 if (is_global_init(current)) {
294 yield();
295 down_read(&mm->mmap_sem);
296 goto survive;
297 }
298 printk("VM: killing process %s\n", current->comm);
299 if (user_mode(regs))
300 do_group_exit(SIGKILL);
301 return SIGKILL;
302
303do_sigbus:
304 up_read(&mm->mmap_sem);
305 info.si_signo = SIGBUS;
306 info.si_errno = 0;
307 info.si_code = BUS_ADRERR;
308 info.si_addr = (void __user *)address;
309 force_sig_info (SIGBUS, &info, current);
310 if (!user_mode(regs))
311 return SIGBUS;
312 return 0;
313}
314
315/*
316 * bad_page_fault is called when we have a bad access from the kernel.
317 * It is called from the DSI and ISI handlers in head.S and from some
318 * of the procedures in traps.c.
319 */
320void
321bad_page_fault(struct pt_regs *regs, unsigned long address, int sig)
322{
323 const struct exception_table_entry *entry;
324
325 /* Are we prepared to handle this fault? */
326 if ((entry = search_exception_tables(regs->nip)) != NULL) {
327 regs->nip = entry->fixup;
328 return;
329 }
330
331 /* kernel has accessed a bad area */
332#if defined(CONFIG_XMON) || defined(CONFIG_KGDB)
333 if (debugger_kernel_faults)
334 debugger(regs);
335#endif
336 die("kernel access of bad area", regs, sig);
337}
338
339#ifdef CONFIG_8xx
340
341/* The pgtable.h claims some functions generically exist, but I
342 * can't find them......
343 */
344pte_t *va_to_pte(unsigned long address)
345{
346 pgd_t *dir;
347 pmd_t *pmd;
348 pte_t *pte;
349
350 if (address < TASK_SIZE)
351 return NULL;
352
353 dir = pgd_offset(&init_mm, address);
354 if (dir) {
355 pmd = pmd_offset(dir, address & PAGE_MASK);
356 if (pmd && pmd_present(*pmd)) {
357 pte = pte_offset_kernel(pmd, address & PAGE_MASK);
358 if (pte && pte_present(*pte))
359 return(pte);
360 }
361 }
362 return NULL;
363}
364
365unsigned long va_to_phys(unsigned long address)
366{
367 pte_t *pte;
368
369 pte = va_to_pte(address);
370 if (pte)
371 return(((unsigned long)(pte_val(*pte)) & PAGE_MASK) | (address & ~(PAGE_MASK)));
372 return (0);
373}
374
375void
376print_8xx_pte(struct mm_struct *mm, unsigned long addr)
377{
378 pgd_t * pgd;
379 pmd_t * pmd;
380 pte_t * pte;
381
382 printk(" pte @ 0x%8lx: ", addr);
383 pgd = pgd_offset(mm, addr & PAGE_MASK);
384 if (pgd) {
385 pmd = pmd_offset(pgd, addr & PAGE_MASK);
386 if (pmd && pmd_present(*pmd)) {
387 pte = pte_offset_kernel(pmd, addr & PAGE_MASK);
388 if (pte) {
389 printk(" (0x%08lx)->(0x%08lx)->0x%08lx\n",
390 (long)pgd, (long)pte, (long)pte_val(*pte));
391#define pp ((long)pte_val(*pte))
392 printk(" RPN: %05lx PP: %lx SPS: %lx SH: %lx "
393 "CI: %lx v: %lx\n",
394 pp>>12, /* rpn */
395 (pp>>10)&3, /* pp */
396 (pp>>3)&1, /* small */
397 (pp>>2)&1, /* shared */
398 (pp>>1)&1, /* cache inhibit */
399 pp&1 /* valid */
400 );
401#undef pp
402 }
403 else {
404 printk("no pte\n");
405 }
406 }
407 else {
408 printk("no pmd\n");
409 }
410 }
411 else {
412 printk("no pgd\n");
413 }
414}
415
416int
417get_8xx_pte(struct mm_struct *mm, unsigned long addr)
418{
419 pgd_t * pgd;
420 pmd_t * pmd;
421 pte_t * pte;
422 int retval = 0;
423
424 pgd = pgd_offset(mm, addr & PAGE_MASK);
425 if (pgd) {
426 pmd = pmd_offset(pgd, addr & PAGE_MASK);
427 if (pmd && pmd_present(*pmd)) {
428 pte = pte_offset_kernel(pmd, addr & PAGE_MASK);
429 if (pte) {
430 retval = (int)pte_val(*pte);
431 }
432 }
433 }
434 return(retval);
435}
436#endif /* CONFIG_8xx */
diff --git a/arch/ppc/mm/hashtable.S b/arch/ppc/mm/hashtable.S
deleted file mode 100644
index 5f364dc50154..000000000000
--- a/arch/ppc/mm/hashtable.S
+++ /dev/null
@@ -1,617 +0,0 @@
1/*
2 * $Id: hashtable.S,v 1.6 1999/10/08 01:56:15 paulus Exp $
3 *
4 * PowerPC version
5 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
6 * Rewritten by Cort Dougan (cort@cs.nmt.edu) for PReP
7 * Copyright (C) 1996 Cort Dougan <cort@cs.nmt.edu>
8 * Adapted for Power Macintosh by Paul Mackerras.
9 * Low-level exception handlers and MMU support
10 * rewritten by Paul Mackerras.
11 * Copyright (C) 1996 Paul Mackerras.
12 *
13 * This file contains low-level assembler routines for managing
14 * the PowerPC MMU hash table. (PPC 8xx processors don't use a
15 * hash table, so this file is not used on them.)
16 *
17 * This program is free software; you can redistribute it and/or
18 * modify it under the terms of the GNU General Public License
19 * as published by the Free Software Foundation; either version
20 * 2 of the License, or (at your option) any later version.
21 *
22 */
23
24#include <asm/processor.h>
25#include <asm/page.h>
26#include <asm/pgtable.h>
27#include <asm/cputable.h>
28#include <asm/ppc_asm.h>
29#include <asm/thread_info.h>
30#include <asm/asm-offsets.h>
31
32#ifdef CONFIG_SMP
33 .section .bss
34 .align 2
35 .globl mmu_hash_lock
36mmu_hash_lock:
37 .space 4
38#endif /* CONFIG_SMP */
39
40/*
41 * Sync CPUs with hash_page taking & releasing the hash
42 * table lock
43 */
44#ifdef CONFIG_SMP
45 .text
46_GLOBAL(hash_page_sync)
47 lis r8,mmu_hash_lock@h
48 ori r8,r8,mmu_hash_lock@l
49 lis r0,0x0fff
50 b 10f
5111: lwz r6,0(r8)
52 cmpwi 0,r6,0
53 bne 11b
5410: lwarx r6,0,r8
55 cmpwi 0,r6,0
56 bne- 11b
57 stwcx. r0,0,r8
58 bne- 10b
59 isync
60 eieio
61 li r0,0
62 stw r0,0(r8)
63 blr
64#endif
65
66/*
67 * Load a PTE into the hash table, if possible.
68 * The address is in r4, and r3 contains an access flag:
69 * _PAGE_RW (0x400) if a write.
70 * r9 contains the SRR1 value, from which we use the MSR_PR bit.
71 * SPRG3 contains the physical address of the current task's thread.
72 *
73 * Returns to the caller if the access is illegal or there is no
74 * mapping for the address. Otherwise it places an appropriate PTE
75 * in the hash table and returns from the exception.
76 * Uses r0, r3 - r8, ctr, lr.
77 */
78 .text
79_GLOBAL(hash_page)
80 tophys(r7,0) /* gets -KERNELBASE into r7 */
81#ifdef CONFIG_SMP
82 addis r8,r7,mmu_hash_lock@h
83 ori r8,r8,mmu_hash_lock@l
84 lis r0,0x0fff
85 b 10f
8611: lwz r6,0(r8)
87 cmpwi 0,r6,0
88 bne 11b
8910: lwarx r6,0,r8
90 cmpwi 0,r6,0
91 bne- 11b
92 stwcx. r0,0,r8
93 bne- 10b
94 isync
95#endif
96 /* Get PTE (linux-style) and check access */
97 lis r0,KERNELBASE@h /* check if kernel address */
98 cmplw 0,r4,r0
99 mfspr r8,SPRN_SPRG3 /* current task's THREAD (phys) */
100 ori r3,r3,_PAGE_USER|_PAGE_PRESENT /* test low addresses as user */
101 lwz r5,PGDIR(r8) /* virt page-table root */
102 blt+ 112f /* assume user more likely */
103 lis r5,swapper_pg_dir@ha /* if kernel address, use */
104 addi r5,r5,swapper_pg_dir@l /* kernel page table */
105 rlwimi r3,r9,32-12,29,29 /* MSR_PR -> _PAGE_USER */
106112: add r5,r5,r7 /* convert to phys addr */
107 rlwimi r5,r4,12,20,29 /* insert top 10 bits of address */
108 lwz r8,0(r5) /* get pmd entry */
109 rlwinm. r8,r8,0,0,19 /* extract address of pte page */
110#ifdef CONFIG_SMP
111 beq- hash_page_out /* return if no mapping */
112#else
113 /* XXX it seems like the 601 will give a machine fault on the
114 rfi if its alignment is wrong (bottom 4 bits of address are
115 8 or 0xc) and we have had a not-taken conditional branch
116 to the address following the rfi. */
117 beqlr-
118#endif
119 rlwimi r8,r4,22,20,29 /* insert next 10 bits of address */
120 rlwinm r0,r3,32-3,24,24 /* _PAGE_RW access -> _PAGE_DIRTY */
121 ori r0,r0,_PAGE_ACCESSED|_PAGE_HASHPTE
122
123 /*
124 * Update the linux PTE atomically. We do the lwarx up-front
125 * because almost always, there won't be a permission violation
126 * and there won't already be an HPTE, and thus we will have
127 * to update the PTE to set _PAGE_HASHPTE. -- paulus.
128 */
129retry:
130 lwarx r6,0,r8 /* get linux-style pte */
131 andc. r5,r3,r6 /* check access & ~permission */
132#ifdef CONFIG_SMP
133 bne- hash_page_out /* return if access not permitted */
134#else
135 bnelr-
136#endif
137 or r5,r0,r6 /* set accessed/dirty bits */
138 stwcx. r5,0,r8 /* attempt to update PTE */
139 bne- retry /* retry if someone got there first */
140
141 mfsrin r3,r4 /* get segment reg for segment */
142 mfctr r0
143 stw r0,_CTR(r11)
144 bl create_hpte /* add the hash table entry */
145
146/*
147 * htab_reloads counts the number of times we have to fault an
148 * HPTE into the hash table. This should only happen after a
149 * fork (because fork does a flush_tlb_mm) or a vmalloc or ioremap.
150 * Where a page is faulted into a process's address space,
151 * update_mmu_cache gets called to put the HPTE into the hash table
152 * and those are counted as preloads rather than reloads.
153 */
154 addis r8,r7,htab_reloads@ha
155 lwz r3,htab_reloads@l(r8)
156 addi r3,r3,1
157 stw r3,htab_reloads@l(r8)
158
159#ifdef CONFIG_SMP
160 eieio
161 addis r8,r7,mmu_hash_lock@ha
162 li r0,0
163 stw r0,mmu_hash_lock@l(r8)
164#endif
165
166 /* Return from the exception */
167 lwz r5,_CTR(r11)
168 mtctr r5
169 lwz r0,GPR0(r11)
170 lwz r7,GPR7(r11)
171 lwz r8,GPR8(r11)
172 b fast_exception_return
173
174#ifdef CONFIG_SMP
175hash_page_out:
176 eieio
177 addis r8,r7,mmu_hash_lock@ha
178 li r0,0
179 stw r0,mmu_hash_lock@l(r8)
180 blr
181#endif /* CONFIG_SMP */
182
183/*
184 * Add an entry for a particular page to the hash table.
185 *
186 * add_hash_page(unsigned context, unsigned long va, unsigned long pmdval)
187 *
188 * We assume any necessary modifications to the pte (e.g. setting
189 * the accessed bit) have already been done and that there is actually
190 * a hash table in use (i.e. we're not on a 603).
191 */
192_GLOBAL(add_hash_page)
193 mflr r0
194 stw r0,4(r1)
195
196 /* Convert context and va to VSID */
197 mulli r3,r3,897*16 /* multiply context by context skew */
198 rlwinm r0,r4,4,28,31 /* get ESID (top 4 bits of va) */
199 mulli r0,r0,0x111 /* multiply by ESID skew */
200 add r3,r3,r0 /* note create_hpte trims to 24 bits */
201
202#ifdef CONFIG_SMP
203 rlwinm r8,r1,0,0,18 /* use cpu number to make tag */
204 lwz r8,TI_CPU(r8) /* to go in mmu_hash_lock */
205 oris r8,r8,12
206#endif /* CONFIG_SMP */
207
208 /*
209 * We disable interrupts here, even on UP, because we don't
210 * want to race with hash_page, and because we want the
211 * _PAGE_HASHPTE bit to be a reliable indication of whether
212 * the HPTE exists (or at least whether one did once).
213 * We also turn off the MMU for data accesses so that we
214 * we can't take a hash table miss (assuming the code is
215 * covered by a BAT). -- paulus
216 */
217 mfmsr r10
218 SYNC
219 rlwinm r0,r10,0,17,15 /* clear bit 16 (MSR_EE) */
220 rlwinm r0,r0,0,28,26 /* clear MSR_DR */
221 mtmsr r0
222 SYNC_601
223 isync
224
225 tophys(r7,0)
226
227#ifdef CONFIG_SMP
228 addis r9,r7,mmu_hash_lock@ha
229 addi r9,r9,mmu_hash_lock@l
23010: lwarx r0,0,r9 /* take the mmu_hash_lock */
231 cmpi 0,r0,0
232 bne- 11f
233 stwcx. r8,0,r9
234 beq+ 12f
23511: lwz r0,0(r9)
236 cmpi 0,r0,0
237 beq 10b
238 b 11b
23912: isync
240#endif
241
242 /*
243 * Fetch the linux pte and test and set _PAGE_HASHPTE atomically.
244 * If _PAGE_HASHPTE was already set, we don't replace the existing
245 * HPTE, so we just unlock and return.
246 */
247 mr r8,r5
248 rlwimi r8,r4,22,20,29
2491: lwarx r6,0,r8
250 andi. r0,r6,_PAGE_HASHPTE
251 bne 9f /* if HASHPTE already set, done */
252 ori r5,r6,_PAGE_HASHPTE
253 stwcx. r5,0,r8
254 bne- 1b
255
256 bl create_hpte
257
258 addis r8,r7,htab_preloads@ha
259 lwz r3,htab_preloads@l(r8)
260 addi r3,r3,1
261 stw r3,htab_preloads@l(r8)
262
2639:
264#ifdef CONFIG_SMP
265 eieio
266 li r0,0
267 stw r0,0(r9) /* clear mmu_hash_lock */
268#endif
269
270 /* reenable interrupts and DR */
271 mtmsr r10
272 SYNC_601
273 isync
274
275 lwz r0,4(r1)
276 mtlr r0
277 blr
278
279/*
280 * This routine adds a hardware PTE to the hash table.
281 * It is designed to be called with the MMU either on or off.
282 * r3 contains the VSID, r4 contains the virtual address,
283 * r5 contains the linux PTE, r6 contains the old value of the
284 * linux PTE (before setting _PAGE_HASHPTE) and r7 contains the
285 * offset to be added to addresses (0 if the MMU is on,
286 * -KERNELBASE if it is off).
287 * On SMP, the caller should have the mmu_hash_lock held.
288 * We assume that the caller has (or will) set the _PAGE_HASHPTE
289 * bit in the linux PTE in memory. The value passed in r6 should
290 * be the old linux PTE value; if it doesn't have _PAGE_HASHPTE set
291 * this routine will skip the search for an existing HPTE.
292 * This procedure modifies r0, r3 - r6, r8, cr0.
293 * -- paulus.
294 *
295 * For speed, 4 of the instructions get patched once the size and
296 * physical address of the hash table are known. These definitions
297 * of Hash_base and Hash_bits below are just an example.
298 */
299Hash_base = 0xc0180000
300Hash_bits = 12 /* e.g. 256kB hash table */
301Hash_msk = (((1 << Hash_bits) - 1) * 64)
302
303/* defines for the PTE format for 32-bit PPCs */
304#define PTE_SIZE 8
305#define PTEG_SIZE 64
306#define LG_PTEG_SIZE 6
307#define LDPTEu lwzu
308#define STPTE stw
309#define CMPPTE cmpw
310#define PTE_H 0x40
311#define PTE_V 0x80000000
312#define TST_V(r) rlwinm. r,r,0,0,0
313#define SET_V(r) oris r,r,PTE_V@h
314#define CLR_V(r,t) rlwinm r,r,0,1,31
315
316#define HASH_LEFT 31-(LG_PTEG_SIZE+Hash_bits-1)
317#define HASH_RIGHT 31-LG_PTEG_SIZE
318
319_GLOBAL(create_hpte)
320 /* Convert linux-style PTE (r5) to low word of PPC-style PTE (r8) */
321 rlwinm r8,r5,32-10,31,31 /* _PAGE_RW -> PP lsb */
322 rlwinm r0,r5,32-7,31,31 /* _PAGE_DIRTY -> PP lsb */
323 and r8,r8,r0 /* writable if _RW & _DIRTY */
324 rlwimi r5,r5,32-1,30,30 /* _PAGE_USER -> PP msb */
325 rlwimi r5,r5,32-2,31,31 /* _PAGE_USER -> PP lsb */
326 ori r8,r8,0xe14 /* clear out reserved bits and M */
327 andc r8,r5,r8 /* PP = user? (rw&dirty? 2: 3): 0 */
328BEGIN_FTR_SECTION
329 ori r8,r8,_PAGE_COHERENT /* set M (coherence required) */
330END_FTR_SECTION_IFSET(CPU_FTR_NEED_COHERENT)
331
332 /* Construct the high word of the PPC-style PTE (r5) */
333 rlwinm r5,r3,7,1,24 /* put VSID in 0x7fffff80 bits */
334 rlwimi r5,r4,10,26,31 /* put in API (abbrev page index) */
335 SET_V(r5) /* set V (valid) bit */
336
337 /* Get the address of the primary PTE group in the hash table (r3) */
338_GLOBAL(hash_page_patch_A)
339 addis r0,r7,Hash_base@h /* base address of hash table */
340 rlwimi r0,r3,LG_PTEG_SIZE,HASH_LEFT,HASH_RIGHT /* VSID -> hash */
341 rlwinm r3,r4,20+LG_PTEG_SIZE,HASH_LEFT,HASH_RIGHT /* PI -> hash */
342 xor r3,r3,r0 /* make primary hash */
343 li r0,8 /* PTEs/group */
344
345 /*
346 * Test the _PAGE_HASHPTE bit in the old linux PTE, and skip the search
347 * if it is clear, meaning that the HPTE isn't there already...
348 */
349 andi. r6,r6,_PAGE_HASHPTE
350 beq+ 10f /* no PTE: go look for an empty slot */
351 tlbie r4
352
353 addis r4,r7,htab_hash_searches@ha
354 lwz r6,htab_hash_searches@l(r4)
355 addi r6,r6,1 /* count how many searches we do */
356 stw r6,htab_hash_searches@l(r4)
357
358 /* Search the primary PTEG for a PTE whose 1st (d)word matches r5 */
359 mtctr r0
360 addi r4,r3,-PTE_SIZE
3611: LDPTEu r6,PTE_SIZE(r4) /* get next PTE */
362 CMPPTE 0,r6,r5
363 bdnzf 2,1b /* loop while ctr != 0 && !cr0.eq */
364 beq+ found_slot
365
366 /* Search the secondary PTEG for a matching PTE */
367 ori r5,r5,PTE_H /* set H (secondary hash) bit */
368_GLOBAL(hash_page_patch_B)
369 xoris r4,r3,Hash_msk>>16 /* compute secondary hash */
370 xori r4,r4,(-PTEG_SIZE & 0xffff)
371 addi r4,r4,-PTE_SIZE
372 mtctr r0
3732: LDPTEu r6,PTE_SIZE(r4)
374 CMPPTE 0,r6,r5
375 bdnzf 2,2b
376 beq+ found_slot
377 xori r5,r5,PTE_H /* clear H bit again */
378
379 /* Search the primary PTEG for an empty slot */
38010: mtctr r0
381 addi r4,r3,-PTE_SIZE /* search primary PTEG */
3821: LDPTEu r6,PTE_SIZE(r4) /* get next PTE */
383 TST_V(r6) /* test valid bit */
384 bdnzf 2,1b /* loop while ctr != 0 && !cr0.eq */
385 beq+ found_empty
386
387 /* update counter of times that the primary PTEG is full */
388 addis r4,r7,primary_pteg_full@ha
389 lwz r6,primary_pteg_full@l(r4)
390 addi r6,r6,1
391 stw r6,primary_pteg_full@l(r4)
392
393 /* Search the secondary PTEG for an empty slot */
394 ori r5,r5,PTE_H /* set H (secondary hash) bit */
395_GLOBAL(hash_page_patch_C)
396 xoris r4,r3,Hash_msk>>16 /* compute secondary hash */
397 xori r4,r4,(-PTEG_SIZE & 0xffff)
398 addi r4,r4,-PTE_SIZE
399 mtctr r0
4002: LDPTEu r6,PTE_SIZE(r4)
401 TST_V(r6)
402 bdnzf 2,2b
403 beq+ found_empty
404 xori r5,r5,PTE_H /* clear H bit again */
405
406 /*
407 * Choose an arbitrary slot in the primary PTEG to overwrite.
408 * Since both the primary and secondary PTEGs are full, and we
409 * have no information that the PTEs in the primary PTEG are
410 * more important or useful than those in the secondary PTEG,
411 * and we know there is a definite (although small) speed
412 * advantage to putting the PTE in the primary PTEG, we always
413 * put the PTE in the primary PTEG.
414 */
415 addis r4,r7,next_slot@ha
416 lwz r6,next_slot@l(r4)
417 addi r6,r6,PTE_SIZE
418 andi. r6,r6,7*PTE_SIZE
419 stw r6,next_slot@l(r4)
420 add r4,r3,r6
421
422 /* update counter of evicted pages */
423 addis r6,r7,htab_evicts@ha
424 lwz r3,htab_evicts@l(r6)
425 addi r3,r3,1
426 stw r3,htab_evicts@l(r6)
427
428#ifndef CONFIG_SMP
429 /* Store PTE in PTEG */
430found_empty:
431 STPTE r5,0(r4)
432found_slot:
433 STPTE r8,PTE_SIZE/2(r4)
434
435#else /* CONFIG_SMP */
436/*
437 * Between the tlbie above and updating the hash table entry below,
438 * another CPU could read the hash table entry and put it in its TLB.
439 * There are 3 cases:
440 * 1. using an empty slot
441 * 2. updating an earlier entry to change permissions (i.e. enable write)
442 * 3. taking over the PTE for an unrelated address
443 *
444 * In each case it doesn't really matter if the other CPUs have the old
445 * PTE in their TLB. So we don't need to bother with another tlbie here,
446 * which is convenient as we've overwritten the register that had the
447 * address. :-) The tlbie above is mainly to make sure that this CPU comes
448 * and gets the new PTE from the hash table.
449 *
450 * We do however have to make sure that the PTE is never in an invalid
451 * state with the V bit set.
452 */
453found_empty:
454found_slot:
455 CLR_V(r5,r0) /* clear V (valid) bit in PTE */
456 STPTE r5,0(r4)
457 sync
458 TLBSYNC
459 STPTE r8,PTE_SIZE/2(r4) /* put in correct RPN, WIMG, PP bits */
460 sync
461 SET_V(r5)
462 STPTE r5,0(r4) /* finally set V bit in PTE */
463#endif /* CONFIG_SMP */
464
465 sync /* make sure pte updates get to memory */
466 blr
467
468 .section .bss
469 .align 2
470next_slot:
471 .space 4
472 .globl primary_pteg_full
473primary_pteg_full:
474 .space 4
475 .globl htab_hash_searches
476htab_hash_searches:
477 .space 4
478 .previous
479
480/*
481 * Flush the entry for a particular page from the hash table.
482 *
483 * flush_hash_pages(unsigned context, unsigned long va, unsigned long pmdval,
484 * int count)
485 *
486 * We assume that there is a hash table in use (Hash != 0).
487 */
488_GLOBAL(flush_hash_pages)
489 tophys(r7,0)
490
491 /*
492 * We disable interrupts here, even on UP, because we want
493 * the _PAGE_HASHPTE bit to be a reliable indication of
494 * whether the HPTE exists (or at least whether one did once).
495 * We also turn off the MMU for data accesses so that we
496 * we can't take a hash table miss (assuming the code is
497 * covered by a BAT). -- paulus
498 */
499 mfmsr r10
500 SYNC
501 rlwinm r0,r10,0,17,15 /* clear bit 16 (MSR_EE) */
502 rlwinm r0,r0,0,28,26 /* clear MSR_DR */
503 mtmsr r0
504 SYNC_601
505 isync
506
507 /* First find a PTE in the range that has _PAGE_HASHPTE set */
508 rlwimi r5,r4,22,20,29
5091: lwz r0,0(r5)
510 cmpwi cr1,r6,1
511 andi. r0,r0,_PAGE_HASHPTE
512 bne 2f
513 ble cr1,19f
514 addi r4,r4,0x1000
515 addi r5,r5,4
516 addi r6,r6,-1
517 b 1b
518
519 /* Convert context and va to VSID */
5202: mulli r3,r3,897*16 /* multiply context by context skew */
521 rlwinm r0,r4,4,28,31 /* get ESID (top 4 bits of va) */
522 mulli r0,r0,0x111 /* multiply by ESID skew */
523 add r3,r3,r0 /* note code below trims to 24 bits */
524
525 /* Construct the high word of the PPC-style PTE (r11) */
526 rlwinm r11,r3,7,1,24 /* put VSID in 0x7fffff80 bits */
527 rlwimi r11,r4,10,26,31 /* put in API (abbrev page index) */
528 SET_V(r11) /* set V (valid) bit */
529
530#ifdef CONFIG_SMP
531 addis r9,r7,mmu_hash_lock@ha
532 addi r9,r9,mmu_hash_lock@l
533 rlwinm r8,r1,0,0,18
534 add r8,r8,r7
535 lwz r8,TI_CPU(r8)
536 oris r8,r8,9
53710: lwarx r0,0,r9
538 cmpi 0,r0,0
539 bne- 11f
540 stwcx. r8,0,r9
541 beq+ 12f
54211: lwz r0,0(r9)
543 cmpi 0,r0,0
544 beq 10b
545 b 11b
54612: isync
547#endif
548
549 /*
550 * Check the _PAGE_HASHPTE bit in the linux PTE. If it is
551 * already clear, we're done (for this pte). If not,
552 * clear it (atomically) and proceed. -- paulus.
553 */
55433: lwarx r8,0,r5 /* fetch the pte */
555 andi. r0,r8,_PAGE_HASHPTE
556 beq 8f /* done if HASHPTE is already clear */
557 rlwinm r8,r8,0,31,29 /* clear HASHPTE bit */
558 stwcx. r8,0,r5 /* update the pte */
559 bne- 33b
560
561 /* Get the address of the primary PTE group in the hash table (r3) */
562_GLOBAL(flush_hash_patch_A)
563 addis r8,r7,Hash_base@h /* base address of hash table */
564 rlwimi r8,r3,LG_PTEG_SIZE,HASH_LEFT,HASH_RIGHT /* VSID -> hash */
565 rlwinm r0,r4,20+LG_PTEG_SIZE,HASH_LEFT,HASH_RIGHT /* PI -> hash */
566 xor r8,r0,r8 /* make primary hash */
567
568 /* Search the primary PTEG for a PTE whose 1st (d)word matches r5 */
569 li r0,8 /* PTEs/group */
570 mtctr r0
571 addi r12,r8,-PTE_SIZE
5721: LDPTEu r0,PTE_SIZE(r12) /* get next PTE */
573 CMPPTE 0,r0,r11
574 bdnzf 2,1b /* loop while ctr != 0 && !cr0.eq */
575 beq+ 3f
576
577 /* Search the secondary PTEG for a matching PTE */
578 ori r11,r11,PTE_H /* set H (secondary hash) bit */
579 li r0,8 /* PTEs/group */
580_GLOBAL(flush_hash_patch_B)
581 xoris r12,r8,Hash_msk>>16 /* compute secondary hash */
582 xori r12,r12,(-PTEG_SIZE & 0xffff)
583 addi r12,r12,-PTE_SIZE
584 mtctr r0
5852: LDPTEu r0,PTE_SIZE(r12)
586 CMPPTE 0,r0,r11
587 bdnzf 2,2b
588 xori r11,r11,PTE_H /* clear H again */
589 bne- 4f /* should rarely fail to find it */
590
5913: li r0,0
592 STPTE r0,0(r12) /* invalidate entry */
5934: sync
594 tlbie r4 /* in hw tlb too */
595 sync
596
5978: ble cr1,9f /* if all ptes checked */
59881: addi r6,r6,-1
599 addi r5,r5,4 /* advance to next pte */
600 addi r4,r4,0x1000
601 lwz r0,0(r5) /* check next pte */
602 cmpwi cr1,r6,1
603 andi. r0,r0,_PAGE_HASHPTE
604 bne 33b
605 bgt cr1,81b
606
6079:
608#ifdef CONFIG_SMP
609 TLBSYNC
610 li r0,0
611 stw r0,0(r9) /* clear mmu_hash_lock */
612#endif
613
61419: mtmsr r10
615 SYNC_601
616 isync
617 blr
diff --git a/arch/ppc/mm/init.c b/arch/ppc/mm/init.c
deleted file mode 100644
index 1a63711081b5..000000000000
--- a/arch/ppc/mm/init.c
+++ /dev/null
@@ -1,603 +0,0 @@
1/*
2 * PowerPC version
3 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
4 *
5 * Modifications by Paul Mackerras (PowerMac) (paulus@cs.anu.edu.au)
6 * and Cort Dougan (PReP) (cort@cs.nmt.edu)
7 * Copyright (C) 1996 Paul Mackerras
8 * Amiga/APUS changes by Jesper Skov (jskov@cygnus.co.uk).
9 * PPC44x/36-bit changes by Matt Porter (mporter@mvista.com)
10 *
11 * Derived from "arch/i386/mm/init.c"
12 * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds
13 *
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License
16 * as published by the Free Software Foundation; either version
17 * 2 of the License, or (at your option) any later version.
18 *
19 */
20
21#include <linux/module.h>
22#include <linux/sched.h>
23#include <linux/kernel.h>
24#include <linux/errno.h>
25#include <linux/string.h>
26#include <linux/types.h>
27#include <linux/mm.h>
28#include <linux/stddef.h>
29#include <linux/init.h>
30#include <linux/bootmem.h>
31#include <linux/highmem.h>
32#include <linux/initrd.h>
33#include <linux/pagemap.h>
34
35#include <asm/pgalloc.h>
36#include <asm/prom.h>
37#include <asm/io.h>
38#include <asm/mmu_context.h>
39#include <asm/pgtable.h>
40#include <asm/mmu.h>
41#include <asm/smp.h>
42#include <asm/machdep.h>
43#include <asm/btext.h>
44#include <asm/tlb.h>
45#include <asm/bootinfo.h>
46
47#include "mem_pieces.h"
48#include "mmu_decl.h"
49
50#if defined(CONFIG_KERNEL_START_BOOL) || defined(CONFIG_LOWMEM_SIZE_BOOL)
51/* The amount of lowmem must be within 0xF0000000 - KERNELBASE. */
52#if (CONFIG_LOWMEM_SIZE > (0xF0000000 - KERNELBASE))
53#error "You must adjust CONFIG_LOWMEM_SIZE or CONFIG_START_KERNEL"
54#endif
55#endif
56#define MAX_LOW_MEM CONFIG_LOWMEM_SIZE
57
58DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
59
60unsigned long total_memory;
61unsigned long total_lowmem;
62
63unsigned long ppc_memstart;
64unsigned long ppc_memoffset = PAGE_OFFSET;
65
66int mem_init_done;
67int init_bootmem_done;
68int boot_mapsize;
69
70extern char _end[];
71extern char etext[], _stext[];
72extern char __init_begin, __init_end;
73
74#ifdef CONFIG_HIGHMEM
75pte_t *kmap_pte;
76pgprot_t kmap_prot;
77
78EXPORT_SYMBOL(kmap_prot);
79EXPORT_SYMBOL(kmap_pte);
80#endif
81
82void MMU_init(void);
83void set_phys_avail(unsigned long total_ram);
84
85/* XXX should be in current.h -- paulus */
86extern struct task_struct *current_set[NR_CPUS];
87
88char *klimit = _end;
89struct mem_pieces phys_avail;
90
91/*
92 * this tells the system to map all of ram with the segregs
93 * (i.e. page tables) instead of the bats.
94 * -- Cort
95 */
96int __map_without_bats;
97int __map_without_ltlbs;
98
99/* max amount of RAM to use */
100unsigned long __max_memory;
101/* max amount of low RAM to map in */
102unsigned long __max_low_memory = MAX_LOW_MEM;
103
104void show_mem(void)
105{
106 int i,free = 0,total = 0,reserved = 0;
107 int shared = 0, cached = 0;
108 int highmem = 0;
109
110 printk("Mem-info:\n");
111 show_free_areas();
112 i = max_mapnr;
113 while (i-- > 0) {
114 total++;
115 if (PageHighMem(mem_map+i))
116 highmem++;
117 if (PageReserved(mem_map+i))
118 reserved++;
119 else if (PageSwapCache(mem_map+i))
120 cached++;
121 else if (!page_count(mem_map+i))
122 free++;
123 else
124 shared += page_count(mem_map+i) - 1;
125 }
126 printk("%d pages of RAM\n",total);
127 printk("%d pages of HIGHMEM\n", highmem);
128 printk("%d free pages\n",free);
129 printk("%d reserved pages\n",reserved);
130 printk("%d pages shared\n",shared);
131 printk("%d pages swap cached\n",cached);
132}
133
134/* Free up now-unused memory */
135static void free_sec(unsigned long start, unsigned long end, const char *name)
136{
137 unsigned long cnt = 0;
138
139 while (start < end) {
140 ClearPageReserved(virt_to_page(start));
141 init_page_count(virt_to_page(start));
142 free_page(start);
143 cnt++;
144 start += PAGE_SIZE;
145 }
146 if (cnt) {
147 printk(" %ldk %s", cnt << (PAGE_SHIFT - 10), name);
148 totalram_pages += cnt;
149 }
150}
151
152void free_initmem(void)
153{
154#define FREESEC(TYPE) \
155 free_sec((unsigned long)(&__ ## TYPE ## _begin), \
156 (unsigned long)(&__ ## TYPE ## _end), \
157 #TYPE);
158
159 printk ("Freeing unused kernel memory:");
160 FREESEC(init);
161 printk("\n");
162 ppc_md.progress = NULL;
163#undef FREESEC
164}
165
166#ifdef CONFIG_BLK_DEV_INITRD
167void free_initrd_mem(unsigned long start, unsigned long end)
168{
169 printk ("Freeing initrd memory: %ldk freed\n", (end - start) >> 10);
170
171 for (; start < end; start += PAGE_SIZE) {
172 ClearPageReserved(virt_to_page(start));
173 init_page_count(virt_to_page(start));
174 free_page(start);
175 totalram_pages++;
176 }
177}
178#endif
179
180/*
181 * Check for command-line options that affect what MMU_init will do.
182 */
183void MMU_setup(void)
184{
185 /* Check for nobats option (used in mapin_ram). */
186 if (strstr(cmd_line, "nobats")) {
187 __map_without_bats = 1;
188 }
189
190 if (strstr(cmd_line, "noltlbs")) {
191 __map_without_ltlbs = 1;
192 }
193
194 /* Look for mem= option on command line */
195 if (strstr(cmd_line, "mem=")) {
196 char *p, *q;
197 unsigned long maxmem = 0;
198
199 for (q = cmd_line; (p = strstr(q, "mem=")) != 0; ) {
200 q = p + 4;
201 if (p > cmd_line && p[-1] != ' ')
202 continue;
203 maxmem = simple_strtoul(q, &q, 0);
204 if (*q == 'k' || *q == 'K') {
205 maxmem <<= 10;
206 ++q;
207 } else if (*q == 'm' || *q == 'M') {
208 maxmem <<= 20;
209 ++q;
210 }
211 }
212 __max_memory = maxmem;
213 }
214}
215
216/*
217 * MMU_init sets up the basic memory mappings for the kernel,
218 * including both RAM and possibly some I/O regions,
219 * and sets up the page tables and the MMU hardware ready to go.
220 */
221void __init MMU_init(void)
222{
223 if (ppc_md.progress)
224 ppc_md.progress("MMU:enter", 0x111);
225
226 /* parse args from command line */
227 MMU_setup();
228
229 /*
230 * Figure out how much memory we have, how much
231 * is lowmem, and how much is highmem. If we were
232 * passed the total memory size from the bootloader,
233 * just use it.
234 */
235 if (boot_mem_size)
236 total_memory = boot_mem_size;
237 else
238 total_memory = ppc_md.find_end_of_memory();
239
240 if (__max_memory && total_memory > __max_memory)
241 total_memory = __max_memory;
242 total_lowmem = total_memory;
243 if (total_lowmem > __max_low_memory) {
244 total_lowmem = __max_low_memory;
245#ifndef CONFIG_HIGHMEM
246 total_memory = total_lowmem;
247#endif /* CONFIG_HIGHMEM */
248 }
249 set_phys_avail(total_lowmem);
250
251 /* Initialize the MMU hardware */
252 if (ppc_md.progress)
253 ppc_md.progress("MMU:hw init", 0x300);
254 MMU_init_hw();
255
256 /* Map in all of RAM starting at KERNELBASE */
257 if (ppc_md.progress)
258 ppc_md.progress("MMU:mapin", 0x301);
259 mapin_ram();
260
261#ifdef CONFIG_HIGHMEM
262 ioremap_base = PKMAP_BASE;
263#else
264 ioremap_base = 0xfe000000UL; /* for now, could be 0xfffff000 */
265#endif /* CONFIG_HIGHMEM */
266 ioremap_bot = ioremap_base;
267
268 /* Map in I/O resources */
269 if (ppc_md.progress)
270 ppc_md.progress("MMU:setio", 0x302);
271 if (ppc_md.setup_io_mappings)
272 ppc_md.setup_io_mappings();
273
274 /* Initialize the context management stuff */
275 mmu_context_init();
276
277 if (ppc_md.progress)
278 ppc_md.progress("MMU:exit", 0x211);
279
280#ifdef CONFIG_BOOTX_TEXT
281 /* By default, we are no longer mapped */
282 boot_text_mapped = 0;
283 /* Must be done last, or ppc_md.progress will die. */
284 map_boot_text();
285#endif
286}
287
288/* This is only called until mem_init is done. */
289void __init *early_get_page(void)
290{
291 void *p;
292
293 if (init_bootmem_done) {
294 p = alloc_bootmem_pages(PAGE_SIZE);
295 } else {
296 p = mem_pieces_find(PAGE_SIZE, PAGE_SIZE);
297 }
298 return p;
299}
300
301/*
302 * Initialize the bootmem system and give it all the memory we
303 * have available.
304 */
305void __init do_init_bootmem(void)
306{
307 unsigned long start, size;
308 int i;
309
310 /*
311 * Find an area to use for the bootmem bitmap.
312 * We look for the first area which is at least
313 * 128kB in length (128kB is enough for a bitmap
314 * for 4GB of memory, using 4kB pages), plus 1 page
315 * (in case the address isn't page-aligned).
316 */
317 start = 0;
318 size = 0;
319 for (i = 0; i < phys_avail.n_regions; ++i) {
320 unsigned long a = phys_avail.regions[i].address;
321 unsigned long s = phys_avail.regions[i].size;
322 if (s <= size)
323 continue;
324 start = a;
325 size = s;
326 if (s >= 33 * PAGE_SIZE)
327 break;
328 }
329 start = PAGE_ALIGN(start);
330
331 min_low_pfn = start >> PAGE_SHIFT;
332 max_low_pfn = (PPC_MEMSTART + total_lowmem) >> PAGE_SHIFT;
333 max_pfn = (PPC_MEMSTART + total_memory) >> PAGE_SHIFT;
334 boot_mapsize = init_bootmem_node(&contig_page_data, min_low_pfn,
335 PPC_MEMSTART >> PAGE_SHIFT,
336 max_low_pfn);
337
338 /* remove the bootmem bitmap from the available memory */
339 mem_pieces_remove(&phys_avail, start, boot_mapsize, 1);
340
341 /* add everything in phys_avail into the bootmem map */
342 for (i = 0; i < phys_avail.n_regions; ++i)
343 free_bootmem(phys_avail.regions[i].address,
344 phys_avail.regions[i].size);
345
346 init_bootmem_done = 1;
347}
348
349/*
350 * paging_init() sets up the page tables - in fact we've already done this.
351 */
352void __init paging_init(void)
353{
354 unsigned long start_pfn, end_pfn;
355 unsigned long max_zone_pfns[MAX_NR_ZONES];
356#ifdef CONFIG_HIGHMEM
357 map_page(PKMAP_BASE, 0, 0); /* XXX gross */
358 pkmap_page_table = pte_offset_kernel(pmd_offset(pgd_offset_k
359 (PKMAP_BASE), PKMAP_BASE), PKMAP_BASE);
360 map_page(KMAP_FIX_BEGIN, 0, 0); /* XXX gross */
361 kmap_pte = pte_offset_kernel(pmd_offset(pgd_offset_k
362 (KMAP_FIX_BEGIN), KMAP_FIX_BEGIN), KMAP_FIX_BEGIN);
363 kmap_prot = PAGE_KERNEL;
364#endif /* CONFIG_HIGHMEM */
365 /* All pages are DMA-able so we put them all in the DMA zone. */
366 start_pfn = __pa(PAGE_OFFSET) >> PAGE_SHIFT;
367 end_pfn = start_pfn + (total_memory >> PAGE_SHIFT);
368 add_active_range(0, start_pfn, end_pfn);
369
370 memset(max_zone_pfns, 0, sizeof(max_zone_pfns));
371#ifdef CONFIG_HIGHMEM
372 max_zone_pfns[ZONE_DMA] = total_lowmem >> PAGE_SHIFT;
373 max_zone_pfns[ZONE_HIGHMEM] = total_memory >> PAGE_SHIFT;
374#else
375 max_zone_pfns[ZONE_DMA] = total_memory >> PAGE_SHIFT;
376#endif /* CONFIG_HIGHMEM */
377 free_area_init_nodes(max_zone_pfns);
378}
379
380void __init mem_init(void)
381{
382 unsigned long addr;
383 int codepages = 0;
384 int datapages = 0;
385 int initpages = 0;
386#ifdef CONFIG_HIGHMEM
387 unsigned long highmem_mapnr;
388
389 highmem_mapnr = total_lowmem >> PAGE_SHIFT;
390#endif /* CONFIG_HIGHMEM */
391 max_mapnr = total_memory >> PAGE_SHIFT;
392
393 high_memory = (void *) __va(PPC_MEMSTART + total_lowmem);
394 num_physpages = max_mapnr; /* RAM is assumed contiguous */
395
396 totalram_pages += free_all_bootmem();
397
398#ifdef CONFIG_BLK_DEV_INITRD
399 /* if we are booted from BootX with an initial ramdisk,
400 make sure the ramdisk pages aren't reserved. */
401 if (initrd_start) {
402 for (addr = initrd_start; addr < initrd_end; addr += PAGE_SIZE)
403 ClearPageReserved(virt_to_page(addr));
404 }
405#endif /* CONFIG_BLK_DEV_INITRD */
406
407 for (addr = PAGE_OFFSET; addr < (unsigned long)high_memory;
408 addr += PAGE_SIZE) {
409 if (!PageReserved(virt_to_page(addr)))
410 continue;
411 if (addr < (ulong) etext)
412 codepages++;
413 else if (addr >= (unsigned long)&__init_begin
414 && addr < (unsigned long)&__init_end)
415 initpages++;
416 else if (addr < (ulong) klimit)
417 datapages++;
418 }
419
420#ifdef CONFIG_HIGHMEM
421 {
422 unsigned long pfn;
423
424 for (pfn = highmem_mapnr; pfn < max_mapnr; ++pfn) {
425 struct page *page = mem_map + pfn;
426
427 ClearPageReserved(page);
428 init_page_count(page);
429 __free_page(page);
430 totalhigh_pages++;
431 }
432 totalram_pages += totalhigh_pages;
433 }
434#endif /* CONFIG_HIGHMEM */
435
436 printk("Memory: %luk available (%dk kernel code, %dk data, %dk init, %ldk highmem)\n",
437 (unsigned long)nr_free_pages()<< (PAGE_SHIFT-10),
438 codepages<< (PAGE_SHIFT-10), datapages<< (PAGE_SHIFT-10),
439 initpages<< (PAGE_SHIFT-10),
440 (unsigned long) (totalhigh_pages << (PAGE_SHIFT-10)));
441
442 mem_init_done = 1;
443}
444
445/*
446 * Set phys_avail to the amount of physical memory,
447 * less the kernel text/data/bss.
448 */
449void __init
450set_phys_avail(unsigned long total_memory)
451{
452 unsigned long kstart, ksize;
453
454 /*
455 * Initially, available physical memory is equivalent to all
456 * physical memory.
457 */
458
459 phys_avail.regions[0].address = PPC_MEMSTART;
460 phys_avail.regions[0].size = total_memory;
461 phys_avail.n_regions = 1;
462
463 /*
464 * Map out the kernel text/data/bss from the available physical
465 * memory.
466 */
467
468 kstart = __pa(_stext); /* should be 0 */
469 ksize = PAGE_ALIGN(klimit - _stext);
470
471 mem_pieces_remove(&phys_avail, kstart, ksize, 0);
472 mem_pieces_remove(&phys_avail, 0, 0x4000, 0);
473
474#if defined(CONFIG_BLK_DEV_INITRD)
475 /* Remove the init RAM disk from the available memory. */
476 if (initrd_start) {
477 mem_pieces_remove(&phys_avail, __pa(initrd_start),
478 initrd_end - initrd_start, 1);
479 }
480#endif /* CONFIG_BLK_DEV_INITRD */
481}
482
483/* Mark some memory as reserved by removing it from phys_avail. */
484void __init reserve_phys_mem(unsigned long start, unsigned long size)
485{
486 mem_pieces_remove(&phys_avail, start, size, 1);
487}
488
489/*
490 * This is called when a page has been modified by the kernel.
491 * It just marks the page as not i-cache clean. We do the i-cache
492 * flush later when the page is given to a user process, if necessary.
493 */
494void flush_dcache_page(struct page *page)
495{
496 clear_bit(PG_arch_1, &page->flags);
497}
498
499void flush_dcache_icache_page(struct page *page)
500{
501#ifdef CONFIG_BOOKE
502 void *start = kmap_atomic(page, KM_PPC_SYNC_ICACHE);
503 __flush_dcache_icache(start);
504 kunmap_atomic(start, KM_PPC_SYNC_ICACHE);
505#elif defined(CONFIG_8xx)
506 /* On 8xx there is no need to kmap since highmem is not supported */
507 __flush_dcache_icache(page_address(page));
508#else
509 __flush_dcache_icache_phys(page_to_pfn(page) << PAGE_SHIFT);
510#endif
511
512}
513void clear_user_page(void *page, unsigned long vaddr, struct page *pg)
514{
515 clear_page(page);
516 clear_bit(PG_arch_1, &pg->flags);
517}
518
519void copy_user_page(void *vto, void *vfrom, unsigned long vaddr,
520 struct page *pg)
521{
522 copy_page(vto, vfrom);
523 clear_bit(PG_arch_1, &pg->flags);
524}
525
526void flush_icache_user_range(struct vm_area_struct *vma, struct page *page,
527 unsigned long addr, int len)
528{
529 unsigned long maddr;
530
531 maddr = (unsigned long) kmap(page) + (addr & ~PAGE_MASK);
532 flush_icache_range(maddr, maddr + len);
533 kunmap(page);
534}
535
536/*
537 * This is called at the end of handling a user page fault, when the
538 * fault has been handled by updating a PTE in the linux page tables.
539 * We use it to preload an HPTE into the hash table corresponding to
540 * the updated linux PTE.
541 */
542void update_mmu_cache(struct vm_area_struct *vma, unsigned long address,
543 pte_t pte)
544{
545 /* handle i-cache coherency */
546 unsigned long pfn = pte_pfn(pte);
547
548 if (pfn_valid(pfn)) {
549 struct page *page = pfn_to_page(pfn);
550#ifdef CONFIG_8xx
551 /* On 8xx, the TLB handlers work in 2 stages:
552 * First, a zeroed entry is loaded by TLBMiss handler,
553 * which causes the TLBError handler to be triggered.
554 * That means the zeroed TLB has to be invalidated
555 * whenever a page miss occurs.
556 */
557 _tlbie(address, 0 /* 8xx doesn't care about PID */);
558#endif
559 if (!PageReserved(page)
560 && !test_bit(PG_arch_1, &page->flags)) {
561 if (vma->vm_mm == current->active_mm)
562 __flush_dcache_icache((void *) address);
563 else
564 flush_dcache_icache_page(page);
565 set_bit(PG_arch_1, &page->flags);
566 }
567 }
568
569#ifdef CONFIG_PPC_STD_MMU
570 /* We only want HPTEs for linux PTEs that have _PAGE_ACCESSED set */
571 if (Hash != 0 && pte_young(pte)) {
572 struct mm_struct *mm;
573 pmd_t *pmd;
574
575 mm = (address < TASK_SIZE)? vma->vm_mm: &init_mm;
576 pmd = pmd_offset(pgd_offset(mm, address), address);
577 if (!pmd_none(*pmd))
578 add_hash_page(mm->context.id, address, pmd_val(*pmd));
579 }
580#endif
581}
582
583/*
584 * This is called by /dev/mem to know if a given address has to
585 * be mapped non-cacheable or not
586 */
587int page_is_ram(unsigned long pfn)
588{
589 return pfn < max_pfn;
590}
591
592pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
593 unsigned long size, pgprot_t vma_prot)
594{
595 if (ppc_md.phys_mem_access_prot)
596 return ppc_md.phys_mem_access_prot(file, pfn, size, vma_prot);
597
598 if (!page_is_ram(pfn))
599 vma_prot = __pgprot(pgprot_val(vma_prot)
600 | _PAGE_GUARDED | _PAGE_NO_CACHE);
601 return vma_prot;
602}
603EXPORT_SYMBOL(phys_mem_access_prot);
diff --git a/arch/ppc/mm/mem_pieces.c b/arch/ppc/mm/mem_pieces.c
deleted file mode 100644
index 6030a0ddfbb4..000000000000
--- a/arch/ppc/mm/mem_pieces.c
+++ /dev/null
@@ -1,162 +0,0 @@
1/*
2 * Copyright (c) 1996 Paul Mackerras <paulus@cs.anu.edu.au>
3 * Changes to accommodate Power Macintoshes.
4 * Cort Dougan <cort@cs.nmt.edu>
5 * Rewrites.
6 * Grant Erickson <grant@lcse.umn.edu>
7 * General rework and split from mm/init.c.
8 *
9 * Module name: mem_pieces.c
10 *
11 * Description:
12 * Routines and data structures for manipulating and representing
13 * phyiscal memory extents (i.e. address/length pairs).
14 *
15 */
16
17#include <linux/kernel.h>
18#include <linux/stddef.h>
19#include <linux/init.h>
20#include <asm/page.h>
21
22#include "mem_pieces.h"
23
24extern struct mem_pieces phys_avail;
25
26static void mem_pieces_print(struct mem_pieces *);
27
28/*
29 * Scan a region for a piece of a given size with the required alignment.
30 */
31void __init *
32mem_pieces_find(unsigned int size, unsigned int align)
33{
34 int i;
35 unsigned a, e;
36 struct mem_pieces *mp = &phys_avail;
37
38 for (i = 0; i < mp->n_regions; ++i) {
39 a = mp->regions[i].address;
40 e = a + mp->regions[i].size;
41 a = (a + align - 1) & -align;
42 if (a + size <= e) {
43 mem_pieces_remove(mp, a, size, 1);
44 return (void *) __va(a);
45 }
46 }
47 panic("Couldn't find %u bytes at %u alignment\n", size, align);
48
49 return NULL;
50}
51
52/*
53 * Remove some memory from an array of pieces
54 */
55void __init
56mem_pieces_remove(struct mem_pieces *mp, unsigned int start, unsigned int size,
57 int must_exist)
58{
59 int i, j;
60 unsigned int end, rs, re;
61 struct reg_property *rp;
62
63 end = start + size;
64 for (i = 0, rp = mp->regions; i < mp->n_regions; ++i, ++rp) {
65 if (end > rp->address && start < rp->address + rp->size)
66 break;
67 }
68 if (i >= mp->n_regions) {
69 if (must_exist)
70 printk("mem_pieces_remove: [%x,%x) not in any region\n",
71 start, end);
72 return;
73 }
74 for (; i < mp->n_regions && end > rp->address; ++i, ++rp) {
75 rs = rp->address;
76 re = rs + rp->size;
77 if (must_exist && (start < rs || end > re)) {
78 printk("mem_pieces_remove: bad overlap [%x,%x) with",
79 start, end);
80 mem_pieces_print(mp);
81 must_exist = 0;
82 }
83 if (start > rs) {
84 rp->size = start - rs;
85 if (end < re) {
86 /* need to split this entry */
87 if (mp->n_regions >= MEM_PIECES_MAX)
88 panic("eek... mem_pieces overflow");
89 for (j = mp->n_regions; j > i + 1; --j)
90 mp->regions[j] = mp->regions[j-1];
91 ++mp->n_regions;
92 rp[1].address = end;
93 rp[1].size = re - end;
94 }
95 } else {
96 if (end < re) {
97 rp->address = end;
98 rp->size = re - end;
99 } else {
100 /* need to delete this entry */
101 for (j = i; j < mp->n_regions - 1; ++j)
102 mp->regions[j] = mp->regions[j+1];
103 --mp->n_regions;
104 --i;
105 --rp;
106 }
107 }
108 }
109}
110
111static void __init
112mem_pieces_print(struct mem_pieces *mp)
113{
114 int i;
115
116 for (i = 0; i < mp->n_regions; ++i)
117 printk(" [%x, %x)", mp->regions[i].address,
118 mp->regions[i].address + mp->regions[i].size);
119 printk("\n");
120}
121
122void __init
123mem_pieces_sort(struct mem_pieces *mp)
124{
125 unsigned long a, s;
126 int i, j;
127
128 for (i = 1; i < mp->n_regions; ++i) {
129 a = mp->regions[i].address;
130 s = mp->regions[i].size;
131 for (j = i - 1; j >= 0; --j) {
132 if (a >= mp->regions[j].address)
133 break;
134 mp->regions[j+1] = mp->regions[j];
135 }
136 mp->regions[j+1].address = a;
137 mp->regions[j+1].size = s;
138 }
139}
140
141void __init
142mem_pieces_coalesce(struct mem_pieces *mp)
143{
144 unsigned long a, s, ns;
145 int i, j, d;
146
147 d = 0;
148 for (i = 0; i < mp->n_regions; i = j) {
149 a = mp->regions[i].address;
150 s = mp->regions[i].size;
151 for (j = i + 1; j < mp->n_regions
152 && mp->regions[j].address - a <= s; ++j) {
153 ns = mp->regions[j].address + mp->regions[j].size - a;
154 if (ns > s)
155 s = ns;
156 }
157 mp->regions[d].address = a;
158 mp->regions[d].size = s;
159 ++d;
160 }
161 mp->n_regions = d;
162}
diff --git a/arch/ppc/mm/mem_pieces.h b/arch/ppc/mm/mem_pieces.h
deleted file mode 100644
index e2b700dc7f18..000000000000
--- a/arch/ppc/mm/mem_pieces.h
+++ /dev/null
@@ -1,48 +0,0 @@
1/*
2 * Copyright (c) 1996 Paul Mackerras <paulus@cs.anu.edu.au>
3 * Changes to accommodate Power Macintoshes.
4 * Cort Dougan <cort@cs.nmt.edu>
5 * Rewrites.
6 * Grant Erickson <grant@lcse.umn.edu>
7 * General rework and split from mm/init.c.
8 *
9 * Module name: mem_pieces.h
10 *
11 * Description:
12 * Routines and data structures for manipulating and representing
13 * phyiscal memory extents (i.e. address/length pairs).
14 *
15 */
16
17#ifndef __MEM_PIECES_H__
18#define __MEM_PIECES_H__
19
20#include <asm/prom.h>
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
26
27/* Type Definitions */
28
29#define MEM_PIECES_MAX 32
30
31struct mem_pieces {
32 int n_regions;
33 struct reg_property regions[MEM_PIECES_MAX];
34};
35
36/* Function Prototypes */
37
38extern void *mem_pieces_find(unsigned int size, unsigned int align);
39extern void mem_pieces_remove(struct mem_pieces *mp, unsigned int start,
40 unsigned int size, int must_exist);
41extern void mem_pieces_coalesce(struct mem_pieces *mp);
42extern void mem_pieces_sort(struct mem_pieces *mp);
43
44#ifdef __cplusplus
45}
46#endif
47
48#endif /* __MEM_PIECES_H__ */
diff --git a/arch/ppc/mm/mmu_context.c b/arch/ppc/mm/mmu_context.c
deleted file mode 100644
index dacf45ced473..000000000000
--- a/arch/ppc/mm/mmu_context.c
+++ /dev/null
@@ -1,85 +0,0 @@
1/*
2 * This file contains the routines for handling the MMU on those
3 * PowerPC implementations where the MMU substantially follows the
4 * architecture specification. This includes the 6xx, 7xx, 7xxx,
5 * and 8260 implementations but excludes the 8xx and 4xx.
6 * -- paulus
7 *
8 * Derived from arch/ppc/mm/init.c:
9 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
10 *
11 * Modifications by Paul Mackerras (PowerMac) (paulus@cs.anu.edu.au)
12 * and Cort Dougan (PReP) (cort@cs.nmt.edu)
13 * Copyright (C) 1996 Paul Mackerras
14 * Amiga/APUS changes by Jesper Skov (jskov@cygnus.co.uk).
15 *
16 * Derived from "arch/i386/mm/init.c"
17 * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds
18 *
19 * This program is free software; you can redistribute it and/or
20 * modify it under the terms of the GNU General Public License
21 * as published by the Free Software Foundation; either version
22 * 2 of the License, or (at your option) any later version.
23 *
24 */
25
26#include <linux/mm.h>
27#include <linux/init.h>
28
29#include <asm/mmu_context.h>
30#include <asm/tlbflush.h>
31
32unsigned long next_mmu_context;
33unsigned long context_map[LAST_CONTEXT / BITS_PER_LONG + 1];
34#ifdef FEW_CONTEXTS
35atomic_t nr_free_contexts;
36struct mm_struct *context_mm[LAST_CONTEXT+1];
37void steal_context(void);
38#endif /* FEW_CONTEXTS */
39
40/*
41 * Initialize the context management stuff.
42 */
43void __init
44mmu_context_init(void)
45{
46 /*
47 * Some processors have too few contexts to reserve one for
48 * init_mm, and require using context 0 for a normal task.
49 * Other processors reserve the use of context zero for the kernel.
50 * This code assumes FIRST_CONTEXT < 32.
51 */
52 context_map[0] = (1 << FIRST_CONTEXT) - 1;
53 next_mmu_context = FIRST_CONTEXT;
54#ifdef FEW_CONTEXTS
55 atomic_set(&nr_free_contexts, LAST_CONTEXT - FIRST_CONTEXT + 1);
56#endif /* FEW_CONTEXTS */
57}
58
59#ifdef FEW_CONTEXTS
60/*
61 * Steal a context from a task that has one at the moment.
62 * This is only used on 8xx and 4xx and we presently assume that
63 * they don't do SMP. If they do then this will have to check
64 * whether the MM we steal is in use.
65 * We also assume that this is only used on systems that don't
66 * use an MMU hash table - this is true for 8xx and 4xx.
67 * This isn't an LRU system, it just frees up each context in
68 * turn (sort-of pseudo-random replacement :). This would be the
69 * place to implement an LRU scheme if anyone was motivated to do it.
70 * -- paulus
71 */
72void
73steal_context(void)
74{
75 struct mm_struct *mm;
76
77 /* free up context `next_mmu_context' */
78 /* if we shouldn't free context 0, don't... */
79 if (next_mmu_context < FIRST_CONTEXT)
80 next_mmu_context = FIRST_CONTEXT;
81 mm = context_mm[next_mmu_context];
82 flush_tlb_mm(mm);
83 destroy_context(mm);
84}
85#endif /* FEW_CONTEXTS */
diff --git a/arch/ppc/mm/mmu_decl.h b/arch/ppc/mm/mmu_decl.h
deleted file mode 100644
index 5f813e386b87..000000000000
--- a/arch/ppc/mm/mmu_decl.h
+++ /dev/null
@@ -1,79 +0,0 @@
1/*
2 * Declarations of procedures and variables shared between files
3 * in arch/ppc/mm/.
4 *
5 * Derived from arch/ppc/mm/init.c:
6 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
7 *
8 * Modifications by Paul Mackerras (PowerMac) (paulus@cs.anu.edu.au)
9 * and Cort Dougan (PReP) (cort@cs.nmt.edu)
10 * Copyright (C) 1996 Paul Mackerras
11 * Amiga/APUS changes by Jesper Skov (jskov@cygnus.co.uk).
12 *
13 * Derived from "arch/i386/mm/init.c"
14 * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds
15 *
16 * This program is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU General Public License
18 * as published by the Free Software Foundation; either version
19 * 2 of the License, or (at your option) any later version.
20 *
21 */
22#include <asm/tlbflush.h>
23#include <asm/mmu.h>
24
25extern void mapin_ram(void);
26extern int map_page(unsigned long va, phys_addr_t pa, int flags);
27extern void setbat(int index, unsigned long virt, unsigned long phys,
28 unsigned int size, int flags);
29extern void reserve_phys_mem(unsigned long start, unsigned long size);
30extern void settlbcam(int index, unsigned long virt, phys_addr_t phys,
31 unsigned int size, int flags, unsigned int pid);
32extern void invalidate_tlbcam_entry(int index);
33
34extern int __map_without_bats;
35extern unsigned long ioremap_base;
36extern unsigned long ioremap_bot;
37extern unsigned int rtas_data, rtas_size;
38
39extern unsigned long total_memory;
40extern unsigned long total_lowmem;
41extern int mem_init_done;
42
43extern PTE *Hash, *Hash_end;
44extern unsigned long Hash_size, Hash_mask;
45
46extern unsigned int num_tlbcam_entries;
47
48/* ...and now those things that may be slightly different between processor
49 * architectures. -- Dan
50 */
51#if defined(CONFIG_8xx)
52#define flush_HPTE(X, va, pg) _tlbie(va, 0 /* 8xx doesn't care about PID */)
53#define MMU_init_hw() do { } while(0)
54#define mmu_mapin_ram() (0UL)
55
56#elif defined(CONFIG_4xx)
57#define flush_HPTE(pid, va, pg) _tlbie(va, pid)
58extern void MMU_init_hw(void);
59extern unsigned long mmu_mapin_ram(void);
60
61#else
62/* anything except 4xx or 8xx */
63extern void MMU_init_hw(void);
64extern unsigned long mmu_mapin_ram(void);
65
66/* Be careful....this needs to be updated if we ever encounter 603 SMPs,
67 * which includes all new 82xx processors. We need tlbie/tlbsync here
68 * in that case (I think). -- Dan.
69 */
70static inline void flush_HPTE(unsigned context, unsigned long va,
71 unsigned long pdval)
72{
73 if ((Hash != 0) &&
74 cpu_has_feature(CPU_FTR_HPTE_TABLE))
75 flush_hash_pages(0, va, pdval, 1);
76 else
77 _tlbie(va);
78}
79#endif
diff --git a/arch/ppc/mm/pgtable.c b/arch/ppc/mm/pgtable.c
deleted file mode 100644
index 03a79bff1271..000000000000
--- a/arch/ppc/mm/pgtable.c
+++ /dev/null
@@ -1,403 +0,0 @@
1/*
2 * This file contains the routines setting up the linux page tables.
3 * -- paulus
4 *
5 * Derived from arch/ppc/mm/init.c:
6 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
7 *
8 * Modifications by Paul Mackerras (PowerMac) (paulus@cs.anu.edu.au)
9 * and Cort Dougan (PReP) (cort@cs.nmt.edu)
10 * Copyright (C) 1996 Paul Mackerras
11 * Amiga/APUS changes by Jesper Skov (jskov@cygnus.co.uk).
12 *
13 * Derived from "arch/i386/mm/init.c"
14 * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds
15 *
16 * This program is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU General Public License
18 * as published by the Free Software Foundation; either version
19 * 2 of the License, or (at your option) any later version.
20 *
21 */
22
23#include <linux/kernel.h>
24#include <linux/module.h>
25#include <linux/types.h>
26#include <linux/mm.h>
27#include <linux/vmalloc.h>
28#include <linux/init.h>
29#include <linux/highmem.h>
30
31#include <asm/pgtable.h>
32#include <asm/pgalloc.h>
33#include <asm/io.h>
34
35#include "mmu_decl.h"
36
37unsigned long ioremap_base;
38unsigned long ioremap_bot;
39int io_bat_index;
40
41#if defined(CONFIG_6xx)
42#define HAVE_BATS 1
43#endif
44
45extern char etext[], _stext[];
46
47#ifdef CONFIG_SMP
48extern void hash_page_sync(void);
49#endif
50
51#ifdef HAVE_BATS
52extern unsigned long v_mapped_by_bats(unsigned long va);
53extern unsigned long p_mapped_by_bats(unsigned long pa);
54void setbat(int index, unsigned long virt, unsigned long phys,
55 unsigned int size, int flags);
56
57#else /* !HAVE_BATS */
58#define v_mapped_by_bats(x) (0UL)
59#define p_mapped_by_bats(x) (0UL)
60#endif /* HAVE_BATS */
61
62#ifdef CONFIG_PTE_64BIT
63/* 44x uses an 8kB pgdir because it has 8-byte Linux PTEs. */
64#define PGDIR_ORDER 1
65#else
66#define PGDIR_ORDER 0
67#endif
68
69pgd_t *pgd_alloc(struct mm_struct *mm)
70{
71 pgd_t *ret;
72
73 ret = (pgd_t *)__get_free_pages(GFP_KERNEL|__GFP_ZERO, PGDIR_ORDER);
74 return ret;
75}
76
77void pgd_free(struct mm_struct *mm, pgd_t *pgd)
78{
79 free_pages((unsigned long)pgd, PGDIR_ORDER);
80}
81
82__init_refok pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address)
83{
84 pte_t *pte;
85 extern int mem_init_done;
86 extern void *early_get_page(void);
87
88 if (mem_init_done) {
89 pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO);
90 } else {
91 pte = (pte_t *)early_get_page();
92 if (pte)
93 clear_page(pte);
94 }
95 return pte;
96}
97
98pgtable_t pte_alloc_one(struct mm_struct *mm, unsigned long address)
99{
100 struct page *ptepage;
101
102#ifdef CONFIG_HIGHPTE
103 gfp_t flags = GFP_KERNEL | __GFP_HIGHMEM | __GFP_REPEAT;
104#else
105 gfp_t flags = GFP_KERNEL | __GFP_REPEAT;
106#endif
107
108 ptepage = alloc_pages(flags, 0);
109 if (ptepage) {
110 clear_highpage(ptepage);
111 pgtable_page_ctor(ptepage);
112 }
113 return ptepage;
114}
115
116void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
117{
118#ifdef CONFIG_SMP
119 hash_page_sync();
120#endif
121 free_page((unsigned long)pte);
122}
123
124void pte_free(struct mm_struct *mm, pgtable_t ptepage)
125{
126#ifdef CONFIG_SMP
127 hash_page_sync();
128#endif
129 pgtable_page_dtor(ptepage);
130 __free_page(ptepage);
131}
132
133#ifndef CONFIG_PHYS_64BIT
134void __iomem *
135ioremap(phys_addr_t addr, unsigned long size)
136{
137 return __ioremap(addr, size, _PAGE_NO_CACHE);
138}
139#else /* CONFIG_PHYS_64BIT */
140void __iomem *
141ioremap64(unsigned long long addr, unsigned long size)
142{
143 return __ioremap(addr, size, _PAGE_NO_CACHE);
144}
145
146void __iomem *
147ioremap(phys_addr_t addr, unsigned long size)
148{
149 phys_addr_t addr64 = fixup_bigphys_addr(addr, size);
150
151 return ioremap64(addr64, size);
152}
153#endif /* CONFIG_PHYS_64BIT */
154
155void __iomem *
156__ioremap(phys_addr_t addr, unsigned long size, unsigned long flags)
157{
158 unsigned long v, i;
159 phys_addr_t p;
160 int err;
161
162 /*
163 * Choose an address to map it to.
164 * Once the vmalloc system is running, we use it.
165 * Before then, we use space going down from ioremap_base
166 * (ioremap_bot records where we're up to).
167 */
168 p = addr & PAGE_MASK;
169 size = PAGE_ALIGN(addr + size) - p;
170
171 /*
172 * If the address lies within the first 16 MB, assume it's in ISA
173 * memory space
174 */
175 if (p < 16*1024*1024)
176 p += _ISA_MEM_BASE;
177
178 /*
179 * Don't allow anybody to remap normal RAM that we're using.
180 * mem_init() sets high_memory so only do the check after that.
181 */
182 if ( mem_init_done && (p < virt_to_phys(high_memory)) )
183 {
184 printk("__ioremap(): phys addr "PHYS_FMT" is RAM lr %p\n", p,
185 __builtin_return_address(0));
186 return NULL;
187 }
188
189 if (size == 0)
190 return NULL;
191
192 /*
193 * Is it already mapped? Perhaps overlapped by a previous
194 * BAT mapping. If the whole area is mapped then we're done,
195 * otherwise remap it since we want to keep the virt addrs for
196 * each request contiguous.
197 *
198 * We make the assumption here that if the bottom and top
199 * of the range we want are mapped then it's mapped to the
200 * same virt address (and this is contiguous).
201 * -- Cort
202 */
203 if ((v = p_mapped_by_bats(p)) /*&& p_mapped_by_bats(p+size-1)*/ )
204 goto out;
205
206 if (mem_init_done) {
207 struct vm_struct *area;
208 area = get_vm_area(size, VM_IOREMAP);
209 if (area == 0)
210 return NULL;
211 v = (unsigned long) area->addr;
212 } else {
213 v = (ioremap_bot -= size);
214 }
215
216 if ((flags & _PAGE_PRESENT) == 0)
217 flags |= _PAGE_KERNEL;
218 if (flags & _PAGE_NO_CACHE)
219 flags |= _PAGE_GUARDED;
220
221 /*
222 * Should check if it is a candidate for a BAT mapping
223 */
224
225 err = 0;
226 for (i = 0; i < size && err == 0; i += PAGE_SIZE)
227 err = map_page(v+i, p+i, flags);
228 if (err) {
229 if (mem_init_done)
230 vunmap((void *)v);
231 return NULL;
232 }
233
234out:
235 return (void __iomem *) (v + ((unsigned long)addr & ~PAGE_MASK));
236}
237
238void iounmap(volatile void __iomem *addr)
239{
240 /*
241 * If mapped by BATs then there is nothing to do.
242 * Calling vfree() generates a benign warning.
243 */
244 if (v_mapped_by_bats((unsigned long)addr)) return;
245
246 if (addr > high_memory && (unsigned long) addr < ioremap_bot)
247 vunmap((void *) (PAGE_MASK & (unsigned long)addr));
248}
249
250void __iomem *ioport_map(unsigned long port, unsigned int len)
251{
252 return (void __iomem *) (port + _IO_BASE);
253}
254
255void ioport_unmap(void __iomem *addr)
256{
257 /* Nothing to do */
258}
259EXPORT_SYMBOL(ioport_map);
260EXPORT_SYMBOL(ioport_unmap);
261
262int
263map_page(unsigned long va, phys_addr_t pa, int flags)
264{
265 pmd_t *pd;
266 pte_t *pg;
267 int err = -ENOMEM;
268
269 /* Use upper 10 bits of VA to index the first level map */
270 pd = pmd_offset(pgd_offset_k(va), va);
271 /* Use middle 10 bits of VA to index the second-level map */
272 pg = pte_alloc_kernel(pd, va);
273 if (pg != 0) {
274 err = 0;
275 set_pte_at(&init_mm, va, pg, pfn_pte(pa >> PAGE_SHIFT, __pgprot(flags)));
276 if (mem_init_done)
277 flush_HPTE(0, va, pmd_val(*pd));
278 }
279 return err;
280}
281
282/*
283 * Map in all of physical memory starting at KERNELBASE.
284 */
285void __init mapin_ram(void)
286{
287 unsigned long v, p, s, f;
288
289 s = mmu_mapin_ram();
290 v = KERNELBASE + s;
291 p = PPC_MEMSTART + s;
292 for (; s < total_lowmem; s += PAGE_SIZE) {
293 if ((char *) v >= _stext && (char *) v < etext)
294 f = _PAGE_RAM_TEXT;
295 else
296 f = _PAGE_RAM;
297 map_page(v, p, f);
298 v += PAGE_SIZE;
299 p += PAGE_SIZE;
300 }
301}
302
303/* is x a power of 4? */
304#define is_power_of_4(x) is_power_of_2(x) && (ffs(x) & 1)
305
306/*
307 * Set up a mapping for a block of I/O.
308 * virt, phys, size must all be page-aligned.
309 * This should only be called before ioremap is called.
310 */
311void __init io_block_mapping(unsigned long virt, phys_addr_t phys,
312 unsigned int size, int flags)
313{
314 int i;
315
316 if (virt > KERNELBASE && virt < ioremap_bot)
317 ioremap_bot = ioremap_base = virt;
318
319#ifdef HAVE_BATS
320 /*
321 * Use a BAT for this if possible...
322 */
323 if (io_bat_index < 2 && is_power_of_2(size)
324 && (virt & (size - 1)) == 0 && (phys & (size - 1)) == 0) {
325 setbat(io_bat_index, virt, phys, size, flags);
326 ++io_bat_index;
327 return;
328 }
329#endif /* HAVE_BATS */
330
331 /* No BATs available, put it in the page tables. */
332 for (i = 0; i < size; i += PAGE_SIZE)
333 map_page(virt + i, phys + i, flags);
334}
335
336/* Scan the real Linux page tables and return a PTE pointer for
337 * a virtual address in a context.
338 * Returns true (1) if PTE was found, zero otherwise. The pointer to
339 * the PTE pointer is unmodified if PTE is not found.
340 */
341int
342get_pteptr(struct mm_struct *mm, unsigned long addr, pte_t **ptep, pmd_t **pmdp)
343{
344 pgd_t *pgd;
345 pmd_t *pmd;
346 pte_t *pte;
347 int retval = 0;
348
349 pgd = pgd_offset(mm, addr & PAGE_MASK);
350 if (pgd) {
351 pmd = pmd_offset(pgd, addr & PAGE_MASK);
352 if (pmd_present(*pmd)) {
353 pte = pte_offset_map(pmd, addr & PAGE_MASK);
354 if (pte) {
355 retval = 1;
356 *ptep = pte;
357 if (pmdp)
358 *pmdp = pmd;
359 /* XXX caller needs to do pte_unmap, yuck */
360 }
361 }
362 }
363 return(retval);
364}
365
366/* Find physical address for this virtual address. Normally used by
367 * I/O functions, but anyone can call it.
368 */
369unsigned long iopa(unsigned long addr)
370{
371 unsigned long pa;
372
373 /* I don't know why this won't work on PMacs or CHRP. It
374 * appears there is some bug, or there is some implicit
375 * mapping done not properly represented by BATs or in page
376 * tables.......I am actively working on resolving this, but
377 * can't hold up other stuff. -- Dan
378 */
379 pte_t *pte;
380 struct mm_struct *mm;
381
382 /* Check the BATs */
383 pa = v_mapped_by_bats(addr);
384 if (pa)
385 return pa;
386
387 /* Allow mapping of user addresses (within the thread)
388 * for DMA if necessary.
389 */
390 if (addr < TASK_SIZE)
391 mm = current->mm;
392 else
393 mm = &init_mm;
394
395 pa = 0;
396 if (get_pteptr(mm, addr, &pte, NULL)) {
397 pa = (pte_val(*pte) & PAGE_MASK) | (addr & ~PAGE_MASK);
398 pte_unmap(pte);
399 }
400
401 return(pa);
402}
403
diff --git a/arch/ppc/mm/ppc_mmu.c b/arch/ppc/mm/ppc_mmu.c
deleted file mode 100644
index 0c1dc155996a..000000000000
--- a/arch/ppc/mm/ppc_mmu.c
+++ /dev/null
@@ -1,269 +0,0 @@
1/*
2 * This file contains the routines for handling the MMU on those
3 * PowerPC implementations where the MMU substantially follows the
4 * architecture specification. This includes the 6xx, 7xx, 7xxx,
5 * and 8260 implementations but excludes the 8xx and 4xx.
6 * -- paulus
7 *
8 * Derived from arch/ppc/mm/init.c:
9 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
10 *
11 * Modifications by Paul Mackerras (PowerMac) (paulus@cs.anu.edu.au)
12 * and Cort Dougan (PReP) (cort@cs.nmt.edu)
13 * Copyright (C) 1996 Paul Mackerras
14 * Amiga/APUS changes by Jesper Skov (jskov@cygnus.co.uk).
15 *
16 * Derived from "arch/i386/mm/init.c"
17 * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds
18 *
19 * This program is free software; you can redistribute it and/or
20 * modify it under the terms of the GNU General Public License
21 * as published by the Free Software Foundation; either version
22 * 2 of the License, or (at your option) any later version.
23 *
24 */
25
26#include <linux/kernel.h>
27#include <linux/mm.h>
28#include <linux/init.h>
29#include <linux/highmem.h>
30
31#include <asm/prom.h>
32#include <asm/mmu.h>
33#include <asm/machdep.h>
34
35#include "mmu_decl.h"
36#include "mem_pieces.h"
37
38PTE *Hash, *Hash_end;
39unsigned long Hash_size, Hash_mask;
40unsigned long _SDR1;
41
42union ubat { /* BAT register values to be loaded */
43 BAT bat;
44 u32 word[2];
45} BATS[4][2]; /* 4 pairs of IBAT, DBAT */
46
47struct batrange { /* stores address ranges mapped by BATs */
48 unsigned long start;
49 unsigned long limit;
50 unsigned long phys;
51} bat_addrs[4];
52
53/*
54 * Return PA for this VA if it is mapped by a BAT, or 0
55 */
56unsigned long v_mapped_by_bats(unsigned long va)
57{
58 int b;
59 for (b = 0; b < 4; ++b)
60 if (va >= bat_addrs[b].start && va < bat_addrs[b].limit)
61 return bat_addrs[b].phys + (va - bat_addrs[b].start);
62 return 0;
63}
64
65/*
66 * Return VA for a given PA or 0 if not mapped
67 */
68unsigned long p_mapped_by_bats(unsigned long pa)
69{
70 int b;
71 for (b = 0; b < 4; ++b)
72 if (pa >= bat_addrs[b].phys
73 && pa < (bat_addrs[b].limit-bat_addrs[b].start)
74 +bat_addrs[b].phys)
75 return bat_addrs[b].start+(pa-bat_addrs[b].phys);
76 return 0;
77}
78
79unsigned long __init mmu_mapin_ram(void)
80{
81 unsigned long tot, bl, done;
82 unsigned long max_size = (256<<20);
83 unsigned long align;
84
85 if (__map_without_bats)
86 return 0;
87
88 /* Set up BAT2 and if necessary BAT3 to cover RAM. */
89
90 /* Make sure we don't map a block larger than the
91 smallest alignment of the physical address. */
92 /* alignment of PPC_MEMSTART */
93 align = ~(PPC_MEMSTART-1) & PPC_MEMSTART;
94 /* set BAT block size to MIN(max_size, align) */
95 if (align && align < max_size)
96 max_size = align;
97
98 tot = total_lowmem;
99 for (bl = 128<<10; bl < max_size; bl <<= 1) {
100 if (bl * 2 > tot)
101 break;
102 }
103
104 setbat(2, KERNELBASE, PPC_MEMSTART, bl, _PAGE_RAM);
105 done = (unsigned long)bat_addrs[2].limit - KERNELBASE + 1;
106 if ((done < tot) && !bat_addrs[3].limit) {
107 /* use BAT3 to cover a bit more */
108 tot -= done;
109 for (bl = 128<<10; bl < max_size; bl <<= 1)
110 if (bl * 2 > tot)
111 break;
112 setbat(3, KERNELBASE+done, PPC_MEMSTART+done, bl, _PAGE_RAM);
113 done = (unsigned long)bat_addrs[3].limit - KERNELBASE + 1;
114 }
115
116 return done;
117}
118
119/*
120 * Set up one of the I/D BAT (block address translation) register pairs.
121 * The parameters are not checked; in particular size must be a power
122 * of 2 between 128k and 256M.
123 */
124void __init setbat(int index, unsigned long virt, unsigned long phys,
125 unsigned int size, int flags)
126{
127 unsigned int bl;
128 int wimgxpp;
129 union ubat *bat = BATS[index];
130
131 if (((flags & _PAGE_NO_CACHE) == 0) &&
132 cpu_has_feature(CPU_FTR_NEED_COHERENT))
133 flags |= _PAGE_COHERENT;
134
135 bl = (size >> 17) - 1;
136 if (PVR_VER(mfspr(SPRN_PVR)) != 1) {
137 /* 603, 604, etc. */
138 /* Do DBAT first */
139 wimgxpp = flags & (_PAGE_WRITETHRU | _PAGE_NO_CACHE
140 | _PAGE_COHERENT | _PAGE_GUARDED);
141 wimgxpp |= (flags & _PAGE_RW)? BPP_RW: BPP_RX;
142 bat[1].word[0] = virt | (bl << 2) | 2; /* Vs=1, Vp=0 */
143 bat[1].word[1] = phys | wimgxpp;
144#ifndef CONFIG_KGDB /* want user access for breakpoints */
145 if (flags & _PAGE_USER)
146#endif
147 bat[1].bat.batu.vp = 1;
148 if (flags & _PAGE_GUARDED) {
149 /* G bit must be zero in IBATs */
150 bat[0].word[0] = bat[0].word[1] = 0;
151 } else {
152 /* make IBAT same as DBAT */
153 bat[0] = bat[1];
154 }
155 } else {
156 /* 601 cpu */
157 if (bl > BL_8M)
158 bl = BL_8M;
159 wimgxpp = flags & (_PAGE_WRITETHRU | _PAGE_NO_CACHE
160 | _PAGE_COHERENT);
161 wimgxpp |= (flags & _PAGE_RW)?
162 ((flags & _PAGE_USER)? PP_RWRW: PP_RWXX): PP_RXRX;
163 bat->word[0] = virt | wimgxpp | 4; /* Ks=0, Ku=1 */
164 bat->word[1] = phys | bl | 0x40; /* V=1 */
165 }
166
167 bat_addrs[index].start = virt;
168 bat_addrs[index].limit = virt + ((bl + 1) << 17) - 1;
169 bat_addrs[index].phys = phys;
170}
171
172/*
173 * Initialize the hash table and patch the instructions in hashtable.S.
174 */
175void __init MMU_init_hw(void)
176{
177 unsigned int hmask, mb, mb2;
178 unsigned int n_hpteg, lg_n_hpteg;
179
180 extern unsigned int hash_page_patch_A[];
181 extern unsigned int hash_page_patch_B[], hash_page_patch_C[];
182 extern unsigned int hash_page[];
183 extern unsigned int flush_hash_patch_A[], flush_hash_patch_B[];
184
185 if (!cpu_has_feature(CPU_FTR_HPTE_TABLE)) {
186 /*
187 * Put a blr (procedure return) instruction at the
188 * start of hash_page, since we can still get DSI
189 * exceptions on a 603.
190 */
191 hash_page[0] = 0x4e800020;
192 flush_icache_range((unsigned long) &hash_page[0],
193 (unsigned long) &hash_page[1]);
194 return;
195 }
196
197 if ( ppc_md.progress ) ppc_md.progress("hash:enter", 0x105);
198
199#define LG_HPTEG_SIZE 6 /* 64 bytes per HPTEG */
200#define SDR1_LOW_BITS ((n_hpteg - 1) >> 10)
201#define MIN_N_HPTEG 1024 /* min 64kB hash table */
202
203 /*
204 * Allow 1 HPTE (1/8 HPTEG) for each page of memory.
205 * This is less than the recommended amount, but then
206 * Linux ain't AIX.
207 */
208 n_hpteg = total_memory / (PAGE_SIZE * 8);
209 if (n_hpteg < MIN_N_HPTEG)
210 n_hpteg = MIN_N_HPTEG;
211 lg_n_hpteg = __ilog2(n_hpteg);
212 if (n_hpteg & (n_hpteg - 1)) {
213 ++lg_n_hpteg; /* round up if not power of 2 */
214 n_hpteg = 1 << lg_n_hpteg;
215 }
216 Hash_size = n_hpteg << LG_HPTEG_SIZE;
217
218 /*
219 * Find some memory for the hash table.
220 */
221 if ( ppc_md.progress ) ppc_md.progress("hash:find piece", 0x322);
222 Hash = mem_pieces_find(Hash_size, Hash_size);
223 cacheable_memzero(Hash, Hash_size);
224 _SDR1 = __pa(Hash) | SDR1_LOW_BITS;
225
226 Hash_end = (PTE *) ((unsigned long)Hash + Hash_size);
227
228 printk("Total memory = %ldMB; using %ldkB for hash table (at %p)\n",
229 total_memory >> 20, Hash_size >> 10, Hash);
230
231
232 /*
233 * Patch up the instructions in hashtable.S:create_hpte
234 */
235 if ( ppc_md.progress ) ppc_md.progress("hash:patch", 0x345);
236 Hash_mask = n_hpteg - 1;
237 hmask = Hash_mask >> (16 - LG_HPTEG_SIZE);
238 mb2 = mb = 32 - LG_HPTEG_SIZE - lg_n_hpteg;
239 if (lg_n_hpteg > 16)
240 mb2 = 16 - LG_HPTEG_SIZE;
241
242 hash_page_patch_A[0] = (hash_page_patch_A[0] & ~0xffff)
243 | ((unsigned int)(Hash) >> 16);
244 hash_page_patch_A[1] = (hash_page_patch_A[1] & ~0x7c0) | (mb << 6);
245 hash_page_patch_A[2] = (hash_page_patch_A[2] & ~0x7c0) | (mb2 << 6);
246 hash_page_patch_B[0] = (hash_page_patch_B[0] & ~0xffff) | hmask;
247 hash_page_patch_C[0] = (hash_page_patch_C[0] & ~0xffff) | hmask;
248
249 /*
250 * Ensure that the locations we've patched have been written
251 * out from the data cache and invalidated in the instruction
252 * cache, on those machines with split caches.
253 */
254 flush_icache_range((unsigned long) &hash_page_patch_A[0],
255 (unsigned long) &hash_page_patch_C[1]);
256
257 /*
258 * Patch up the instructions in hashtable.S:flush_hash_page
259 */
260 flush_hash_patch_A[0] = (flush_hash_patch_A[0] & ~0xffff)
261 | ((unsigned int)(Hash) >> 16);
262 flush_hash_patch_A[1] = (flush_hash_patch_A[1] & ~0x7c0) | (mb << 6);
263 flush_hash_patch_A[2] = (flush_hash_patch_A[2] & ~0x7c0) | (mb2 << 6);
264 flush_hash_patch_B[0] = (flush_hash_patch_B[0] & ~0xffff) | hmask;
265 flush_icache_range((unsigned long) &flush_hash_patch_A[0],
266 (unsigned long) &flush_hash_patch_B[1]);
267
268 if ( ppc_md.progress ) ppc_md.progress("hash:done", 0x205);
269}
diff --git a/arch/ppc/mm/tlb.c b/arch/ppc/mm/tlb.c
deleted file mode 100644
index 4ff260bc9dd1..000000000000
--- a/arch/ppc/mm/tlb.c
+++ /dev/null
@@ -1,183 +0,0 @@
1/*
2 * This file contains the routines for TLB flushing.
3 * On machines where the MMU uses a hash table to store virtual to
4 * physical translations, these routines flush entries from the
5 * hash table also.
6 * -- paulus
7 *
8 * Derived from arch/ppc/mm/init.c:
9 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
10 *
11 * Modifications by Paul Mackerras (PowerMac) (paulus@cs.anu.edu.au)
12 * and Cort Dougan (PReP) (cort@cs.nmt.edu)
13 * Copyright (C) 1996 Paul Mackerras
14 * Amiga/APUS changes by Jesper Skov (jskov@cygnus.co.uk).
15 *
16 * Derived from "arch/i386/mm/init.c"
17 * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds
18 *
19 * This program is free software; you can redistribute it and/or
20 * modify it under the terms of the GNU General Public License
21 * as published by the Free Software Foundation; either version
22 * 2 of the License, or (at your option) any later version.
23 *
24 */
25
26#include <linux/kernel.h>
27#include <linux/mm.h>
28#include <linux/init.h>
29#include <linux/highmem.h>
30#include <linux/pagemap.h>
31#include <asm/tlbflush.h>
32#include <asm/tlb.h>
33
34#include "mmu_decl.h"
35
36/*
37 * Called when unmapping pages to flush entries from the TLB/hash table.
38 */
39void flush_hash_entry(struct mm_struct *mm, pte_t *ptep, unsigned long addr)
40{
41 unsigned long ptephys;
42
43 if (Hash != 0) {
44 ptephys = __pa(ptep) & PAGE_MASK;
45 flush_hash_pages(mm->context.id, addr, ptephys, 1);
46 }
47}
48
49/*
50 * Called by ptep_set_access_flags, must flush on CPUs for which the
51 * DSI handler can't just "fixup" the TLB on a write fault
52 */
53void flush_tlb_page_nohash(struct vm_area_struct *vma, unsigned long addr)
54{
55 if (Hash != 0)
56 return;
57 _tlbie(addr);
58}
59
60/*
61 * Called at the end of a mmu_gather operation to make sure the
62 * TLB flush is completely done.
63 */
64void tlb_flush(struct mmu_gather *tlb)
65{
66 if (Hash == 0) {
67 /*
68 * 603 needs to flush the whole TLB here since
69 * it doesn't use a hash table.
70 */
71 _tlbia();
72 }
73}
74
75/*
76 * TLB flushing:
77 *
78 * - flush_tlb_mm(mm) flushes the specified mm context TLB's
79 * - flush_tlb_page(vma, vmaddr) flushes one page
80 * - flush_tlb_range(vma, start, end) flushes a range of pages
81 * - flush_tlb_kernel_range(start, end) flushes kernel pages
82 *
83 * since the hardware hash table functions as an extension of the
84 * tlb as far as the linux tables are concerned, flush it too.
85 * -- Cort
86 */
87
88/*
89 * 750 SMP is a Bad Idea because the 750 doesn't broadcast all
90 * the cache operations on the bus. Hence we need to use an IPI
91 * to get the other CPU(s) to invalidate their TLBs.
92 */
93#ifdef CONFIG_SMP_750
94#define FINISH_FLUSH smp_send_tlb_invalidate(0)
95#else
96#define FINISH_FLUSH do { } while (0)
97#endif
98
99static void flush_range(struct mm_struct *mm, unsigned long start,
100 unsigned long end)
101{
102 pmd_t *pmd;
103 unsigned long pmd_end;
104 int count;
105 unsigned int ctx = mm->context.id;
106
107 if (Hash == 0) {
108 _tlbia();
109 return;
110 }
111 start &= PAGE_MASK;
112 if (start >= end)
113 return;
114 end = (end - 1) | ~PAGE_MASK;
115 pmd = pmd_offset(pgd_offset(mm, start), start);
116 for (;;) {
117 pmd_end = ((start + PGDIR_SIZE) & PGDIR_MASK) - 1;
118 if (pmd_end > end)
119 pmd_end = end;
120 if (!pmd_none(*pmd)) {
121 count = ((pmd_end - start) >> PAGE_SHIFT) + 1;
122 flush_hash_pages(ctx, start, pmd_val(*pmd), count);
123 }
124 if (pmd_end == end)
125 break;
126 start = pmd_end + 1;
127 ++pmd;
128 }
129}
130
131/*
132 * Flush kernel TLB entries in the given range
133 */
134void flush_tlb_kernel_range(unsigned long start, unsigned long end)
135{
136 flush_range(&init_mm, start, end);
137 FINISH_FLUSH;
138}
139
140/*
141 * Flush all the (user) entries for the address space described by mm.
142 */
143void flush_tlb_mm(struct mm_struct *mm)
144{
145 struct vm_area_struct *mp;
146
147 if (Hash == 0) {
148 _tlbia();
149 return;
150 }
151
152 for (mp = mm->mmap; mp != NULL; mp = mp->vm_next)
153 flush_range(mp->vm_mm, mp->vm_start, mp->vm_end);
154 FINISH_FLUSH;
155}
156
157void flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr)
158{
159 struct mm_struct *mm;
160 pmd_t *pmd;
161
162 if (Hash == 0) {
163 _tlbie(vmaddr);
164 return;
165 }
166 mm = (vmaddr < TASK_SIZE)? vma->vm_mm: &init_mm;
167 pmd = pmd_offset(pgd_offset(mm, vmaddr), vmaddr);
168 if (!pmd_none(*pmd))
169 flush_hash_pages(mm->context.id, vmaddr, pmd_val(*pmd), 1);
170 FINISH_FLUSH;
171}
172
173/*
174 * For each address in the range, find the pte for the address
175 * and check _PAGE_HASHPTE bit; if it is set, find and destroy
176 * the corresponding HPTE.
177 */
178void flush_tlb_range(struct vm_area_struct *vma, unsigned long start,
179 unsigned long end)
180{
181 flush_range(vma->vm_mm, start, end);
182 FINISH_FLUSH;
183}
diff --git a/arch/ppc/platforms/4xx/Kconfig b/arch/ppc/platforms/4xx/Kconfig
deleted file mode 100644
index 76551b679030..000000000000
--- a/arch/ppc/platforms/4xx/Kconfig
+++ /dev/null
@@ -1,285 +0,0 @@
1config 4xx
2 bool
3 depends on 40x || 44x
4 default y
5
6config WANT_EARLY_SERIAL
7 bool
8 select SERIAL_8250
9 default n
10
11menu "IBM 4xx options"
12 depends on 4xx
13
14choice
15 prompt "Machine Type"
16 depends on 40x
17 default WALNUT
18
19config BUBINGA
20 bool "Bubinga"
21 select WANT_EARLY_SERIAL
22 help
23 This option enables support for the IBM 405EP evaluation board.
24
25config CPCI405
26 bool "CPCI405"
27 help
28 This option enables support for the CPCI405 board.
29
30config EP405
31 bool "EP405/EP405PC"
32 select EMBEDDEDBOOT
33 help
34 This option enables support for the EP405/EP405PC boards.
35
36config REDWOOD_5
37 bool "Redwood-5"
38 help
39 This option enables support for the IBM STB04 evaluation board.
40
41config REDWOOD_6
42 bool "Redwood-6"
43 help
44 This option enables support for the IBM STBx25xx evaluation board.
45
46config SYCAMORE
47 bool "Sycamore"
48 help
49 This option enables support for the IBM PPC405GPr evaluation board.
50
51config WALNUT
52 bool "Walnut"
53 help
54 This option enables support for the IBM PPC405GP evaluation board.
55
56config XILINX_ML300
57 bool "Xilinx-ML300"
58 select XILINX_VIRTEX_II_PRO
59 select EMBEDDEDBOOT
60 help
61 This option enables support for the Xilinx ML300 evaluation board.
62
63config XILINX_ML403
64 bool "Xilinx-ML403"
65 select XILINX_VIRTEX_4_FX
66 select EMBEDDEDBOOT
67 help
68 This option enables support for the Xilinx ML403 evaluation board.
69endchoice
70
71choice
72 prompt "Machine Type"
73 depends on 44x
74 default EBONY
75
76config BAMBOO
77 bool "Bamboo"
78 select WANT_EARLY_SERIAL
79 help
80 This option enables support for the IBM PPC440EP evaluation board.
81
82config EBONY
83 bool "Ebony"
84 select WANT_EARLY_SERIAL
85 help
86 This option enables support for the IBM PPC440GP evaluation board.
87
88config LUAN
89 bool "Luan"
90 select WANT_EARLY_SERIAL
91 help
92 This option enables support for the IBM PPC440SP evaluation board.
93
94config YUCCA
95 bool "Yucca"
96 select WANT_EARLY_SERIAL
97 help
98 This option enables support for the AMCC PPC440SPe evaluation board.
99
100config OCOTEA
101 bool "Ocotea"
102 select WANT_EARLY_SERIAL
103 help
104 This option enables support for the IBM PPC440GX evaluation board.
105
106config TAISHAN
107 bool "Taishan"
108 select WANT_EARLY_SERIAL
109 help
110 This option enables support for the AMCC PPC440GX evaluation board.
111
112endchoice
113
114config EP405PC
115 bool "EP405PC Support"
116 depends on EP405
117
118
119# It's often necessary to know the specific 4xx processor type.
120# Fortunately, it is impled (so far) from the board type, so we
121# don't need to ask more redundant questions.
122config NP405H
123 bool
124 depends on ASH
125 default y
126
127config 440EP
128 bool
129 depends on BAMBOO
130 select PPC_FPU
131 default y
132
133config 440GP
134 bool
135 depends on EBONY
136 default y
137
138config 440GX
139 bool
140 depends on OCOTEA || TAISHAN
141 default y
142
143config 440SP
144 bool
145 depends on LUAN
146 default y
147
148config 440SPE
149 bool
150 depends on YUCCA
151 default y
152
153config 440
154 bool
155 depends on 440GP || 440SP || 440SPE || 440EP
156 default y
157
158config 440A
159 bool
160 depends on 440GX
161 default y
162
163config IBM440EP_ERR42
164 bool
165 depends on 440EP
166 default y
167
168# All 405-based cores up until the 405GPR and 405EP have this errata.
169config IBM405_ERR77
170 bool
171 depends on 40x && !403GCX && !405GPR && !405EP
172 default y
173
174# All 40x-based cores, up until the 405GPR and 405EP have this errata.
175config IBM405_ERR51
176 bool
177 depends on 40x && !405GPR && !405EP
178 default y
179
180config BOOKE
181 bool
182 depends on 44x
183 default y
184
185config IBM_OCP
186 bool
187 depends on ASH || BAMBOO || BUBINGA || CPCI405 || EBONY || EP405 || LUAN || YUCCA || OCOTEA || REDWOOD_5 || REDWOOD_6 || SYCAMORE || TAISHAN || WALNUT
188 default y
189
190config IBM_EMAC4
191 bool
192 depends on 440GX || 440SP || 440SPE
193 default y
194
195config BIOS_FIXUP
196 bool
197 depends on BUBINGA || EP405 || SYCAMORE || WALNUT || CPCI405
198 default y
199
200# OAK doesn't exist but wanted to keep this around for any future 403GCX boards
201config 403GCX
202 bool
203 depends on OAK
204 default y
205
206config 405EP
207 bool
208 depends on BUBINGA
209 default y
210
211config 405GP
212 bool
213 depends on CPCI405 || EP405 || WALNUT
214 default y
215
216config 405GPR
217 bool
218 depends on SYCAMORE
219 default y
220
221config XILINX_VIRTEX_II_PRO
222 bool
223 select XILINX_VIRTEX
224
225config XILINX_VIRTEX_4_FX
226 bool
227 select XILINX_VIRTEX
228
229config XILINX_VIRTEX
230 bool
231
232config STB03xxx
233 bool
234 depends on REDWOOD_5 || REDWOOD_6
235 default y
236
237config EMBEDDEDBOOT
238 bool
239
240config IBM_OPENBIOS
241 bool
242 depends on ASH || REDWOOD_5 || REDWOOD_6
243 default y
244
245config PPC4xx_DMA
246 bool "PPC4xx DMA controller support"
247 depends on 4xx
248
249config PPC4xx_EDMA
250 bool
251 depends on !STB03xxx && PPC4xx_DMA
252 default y
253
254config PPC_GEN550
255 bool
256 depends on 4xx
257 default y
258
259choice
260 prompt "TTYS0 device and default console"
261 depends on 40x
262 default UART0_TTYS0
263
264config UART0_TTYS0
265 bool "UART0"
266
267config UART0_TTYS1
268 bool "UART1"
269
270endchoice
271
272config SERIAL_SICC
273 bool "SICC Serial port support"
274 depends on STB03xxx
275
276config UART1_DFLT_CONSOLE
277 bool
278 depends on SERIAL_SICC && UART0_TTYS1
279 default y
280
281config SERIAL_SICC_CONSOLE
282 bool
283 depends on SERIAL_SICC && UART0_TTYS1
284 default y
285endmenu
diff --git a/arch/ppc/platforms/4xx/Makefile b/arch/ppc/platforms/4xx/Makefile
deleted file mode 100644
index 723ad7985cc6..000000000000
--- a/arch/ppc/platforms/4xx/Makefile
+++ /dev/null
@@ -1,31 +0,0 @@
1#
2# Makefile for the PowerPC 4xx linux kernel.
3
4obj-$(CONFIG_BAMBOO) += bamboo.o
5obj-$(CONFIG_CPCI405) += cpci405.o
6obj-$(CONFIG_EBONY) += ebony.o
7obj-$(CONFIG_EP405) += ep405.o
8obj-$(CONFIG_BUBINGA) += bubinga.o
9obj-$(CONFIG_LUAN) += luan.o
10obj-$(CONFIG_YUCCA) += yucca.o
11obj-$(CONFIG_OCOTEA) += ocotea.o
12obj-$(CONFIG_REDWOOD_5) += redwood5.o
13obj-$(CONFIG_REDWOOD_6) += redwood6.o
14obj-$(CONFIG_SYCAMORE) += sycamore.o
15obj-$(CONFIG_TAISHAN) += taishan.o
16obj-$(CONFIG_WALNUT) += walnut.o
17obj-$(CONFIG_XILINX_ML300) += xilinx_ml300.o
18obj-$(CONFIG_XILINX_ML403) += xilinx_ml403.o
19
20obj-$(CONFIG_405GP) += ibm405gp.o
21obj-$(CONFIG_REDWOOD_5) += ibmstb4.o
22obj-$(CONFIG_NP405H) += ibmnp405h.o
23obj-$(CONFIG_REDWOOD_6) += ibmstbx25.o
24obj-$(CONFIG_440EP) += ibm440ep.o
25obj-$(CONFIG_440GP) += ibm440gp.o
26obj-$(CONFIG_440GX) += ibm440gx.o
27obj-$(CONFIG_440SP) += ibm440sp.o
28obj-$(CONFIG_440SPE) += ppc440spe.o
29obj-$(CONFIG_405EP) += ibm405ep.o
30obj-$(CONFIG_405GPR) += ibm405gpr.o
31
diff --git a/arch/ppc/platforms/4xx/bamboo.c b/arch/ppc/platforms/4xx/bamboo.c
deleted file mode 100644
index 01f20f4c14fe..000000000000
--- a/arch/ppc/platforms/4xx/bamboo.c
+++ /dev/null
@@ -1,442 +0,0 @@
1/*
2 * Bamboo board specific routines
3 *
4 * Wade Farnsworth <wfarnsworth@mvista.com>
5 * Copyright 2004 MontaVista Software Inc.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 */
12
13#include <linux/stddef.h>
14#include <linux/kernel.h>
15#include <linux/init.h>
16#include <linux/errno.h>
17#include <linux/reboot.h>
18#include <linux/pci.h>
19#include <linux/kdev_t.h>
20#include <linux/types.h>
21#include <linux/major.h>
22#include <linux/blkdev.h>
23#include <linux/console.h>
24#include <linux/delay.h>
25#include <linux/initrd.h>
26#include <linux/seq_file.h>
27#include <linux/root_dev.h>
28#include <linux/tty.h>
29#include <linux/serial.h>
30#include <linux/serial_core.h>
31#include <linux/serial_8250.h>
32#include <linux/ethtool.h>
33
34#include <asm/system.h>
35#include <asm/pgtable.h>
36#include <asm/page.h>
37#include <asm/dma.h>
38#include <asm/io.h>
39#include <asm/machdep.h>
40#include <asm/ocp.h>
41#include <asm/pci-bridge.h>
42#include <asm/time.h>
43#include <asm/todc.h>
44#include <asm/bootinfo.h>
45#include <asm/ppc4xx_pic.h>
46#include <asm/ppcboot.h>
47
48#include <syslib/gen550.h>
49#include <syslib/ibm440gx_common.h>
50
51extern bd_t __res;
52
53static struct ibm44x_clocks clocks __initdata;
54
55/*
56 * Bamboo external IRQ triggering/polarity settings
57 */
58unsigned char ppc4xx_uic_ext_irq_cfg[] __initdata = {
59 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* IRQ0: Ethernet transceiver */
60 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* IRQ1: Expansion connector */
61 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* IRQ2: PCI slot 0 */
62 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* IRQ3: PCI slot 1 */
63 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* IRQ4: PCI slot 2 */
64 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* IRQ5: PCI slot 3 */
65 (IRQ_SENSE_EDGE | IRQ_POLARITY_NEGATIVE), /* IRQ6: SMI pushbutton */
66 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* IRQ7: EXT */
67 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* IRQ8: EXT */
68 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* IRQ9: EXT */
69};
70
71static void __init
72bamboo_calibrate_decr(void)
73{
74 unsigned int freq;
75
76 if (mfspr(SPRN_CCR1) & CCR1_TCS)
77 freq = BAMBOO_TMRCLK;
78 else
79 freq = clocks.cpu;
80
81 ibm44x_calibrate_decr(freq);
82
83}
84
85static int
86bamboo_show_cpuinfo(struct seq_file *m)
87{
88 seq_printf(m, "vendor\t\t: IBM\n");
89 seq_printf(m, "machine\t\t: PPC440EP EVB (Bamboo)\n");
90
91 return 0;
92}
93
94static inline int
95bamboo_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
96{
97 static char pci_irq_table[][4] =
98 /*
99 * PCI IDSEL/INTPIN->INTLINE
100 * A B C D
101 */
102 {
103 { 28, 28, 28, 28 }, /* IDSEL 1 - PCI Slot 0 */
104 { 27, 27, 27, 27 }, /* IDSEL 2 - PCI Slot 1 */
105 { 26, 26, 26, 26 }, /* IDSEL 3 - PCI Slot 2 */
106 { 25, 25, 25, 25 }, /* IDSEL 4 - PCI Slot 3 */
107 };
108
109 const long min_idsel = 1, max_idsel = 4, irqs_per_slot = 4;
110 return PCI_IRQ_TABLE_LOOKUP;
111}
112
113static void __init bamboo_set_emacdata(void)
114{
115 u8 * base_addr;
116 struct ocp_def *def;
117 struct ocp_func_emac_data *emacdata;
118 u8 val;
119 int mode;
120 u32 excluded = 0;
121
122 base_addr = ioremap64(BAMBOO_FPGA_SELECTION1_REG_ADDR, 16);
123 val = readb(base_addr);
124 iounmap((void *) base_addr);
125 if (BAMBOO_SEL_MII(val))
126 mode = PHY_MODE_MII;
127 else if (BAMBOO_SEL_RMII(val))
128 mode = PHY_MODE_RMII;
129 else
130 mode = PHY_MODE_SMII;
131
132 /*
133 * SW2 on the Bamboo is used for ethernet configuration and is accessed
134 * via the CONFIG2 register in the FPGA. If the ANEG pin is set,
135 * overwrite the supported features with the settings in SW2.
136 *
137 * This is used as a workaround for the improperly biased RJ-45 sockets
138 * on the Rev. 0 Bamboo. By default only 10baseT is functional.
139 * Removing inductors L17 and L18 from the board allows 100baseT, but
140 * disables 10baseT. The Rev. 1 has no such limitations.
141 */
142
143 base_addr = ioremap64(BAMBOO_FPGA_CONFIG2_REG_ADDR, 8);
144 val = readb(base_addr);
145 iounmap((void *) base_addr);
146 if (!BAMBOO_AUTONEGOTIATE(val)) {
147 excluded |= SUPPORTED_Autoneg;
148 if (BAMBOO_FORCE_100Mbps(val)) {
149 excluded |= SUPPORTED_10baseT_Full;
150 excluded |= SUPPORTED_10baseT_Half;
151 if (BAMBOO_FULL_DUPLEX_EN(val))
152 excluded |= SUPPORTED_100baseT_Half;
153 else
154 excluded |= SUPPORTED_100baseT_Full;
155 } else {
156 excluded |= SUPPORTED_100baseT_Full;
157 excluded |= SUPPORTED_100baseT_Half;
158 if (BAMBOO_FULL_DUPLEX_EN(val))
159 excluded |= SUPPORTED_10baseT_Half;
160 else
161 excluded |= SUPPORTED_10baseT_Full;
162 }
163 }
164
165 /* Set mac_addr, phy mode and unsupported phy features for each EMAC */
166
167 def = ocp_get_one_device(OCP_VENDOR_IBM, OCP_FUNC_EMAC, 0);
168 emacdata = def->additions;
169 memcpy(emacdata->mac_addr, __res.bi_enetaddr, 6);
170 emacdata->phy_mode = mode;
171 emacdata->phy_feat_exc = excluded;
172
173 def = ocp_get_one_device(OCP_VENDOR_IBM, OCP_FUNC_EMAC, 1);
174 emacdata = def->additions;
175 memcpy(emacdata->mac_addr, __res.bi_enet1addr, 6);
176 emacdata->phy_mode = mode;
177 emacdata->phy_feat_exc = excluded;
178}
179
180static int
181bamboo_exclude_device(unsigned char bus, unsigned char devfn)
182{
183 return (bus == 0 && devfn == 0);
184}
185
186#define PCI_READW(offset) \
187 (readw((void *)((u32)pci_reg_base+offset)))
188
189#define PCI_WRITEW(value, offset) \
190 (writew(value, (void *)((u32)pci_reg_base+offset)))
191
192#define PCI_WRITEL(value, offset) \
193 (writel(value, (void *)((u32)pci_reg_base+offset)))
194
195static void __init
196bamboo_setup_pci(void)
197{
198 void *pci_reg_base;
199 unsigned long memory_size;
200 memory_size = ppc_md.find_end_of_memory();
201
202 pci_reg_base = ioremap64(BAMBOO_PCIL0_BASE, BAMBOO_PCIL0_SIZE);
203
204 /* Enable PCI I/O, Mem, and Busmaster cycles */
205 PCI_WRITEW(PCI_READW(PCI_COMMAND) |
206 PCI_COMMAND_MEMORY |
207 PCI_COMMAND_MASTER, PCI_COMMAND);
208
209 /* Disable region first */
210 PCI_WRITEL(0, BAMBOO_PCIL0_PMM0MA);
211
212 /* PLB starting addr: 0x00000000A0000000 */
213 PCI_WRITEL(BAMBOO_PCI_PHY_MEM_BASE, BAMBOO_PCIL0_PMM0LA);
214
215 /* PCI start addr, 0xA0000000 (PCI Address) */
216 PCI_WRITEL(BAMBOO_PCI_MEM_BASE, BAMBOO_PCIL0_PMM0PCILA);
217 PCI_WRITEL(0, BAMBOO_PCIL0_PMM0PCIHA);
218
219 /* Enable no pre-fetch, enable region */
220 PCI_WRITEL(((0xffffffff -
221 (BAMBOO_PCI_UPPER_MEM - BAMBOO_PCI_MEM_BASE)) | 0x01),
222 BAMBOO_PCIL0_PMM0MA);
223
224 /* Disable region one */
225 PCI_WRITEL(0, BAMBOO_PCIL0_PMM1MA);
226 PCI_WRITEL(0, BAMBOO_PCIL0_PMM1LA);
227 PCI_WRITEL(0, BAMBOO_PCIL0_PMM1PCILA);
228 PCI_WRITEL(0, BAMBOO_PCIL0_PMM1PCIHA);
229 PCI_WRITEL(0, BAMBOO_PCIL0_PMM1MA);
230
231 /* Disable region two */
232 PCI_WRITEL(0, BAMBOO_PCIL0_PMM2MA);
233 PCI_WRITEL(0, BAMBOO_PCIL0_PMM2LA);
234 PCI_WRITEL(0, BAMBOO_PCIL0_PMM2PCILA);
235 PCI_WRITEL(0, BAMBOO_PCIL0_PMM2PCIHA);
236 PCI_WRITEL(0, BAMBOO_PCIL0_PMM2MA);
237
238 /* Now configure the PCI->PLB windows, we only use PTM1
239 *
240 * For Inbound flow, set the window size to all available memory
241 * This is required because if size is smaller,
242 * then Eth/PCI DD would fail as PCI card not able to access
243 * the memory allocated by DD.
244 */
245
246 PCI_WRITEL(0, BAMBOO_PCIL0_PTM1MS); /* disabled region 1 */
247 PCI_WRITEL(0, BAMBOO_PCIL0_PTM1LA); /* begin of address map */
248
249 memory_size = 1 << fls(memory_size - 1);
250
251 /* Size low + Enabled */
252 PCI_WRITEL((0xffffffff - (memory_size - 1)) | 0x1, BAMBOO_PCIL0_PTM1MS);
253
254 eieio();
255 iounmap(pci_reg_base);
256}
257
258static void __init
259bamboo_setup_hose(void)
260{
261 unsigned int bar_response, bar;
262 struct pci_controller *hose;
263
264 bamboo_setup_pci();
265
266 hose = pcibios_alloc_controller();
267
268 if (!hose)
269 return;
270
271 hose->first_busno = 0;
272 hose->last_busno = 0xff;
273
274 hose->pci_mem_offset = BAMBOO_PCI_MEM_OFFSET;
275
276 pci_init_resource(&hose->io_resource,
277 BAMBOO_PCI_LOWER_IO,
278 BAMBOO_PCI_UPPER_IO,
279 IORESOURCE_IO,
280 "PCI host bridge");
281
282 pci_init_resource(&hose->mem_resources[0],
283 BAMBOO_PCI_LOWER_MEM,
284 BAMBOO_PCI_UPPER_MEM,
285 IORESOURCE_MEM,
286 "PCI host bridge");
287
288 ppc_md.pci_exclude_device = bamboo_exclude_device;
289
290 hose->io_space.start = BAMBOO_PCI_LOWER_IO;
291 hose->io_space.end = BAMBOO_PCI_UPPER_IO;
292 hose->mem_space.start = BAMBOO_PCI_LOWER_MEM;
293 hose->mem_space.end = BAMBOO_PCI_UPPER_MEM;
294 isa_io_base =
295 (unsigned long)ioremap64(BAMBOO_PCI_IO_BASE, BAMBOO_PCI_IO_SIZE);
296 hose->io_base_virt = (void *)isa_io_base;
297
298 setup_indirect_pci(hose,
299 BAMBOO_PCI_CFGA_PLB32,
300 BAMBOO_PCI_CFGD_PLB32);
301 hose->set_cfg_type = 1;
302
303 /* Zero config bars */
304 for (bar = PCI_BASE_ADDRESS_1; bar <= PCI_BASE_ADDRESS_2; bar += 4) {
305 early_write_config_dword(hose, hose->first_busno,
306 PCI_FUNC(hose->first_busno), bar,
307 0x00000000);
308 early_read_config_dword(hose, hose->first_busno,
309 PCI_FUNC(hose->first_busno), bar,
310 &bar_response);
311 }
312
313 hose->last_busno = pciauto_bus_scan(hose, hose->first_busno);
314
315 ppc_md.pci_swizzle = common_swizzle;
316 ppc_md.pci_map_irq = bamboo_map_irq;
317}
318
319TODC_ALLOC();
320
321static void __init
322bamboo_early_serial_map(void)
323{
324 struct uart_port port;
325
326 /* Setup ioremapped serial port access */
327 memset(&port, 0, sizeof(port));
328 port.membase = ioremap64(PPC440EP_UART0_ADDR, 8);
329 port.irq = 0;
330 port.uartclk = clocks.uart0;
331 port.regshift = 0;
332 port.iotype = UPIO_MEM;
333 port.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST;
334 port.line = 0;
335
336 if (early_serial_setup(&port) != 0) {
337 printk("Early serial init of port 0 failed\n");
338 }
339
340#if defined(CONFIG_SERIAL_TEXT_DEBUG) || defined(CONFIG_KGDB)
341 /* Configure debug serial access */
342 gen550_init(0, &port);
343#endif
344
345 port.membase = ioremap64(PPC440EP_UART1_ADDR, 8);
346 port.irq = 1;
347 port.uartclk = clocks.uart1;
348 port.line = 1;
349
350 if (early_serial_setup(&port) != 0) {
351 printk("Early serial init of port 1 failed\n");
352 }
353
354#if defined(CONFIG_SERIAL_TEXT_DEBUG) || defined(CONFIG_KGDB)
355 /* Configure debug serial access */
356 gen550_init(1, &port);
357#endif
358
359 port.membase = ioremap64(PPC440EP_UART2_ADDR, 8);
360 port.irq = 3;
361 port.uartclk = clocks.uart2;
362 port.line = 2;
363
364 if (early_serial_setup(&port) != 0) {
365 printk("Early serial init of port 2 failed\n");
366 }
367
368#if defined(CONFIG_SERIAL_TEXT_DEBUG) || defined(CONFIG_KGDB)
369 /* Configure debug serial access */
370 gen550_init(2, &port);
371#endif
372
373 port.membase = ioremap64(PPC440EP_UART3_ADDR, 8);
374 port.irq = 4;
375 port.uartclk = clocks.uart3;
376 port.line = 3;
377
378 if (early_serial_setup(&port) != 0) {
379 printk("Early serial init of port 3 failed\n");
380 }
381}
382
383static void __init
384bamboo_setup_arch(void)
385{
386
387 bamboo_set_emacdata();
388
389 ibm440gx_get_clocks(&clocks, 33333333, 6 * 1843200);
390 ocp_sys_info.opb_bus_freq = clocks.opb;
391
392 /* Setup TODC access */
393 TODC_INIT(TODC_TYPE_DS1743,
394 0,
395 0,
396 ioremap64(BAMBOO_RTC_ADDR, BAMBOO_RTC_SIZE),
397 8);
398
399 /* init to some ~sane value until calibrate_delay() runs */
400 loops_per_jiffy = 50000000/HZ;
401
402 /* Setup PCI host bridge */
403 bamboo_setup_hose();
404
405#ifdef CONFIG_BLK_DEV_INITRD
406 if (initrd_start)
407 ROOT_DEV = Root_RAM0;
408 else
409#endif
410#ifdef CONFIG_ROOT_NFS
411 ROOT_DEV = Root_NFS;
412#else
413 ROOT_DEV = Root_HDA1;
414#endif
415
416 bamboo_early_serial_map();
417
418 /* Identify the system */
419 printk("IBM Bamboo port (MontaVista Software, Inc. (source@mvista.com))\n");
420}
421
422void __init platform_init(unsigned long r3, unsigned long r4,
423 unsigned long r5, unsigned long r6, unsigned long r7)
424{
425 ibm44x_platform_init(r3, r4, r5, r6, r7);
426
427 ppc_md.setup_arch = bamboo_setup_arch;
428 ppc_md.show_cpuinfo = bamboo_show_cpuinfo;
429 ppc_md.get_irq = NULL; /* Set in ppc4xx_pic_init() */
430
431 ppc_md.calibrate_decr = bamboo_calibrate_decr;
432 ppc_md.time_init = todc_time_init;
433 ppc_md.set_rtc_time = todc_set_rtc_time;
434 ppc_md.get_rtc_time = todc_get_rtc_time;
435
436 ppc_md.nvram_read_val = todc_direct_read_val;
437 ppc_md.nvram_write_val = todc_direct_write_val;
438#ifdef CONFIG_KGDB
439 ppc_md.early_serial_map = bamboo_early_serial_map;
440#endif
441}
442
diff --git a/arch/ppc/platforms/4xx/bamboo.h b/arch/ppc/platforms/4xx/bamboo.h
deleted file mode 100644
index dcd3d09a0a71..000000000000
--- a/arch/ppc/platforms/4xx/bamboo.h
+++ /dev/null
@@ -1,133 +0,0 @@
1/*
2 * Bamboo board definitions
3 *
4 * Wade Farnsworth <wfarnsworth@mvista.com>
5 *
6 * Copyright 2004 MontaVista Software Inc.
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
12 */
13
14#ifdef __KERNEL__
15#ifndef __ASM_BAMBOO_H__
16#define __ASM_BAMBOO_H__
17
18#include <platforms/4xx/ibm440ep.h>
19
20/* F/W TLB mapping used in bootloader glue to reset EMAC */
21#define PPC44x_EMAC0_MR0 0x0EF600E00
22
23/* Location of MAC addresses in PIBS image */
24#define PIBS_FLASH_BASE 0xfff00000
25#define PIBS_MAC_BASE (PIBS_FLASH_BASE+0xc0400)
26#define PIBS_MAC_SIZE 0x200
27#define PIBS_MAC_OFFSET 0x100
28
29/* Default clock rate */
30#define BAMBOO_TMRCLK 25000000
31
32/* RTC/NVRAM location */
33#define BAMBOO_RTC_ADDR 0x080000000ULL
34#define BAMBOO_RTC_SIZE 0x2000
35
36/* FPGA Registers */
37#define BAMBOO_FPGA_ADDR 0x080002000ULL
38
39#define BAMBOO_FPGA_CONFIG2_REG_ADDR (BAMBOO_FPGA_ADDR + 0x1)
40#define BAMBOO_FULL_DUPLEX_EN(x) (x & 0x08)
41#define BAMBOO_FORCE_100Mbps(x) (x & 0x04)
42#define BAMBOO_AUTONEGOTIATE(x) (x & 0x02)
43
44#define BAMBOO_FPGA_SETTING_REG_ADDR (BAMBOO_FPGA_ADDR + 0x3)
45#define BAMBOO_BOOT_SMALL_FLASH(x) (!(x & 0x80))
46#define BAMBOO_LARGE_FLASH_EN(x) (!(x & 0x40))
47#define BAMBOO_BOOT_NAND_FLASH(x) (!(x & 0x20))
48
49#define BAMBOO_FPGA_SELECTION1_REG_ADDR (BAMBOO_FPGA_ADDR + 0x4)
50#define BAMBOO_SEL_MII(x) (x & 0x80)
51#define BAMBOO_SEL_RMII(x) (x & 0x40)
52#define BAMBOO_SEL_SMII(x) (x & 0x20)
53
54/* Flash */
55#define BAMBOO_SMALL_FLASH_LOW 0x087f00000ULL
56#define BAMBOO_SMALL_FLASH_HIGH 0x0fff00000ULL
57#define BAMBOO_SMALL_FLASH_SIZE 0x100000
58#define BAMBOO_LARGE_FLASH_LOW 0x087800000ULL
59#define BAMBOO_LARGE_FLASH_HIGH1 0x0ff800000ULL
60#define BAMBOO_LARGE_FLASH_HIGH2 0x0ffc00000ULL
61#define BAMBOO_LARGE_FLASH_SIZE 0x400000
62#define BAMBOO_SRAM_LOW 0x087f00000ULL
63#define BAMBOO_SRAM_HIGH1 0x0fff00000ULL
64#define BAMBOO_SRAM_HIGH2 0x0ff800000ULL
65#define BAMBOO_SRAM_SIZE 0x100000
66#define BAMBOO_NAND_FLASH_REG_ADDR 0x090000000ULL
67#define BAMBOO_NAND_FLASH_REG_SIZE 0x2000
68
69/*
70 * Serial port defines
71 */
72#define RS_TABLE_SIZE 4
73
74#define UART0_IO_BASE 0xEF600300
75#define UART1_IO_BASE 0xEF600400
76#define UART2_IO_BASE 0xEF600500
77#define UART3_IO_BASE 0xEF600600
78
79#define BASE_BAUD 33177600/3/16
80#define UART0_INT 0
81#define UART1_INT 1
82#define UART2_INT 3
83#define UART3_INT 4
84
85#define STD_UART_OP(num) \
86 { 0, BASE_BAUD, 0, UART##num##_INT, \
87 (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST), \
88 iomem_base: (void*)UART##num##_IO_BASE, \
89 io_type: SERIAL_IO_MEM},
90
91#define SERIAL_PORT_DFNS \
92 STD_UART_OP(0) \
93 STD_UART_OP(1) \
94 STD_UART_OP(2) \
95 STD_UART_OP(3)
96
97/* PCI support */
98#define BAMBOO_PCI_CFGA_PLB32 0xeec00000
99#define BAMBOO_PCI_CFGD_PLB32 0xeec00004
100
101#define BAMBOO_PCI_IO_BASE 0x00000000e8000000ULL
102#define BAMBOO_PCI_IO_SIZE 0x00010000
103#define BAMBOO_PCI_MEM_OFFSET 0x00000000
104#define BAMBOO_PCI_PHY_MEM_BASE 0x00000000a0000000ULL
105
106#define BAMBOO_PCI_LOWER_IO 0x00000000
107#define BAMBOO_PCI_UPPER_IO 0x0000ffff
108#define BAMBOO_PCI_LOWER_MEM 0xa0000000
109#define BAMBOO_PCI_UPPER_MEM 0xafffffff
110#define BAMBOO_PCI_MEM_BASE 0xa0000000
111
112#define BAMBOO_PCIL0_BASE 0x00000000ef400000ULL
113#define BAMBOO_PCIL0_SIZE 0x40
114
115#define BAMBOO_PCIL0_PMM0LA 0x000
116#define BAMBOO_PCIL0_PMM0MA 0x004
117#define BAMBOO_PCIL0_PMM0PCILA 0x008
118#define BAMBOO_PCIL0_PMM0PCIHA 0x00C
119#define BAMBOO_PCIL0_PMM1LA 0x010
120#define BAMBOO_PCIL0_PMM1MA 0x014
121#define BAMBOO_PCIL0_PMM1PCILA 0x018
122#define BAMBOO_PCIL0_PMM1PCIHA 0x01C
123#define BAMBOO_PCIL0_PMM2LA 0x020
124#define BAMBOO_PCIL0_PMM2MA 0x024
125#define BAMBOO_PCIL0_PMM2PCILA 0x028
126#define BAMBOO_PCIL0_PMM2PCIHA 0x02C
127#define BAMBOO_PCIL0_PTM1MS 0x030
128#define BAMBOO_PCIL0_PTM1LA 0x034
129#define BAMBOO_PCIL0_PTM2MS 0x038
130#define BAMBOO_PCIL0_PTM2LA 0x03C
131
132#endif /* __ASM_BAMBOO_H__ */
133#endif /* __KERNEL__ */
diff --git a/arch/ppc/platforms/4xx/bubinga.c b/arch/ppc/platforms/4xx/bubinga.c
deleted file mode 100644
index cd696be55aca..000000000000
--- a/arch/ppc/platforms/4xx/bubinga.c
+++ /dev/null
@@ -1,265 +0,0 @@
1/*
2 * Support for IBM PPC 405EP evaluation board (Bubinga).
3 *
4 * Author: SAW (IBM), derived from walnut.c.
5 * Maintained by MontaVista Software <source@mvista.com>
6 *
7 * 2003 (c) MontaVista Softare Inc. This file is licensed under the
8 * terms of the GNU General Public License version 2. This program is
9 * licensed "as is" without any warranty of any kind, whether express
10 * or implied.
11 */
12
13#include <linux/init.h>
14#include <linux/smp.h>
15#include <linux/threads.h>
16#include <linux/param.h>
17#include <linux/string.h>
18#include <linux/blkdev.h>
19#include <linux/pci.h>
20#include <linux/rtc.h>
21#include <linux/tty.h>
22#include <linux/serial.h>
23#include <linux/serial_core.h>
24#include <linux/serial_8250.h>
25
26#include <asm/system.h>
27#include <asm/pci-bridge.h>
28#include <asm/processor.h>
29#include <asm/machdep.h>
30#include <asm/page.h>
31#include <asm/time.h>
32#include <asm/io.h>
33#include <asm/todc.h>
34#include <asm/kgdb.h>
35#include <asm/ocp.h>
36#include <asm/ibm_ocp_pci.h>
37
38#include <platforms/4xx/ibm405ep.h>
39
40#undef DEBUG
41
42#ifdef DEBUG
43#define DBG(x...) printk(x)
44#else
45#define DBG(x...)
46#endif
47
48extern bd_t __res;
49
50void *bubinga_rtc_base;
51
52/* Some IRQs unique to the board
53 * Used by the generic 405 PCI setup functions in ppc4xx_pci.c
54 */
55int __init
56ppc405_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
57{
58 static char pci_irq_table[][4] =
59 /*
60 * PCI IDSEL/INTPIN->INTLINE
61 * A B C D
62 */
63 {
64 {28, 28, 28, 28}, /* IDSEL 1 - PCI slot 1 */
65 {29, 29, 29, 29}, /* IDSEL 2 - PCI slot 2 */
66 {30, 30, 30, 30}, /* IDSEL 3 - PCI slot 3 */
67 {31, 31, 31, 31}, /* IDSEL 4 - PCI slot 4 */
68 };
69
70 const long min_idsel = 1, max_idsel = 4, irqs_per_slot = 4;
71 return PCI_IRQ_TABLE_LOOKUP;
72};
73
74/* The serial clock for the chip is an internal clock determined by
75 * different clock speeds/dividers.
76 * Calculate the proper input baud rate and setup the serial driver.
77 */
78static void __init
79bubinga_early_serial_map(void)
80{
81 u32 uart_div;
82 int uart_clock;
83 struct uart_port port;
84
85 /* Calculate the serial clock input frequency
86 *
87 * The base baud is the PLL OUTA (provided in the board info
88 * structure) divided by the external UART Divisor, divided
89 * by 16.
90 */
91 uart_div = (mfdcr(DCRN_CPC0_UCR_BASE) & DCRN_CPC0_UCR_U0DIV);
92 uart_clock = __res.bi_procfreq / uart_div;
93
94 /* Setup serial port access */
95 memset(&port, 0, sizeof(port));
96 port.membase = (void*)ACTING_UART0_IO_BASE;
97 port.irq = ACTING_UART0_INT;
98 port.uartclk = uart_clock;
99 port.regshift = 0;
100 port.iotype = UPIO_MEM;
101 port.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST;
102 port.line = 0;
103
104 if (early_serial_setup(&port) != 0) {
105 printk("Early serial init of port 0 failed\n");
106 }
107
108 port.membase = (void*)ACTING_UART1_IO_BASE;
109 port.irq = ACTING_UART1_INT;
110 port.line = 1;
111
112 if (early_serial_setup(&port) != 0) {
113 printk("Early serial init of port 1 failed\n");
114 }
115}
116
117void __init
118bios_fixup(struct pci_controller *hose, struct pcil0_regs *pcip)
119{
120#ifdef CONFIG_PCI
121
122 unsigned int bar_response, bar;
123 /*
124 * Expected PCI mapping:
125 *
126 * PLB addr PCI memory addr
127 * --------------------- ---------------------
128 * 0000'0000 - 7fff'ffff <--- 0000'0000 - 7fff'ffff
129 * 8000'0000 - Bfff'ffff ---> 8000'0000 - Bfff'ffff
130 *
131 * PLB addr PCI io addr
132 * --------------------- ---------------------
133 * e800'0000 - e800'ffff ---> 0000'0000 - 0001'0000
134 *
135 * The following code is simplified by assuming that the bootrom
136 * has been well behaved in following this mapping.
137 */
138
139#ifdef DEBUG
140 int i;
141
142 printk("ioremap PCLIO_BASE = 0x%x\n", pcip);
143 printk("PCI bridge regs before fixup \n");
144 for (i = 0; i <= 3; i++) {
145 printk(" pmm%dma\t0x%x\n", i, in_le32(&(pcip->pmm[i].ma)));
146 printk(" pmm%dma\t0x%x\n", i, in_le32(&(pcip->pmm[i].la)));
147 printk(" pmm%dma\t0x%x\n", i, in_le32(&(pcip->pmm[i].pcila)));
148 printk(" pmm%dma\t0x%x\n", i, in_le32(&(pcip->pmm[i].pciha)));
149 }
150 printk(" ptm1ms\t0x%x\n", in_le32(&(pcip->ptm1ms)));
151 printk(" ptm1la\t0x%x\n", in_le32(&(pcip->ptm1la)));
152 printk(" ptm2ms\t0x%x\n", in_le32(&(pcip->ptm2ms)));
153 printk(" ptm2la\t0x%x\n", in_le32(&(pcip->ptm2la)));
154
155#endif
156
157 /* added for IBM boot rom version 1.15 bios bar changes -AK */
158
159 /* Disable region first */
160 out_le32((void *) &(pcip->pmm[0].ma), 0x00000000);
161 /* PLB starting addr, PCI: 0x80000000 */
162 out_le32((void *) &(pcip->pmm[0].la), 0x80000000);
163 /* PCI start addr, 0x80000000 */
164 out_le32((void *) &(pcip->pmm[0].pcila), PPC405_PCI_MEM_BASE);
165 /* 512MB range of PLB to PCI */
166 out_le32((void *) &(pcip->pmm[0].pciha), 0x00000000);
167 /* Enable no pre-fetch, enable region */
168 out_le32((void *) &(pcip->pmm[0].ma), ((0xffffffff -
169 (PPC405_PCI_UPPER_MEM -
170 PPC405_PCI_MEM_BASE)) | 0x01));
171
172 /* Disable region one */
173 out_le32((void *) &(pcip->pmm[1].ma), 0x00000000);
174 out_le32((void *) &(pcip->pmm[1].la), 0x00000000);
175 out_le32((void *) &(pcip->pmm[1].pcila), 0x00000000);
176 out_le32((void *) &(pcip->pmm[1].pciha), 0x00000000);
177 out_le32((void *) &(pcip->pmm[1].ma), 0x00000000);
178 out_le32((void *) &(pcip->ptm1ms), 0x00000001);
179
180 /* Disable region two */
181 out_le32((void *) &(pcip->pmm[2].ma), 0x00000000);
182 out_le32((void *) &(pcip->pmm[2].la), 0x00000000);
183 out_le32((void *) &(pcip->pmm[2].pcila), 0x00000000);
184 out_le32((void *) &(pcip->pmm[2].pciha), 0x00000000);
185 out_le32((void *) &(pcip->pmm[2].ma), 0x00000000);
186 out_le32((void *) &(pcip->ptm2ms), 0x00000000);
187 out_le32((void *) &(pcip->ptm2la), 0x00000000);
188
189 /* Zero config bars */
190 for (bar = PCI_BASE_ADDRESS_1; bar <= PCI_BASE_ADDRESS_2; bar += 4) {
191 early_write_config_dword(hose, hose->first_busno,
192 PCI_FUNC(hose->first_busno), bar,
193 0x00000000);
194 early_read_config_dword(hose, hose->first_busno,
195 PCI_FUNC(hose->first_busno), bar,
196 &bar_response);
197 DBG("BUS %d, device %d, Function %d bar 0x%8.8x is 0x%8.8x\n",
198 hose->first_busno, PCI_SLOT(hose->first_busno),
199 PCI_FUNC(hose->first_busno), bar, bar_response);
200 }
201 /* end workaround */
202
203#ifdef DEBUG
204 printk("PCI bridge regs after fixup \n");
205 for (i = 0; i <= 3; i++) {
206 printk(" pmm%dma\t0x%x\n", i, in_le32(&(pcip->pmm[i].ma)));
207 printk(" pmm%dma\t0x%x\n", i, in_le32(&(pcip->pmm[i].la)));
208 printk(" pmm%dma\t0x%x\n", i, in_le32(&(pcip->pmm[i].pcila)));
209 printk(" pmm%dma\t0x%x\n", i, in_le32(&(pcip->pmm[i].pciha)));
210 }
211 printk(" ptm1ms\t0x%x\n", in_le32(&(pcip->ptm1ms)));
212 printk(" ptm1la\t0x%x\n", in_le32(&(pcip->ptm1la)));
213 printk(" ptm2ms\t0x%x\n", in_le32(&(pcip->ptm2ms)));
214 printk(" ptm2la\t0x%x\n", in_le32(&(pcip->ptm2la)));
215
216#endif
217#endif
218}
219
220void __init
221bubinga_setup_arch(void)
222{
223 ppc4xx_setup_arch();
224
225 ibm_ocp_set_emac(0, 1);
226
227 bubinga_early_serial_map();
228
229 /* RTC step for the evb405ep */
230 bubinga_rtc_base = (void *) BUBINGA_RTC_VADDR;
231 TODC_INIT(TODC_TYPE_DS1743, bubinga_rtc_base, bubinga_rtc_base,
232 bubinga_rtc_base, 8);
233 /* Identify the system */
234 printk("IBM Bubinga port (MontaVista Software, Inc. <source@mvista.com>)\n");
235}
236
237void __init
238bubinga_map_io(void)
239{
240 ppc4xx_map_io();
241 io_block_mapping(BUBINGA_RTC_VADDR,
242 BUBINGA_RTC_PADDR, BUBINGA_RTC_SIZE, _PAGE_IO);
243}
244
245void __init
246platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
247 unsigned long r6, unsigned long r7)
248{
249 ppc4xx_init(r3, r4, r5, r6, r7);
250
251 ppc_md.setup_arch = bubinga_setup_arch;
252 ppc_md.setup_io_mappings = bubinga_map_io;
253
254#ifdef CONFIG_GEN_RTC
255 ppc_md.time_init = todc_time_init;
256 ppc_md.set_rtc_time = todc_set_rtc_time;
257 ppc_md.get_rtc_time = todc_get_rtc_time;
258 ppc_md.nvram_read_val = todc_direct_read_val;
259 ppc_md.nvram_write_val = todc_direct_write_val;
260#endif
261#ifdef CONFIG_KGDB
262 ppc_md.early_serial_map = bubinga_early_serial_map;
263#endif
264}
265
diff --git a/arch/ppc/platforms/4xx/bubinga.h b/arch/ppc/platforms/4xx/bubinga.h
deleted file mode 100644
index 5c408060eb35..000000000000
--- a/arch/ppc/platforms/4xx/bubinga.h
+++ /dev/null
@@ -1,54 +0,0 @@
1/*
2 * Bubinga board definitions
3 *
4 * Copyright (c) 2005 DENX Software Engineering
5 * Stefan Roese <sr@denx.de>
6 *
7 * Based on original work by
8 * SAW (IBM)
9 * 2003 (c) MontaVista Softare Inc.
10 *
11 * This program is free software; you can redistribute it and/or modify it
12 * under the terms of the GNU General Public License as published by the
13 * Free Software Foundation; either version 2 of the License, or (at your
14 * option) any later version.
15 *
16 */
17
18#ifdef __KERNEL__
19#ifndef __BUBINGA_H__
20#define __BUBINGA_H__
21
22#include <platforms/4xx/ibm405ep.h>
23#include <asm/ppcboot.h>
24
25/* Memory map for the Bubinga board.
26 * Generic 4xx plus RTC.
27 */
28
29#define BUBINGA_RTC_PADDR ((uint)0xf0000000)
30#define BUBINGA_RTC_VADDR BUBINGA_RTC_PADDR
31#define BUBINGA_RTC_SIZE ((uint)8*1024)
32
33/* The UART clock is based off an internal clock -
34 * define BASE_BAUD based on the internal clock and divider(s).
35 * Since BASE_BAUD must be a constant, we will initialize it
36 * using clock/divider values which OpenBIOS initializes
37 * for typical configurations at various CPU speeds.
38 * The base baud is calculated as (FWDA / EXT UART DIV / 16)
39 */
40#define BASE_BAUD 0
41
42/* Flash */
43#define PPC40x_FPGA_BASE 0xF0300000
44#define PPC40x_FPGA_REG_OFFS 1 /* offset to flash map reg */
45#define PPC40x_FLASH_ONBD_N(x) (x & 0x02)
46#define PPC40x_FLASH_SRAM_SEL(x) (x & 0x01)
47#define PPC40x_FLASH_LOW 0xFFF00000
48#define PPC40x_FLASH_HIGH 0xFFF80000
49#define PPC40x_FLASH_SIZE 0x80000
50
51#define PPC4xx_MACHINE_NAME "IBM Bubinga"
52
53#endif /* __BUBINGA_H__ */
54#endif /* __KERNEL__ */
diff --git a/arch/ppc/platforms/4xx/cpci405.c b/arch/ppc/platforms/4xx/cpci405.c
deleted file mode 100644
index 2e7e25dd84cb..000000000000
--- a/arch/ppc/platforms/4xx/cpci405.c
+++ /dev/null
@@ -1,201 +0,0 @@
1/*
2 * Board setup routines for the esd CPCI-405 cPCI Board.
3 *
4 * Copyright 2001-2006 esd electronic system design - hannover germany
5 *
6 * Authors: Matthias Fuchs
7 * matthias.fuchs@esd-electronics.com
8 * Stefan Roese
9 * stefan.roese@esd-electronics.com
10 *
11 * This program is free software; you can redistribute it and/or modify it
12 * under the terms of the GNU General Public License as published by the
13 * Free Software Foundation; either version 2 of the License, or (at your
14 * option) any later version.
15 *
16 */
17
18#include <linux/init.h>
19#include <linux/pci.h>
20#include <asm/system.h>
21#include <asm/pci-bridge.h>
22#include <asm/machdep.h>
23#include <asm/todc.h>
24#include <linux/serial.h>
25#include <linux/serial_core.h>
26#include <linux/serial_8250.h>
27#include <asm/ocp.h>
28#include <asm/ibm_ocp_pci.h>
29#include <platforms/4xx/ibm405gp.h>
30
31#ifdef CONFIG_GEN_RTC
32void *cpci405_nvram;
33#endif
34
35extern bd_t __res;
36
37/*
38 * Some IRQs unique to CPCI-405.
39 */
40int __init
41ppc405_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
42{
43 static char pci_irq_table[][4] =
44 /*
45 * PCI IDSEL/INTPIN->INTLINE
46 * A B C D
47 */
48 {
49 {28, 29, 30, 27}, /* IDSEL 15 - cPCI slot 8 */
50 {29, 30, 27, 28}, /* IDSEL 16 - cPCI slot 7 */
51 {30, 27, 28, 29}, /* IDSEL 17 - cPCI slot 6 */
52 {27, 28, 29, 30}, /* IDSEL 18 - cPCI slot 5 */
53 {28, 29, 30, 27}, /* IDSEL 19 - cPCI slot 4 */
54 {29, 30, 27, 28}, /* IDSEL 20 - cPCI slot 3 */
55 {30, 27, 28, 29}, /* IDSEL 21 - cPCI slot 2 */
56 };
57 const long min_idsel = 15, max_idsel = 21, irqs_per_slot = 4;
58 return PCI_IRQ_TABLE_LOOKUP;
59};
60
61/* The serial clock for the chip is an internal clock determined by
62 * different clock speeds/dividers.
63 * Calculate the proper input baud rate and setup the serial driver.
64 */
65static void __init
66cpci405_early_serial_map(void)
67{
68 u32 uart_div;
69 int uart_clock;
70 struct uart_port port;
71
72 /* Calculate the serial clock input frequency
73 *
74 * The uart clock is the cpu frequency (provided in the board info
75 * structure) divided by the external UART Divisor.
76 */
77 uart_div = ((mfdcr(DCRN_CHCR_BASE) & CHR0_UDIV) >> 1) + 1;
78 uart_clock = __res.bi_procfreq / uart_div;
79
80 /* Setup serial port access */
81 memset(&port, 0, sizeof(port));
82#if defined(CONFIG_UART0_TTYS0)
83 port.membase = (void*)UART0_IO_BASE;
84 port.irq = UART0_INT;
85#else
86 port.membase = (void*)UART1_IO_BASE;
87 port.irq = UART1_INT;
88#endif
89 port.uartclk = uart_clock;
90 port.regshift = 0;
91 port.iotype = UPIO_MEM;
92 port.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST;
93 port.line = 0;
94
95 if (early_serial_setup(&port) != 0) {
96 printk("Early serial init of port 0 failed\n");
97 }
98#if defined(CONFIG_UART0_TTYS0)
99 port.membase = (void*)UART1_IO_BASE;
100 port.irq = UART1_INT;
101#else
102 port.membase = (void*)UART0_IO_BASE;
103 port.irq = UART0_INT;
104#endif
105 port.line = 1;
106
107 if (early_serial_setup(&port) != 0) {
108 printk("Early serial init of port 1 failed\n");
109 }
110}
111
112void __init
113cpci405_setup_arch(void)
114{
115 ppc4xx_setup_arch();
116
117 ibm_ocp_set_emac(0, 0);
118
119 cpci405_early_serial_map();
120
121#ifdef CONFIG_GEN_RTC
122 TODC_INIT(TODC_TYPE_MK48T35,
123 cpci405_nvram, cpci405_nvram, cpci405_nvram, 8);
124#endif
125}
126
127void __init
128bios_fixup(struct pci_controller *hose, struct pcil0_regs *pcip)
129{
130#ifdef CONFIG_PCI
131 unsigned int bar_response, bar;
132
133 /* Disable region first */
134 out_le32((void *) &(pcip->pmm[0].ma), 0x00000000);
135 /* PLB starting addr, PCI: 0x80000000 */
136 out_le32((void *) &(pcip->pmm[0].la), 0x80000000);
137 /* PCI start addr, 0x80000000 */
138 out_le32((void *) &(pcip->pmm[0].pcila), PPC405_PCI_MEM_BASE);
139 /* 512MB range of PLB to PCI */
140 out_le32((void *) &(pcip->pmm[0].pciha), 0x00000000);
141 /* Enable no pre-fetch, enable region */
142 out_le32((void *) &(pcip->pmm[0].ma), ((0xffffffff -
143 (PPC405_PCI_UPPER_MEM -
144 PPC405_PCI_MEM_BASE)) | 0x01));
145
146 /* Disable region one */
147 out_le32((void *) &(pcip->pmm[1].ma), 0x00000000);
148 out_le32((void *) &(pcip->pmm[1].la), 0x00000000);
149 out_le32((void *) &(pcip->pmm[1].pcila), 0x00000000);
150 out_le32((void *) &(pcip->pmm[1].pciha), 0x00000000);
151 out_le32((void *) &(pcip->pmm[1].ma), 0x00000000);
152 out_le32((void *) &(pcip->ptm1ms), 0x00000001);
153
154 /* Disable region two */
155 out_le32((void *) &(pcip->pmm[2].ma), 0x00000000);
156 out_le32((void *) &(pcip->pmm[2].la), 0x00000000);
157 out_le32((void *) &(pcip->pmm[2].pcila), 0x00000000);
158 out_le32((void *) &(pcip->pmm[2].pciha), 0x00000000);
159 out_le32((void *) &(pcip->pmm[2].ma), 0x00000000);
160 out_le32((void *) &(pcip->ptm2ms), 0x00000000);
161 out_le32((void *) &(pcip->ptm2la), 0x00000000);
162
163 /* Zero config bars */
164 for (bar = PCI_BASE_ADDRESS_1; bar <= PCI_BASE_ADDRESS_2; bar += 4) {
165 early_write_config_dword(hose, hose->first_busno,
166 PCI_FUNC(hose->first_busno), bar,
167 0x00000000);
168 early_read_config_dword(hose, hose->first_busno,
169 PCI_FUNC(hose->first_busno), bar,
170 &bar_response);
171 }
172#endif
173}
174
175void __init
176cpci405_map_io(void)
177{
178 ppc4xx_map_io();
179
180#ifdef CONFIG_GEN_RTC
181 cpci405_nvram = ioremap(CPCI405_NVRAM_PADDR, CPCI405_NVRAM_SIZE);
182#endif
183}
184
185void __init
186platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
187 unsigned long r6, unsigned long r7)
188{
189 ppc4xx_init(r3, r4, r5, r6, r7);
190
191 ppc_md.setup_arch = cpci405_setup_arch;
192 ppc_md.setup_io_mappings = cpci405_map_io;
193
194#ifdef CONFIG_GEN_RTC
195 ppc_md.time_init = todc_time_init;
196 ppc_md.set_rtc_time = todc_set_rtc_time;
197 ppc_md.get_rtc_time = todc_get_rtc_time;
198 ppc_md.nvram_read_val = todc_direct_read_val;
199 ppc_md.nvram_write_val = todc_direct_write_val;
200#endif
201}
diff --git a/arch/ppc/platforms/4xx/cpci405.h b/arch/ppc/platforms/4xx/cpci405.h
deleted file mode 100644
index a6c0a138b0d7..000000000000
--- a/arch/ppc/platforms/4xx/cpci405.h
+++ /dev/null
@@ -1,28 +0,0 @@
1/*
2 * CPCI-405 board specific definitions
3 *
4 * Copyright 2001-2006 esd electronic system design - hannover germany
5 *
6 * Authors: Matthias Fuchs
7 * matthias.fuchs@esd-electronics.com
8 * Stefan Roese
9 * stefan.roese@esd-electronics.com
10 */
11
12#ifdef __KERNEL__
13#ifndef __CPCI405_H__
14#define __CPCI405_H__
15
16#include <platforms/4xx/ibm405gp.h>
17#include <asm/ppcboot.h>
18
19/* Map for the NVRAM space */
20#define CPCI405_NVRAM_PADDR ((uint)0xf0200000)
21#define CPCI405_NVRAM_SIZE ((uint)32*1024)
22
23#define BASE_BAUD 0
24
25#define PPC4xx_MACHINE_NAME "esd CPCI-405"
26
27#endif /* __CPCI405_H__ */
28#endif /* __KERNEL__ */
diff --git a/arch/ppc/platforms/4xx/ebony.c b/arch/ppc/platforms/4xx/ebony.c
deleted file mode 100644
index 8027a36fc5bb..000000000000
--- a/arch/ppc/platforms/4xx/ebony.c
+++ /dev/null
@@ -1,334 +0,0 @@
1/*
2 * Ebony board specific routines
3 *
4 * Matt Porter <mporter@kernel.crashing.org>
5 * Copyright 2002-2005 MontaVista Software Inc.
6 *
7 * Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net>
8 * Copyright (c) 2003-2005 Zultys Technologies
9 *
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the
12 * Free Software Foundation; either version 2 of the License, or (at your
13 * option) any later version.
14 */
15
16#include <linux/stddef.h>
17#include <linux/kernel.h>
18#include <linux/init.h>
19#include <linux/errno.h>
20#include <linux/reboot.h>
21#include <linux/pci.h>
22#include <linux/kdev_t.h>
23#include <linux/types.h>
24#include <linux/major.h>
25#include <linux/blkdev.h>
26#include <linux/console.h>
27#include <linux/delay.h>
28#include <linux/initrd.h>
29#include <linux/seq_file.h>
30#include <linux/root_dev.h>
31#include <linux/tty.h>
32#include <linux/serial.h>
33#include <linux/serial_core.h>
34#include <linux/serial_8250.h>
35
36#include <asm/system.h>
37#include <asm/pgtable.h>
38#include <asm/page.h>
39#include <asm/dma.h>
40#include <asm/io.h>
41#include <asm/machdep.h>
42#include <asm/ocp.h>
43#include <asm/pci-bridge.h>
44#include <asm/time.h>
45#include <asm/todc.h>
46#include <asm/bootinfo.h>
47#include <asm/ppc4xx_pic.h>
48#include <asm/ppcboot.h>
49#include <asm/tlbflush.h>
50
51#include <syslib/gen550.h>
52#include <syslib/ibm440gp_common.h>
53
54extern bd_t __res;
55
56static struct ibm44x_clocks clocks __initdata;
57
58/*
59 * Ebony external IRQ triggering/polarity settings
60 */
61unsigned char ppc4xx_uic_ext_irq_cfg[] __initdata = {
62 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* IRQ0: PCI slot 0 */
63 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* IRQ1: PCI slot 1 */
64 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* IRQ2: PCI slot 2 */
65 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* IRQ3: PCI slot 3 */
66 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* IRQ4: IRDA */
67 (IRQ_SENSE_EDGE | IRQ_POLARITY_NEGATIVE), /* IRQ5: SMI pushbutton */
68 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* IRQ6: PHYs */
69 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* IRQ7: AUX */
70 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* IRQ8: EXT */
71 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* IRQ9: EXT */
72 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* IRQ10: EXT */
73 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* IRQ11: EXT */
74 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* IRQ12: EXT */
75};
76
77static void __init
78ebony_calibrate_decr(void)
79{
80 unsigned int freq;
81
82 /*
83 * Determine system clock speed
84 *
85 * If we are on Rev. B silicon, then use
86 * default external system clock. If we are
87 * on Rev. C silicon then errata forces us to
88 * use the internal clock.
89 */
90 if (strcmp(cur_cpu_spec->cpu_name, "440GP Rev. B") == 0)
91 freq = EBONY_440GP_RB_SYSCLK;
92 else
93 freq = EBONY_440GP_RC_SYSCLK;
94
95 ibm44x_calibrate_decr(freq);
96}
97
98static int
99ebony_show_cpuinfo(struct seq_file *m)
100{
101 seq_printf(m, "vendor\t\t: IBM\n");
102 seq_printf(m, "machine\t\t: Ebony\n");
103
104 return 0;
105}
106
107static inline int
108ebony_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
109{
110 static char pci_irq_table[][4] =
111 /*
112 * PCI IDSEL/INTPIN->INTLINE
113 * A B C D
114 */
115 {
116 { 23, 23, 23, 23 }, /* IDSEL 1 - PCI Slot 0 */
117 { 24, 24, 24, 24 }, /* IDSEL 2 - PCI Slot 1 */
118 { 25, 25, 25, 25 }, /* IDSEL 3 - PCI Slot 2 */
119 { 26, 26, 26, 26 }, /* IDSEL 4 - PCI Slot 3 */
120 };
121
122 const long min_idsel = 1, max_idsel = 4, irqs_per_slot = 4;
123 return PCI_IRQ_TABLE_LOOKUP;
124}
125
126#define PCIX_WRITEL(value, offset) \
127 (writel(value, pcix_reg_base + offset))
128
129/*
130 * FIXME: This is only here to "make it work". This will move
131 * to a ibm_pcix.c which will contain a generic IBM PCIX bridge
132 * configuration library. -Matt
133 */
134static void __init
135ebony_setup_pcix(void)
136{
137 void __iomem *pcix_reg_base;
138
139 pcix_reg_base = ioremap64(PCIX0_REG_BASE, PCIX_REG_SIZE);
140
141 /* Disable all windows */
142 PCIX_WRITEL(0, PCIX0_POM0SA);
143 PCIX_WRITEL(0, PCIX0_POM1SA);
144 PCIX_WRITEL(0, PCIX0_POM2SA);
145 PCIX_WRITEL(0, PCIX0_PIM0SA);
146 PCIX_WRITEL(0, PCIX0_PIM1SA);
147 PCIX_WRITEL(0, PCIX0_PIM2SA);
148
149 /* Setup 2GB PLB->PCI outbound mem window (3_8000_0000->0_8000_0000) */
150 PCIX_WRITEL(0x00000003, PCIX0_POM0LAH);
151 PCIX_WRITEL(0x80000000, PCIX0_POM0LAL);
152 PCIX_WRITEL(0x00000000, PCIX0_POM0PCIAH);
153 PCIX_WRITEL(0x80000000, PCIX0_POM0PCIAL);
154 PCIX_WRITEL(0x80000001, PCIX0_POM0SA);
155
156 /* Setup 2GB PCI->PLB inbound memory window at 0, enable MSIs */
157 PCIX_WRITEL(0x00000000, PCIX0_PIM0LAH);
158 PCIX_WRITEL(0x00000000, PCIX0_PIM0LAL);
159 PCIX_WRITEL(0x80000007, PCIX0_PIM0SA);
160
161 eieio();
162}
163
164static void __init
165ebony_setup_hose(void)
166{
167 struct pci_controller *hose;
168
169 /* Configure windows on the PCI-X host bridge */
170 ebony_setup_pcix();
171
172 hose = pcibios_alloc_controller();
173
174 if (!hose)
175 return;
176
177 hose->first_busno = 0;
178 hose->last_busno = 0xff;
179
180 hose->pci_mem_offset = EBONY_PCI_MEM_OFFSET;
181
182 pci_init_resource(&hose->io_resource,
183 EBONY_PCI_LOWER_IO,
184 EBONY_PCI_UPPER_IO,
185 IORESOURCE_IO,
186 "PCI host bridge");
187
188 pci_init_resource(&hose->mem_resources[0],
189 EBONY_PCI_LOWER_MEM,
190 EBONY_PCI_UPPER_MEM,
191 IORESOURCE_MEM,
192 "PCI host bridge");
193
194 hose->io_space.start = EBONY_PCI_LOWER_IO;
195 hose->io_space.end = EBONY_PCI_UPPER_IO;
196 hose->mem_space.start = EBONY_PCI_LOWER_MEM;
197 hose->mem_space.end = EBONY_PCI_UPPER_MEM;
198 hose->io_base_virt = ioremap64(EBONY_PCI_IO_BASE, EBONY_PCI_IO_SIZE);
199 isa_io_base = (unsigned long)hose->io_base_virt;
200
201 setup_indirect_pci(hose,
202 EBONY_PCI_CFGA_PLB32,
203 EBONY_PCI_CFGD_PLB32);
204 hose->set_cfg_type = 1;
205
206 hose->last_busno = pciauto_bus_scan(hose, hose->first_busno);
207
208 ppc_md.pci_swizzle = common_swizzle;
209 ppc_md.pci_map_irq = ebony_map_irq;
210}
211
212TODC_ALLOC();
213
214static void __init
215ebony_early_serial_map(void)
216{
217 struct uart_port port;
218
219 /* Setup ioremapped serial port access */
220 memset(&port, 0, sizeof(port));
221 port.membase = ioremap64(PPC440GP_UART0_ADDR, 8);
222 port.irq = 0;
223 port.uartclk = clocks.uart0;
224 port.regshift = 0;
225 port.iotype = UPIO_MEM;
226 port.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST;
227 port.line = 0;
228
229 if (early_serial_setup(&port) != 0) {
230 printk("Early serial init of port 0 failed\n");
231 }
232
233#if defined(CONFIG_SERIAL_TEXT_DEBUG) || defined(CONFIG_KGDB)
234 /* Configure debug serial access */
235 gen550_init(0, &port);
236
237 /* Purge TLB entry added in head_44x.S for early serial access */
238 _tlbie(UART0_IO_BASE, 0);
239#endif
240
241 port.membase = ioremap64(PPC440GP_UART1_ADDR, 8);
242 port.irq = 1;
243 port.uartclk = clocks.uart1;
244 port.line = 1;
245
246 if (early_serial_setup(&port) != 0) {
247 printk("Early serial init of port 1 failed\n");
248 }
249
250#if defined(CONFIG_SERIAL_TEXT_DEBUG) || defined(CONFIG_KGDB)
251 /* Configure debug serial access */
252 gen550_init(1, &port);
253#endif
254}
255
256static void __init
257ebony_setup_arch(void)
258{
259 struct ocp_def *def;
260 struct ocp_func_emac_data *emacdata;
261
262 /* Set mac_addr for each EMAC */
263 def = ocp_get_one_device(OCP_VENDOR_IBM, OCP_FUNC_EMAC, 0);
264 emacdata = def->additions;
265 emacdata->phy_map = 0x00000001; /* Skip 0x00 */
266 emacdata->phy_mode = PHY_MODE_RMII;
267 memcpy(emacdata->mac_addr, __res.bi_enetaddr, 6);
268
269 def = ocp_get_one_device(OCP_VENDOR_IBM, OCP_FUNC_EMAC, 1);
270 emacdata = def->additions;
271 emacdata->phy_map = 0x00000001; /* Skip 0x00 */
272 emacdata->phy_mode = PHY_MODE_RMII;
273 memcpy(emacdata->mac_addr, __res.bi_enet1addr, 6);
274
275 /*
276 * Determine various clocks.
277 * To be completely correct we should get SysClk
278 * from FPGA, because it can be changed by on-board switches
279 * --ebs
280 */
281 ibm440gp_get_clocks(&clocks, 33333333, 6 * 1843200);
282 ocp_sys_info.opb_bus_freq = clocks.opb;
283
284 /* Setup TODC access */
285 TODC_INIT(TODC_TYPE_DS1743,
286 0,
287 0,
288 ioremap64(EBONY_RTC_ADDR, EBONY_RTC_SIZE),
289 8);
290
291 /* init to some ~sane value until calibrate_delay() runs */
292 loops_per_jiffy = 50000000/HZ;
293
294 /* Setup PCI host bridge */
295 ebony_setup_hose();
296
297#ifdef CONFIG_BLK_DEV_INITRD
298 if (initrd_start)
299 ROOT_DEV = Root_RAM0;
300 else
301#endif
302#ifdef CONFIG_ROOT_NFS
303 ROOT_DEV = Root_NFS;
304#else
305 ROOT_DEV = Root_HDA1;
306#endif
307
308 ebony_early_serial_map();
309
310 /* Identify the system */
311 printk("IBM Ebony port (MontaVista Software, Inc. (source@mvista.com))\n");
312}
313
314void __init platform_init(unsigned long r3, unsigned long r4,
315 unsigned long r5, unsigned long r6, unsigned long r7)
316{
317 ibm44x_platform_init(r3, r4, r5, r6, r7);
318
319 ppc_md.setup_arch = ebony_setup_arch;
320 ppc_md.show_cpuinfo = ebony_show_cpuinfo;
321 ppc_md.get_irq = NULL; /* Set in ppc4xx_pic_init() */
322
323 ppc_md.calibrate_decr = ebony_calibrate_decr;
324 ppc_md.time_init = todc_time_init;
325 ppc_md.set_rtc_time = todc_set_rtc_time;
326 ppc_md.get_rtc_time = todc_get_rtc_time;
327
328 ppc_md.nvram_read_val = todc_direct_read_val;
329 ppc_md.nvram_write_val = todc_direct_write_val;
330#ifdef CONFIG_KGDB
331 ppc_md.early_serial_map = ebony_early_serial_map;
332#endif
333}
334
diff --git a/arch/ppc/platforms/4xx/ebony.h b/arch/ppc/platforms/4xx/ebony.h
deleted file mode 100644
index f40e33d39d76..000000000000
--- a/arch/ppc/platforms/4xx/ebony.h
+++ /dev/null
@@ -1,97 +0,0 @@
1/*
2 * Ebony board definitions
3 *
4 * Matt Porter <mporter@mvista.com>
5 *
6 * Copyright 2002 MontaVista Software Inc.
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
12 */
13
14#ifdef __KERNEL__
15#ifndef __ASM_EBONY_H__
16#define __ASM_EBONY_H__
17
18#include <platforms/4xx/ibm440gp.h>
19
20/* F/W TLB mapping used in bootloader glue to reset EMAC */
21#define PPC44x_EMAC0_MR0 0xE0000800
22
23/* Where to find the MAC info */
24#define OPENBIOS_MAC_BASE 0xfffffe0c
25#define OPENBIOS_MAC_OFFSET 0x0c
26
27/* Default clock rates for Rev. B and Rev. C silicon */
28#define EBONY_440GP_RB_SYSCLK 33000000
29#define EBONY_440GP_RC_SYSCLK 400000000
30
31/* RTC/NVRAM location */
32#define EBONY_RTC_ADDR 0x0000000148000000ULL
33#define EBONY_RTC_SIZE 0x2000
34
35/* Flash */
36#define EBONY_FPGA_ADDR 0x0000000148300000ULL
37#define EBONY_BOOT_SMALL_FLASH(x) (x & 0x20)
38#define EBONY_ONBRD_FLASH_EN(x) (x & 0x02)
39#define EBONY_FLASH_SEL(x) (x & 0x01)
40#define EBONY_SMALL_FLASH_LOW1 0x00000001ff800000ULL
41#define EBONY_SMALL_FLASH_LOW2 0x00000001ff880000ULL
42#define EBONY_SMALL_FLASH_HIGH1 0x00000001fff00000ULL
43#define EBONY_SMALL_FLASH_HIGH2 0x00000001fff80000ULL
44#define EBONY_SMALL_FLASH_SIZE 0x80000
45#define EBONY_LARGE_FLASH_LOW 0x00000001ff800000ULL
46#define EBONY_LARGE_FLASH_HIGH 0x00000001ffc00000ULL
47#define EBONY_LARGE_FLASH_SIZE 0x400000
48
49#define EBONY_SMALL_FLASH_BASE 0x00000001fff80000ULL
50#define EBONY_LARGE_FLASH_BASE 0x00000001ff800000ULL
51
52/*
53 * Serial port defines
54 */
55
56#if defined(__BOOTER__)
57/* OpenBIOS defined UART mappings, used by bootloader shim */
58#define UART0_IO_BASE 0xE0000200
59#define UART1_IO_BASE 0xE0000300
60#else
61/* head_44x.S created UART mapping, used before early_serial_setup.
62 * We cannot use default OpenBIOS UART mappings because they
63 * don't work for configurations with more than 512M RAM. --ebs
64 */
65#define UART0_IO_BASE 0xF0000200
66#define UART1_IO_BASE 0xF0000300
67#endif
68
69/* external Epson SG-615P */
70#define BASE_BAUD 691200
71
72#define STD_UART_OP(num) \
73 { 0, BASE_BAUD, 0, UART##num##_INT, \
74 (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST), \
75 iomem_base: (void*)UART##num##_IO_BASE, \
76 io_type: SERIAL_IO_MEM},
77
78#define SERIAL_PORT_DFNS \
79 STD_UART_OP(0) \
80 STD_UART_OP(1)
81
82/* PCI support */
83#define EBONY_PCI_LOWER_IO 0x00000000
84#define EBONY_PCI_UPPER_IO 0x0000ffff
85#define EBONY_PCI_LOWER_MEM 0x80002000
86#define EBONY_PCI_UPPER_MEM 0xffffefff
87
88#define EBONY_PCI_CFGREGS_BASE 0x000000020ec00000
89#define EBONY_PCI_CFGA_PLB32 0x0ec00000
90#define EBONY_PCI_CFGD_PLB32 0x0ec00004
91
92#define EBONY_PCI_IO_BASE 0x0000000208000000ULL
93#define EBONY_PCI_IO_SIZE 0x00010000
94#define EBONY_PCI_MEM_OFFSET 0x00000000
95
96#endif /* __ASM_EBONY_H__ */
97#endif /* __KERNEL__ */
diff --git a/arch/ppc/platforms/4xx/ep405.c b/arch/ppc/platforms/4xx/ep405.c
deleted file mode 100644
index 5aa295022804..000000000000
--- a/arch/ppc/platforms/4xx/ep405.c
+++ /dev/null
@@ -1,196 +0,0 @@
1/*
2 * Embedded Planet 405GP board
3 * http://www.embeddedplanet.com
4 *
5 * Author: Matthew Locke <mlocke@mvista.com>
6 *
7 * 2001 (c) MontaVista, Software, Inc. This file is licensed under
8 * the terms of the GNU General Public License version 2. This program
9 * is licensed "as is" without any warranty of any kind, whether express
10 * or implied.
11 */
12#include <linux/init.h>
13#include <linux/pci.h>
14#include <asm/system.h>
15#include <asm/pci-bridge.h>
16#include <asm/machdep.h>
17#include <asm/todc.h>
18#include <asm/ocp.h>
19#include <asm/ibm_ocp_pci.h>
20
21#undef DEBUG
22#ifdef DEBUG
23#define DBG(x...) printk(x)
24#else
25#define DBG(x...)
26#endif
27
28u8 *ep405_bcsr;
29u8 *ep405_nvram;
30
31static struct {
32 u8 cpld_xirq_select;
33 int pci_idsel;
34 int irq;
35} ep405_devtable[] = {
36#ifdef CONFIG_EP405PC
37 {0x07, 0x0E, 25}, /* EP405PC: USB */
38#endif
39};
40
41int __init
42ppc405_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
43{
44 int i;
45
46 /* AFAICT this is only called a few times during PCI setup, so
47 performance is not critical */
48 for (i = 0; i < ARRAY_SIZE(ep405_devtable); i++) {
49 if (idsel == ep405_devtable[i].pci_idsel)
50 return ep405_devtable[i].irq;
51 }
52 return -1;
53};
54
55void __init
56ep405_setup_arch(void)
57{
58 ppc4xx_setup_arch();
59
60 ibm_ocp_set_emac(0, 0);
61
62 if (__res.bi_nvramsize == 512*1024) {
63 /* FIXME: we should properly handle NVRTCs of different sizes */
64 TODC_INIT(TODC_TYPE_DS1557, ep405_nvram, ep405_nvram, ep405_nvram, 8);
65 }
66}
67
68void __init
69bios_fixup(struct pci_controller *hose, struct pcil0_regs *pcip)
70{
71#ifdef CONFIG_PCI
72 unsigned int bar_response, bar;
73 /*
74 * Expected PCI mapping:
75 *
76 * PLB addr PCI memory addr
77 * --------------------- ---------------------
78 * 0000'0000 - 7fff'ffff <--- 0000'0000 - 7fff'ffff
79 * 8000'0000 - Bfff'ffff ---> 8000'0000 - Bfff'ffff
80 *
81 * PLB addr PCI io addr
82 * --------------------- ---------------------
83 * e800'0000 - e800'ffff ---> 0000'0000 - 0001'0000
84 *
85 */
86
87 /* Disable region zero first */
88 out_le32((void *) &(pcip->pmm[0].ma), 0x00000000);
89 /* PLB starting addr, PCI: 0x80000000 */
90 out_le32((void *) &(pcip->pmm[0].la), 0x80000000);
91 /* PCI start addr, 0x80000000 */
92 out_le32((void *) &(pcip->pmm[0].pcila), PPC405_PCI_MEM_BASE);
93 /* 512MB range of PLB to PCI */
94 out_le32((void *) &(pcip->pmm[0].pciha), 0x00000000);
95 /* Enable no pre-fetch, enable region */
96 out_le32((void *) &(pcip->pmm[0].ma), ((0xffffffff -
97 (PPC405_PCI_UPPER_MEM -
98 PPC405_PCI_MEM_BASE)) | 0x01));
99
100 /* Disable region one */
101 out_le32((void *) &(pcip->pmm[1].ma), 0x00000000);
102 out_le32((void *) &(pcip->pmm[1].la), 0x00000000);
103 out_le32((void *) &(pcip->pmm[1].pcila), 0x00000000);
104 out_le32((void *) &(pcip->pmm[1].pciha), 0x00000000);
105 out_le32((void *) &(pcip->pmm[1].ma), 0x00000000);
106 out_le32((void *) &(pcip->ptm1ms), 0x00000000);
107
108 /* Disable region two */
109 out_le32((void *) &(pcip->pmm[2].ma), 0x00000000);
110 out_le32((void *) &(pcip->pmm[2].la), 0x00000000);
111 out_le32((void *) &(pcip->pmm[2].pcila), 0x00000000);
112 out_le32((void *) &(pcip->pmm[2].pciha), 0x00000000);
113 out_le32((void *) &(pcip->pmm[2].ma), 0x00000000);
114 out_le32((void *) &(pcip->ptm2ms), 0x00000000);
115
116 /* Configure PTM (PCI->PLB) region 1 */
117 out_le32((void *) &(pcip->ptm1la), 0x00000000); /* PLB base address */
118 /* Disable PTM region 2 */
119 out_le32((void *) &(pcip->ptm2ms), 0x00000000);
120
121 /* Zero config bars */
122 for (bar = PCI_BASE_ADDRESS_1; bar <= PCI_BASE_ADDRESS_2; bar += 4) {
123 early_write_config_dword(hose, hose->first_busno,
124 PCI_FUNC(hose->first_busno), bar,
125 0x00000000);
126 early_read_config_dword(hose, hose->first_busno,
127 PCI_FUNC(hose->first_busno), bar,
128 &bar_response);
129 DBG("BUS %d, device %d, Function %d bar 0x%8.8x is 0x%8.8x\n",
130 hose->first_busno, PCI_SLOT(hose->first_busno),
131 PCI_FUNC(hose->first_busno), bar, bar_response);
132 }
133 /* end workaround */
134#endif
135}
136
137void __init
138ep405_map_io(void)
139{
140 bd_t *bip = &__res;
141
142 ppc4xx_map_io();
143
144 ep405_bcsr = ioremap(EP405_BCSR_PADDR, EP405_BCSR_SIZE);
145
146 if (bip->bi_nvramsize > 0) {
147 ep405_nvram = ioremap(EP405_NVRAM_PADDR, bip->bi_nvramsize);
148 }
149}
150
151void __init
152ep405_init_IRQ(void)
153{
154 int i;
155
156 ppc4xx_init_IRQ();
157
158 /* Workaround for a bug in the firmware it incorrectly sets
159 the IRQ polarities for XIRQ0 and XIRQ1 */
160 mtdcr(DCRN_UIC_PR(DCRN_UIC0_BASE), 0xffffff80); /* set the polarity */
161 mtdcr(DCRN_UIC_SR(DCRN_UIC0_BASE), 0x00000060); /* clear bogus interrupts */
162
163 /* Activate the XIRQs from the CPLD */
164 writeb(0xf0, ep405_bcsr+10);
165
166 /* Set up IRQ routing */
167 for (i = 0; i < ARRAY_SIZE(ep405_devtable); i++) {
168 if ( (ep405_devtable[i].irq >= 25)
169 && (ep405_devtable[i].irq) <= 31) {
170 writeb(ep405_devtable[i].cpld_xirq_select, ep405_bcsr+5);
171 writeb(ep405_devtable[i].irq - 25, ep405_bcsr+6);
172 }
173 }
174}
175
176void __init
177platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
178 unsigned long r6, unsigned long r7)
179{
180 ppc4xx_init(r3, r4, r5, r6, r7);
181
182 ppc_md.setup_arch = ep405_setup_arch;
183 ppc_md.setup_io_mappings = ep405_map_io;
184 ppc_md.init_IRQ = ep405_init_IRQ;
185
186 ppc_md.nvram_read_val = todc_direct_read_val;
187 ppc_md.nvram_write_val = todc_direct_write_val;
188
189 if (__res.bi_nvramsize == 512*1024) {
190 ppc_md.time_init = todc_time_init;
191 ppc_md.set_rtc_time = todc_set_rtc_time;
192 ppc_md.get_rtc_time = todc_get_rtc_time;
193 } else {
194 printk("EP405: NVRTC size is not 512k (not a DS1557). Not sure what to do with it\n");
195 }
196}
diff --git a/arch/ppc/platforms/4xx/ep405.h b/arch/ppc/platforms/4xx/ep405.h
deleted file mode 100644
index 9814fc431725..000000000000
--- a/arch/ppc/platforms/4xx/ep405.h
+++ /dev/null
@@ -1,52 +0,0 @@
1/*
2 * Embedded Planet 405GP board
3 * http://www.embeddedplanet.com
4 *
5 * Author: Matthew Locke <mlocke@mvista.com>
6 *
7 * 2000 (c) MontaVista, Software, Inc. This file is licensed under
8 * the terms of the GNU General Public License version 2. This program
9 * is licensed "as is" without any warranty of any kind, whether express
10 * or implied.
11 */
12
13#ifdef __KERNEL__
14#ifndef __ASM_EP405_H__
15#define __ASM_EP405_H__
16
17/* We have a 405GP core */
18#include <platforms/4xx/ibm405gp.h>
19
20#ifndef __ASSEMBLY__
21
22#include <linux/types.h>
23
24typedef struct board_info {
25 unsigned int bi_memsize; /* DRAM installed, in bytes */
26 unsigned char bi_enetaddr[6]; /* Local Ethernet MAC address */
27 unsigned int bi_intfreq; /* Processor speed, in Hz */
28 unsigned int bi_busfreq; /* PLB Bus speed, in Hz */
29 unsigned int bi_pci_busfreq; /* PCI Bus speed, in Hz */
30 unsigned int bi_nvramsize; /* Size of the NVRAM/RTC */
31} bd_t;
32
33/* Some 4xx parts use a different timebase frequency from the internal clock.
34*/
35#define bi_tbfreq bi_intfreq
36
37extern u8 *ep405_bcsr;
38extern u8 *ep405_nvram;
39
40/* Map for the BCSR and NVRAM space */
41#define EP405_BCSR_PADDR ((uint)0xf4000000)
42#define EP405_BCSR_SIZE ((uint)16)
43#define EP405_NVRAM_PADDR ((uint)0xf4200000)
44
45/* serial defines */
46#define BASE_BAUD 399193
47
48#define PPC4xx_MACHINE_NAME "Embedded Planet 405GP"
49
50#endif /* !__ASSEMBLY__ */
51#endif /* __ASM_EP405_H__ */
52#endif /* __KERNEL__ */
diff --git a/arch/ppc/platforms/4xx/ibm405ep.c b/arch/ppc/platforms/4xx/ibm405ep.c
deleted file mode 100644
index fb3630a1608d..000000000000
--- a/arch/ppc/platforms/4xx/ibm405ep.c
+++ /dev/null
@@ -1,141 +0,0 @@
1/*
2 * Support for IBM PPC 405EP processors.
3 *
4 * Author: SAW (IBM), derived from ibmnp405l.c.
5 * Maintained by MontaVista Software <source@mvista.com>
6 *
7 * 2003 (c) MontaVista Softare Inc. This file is licensed under the
8 * terms of the GNU General Public License version 2. This program is
9 * licensed "as is" without any warranty of any kind, whether express
10 * or implied.
11 */
12
13#include <linux/init.h>
14#include <linux/smp.h>
15#include <linux/threads.h>
16#include <linux/param.h>
17#include <linux/string.h>
18
19#include <asm/ibm4xx.h>
20#include <asm/ocp.h>
21#include <asm/ppc4xx_pic.h>
22
23#include <platforms/4xx/ibm405ep.h>
24
25static struct ocp_func_mal_data ibm405ep_mal0_def = {
26 .num_tx_chans = 4, /* Number of TX channels */
27 .num_rx_chans = 2, /* Number of RX channels */
28 .txeob_irq = 11, /* TX End Of Buffer IRQ */
29 .rxeob_irq = 12, /* RX End Of Buffer IRQ */
30 .txde_irq = 13, /* TX Descriptor Error IRQ */
31 .rxde_irq = 14, /* RX Descriptor Error IRQ */
32 .serr_irq = 10, /* MAL System Error IRQ */
33 .dcr_base = DCRN_MAL_BASE /* MAL0_CFG DCR number */
34};
35OCP_SYSFS_MAL_DATA()
36
37static struct ocp_func_emac_data ibm405ep_emac0_def = {
38 .rgmii_idx = -1, /* No RGMII */
39 .rgmii_mux = -1, /* No RGMII */
40 .zmii_idx = -1, /* ZMII device index */
41 .zmii_mux = 0, /* ZMII input of this EMAC */
42 .mal_idx = 0, /* MAL device index */
43 .mal_rx_chan = 0, /* MAL rx channel number */
44 .mal_tx_chan = 0, /* MAL tx channel number */
45 .wol_irq = 9, /* WOL interrupt number */
46 .mdio_idx = 0, /* MDIO via EMAC0 */
47 .tah_idx = -1, /* No TAH */
48};
49
50static struct ocp_func_emac_data ibm405ep_emac1_def = {
51 .rgmii_idx = -1, /* No RGMII */
52 .rgmii_mux = -1, /* No RGMII */
53 .zmii_idx = -1, /* ZMII device index */
54 .zmii_mux = 0, /* ZMII input of this EMAC */
55 .mal_idx = 0, /* MAL device index */
56 .mal_rx_chan = 1, /* MAL rx channel number */
57 .mal_tx_chan = 2, /* MAL tx channel number */
58 .wol_irq = 9, /* WOL interrupt number */
59 .mdio_idx = 0, /* MDIO via EMAC0 */
60 .tah_idx = -1, /* No TAH */
61};
62OCP_SYSFS_EMAC_DATA()
63
64static struct ocp_func_iic_data ibm405ep_iic0_def = {
65 .fast_mode = 0, /* Use standad mode (100Khz) */
66};
67OCP_SYSFS_IIC_DATA()
68
69struct ocp_def core_ocp[] = {
70 { .vendor = OCP_VENDOR_IBM,
71 .function = OCP_FUNC_OPB,
72 .index = 0,
73 .paddr = 0xEF600000,
74 .irq = OCP_IRQ_NA,
75 .pm = OCP_CPM_NA,
76 },
77 { .vendor = OCP_VENDOR_IBM,
78 .function = OCP_FUNC_16550,
79 .index = 0,
80 .paddr = UART0_IO_BASE,
81 .irq = UART0_INT,
82 .pm = IBM_CPM_UART0
83 },
84 { .vendor = OCP_VENDOR_IBM,
85 .function = OCP_FUNC_16550,
86 .index = 1,
87 .paddr = UART1_IO_BASE,
88 .irq = UART1_INT,
89 .pm = IBM_CPM_UART1
90 },
91 { .vendor = OCP_VENDOR_IBM,
92 .function = OCP_FUNC_IIC,
93 .paddr = 0xEF600500,
94 .irq = 2,
95 .pm = IBM_CPM_IIC0,
96 .additions = &ibm405ep_iic0_def,
97 .show = &ocp_show_iic_data
98 },
99 { .vendor = OCP_VENDOR_IBM,
100 .function = OCP_FUNC_GPIO,
101 .paddr = 0xEF600700,
102 .irq = OCP_IRQ_NA,
103 .pm = IBM_CPM_GPIO0
104 },
105 { .vendor = OCP_VENDOR_IBM,
106 .function = OCP_FUNC_MAL,
107 .paddr = OCP_PADDR_NA,
108 .irq = OCP_IRQ_NA,
109 .pm = OCP_CPM_NA,
110 .additions = &ibm405ep_mal0_def,
111 .show = &ocp_show_mal_data
112 },
113 { .vendor = OCP_VENDOR_IBM,
114 .function = OCP_FUNC_EMAC,
115 .index = 0,
116 .paddr = EMAC0_BASE,
117 .irq = 15,
118 .pm = OCP_CPM_NA,
119 .additions = &ibm405ep_emac0_def,
120 .show = &ocp_show_emac_data
121 },
122 { .vendor = OCP_VENDOR_IBM,
123 .function = OCP_FUNC_EMAC,
124 .index = 1,
125 .paddr = 0xEF600900,
126 .irq = 17,
127 .pm = OCP_CPM_NA,
128 .additions = &ibm405ep_emac1_def,
129 .show = &ocp_show_emac_data
130 },
131 { .vendor = OCP_VENDOR_INVALID
132 }
133};
134
135/* Polarity and triggering settings for internal interrupt sources */
136struct ppc4xx_uic_settings ppc4xx_core_uic_cfg[] __initdata = {
137 { .polarity = 0xffff7f80,
138 .triggering = 0x00000000,
139 .ext_irq_mask = 0x0000007f, /* IRQ0 - IRQ6 */
140 }
141};
diff --git a/arch/ppc/platforms/4xx/ibm405ep.h b/arch/ppc/platforms/4xx/ibm405ep.h
deleted file mode 100644
index 3ef20a547080..000000000000
--- a/arch/ppc/platforms/4xx/ibm405ep.h
+++ /dev/null
@@ -1,145 +0,0 @@
1/*
2 * IBM PPC 405EP processor defines.
3 *
4 * Author: SAW (IBM), derived from ibm405gp.h.
5 * Maintained by MontaVista Software <source@mvista.com>
6 *
7 * 2003 (c) MontaVista Softare Inc. This file is licensed under the
8 * terms of the GNU General Public License version 2. This program is
9 * licensed "as is" without any warranty of any kind, whether express
10 * or implied.
11 */
12
13#ifdef __KERNEL__
14#ifndef __ASM_IBM405EP_H__
15#define __ASM_IBM405EP_H__
16
17
18/* ibm405.h at bottom of this file */
19
20/* PCI
21 * PCI Bridge config reg definitions
22 * see 17-19 of manual
23 */
24
25#define PPC405_PCI_CONFIG_ADDR 0xeec00000
26#define PPC405_PCI_CONFIG_DATA 0xeec00004
27
28#define PPC405_PCI_PHY_MEM_BASE 0x80000000 /* hose_a->pci_mem_offset */
29 /* setbat */
30#define PPC405_PCI_MEM_BASE PPC405_PCI_PHY_MEM_BASE /* setbat */
31#define PPC405_PCI_PHY_IO_BASE 0xe8000000 /* setbat */
32#define PPC405_PCI_IO_BASE PPC405_PCI_PHY_IO_BASE /* setbat */
33
34#define PPC405_PCI_LOWER_MEM 0x80000000 /* hose_a->mem_space.start */
35#define PPC405_PCI_UPPER_MEM 0xBfffffff /* hose_a->mem_space.end */
36#define PPC405_PCI_LOWER_IO 0x00000000 /* hose_a->io_space.start */
37#define PPC405_PCI_UPPER_IO 0x0000ffff /* hose_a->io_space.end */
38
39#define PPC405_ISA_IO_BASE PPC405_PCI_IO_BASE
40
41#define PPC4xx_PCI_IO_PADDR ((uint)PPC405_PCI_PHY_IO_BASE)
42#define PPC4xx_PCI_IO_VADDR PPC4xx_PCI_IO_PADDR
43#define PPC4xx_PCI_IO_SIZE ((uint)64*1024)
44#define PPC4xx_PCI_CFG_PADDR ((uint)PPC405_PCI_CONFIG_ADDR)
45#define PPC4xx_PCI_CFG_VADDR PPC4xx_PCI_CFG_PADDR
46#define PPC4xx_PCI_CFG_SIZE ((uint)4*1024)
47#define PPC4xx_PCI_LCFG_PADDR ((uint)0xef400000)
48#define PPC4xx_PCI_LCFG_VADDR PPC4xx_PCI_LCFG_PADDR
49#define PPC4xx_PCI_LCFG_SIZE ((uint)4*1024)
50#define PPC4xx_ONB_IO_PADDR ((uint)0xef600000)
51#define PPC4xx_ONB_IO_VADDR PPC4xx_ONB_IO_PADDR
52#define PPC4xx_ONB_IO_SIZE ((uint)4*1024)
53
54/* serial port defines */
55#define RS_TABLE_SIZE 2
56
57#define UART0_INT 0
58#define UART1_INT 1
59
60#define PCIL0_BASE 0xEF400000
61#define UART0_IO_BASE 0xEF600300
62#define UART1_IO_BASE 0xEF600400
63#define EMAC0_BASE 0xEF600800
64
65#define BD_EMAC_ADDR(e,i) bi_enetaddr[e][i]
66
67#if defined(CONFIG_UART0_TTYS0)
68#define ACTING_UART0_IO_BASE UART0_IO_BASE
69#define ACTING_UART1_IO_BASE UART1_IO_BASE
70#define ACTING_UART0_INT UART0_INT
71#define ACTING_UART1_INT UART1_INT
72#else
73#define ACTING_UART0_IO_BASE UART1_IO_BASE
74#define ACTING_UART1_IO_BASE UART0_IO_BASE
75#define ACTING_UART0_INT UART1_INT
76#define ACTING_UART1_INT UART0_INT
77#endif
78
79#define STD_UART_OP(num) \
80 { 0, BASE_BAUD, 0, ACTING_UART##num##_INT, \
81 (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST), \
82 iomem_base: (u8 *)ACTING_UART##num##_IO_BASE, \
83 io_type: SERIAL_IO_MEM},
84
85#define SERIAL_DEBUG_IO_BASE ACTING_UART0_IO_BASE
86#define SERIAL_PORT_DFNS \
87 STD_UART_OP(0) \
88 STD_UART_OP(1)
89
90/* DCR defines */
91#define DCRN_CPMSR_BASE 0x0BA
92#define DCRN_CPMFR_BASE 0x0B9
93
94#define DCRN_CPC0_PLLMR0_BASE 0x0F0
95#define DCRN_CPC0_BOOT_BASE 0x0F1
96#define DCRN_CPC0_CR1_BASE 0x0F2
97#define DCRN_CPC0_EPRCSR_BASE 0x0F3
98#define DCRN_CPC0_PLLMR1_BASE 0x0F4
99#define DCRN_CPC0_UCR_BASE 0x0F5
100#define DCRN_CPC0_UCR_U0DIV 0x07F
101#define DCRN_CPC0_SRR_BASE 0x0F6
102#define DCRN_CPC0_JTAGID_BASE 0x0F7
103#define DCRN_CPC0_SPARE_BASE 0x0F8
104#define DCRN_CPC0_PCI_BASE 0x0F9
105
106
107#define IBM_CPM_GPT 0x80000000 /* GPT interface */
108#define IBM_CPM_PCI 0x40000000 /* PCI bridge */
109#define IBM_CPM_UIC 0x00010000 /* Universal Int Controller */
110#define IBM_CPM_CPU 0x00008000 /* processor core */
111#define IBM_CPM_EBC 0x00002000 /* EBC controller */
112#define IBM_CPM_SDRAM0 0x00004000 /* SDRAM memory controller */
113#define IBM_CPM_GPIO0 0x00001000 /* General Purpose IO */
114#define IBM_CPM_TMRCLK 0x00000400 /* CPU timers */
115#define IBM_CPM_PLB 0x00000100 /* PLB bus arbiter */
116#define IBM_CPM_OPB 0x00000080 /* PLB to OPB bridge */
117#define IBM_CPM_DMA 0x00000040 /* DMA controller */
118#define IBM_CPM_IIC0 0x00000010 /* IIC interface */
119#define IBM_CPM_UART1 0x00000002 /* serial port 0 */
120#define IBM_CPM_UART0 0x00000001 /* serial port 1 */
121#define DFLT_IBM4xx_PM ~(IBM_CPM_PCI | IBM_CPM_CPU | IBM_CPM_DMA \
122 | IBM_CPM_OPB | IBM_CPM_EBC \
123 | IBM_CPM_SDRAM0 | IBM_CPM_PLB \
124 | IBM_CPM_UIC | IBM_CPM_TMRCLK)
125#define DCRN_DMA0_BASE 0x100
126#define DCRN_DMA1_BASE 0x108
127#define DCRN_DMA2_BASE 0x110
128#define DCRN_DMA3_BASE 0x118
129#define DCRNCAP_DMA_SG 1 /* have DMA scatter/gather capability */
130#define DCRN_DMASR_BASE 0x120
131#define DCRN_EBC_BASE 0x012
132#define DCRN_DCP0_BASE 0x014
133#define DCRN_MAL_BASE 0x180
134#define DCRN_OCM0_BASE 0x018
135#define DCRN_PLB0_BASE 0x084
136#define DCRN_PLLMR_BASE 0x0B0
137#define DCRN_POB0_BASE 0x0A0
138#define DCRN_SDRAM0_BASE 0x010
139#define DCRN_UIC0_BASE 0x0C0
140#define UIC0 DCRN_UIC0_BASE
141
142#include <asm/ibm405.h>
143
144#endif /* __ASM_IBM405EP_H__ */
145#endif /* __KERNEL__ */
diff --git a/arch/ppc/platforms/4xx/ibm405gp.c b/arch/ppc/platforms/4xx/ibm405gp.c
deleted file mode 100644
index 2ac67a2f0ba6..000000000000
--- a/arch/ppc/platforms/4xx/ibm405gp.c
+++ /dev/null
@@ -1,120 +0,0 @@
1/*
2 *
3 * Copyright 2000-2001 MontaVista Software Inc.
4 * Original author: Armin Kuster akuster@mvista.com
5 *
6 * Module name: ibm405gp.c
7 *
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation; either version 2 of the License, or (at your
12 * option) any later version.
13 *
14 */
15
16#include <linux/init.h>
17#include <linux/smp.h>
18#include <linux/threads.h>
19#include <linux/param.h>
20#include <linux/string.h>
21#include <platforms/4xx/ibm405gp.h>
22#include <asm/ibm4xx.h>
23#include <asm/ocp.h>
24#include <asm/ppc4xx_pic.h>
25
26static struct ocp_func_emac_data ibm405gp_emac0_def = {
27 .rgmii_idx = -1, /* No RGMII */
28 .rgmii_mux = -1, /* No RGMII */
29 .zmii_idx = -1, /* ZMII device index */
30 .zmii_mux = 0, /* ZMII input of this EMAC */
31 .mal_idx = 0, /* MAL device index */
32 .mal_rx_chan = 0, /* MAL rx channel number */
33 .mal_tx_chan = 0, /* MAL tx channel number */
34 .wol_irq = 9, /* WOL interrupt number */
35 .mdio_idx = -1, /* No shared MDIO */
36 .tah_idx = -1, /* No TAH */
37};
38OCP_SYSFS_EMAC_DATA()
39
40static struct ocp_func_mal_data ibm405gp_mal0_def = {
41 .num_tx_chans = 1, /* Number of TX channels */
42 .num_rx_chans = 1, /* Number of RX channels */
43 .txeob_irq = 11, /* TX End Of Buffer IRQ */
44 .rxeob_irq = 12, /* RX End Of Buffer IRQ */
45 .txde_irq = 13, /* TX Descriptor Error IRQ */
46 .rxde_irq = 14, /* RX Descriptor Error IRQ */
47 .serr_irq = 10, /* MAL System Error IRQ */
48 .dcr_base = DCRN_MAL_BASE /* MAL0_CFG DCR number */
49};
50OCP_SYSFS_MAL_DATA()
51
52static struct ocp_func_iic_data ibm405gp_iic0_def = {
53 .fast_mode = 0, /* Use standad mode (100Khz) */
54};
55OCP_SYSFS_IIC_DATA()
56
57struct ocp_def core_ocp[] = {
58 { .vendor = OCP_VENDOR_IBM,
59 .function = OCP_FUNC_OPB,
60 .index = 0,
61 .paddr = 0xEF600000,
62 .irq = OCP_IRQ_NA,
63 .pm = OCP_CPM_NA,
64 },
65 { .vendor = OCP_VENDOR_IBM,
66 .function = OCP_FUNC_16550,
67 .index = 0,
68 .paddr = UART0_IO_BASE,
69 .irq = UART0_INT,
70 .pm = IBM_CPM_UART0
71 },
72 { .vendor = OCP_VENDOR_IBM,
73 .function = OCP_FUNC_16550,
74 .index = 1,
75 .paddr = UART1_IO_BASE,
76 .irq = UART1_INT,
77 .pm = IBM_CPM_UART1
78 },
79 { .vendor = OCP_VENDOR_IBM,
80 .function = OCP_FUNC_IIC,
81 .paddr = 0xEF600500,
82 .irq = 2,
83 .pm = IBM_CPM_IIC0,
84 .additions = &ibm405gp_iic0_def,
85 .show = &ocp_show_iic_data,
86 },
87 { .vendor = OCP_VENDOR_IBM,
88 .function = OCP_FUNC_GPIO,
89 .paddr = 0xEF600700,
90 .irq = OCP_IRQ_NA,
91 .pm = IBM_CPM_GPIO0
92 },
93 { .vendor = OCP_VENDOR_IBM,
94 .function = OCP_FUNC_MAL,
95 .paddr = OCP_PADDR_NA,
96 .irq = OCP_IRQ_NA,
97 .pm = OCP_CPM_NA,
98 .additions = &ibm405gp_mal0_def,
99 .show = &ocp_show_mal_data,
100 },
101 { .vendor = OCP_VENDOR_IBM,
102 .function = OCP_FUNC_EMAC,
103 .index = 0,
104 .paddr = EMAC0_BASE,
105 .irq = 15,
106 .pm = IBM_CPM_EMAC0,
107 .additions = &ibm405gp_emac0_def,
108 .show = &ocp_show_emac_data,
109 },
110 { .vendor = OCP_VENDOR_INVALID
111 }
112};
113
114/* Polarity and triggering settings for internal interrupt sources */
115struct ppc4xx_uic_settings ppc4xx_core_uic_cfg[] __initdata = {
116 { .polarity = 0xffffff80,
117 .triggering = 0x10000000,
118 .ext_irq_mask = 0x0000007f, /* IRQ0 - IRQ6 */
119 }
120};
diff --git a/arch/ppc/platforms/4xx/ibm405gp.h b/arch/ppc/platforms/4xx/ibm405gp.h
deleted file mode 100644
index 9f15e5518719..000000000000
--- a/arch/ppc/platforms/4xx/ibm405gp.h
+++ /dev/null
@@ -1,148 +0,0 @@
1/*
2 * Author: Armin Kuster akuster@mvista.com
3 *
4 * 2001 (c) MontaVista, Software, Inc. This file is licensed under
5 * the terms of the GNU General Public License version 2. This program
6 * is licensed "as is" without any warranty of any kind, whether express
7 * or implied.
8 */
9
10#ifdef __KERNEL__
11#ifndef __ASM_IBM405GP_H__
12#define __ASM_IBM405GP_H__
13
14
15/* ibm405.h at bottom of this file */
16
17/* PCI
18 * PCI Bridge config reg definitions
19 * see 17-19 of manual
20 */
21
22#define PPC405_PCI_CONFIG_ADDR 0xeec00000
23#define PPC405_PCI_CONFIG_DATA 0xeec00004
24
25#define PPC405_PCI_PHY_MEM_BASE 0x80000000 /* hose_a->pci_mem_offset */
26 /* setbat */
27#define PPC405_PCI_MEM_BASE PPC405_PCI_PHY_MEM_BASE /* setbat */
28#define PPC405_PCI_PHY_IO_BASE 0xe8000000 /* setbat */
29#define PPC405_PCI_IO_BASE PPC405_PCI_PHY_IO_BASE /* setbat */
30
31#define PPC405_PCI_LOWER_MEM 0x80000000 /* hose_a->mem_space.start */
32#define PPC405_PCI_UPPER_MEM 0xBfffffff /* hose_a->mem_space.end */
33#define PPC405_PCI_LOWER_IO 0x00000000 /* hose_a->io_space.start */
34#define PPC405_PCI_UPPER_IO 0x0000ffff /* hose_a->io_space.end */
35
36#define PPC405_ISA_IO_BASE PPC405_PCI_IO_BASE
37
38#define PPC4xx_PCI_IO_PADDR ((uint)PPC405_PCI_PHY_IO_BASE)
39#define PPC4xx_PCI_IO_VADDR PPC4xx_PCI_IO_PADDR
40#define PPC4xx_PCI_IO_SIZE ((uint)64*1024)
41#define PPC4xx_PCI_CFG_PADDR ((uint)PPC405_PCI_CONFIG_ADDR)
42#define PPC4xx_PCI_CFG_VADDR PPC4xx_PCI_CFG_PADDR
43#define PPC4xx_PCI_CFG_SIZE ((uint)4*1024)
44#define PPC4xx_PCI_LCFG_PADDR ((uint)0xef400000)
45#define PPC4xx_PCI_LCFG_VADDR PPC4xx_PCI_LCFG_PADDR
46#define PPC4xx_PCI_LCFG_SIZE ((uint)4*1024)
47#define PPC4xx_ONB_IO_PADDR ((uint)0xef600000)
48#define PPC4xx_ONB_IO_VADDR PPC4xx_ONB_IO_PADDR
49#define PPC4xx_ONB_IO_SIZE ((uint)4*1024)
50
51/* serial port defines */
52#define RS_TABLE_SIZE 2
53
54#define UART0_INT 0
55#define UART1_INT 1
56
57#define PCIL0_BASE 0xEF400000
58#define UART0_IO_BASE 0xEF600300
59#define UART1_IO_BASE 0xEF600400
60#define EMAC0_BASE 0xEF600800
61
62#define BD_EMAC_ADDR(e,i) bi_enetaddr[i]
63
64#define STD_UART_OP(num) \
65 { 0, BASE_BAUD, 0, UART##num##_INT, \
66 (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST), \
67 iomem_base: (u8 *)UART##num##_IO_BASE, \
68 io_type: SERIAL_IO_MEM},
69
70#if defined(CONFIG_UART0_TTYS0)
71#define SERIAL_DEBUG_IO_BASE UART0_IO_BASE
72#define SERIAL_PORT_DFNS \
73 STD_UART_OP(0) \
74 STD_UART_OP(1)
75#endif
76
77#if defined(CONFIG_UART0_TTYS1)
78#define SERIAL_DEBUG_IO_BASE UART1_IO_BASE
79#define SERIAL_PORT_DFNS \
80 STD_UART_OP(1) \
81 STD_UART_OP(0)
82#endif
83
84/* DCR defines */
85#define DCRN_CHCR_BASE 0x0B1
86#define DCRN_CHPSR_BASE 0x0B4
87#define DCRN_CPMSR_BASE 0x0B8
88#define DCRN_CPMFR_BASE 0x0BA
89
90#define CHR0_U0EC 0x00000080 /* Select external clock for UART0 */
91#define CHR0_U1EC 0x00000040 /* Select external clock for UART1 */
92#define CHR0_UDIV 0x0000003E /* UART internal clock divisor */
93#define CHR1_CETE 0x00800000 /* CPU external timer enable */
94
95#define DCRN_CHPSR_BASE 0x0B4
96#define PSR_PLL_FWD_MASK 0xC0000000
97#define PSR_PLL_FDBACK_MASK 0x30000000
98#define PSR_PLL_TUNING_MASK 0x0E000000
99#define PSR_PLB_CPU_MASK 0x01800000
100#define PSR_OPB_PLB_MASK 0x00600000
101#define PSR_PCI_PLB_MASK 0x00180000
102#define PSR_EB_PLB_MASK 0x00060000
103#define PSR_ROM_WIDTH_MASK 0x00018000
104#define PSR_ROM_LOC 0x00004000
105#define PSR_PCI_ASYNC_EN 0x00001000
106#define PSR_PCI_ARBIT_EN 0x00000400
107
108#define IBM_CPM_IIC0 0x80000000 /* IIC interface */
109#define IBM_CPM_PCI 0x40000000 /* PCI bridge */
110#define IBM_CPM_CPU 0x20000000 /* processor core */
111#define IBM_CPM_DMA 0x10000000 /* DMA controller */
112#define IBM_CPM_OPB 0x08000000 /* PLB to OPB bridge */
113#define IBM_CPM_DCP 0x04000000 /* CodePack */
114#define IBM_CPM_EBC 0x02000000 /* ROM/SRAM peripheral controller */
115#define IBM_CPM_SDRAM0 0x01000000 /* SDRAM memory controller */
116#define IBM_CPM_PLB 0x00800000 /* PLB bus arbiter */
117#define IBM_CPM_GPIO0 0x00400000 /* General Purpose IO (??) */
118#define IBM_CPM_UART0 0x00200000 /* serial port 0 */
119#define IBM_CPM_UART1 0x00100000 /* serial port 1 */
120#define IBM_CPM_UIC 0x00080000 /* Universal Interrupt Controller */
121#define IBM_CPM_TMRCLK 0x00040000 /* CPU timers */
122#define IBM_CPM_EMAC0 0x00020000 /* on-chip ethernet MM unit */
123#define DFLT_IBM4xx_PM ~(IBM_CPM_PCI | IBM_CPM_CPU | IBM_CPM_DMA \
124 | IBM_CPM_OPB | IBM_CPM_EBC \
125 | IBM_CPM_SDRAM0 | IBM_CPM_PLB \
126 | IBM_CPM_UIC | IBM_CPM_TMRCLK)
127
128#define DCRN_DMA0_BASE 0x100
129#define DCRN_DMA1_BASE 0x108
130#define DCRN_DMA2_BASE 0x110
131#define DCRN_DMA3_BASE 0x118
132#define DCRNCAP_DMA_SG 1 /* have DMA scatter/gather capability */
133#define DCRN_DMASR_BASE 0x120
134#define DCRN_EBC_BASE 0x012
135#define DCRN_DCP0_BASE 0x014
136#define DCRN_MAL_BASE 0x180
137#define DCRN_OCM0_BASE 0x018
138#define DCRN_PLB0_BASE 0x084
139#define DCRN_PLLMR_BASE 0x0B0
140#define DCRN_POB0_BASE 0x0A0
141#define DCRN_SDRAM0_BASE 0x010
142#define DCRN_UIC0_BASE 0x0C0
143#define UIC0 DCRN_UIC0_BASE
144
145#include <asm/ibm405.h>
146
147#endif /* __ASM_IBM405GP_H__ */
148#endif /* __KERNEL__ */
diff --git a/arch/ppc/platforms/4xx/ibm405gpr.c b/arch/ppc/platforms/4xx/ibm405gpr.c
deleted file mode 100644
index 9f4dacffdbb3..000000000000
--- a/arch/ppc/platforms/4xx/ibm405gpr.c
+++ /dev/null
@@ -1,115 +0,0 @@
1/*
2 * Author: Armin Kuster <akuster@mvista.com>
3 *
4 * 2002 (c) MontaVista, Software, Inc. This file is licensed under
5 * the terms of the GNU General Public License version 2. This program
6 * is licensed "as is" without any warranty of any kind, whether express
7 * or implied.
8 */
9
10#include <linux/init.h>
11#include <linux/smp.h>
12#include <linux/threads.h>
13#include <linux/param.h>
14#include <linux/string.h>
15#include <platforms/4xx/ibm405gpr.h>
16#include <asm/ibm4xx.h>
17#include <asm/ocp.h>
18#include <asm/ppc4xx_pic.h>
19
20static struct ocp_func_emac_data ibm405gpr_emac0_def = {
21 .rgmii_idx = -1, /* No RGMII */
22 .rgmii_mux = -1, /* No RGMII */
23 .zmii_idx = -1, /* ZMII device index */
24 .zmii_mux = 0, /* ZMII input of this EMAC */
25 .mal_idx = 0, /* MAL device index */
26 .mal_rx_chan = 0, /* MAL rx channel number */
27 .mal_tx_chan = 0, /* MAL tx channel number */
28 .wol_irq = 9, /* WOL interrupt number */
29 .mdio_idx = -1, /* No shared MDIO */
30 .tah_idx = -1, /* No TAH */
31};
32OCP_SYSFS_EMAC_DATA()
33
34static struct ocp_func_mal_data ibm405gpr_mal0_def = {
35 .num_tx_chans = 1, /* Number of TX channels */
36 .num_rx_chans = 1, /* Number of RX channels */
37 .txeob_irq = 11, /* TX End Of Buffer IRQ */
38 .rxeob_irq = 12, /* RX End Of Buffer IRQ */
39 .txde_irq = 13, /* TX Descriptor Error IRQ */
40 .rxde_irq = 14, /* RX Descriptor Error IRQ */
41 .serr_irq = 10, /* MAL System Error IRQ */
42 .dcr_base = DCRN_MAL_BASE /* MAL0_CFG DCR number */
43};
44OCP_SYSFS_MAL_DATA()
45
46static struct ocp_func_iic_data ibm405gpr_iic0_def = {
47 .fast_mode = 0, /* Use standad mode (100Khz) */
48};
49
50OCP_SYSFS_IIC_DATA()
51
52struct ocp_def core_ocp[] = {
53 { .vendor = OCP_VENDOR_IBM,
54 .function = OCP_FUNC_OPB,
55 .index = 0,
56 .paddr = 0xEF600000,
57 .irq = OCP_IRQ_NA,
58 .pm = OCP_CPM_NA,
59 },
60 { .vendor = OCP_VENDOR_IBM,
61 .function = OCP_FUNC_16550,
62 .index = 0,
63 .paddr = UART0_IO_BASE,
64 .irq = UART0_INT,
65 .pm = IBM_CPM_UART0
66 },
67 { .vendor = OCP_VENDOR_IBM,
68 .function = OCP_FUNC_16550,
69 .index = 1,
70 .paddr = UART1_IO_BASE,
71 .irq = UART1_INT,
72 .pm = IBM_CPM_UART1
73 },
74 { .vendor = OCP_VENDOR_IBM,
75 .function = OCP_FUNC_IIC,
76 .paddr = 0xEF600500,
77 .irq = 2,
78 .pm = IBM_CPM_IIC0,
79 .additions = &ibm405gpr_iic0_def,
80 .show = &ocp_show_iic_data,
81 },
82 { .vendor = OCP_VENDOR_IBM,
83 .function = OCP_FUNC_GPIO,
84 .paddr = 0xEF600700,
85 .irq = OCP_IRQ_NA,
86 .pm = IBM_CPM_GPIO0
87 },
88 { .vendor = OCP_VENDOR_IBM,
89 .function = OCP_FUNC_MAL,
90 .paddr = OCP_PADDR_NA,
91 .irq = OCP_IRQ_NA,
92 .pm = OCP_CPM_NA,
93 .additions = &ibm405gpr_mal0_def,
94 .show = &ocp_show_mal_data,
95 },
96 { .vendor = OCP_VENDOR_IBM,
97 .function = OCP_FUNC_EMAC,
98 .index = 0,
99 .paddr = EMAC0_BASE,
100 .irq = 15,
101 .pm = IBM_CPM_EMAC0,
102 .additions = &ibm405gpr_emac0_def,
103 .show = &ocp_show_emac_data,
104 },
105 { .vendor = OCP_VENDOR_INVALID
106 }
107};
108
109/* Polarity and triggering settings for internal interrupt sources */
110struct ppc4xx_uic_settings ppc4xx_core_uic_cfg[] __initdata = {
111 { .polarity = 0xffffe000,
112 .triggering = 0x10000000,
113 .ext_irq_mask = 0x00001fff, /* IRQ7 - IRQ12, IRQ0 - IRQ6 */
114 }
115};
diff --git a/arch/ppc/platforms/4xx/ibm405gpr.h b/arch/ppc/platforms/4xx/ibm405gpr.h
deleted file mode 100644
index 9e01f1515de3..000000000000
--- a/arch/ppc/platforms/4xx/ibm405gpr.h
+++ /dev/null
@@ -1,148 +0,0 @@
1/*
2 * Author: Armin Kuster <akuster@mvista.com>
3 *
4 * 2002 (c) MontaVista, Software, Inc. This file is licensed under
5 * the terms of the GNU General Public License version 2. This program
6 * is licensed "as is" without any warranty of any kind, whether express
7 * or implied.
8 */
9
10#ifdef __KERNEL__
11#ifndef __ASM_IBM405GPR_H__
12#define __ASM_IBM405GPR_H__
13
14
15/* ibm405.h at bottom of this file */
16
17/* PCI
18 * PCI Bridge config reg definitions
19 * see 17-19 of manual
20 */
21
22#define PPC405_PCI_CONFIG_ADDR 0xeec00000
23#define PPC405_PCI_CONFIG_DATA 0xeec00004
24
25#define PPC405_PCI_PHY_MEM_BASE 0x80000000 /* hose_a->pci_mem_offset */
26 /* setbat */
27#define PPC405_PCI_MEM_BASE PPC405_PCI_PHY_MEM_BASE /* setbat */
28#define PPC405_PCI_PHY_IO_BASE 0xe8000000 /* setbat */
29#define PPC405_PCI_IO_BASE PPC405_PCI_PHY_IO_BASE /* setbat */
30
31#define PPC405_PCI_LOWER_MEM 0x80000000 /* hose_a->mem_space.start */
32#define PPC405_PCI_UPPER_MEM 0xBfffffff /* hose_a->mem_space.end */
33#define PPC405_PCI_LOWER_IO 0x00000000 /* hose_a->io_space.start */
34#define PPC405_PCI_UPPER_IO 0x0000ffff /* hose_a->io_space.end */
35
36#define PPC405_ISA_IO_BASE PPC405_PCI_IO_BASE
37
38#define PPC4xx_PCI_IO_PADDR ((uint)PPC405_PCI_PHY_IO_BASE)
39#define PPC4xx_PCI_IO_VADDR PPC4xx_PCI_IO_PADDR
40#define PPC4xx_PCI_IO_SIZE ((uint)64*1024)
41#define PPC4xx_PCI_CFG_PADDR ((uint)PPC405_PCI_CONFIG_ADDR)
42#define PPC4xx_PCI_CFG_VADDR PPC4xx_PCI_CFG_PADDR
43#define PPC4xx_PCI_CFG_SIZE ((uint)4*1024)
44#define PPC4xx_PCI_LCFG_PADDR ((uint)0xef400000)
45#define PPC4xx_PCI_LCFG_VADDR PPC4xx_PCI_LCFG_PADDR
46#define PPC4xx_PCI_LCFG_SIZE ((uint)4*1024)
47#define PPC4xx_ONB_IO_PADDR ((uint)0xef600000)
48#define PPC4xx_ONB_IO_VADDR PPC4xx_ONB_IO_PADDR
49#define PPC4xx_ONB_IO_SIZE ((uint)4*1024)
50
51/* serial port defines */
52#define RS_TABLE_SIZE 2
53
54#define UART0_INT 0
55#define UART1_INT 1
56
57#define PCIL0_BASE 0xEF400000
58#define UART0_IO_BASE 0xEF600300
59#define UART1_IO_BASE 0xEF600400
60#define EMAC0_BASE 0xEF600800
61
62#define BD_EMAC_ADDR(e,i) bi_enetaddr[i]
63
64#define STD_UART_OP(num) \
65 { 0, BASE_BAUD, 0, UART##num##_INT, \
66 (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST), \
67 iomem_base: (u8 *)UART##num##_IO_BASE, \
68 io_type: SERIAL_IO_MEM},
69
70#if defined(CONFIG_UART0_TTYS0)
71#define SERIAL_DEBUG_IO_BASE UART0_IO_BASE
72#define SERIAL_PORT_DFNS \
73 STD_UART_OP(0) \
74 STD_UART_OP(1)
75#endif
76
77#if defined(CONFIG_UART0_TTYS1)
78#define SERIAL_DEBUG_IO_BASE UART1_IO_BASE
79#define SERIAL_PORT_DFNS \
80 STD_UART_OP(1) \
81 STD_UART_OP(0)
82#endif
83
84/* DCR defines */
85#define DCRN_CHCR_BASE 0x0B1
86#define DCRN_CHPSR_BASE 0x0B4
87#define DCRN_CPMSR_BASE 0x0B8
88#define DCRN_CPMFR_BASE 0x0BA
89
90#define CHR0_U0EC 0x00000080 /* Select external clock for UART0 */
91#define CHR0_U1EC 0x00000040 /* Select external clock for UART1 */
92#define CHR0_UDIV 0x0000003E /* UART internal clock divisor */
93#define CHR1_CETE 0x00800000 /* CPU external timer enable */
94
95#define DCRN_CHPSR_BASE 0x0B4
96#define PSR_PLL_FWD_MASK 0xC0000000
97#define PSR_PLL_FDBACK_MASK 0x30000000
98#define PSR_PLL_TUNING_MASK 0x0E000000
99#define PSR_PLB_CPU_MASK 0x01800000
100#define PSR_OPB_PLB_MASK 0x00600000
101#define PSR_PCI_PLB_MASK 0x00180000
102#define PSR_EB_PLB_MASK 0x00060000
103#define PSR_ROM_WIDTH_MASK 0x00018000
104#define PSR_ROM_LOC 0x00004000
105#define PSR_PCI_ASYNC_EN 0x00001000
106#define PSR_PCI_ARBIT_EN 0x00000400
107
108#define IBM_CPM_IIC0 0x80000000 /* IIC interface */
109#define IBM_CPM_PCI 0x40000000 /* PCI bridge */
110#define IBM_CPM_CPU 0x20000000 /* processor core */
111#define IBM_CPM_DMA 0x10000000 /* DMA controller */
112#define IBM_CPM_OPB 0x08000000 /* PLB to OPB bridge */
113#define IBM_CPM_DCP 0x04000000 /* CodePack */
114#define IBM_CPM_EBC 0x02000000 /* ROM/SRAM peripheral controller */
115#define IBM_CPM_SDRAM0 0x01000000 /* SDRAM memory controller */
116#define IBM_CPM_PLB 0x00800000 /* PLB bus arbiter */
117#define IBM_CPM_GPIO0 0x00400000 /* General Purpose IO (??) */
118#define IBM_CPM_UART0 0x00200000 /* serial port 0 */
119#define IBM_CPM_UART1 0x00100000 /* serial port 1 */
120#define IBM_CPM_UIC 0x00080000 /* Universal Interrupt Controller */
121#define IBM_CPM_TMRCLK 0x00040000 /* CPU timers */
122#define IBM_CPM_EMAC0 0x00020000 /* on-chip ethernet MM unit */
123#define DFLT_IBM4xx_PM ~(IBM_CPM_PCI | IBM_CPM_CPU | IBM_CPM_DMA \
124 | IBM_CPM_OPB | IBM_CPM_EBC \
125 | IBM_CPM_SDRAM0 | IBM_CPM_PLB \
126 | IBM_CPM_UIC | IBM_CPM_TMRCLK)
127
128#define DCRN_DMA0_BASE 0x100
129#define DCRN_DMA1_BASE 0x108
130#define DCRN_DMA2_BASE 0x110
131#define DCRN_DMA3_BASE 0x118
132#define DCRNCAP_DMA_SG 1 /* have DMA scatter/gather capability */
133#define DCRN_DMASR_BASE 0x120
134#define DCRN_EBC_BASE 0x012
135#define DCRN_DCP0_BASE 0x014
136#define DCRN_MAL_BASE 0x180
137#define DCRN_OCM0_BASE 0x018
138#define DCRN_PLB0_BASE 0x084
139#define DCRN_PLLMR_BASE 0x0B0
140#define DCRN_POB0_BASE 0x0A0
141#define DCRN_SDRAM0_BASE 0x010
142#define DCRN_UIC0_BASE 0x0C0
143#define UIC0 DCRN_UIC0_BASE
144
145#include <asm/ibm405.h>
146
147#endif /* __ASM_IBM405GPR_H__ */
148#endif /* __KERNEL__ */
diff --git a/arch/ppc/platforms/4xx/ibm440ep.c b/arch/ppc/platforms/4xx/ibm440ep.c
deleted file mode 100644
index 0de91532aabb..000000000000
--- a/arch/ppc/platforms/4xx/ibm440ep.c
+++ /dev/null
@@ -1,220 +0,0 @@
1/*
2 * PPC440EP I/O descriptions
3 *
4 * Wade Farnsworth <wfarnsworth@mvista.com>
5 * Copyright 2004 MontaVista Software Inc.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 *
12 */
13#include <linux/init.h>
14#include <linux/module.h>
15#include <linux/platform_device.h>
16#include <platforms/4xx/ibm440ep.h>
17#include <asm/ocp.h>
18#include <asm/ppc4xx_pic.h>
19
20static struct ocp_func_emac_data ibm440ep_emac0_def = {
21 .rgmii_idx = -1, /* No RGMII */
22 .rgmii_mux = -1, /* No RGMII */
23 .zmii_idx = 0, /* ZMII device index */
24 .zmii_mux = 0, /* ZMII input of this EMAC */
25 .mal_idx = 0, /* MAL device index */
26 .mal_rx_chan = 0, /* MAL rx channel number */
27 .mal_tx_chan = 0, /* MAL tx channel number */
28 .wol_irq = 61, /* WOL interrupt number */
29 .mdio_idx = -1, /* No shared MDIO */
30 .tah_idx = -1, /* No TAH */
31};
32
33static struct ocp_func_emac_data ibm440ep_emac1_def = {
34 .rgmii_idx = -1, /* No RGMII */
35 .rgmii_mux = -1, /* No RGMII */
36 .zmii_idx = 0, /* ZMII device index */
37 .zmii_mux = 1, /* ZMII input of this EMAC */
38 .mal_idx = 0, /* MAL device index */
39 .mal_rx_chan = 1, /* MAL rx channel number */
40 .mal_tx_chan = 2, /* MAL tx channel number */
41 .wol_irq = 63, /* WOL interrupt number */
42 .mdio_idx = -1, /* No shared MDIO */
43 .tah_idx = -1, /* No TAH */
44};
45OCP_SYSFS_EMAC_DATA()
46
47static struct ocp_func_mal_data ibm440ep_mal0_def = {
48 .num_tx_chans = 4, /* Number of TX channels */
49 .num_rx_chans = 2, /* Number of RX channels */
50 .txeob_irq = 10, /* TX End Of Buffer IRQ */
51 .rxeob_irq = 11, /* RX End Of Buffer IRQ */
52 .txde_irq = 33, /* TX Descriptor Error IRQ */
53 .rxde_irq = 34, /* RX Descriptor Error IRQ */
54 .serr_irq = 32, /* MAL System Error IRQ */
55 .dcr_base = DCRN_MAL_BASE /* MAL0_CFG DCR number */
56};
57OCP_SYSFS_MAL_DATA()
58
59static struct ocp_func_iic_data ibm440ep_iic0_def = {
60 .fast_mode = 0, /* Use standad mode (100Khz) */
61};
62
63static struct ocp_func_iic_data ibm440ep_iic1_def = {
64 .fast_mode = 0, /* Use standad mode (100Khz) */
65};
66OCP_SYSFS_IIC_DATA()
67
68struct ocp_def core_ocp[] = {
69 { .vendor = OCP_VENDOR_IBM,
70 .function = OCP_FUNC_OPB,
71 .index = 0,
72 .paddr = 0x0EF600000ULL,
73 .irq = OCP_IRQ_NA,
74 .pm = OCP_CPM_NA,
75 },
76 { .vendor = OCP_VENDOR_IBM,
77 .function = OCP_FUNC_16550,
78 .index = 0,
79 .paddr = PPC440EP_UART0_ADDR,
80 .irq = UART0_INT,
81 .pm = IBM_CPM_UART0,
82 },
83 { .vendor = OCP_VENDOR_IBM,
84 .function = OCP_FUNC_16550,
85 .index = 1,
86 .paddr = PPC440EP_UART1_ADDR,
87 .irq = UART1_INT,
88 .pm = IBM_CPM_UART1,
89 },
90 { .vendor = OCP_VENDOR_IBM,
91 .function = OCP_FUNC_16550,
92 .index = 2,
93 .paddr = PPC440EP_UART2_ADDR,
94 .irq = UART2_INT,
95 .pm = IBM_CPM_UART2,
96 },
97 { .vendor = OCP_VENDOR_IBM,
98 .function = OCP_FUNC_16550,
99 .index = 3,
100 .paddr = PPC440EP_UART3_ADDR,
101 .irq = UART3_INT,
102 .pm = IBM_CPM_UART3,
103 },
104 { .vendor = OCP_VENDOR_IBM,
105 .function = OCP_FUNC_IIC,
106 .index = 0,
107 .paddr = 0x0EF600700ULL,
108 .irq = 2,
109 .pm = IBM_CPM_IIC0,
110 .additions = &ibm440ep_iic0_def,
111 .show = &ocp_show_iic_data
112 },
113 { .vendor = OCP_VENDOR_IBM,
114 .function = OCP_FUNC_IIC,
115 .index = 1,
116 .paddr = 0x0EF600800ULL,
117 .irq = 7,
118 .pm = IBM_CPM_IIC1,
119 .additions = &ibm440ep_iic1_def,
120 .show = &ocp_show_iic_data
121 },
122 { .vendor = OCP_VENDOR_IBM,
123 .function = OCP_FUNC_GPIO,
124 .index = 0,
125 .paddr = 0x0EF600B00ULL,
126 .irq = OCP_IRQ_NA,
127 .pm = IBM_CPM_GPIO0,
128 },
129 { .vendor = OCP_VENDOR_IBM,
130 .function = OCP_FUNC_GPIO,
131 .index = 1,
132 .paddr = 0x0EF600C00ULL,
133 .irq = OCP_IRQ_NA,
134 .pm = OCP_CPM_NA,
135 },
136 { .vendor = OCP_VENDOR_IBM,
137 .function = OCP_FUNC_MAL,
138 .paddr = OCP_PADDR_NA,
139 .irq = OCP_IRQ_NA,
140 .pm = OCP_CPM_NA,
141 .additions = &ibm440ep_mal0_def,
142 .show = &ocp_show_mal_data,
143 },
144 { .vendor = OCP_VENDOR_IBM,
145 .function = OCP_FUNC_EMAC,
146 .index = 0,
147 .paddr = 0x0EF600E00ULL,
148 .irq = 60,
149 .pm = OCP_CPM_NA,
150 .additions = &ibm440ep_emac0_def,
151 .show = &ocp_show_emac_data,
152 },
153 { .vendor = OCP_VENDOR_IBM,
154 .function = OCP_FUNC_EMAC,
155 .index = 1,
156 .paddr = 0x0EF600F00ULL,
157 .irq = 62,
158 .pm = OCP_CPM_NA,
159 .additions = &ibm440ep_emac1_def,
160 .show = &ocp_show_emac_data,
161 },
162 { .vendor = OCP_VENDOR_IBM,
163 .function = OCP_FUNC_ZMII,
164 .paddr = 0x0EF600D00ULL,
165 .irq = OCP_IRQ_NA,
166 .pm = OCP_CPM_NA,
167 },
168 { .vendor = OCP_VENDOR_INVALID
169 }
170};
171
172/* Polarity and triggering settings for internal interrupt sources */
173struct ppc4xx_uic_settings ppc4xx_core_uic_cfg[] __initdata = {
174 { .polarity = 0xffbffe03,
175 .triggering = 0x00000000,
176 .ext_irq_mask = 0x000001fc, /* IRQ0 - IRQ6 */
177 },
178 { .polarity = 0xffffc6af,
179 .triggering = 0x06000140,
180 .ext_irq_mask = 0x00003800, /* IRQ7 - IRQ9 */
181 },
182};
183
184static struct resource usb_gadget_resources[] = {
185 [0] = {
186 .start = 0x050000100ULL,
187 .end = 0x05000017FULL,
188 .flags = IORESOURCE_MEM,
189 },
190 [1] = {
191 .start = 55,
192 .end = 55,
193 .flags = IORESOURCE_IRQ,
194 },
195};
196
197static u64 dma_mask = 0xffffffffULL;
198
199static struct platform_device usb_gadget_device = {
200 .name = "musbhsfc",
201 .id = 0,
202 .num_resources = ARRAY_SIZE(usb_gadget_resources),
203 .resource = usb_gadget_resources,
204 .dev = {
205 .dma_mask = &dma_mask,
206 .coherent_dma_mask = 0xffffffffULL,
207 }
208};
209
210static struct platform_device *ibm440ep_devs[] __initdata = {
211 &usb_gadget_device,
212};
213
214static int __init
215ibm440ep_platform_add_devices(void)
216{
217 return platform_add_devices(ibm440ep_devs, ARRAY_SIZE(ibm440ep_devs));
218}
219arch_initcall(ibm440ep_platform_add_devices);
220
diff --git a/arch/ppc/platforms/4xx/ibm440ep.h b/arch/ppc/platforms/4xx/ibm440ep.h
deleted file mode 100644
index d92572727d20..000000000000
--- a/arch/ppc/platforms/4xx/ibm440ep.h
+++ /dev/null
@@ -1,73 +0,0 @@
1/*
2 * PPC440EP definitions
3 *
4 * Wade Farnsworth <wfarnsworth@mvista.com>
5 *
6 * Copyright 2002 Roland Dreier
7 * Copyright 2004 MontaVista Software, Inc.
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation; either version 2 of the License, or (at your
12 * option) any later version.
13 *
14 */
15
16#ifdef __KERNEL__
17#ifndef __PPC_PLATFORMS_IBM440EP_H
18#define __PPC_PLATFORMS_IBM440EP_H
19
20#include <asm/ibm44x.h>
21
22/* UART */
23#define PPC440EP_UART0_ADDR 0x0EF600300
24#define PPC440EP_UART1_ADDR 0x0EF600400
25#define PPC440EP_UART2_ADDR 0x0EF600500
26#define PPC440EP_UART3_ADDR 0x0EF600600
27#define UART0_INT 0
28#define UART1_INT 1
29#define UART2_INT 3
30#define UART3_INT 4
31
32/* Clock and Power Management */
33#define IBM_CPM_IIC0 0x80000000 /* IIC interface */
34#define IBM_CPM_IIC1 0x40000000 /* IIC interface */
35#define IBM_CPM_PCI 0x20000000 /* PCI bridge */
36#define IBM_CPM_USB1H 0x08000000 /* USB 1.1 Host */
37#define IBM_CPM_FPU 0x04000000 /* floating point unit */
38#define IBM_CPM_CPU 0x02000000 /* processor core */
39#define IBM_CPM_DMA 0x01000000 /* DMA controller */
40#define IBM_CPM_BGO 0x00800000 /* PLB to OPB bus arbiter */
41#define IBM_CPM_BGI 0x00400000 /* OPB to PLB bridge */
42#define IBM_CPM_EBC 0x00200000 /* External Bus Controller */
43#define IBM_CPM_EBM 0x00100000 /* Ext Bus Master Interface */
44#define IBM_CPM_DMC 0x00080000 /* SDRAM peripheral controller */
45#define IBM_CPM_PLB4 0x00040000 /* PLB4 bus arbiter */
46#define IBM_CPM_PLB4x3 0x00020000 /* PLB4 to PLB3 bridge controller */
47#define IBM_CPM_PLB3x4 0x00010000 /* PLB3 to PLB4 bridge controller */
48#define IBM_CPM_PLB3 0x00008000 /* PLB3 bus arbiter */
49#define IBM_CPM_PPM 0x00002000 /* PLB Performance Monitor */
50#define IBM_CPM_UIC1 0x00001000 /* Universal Interrupt Controller */
51#define IBM_CPM_GPIO0 0x00000800 /* General Purpose IO (??) */
52#define IBM_CPM_GPT 0x00000400 /* General Purpose Timers */
53#define IBM_CPM_UART0 0x00000200 /* serial port 0 */
54#define IBM_CPM_UART1 0x00000100 /* serial port 1 */
55#define IBM_CPM_UIC0 0x00000080 /* Universal Interrupt Controller */
56#define IBM_CPM_TMRCLK 0x00000040 /* CPU timers */
57#define IBM_CPM_EMAC0 0x00000020 /* ethernet port 0 */
58#define IBM_CPM_EMAC1 0x00000010 /* ethernet port 1 */
59#define IBM_CPM_UART2 0x00000008 /* serial port 2 */
60#define IBM_CPM_UART3 0x00000004 /* serial port 3 */
61#define IBM_CPM_USB2D 0x00000002 /* USB 2.0 Device */
62#define IBM_CPM_USB2H 0x00000001 /* USB 2.0 Host */
63
64#define DFLT_IBM4xx_PM ~(IBM_CPM_UIC0 | IBM_CPM_UIC1 | IBM_CPM_CPU \
65 | IBM_CPM_EBC | IBM_CPM_BGO | IBM_CPM_FPU \
66 | IBM_CPM_EBM | IBM_CPM_PLB4 | IBM_CPM_3x4 \
67 | IBM_CPM_PLB3 | IBM_CPM_PLB4x3 \
68 | IBM_CPM_EMAC0 | IBM_CPM_TMRCLK \
69 | IBM_CPM_DMA | IBM_CPM_PCI | IBM_CPM_EMAC1)
70
71
72#endif /* __PPC_PLATFORMS_IBM440EP_H */
73#endif /* __KERNEL__ */
diff --git a/arch/ppc/platforms/4xx/ibm440gp.c b/arch/ppc/platforms/4xx/ibm440gp.c
deleted file mode 100644
index b67a72e5c6fe..000000000000
--- a/arch/ppc/platforms/4xx/ibm440gp.c
+++ /dev/null
@@ -1,163 +0,0 @@
1/*
2 * PPC440GP I/O descriptions
3 *
4 * Matt Porter <mporter@mvista.com>
5 * Copyright 2002-2004 MontaVista Software Inc.
6 *
7 * Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net>
8 * Copyright (c) 2003, 2004 Zultys Technologies
9 *
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the
12 * Free Software Foundation; either version 2 of the License, or (at your
13 * option) any later version.
14 *
15 */
16#include <linux/init.h>
17#include <linux/module.h>
18#include <platforms/4xx/ibm440gp.h>
19#include <asm/ocp.h>
20#include <asm/ppc4xx_pic.h>
21
22static struct ocp_func_emac_data ibm440gp_emac0_def = {
23 .rgmii_idx = -1, /* No RGMII */
24 .rgmii_mux = -1, /* No RGMII */
25 .zmii_idx = 0, /* ZMII device index */
26 .zmii_mux = 0, /* ZMII input of this EMAC */
27 .mal_idx = 0, /* MAL device index */
28 .mal_rx_chan = 0, /* MAL rx channel number */
29 .mal_tx_chan = 0, /* MAL tx channel number */
30 .wol_irq = 61, /* WOL interrupt number */
31 .mdio_idx = -1, /* No shared MDIO */
32 .tah_idx = -1, /* No TAH */
33};
34
35static struct ocp_func_emac_data ibm440gp_emac1_def = {
36 .rgmii_idx = -1, /* No RGMII */
37 .rgmii_mux = -1, /* No RGMII */
38 .zmii_idx = 0, /* ZMII device index */
39 .zmii_mux = 1, /* ZMII input of this EMAC */
40 .mal_idx = 0, /* MAL device index */
41 .mal_rx_chan = 1, /* MAL rx channel number */
42 .mal_tx_chan = 2, /* MAL tx channel number */
43 .wol_irq = 63, /* WOL interrupt number */
44 .mdio_idx = -1, /* No shared MDIO */
45 .tah_idx = -1, /* No TAH */
46};
47OCP_SYSFS_EMAC_DATA()
48
49static struct ocp_func_mal_data ibm440gp_mal0_def = {
50 .num_tx_chans = 4, /* Number of TX channels */
51 .num_rx_chans = 2, /* Number of RX channels */
52 .txeob_irq = 10, /* TX End Of Buffer IRQ */
53 .rxeob_irq = 11, /* RX End Of Buffer IRQ */
54 .txde_irq = 33, /* TX Descriptor Error IRQ */
55 .rxde_irq = 34, /* RX Descriptor Error IRQ */
56 .serr_irq = 32, /* MAL System Error IRQ */
57 .dcr_base = DCRN_MAL_BASE /* MAL0_CFG DCR number */
58};
59OCP_SYSFS_MAL_DATA()
60
61static struct ocp_func_iic_data ibm440gp_iic0_def = {
62 .fast_mode = 0, /* Use standad mode (100Khz) */
63};
64
65static struct ocp_func_iic_data ibm440gp_iic1_def = {
66 .fast_mode = 0, /* Use standad mode (100Khz) */
67};
68OCP_SYSFS_IIC_DATA()
69
70struct ocp_def core_ocp[] = {
71 { .vendor = OCP_VENDOR_IBM,
72 .function = OCP_FUNC_OPB,
73 .index = 0,
74 .paddr = 0x0000000140000000ULL,
75 .irq = OCP_IRQ_NA,
76 .pm = OCP_CPM_NA,
77 },
78 { .vendor = OCP_VENDOR_IBM,
79 .function = OCP_FUNC_16550,
80 .index = 0,
81 .paddr = PPC440GP_UART0_ADDR,
82 .irq = UART0_INT,
83 .pm = IBM_CPM_UART0,
84 },
85 { .vendor = OCP_VENDOR_IBM,
86 .function = OCP_FUNC_16550,
87 .index = 1,
88 .paddr = PPC440GP_UART1_ADDR,
89 .irq = UART1_INT,
90 .pm = IBM_CPM_UART1,
91 },
92 { .vendor = OCP_VENDOR_IBM,
93 .function = OCP_FUNC_IIC,
94 .index = 0,
95 .paddr = 0x0000000140000400ULL,
96 .irq = 2,
97 .pm = IBM_CPM_IIC0,
98 .additions = &ibm440gp_iic0_def,
99 .show = &ocp_show_iic_data
100 },
101 { .vendor = OCP_VENDOR_IBM,
102 .function = OCP_FUNC_IIC,
103 .index = 1,
104 .paddr = 0x0000000140000500ULL,
105 .irq = 3,
106 .pm = IBM_CPM_IIC1,
107 .additions = &ibm440gp_iic1_def,
108 .show = &ocp_show_iic_data
109 },
110 { .vendor = OCP_VENDOR_IBM,
111 .function = OCP_FUNC_GPIO,
112 .index = 0,
113 .paddr = 0x0000000140000700ULL,
114 .irq = OCP_IRQ_NA,
115 .pm = IBM_CPM_GPIO0,
116 },
117 { .vendor = OCP_VENDOR_IBM,
118 .function = OCP_FUNC_MAL,
119 .paddr = OCP_PADDR_NA,
120 .irq = OCP_IRQ_NA,
121 .pm = OCP_CPM_NA,
122 .additions = &ibm440gp_mal0_def,
123 .show = &ocp_show_mal_data,
124 },
125 { .vendor = OCP_VENDOR_IBM,
126 .function = OCP_FUNC_EMAC,
127 .index = 0,
128 .paddr = 0x0000000140000800ULL,
129 .irq = 60,
130 .pm = OCP_CPM_NA,
131 .additions = &ibm440gp_emac0_def,
132 .show = &ocp_show_emac_data,
133 },
134 { .vendor = OCP_VENDOR_IBM,
135 .function = OCP_FUNC_EMAC,
136 .index = 1,
137 .paddr = 0x0000000140000900ULL,
138 .irq = 62,
139 .pm = OCP_CPM_NA,
140 .additions = &ibm440gp_emac1_def,
141 .show = &ocp_show_emac_data,
142 },
143 { .vendor = OCP_VENDOR_IBM,
144 .function = OCP_FUNC_ZMII,
145 .paddr = 0x0000000140000780ULL,
146 .irq = OCP_IRQ_NA,
147 .pm = OCP_CPM_NA,
148 },
149 { .vendor = OCP_VENDOR_INVALID
150 }
151};
152
153/* Polarity and triggering settings for internal interrupt sources */
154struct ppc4xx_uic_settings ppc4xx_core_uic_cfg[] __initdata = {
155 { .polarity = 0xfffffe03,
156 .triggering = 0x01c00000,
157 .ext_irq_mask = 0x000001fc, /* IRQ0 - IRQ6 */
158 },
159 { .polarity = 0xffffc0ff,
160 .triggering = 0x00ff8000,
161 .ext_irq_mask = 0x00003f00, /* IRQ7 - IRQ12 */
162 },
163};
diff --git a/arch/ppc/platforms/4xx/ibm440gp.h b/arch/ppc/platforms/4xx/ibm440gp.h
deleted file mode 100644
index 391c90e1f5ea..000000000000
--- a/arch/ppc/platforms/4xx/ibm440gp.h
+++ /dev/null
@@ -1,63 +0,0 @@
1/*
2 * PPC440GP definitions
3 *
4 * Roland Dreier <roland@digitalvampire.org>
5 *
6 * Copyright 2002 Roland Dreier
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
12 *
13 * This file contains code that was originally in the files ibm44x.h
14 * and ebony.h, which were written by Matt Porter of MontaVista Software Inc.
15 */
16
17#ifdef __KERNEL__
18#ifndef __PPC_PLATFORMS_IBM440GP_H
19#define __PPC_PLATFORMS_IBM440GP_H
20
21
22/* UART */
23#define PPC440GP_UART0_ADDR 0x0000000140000200ULL
24#define PPC440GP_UART1_ADDR 0x0000000140000300ULL
25#define UART0_INT 0
26#define UART1_INT 1
27
28/* Clock and Power Management */
29#define IBM_CPM_IIC0 0x80000000 /* IIC interface */
30#define IBM_CPM_IIC1 0x40000000 /* IIC interface */
31#define IBM_CPM_PCI 0x20000000 /* PCI bridge */
32#define IBM_CPM_CPU 0x02000000 /* processor core */
33#define IBM_CPM_DMA 0x01000000 /* DMA controller */
34#define IBM_CPM_BGO 0x00800000 /* PLB to OPB bus arbiter */
35#define IBM_CPM_BGI 0x00400000 /* OPB to PLB bridge */
36#define IBM_CPM_EBC 0x00200000 /* External Bux Controller */
37#define IBM_CPM_EBM 0x00100000 /* Ext Bus Master Interface */
38#define IBM_CPM_DMC 0x00080000 /* SDRAM peripheral controller */
39#define IBM_CPM_PLB 0x00040000 /* PLB bus arbiter */
40#define IBM_CPM_SRAM 0x00020000 /* SRAM memory controller */
41#define IBM_CPM_PPM 0x00002000 /* PLB Performance Monitor */
42#define IBM_CPM_UIC1 0x00001000 /* Universal Interrupt Controller */
43#define IBM_CPM_GPIO0 0x00000800 /* General Purpose IO (??) */
44#define IBM_CPM_GPT 0x00000400 /* General Purpose Timers */
45#define IBM_CPM_UART0 0x00000200 /* serial port 0 */
46#define IBM_CPM_UART1 0x00000100 /* serial port 1 */
47#define IBM_CPM_UIC0 0x00000080 /* Universal Interrupt Controller */
48#define IBM_CPM_TMRCLK 0x00000040 /* CPU timers */
49
50#define DFLT_IBM4xx_PM ~(IBM_CPM_UIC | IBM_CPM_UIC1 | IBM_CPM_CPU \
51 | IBM_CPM_EBC | IBM_CPM_SRAM | IBM_CPM_BGO \
52 | IBM_CPM_EBM | IBM_CPM_PLB | IBM_CPM_OPB \
53 | IBM_CPM_TMRCLK | IBM_CPM_DMA | IBM_CPM_PCI)
54/*
55 * Serial port defines
56 */
57#define RS_TABLE_SIZE 2
58
59#include <asm/ibm44x.h>
60#include <syslib/ibm440gp_common.h>
61
62#endif /* __PPC_PLATFORMS_IBM440GP_H */
63#endif /* __KERNEL__ */
diff --git a/arch/ppc/platforms/4xx/ibm440gx.c b/arch/ppc/platforms/4xx/ibm440gx.c
deleted file mode 100644
index 685abffcb6ce..000000000000
--- a/arch/ppc/platforms/4xx/ibm440gx.c
+++ /dev/null
@@ -1,231 +0,0 @@
1/*
2 * PPC440GX I/O descriptions
3 *
4 * Matt Porter <mporter@mvista.com>
5 * Copyright 2002-2004 MontaVista Software Inc.
6 *
7 * Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net>
8 * Copyright (c) 2003, 2004 Zultys Technologies
9 *
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the
12 * Free Software Foundation; either version 2 of the License, or (at your
13 * option) any later version.
14 *
15 */
16#include <linux/init.h>
17#include <linux/module.h>
18#include <platforms/4xx/ibm440gx.h>
19#include <asm/ocp.h>
20#include <asm/ppc4xx_pic.h>
21
22static struct ocp_func_emac_data ibm440gx_emac0_def = {
23 .rgmii_idx = -1, /* No RGMII */
24 .rgmii_mux = -1, /* No RGMII */
25 .zmii_idx = 0, /* ZMII device index */
26 .zmii_mux = 0, /* ZMII input of this EMAC */
27 .mal_idx = 0, /* MAL device index */
28 .mal_rx_chan = 0, /* MAL rx channel number */
29 .mal_tx_chan = 0, /* MAL tx channel number */
30 .wol_irq = 61, /* WOL interrupt number */
31 .mdio_idx = -1, /* No shared MDIO */
32 .tah_idx = -1, /* No TAH */
33};
34
35static struct ocp_func_emac_data ibm440gx_emac1_def = {
36 .rgmii_idx = -1, /* No RGMII */
37 .rgmii_mux = -1, /* No RGMII */
38 .zmii_idx = 0, /* ZMII device index */
39 .zmii_mux = 1, /* ZMII input of this EMAC */
40 .mal_idx = 0, /* MAL device index */
41 .mal_rx_chan = 1, /* MAL rx channel number */
42 .mal_tx_chan = 1, /* MAL tx channel number */
43 .wol_irq = 63, /* WOL interrupt number */
44 .mdio_idx = -1, /* No shared MDIO */
45 .tah_idx = -1, /* No TAH */
46};
47
48static struct ocp_func_emac_data ibm440gx_emac2_def = {
49 .rgmii_idx = 0, /* RGMII device index */
50 .rgmii_mux = 0, /* RGMII input of this EMAC */
51 .zmii_idx = 0, /* ZMII device index */
52 .zmii_mux = 2, /* ZMII input of this EMAC */
53 .mal_idx = 0, /* MAL device index */
54 .mal_rx_chan = 2, /* MAL rx channel number */
55 .mal_tx_chan = 2, /* MAL tx channel number */
56 .wol_irq = 65, /* WOL interrupt number */
57 .mdio_idx = -1, /* No shared MDIO */
58 .tah_idx = 0, /* TAH device index */
59};
60
61static struct ocp_func_emac_data ibm440gx_emac3_def = {
62 .rgmii_idx = 0, /* RGMII device index */
63 .rgmii_mux = 1, /* RGMII input of this EMAC */
64 .zmii_idx = 0, /* ZMII device index */
65 .zmii_mux = 3, /* ZMII input of this EMAC */
66 .mal_idx = 0, /* MAL device index */
67 .mal_rx_chan = 3, /* MAL rx channel number */
68 .mal_tx_chan = 3, /* MAL tx channel number */
69 .wol_irq = 67, /* WOL interrupt number */
70 .mdio_idx = -1, /* No shared MDIO */
71 .tah_idx = 1, /* TAH device index */
72};
73OCP_SYSFS_EMAC_DATA()
74
75static struct ocp_func_mal_data ibm440gx_mal0_def = {
76 .num_tx_chans = 4, /* Number of TX channels */
77 .num_rx_chans = 4, /* Number of RX channels */
78 .txeob_irq = 10, /* TX End Of Buffer IRQ */
79 .rxeob_irq = 11, /* RX End Of Buffer IRQ */
80 .txde_irq = 33, /* TX Descriptor Error IRQ */
81 .rxde_irq = 34, /* RX Descriptor Error IRQ */
82 .serr_irq = 32, /* MAL System Error IRQ */
83 .dcr_base = DCRN_MAL_BASE /* MAL0_CFG DCR number */
84};
85OCP_SYSFS_MAL_DATA()
86
87static struct ocp_func_iic_data ibm440gx_iic0_def = {
88 .fast_mode = 0, /* Use standad mode (100Khz) */
89};
90
91static struct ocp_func_iic_data ibm440gx_iic1_def = {
92 .fast_mode = 0, /* Use standad mode (100Khz) */
93};
94OCP_SYSFS_IIC_DATA()
95
96struct ocp_def core_ocp[] = {
97 { .vendor = OCP_VENDOR_IBM,
98 .function = OCP_FUNC_OPB,
99 .index = 0,
100 .paddr = 0x0000000140000000ULL,
101 .irq = OCP_IRQ_NA,
102 .pm = OCP_CPM_NA,
103 },
104 { .vendor = OCP_VENDOR_IBM,
105 .function = OCP_FUNC_16550,
106 .index = 0,
107 .paddr = PPC440GX_UART0_ADDR,
108 .irq = UART0_INT,
109 .pm = IBM_CPM_UART0,
110 },
111 { .vendor = OCP_VENDOR_IBM,
112 .function = OCP_FUNC_16550,
113 .index = 1,
114 .paddr = PPC440GX_UART1_ADDR,
115 .irq = UART1_INT,
116 .pm = IBM_CPM_UART1,
117 },
118 { .vendor = OCP_VENDOR_IBM,
119 .function = OCP_FUNC_IIC,
120 .index = 0,
121 .paddr = 0x0000000140000400ULL,
122 .irq = 2,
123 .pm = IBM_CPM_IIC0,
124 .additions = &ibm440gx_iic0_def,
125 .show = &ocp_show_iic_data
126 },
127 { .vendor = OCP_VENDOR_IBM,
128 .function = OCP_FUNC_IIC,
129 .index = 1,
130 .paddr = 0x0000000140000500ULL,
131 .irq = 3,
132 .pm = IBM_CPM_IIC1,
133 .additions = &ibm440gx_iic1_def,
134 .show = &ocp_show_iic_data
135 },
136 { .vendor = OCP_VENDOR_IBM,
137 .function = OCP_FUNC_GPIO,
138 .index = 0,
139 .paddr = 0x0000000140000700ULL,
140 .irq = OCP_IRQ_NA,
141 .pm = IBM_CPM_GPIO0,
142 },
143 { .vendor = OCP_VENDOR_IBM,
144 .function = OCP_FUNC_MAL,
145 .paddr = OCP_PADDR_NA,
146 .irq = OCP_IRQ_NA,
147 .pm = OCP_CPM_NA,
148 .additions = &ibm440gx_mal0_def,
149 .show = &ocp_show_mal_data,
150 },
151 { .vendor = OCP_VENDOR_IBM,
152 .function = OCP_FUNC_EMAC,
153 .index = 0,
154 .paddr = 0x0000000140000800ULL,
155 .irq = 60,
156 .pm = OCP_CPM_NA,
157 .additions = &ibm440gx_emac0_def,
158 .show = &ocp_show_emac_data,
159 },
160 { .vendor = OCP_VENDOR_IBM,
161 .function = OCP_FUNC_EMAC,
162 .index = 1,
163 .paddr = 0x0000000140000900ULL,
164 .irq = 62,
165 .pm = OCP_CPM_NA,
166 .additions = &ibm440gx_emac1_def,
167 .show = &ocp_show_emac_data,
168 },
169 { .vendor = OCP_VENDOR_IBM,
170 .function = OCP_FUNC_EMAC,
171 .index = 2,
172 .paddr = 0x0000000140000C00ULL,
173 .irq = 64,
174 .pm = OCP_CPM_NA,
175 .additions = &ibm440gx_emac2_def,
176 .show = &ocp_show_emac_data,
177 },
178 { .vendor = OCP_VENDOR_IBM,
179 .function = OCP_FUNC_EMAC,
180 .index = 3,
181 .paddr = 0x0000000140000E00ULL,
182 .irq = 66,
183 .pm = OCP_CPM_NA,
184 .additions = &ibm440gx_emac3_def,
185 .show = &ocp_show_emac_data,
186 },
187 { .vendor = OCP_VENDOR_IBM,
188 .function = OCP_FUNC_RGMII,
189 .paddr = 0x0000000140000790ULL,
190 .irq = OCP_IRQ_NA,
191 .pm = OCP_CPM_NA,
192 },
193 { .vendor = OCP_VENDOR_IBM,
194 .function = OCP_FUNC_ZMII,
195 .paddr = 0x0000000140000780ULL,
196 .irq = OCP_IRQ_NA,
197 .pm = OCP_CPM_NA,
198 },
199 { .vendor = OCP_VENDOR_IBM,
200 .function = OCP_FUNC_TAH,
201 .index = 0,
202 .paddr = 0x0000000140000b50ULL,
203 .irq = 68,
204 .pm = OCP_CPM_NA,
205 },
206 { .vendor = OCP_VENDOR_IBM,
207 .function = OCP_FUNC_TAH,
208 .index = 1,
209 .paddr = 0x0000000140000d50ULL,
210 .irq = 69,
211 .pm = OCP_CPM_NA,
212 },
213 { .vendor = OCP_VENDOR_INVALID
214 }
215};
216
217/* Polarity and triggering settings for internal interrupt sources */
218struct ppc4xx_uic_settings ppc4xx_core_uic_cfg[] __initdata = {
219 { .polarity = 0xfffffe03,
220 .triggering = 0x01c00000,
221 .ext_irq_mask = 0x000001fc, /* IRQ0 - IRQ6 */
222 },
223 { .polarity = 0xffffc0ff,
224 .triggering = 0x00ff8000,
225 .ext_irq_mask = 0x00003f00, /* IRQ7 - IRQ12 */
226 },
227 { .polarity = 0xffff83ff,
228 .triggering = 0x000f83c0,
229 .ext_irq_mask = 0x00007c00, /* IRQ13 - IRQ17 */
230 },
231};
diff --git a/arch/ppc/platforms/4xx/ibm440gx.h b/arch/ppc/platforms/4xx/ibm440gx.h
deleted file mode 100644
index 599c4289b9c2..000000000000
--- a/arch/ppc/platforms/4xx/ibm440gx.h
+++ /dev/null
@@ -1,71 +0,0 @@
1/*
2 * PPC440GX definitions
3 *
4 * Matt Porter <mporter@mvista.com>
5 *
6 * Copyright 2002 Roland Dreier
7 * Copyright 2003 MontaVista Software, Inc.
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation; either version 2 of the License, or (at your
12 * option) any later version.
13 *
14 */
15
16#ifdef __KERNEL__
17#ifndef __PPC_PLATFORMS_IBM440GX_H
18#define __PPC_PLATFORMS_IBM440GX_H
19
20
21#include <asm/ibm44x.h>
22
23/* UART */
24#define PPC440GX_UART0_ADDR 0x0000000140000200ULL
25#define PPC440GX_UART1_ADDR 0x0000000140000300ULL
26#define UART0_INT 0
27#define UART1_INT 1
28
29/* Clock and Power Management */
30#define IBM_CPM_IIC0 0x80000000 /* IIC interface */
31#define IBM_CPM_IIC1 0x40000000 /* IIC interface */
32#define IBM_CPM_PCI 0x20000000 /* PCI bridge */
33#define IBM_CPM_RGMII 0x10000000 /* RGMII */
34#define IBM_CPM_TAHOE0 0x08000000 /* TAHOE 0 */
35#define IBM_CPM_TAHOE1 0x04000000 /* TAHOE 1 */
36#define IBM_CPM_CPU 0x02000000 /* processor core */
37#define IBM_CPM_DMA 0x01000000 /* DMA controller */
38#define IBM_CPM_BGO 0x00800000 /* PLB to OPB bus arbiter */
39#define IBM_CPM_BGI 0x00400000 /* OPB to PLB bridge */
40#define IBM_CPM_EBC 0x00200000 /* External Bux Controller */
41#define IBM_CPM_EBM 0x00100000 /* Ext Bus Master Interface */
42#define IBM_CPM_DMC 0x00080000 /* SDRAM peripheral controller */
43#define IBM_CPM_PLB 0x00040000 /* PLB bus arbiter */
44#define IBM_CPM_SRAM 0x00020000 /* SRAM memory controller */
45#define IBM_CPM_PPM 0x00002000 /* PLB Performance Monitor */
46#define IBM_CPM_UIC1 0x00001000 /* Universal Interrupt Controller */
47#define IBM_CPM_GPIO0 0x00000800 /* General Purpose IO (??) */
48#define IBM_CPM_GPT 0x00000400 /* General Purpose Timers */
49#define IBM_CPM_UART0 0x00000200 /* serial port 0 */
50#define IBM_CPM_UART1 0x00000100 /* serial port 1 */
51#define IBM_CPM_UIC0 0x00000080 /* Universal Interrupt Controller */
52#define IBM_CPM_TMRCLK 0x00000040 /* CPU timers */
53#define IBM_CPM_EMAC0 0x00000020 /* EMAC 0 */
54#define IBM_CPM_EMAC1 0x00000010 /* EMAC 1 */
55#define IBM_CPM_EMAC2 0x00000008 /* EMAC 2 */
56#define IBM_CPM_EMAC3 0x00000004 /* EMAC 3 */
57
58#define DFLT_IBM4xx_PM ~(IBM_CPM_UIC | IBM_CPM_UIC1 | IBM_CPM_CPU \
59 | IBM_CPM_EBC | IBM_CPM_SRAM | IBM_CPM_BGO \
60 | IBM_CPM_EBM | IBM_CPM_PLB | IBM_CPM_OPB \
61 | IBM_CPM_TMRCLK | IBM_CPM_DMA | IBM_CPM_PCI \
62 | IBM_CPM_TAHOE0 | IBM_CPM_TAHOE1 \
63 | IBM_CPM_EMAC0 | IBM_CPM_EMAC1 \
64 | IBM_CPM_EMAC2 | IBM_CPM_EMAC3 )
65/*
66 * Serial port defines
67 */
68#define RS_TABLE_SIZE 2
69
70#endif /* __PPC_PLATFORMS_IBM440GX_H */
71#endif /* __KERNEL__ */
diff --git a/arch/ppc/platforms/4xx/ibm440sp.c b/arch/ppc/platforms/4xx/ibm440sp.c
deleted file mode 100644
index de8f7ac5623c..000000000000
--- a/arch/ppc/platforms/4xx/ibm440sp.c
+++ /dev/null
@@ -1,129 +0,0 @@
1/*
2 * PPC440SP I/O descriptions
3 *
4 * Matt Porter <mporter@kernel.crashing.org>
5 * Copyright 2002-2005 MontaVista Software Inc.
6 *
7 * Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net>
8 * Copyright (c) 2003, 2004 Zultys Technologies
9 *
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the
12 * Free Software Foundation; either version 2 of the License, or (at your
13 * option) any later version.
14 *
15 */
16#include <linux/init.h>
17#include <linux/module.h>
18#include <platforms/4xx/ibm440sp.h>
19#include <asm/ocp.h>
20
21static struct ocp_func_emac_data ibm440sp_emac0_def = {
22 .rgmii_idx = -1, /* No RGMII */
23 .rgmii_mux = -1, /* No RGMII */
24 .zmii_idx = -1, /* No ZMII */
25 .zmii_mux = -1, /* No ZMII */
26 .mal_idx = 0, /* MAL device index */
27 .mal_rx_chan = 0, /* MAL rx channel number */
28 .mal_tx_chan = 0, /* MAL tx channel number */
29 .wol_irq = 61, /* WOL interrupt number */
30 .mdio_idx = -1, /* No shared MDIO */
31 .tah_idx = -1, /* No TAH */
32};
33OCP_SYSFS_EMAC_DATA()
34
35static struct ocp_func_mal_data ibm440sp_mal0_def = {
36 .num_tx_chans = 1, /* Number of TX channels */
37 .num_rx_chans = 1, /* Number of RX channels */
38 .txeob_irq = 38, /* TX End Of Buffer IRQ */
39 .rxeob_irq = 39, /* RX End Of Buffer IRQ */
40 .txde_irq = 34, /* TX Descriptor Error IRQ */
41 .rxde_irq = 35, /* RX Descriptor Error IRQ */
42 .serr_irq = 33, /* MAL System Error IRQ */
43 .dcr_base = DCRN_MAL_BASE /* MAL0_CFG DCR number */
44};
45OCP_SYSFS_MAL_DATA()
46
47static struct ocp_func_iic_data ibm440sp_iic0_def = {
48 .fast_mode = 0, /* Use standad mode (100Khz) */
49};
50
51static struct ocp_func_iic_data ibm440sp_iic1_def = {
52 .fast_mode = 0, /* Use standad mode (100Khz) */
53};
54OCP_SYSFS_IIC_DATA()
55
56struct ocp_def core_ocp[] = {
57 { .vendor = OCP_VENDOR_IBM,
58 .function = OCP_FUNC_OPB,
59 .index = 0,
60 .paddr = 0x0000000140000000ULL,
61 .irq = OCP_IRQ_NA,
62 .pm = OCP_CPM_NA,
63 },
64 { .vendor = OCP_VENDOR_IBM,
65 .function = OCP_FUNC_16550,
66 .index = 0,
67 .paddr = PPC440SP_UART0_ADDR,
68 .irq = UART0_INT,
69 .pm = IBM_CPM_UART0,
70 },
71 { .vendor = OCP_VENDOR_IBM,
72 .function = OCP_FUNC_16550,
73 .index = 1,
74 .paddr = PPC440SP_UART1_ADDR,
75 .irq = UART1_INT,
76 .pm = IBM_CPM_UART1,
77 },
78 { .vendor = OCP_VENDOR_IBM,
79 .function = OCP_FUNC_16550,
80 .index = 2,
81 .paddr = PPC440SP_UART2_ADDR,
82 .irq = UART2_INT,
83 .pm = IBM_CPM_UART2,
84 },
85 { .vendor = OCP_VENDOR_IBM,
86 .function = OCP_FUNC_IIC,
87 .index = 0,
88 .paddr = 0x00000001f0000400ULL,
89 .irq = 2,
90 .pm = IBM_CPM_IIC0,
91 .additions = &ibm440sp_iic0_def,
92 .show = &ocp_show_iic_data
93 },
94 { .vendor = OCP_VENDOR_IBM,
95 .function = OCP_FUNC_IIC,
96 .index = 1,
97 .paddr = 0x00000001f0000500ULL,
98 .irq = 3,
99 .pm = IBM_CPM_IIC1,
100 .additions = &ibm440sp_iic1_def,
101 .show = &ocp_show_iic_data
102 },
103 { .vendor = OCP_VENDOR_IBM,
104 .function = OCP_FUNC_GPIO,
105 .index = 0,
106 .paddr = 0x00000001f0000700ULL,
107 .irq = OCP_IRQ_NA,
108 .pm = IBM_CPM_GPIO0,
109 },
110 { .vendor = OCP_VENDOR_IBM,
111 .function = OCP_FUNC_MAL,
112 .paddr = OCP_PADDR_NA,
113 .irq = OCP_IRQ_NA,
114 .pm = OCP_CPM_NA,
115 .additions = &ibm440sp_mal0_def,
116 .show = &ocp_show_mal_data,
117 },
118 { .vendor = OCP_VENDOR_IBM,
119 .function = OCP_FUNC_EMAC,
120 .index = 0,
121 .paddr = 0x00000001f0000800ULL,
122 .irq = 60,
123 .pm = OCP_CPM_NA,
124 .additions = &ibm440sp_emac0_def,
125 .show = &ocp_show_emac_data,
126 },
127 { .vendor = OCP_VENDOR_INVALID
128 }
129};
diff --git a/arch/ppc/platforms/4xx/ibm440sp.h b/arch/ppc/platforms/4xx/ibm440sp.h
deleted file mode 100644
index 2978682f1720..000000000000
--- a/arch/ppc/platforms/4xx/ibm440sp.h
+++ /dev/null
@@ -1,61 +0,0 @@
1/*
2 * PPC440SP definitions
3 *
4 * Matt Porter <mporter@kernel.crashing.org>
5 *
6 * Copyright 2004-2005 MontaVista Software, Inc.
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
12 */
13
14#ifdef __KERNEL__
15#ifndef __PPC_PLATFORMS_IBM440SP_H
16#define __PPC_PLATFORMS_IBM440SP_H
17
18
19#include <asm/ibm44x.h>
20
21/* UART */
22#define PPC440SP_UART0_ADDR 0x00000001f0000200ULL
23#define PPC440SP_UART1_ADDR 0x00000001f0000300ULL
24#define PPC440SP_UART2_ADDR 0x00000001f0000600ULL
25#define UART0_INT 0
26#define UART1_INT 1
27#define UART2_INT 2
28
29/* Clock and Power Management */
30#define IBM_CPM_IIC0 0x80000000 /* IIC interface */
31#define IBM_CPM_IIC1 0x40000000 /* IIC interface */
32#define IBM_CPM_PCI 0x20000000 /* PCI bridge */
33#define IBM_CPM_CPU 0x02000000 /* processor core */
34#define IBM_CPM_DMA 0x01000000 /* DMA controller */
35#define IBM_CPM_BGO 0x00800000 /* PLB to OPB bus arbiter */
36#define IBM_CPM_BGI 0x00400000 /* OPB to PLB bridge */
37#define IBM_CPM_EBC 0x00200000 /* External Bux Controller */
38#define IBM_CPM_EBM 0x00100000 /* Ext Bus Master Interface */
39#define IBM_CPM_DMC 0x00080000 /* SDRAM peripheral controller */
40#define IBM_CPM_PLB 0x00040000 /* PLB bus arbiter */
41#define IBM_CPM_SRAM 0x00020000 /* SRAM memory controller */
42#define IBM_CPM_PPM 0x00002000 /* PLB Performance Monitor */
43#define IBM_CPM_UIC1 0x00001000 /* Universal Interrupt Controller */
44#define IBM_CPM_GPIO0 0x00000800 /* General Purpose IO (??) */
45#define IBM_CPM_GPT 0x00000400 /* General Purpose Timers */
46#define IBM_CPM_UART0 0x00000200 /* serial port 0 */
47#define IBM_CPM_UART1 0x00000100 /* serial port 1 */
48#define IBM_CPM_UART2 0x00000100 /* serial port 1 */
49#define IBM_CPM_UIC0 0x00000080 /* Universal Interrupt Controller */
50#define IBM_CPM_TMRCLK 0x00000040 /* CPU timers */
51#define IBM_CPM_EMAC0 0x00000020 /* EMAC 0 */
52
53#define DFLT_IBM4xx_PM ~(IBM_CPM_UIC | IBM_CPM_UIC1 | IBM_CPM_CPU \
54 | IBM_CPM_EBC | IBM_CPM_SRAM | IBM_CPM_BGO \
55 | IBM_CPM_EBM | IBM_CPM_PLB | IBM_CPM_OPB \
56 | IBM_CPM_TMRCLK | IBM_CPM_DMA | IBM_CPM_PCI \
57 | IBM_CPM_TAHOE0 | IBM_CPM_TAHOE1 \
58 | IBM_CPM_EMAC0 | IBM_CPM_EMAC1 \
59 | IBM_CPM_EMAC2 | IBM_CPM_EMAC3 )
60#endif /* __PPC_PLATFORMS_IBM440SP_H */
61#endif /* __KERNEL__ */
diff --git a/arch/ppc/platforms/4xx/ibmnp405h.c b/arch/ppc/platforms/4xx/ibmnp405h.c
deleted file mode 100644
index 1afc3642e5b1..000000000000
--- a/arch/ppc/platforms/4xx/ibmnp405h.c
+++ /dev/null
@@ -1,170 +0,0 @@
1/*
2 * Author: Armin Kuster <akuster@mvista.com>
3 *
4 * 2000-2002 (c) MontaVista, Software, Inc. This file is licensed under
5 * the terms of the GNU General Public License version 2. This program
6 * is licensed "as is" without any warranty of any kind, whether express
7 * or implied.
8 */
9
10#include <linux/init.h>
11#include <asm/ocp.h>
12#include <platforms/4xx/ibmnp405h.h>
13
14static struct ocp_func_emac_data ibmnp405h_emac0_def = {
15 .rgmii_idx = -1, /* No RGMII */
16 .rgmii_mux = -1, /* No RGMII */
17 .zmii_idx = 0, /* ZMII device index */
18 .zmii_mux = 0, /* ZMII input of this EMAC */
19 .mal_idx = 0, /* MAL device index */
20 .mal_rx_chan = 0, /* MAL rx channel number */
21 .mal_tx_chan = 0, /* MAL tx channel number */
22 .wol_irq = 41, /* WOL interrupt number */
23 .mdio_idx = -1, /* No shared MDIO */
24 .tah_idx = -1, /* No TAH */
25};
26
27static struct ocp_func_emac_data ibmnp405h_emac1_def = {
28 .rgmii_idx = -1, /* No RGMII */
29 .rgmii_mux = -1, /* No RGMII */
30 .zmii_idx = 0, /* ZMII device index */
31 .zmii_mux = 1, /* ZMII input of this EMAC */
32 .mal_idx = 0, /* MAL device index */
33 .mal_rx_chan = 1, /* MAL rx channel number */
34 .mal_tx_chan = 2, /* MAL tx channel number */
35 .wol_irq = 41, /* WOL interrupt number */
36 .mdio_idx = -1, /* No shared MDIO */
37 .tah_idx = -1, /* No TAH */
38};
39static struct ocp_func_emac_data ibmnp405h_emac2_def = {
40 .rgmii_idx = -1, /* No RGMII */
41 .rgmii_mux = -1, /* No RGMII */
42 .zmii_idx = 0, /* ZMII device index */
43 .zmii_mux = 2, /* ZMII input of this EMAC */
44 .mal_idx = 0, /* MAL device index */
45 .mal_rx_chan = 2, /* MAL rx channel number */
46 .mal_tx_chan = 4, /* MAL tx channel number */
47 .wol_irq = 41, /* WOL interrupt number */
48 .mdio_idx = -1, /* No shared MDIO */
49 .tah_idx = -1, /* No TAH */
50};
51static struct ocp_func_emac_data ibmnp405h_emac3_def = {
52 .rgmii_idx = -1, /* No RGMII */
53 .rgmii_mux = -1, /* No RGMII */
54 .zmii_idx = 0, /* ZMII device index */
55 .zmii_mux = 3, /* ZMII input of this EMAC */
56 .mal_idx = 0, /* MAL device index */
57 .mal_rx_chan = 3, /* MAL rx channel number */
58 .mal_tx_chan = 6, /* MAL tx channel number */
59 .wol_irq = 41, /* WOL interrupt number */
60 .mdio_idx = -1, /* No shared MDIO */
61 .tah_idx = -1, /* No TAH */
62};
63OCP_SYSFS_EMAC_DATA()
64
65static struct ocp_func_mal_data ibmnp405h_mal0_def = {
66 .num_tx_chans = 8, /* Number of TX channels */
67 .num_rx_chans = 4, /* Number of RX channels */
68 .txeob_irq = 17, /* TX End Of Buffer IRQ */
69 .rxeob_irq = 18, /* RX End Of Buffer IRQ */
70 .txde_irq = 46, /* TX Descriptor Error IRQ */
71 .rxde_irq = 47, /* RX Descriptor Error IRQ */
72 .serr_irq = 45, /* MAL System Error IRQ */
73 .dcr_base = DCRN_MAL_BASE /* MAL0_CFG DCR number */
74};
75OCP_SYSFS_MAL_DATA()
76
77static struct ocp_func_iic_data ibmnp405h_iic0_def = {
78 .fast_mode = 0, /* Use standad mode (100Khz) */
79};
80OCP_SYSFS_IIC_DATA()
81
82struct ocp_def core_ocp[] = {
83 { .vendor = OCP_VENDOR_IBM,
84 .function = OCP_FUNC_OPB,
85 .index = 0,
86 .paddr = 0xEF600000,
87 .irq = OCP_IRQ_NA,
88 .pm = OCP_CPM_NA,
89 },
90 { .vendor = OCP_VENDOR_IBM,
91 .function = OCP_FUNC_16550,
92 .index = 0,
93 .paddr = UART0_IO_BASE,
94 .irq = UART0_INT,
95 .pm = IBM_CPM_UART0
96 },
97 { .vendor = OCP_VENDOR_IBM,
98 .function = OCP_FUNC_16550,
99 .index = 1,
100 .paddr = UART1_IO_BASE,
101 .irq = UART1_INT,
102 .pm = IBM_CPM_UART1
103 },
104 { .vendor = OCP_VENDOR_IBM,
105 .function = OCP_FUNC_IIC,
106 .paddr = 0xEF600500,
107 .irq = 2,
108 .pm = IBM_CPM_IIC0,
109 .additions = &ibmnp405h_iic0_def,
110 .show = &ocp_show_iic_data
111 },
112 { .vendor = OCP_VENDOR_IBM,
113 .function = OCP_FUNC_GPIO,
114 .paddr = 0xEF600700,
115 .irq = OCP_IRQ_NA,
116 .pm = IBM_CPM_GPIO0
117 },
118 { .vendor = OCP_VENDOR_IBM,
119 .function = OCP_FUNC_MAL,
120 .paddr = OCP_PADDR_NA,
121 .irq = OCP_IRQ_NA,
122 .pm = OCP_CPM_NA,
123 .additions = &ibmnp405h_mal0_def,
124 .show = &ocp_show_mal_data,
125 },
126 { .vendor = OCP_VENDOR_IBM,
127 .function = OCP_FUNC_EMAC,
128 .index = 0,
129 .paddr = EMAC0_BASE,
130 .irq = 37,
131 .pm = IBM_CPM_EMAC0,
132 .additions = &ibmnp405h_emac0_def,
133 .show = &ocp_show_emac_data,
134 },
135 { .vendor = OCP_VENDOR_IBM,
136 .function = OCP_FUNC_EMAC,
137 .index = 1,
138 .paddr = 0xEF600900,
139 .irq = 38,
140 .pm = IBM_CPM_EMAC1,
141 .additions = &ibmnp405h_emac1_def,
142 .show = &ocp_show_emac_data,
143 },
144 { .vendor = OCP_VENDOR_IBM,
145 .function = OCP_FUNC_EMAC,
146 .index = 2,
147 .paddr = 0xEF600a00,
148 .irq = 39,
149 .pm = IBM_CPM_EMAC2,
150 .additions = &ibmnp405h_emac2_def,
151 .show = &ocp_show_emac_data,
152 },
153 { .vendor = OCP_VENDOR_IBM,
154 .function = OCP_FUNC_EMAC,
155 .index = 3,
156 .paddr = 0xEF600b00,
157 .irq = 40,
158 .pm = IBM_CPM_EMAC3,
159 .additions = &ibmnp405h_emac3_def,
160 .show = &ocp_show_emac_data,
161 },
162 { .vendor = OCP_VENDOR_IBM,
163 .function = OCP_FUNC_ZMII,
164 .paddr = 0xEF600C10,
165 .irq = OCP_IRQ_NA,
166 .pm = OCP_CPM_NA,
167 },
168 { .vendor = OCP_VENDOR_INVALID
169 }
170};
diff --git a/arch/ppc/platforms/4xx/ibmnp405h.h b/arch/ppc/platforms/4xx/ibmnp405h.h
deleted file mode 100644
index 08a6a7791903..000000000000
--- a/arch/ppc/platforms/4xx/ibmnp405h.h
+++ /dev/null
@@ -1,154 +0,0 @@
1/*
2 * Author: Armin Kuster <akuster@mvista.com>
3 *
4 * 2002 (c) MontaVista, Software, Inc. This file is licensed under
5 * the terms of the GNU General Public License version 2. This program
6 * is licensed "as is" without any warranty of any kind, whether express
7 * or implied.
8 */
9
10#ifdef __KERNEL__
11#ifndef __ASM_IBMNP405H_H__
12#define __ASM_IBMNP405H_H__
13
14
15/* ibm405.h at bottom of this file */
16
17#define PPC405_PCI_CONFIG_ADDR 0xeec00000
18#define PPC405_PCI_CONFIG_DATA 0xeec00004
19#define PPC405_PCI_PHY_MEM_BASE 0x80000000 /* hose_a->pci_mem_offset */
20 /* setbat */
21#define PPC405_PCI_MEM_BASE PPC405_PCI_PHY_MEM_BASE /* setbat */
22#define PPC405_PCI_PHY_IO_BASE 0xe8000000 /* setbat */
23#define PPC405_PCI_IO_BASE PPC405_PCI_PHY_IO_BASE /* setbat */
24
25#define PPC405_PCI_LOWER_MEM 0x00000000 /* hose_a->mem_space.start */
26#define PPC405_PCI_UPPER_MEM 0xBfffffff /* hose_a->mem_space.end */
27#define PPC405_PCI_LOWER_IO 0x00000000 /* hose_a->io_space.start */
28#define PPC405_PCI_UPPER_IO 0x0000ffff /* hose_a->io_space.end */
29
30#define PPC405_ISA_IO_BASE PPC405_PCI_IO_BASE
31
32#define PPC4xx_PCI_IO_ADDR ((uint)PPC405_PCI_PHY_IO_BASE)
33#define PPC4xx_PCI_IO_SIZE ((uint)64*1024)
34#define PPC4xx_PCI_CFG_ADDR ((uint)PPC405_PCI_CONFIG_ADDR)
35#define PPC4xx_PCI_CFG_SIZE ((uint)4*1024)
36#define PPC4xx_PCI_LCFG_ADDR ((uint)0xef400000)
37#define PPC4xx_PCI_LCFG_SIZE ((uint)4*1024)
38#define PPC4xx_ONB_IO_ADDR ((uint)0xef600000)
39#define PPC4xx_ONB_IO_SIZE ((uint)4*1024)
40
41/* serial port defines */
42#define RS_TABLE_SIZE 4
43
44#define UART0_INT 0
45#define UART1_INT 1
46#define PCIL0_BASE 0xEF400000
47#define UART0_IO_BASE 0xEF600300
48#define UART1_IO_BASE 0xEF600400
49#define OPB0_BASE 0xEF600600
50#define EMAC0_BASE 0xEF600800
51
52#define BD_EMAC_ADDR(e,i) bi_enetaddr[e][i]
53
54#define STD_UART_OP(num) \
55 { 0, BASE_BAUD, 0, UART##num##_INT, \
56 (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST), \
57 iomem_base:(u8 *) UART##num##_IO_BASE, \
58 io_type: SERIAL_IO_MEM},
59
60#if defined(CONFIG_UART0_TTYS0)
61#define SERIAL_DEBUG_IO_BASE UART0_IO_BASE
62#define SERIAL_PORT_DFNS \
63 STD_UART_OP(0) \
64 STD_UART_OP(1)
65#endif
66
67#if defined(CONFIG_UART0_TTYS1)
68#define SERIAL_DEBUG_IO_BASE UART0_IO_BASE
69#define SERIAL_PORT_DFNS \
70 STD_UART_OP(1) \
71 STD_UART_OP(0)
72#endif
73
74/* DCR defines */
75/* ------------------------------------------------------------------------- */
76
77#define DCRN_CHCR_BASE 0x0F1
78#define DCRN_CHPSR_BASE 0x0B4
79#define DCRN_CPMSR_BASE 0x0BA
80#define DCRN_CPMFR_BASE 0x0B9
81#define DCRN_CPMER_BASE 0x0B8
82
83/* CPM Clocking & Power Management defines */
84#define IBM_CPM_PCI 0x40000000 /* PCI */
85#define IBM_CPM_EMAC2 0x20000000 /* EMAC 2 MII */
86#define IBM_CPM_EMAC3 0x04000000 /* EMAC 3 MII */
87#define IBM_CPM_EMAC0 0x00800000 /* EMAC 0 MII */
88#define IBM_CPM_EMAC1 0x00100000 /* EMAC 1 MII */
89#define IBM_CPM_EMMII 0 /* Shift value for MII */
90#define IBM_CPM_EMRX 1 /* Shift value for recv */
91#define IBM_CPM_EMTX 2 /* Shift value for MAC */
92#define IBM_CPM_UIC1 0x00020000 /* Universal Interrupt Controller */
93#define IBM_CPM_UIC0 0x00010000 /* Universal Interrupt Controller */
94#define IBM_CPM_CPU 0x00008000 /* processor core */
95#define IBM_CPM_EBC 0x00004000 /* ROM/SRAM peripheral controller */
96#define IBM_CPM_SDRAM0 0x00002000 /* SDRAM memory controller */
97#define IBM_CPM_GPIO0 0x00001000 /* General Purpose IO (??) */
98#define IBM_CPM_HDLC 0x00000800 /* HDCL */
99#define IBM_CPM_TMRCLK 0x00000400 /* CPU timers */
100#define IBM_CPM_PLB 0x00000100 /* PLB bus arbiter */
101#define IBM_CPM_OPB 0x00000080 /* PLB to OPB bridge */
102#define IBM_CPM_DMA 0x00000040 /* DMA controller */
103#define IBM_CPM_IIC0 0x00000010 /* IIC interface */
104#define IBM_CPM_UART0 0x00000002 /* serial port 0 */
105#define IBM_CPM_UART1 0x00000001 /* serial port 1 */
106/* this is the default setting for devices put to sleep when booting */
107
108#define DFLT_IBM4xx_PM ~(IBM_CPM_UIC0 | IBM_CPM_UIC1 | IBM_CPM_CPU \
109 | IBM_CPM_EBC | IBM_CPM_SDRAM0 | IBM_CPM_PLB \
110 | IBM_CPM_OPB | IBM_CPM_TMRCLK | IBM_CPM_DMA \
111 | IBM_CPM_EMAC0 | IBM_CPM_EMAC1 | IBM_CPM_EMAC2 \
112 | IBM_CPM_EMAC3 | IBM_CPM_PCI)
113
114#define DCRN_DMA0_BASE 0x100
115#define DCRN_DMA1_BASE 0x108
116#define DCRN_DMA2_BASE 0x110
117#define DCRN_DMA3_BASE 0x118
118#define DCRNCAP_DMA_SG 1 /* have DMA scatter/gather capability */
119#define DCRN_DMASR_BASE 0x120
120#define DCRN_EBC_BASE 0x012
121#define DCRN_DCP0_BASE 0x014
122#define DCRN_MAL_BASE 0x180
123#define DCRN_OCM0_BASE 0x018
124#define DCRN_PLB0_BASE 0x084
125#define DCRN_PLLMR_BASE 0x0B0
126#define DCRN_POB0_BASE 0x0A0
127#define DCRN_SDRAM0_BASE 0x010
128#define DCRN_UIC0_BASE 0x0C0
129#define DCRN_UIC1_BASE 0x0D0
130#define DCRN_CPC0_EPRCSR 0x0F3
131
132#define UIC0_UIC1NC 0x00000002
133
134#define CHR1_CETE 0x00000004 /* CPU external timer enable */
135#define UIC0 DCRN_UIC0_BASE
136#define UIC1 DCRN_UIC1_BASE
137
138#undef NR_UICS
139#define NR_UICS 2
140
141/* EMAC DCRN's FIXME: armin */
142#define DCRN_MALRXCTP2R(base) ((base) + 0x42) /* Channel Rx 2 Channel Table Pointer */
143#define DCRN_MALRXCTP3R(base) ((base) + 0x43) /* Channel Rx 3 Channel Table Pointer */
144#define DCRN_MALTXCTP4R(base) ((base) + 0x24) /* Channel Tx 4 Channel Table Pointer */
145#define DCRN_MALTXCTP5R(base) ((base) + 0x25) /* Channel Tx 5 Channel Table Pointer */
146#define DCRN_MALTXCTP6R(base) ((base) + 0x26) /* Channel Tx 6 Channel Table Pointer */
147#define DCRN_MALTXCTP7R(base) ((base) + 0x27) /* Channel Tx 7 Channel Table Pointer */
148#define DCRN_MALRCBS2(base) ((base) + 0x62) /* Channel Rx 2 Channel Buffer Size */
149#define DCRN_MALRCBS3(base) ((base) + 0x63) /* Channel Rx 3 Channel Buffer Size */
150
151#include <asm/ibm405.h>
152
153#endif /* __ASM_IBMNP405H_H__ */
154#endif /* __KERNEL__ */
diff --git a/arch/ppc/platforms/4xx/ibmstb4.c b/arch/ppc/platforms/4xx/ibmstb4.c
deleted file mode 100644
index 799a2eccccc3..000000000000
--- a/arch/ppc/platforms/4xx/ibmstb4.c
+++ /dev/null
@@ -1,122 +0,0 @@
1/*
2 * Author: Armin Kuster <akuster@mvista.com>
3 *
4 * 2000-2001 (c) MontaVista, Software, Inc. This file is licensed under
5 * the terms of the GNU General Public License version 2. This program
6 * is licensed "as is" without any warranty of any kind, whether express
7 * or implied.
8 */
9
10#include <linux/init.h>
11#include <linux/platform_device.h>
12#include <asm/ocp.h>
13#include <asm/ppc4xx_pic.h>
14#include <platforms/4xx/ibmstb4.h>
15
16static struct ocp_func_iic_data ibmstb4_iic0_def = {
17 .fast_mode = 0, /* Use standad mode (100Khz) */
18};
19
20static struct ocp_func_iic_data ibmstb4_iic1_def = {
21 .fast_mode = 0, /* Use standad mode (100Khz) */
22};
23OCP_SYSFS_IIC_DATA()
24
25struct ocp_def core_ocp[] __initdata = {
26 { .vendor = OCP_VENDOR_IBM,
27 .function = OCP_FUNC_16550,
28 .index = 0,
29 .paddr = UART0_IO_BASE,
30 .irq = UART0_INT,
31 .pm = IBM_CPM_UART0,
32 },
33 { .vendor = OCP_VENDOR_IBM,
34 .function = OCP_FUNC_16550,
35 .index = 1,
36 .paddr = UART1_IO_BASE,
37 .irq = UART1_INT,
38 .pm = IBM_CPM_UART1,
39 },
40 { .vendor = OCP_VENDOR_IBM,
41 .function = OCP_FUNC_16550,
42 .index = 2,
43 .paddr = UART2_IO_BASE,
44 .irq = UART2_INT,
45 .pm = IBM_CPM_UART2,
46 },
47 { .vendor = OCP_VENDOR_IBM,
48 .function = OCP_FUNC_IIC,
49 .paddr = IIC0_BASE,
50 .irq = IIC0_IRQ,
51 .pm = IBM_CPM_IIC0,
52 .additions = &ibmstb4_iic0_def,
53 .show = &ocp_show_iic_data
54 },
55 { .vendor = OCP_VENDOR_IBM,
56 .function = OCP_FUNC_IIC,
57 .paddr = IIC1_BASE,
58 .irq = IIC1_IRQ,
59 .pm = IBM_CPM_IIC1,
60 .additions = &ibmstb4_iic1_def,
61 .show = &ocp_show_iic_data
62 },
63 { .vendor = OCP_VENDOR_IBM,
64 .function = OCP_FUNC_GPIO,
65 .paddr = GPIO0_BASE,
66 .irq = OCP_IRQ_NA,
67 .pm = IBM_CPM_GPIO0,
68 },
69 { .vendor = OCP_VENDOR_IBM,
70 .function = OCP_FUNC_IDE,
71 .paddr = IDE0_BASE,
72 .irq = IDE0_IRQ,
73 .pm = OCP_CPM_NA,
74 },
75 { .vendor = OCP_VENDOR_INVALID,
76 }
77};
78
79/* Polarity and triggering settings for internal interrupt sources */
80struct ppc4xx_uic_settings ppc4xx_core_uic_cfg[] __initdata = {
81 { .polarity = 0x7fffff01,
82 .triggering = 0x00000000,
83 .ext_irq_mask = 0x0000007e, /* IRQ0 - IRQ5 */
84 }
85};
86
87static struct resource ohci_usb_resources[] = {
88 [0] = {
89 .start = USB0_BASE,
90 .end = USB0_BASE + USB0_SIZE - 1,
91 .flags = IORESOURCE_MEM,
92 },
93 [1] = {
94 .start = USB0_IRQ,
95 .end = USB0_IRQ,
96 .flags = IORESOURCE_IRQ,
97 },
98};
99
100static u64 dma_mask = 0xffffffffULL;
101
102static struct platform_device ohci_usb_device = {
103 .name = "ppc-soc-ohci",
104 .id = 0,
105 .num_resources = ARRAY_SIZE(ohci_usb_resources),
106 .resource = ohci_usb_resources,
107 .dev = {
108 .dma_mask = &dma_mask,
109 .coherent_dma_mask = 0xffffffffULL,
110 }
111};
112
113static struct platform_device *ibmstb4_devs[] __initdata = {
114 &ohci_usb_device,
115};
116
117static int __init
118ibmstb4_platform_add_devices(void)
119{
120 return platform_add_devices(ibmstb4_devs, ARRAY_SIZE(ibmstb4_devs));
121}
122arch_initcall(ibmstb4_platform_add_devices);
diff --git a/arch/ppc/platforms/4xx/ibmstb4.h b/arch/ppc/platforms/4xx/ibmstb4.h
deleted file mode 100644
index 31a08abaa4a2..000000000000
--- a/arch/ppc/platforms/4xx/ibmstb4.h
+++ /dev/null
@@ -1,235 +0,0 @@
1/*
2 * Author: Armin Kuster <akuster@mvista.com>
3 *
4 * 2001 (c) MontaVista, Software, Inc. This file is licensed under
5 * the terms of the GNU General Public License version 2. This program
6 * is licensed "as is" without any warranty of any kind, whether express
7 * or implied.
8 */
9
10#ifdef __KERNEL__
11#ifndef __ASM_IBMSTB4_H__
12#define __ASM_IBMSTB4_H__
13
14
15/* serial port defines */
16#define STB04xxx_IO_BASE ((uint)0xe0000000)
17#define PPC4xx_PCI_IO_ADDR STB04xxx_IO_BASE
18#define PPC4xx_ONB_IO_PADDR STB04xxx_IO_BASE
19#define PPC4xx_ONB_IO_VADDR ((uint)0xe0000000)
20#define PPC4xx_ONB_IO_SIZE ((uint)14*64*1024)
21
22/*
23 * map STB04xxx internal i/o address (0x400x00xx) to an address
24 * which is below the 2GB limit...
25 *
26 * 4000 000x uart1 -> 0xe000 000x
27 * 4001 00xx ppu
28 * 4002 00xx smart card
29 * 4003 000x iic
30 * 4004 000x uart0
31 * 4005 0xxx timer
32 * 4006 00xx gpio
33 * 4007 00xx smart card
34 * 400b 000x iic
35 * 400c 000x scp
36 * 400d 000x modem
37 * 400e 000x uart2
38*/
39#define STB04xxx_MAP_IO_ADDR(a) (((uint)(a)) + (STB04xxx_IO_BASE - 0x40000000))
40
41#define RS_TABLE_SIZE 3
42#define UART0_INT 20
43
44#ifdef __BOOTER__
45#define UART0_IO_BASE 0x40040000
46#else
47#define UART0_IO_BASE 0xe0040000
48#endif
49
50#define UART1_INT 21
51
52#ifdef __BOOTER__
53#define UART1_IO_BASE 0x40000000
54#else
55#define UART1_IO_BASE 0xe0000000
56#endif
57
58#define UART2_INT 31
59#ifdef __BOOTER__
60#define UART2_IO_BASE 0x400e0000
61#else
62#define UART2_IO_BASE 0xe00e0000
63#endif
64
65#define IDE0_BASE 0x400F0000
66#define IDE0_SIZE 0x200
67#define IDE0_IRQ 25
68#define IIC0_BASE 0x40030000
69#define IIC1_BASE 0x400b0000
70#define OPB0_BASE 0x40000000
71#define GPIO0_BASE 0x40060000
72
73#define USB0_BASE 0x40010000
74#define USB0_SIZE 0xA0
75#define USB0_IRQ 18
76
77#define IIC_NUMS 2
78#define UART_NUMS 3
79#define IIC0_IRQ 9
80#define IIC1_IRQ 10
81#define IIC_OWN 0x55
82#define IIC_CLOCK 50
83
84#define BD_EMAC_ADDR(e,i) bi_enetaddr[i]
85
86#define STD_UART_OP(num) \
87 { 0, BASE_BAUD, 0, UART##num##_INT, \
88 (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST), \
89 iomem_base: (u8 *)UART##num##_IO_BASE, \
90 io_type: SERIAL_IO_MEM},
91
92#if defined(CONFIG_UART0_TTYS0)
93#define SERIAL_DEBUG_IO_BASE UART0_IO_BASE
94#define SERIAL_PORT_DFNS \
95 STD_UART_OP(0) \
96 STD_UART_OP(1) \
97 STD_UART_OP(2)
98#endif
99
100#if defined(CONFIG_UART0_TTYS1)
101#define SERIAL_DEBUG_IO_BASE UART2_IO_BASE
102#define SERIAL_PORT_DFNS \
103 STD_UART_OP(1) \
104 STD_UART_OP(0) \
105 STD_UART_OP(2)
106#endif
107
108#if defined(CONFIG_UART0_TTYS2)
109#define SERIAL_DEBUG_IO_BASE UART2_IO_BASE
110#define SERIAL_PORT_DFNS \
111 STD_UART_OP(2) \
112 STD_UART_OP(0) \
113 STD_UART_OP(1)
114#endif
115
116#define DCRN_BE_BASE 0x090
117#define DCRN_DMA0_BASE 0x0C0
118#define DCRN_DMA1_BASE 0x0C8
119#define DCRN_DMA2_BASE 0x0D0
120#define DCRN_DMA3_BASE 0x0D8
121#define DCRNCAP_DMA_CC 1 /* have DMA chained count capability */
122#define DCRN_DMASR_BASE 0x0E0
123#define DCRN_PLB0_BASE 0x054
124#define DCRN_PLB1_BASE 0x064
125#define DCRN_POB0_BASE 0x0B0
126#define DCRN_SCCR_BASE 0x120
127#define DCRN_UIC0_BASE 0x040
128#define DCRN_BE_BASE 0x090
129#define DCRN_DMA0_BASE 0x0C0
130#define DCRN_DMA1_BASE 0x0C8
131#define DCRN_DMA2_BASE 0x0D0
132#define DCRN_DMA3_BASE 0x0D8
133#define DCRN_CIC_BASE 0x030
134#define DCRN_DMASR_BASE 0x0E0
135#define DCRN_EBIMC_BASE 0x070
136#define DCRN_DCRX_BASE 0x020
137#define DCRN_CPMFR_BASE 0x102
138#define DCRN_SCCR_BASE 0x120
139#define UIC0 DCRN_UIC0_BASE
140
141#define IBM_CPM_IIC0 0x80000000 /* IIC 0 interface */
142#define IBM_CPM_USB0 0x40000000 /* IEEE-1284 */
143#define IBM_CPM_IIC1 0x20000000 /* IIC 1 interface */
144#define IBM_CPM_CPU 0x10000000 /* PPC405B3 clock control */
145#define IBM_CPM_AUD 0x08000000 /* Audio Decoder */
146#define IBM_CPM_EBIU 0x04000000 /* External Bus Interface Unit */
147#define IBM_CPM_SDRAM1 0x02000000 /* SDRAM 1 memory controller */
148#define IBM_CPM_DMA 0x01000000 /* DMA controller */
149#define IBM_CPM_DMA1 0x00800000 /* reserved */
150#define IBM_CPM_XPT1 0x00400000 /* reserved */
151#define IBM_CPM_XPT2 0x00200000 /* reserved */
152#define IBM_CPM_UART1 0x00100000 /* Serial 1 / Infrared */
153#define IBM_CPM_UART0 0x00080000 /* Serial 0 / 16550 */
154#define IBM_CPM_EPI 0x00040000 /* DCR Extension */
155#define IBM_CPM_SC0 0x00020000 /* Smart Card 0 */
156#define IBM_CPM_VID 0x00010000 /* reserved */
157#define IBM_CPM_SC1 0x00008000 /* Smart Card 1 */
158#define IBM_CPM_USBSDRA 0x00004000 /* SDRAM 0 memory controller */
159#define IBM_CPM_XPT0 0x00002000 /* Transport - 54 Mhz */
160#define IBM_CPM_CBS 0x00001000 /* Cross Bar Switch */
161#define IBM_CPM_GPT 0x00000800 /* GPTPWM */
162#define IBM_CPM_GPIO0 0x00000400 /* General Purpose IO 0 */
163#define IBM_CPM_DENC 0x00000200 /* Digital video Encoder */
164#define IBM_CPM_TMRCLK 0x00000100 /* CPU timers */
165#define IBM_CPM_XPT27 0x00000080 /* Transport - 27 Mhz */
166#define IBM_CPM_UIC 0x00000040 /* Universal Interrupt Controller */
167#define IBM_CPM_SSP 0x00000010 /* Modem Serial Interface (SSP) */
168#define IBM_CPM_UART2 0x00000008 /* Serial Control Port */
169#define IBM_CPM_DDIO 0x00000004 /* Descrambler */
170#define IBM_CPM_VID2 0x00000002 /* Video Decoder clock domain 2 */
171
172#define DFLT_IBM4xx_PM ~(IBM_CPM_CPU | IBM_CPM_EBIU | IBM_CPM_SDRAM1 \
173 | IBM_CPM_DMA | IBM_CPM_DMA1 | IBM_CPM_CBS \
174 | IBM_CPM_USBSDRA | IBM_CPM_XPT0 | IBM_CPM_TMRCLK \
175 | IBM_CPM_XPT27 | IBM_CPM_UIC )
176
177#define DCRN_BEAR (DCRN_BE_BASE + 0x0) /* Bus Error Address Register */
178#define DCRN_BESR (DCRN_BE_BASE + 0x1) /* Bus Error Syndrome Register */
179/* DCRN_BESR */
180#define BESR_DSES 0x80000000 /* Data-Side Error Status */
181#define BESR_DMES 0x40000000 /* DMA Error Status */
182#define BESR_RWS 0x20000000 /* Read/Write Status */
183#define BESR_ETMASK 0x1C000000 /* Error Type */
184#define ET_PROT 0
185#define ET_PARITY 1
186#define ET_NCFG 2
187#define ET_BUSERR 4
188#define ET_BUSTO 6
189
190#define CHR1_CETE 0x00800000 /* CPU external timer enable */
191#define CHR1_PCIPW 0x00008000 /* PCI Int enable/Peripheral Write enable */
192
193#define DCRN_CICCR (DCRN_CIC_BASE + 0x0) /* CIC Control Register */
194#define DCRN_DMAS1 (DCRN_CIC_BASE + 0x1) /* DMA Select1 Register */
195#define DCRN_DMAS2 (DCRN_CIC_BASE + 0x2) /* DMA Select2 Register */
196#define DCRN_CICVCR (DCRN_CIC_BASE + 0x3) /* CIC Video COntro Register */
197#define DCRN_CICSEL3 (DCRN_CIC_BASE + 0x5) /* CIC Select 3 Register */
198#define DCRN_SGPO (DCRN_CIC_BASE + 0x6) /* CIC GPIO Output Register */
199#define DCRN_SGPOD (DCRN_CIC_BASE + 0x7) /* CIC GPIO OD Register */
200#define DCRN_SGPTC (DCRN_CIC_BASE + 0x8) /* CIC GPIO Tristate Ctrl Reg */
201#define DCRN_SGPI (DCRN_CIC_BASE + 0x9) /* CIC GPIO Input Reg */
202
203#define DCRN_DCRXICR (DCRN_DCRX_BASE + 0x0) /* Internal Control Register */
204#define DCRN_DCRXISR (DCRN_DCRX_BASE + 0x1) /* Internal Status Register */
205#define DCRN_DCRXECR (DCRN_DCRX_BASE + 0x2) /* External Control Register */
206#define DCRN_DCRXESR (DCRN_DCRX_BASE + 0x3) /* External Status Register */
207#define DCRN_DCRXTAR (DCRN_DCRX_BASE + 0x4) /* Target Address Register */
208#define DCRN_DCRXTDR (DCRN_DCRX_BASE + 0x5) /* Target Data Register */
209#define DCRN_DCRXIGR (DCRN_DCRX_BASE + 0x6) /* Interrupt Generation Register */
210#define DCRN_DCRXBCR (DCRN_DCRX_BASE + 0x7) /* Line Buffer Control Register */
211
212#define DCRN_BRCRH0 (DCRN_EBIMC_BASE + 0x0) /* Bus Region Config High 0 */
213#define DCRN_BRCRH1 (DCRN_EBIMC_BASE + 0x1) /* Bus Region Config High 1 */
214#define DCRN_BRCRH2 (DCRN_EBIMC_BASE + 0x2) /* Bus Region Config High 2 */
215#define DCRN_BRCRH3 (DCRN_EBIMC_BASE + 0x3) /* Bus Region Config High 3 */
216#define DCRN_BRCRH4 (DCRN_EBIMC_BASE + 0x4) /* Bus Region Config High 4 */
217#define DCRN_BRCRH5 (DCRN_EBIMC_BASE + 0x5) /* Bus Region Config High 5 */
218#define DCRN_BRCRH6 (DCRN_EBIMC_BASE + 0x6) /* Bus Region Config High 6 */
219#define DCRN_BRCRH7 (DCRN_EBIMC_BASE + 0x7) /* Bus Region Config High 7 */
220#define DCRN_BRCR0 (DCRN_EBIMC_BASE + 0x10) /* BRC 0 */
221#define DCRN_BRCR1 (DCRN_EBIMC_BASE + 0x11) /* BRC 1 */
222#define DCRN_BRCR2 (DCRN_EBIMC_BASE + 0x12) /* BRC 2 */
223#define DCRN_BRCR3 (DCRN_EBIMC_BASE + 0x13) /* BRC 3 */
224#define DCRN_BRCR4 (DCRN_EBIMC_BASE + 0x14) /* BRC 4 */
225#define DCRN_BRCR5 (DCRN_EBIMC_BASE + 0x15) /* BRC 5 */
226#define DCRN_BRCR6 (DCRN_EBIMC_BASE + 0x16) /* BRC 6 */
227#define DCRN_BRCR7 (DCRN_EBIMC_BASE + 0x17) /* BRC 7 */
228#define DCRN_BEAR0 (DCRN_EBIMC_BASE + 0x20) /* Bus Error Address Register */
229#define DCRN_BESR0 (DCRN_EBIMC_BASE + 0x21) /* Bus Error Status Register */
230#define DCRN_BIUCR (DCRN_EBIMC_BASE + 0x2A) /* Bus Interfac Unit Ctrl Reg */
231
232#include <asm/ibm405.h>
233
234#endif /* __ASM_IBMSTB4_H__ */
235#endif /* __KERNEL__ */
diff --git a/arch/ppc/platforms/4xx/ibmstbx25.c b/arch/ppc/platforms/4xx/ibmstbx25.c
deleted file mode 100644
index 090ddcbecc5e..000000000000
--- a/arch/ppc/platforms/4xx/ibmstbx25.c
+++ /dev/null
@@ -1,66 +0,0 @@
1/*
2 * Author: Armin Kuster <akuster@mvista.com>
3 *
4 * 2000-2002 (c) MontaVista, Software, Inc. This file is licensed under
5 * the terms of the GNU General Public License version 2. This program
6 * is licensed "as is" without any warranty of any kind, whether express
7 * or implied.
8 */
9
10#include <linux/init.h>
11#include <asm/ocp.h>
12#include <platforms/4xx/ibmstbx25.h>
13#include <asm/ppc4xx_pic.h>
14
15static struct ocp_func_iic_data ibmstbx25_iic0_def = {
16 .fast_mode = 0, /* Use standad mode (100Khz) */
17};
18OCP_SYSFS_IIC_DATA()
19
20struct ocp_def core_ocp[] __initdata = {
21 { .vendor = OCP_VENDOR_IBM,
22 .function = OCP_FUNC_16550,
23 .index = 0,
24 .paddr = UART0_IO_BASE,
25 .irq = UART0_INT,
26 .pm = IBM_CPM_UART0,
27 },
28 { .vendor = OCP_VENDOR_IBM,
29 .function = OCP_FUNC_16550,
30 .index = 1,
31 .paddr = UART1_IO_BASE,
32 .irq = UART1_INT,
33 .pm = IBM_CPM_UART1,
34 },
35 { .vendor = OCP_VENDOR_IBM,
36 .function = OCP_FUNC_16550,
37 .index = 2,
38 .paddr = UART2_IO_BASE,
39 .irq = UART2_INT,
40 .pm = IBM_CPM_UART2,
41 },
42 { .vendor = OCP_VENDOR_IBM,
43 .function = OCP_FUNC_IIC,
44 .paddr = IIC0_BASE,
45 .irq = IIC0_IRQ,
46 .pm = IBM_CPM_IIC0,
47 .additions = &ibmstbx25_iic0_def,
48 .show = &ocp_show_iic_data
49 },
50 { .vendor = OCP_VENDOR_IBM,
51 .function = OCP_FUNC_GPIO,
52 .paddr = GPIO0_BASE,
53 .irq = OCP_IRQ_NA,
54 .pm = IBM_CPM_GPIO0,
55 },
56 { .vendor = OCP_VENDOR_INVALID
57 }
58};
59
60/* Polarity and triggering settings for internal interrupt sources */
61struct ppc4xx_uic_settings ppc4xx_core_uic_cfg[] __initdata = {
62 { .polarity = 0xffff8f80,
63 .triggering = 0x00000000,
64 .ext_irq_mask = 0x0000707f, /* IRQ7 - IRQ9, IRQ0 - IRQ6 */
65 }
66};
diff --git a/arch/ppc/platforms/4xx/ibmstbx25.h b/arch/ppc/platforms/4xx/ibmstbx25.h
deleted file mode 100644
index 31b63343e641..000000000000
--- a/arch/ppc/platforms/4xx/ibmstbx25.h
+++ /dev/null
@@ -1,258 +0,0 @@
1/*
2 * Author: Armin Kuster <akuster@mvista.com>
3 *
4 * 2002 (c) MontaVista, Software, Inc. This file is licensed under
5 * the terms of the GNU General Public License version 2. This program
6 * is licensed "as is" without any warranty of any kind, whether express
7 * or implied.
8 */
9
10#ifdef __KERNEL__
11#ifndef __ASM_IBMSTBX25_H__
12#define __ASM_IBMSTBX25_H__
13
14
15/* serial port defines */
16#define STBx25xx_IO_BASE ((uint)0xe0000000)
17#define PPC4xx_ONB_IO_PADDR STBx25xx_IO_BASE
18#define PPC4xx_ONB_IO_VADDR ((uint)0xe0000000)
19#define PPC4xx_ONB_IO_SIZE ((uint)14*64*1024)
20
21/*
22 * map STBxxxx internal i/o address (0x400x00xx) to an address
23 * which is below the 2GB limit...
24 *
25 * 4000 000x uart1 -> 0xe000 000x
26 * 4001 00xx uart2
27 * 4002 00xx smart card
28 * 4003 000x iic
29 * 4004 000x uart0
30 * 4005 0xxx timer
31 * 4006 00xx gpio
32 * 4007 00xx smart card
33 * 400b 000x iic
34 * 400c 000x scp
35 * 400d 000x modem
36 * 400e 000x uart2
37*/
38#define STBx25xx_MAP_IO_ADDR(a) (((uint)(a)) + (STBx25xx_IO_BASE - 0x40000000))
39
40#define RS_TABLE_SIZE 3
41
42#define OPB_BASE_START 0x40000000
43#define EBIU_BASE_START 0xF0100000
44#define DCR_BASE_START 0x0000
45
46#ifdef __BOOTER__
47#define UART1_IO_BASE 0x40000000
48#define UART2_IO_BASE 0x40010000
49#else
50#define UART1_IO_BASE 0xe0000000
51#define UART2_IO_BASE 0xe0010000
52#endif
53#define SC0_BASE 0x40020000 /* smart card #0 */
54#define IIC0_BASE 0x40030000
55#ifdef __BOOTER__
56#define UART0_IO_BASE 0x40040000
57#else
58#define UART0_IO_BASE 0xe0040000
59#endif
60#define SCC0_BASE 0x40040000 /* Serial 0 controller IrdA */
61#define GPT0_BASE 0x40050000 /* General purpose timers */
62#define GPIO0_BASE 0x40060000
63#define SC1_BASE 0x40070000 /* smart card #1 */
64#define SCP0_BASE 0x400C0000 /* Serial Controller Port */
65#define SSP0_BASE 0x400D0000 /* Sync serial port */
66
67#define IDE0_BASE 0xf0100000
68#define REDWOOD_IDE_CTRL 0xf1100000
69
70#define RTCFPC_IRQ 0
71#define XPORT_IRQ 1
72#define AUD_IRQ 2
73#define AID_IRQ 3
74#define DMA0 4
75#define DMA1_IRQ 5
76#define DMA2_IRQ 6
77#define DMA3_IRQ 7
78#define SC0_IRQ 8
79#define IIC0_IRQ 9
80#define IIR0_IRQ 10
81#define GPT0_IRQ 11
82#define GPT1_IRQ 12
83#define SCP0_IRQ 13
84#define SSP0_IRQ 14
85#define GPT2_IRQ 15 /* count down timer */
86#define SC1_IRQ 16
87/* IRQ 17 - 19 external */
88#define UART0_INT 20
89#define UART1_INT 21
90#define UART2_INT 22
91#define XPTDMA_IRQ 23
92#define DCRIDE_IRQ 24
93/* IRQ 25 - 30 external */
94#define IDE0_IRQ 26
95
96#define IIC_NUMS 1
97#define UART_NUMS 3
98#define IIC_OWN 0x55
99#define IIC_CLOCK 50
100
101#define BD_EMAC_ADDR(e,i) bi_enetaddr[i]
102
103#define STD_UART_OP(num) \
104 { 0, BASE_BAUD, 0, UART##num##_INT, \
105 (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST), \
106 iomem_base: (u8 *)UART##num##_IO_BASE, \
107 io_type: SERIAL_IO_MEM},
108
109#if defined(CONFIG_UART0_TTYS0)
110#define SERIAL_DEBUG_IO_BASE UART0_IO_BASE
111#define SERIAL_PORT_DFNS \
112 STD_UART_OP(0) \
113 STD_UART_OP(1) \
114 STD_UART_OP(2)
115#endif
116
117#if defined(CONFIG_UART0_TTYS1)
118#define SERIAL_DEBUG_IO_BASE UART2_IO_BASE
119#define SERIAL_PORT_DFNS \
120 STD_UART_OP(1) \
121 STD_UART_OP(0) \
122 STD_UART_OP(2)
123#endif
124
125#if defined(CONFIG_UART0_TTYS2)
126#define SERIAL_DEBUG_IO_BASE UART2_IO_BASE
127#define SERIAL_PORT_DFNS \
128 STD_UART_OP(2) \
129 STD_UART_OP(0) \
130 STD_UART_OP(1)
131#endif
132
133#define DCRN_BE_BASE 0x090
134#define DCRN_DMA0_BASE 0x0C0
135#define DCRN_DMA1_BASE 0x0C8
136#define DCRN_DMA2_BASE 0x0D0
137#define DCRN_DMA3_BASE 0x0D8
138#define DCRNCAP_DMA_CC 1 /* have DMA chained count capability */
139#define DCRN_DMASR_BASE 0x0E0
140#define DCRN_PLB0_BASE 0x054
141#define DCRN_PLB1_BASE 0x064
142#define DCRN_POB0_BASE 0x0B0
143#define DCRN_SCCR_BASE 0x120
144#define DCRN_UIC0_BASE 0x040
145#define DCRN_BE_BASE 0x090
146#define DCRN_DMA0_BASE 0x0C0
147#define DCRN_DMA1_BASE 0x0C8
148#define DCRN_DMA2_BASE 0x0D0
149#define DCRN_DMA3_BASE 0x0D8
150#define DCRN_CIC_BASE 0x030
151#define DCRN_DMASR_BASE 0x0E0
152#define DCRN_EBIMC_BASE 0x070
153#define DCRN_DCRX_BASE 0x020
154#define DCRN_CPMFR_BASE 0x102
155#define DCRN_SCCR_BASE 0x120
156#define DCRN_RTCFP_BASE 0x310
157
158#define UIC0 DCRN_UIC0_BASE
159
160#define IBM_CPM_IIC0 0x80000000 /* IIC 0 interface */
161#define IBM_CPM_CPU 0x10000000 /* PPC405B3 clock control */
162#define IBM_CPM_AUD 0x08000000 /* Audio Decoder */
163#define IBM_CPM_EBIU 0x04000000 /* External Bus Interface Unit */
164#define IBM_CPM_IRR 0x02000000 /* Infrared receiver */
165#define IBM_CPM_DMA 0x01000000 /* DMA controller */
166#define IBM_CPM_UART2 0x00200000 /* Serial Control Port */
167#define IBM_CPM_UART1 0x00100000 /* Serial 1 / Infrared */
168#define IBM_CPM_UART0 0x00080000 /* Serial 0 / 16550 */
169#define IBM_PM_DCRIDE 0x00040000 /* DCR timeout & IDE line Mode clock */
170#define IBM_CPM_SC0 0x00020000 /* Smart Card 0 */
171#define IBM_CPM_VID 0x00010000 /* reserved */
172#define IBM_CPM_SC1 0x00008000 /* Smart Card 0 */
173#define IBM_CPM_XPT0 0x00002000 /* Transport - 54 Mhz */
174#define IBM_CPM_CBS 0x00001000 /* Cross Bar Switch */
175#define IBM_CPM_GPT 0x00000800 /* GPTPWM */
176#define IBM_CPM_GPIO0 0x00000400 /* General Purpose IO 0 */
177#define IBM_CPM_DENC 0x00000200 /* Digital video Encoder */
178#define IBM_CPM_C405T 0x00000100 /* CPU timers */
179#define IBM_CPM_XPT27 0x00000080 /* Transport - 27 Mhz */
180#define IBM_CPM_UIC 0x00000040 /* Universal Interrupt Controller */
181#define IBM_CPM_RTCFPC 0x00000020 /* Realtime clock and front panel */
182#define IBM_CPM_SSP 0x00000010 /* Modem Serial Interface (SSP) */
183#define IBM_CPM_VID2 0x00000002 /* Video Decoder clock domain 2 */
184#define DFLT_IBM4xx_PM ~(IBM_CPM_CPU | IBM_CPM_EBIU | IBM_CPM_DMA \
185 | IBM_CPM_CBS | IBM_CPM_XPT0 | IBM_CPM_C405T \
186 | IBM_CPM_XPT27 | IBM_CPM_UIC)
187
188#define DCRN_BEAR (DCRN_BE_BASE + 0x0) /* Bus Error Address Register */
189#define DCRN_BESR (DCRN_BE_BASE + 0x1) /* Bus Error Syndrome Register */
190/* DCRN_BESR */
191#define BESR_DSES 0x80000000 /* Data-Side Error Status */
192#define BESR_DMES 0x40000000 /* DMA Error Status */
193#define BESR_RWS 0x20000000 /* Read/Write Status */
194#define BESR_ETMASK 0x1C000000 /* Error Type */
195#define ET_PROT 0
196#define ET_PARITY 1
197#define ET_NCFG 2
198#define ET_BUSERR 4
199#define ET_BUSTO 6
200
201#define CHR1_CETE 0x00800000 /* CPU external timer enable */
202#define CHR1_PCIPW 0x00008000 /* PCI Int enable/Peripheral Write enable */
203
204#define DCRN_CICCR (DCRN_CIC_BASE + 0x0) /* CIC Control Register */
205#define DCRN_DMAS1 (DCRN_CIC_BASE + 0x1) /* DMA Select1 Register */
206#define DCRN_DMAS2 (DCRN_CIC_BASE + 0x2) /* DMA Select2 Register */
207#define DCRN_CICVCR (DCRN_CIC_BASE + 0x3) /* CIC Video COntro Register */
208#define DCRN_CICSEL3 (DCRN_CIC_BASE + 0x5) /* CIC Select 3 Register */
209#define DCRN_SGPO (DCRN_CIC_BASE + 0x6) /* CIC GPIO Output Register */
210#define DCRN_SGPOD (DCRN_CIC_BASE + 0x7) /* CIC GPIO OD Register */
211#define DCRN_SGPTC (DCRN_CIC_BASE + 0x8) /* CIC GPIO Tristate Ctrl Reg */
212#define DCRN_SGPI (DCRN_CIC_BASE + 0x9) /* CIC GPIO Input Reg */
213
214#define DCRN_DCRXICR (DCRN_DCRX_BASE + 0x0) /* Internal Control Register */
215#define DCRN_DCRXISR (DCRN_DCRX_BASE + 0x1) /* Internal Status Register */
216#define DCRN_DCRXECR (DCRN_DCRX_BASE + 0x2) /* External Control Register */
217#define DCRN_DCRXESR (DCRN_DCRX_BASE + 0x3) /* External Status Register */
218#define DCRN_DCRXTAR (DCRN_DCRX_BASE + 0x4) /* Target Address Register */
219#define DCRN_DCRXTDR (DCRN_DCRX_BASE + 0x5) /* Target Data Register */
220#define DCRN_DCRXIGR (DCRN_DCRX_BASE + 0x6) /* Interrupt Generation Register */
221#define DCRN_DCRXBCR (DCRN_DCRX_BASE + 0x7) /* Line Buffer Control Register */
222
223#define DCRN_BRCRH0 (DCRN_EBIMC_BASE + 0x0) /* Bus Region Config High 0 */
224#define DCRN_BRCRH1 (DCRN_EBIMC_BASE + 0x1) /* Bus Region Config High 1 */
225#define DCRN_BRCRH2 (DCRN_EBIMC_BASE + 0x2) /* Bus Region Config High 2 */
226#define DCRN_BRCRH3 (DCRN_EBIMC_BASE + 0x3) /* Bus Region Config High 3 */
227#define DCRN_BRCRH4 (DCRN_EBIMC_BASE + 0x4) /* Bus Region Config High 4 */
228#define DCRN_BRCRH5 (DCRN_EBIMC_BASE + 0x5) /* Bus Region Config High 5 */
229#define DCRN_BRCRH6 (DCRN_EBIMC_BASE + 0x6) /* Bus Region Config High 6 */
230#define DCRN_BRCRH7 (DCRN_EBIMC_BASE + 0x7) /* Bus Region Config High 7 */
231#define DCRN_BRCR0 (DCRN_EBIMC_BASE + 0x10) /* BRC 0 */
232#define DCRN_BRCR1 (DCRN_EBIMC_BASE + 0x11) /* BRC 1 */
233#define DCRN_BRCR2 (DCRN_EBIMC_BASE + 0x12) /* BRC 2 */
234#define DCRN_BRCR3 (DCRN_EBIMC_BASE + 0x13) /* BRC 3 */
235#define DCRN_BRCR4 (DCRN_EBIMC_BASE + 0x14) /* BRC 4 */
236#define DCRN_BRCR5 (DCRN_EBIMC_BASE + 0x15) /* BRC 5 */
237#define DCRN_BRCR6 (DCRN_EBIMC_BASE + 0x16) /* BRC 6 */
238#define DCRN_BRCR7 (DCRN_EBIMC_BASE + 0x17) /* BRC 7 */
239#define DCRN_BEAR0 (DCRN_EBIMC_BASE + 0x20) /* Bus Error Address Register */
240#define DCRN_BESR0 (DCRN_EBIMC_BASE + 0x21) /* Bus Error Status Register */
241#define DCRN_BIUCR (DCRN_EBIMC_BASE + 0x2A) /* Bus Interfac Unit Ctrl Reg */
242
243#define DCRN_RTC_FPC0_CNTL (DCRN_RTCFP_BASE + 0x00) /* RTC cntl */
244#define DCRN_RTC_FPC0_INT (DCRN_RTCFP_BASE + 0x01) /* RTC Interrupt */
245#define DCRN_RTC_FPC0_TIME (DCRN_RTCFP_BASE + 0x02) /* RTC time reg */
246#define DCRN_RTC_FPC0_ALRM (DCRN_RTCFP_BASE + 0x03) /* RTC Alarm reg */
247#define DCRN_RTC_FPC0_D1 (DCRN_RTCFP_BASE + 0x04) /* LED Data 1 */
248#define DCRN_RTC_FPC0_D2 (DCRN_RTCFP_BASE + 0x05) /* LED Data 2 */
249#define DCRN_RTC_FPC0_D3 (DCRN_RTCFP_BASE + 0x06) /* LED Data 3 */
250#define DCRN_RTC_FPC0_D4 (DCRN_RTCFP_BASE + 0x07) /* LED Data 4 */
251#define DCRN_RTC_FPC0_D5 (DCRN_RTCFP_BASE + 0x08) /* LED Data 5 */
252#define DCRN_RTC_FPC0_FCNTL (DCRN_RTCFP_BASE + 0x09) /* LED control */
253#define DCRN_RTC_FPC0_BRT (DCRN_RTCFP_BASE + 0x0A) /* Brightness cntl */
254
255#include <asm/ibm405.h>
256
257#endif /* __ASM_IBMSTBX25_H__ */
258#endif /* __KERNEL__ */
diff --git a/arch/ppc/platforms/4xx/luan.c b/arch/ppc/platforms/4xx/luan.c
deleted file mode 100644
index f6d8c2e8b6b7..000000000000
--- a/arch/ppc/platforms/4xx/luan.c
+++ /dev/null
@@ -1,371 +0,0 @@
1/*
2 * Luan board specific routines
3 *
4 * Matt Porter <mporter@kernel.crashing.org>
5 *
6 * Copyright 2004-2005 MontaVista Software Inc.
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
12 */
13
14#include <linux/stddef.h>
15#include <linux/kernel.h>
16#include <linux/init.h>
17#include <linux/errno.h>
18#include <linux/reboot.h>
19#include <linux/pci.h>
20#include <linux/kdev_t.h>
21#include <linux/types.h>
22#include <linux/major.h>
23#include <linux/blkdev.h>
24#include <linux/console.h>
25#include <linux/delay.h>
26#include <linux/initrd.h>
27#include <linux/seq_file.h>
28#include <linux/root_dev.h>
29#include <linux/tty.h>
30#include <linux/serial.h>
31#include <linux/serial_core.h>
32#include <linux/serial_8250.h>
33
34#include <asm/system.h>
35#include <asm/pgtable.h>
36#include <asm/page.h>
37#include <asm/dma.h>
38#include <asm/io.h>
39#include <asm/machdep.h>
40#include <asm/ocp.h>
41#include <asm/pci-bridge.h>
42#include <asm/time.h>
43#include <asm/todc.h>
44#include <asm/bootinfo.h>
45#include <asm/ppc4xx_pic.h>
46#include <asm/ppcboot.h>
47
48#include <syslib/ibm44x_common.h>
49#include <syslib/ibm440gx_common.h>
50#include <syslib/ibm440sp_common.h>
51
52extern bd_t __res;
53
54static struct ibm44x_clocks clocks __initdata;
55
56static void __init
57luan_calibrate_decr(void)
58{
59 unsigned int freq;
60
61 if (mfspr(SPRN_CCR1) & CCR1_TCS)
62 freq = LUAN_TMR_CLK;
63 else
64 freq = clocks.cpu;
65
66 ibm44x_calibrate_decr(freq);
67}
68
69static int
70luan_show_cpuinfo(struct seq_file *m)
71{
72 seq_printf(m, "vendor\t\t: IBM\n");
73 seq_printf(m, "machine\t\t: PPC440SP EVB (Luan)\n");
74
75 return 0;
76}
77
78static inline int
79luan_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
80{
81 struct pci_controller *hose = pci_bus_to_hose(dev->bus->number);
82
83 /* PCIX0 in adapter mode, no host interrupt routing */
84
85 /* PCIX1 */
86 if (hose->index == 0) {
87 static char pci_irq_table[][4] =
88 /*
89 * PCI IDSEL/INTPIN->INTLINE
90 * A B C D
91 */
92 {
93 { 49, 49, 49, 49 }, /* IDSEL 1 - PCIX1 Slot 0 */
94 { 49, 49, 49, 49 }, /* IDSEL 2 - PCIX1 Slot 1 */
95 { 49, 49, 49, 49 }, /* IDSEL 3 - PCIX1 Slot 2 */
96 { 49, 49, 49, 49 }, /* IDSEL 4 - PCIX1 Slot 3 */
97 };
98 const long min_idsel = 1, max_idsel = 4, irqs_per_slot = 4;
99 return PCI_IRQ_TABLE_LOOKUP;
100 /* PCIX2 */
101 } else if (hose->index == 1) {
102 static char pci_irq_table[][4] =
103 /*
104 * PCI IDSEL/INTPIN->INTLINE
105 * A B C D
106 */
107 {
108 { 50, 50, 50, 50 }, /* IDSEL 1 - PCIX2 Slot 0 */
109 { 50, 50, 50, 50 }, /* IDSEL 2 - PCIX2 Slot 1 */
110 { 50, 50, 50, 50 }, /* IDSEL 3 - PCIX2 Slot 2 */
111 { 50, 50, 50, 50 }, /* IDSEL 4 - PCIX2 Slot 3 */
112 };
113 const long min_idsel = 1, max_idsel = 4, irqs_per_slot = 4;
114 return PCI_IRQ_TABLE_LOOKUP;
115 }
116 return -1;
117}
118
119static void __init luan_set_emacdata(void)
120{
121 struct ocp_def *def;
122 struct ocp_func_emac_data *emacdata;
123
124 /* Set phy_map, phy_mode, and mac_addr for the EMAC */
125 def = ocp_get_one_device(OCP_VENDOR_IBM, OCP_FUNC_EMAC, 0);
126 emacdata = def->additions;
127 emacdata->phy_map = 0x00000001; /* Skip 0x00 */
128 emacdata->phy_mode = PHY_MODE_GMII;
129 memcpy(emacdata->mac_addr, __res.bi_enetaddr, 6);
130}
131
132#define PCIX_READW(offset) \
133 (readw((void *)((u32)pcix_reg_base+offset)))
134
135#define PCIX_WRITEW(value, offset) \
136 (writew(value, (void *)((u32)pcix_reg_base+offset)))
137
138#define PCIX_WRITEL(value, offset) \
139 (writel(value, (void *)((u32)pcix_reg_base+offset)))
140
141static void __init
142luan_setup_pcix(void)
143{
144 int i;
145 void *pcix_reg_base;
146
147 for (i=0;i<3;i++) {
148 pcix_reg_base = ioremap64(PCIX0_REG_BASE + i*PCIX_REG_OFFSET, PCIX_REG_SIZE);
149
150 /* Enable PCIX0 I/O, Mem, and Busmaster cycles */
151 PCIX_WRITEW(PCIX_READW(PCIX0_COMMAND) | PCI_COMMAND_IO | PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER, PCIX0_COMMAND);
152
153 /* Disable all windows */
154 PCIX_WRITEL(0, PCIX0_POM0SA);
155 PCIX_WRITEL(0, PCIX0_POM1SA);
156 PCIX_WRITEL(0, PCIX0_POM2SA);
157 PCIX_WRITEL(0, PCIX0_PIM0SA);
158 PCIX_WRITEL(0, PCIX0_PIM0SAH);
159 PCIX_WRITEL(0, PCIX0_PIM1SA);
160 PCIX_WRITEL(0, PCIX0_PIM2SA);
161 PCIX_WRITEL(0, PCIX0_PIM2SAH);
162
163 /*
164 * Setup 512MB PLB->PCI outbound mem window
165 * (a_n000_0000->0_n000_0000)
166 * */
167 PCIX_WRITEL(0x0000000a, PCIX0_POM0LAH);
168 PCIX_WRITEL(0x80000000 | i*LUAN_PCIX_MEM_SIZE, PCIX0_POM0LAL);
169 PCIX_WRITEL(0x00000000, PCIX0_POM0PCIAH);
170 PCIX_WRITEL(0x80000000 | i*LUAN_PCIX_MEM_SIZE, PCIX0_POM0PCIAL);
171 PCIX_WRITEL(0xe0000001, PCIX0_POM0SA);
172
173 /* Setup 2GB PCI->PLB inbound memory window at 0, enable MSIs */
174 PCIX_WRITEL(0x00000000, PCIX0_PIM0LAH);
175 PCIX_WRITEL(0x00000000, PCIX0_PIM0LAL);
176 PCIX_WRITEL(0xe0000007, PCIX0_PIM0SA);
177 PCIX_WRITEL(0xffffffff, PCIX0_PIM0SAH);
178
179 iounmap(pcix_reg_base);
180 }
181
182 eieio();
183}
184
185static void __init
186luan_setup_hose(struct pci_controller *hose,
187 int lower_mem,
188 int upper_mem,
189 int cfga,
190 int cfgd,
191 u64 pcix_io_base)
192{
193 char name[20];
194
195 sprintf(name, "PCIX%d host bridge", hose->index);
196
197 hose->pci_mem_offset = LUAN_PCIX_MEM_OFFSET;
198
199 pci_init_resource(&hose->io_resource,
200 LUAN_PCIX_LOWER_IO,
201 LUAN_PCIX_UPPER_IO,
202 IORESOURCE_IO,
203 name);
204
205 pci_init_resource(&hose->mem_resources[0],
206 lower_mem,
207 upper_mem,
208 IORESOURCE_MEM,
209 name);
210
211 hose->io_space.start = LUAN_PCIX_LOWER_IO;
212 hose->io_space.end = LUAN_PCIX_UPPER_IO;
213 hose->mem_space.start = lower_mem;
214 hose->mem_space.end = upper_mem;
215 hose->io_base_virt = ioremap64(pcix_io_base, PCIX_IO_SIZE);
216 isa_io_base = (unsigned long) hose->io_base_virt;
217
218 setup_indirect_pci(hose, cfga, cfgd);
219 hose->set_cfg_type = 1;
220}
221
222static void __init
223luan_setup_hoses(void)
224{
225 struct pci_controller *hose1, *hose2;
226
227 /* Configure windows on the PCI-X host bridge */
228 luan_setup_pcix();
229
230 /* Allocate hoses for PCIX1 and PCIX2 */
231 hose1 = pcibios_alloc_controller();
232 if (!hose1)
233 return;
234
235 hose2 = pcibios_alloc_controller();
236 if (!hose2) {
237 pcibios_free_controller(hose1);
238 return;
239 }
240
241 /* Setup PCIX1 */
242 hose1->first_busno = 0;
243 hose1->last_busno = 0xff;
244
245 luan_setup_hose(hose1,
246 LUAN_PCIX1_LOWER_MEM,
247 LUAN_PCIX1_UPPER_MEM,
248 PCIX1_CFGA,
249 PCIX1_CFGD,
250 PCIX1_IO_BASE);
251
252 hose1->last_busno = pciauto_bus_scan(hose1, hose1->first_busno);
253
254 /* Setup PCIX2 */
255 hose2->first_busno = hose1->last_busno + 1;
256 hose2->last_busno = 0xff;
257
258 luan_setup_hose(hose2,
259 LUAN_PCIX2_LOWER_MEM,
260 LUAN_PCIX2_UPPER_MEM,
261 PCIX2_CFGA,
262 PCIX2_CFGD,
263 PCIX2_IO_BASE);
264
265 hose2->last_busno = pciauto_bus_scan(hose2, hose2->first_busno);
266
267 ppc_md.pci_swizzle = common_swizzle;
268 ppc_md.pci_map_irq = luan_map_irq;
269}
270
271TODC_ALLOC();
272
273static void __init
274luan_early_serial_map(void)
275{
276 struct uart_port port;
277
278 /* Setup ioremapped serial port access */
279 memset(&port, 0, sizeof(port));
280 port.membase = ioremap64(PPC440SP_UART0_ADDR, 8);
281 port.irq = UART0_INT;
282 port.uartclk = clocks.uart0;
283 port.regshift = 0;
284 port.iotype = UPIO_MEM;
285 port.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST;
286 port.line = 0;
287
288 if (early_serial_setup(&port) != 0) {
289 printk("Early serial init of port 0 failed\n");
290 }
291
292 port.membase = ioremap64(PPC440SP_UART1_ADDR, 8);
293 port.irq = UART1_INT;
294 port.uartclk = clocks.uart1;
295 port.line = 1;
296
297 if (early_serial_setup(&port) != 0) {
298 printk("Early serial init of port 1 failed\n");
299 }
300
301 port.membase = ioremap64(PPC440SP_UART2_ADDR, 8);
302 port.irq = UART2_INT;
303 port.uartclk = BASE_BAUD;
304 port.line = 2;
305
306 if (early_serial_setup(&port) != 0) {
307 printk("Early serial init of port 2 failed\n");
308 }
309}
310
311static void __init
312luan_setup_arch(void)
313{
314 luan_set_emacdata();
315
316#if !defined(CONFIG_BDI_SWITCH)
317 /*
318 * The Abatron BDI JTAG debugger does not tolerate others
319 * mucking with the debug registers.
320 */
321 mtspr(SPRN_DBCR0, (DBCR0_TDE | DBCR0_IDM));
322#endif
323
324 /*
325 * Determine various clocks.
326 * To be completely correct we should get SysClk
327 * from FPGA, because it can be changed by on-board switches
328 * --ebs
329 */
330 /* 440GX and 440SP clocking is the same -mdp */
331 ibm440gx_get_clocks(&clocks, 33333333, 6 * 1843200);
332 ocp_sys_info.opb_bus_freq = clocks.opb;
333
334 /* init to some ~sane value until calibrate_delay() runs */
335 loops_per_jiffy = 50000000/HZ;
336
337 /* Setup PCIXn host bridges */
338 luan_setup_hoses();
339
340#ifdef CONFIG_BLK_DEV_INITRD
341 if (initrd_start)
342 ROOT_DEV = Root_RAM0;
343 else
344#endif
345#ifdef CONFIG_ROOT_NFS
346 ROOT_DEV = Root_NFS;
347#else
348 ROOT_DEV = Root_HDA1;
349#endif
350
351 luan_early_serial_map();
352
353 /* Identify the system */
354 printk("Luan port (MontaVista Software, Inc. <source@mvista.com>)\n");
355}
356
357void __init platform_init(unsigned long r3, unsigned long r4,
358 unsigned long r5, unsigned long r6, unsigned long r7)
359{
360 ibm44x_platform_init(r3, r4, r5, r6, r7);
361
362 ppc_md.setup_arch = luan_setup_arch;
363 ppc_md.show_cpuinfo = luan_show_cpuinfo;
364 ppc_md.find_end_of_memory = ibm440sp_find_end_of_memory;
365 ppc_md.get_irq = NULL; /* Set in ppc4xx_pic_init() */
366
367 ppc_md.calibrate_decr = luan_calibrate_decr;
368#ifdef CONFIG_KGDB
369 ppc_md.early_serial_map = luan_early_serial_map;
370#endif
371}
diff --git a/arch/ppc/platforms/4xx/luan.h b/arch/ppc/platforms/4xx/luan.h
deleted file mode 100644
index 68dd46b0a5c4..000000000000
--- a/arch/ppc/platforms/4xx/luan.h
+++ /dev/null
@@ -1,77 +0,0 @@
1/*
2 * Luan board definitions
3 *
4 * Matt Porter <mporter@kernel.crashing.org>
5 *
6 * Copyright 2004-2005 MontaVista Software Inc.
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
12 *
13 */
14
15#ifdef __KERNEL__
16#ifndef __ASM_LUAN_H__
17#define __ASM_LUAN_H__
18
19#include <platforms/4xx/ibm440sp.h>
20
21/* F/W TLB mapping used in bootloader glue to reset EMAC */
22#define PPC44x_EMAC0_MR0 0xa0000800
23
24/* Location of MAC addresses in PIBS image */
25#define PIBS_FLASH_BASE 0xffe00000
26#define PIBS_MAC_BASE (PIBS_FLASH_BASE+0x1b0400)
27
28/* External timer clock frequency */
29#define LUAN_TMR_CLK 25000000
30
31/* Flash */
32#define LUAN_FPGA_REG_0 0x0000000148300000ULL
33#define LUAN_BOOT_LARGE_FLASH(x) (x & 0x40)
34#define LUAN_SMALL_FLASH_LOW 0x00000001ff900000ULL
35#define LUAN_SMALL_FLASH_HIGH 0x00000001ffe00000ULL
36#define LUAN_SMALL_FLASH_SIZE 0x100000
37#define LUAN_LARGE_FLASH_LOW 0x00000001ff800000ULL
38#define LUAN_LARGE_FLASH_HIGH 0x00000001ffc00000ULL
39#define LUAN_LARGE_FLASH_SIZE 0x400000
40
41/*
42 * Serial port defines
43 */
44#define RS_TABLE_SIZE 3
45
46/* PIBS defined UART mappings, used before early_serial_setup */
47#define UART0_IO_BASE 0xa0000200
48#define UART1_IO_BASE 0xa0000300
49#define UART2_IO_BASE 0xa0000600
50
51#define BASE_BAUD 11059200
52#define STD_UART_OP(num) \
53 { 0, BASE_BAUD, 0, UART##num##_INT, \
54 (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST), \
55 iomem_base: (void*)UART##num##_IO_BASE, \
56 io_type: SERIAL_IO_MEM},
57
58#define SERIAL_PORT_DFNS \
59 STD_UART_OP(0) \
60 STD_UART_OP(1) \
61 STD_UART_OP(2)
62
63/* PCI support */
64#define LUAN_PCIX_LOWER_IO 0x00000000
65#define LUAN_PCIX_UPPER_IO 0x0000ffff
66#define LUAN_PCIX0_LOWER_MEM 0x80000000
67#define LUAN_PCIX0_UPPER_MEM 0x9fffffff
68#define LUAN_PCIX1_LOWER_MEM 0xa0000000
69#define LUAN_PCIX1_UPPER_MEM 0xbfffffff
70#define LUAN_PCIX2_LOWER_MEM 0xc0000000
71#define LUAN_PCIX2_UPPER_MEM 0xdfffffff
72
73#define LUAN_PCIX_MEM_SIZE 0x20000000
74#define LUAN_PCIX_MEM_OFFSET 0x00000000
75
76#endif /* __ASM_LUAN_H__ */
77#endif /* __KERNEL__ */
diff --git a/arch/ppc/platforms/4xx/ocotea.c b/arch/ppc/platforms/4xx/ocotea.c
deleted file mode 100644
index 308386ef6f77..000000000000
--- a/arch/ppc/platforms/4xx/ocotea.c
+++ /dev/null
@@ -1,350 +0,0 @@
1/*
2 * Ocotea board specific routines
3 *
4 * Matt Porter <mporter@kernel.crashing.org>
5 *
6 * Copyright 2003-2005 MontaVista Software Inc.
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
12 */
13
14#include <linux/stddef.h>
15#include <linux/kernel.h>
16#include <linux/init.h>
17#include <linux/errno.h>
18#include <linux/reboot.h>
19#include <linux/pci.h>
20#include <linux/kdev_t.h>
21#include <linux/types.h>
22#include <linux/major.h>
23#include <linux/blkdev.h>
24#include <linux/console.h>
25#include <linux/delay.h>
26#include <linux/initrd.h>
27#include <linux/seq_file.h>
28#include <linux/root_dev.h>
29#include <linux/tty.h>
30#include <linux/serial.h>
31#include <linux/serial_core.h>
32#include <linux/serial_8250.h>
33
34#include <asm/system.h>
35#include <asm/pgtable.h>
36#include <asm/page.h>
37#include <asm/dma.h>
38#include <asm/io.h>
39#include <asm/machdep.h>
40#include <asm/ocp.h>
41#include <asm/pci-bridge.h>
42#include <asm/time.h>
43#include <asm/todc.h>
44#include <asm/bootinfo.h>
45#include <asm/ppc4xx_pic.h>
46#include <asm/ppcboot.h>
47#include <asm/tlbflush.h>
48
49#include <syslib/gen550.h>
50#include <syslib/ibm440gx_common.h>
51
52extern bd_t __res;
53
54static struct ibm44x_clocks clocks __initdata;
55
56static void __init
57ocotea_calibrate_decr(void)
58{
59 unsigned int freq;
60
61 if (mfspr(SPRN_CCR1) & CCR1_TCS)
62 freq = OCOTEA_TMR_CLK;
63 else
64 freq = clocks.cpu;
65
66 ibm44x_calibrate_decr(freq);
67}
68
69static int
70ocotea_show_cpuinfo(struct seq_file *m)
71{
72 seq_printf(m, "vendor\t\t: IBM\n");
73 seq_printf(m, "machine\t\t: PPC440GX EVB (Ocotea)\n");
74 ibm440gx_show_cpuinfo(m);
75 return 0;
76}
77
78static inline int
79ocotea_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
80{
81 static char pci_irq_table[][4] =
82 /*
83 * PCI IDSEL/INTPIN->INTLINE
84 * A B C D
85 */
86 {
87 { 23, 23, 23, 23 }, /* IDSEL 1 - PCI Slot 0 */
88 { 24, 24, 24, 24 }, /* IDSEL 2 - PCI Slot 1 */
89 { 25, 25, 25, 25 }, /* IDSEL 3 - PCI Slot 2 */
90 { 26, 26, 26, 26 }, /* IDSEL 4 - PCI Slot 3 */
91 };
92
93 const long min_idsel = 1, max_idsel = 4, irqs_per_slot = 4;
94 return PCI_IRQ_TABLE_LOOKUP;
95}
96
97static void __init ocotea_set_emacdata(void)
98{
99 struct ocp_def *def;
100 struct ocp_func_emac_data *emacdata;
101 int i;
102
103 /*
104 * Note: Current rev. board only operates in Group 4a
105 * mode, so we always set EMAC0-1 for SMII and EMAC2-3
106 * for RGMII (though these could run in RTBI just the same).
107 *
108 * The FPGA reg 3 information isn't even suitable for
109 * determining the phy_mode, so if the board becomes
110 * usable in !4a, it will be necessary to parse an environment
111 * variable from the firmware or similar to properly configure
112 * the phy_map/phy_mode.
113 */
114 /* Set phy_map, phy_mode, and mac_addr for each EMAC */
115 for (i=0; i<4; i++) {
116 def = ocp_get_one_device(OCP_VENDOR_IBM, OCP_FUNC_EMAC, i);
117 emacdata = def->additions;
118 if (i < 2) {
119 emacdata->phy_map = 0x00000001; /* Skip 0x00 */
120 emacdata->phy_mode = PHY_MODE_SMII;
121 }
122 else {
123 emacdata->phy_map = 0x0000ffff; /* Skip 0x00-0x0f */
124 emacdata->phy_mode = PHY_MODE_RGMII;
125 }
126 if (i == 0)
127 memcpy(emacdata->mac_addr, __res.bi_enetaddr, 6);
128 else if (i == 1)
129 memcpy(emacdata->mac_addr, __res.bi_enet1addr, 6);
130 else if (i == 2)
131 memcpy(emacdata->mac_addr, __res.bi_enet2addr, 6);
132 else if (i == 3)
133 memcpy(emacdata->mac_addr, __res.bi_enet3addr, 6);
134 }
135}
136
137#define PCIX_READW(offset) \
138 (readw(pcix_reg_base+offset))
139
140#define PCIX_WRITEW(value, offset) \
141 (writew(value, pcix_reg_base+offset))
142
143#define PCIX_WRITEL(value, offset) \
144 (writel(value, pcix_reg_base+offset))
145
146/*
147 * FIXME: This is only here to "make it work". This will move
148 * to a ibm_pcix.c which will contain a generic IBM PCIX bridge
149 * configuration library. -Matt
150 */
151static void __init
152ocotea_setup_pcix(void)
153{
154 void *pcix_reg_base;
155
156 pcix_reg_base = ioremap64(PCIX0_REG_BASE, PCIX_REG_SIZE);
157
158 /* Enable PCIX0 I/O, Mem, and Busmaster cycles */
159 PCIX_WRITEW(PCIX_READW(PCIX0_COMMAND) | PCI_COMMAND_IO | PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER, PCIX0_COMMAND);
160
161 /* Disable all windows */
162 PCIX_WRITEL(0, PCIX0_POM0SA);
163 PCIX_WRITEL(0, PCIX0_POM1SA);
164 PCIX_WRITEL(0, PCIX0_POM2SA);
165 PCIX_WRITEL(0, PCIX0_PIM0SA);
166 PCIX_WRITEL(0, PCIX0_PIM0SAH);
167 PCIX_WRITEL(0, PCIX0_PIM1SA);
168 PCIX_WRITEL(0, PCIX0_PIM2SA);
169 PCIX_WRITEL(0, PCIX0_PIM2SAH);
170
171 /* Setup 2GB PLB->PCI outbound mem window (3_8000_0000->0_8000_0000) */
172 PCIX_WRITEL(0x00000003, PCIX0_POM0LAH);
173 PCIX_WRITEL(0x80000000, PCIX0_POM0LAL);
174 PCIX_WRITEL(0x00000000, PCIX0_POM0PCIAH);
175 PCIX_WRITEL(0x80000000, PCIX0_POM0PCIAL);
176 PCIX_WRITEL(0x80000001, PCIX0_POM0SA);
177
178 /* Setup 2GB PCI->PLB inbound memory window at 0, enable MSIs */
179 PCIX_WRITEL(0x00000000, PCIX0_PIM0LAH);
180 PCIX_WRITEL(0x00000000, PCIX0_PIM0LAL);
181 PCIX_WRITEL(0x80000007, PCIX0_PIM0SA);
182
183 eieio();
184}
185
186static void __init
187ocotea_setup_hose(void)
188{
189 struct pci_controller *hose;
190
191 /* Configure windows on the PCI-X host bridge */
192 ocotea_setup_pcix();
193
194 hose = pcibios_alloc_controller();
195
196 if (!hose)
197 return;
198
199 hose->first_busno = 0;
200 hose->last_busno = 0xff;
201
202 hose->pci_mem_offset = OCOTEA_PCI_MEM_OFFSET;
203
204 pci_init_resource(&hose->io_resource,
205 OCOTEA_PCI_LOWER_IO,
206 OCOTEA_PCI_UPPER_IO,
207 IORESOURCE_IO,
208 "PCI host bridge");
209
210 pci_init_resource(&hose->mem_resources[0],
211 OCOTEA_PCI_LOWER_MEM,
212 OCOTEA_PCI_UPPER_MEM,
213 IORESOURCE_MEM,
214 "PCI host bridge");
215
216 hose->io_space.start = OCOTEA_PCI_LOWER_IO;
217 hose->io_space.end = OCOTEA_PCI_UPPER_IO;
218 hose->mem_space.start = OCOTEA_PCI_LOWER_MEM;
219 hose->mem_space.end = OCOTEA_PCI_UPPER_MEM;
220 hose->io_base_virt = ioremap64(OCOTEA_PCI_IO_BASE, OCOTEA_PCI_IO_SIZE);
221 isa_io_base = (unsigned long) hose->io_base_virt;
222
223 setup_indirect_pci(hose,
224 OCOTEA_PCI_CFGA_PLB32,
225 OCOTEA_PCI_CFGD_PLB32);
226 hose->set_cfg_type = 1;
227
228 hose->last_busno = pciauto_bus_scan(hose, hose->first_busno);
229
230 ppc_md.pci_swizzle = common_swizzle;
231 ppc_md.pci_map_irq = ocotea_map_irq;
232}
233
234
235TODC_ALLOC();
236
237static void __init
238ocotea_early_serial_map(void)
239{
240 struct uart_port port;
241
242 /* Setup ioremapped serial port access */
243 memset(&port, 0, sizeof(port));
244 port.membase = ioremap64(PPC440GX_UART0_ADDR, 8);
245 port.irq = UART0_INT;
246 port.uartclk = clocks.uart0;
247 port.regshift = 0;
248 port.iotype = UPIO_MEM;
249 port.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST;
250 port.line = 0;
251
252 if (early_serial_setup(&port) != 0) {
253 printk("Early serial init of port 0 failed\n");
254 }
255
256#if defined(CONFIG_SERIAL_TEXT_DEBUG) || defined(CONFIG_KGDB)
257 /* Configure debug serial access */
258 gen550_init(0, &port);
259
260 /* Purge TLB entry added in head_44x.S for early serial access */
261 _tlbie(UART0_IO_BASE, 0);
262#endif
263
264 port.membase = ioremap64(PPC440GX_UART1_ADDR, 8);
265 port.irq = UART1_INT;
266 port.uartclk = clocks.uart1;
267 port.line = 1;
268
269 if (early_serial_setup(&port) != 0) {
270 printk("Early serial init of port 1 failed\n");
271 }
272
273#if defined(CONFIG_SERIAL_TEXT_DEBUG) || defined(CONFIG_KGDB)
274 /* Configure debug serial access */
275 gen550_init(1, &port);
276#endif
277}
278
279static void __init
280ocotea_setup_arch(void)
281{
282 ocotea_set_emacdata();
283
284 ibm440gx_tah_enable();
285
286 /*
287 * Determine various clocks.
288 * To be completely correct we should get SysClk
289 * from FPGA, because it can be changed by on-board switches
290 * --ebs
291 */
292 ibm440gx_get_clocks(&clocks, 33300000, 6 * 1843200);
293 ocp_sys_info.opb_bus_freq = clocks.opb;
294
295 /* Setup TODC access */
296 TODC_INIT(TODC_TYPE_DS1743,
297 0,
298 0,
299 ioremap64(OCOTEA_RTC_ADDR, OCOTEA_RTC_SIZE),
300 8);
301
302 /* init to some ~sane value until calibrate_delay() runs */
303 loops_per_jiffy = 50000000/HZ;
304
305 /* Setup PCI host bridge */
306 ocotea_setup_hose();
307
308#ifdef CONFIG_BLK_DEV_INITRD
309 if (initrd_start)
310 ROOT_DEV = Root_RAM0;
311 else
312#endif
313#ifdef CONFIG_ROOT_NFS
314 ROOT_DEV = Root_NFS;
315#else
316 ROOT_DEV = Root_HDA1;
317#endif
318
319 ocotea_early_serial_map();
320
321 /* Identify the system */
322 printk("IBM Ocotea port (MontaVista Software, Inc. <source@mvista.com>)\n");
323}
324
325static void __init ocotea_init(void)
326{
327 ibm440gx_l2c_setup(&clocks);
328}
329
330void __init platform_init(unsigned long r3, unsigned long r4,
331 unsigned long r5, unsigned long r6, unsigned long r7)
332{
333 ibm440gx_platform_init(r3, r4, r5, r6, r7);
334
335 ppc_md.setup_arch = ocotea_setup_arch;
336 ppc_md.show_cpuinfo = ocotea_show_cpuinfo;
337 ppc_md.get_irq = NULL; /* Set in ppc4xx_pic_init() */
338
339 ppc_md.calibrate_decr = ocotea_calibrate_decr;
340 ppc_md.time_init = todc_time_init;
341 ppc_md.set_rtc_time = todc_set_rtc_time;
342 ppc_md.get_rtc_time = todc_get_rtc_time;
343
344 ppc_md.nvram_read_val = todc_direct_read_val;
345 ppc_md.nvram_write_val = todc_direct_write_val;
346#ifdef CONFIG_KGDB
347 ppc_md.early_serial_map = ocotea_early_serial_map;
348#endif
349 ppc_md.init = ocotea_init;
350}
diff --git a/arch/ppc/platforms/4xx/ocotea.h b/arch/ppc/platforms/4xx/ocotea.h
deleted file mode 100644
index 89730ce2322c..000000000000
--- a/arch/ppc/platforms/4xx/ocotea.h
+++ /dev/null
@@ -1,94 +0,0 @@
1/*
2 * Ocotea board definitions
3 *
4 * Matt Porter <mporter@kernel.crashing.org>
5 *
6 * Copyright 2003-2005 MontaVista Software Inc.
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
12 *
13 */
14
15#ifdef __KERNEL__
16#ifndef __ASM_OCOTEA_H__
17#define __ASM_OCOTEA_H__
18
19#include <platforms/4xx/ibm440gx.h>
20
21/* F/W TLB mapping used in bootloader glue to reset EMAC */
22#define PPC44x_EMAC0_MR0 0xe0000800
23
24/* Location of MAC addresses in PIBS image */
25#define PIBS_FLASH_BASE 0xfff00000
26#define PIBS_MAC_BASE (PIBS_FLASH_BASE+0xb0500)
27#define PIBS_MAC_SIZE 0x200
28#define PIBS_MAC_OFFSET 0x100
29
30/* External timer clock frequency */
31#define OCOTEA_TMR_CLK 25000000
32
33/* RTC/NVRAM location */
34#define OCOTEA_RTC_ADDR 0x0000000148000000ULL
35#define OCOTEA_RTC_SIZE 0x2000
36
37/* Flash */
38#define OCOTEA_FPGA_REG_0 0x0000000148300000ULL
39#define OCOTEA_BOOT_LARGE_FLASH(x) (x & 0x40)
40#define OCOTEA_SMALL_FLASH_LOW 0x00000001ff900000ULL
41#define OCOTEA_SMALL_FLASH_HIGH 0x00000001fff00000ULL
42#define OCOTEA_SMALL_FLASH_SIZE 0x100000
43#define OCOTEA_LARGE_FLASH_LOW 0x00000001ff800000ULL
44#define OCOTEA_LARGE_FLASH_HIGH 0x00000001ffc00000ULL
45#define OCOTEA_LARGE_FLASH_SIZE 0x400000
46
47/* FPGA_REG_3 (Ethernet Groups) */
48#define OCOTEA_FPGA_REG_3 0x0000000148300003ULL
49
50/*
51 * Serial port defines
52 */
53#define RS_TABLE_SIZE 2
54
55#if defined(__BOOTER__)
56/* OpenBIOS defined UART mappings, used by bootloader shim */
57#define UART0_IO_BASE 0xE0000200
58#define UART1_IO_BASE 0xE0000300
59#else
60/* head_44x.S created UART mapping, used before early_serial_setup.
61 * We cannot use default OpenBIOS UART mappings because they
62 * don't work for configurations with more than 512M RAM. --ebs
63 */
64#define UART0_IO_BASE 0xF0000200
65#define UART1_IO_BASE 0xF0000300
66#endif
67
68#define BASE_BAUD 11059200/16
69#define STD_UART_OP(num) \
70 { 0, BASE_BAUD, 0, UART##num##_INT, \
71 (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST), \
72 iomem_base: (void*)UART##num##_IO_BASE, \
73 io_type: SERIAL_IO_MEM},
74
75#define SERIAL_PORT_DFNS \
76 STD_UART_OP(0) \
77 STD_UART_OP(1)
78
79/* PCI support */
80#define OCOTEA_PCI_LOWER_IO 0x00000000
81#define OCOTEA_PCI_UPPER_IO 0x0000ffff
82#define OCOTEA_PCI_LOWER_MEM 0x80000000
83#define OCOTEA_PCI_UPPER_MEM 0xffffefff
84
85#define OCOTEA_PCI_CFGREGS_BASE 0x000000020ec00000ULL
86#define OCOTEA_PCI_CFGA_PLB32 0x0ec00000
87#define OCOTEA_PCI_CFGD_PLB32 0x0ec00004
88
89#define OCOTEA_PCI_IO_BASE 0x0000000208000000ULL
90#define OCOTEA_PCI_IO_SIZE 0x00010000
91#define OCOTEA_PCI_MEM_OFFSET 0x00000000
92
93#endif /* __ASM_OCOTEA_H__ */
94#endif /* __KERNEL__ */
diff --git a/arch/ppc/platforms/4xx/ppc440spe.c b/arch/ppc/platforms/4xx/ppc440spe.c
deleted file mode 100644
index 1be5d1c8e266..000000000000
--- a/arch/ppc/platforms/4xx/ppc440spe.c
+++ /dev/null
@@ -1,146 +0,0 @@
1/*
2 * PPC440SPe I/O descriptions
3 *
4 * Roland Dreier <rolandd@cisco.com>
5 * Copyright (c) 2005 Cisco Systems. All rights reserved.
6 *
7 * Matt Porter <mporter@kernel.crashing.org>
8 * Copyright 2002-2005 MontaVista Software Inc.
9 *
10 * Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net>
11 * Copyright (c) 2003, 2004 Zultys Technologies
12 *
13 * This program is free software; you can redistribute it and/or modify it
14 * under the terms of the GNU General Public License as published by the
15 * Free Software Foundation; either version 2 of the License, or (at your
16 * option) any later version.
17 *
18 */
19#include <linux/init.h>
20#include <linux/module.h>
21#include <platforms/4xx/ppc440spe.h>
22#include <asm/ocp.h>
23#include <asm/ppc4xx_pic.h>
24
25static struct ocp_func_emac_data ppc440spe_emac0_def = {
26 .rgmii_idx = -1, /* No RGMII */
27 .rgmii_mux = -1, /* No RGMII */
28 .zmii_idx = -1, /* No ZMII */
29 .zmii_mux = -1, /* No ZMII */
30 .mal_idx = 0, /* MAL device index */
31 .mal_rx_chan = 0, /* MAL rx channel number */
32 .mal_tx_chan = 0, /* MAL tx channel number */
33 .wol_irq = 61, /* WOL interrupt number */
34 .mdio_idx = -1, /* No shared MDIO */
35 .tah_idx = -1, /* No TAH */
36};
37OCP_SYSFS_EMAC_DATA()
38
39static struct ocp_func_mal_data ppc440spe_mal0_def = {
40 .num_tx_chans = 1, /* Number of TX channels */
41 .num_rx_chans = 1, /* Number of RX channels */
42 .txeob_irq = 38, /* TX End Of Buffer IRQ */
43 .rxeob_irq = 39, /* RX End Of Buffer IRQ */
44 .txde_irq = 34, /* TX Descriptor Error IRQ */
45 .rxde_irq = 35, /* RX Descriptor Error IRQ */
46 .serr_irq = 33, /* MAL System Error IRQ */
47 .dcr_base = DCRN_MAL_BASE /* MAL0_CFG DCR number */
48};
49OCP_SYSFS_MAL_DATA()
50
51static struct ocp_func_iic_data ppc440spe_iic0_def = {
52 .fast_mode = 0, /* Use standad mode (100Khz) */
53};
54
55static struct ocp_func_iic_data ppc440spe_iic1_def = {
56 .fast_mode = 0, /* Use standad mode (100Khz) */
57};
58OCP_SYSFS_IIC_DATA()
59
60struct ocp_def core_ocp[] = {
61 { .vendor = OCP_VENDOR_IBM,
62 .function = OCP_FUNC_16550,
63 .index = 0,
64 .paddr = PPC440SPE_UART0_ADDR,
65 .irq = UART0_INT,
66 .pm = IBM_CPM_UART0,
67 },
68 { .vendor = OCP_VENDOR_IBM,
69 .function = OCP_FUNC_16550,
70 .index = 1,
71 .paddr = PPC440SPE_UART1_ADDR,
72 .irq = UART1_INT,
73 .pm = IBM_CPM_UART1,
74 },
75 { .vendor = OCP_VENDOR_IBM,
76 .function = OCP_FUNC_16550,
77 .index = 2,
78 .paddr = PPC440SPE_UART2_ADDR,
79 .irq = UART2_INT,
80 .pm = IBM_CPM_UART2,
81 },
82 { .vendor = OCP_VENDOR_IBM,
83 .function = OCP_FUNC_IIC,
84 .index = 0,
85 .paddr = 0x00000004f0000400ULL,
86 .irq = 2,
87 .pm = IBM_CPM_IIC0,
88 .additions = &ppc440spe_iic0_def,
89 .show = &ocp_show_iic_data
90 },
91 { .vendor = OCP_VENDOR_IBM,
92 .function = OCP_FUNC_IIC,
93 .index = 1,
94 .paddr = 0x00000004f0000500ULL,
95 .irq = 3,
96 .pm = IBM_CPM_IIC1,
97 .additions = &ppc440spe_iic1_def,
98 .show = &ocp_show_iic_data
99 },
100 { .vendor = OCP_VENDOR_IBM,
101 .function = OCP_FUNC_GPIO,
102 .index = 0,
103 .paddr = 0x00000004f0000700ULL,
104 .irq = OCP_IRQ_NA,
105 .pm = IBM_CPM_GPIO0,
106 },
107 { .vendor = OCP_VENDOR_IBM,
108 .function = OCP_FUNC_MAL,
109 .paddr = OCP_PADDR_NA,
110 .irq = OCP_IRQ_NA,
111 .pm = OCP_CPM_NA,
112 .additions = &ppc440spe_mal0_def,
113 .show = &ocp_show_mal_data,
114 },
115 { .vendor = OCP_VENDOR_IBM,
116 .function = OCP_FUNC_EMAC,
117 .index = 0,
118 .paddr = 0x00000004f0000800ULL,
119 .irq = 60,
120 .pm = OCP_CPM_NA,
121 .additions = &ppc440spe_emac0_def,
122 .show = &ocp_show_emac_data,
123 },
124 { .vendor = OCP_VENDOR_INVALID
125 }
126};
127
128/* Polarity and triggering settings for internal interrupt sources */
129struct ppc4xx_uic_settings ppc4xx_core_uic_cfg[] __initdata = {
130 { .polarity = 0xffffffff,
131 .triggering = 0x010f0004,
132 .ext_irq_mask = 0x00000000,
133 },
134 { .polarity = 0xffffffff,
135 .triggering = 0x001f8040,
136 .ext_irq_mask = 0x00007c30, /* IRQ6 - IRQ7, IRQ8 - IRQ12 */
137 },
138 { .polarity = 0xffffffff,
139 .triggering = 0x00000000,
140 .ext_irq_mask = 0x000000fc, /* IRQ0 - IRQ5 */
141 },
142 { .polarity = 0xffffffff,
143 .triggering = 0x00000000,
144 .ext_irq_mask = 0x00000000,
145 },
146};
diff --git a/arch/ppc/platforms/4xx/ppc440spe.h b/arch/ppc/platforms/4xx/ppc440spe.h
deleted file mode 100644
index f1e867c4c9fc..000000000000
--- a/arch/ppc/platforms/4xx/ppc440spe.h
+++ /dev/null
@@ -1,63 +0,0 @@
1/*
2 * PPC440SPe definitions
3 *
4 * Roland Dreier <rolandd@cisco.com>
5 * Copyright (c) 2005 Cisco Systems. All rights reserved.
6 *
7 * Matt Porter <mporter@kernel.crashing.org>
8 * Copyright 2004-2005 MontaVista Software, Inc.
9 *
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the
12 * Free Software Foundation; either version 2 of the License, or (at your
13 * option) any later version.
14 */
15
16#ifdef __KERNEL__
17#ifndef __PPC_PLATFORMS_PPC440SPE_H
18#define __PPC_PLATFORMS_PPC440SPE_H
19
20
21#include <asm/ibm44x.h>
22
23/* UART */
24#define PPC440SPE_UART0_ADDR 0x00000004f0000200ULL
25#define PPC440SPE_UART1_ADDR 0x00000004f0000300ULL
26#define PPC440SPE_UART2_ADDR 0x00000004f0000600ULL
27#define UART0_INT 0
28#define UART1_INT 1
29#define UART2_INT 37
30
31/* Clock and Power Management */
32#define IBM_CPM_IIC0 0x80000000 /* IIC interface */
33#define IBM_CPM_IIC1 0x40000000 /* IIC interface */
34#define IBM_CPM_PCI 0x20000000 /* PCI bridge */
35#define IBM_CPM_CPU 0x02000000 /* processor core */
36#define IBM_CPM_DMA 0x01000000 /* DMA controller */
37#define IBM_CPM_BGO 0x00800000 /* PLB to OPB bus arbiter */
38#define IBM_CPM_BGI 0x00400000 /* OPB to PLB bridge */
39#define IBM_CPM_EBC 0x00200000 /* External Bux Controller */
40#define IBM_CPM_EBM 0x00100000 /* Ext Bus Master Interface */
41#define IBM_CPM_DMC 0x00080000 /* SDRAM peripheral controller */
42#define IBM_CPM_PLB 0x00040000 /* PLB bus arbiter */
43#define IBM_CPM_SRAM 0x00020000 /* SRAM memory controller */
44#define IBM_CPM_PPM 0x00002000 /* PLB Performance Monitor */
45#define IBM_CPM_UIC1 0x00001000 /* Universal Interrupt Controller */
46#define IBM_CPM_GPIO0 0x00000800 /* General Purpose IO (??) */
47#define IBM_CPM_GPT 0x00000400 /* General Purpose Timers */
48#define IBM_CPM_UART0 0x00000200 /* serial port 0 */
49#define IBM_CPM_UART1 0x00000100 /* serial port 1 */
50#define IBM_CPM_UART2 0x00000100 /* serial port 1 */
51#define IBM_CPM_UIC0 0x00000080 /* Universal Interrupt Controller */
52#define IBM_CPM_TMRCLK 0x00000040 /* CPU timers */
53#define IBM_CPM_EMAC0 0x00000020 /* EMAC 0 */
54
55#define DFLT_IBM4xx_PM ~(IBM_CPM_UIC | IBM_CPM_UIC1 | IBM_CPM_CPU \
56 | IBM_CPM_EBC | IBM_CPM_SRAM | IBM_CPM_BGO \
57 | IBM_CPM_EBM | IBM_CPM_PLB | IBM_CPM_OPB \
58 | IBM_CPM_TMRCLK | IBM_CPM_DMA | IBM_CPM_PCI \
59 | IBM_CPM_TAHOE0 | IBM_CPM_TAHOE1 \
60 | IBM_CPM_EMAC0 | IBM_CPM_EMAC1 \
61 | IBM_CPM_EMAC2 | IBM_CPM_EMAC3 )
62#endif /* __PPC_PLATFORMS_PPC440SP_H */
63#endif /* __KERNEL__ */
diff --git a/arch/ppc/platforms/4xx/redwood5.c b/arch/ppc/platforms/4xx/redwood5.c
deleted file mode 100644
index edf4d37d1a52..000000000000
--- a/arch/ppc/platforms/4xx/redwood5.c
+++ /dev/null
@@ -1,120 +0,0 @@
1/*
2 * Support for the IBM redwood5 eval board file
3 *
4 * Author: Armin Kuster <akuster@mvista.com>
5 *
6 * 2000-2001 (c) MontaVista, Software, Inc. This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10 */
11
12#include <linux/init.h>
13#include <linux/pagemap.h>
14#include <linux/platform_device.h>
15#include <linux/ioport.h>
16#include <asm/io.h>
17#include <asm/machdep.h>
18#include <asm/ppc4xx_pic.h>
19
20/*
21 * Define external IRQ senses and polarities.
22 */
23unsigned char ppc4xx_uic_ext_irq_cfg[] __initdata = {
24 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 0 */
25 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 1 */
26 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 2 */
27 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 3 */
28 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 4 */
29 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 5 */
30};
31
32static struct resource smc91x_resources[] = {
33 [0] = {
34 .start = SMC91111_BASE_ADDR,
35 .end = SMC91111_BASE_ADDR + SMC91111_REG_SIZE - 1,
36 .flags = IORESOURCE_MEM,
37 },
38 [1] = {
39 .start = SMC91111_IRQ,
40 .end = SMC91111_IRQ,
41 .flags = IORESOURCE_IRQ,
42 },
43};
44
45static struct platform_device smc91x_device = {
46 .name = "smc91x",
47 .id = 0,
48 .num_resources = ARRAY_SIZE(smc91x_resources),
49 .resource = smc91x_resources,
50};
51
52static struct platform_device *redwood5_devs[] __initdata = {
53 &smc91x_device,
54};
55
56static int __init
57redwood5_platform_add_devices(void)
58{
59 return platform_add_devices(redwood5_devs, ARRAY_SIZE(redwood5_devs));
60}
61
62void __init
63redwood5_setup_arch(void)
64{
65 ppc4xx_setup_arch();
66
67#ifdef CONFIG_DEBUG_BRINGUP
68 printk("\n");
69 printk("machine\t: %s\n", PPC4xx_MACHINE_NAME);
70 printk("\n");
71 printk("bi_s_version\t %s\n", bip->bi_s_version);
72 printk("bi_r_version\t %s\n", bip->bi_r_version);
73 printk("bi_memsize\t 0x%8.8x\t %dMBytes\n", bip->bi_memsize,bip->bi_memsize/(1024*1000));
74 printk("bi_enetaddr %d\t %2.2x%2.2x%2.2x-%2.2x%2.2x%2.2x\n", 0,
75 bip->bi_enetaddr[0], bip->bi_enetaddr[1],
76 bip->bi_enetaddr[2], bip->bi_enetaddr[3],
77 bip->bi_enetaddr[4], bip->bi_enetaddr[5]);
78
79 printk("bi_intfreq\t 0x%8.8x\t clock:\t %dMhz\n",
80 bip->bi_intfreq, bip->bi_intfreq/ 1000000);
81
82 printk("bi_busfreq\t 0x%8.8x\t plb bus clock:\t %dMHz\n",
83 bip->bi_busfreq, bip->bi_busfreq / 1000000 );
84 printk("bi_tbfreq\t 0x%8.8x\t TB freq:\t %dMHz\n",
85 bip->bi_tbfreq, bip->bi_tbfreq/1000000);
86
87 printk("\n");
88#endif
89 device_initcall(redwood5_platform_add_devices);
90}
91
92void __init
93redwood5_map_io(void)
94{
95 int i;
96
97 ppc4xx_map_io();
98 for (i = 0; i < 16; i++) {
99 unsigned long v, p;
100
101 /* 0x400x0000 -> 0xe00x0000 */
102 p = 0x40000000 | (i << 16);
103 v = STB04xxx_IO_BASE | (i << 16);
104
105 io_block_mapping(v, p, PAGE_SIZE,
106 _PAGE_NO_CACHE | pgprot_val(PAGE_KERNEL) | _PAGE_GUARDED);
107 }
108
109
110}
111
112void __init
113platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
114 unsigned long r6, unsigned long r7)
115{
116 ppc4xx_init(r3, r4, r5, r6, r7);
117
118 ppc_md.setup_arch = redwood5_setup_arch;
119 ppc_md.setup_io_mappings = redwood5_map_io;
120}
diff --git a/arch/ppc/platforms/4xx/redwood5.h b/arch/ppc/platforms/4xx/redwood5.h
deleted file mode 100644
index 49edd4818970..000000000000
--- a/arch/ppc/platforms/4xx/redwood5.h
+++ /dev/null
@@ -1,52 +0,0 @@
1/*
2 * Macros, definitions, and data structures specific to the IBM PowerPC
3 * STB03xxx "Redwood" evaluation board.
4 *
5 * Author: Armin Kuster <akuster@mvista.com>
6 *
7 * 2001 (c) MontaVista, Software, Inc. This file is licensed under
8 * the terms of the GNU General Public License version 2. This program
9 * is licensed "as is" without any warranty of any kind, whether express
10 * or implied.
11 */
12
13#ifdef __KERNEL__
14#ifndef __ASM_REDWOOD5_H__
15#define __ASM_REDWOOD5_H__
16
17/* Redwood5 has an STB04xxx core */
18#include <platforms/4xx/ibmstb4.h>
19
20#ifndef __ASSEMBLY__
21typedef struct board_info {
22 unsigned char bi_s_version[4]; /* Version of this structure */
23 unsigned char bi_r_version[30]; /* Version of the IBM ROM */
24 unsigned int bi_memsize; /* DRAM installed, in bytes */
25 unsigned int bi_dummy; /* field shouldn't exist */
26 unsigned char bi_enetaddr[6]; /* Ethernet MAC address */
27 unsigned int bi_intfreq; /* Processor speed, in Hz */
28 unsigned int bi_busfreq; /* Bus speed, in Hz */
29 unsigned int bi_tbfreq; /* Software timebase freq */
30} bd_t;
31#endif /* !__ASSEMBLY__ */
32
33
34#define SMC91111_BASE_ADDR 0xf2000300
35#define SMC91111_REG_SIZE 16
36#define SMC91111_IRQ 28
37
38#ifdef MAX_HWIFS
39#undef MAX_HWIFS
40#endif
41#define MAX_HWIFS 1
42
43#define _IO_BASE 0
44#define _ISA_MEM_BASE 0
45#define PCI_DRAM_OFFSET 0
46
47#define BASE_BAUD (378000000 / 18 / 16)
48
49#define PPC4xx_MACHINE_NAME "IBM Redwood5"
50
51#endif /* __ASM_REDWOOD5_H__ */
52#endif /* __KERNEL__ */
diff --git a/arch/ppc/platforms/4xx/redwood6.c b/arch/ppc/platforms/4xx/redwood6.c
deleted file mode 100644
index 006e29f83a1a..000000000000
--- a/arch/ppc/platforms/4xx/redwood6.c
+++ /dev/null
@@ -1,156 +0,0 @@
1/*
2 * Author: Armin Kuster <akuster@mvista.com>
3 *
4 * 2002 (c) MontaVista, Software, Inc. This file is licensed under
5 * the terms of the GNU General Public License version 2. This program
6 * is licensed "as is" without any warranty of any kind, whether express
7 * or implied.
8 */
9
10#include <linux/init.h>
11#include <linux/pagemap.h>
12#include <linux/platform_device.h>
13#include <linux/ioport.h>
14#include <asm/io.h>
15#include <asm/ppc4xx_pic.h>
16#include <linux/delay.h>
17#include <asm/machdep.h>
18
19/*
20 * Define external IRQ senses and polarities.
21 */
22unsigned char ppc4xx_uic_ext_irq_cfg[] __initdata = {
23 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 7 */
24 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 8 */
25 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 9 */
26 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 0 */
27 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 1 */
28 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 2 */
29 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 3 */
30 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 4 */
31 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 5 */
32 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 6 */
33};
34
35static struct resource smc91x_resources[] = {
36 [0] = {
37 .start = SMC91111_BASE_ADDR,
38 .end = SMC91111_BASE_ADDR + SMC91111_REG_SIZE - 1,
39 .flags = IORESOURCE_MEM,
40 },
41 [1] = {
42 .start = SMC91111_IRQ,
43 .end = SMC91111_IRQ,
44 .flags = IORESOURCE_IRQ,
45 },
46};
47
48static struct platform_device smc91x_device = {
49 .name = "smc91x",
50 .id = 0,
51 .num_resources = ARRAY_SIZE(smc91x_resources),
52 .resource = smc91x_resources,
53};
54
55static struct platform_device *redwood6_devs[] __initdata = {
56 &smc91x_device,
57};
58
59static int __init
60redwood6_platform_add_devices(void)
61{
62 return platform_add_devices(redwood6_devs, ARRAY_SIZE(redwood6_devs));
63}
64
65
66void __init
67redwood6_setup_arch(void)
68{
69#ifdef CONFIG_IDE
70 void *xilinx, *xilinx_1, *xilinx_2;
71 unsigned short us_reg5;
72#endif
73
74 ppc4xx_setup_arch();
75
76#ifdef CONFIG_IDE
77 xilinx = (unsigned long) ioremap(IDE_XLINUX_MUX_BASE, 0x10);
78 /* init xilinx control registers - enable ide mux, clear reset bit */
79 if (!xilinx) {
80 printk(KERN_CRIT
81 "redwood6_setup_arch() xilinxi ioremap failed\n");
82 return;
83 }
84 xilinx_1 = xilinx + 0xa;
85 xilinx_2 = xilinx + 0xe;
86
87 us_reg5 = readb(xilinx_1);
88 writeb(0x01d1, xilinx_1);
89 writeb(0x0008, xilinx_2);
90
91 udelay(10 * 1000);
92
93 writeb(0x01d1, xilinx_1);
94 writeb(0x0008, xilinx_2);
95#endif
96
97#ifdef DEBUG_BRINGUP
98 bd_t *bip = (bd_t *) __res;
99 printk("\n");
100 printk("machine\t: %s\n", PPC4xx_MACHINE_NAME);
101 printk("\n");
102 printk("bi_s_version\t %s\n", bip->bi_s_version);
103 printk("bi_r_version\t %s\n", bip->bi_r_version);
104 printk("bi_memsize\t 0x%8.8x\t %dMBytes\n", bip->bi_memsize,
105 bip->bi_memsize / (1024 * 1000));
106 printk("bi_enetaddr %d\t %2.2x%2.2x%2.2x-%2.2x%2.2x%2.2x\n", 0,
107 bip->bi_enetaddr[0], bip->bi_enetaddr[1], bip->bi_enetaddr[2],
108 bip->bi_enetaddr[3], bip->bi_enetaddr[4], bip->bi_enetaddr[5]);
109
110 printk("bi_intfreq\t 0x%8.8x\t clock:\t %dMhz\n",
111 bip->bi_intfreq, bip->bi_intfreq / 1000000);
112
113 printk("bi_busfreq\t 0x%8.8x\t plb bus clock:\t %dMHz\n",
114 bip->bi_busfreq, bip->bi_busfreq / 1000000);
115 printk("bi_tbfreq\t 0x%8.8x\t TB freq:\t %dMHz\n",
116 bip->bi_tbfreq, bip->bi_tbfreq / 1000000);
117
118 printk("\n");
119#endif
120
121 /* Identify the system */
122 printk(KERN_INFO "IBM Redwood6 (STBx25XX) Platform\n");
123 printk(KERN_INFO
124 "Port by MontaVista Software, Inc. (source@mvista.com)\n");
125
126 device_initcall(redwood6_platform_add_devices);
127}
128
129void __init
130redwood6_map_io(void)
131{
132 int i;
133
134 ppc4xx_map_io();
135 for (i = 0; i < 16; i++) {
136 unsigned long v, p;
137
138 /* 0x400x0000 -> 0xe00x0000 */
139 p = 0x40000000 | (i << 16);
140 v = STBx25xx_IO_BASE | (i << 16);
141
142 io_block_mapping(v, p, PAGE_SIZE,
143 _PAGE_NO_CACHE | pgprot_val(PAGE_KERNEL) |
144 _PAGE_GUARDED);
145 }
146}
147
148void __init
149platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
150 unsigned long r6, unsigned long r7)
151{
152 ppc4xx_init(r3, r4, r5, r6, r7);
153
154 ppc_md.setup_arch = redwood6_setup_arch;
155 ppc_md.setup_io_mappings = redwood6_map_io;
156}
diff --git a/arch/ppc/platforms/4xx/redwood6.h b/arch/ppc/platforms/4xx/redwood6.h
deleted file mode 100644
index 1edcbe5c51c7..000000000000
--- a/arch/ppc/platforms/4xx/redwood6.h
+++ /dev/null
@@ -1,53 +0,0 @@
1/*
2 * Macros, definitions, and data structures specific to the IBM PowerPC
3 * STBx25xx "Redwood6" evaluation board.
4 *
5 * Author: Armin Kuster <akuster@mvista.com>
6 *
7 * 2002 (c) MontaVista, Software, Inc. This file is licensed under
8 * the terms of the GNU General Public License version 2. This program
9 * is licensed "as is" without any warranty of any kind, whether express
10 * or implied.
11 */
12
13#ifdef __KERNEL__
14#ifndef __ASM_REDWOOD5_H__
15#define __ASM_REDWOOD5_H__
16
17/* Redwood6 has an STBx25xx core */
18#include <platforms/4xx/ibmstbx25.h>
19
20#ifndef __ASSEMBLY__
21typedef struct board_info {
22 unsigned char bi_s_version[4]; /* Version of this structure */
23 unsigned char bi_r_version[30]; /* Version of the IBM ROM */
24 unsigned int bi_memsize; /* DRAM installed, in bytes */
25 unsigned int bi_dummy; /* field shouldn't exist */
26 unsigned char bi_enetaddr[6]; /* Ethernet MAC address */
27 unsigned int bi_intfreq; /* Processor speed, in Hz */
28 unsigned int bi_busfreq; /* Bus speed, in Hz */
29 unsigned int bi_tbfreq; /* Software timebase freq */
30} bd_t;
31#endif /* !__ASSEMBLY__ */
32
33#define SMC91111_BASE_ADDR 0xf2030300
34#define SMC91111_REG_SIZE 16
35#define SMC91111_IRQ 27
36#define IDE_XLINUX_MUX_BASE 0xf2040000
37#define IDE_DMA_ADDR 0xfce00000
38
39#ifdef MAX_HWIFS
40#undef MAX_HWIFS
41#endif
42#define MAX_HWIFS 1
43
44#define _IO_BASE 0
45#define _ISA_MEM_BASE 0
46#define PCI_DRAM_OFFSET 0
47
48#define BASE_BAUD (378000000 / 18 / 16)
49
50#define PPC4xx_MACHINE_NAME "IBM Redwood6"
51
52#endif /* __ASM_REDWOOD5_H__ */
53#endif /* __KERNEL__ */
diff --git a/arch/ppc/platforms/4xx/sycamore.c b/arch/ppc/platforms/4xx/sycamore.c
deleted file mode 100644
index 8689f3e8ef3a..000000000000
--- a/arch/ppc/platforms/4xx/sycamore.c
+++ /dev/null
@@ -1,272 +0,0 @@
1/*
2 * Architecture- / platform-specific boot-time initialization code for
3 * IBM PowerPC 4xx based boards.
4 *
5 * Author: Armin Kuster <akuster@mvista.com>
6 *
7 * 2000-2002 (c) MontaVista, Software, Inc. This file is licensed under
8 * the terms of the GNU General Public License version 2. This program
9 * is licensed "as is" without any warranty of any kind, whether express
10 * or implied.
11 */
12#include <linux/init.h>
13#include <linux/smp.h>
14#include <linux/threads.h>
15#include <linux/param.h>
16#include <linux/string.h>
17#include <linux/pci.h>
18#include <linux/rtc.h>
19
20#include <asm/ocp.h>
21#include <asm/ppc4xx_pic.h>
22#include <asm/system.h>
23#include <asm/pci-bridge.h>
24#include <asm/machdep.h>
25#include <asm/page.h>
26#include <asm/time.h>
27#include <asm/io.h>
28#include <asm/ibm_ocp_pci.h>
29#include <asm/todc.h>
30
31#undef DEBUG
32
33#ifdef DEBUG
34#define DBG(x...) printk(x)
35#else
36#define DBG(x...)
37#endif
38
39void *kb_cs;
40void *kb_data;
41void *sycamore_rtc_base;
42
43/*
44 * Define external IRQ senses and polarities.
45 */
46unsigned char ppc4xx_uic_ext_irq_cfg[] __initdata = {
47 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 7 */
48 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 8 */
49 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 9 */
50 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 10 */
51 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 11 */
52 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 12 */
53 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 0 */
54 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 1 */
55 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 2 */
56 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 3 */
57 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 4 */
58 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 5 */
59 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 6 */
60};
61
62
63/* Some IRQs unique to Sycamore.
64 * Used by the generic 405 PCI setup functions in ppc4xx_pci.c
65 */
66int __init
67ppc405_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
68{
69 static char pci_irq_table[][4] =
70 /*
71 * PCI IDSEL/INTPIN->INTLINE
72 * A B C D
73 */
74 {
75 {28, 28, 28, 28}, /* IDSEL 1 - PCI slot 1 */
76 {29, 29, 29, 29}, /* IDSEL 2 - PCI slot 2 */
77 {30, 30, 30, 30}, /* IDSEL 3 - PCI slot 3 */
78 {31, 31, 31, 31}, /* IDSEL 4 - PCI slot 4 */
79 };
80
81 const long min_idsel = 1, max_idsel = 4, irqs_per_slot = 4;
82 return PCI_IRQ_TABLE_LOOKUP;
83};
84
85void __init
86sycamore_setup_arch(void)
87{
88 void *fpga_brdc;
89 unsigned char fpga_brdc_data;
90 void *fpga_enable;
91 void *fpga_polarity;
92 void *fpga_status;
93 void *fpga_trigger;
94
95 ppc4xx_setup_arch();
96
97 ibm_ocp_set_emac(0, 0);
98
99 kb_data = ioremap(SYCAMORE_PS2_BASE, 8);
100 if (!kb_data) {
101 printk(KERN_CRIT
102 "sycamore_setup_arch() kb_data ioremap failed\n");
103 return;
104 }
105
106 kb_cs = kb_data + 1;
107
108 fpga_status = ioremap(PPC40x_FPGA_BASE, 8);
109 if (!fpga_status) {
110 printk(KERN_CRIT
111 "sycamore_setup_arch() fpga_status ioremap failed\n");
112 return;
113 }
114
115 fpga_enable = fpga_status + 1;
116 fpga_polarity = fpga_status + 2;
117 fpga_trigger = fpga_status + 3;
118 fpga_brdc = fpga_status + 4;
119
120 /* split the keyboard and mouse interrupts */
121 fpga_brdc_data = readb(fpga_brdc);
122 fpga_brdc_data |= 0x80;
123 writeb(fpga_brdc_data, fpga_brdc);
124
125 writeb(0x3, fpga_enable);
126
127 writeb(0x3, fpga_polarity);
128
129 writeb(0x3, fpga_trigger);
130
131 /* RTC step for the sycamore */
132 sycamore_rtc_base = (void *) SYCAMORE_RTC_VADDR;
133 TODC_INIT(TODC_TYPE_DS1743, sycamore_rtc_base, sycamore_rtc_base,
134 sycamore_rtc_base, 8);
135
136 /* Identify the system */
137 printk(KERN_INFO "IBM Sycamore (IBM405GPr) Platform\n");
138 printk(KERN_INFO
139 "Port by MontaVista Software, Inc. (source@mvista.com)\n");
140}
141
142void __init
143bios_fixup(struct pci_controller *hose, struct pcil0_regs *pcip)
144{
145#ifdef CONFIG_PCI
146 unsigned int bar_response, bar;
147 /*
148 * Expected PCI mapping:
149 *
150 * PLB addr PCI memory addr
151 * --------------------- ---------------------
152 * 0000'0000 - 7fff'ffff <--- 0000'0000 - 7fff'ffff
153 * 8000'0000 - Bfff'ffff ---> 8000'0000 - Bfff'ffff
154 *
155 * PLB addr PCI io addr
156 * --------------------- ---------------------
157 * e800'0000 - e800'ffff ---> 0000'0000 - 0001'0000
158 *
159 * The following code is simplified by assuming that the bootrom
160 * has been well behaved in following this mapping.
161 */
162
163#ifdef DEBUG
164 int i;
165
166 printk("ioremap PCLIO_BASE = 0x%x\n", pcip);
167 printk("PCI bridge regs before fixup \n");
168 for (i = 0; i <= 3; i++) {
169 printk(" pmm%dma\t0x%x\n", i, in_le32(&(pcip->pmm[i].ma)));
170 printk(" pmm%dma\t0x%x\n", i, in_le32(&(pcip->pmm[i].la)));
171 printk(" pmm%dma\t0x%x\n", i, in_le32(&(pcip->pmm[i].pcila)));
172 printk(" pmm%dma\t0x%x\n", i, in_le32(&(pcip->pmm[i].pciha)));
173 }
174 printk(" ptm1ms\t0x%x\n", in_le32(&(pcip->ptm1ms)));
175 printk(" ptm1la\t0x%x\n", in_le32(&(pcip->ptm1la)));
176 printk(" ptm2ms\t0x%x\n", in_le32(&(pcip->ptm2ms)));
177 printk(" ptm2la\t0x%x\n", in_le32(&(pcip->ptm2la)));
178
179#endif
180
181 /* added for IBM boot rom version 1.15 bios bar changes -AK */
182
183 /* Disable region first */
184 out_le32((void *) &(pcip->pmm[0].ma), 0x00000000);
185 /* PLB starting addr, PCI: 0x80000000 */
186 out_le32((void *) &(pcip->pmm[0].la), 0x80000000);
187 /* PCI start addr, 0x80000000 */
188 out_le32((void *) &(pcip->pmm[0].pcila), PPC405_PCI_MEM_BASE);
189 /* 512MB range of PLB to PCI */
190 out_le32((void *) &(pcip->pmm[0].pciha), 0x00000000);
191 /* Enable no pre-fetch, enable region */
192 out_le32((void *) &(pcip->pmm[0].ma), ((0xffffffff -
193 (PPC405_PCI_UPPER_MEM -
194 PPC405_PCI_MEM_BASE)) | 0x01));
195
196 /* Enable inbound region one - 1GB size */
197 out_le32((void *) &(pcip->ptm1ms), 0xc0000001);
198
199 /* Disable outbound region one */
200 out_le32((void *) &(pcip->pmm[1].ma), 0x00000000);
201 out_le32((void *) &(pcip->pmm[1].la), 0x00000000);
202 out_le32((void *) &(pcip->pmm[1].pcila), 0x00000000);
203 out_le32((void *) &(pcip->pmm[1].pciha), 0x00000000);
204 out_le32((void *) &(pcip->pmm[1].ma), 0x00000000);
205
206 /* Disable inbound region two */
207 out_le32((void *) &(pcip->ptm2ms), 0x00000000);
208
209 /* Disable outbound region two */
210 out_le32((void *) &(pcip->pmm[2].ma), 0x00000000);
211 out_le32((void *) &(pcip->pmm[2].la), 0x00000000);
212 out_le32((void *) &(pcip->pmm[2].pcila), 0x00000000);
213 out_le32((void *) &(pcip->pmm[2].pciha), 0x00000000);
214 out_le32((void *) &(pcip->pmm[2].ma), 0x00000000);
215
216 /* Zero config bars */
217 for (bar = PCI_BASE_ADDRESS_1; bar <= PCI_BASE_ADDRESS_2; bar += 4) {
218 early_write_config_dword(hose, hose->first_busno,
219 PCI_FUNC(hose->first_busno), bar,
220 0x00000000);
221 early_read_config_dword(hose, hose->first_busno,
222 PCI_FUNC(hose->first_busno), bar,
223 &bar_response);
224 DBG("BUS %d, device %d, Function %d bar 0x%8.8x is 0x%8.8x\n",
225 hose->first_busno, PCI_SLOT(hose->first_busno),
226 PCI_FUNC(hose->first_busno), bar, bar_response);
227 }
228 /* end workaround */
229
230#ifdef DEBUG
231 printk("PCI bridge regs after fixup \n");
232 for (i = 0; i <= 3; i++) {
233 printk(" pmm%dma\t0x%x\n", i, in_le32(&(pcip->pmm[i].ma)));
234 printk(" pmm%dma\t0x%x\n", i, in_le32(&(pcip->pmm[i].la)));
235 printk(" pmm%dma\t0x%x\n", i, in_le32(&(pcip->pmm[i].pcila)));
236 printk(" pmm%dma\t0x%x\n", i, in_le32(&(pcip->pmm[i].pciha)));
237 }
238 printk(" ptm1ms\t0x%x\n", in_le32(&(pcip->ptm1ms)));
239 printk(" ptm1la\t0x%x\n", in_le32(&(pcip->ptm1la)));
240 printk(" ptm2ms\t0x%x\n", in_le32(&(pcip->ptm2ms)));
241 printk(" ptm2la\t0x%x\n", in_le32(&(pcip->ptm2la)));
242
243#endif
244#endif
245
246}
247
248void __init
249sycamore_map_io(void)
250{
251 ppc4xx_map_io();
252 io_block_mapping(SYCAMORE_RTC_VADDR,
253 SYCAMORE_RTC_PADDR, SYCAMORE_RTC_SIZE, _PAGE_IO);
254}
255
256void __init
257platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
258 unsigned long r6, unsigned long r7)
259{
260 ppc4xx_init(r3, r4, r5, r6, r7);
261
262 ppc_md.setup_arch = sycamore_setup_arch;
263 ppc_md.setup_io_mappings = sycamore_map_io;
264
265#ifdef CONFIG_GEN_RTC
266 ppc_md.time_init = todc_time_init;
267 ppc_md.set_rtc_time = todc_set_rtc_time;
268 ppc_md.get_rtc_time = todc_get_rtc_time;
269 ppc_md.nvram_read_val = todc_direct_read_val;
270 ppc_md.nvram_write_val = todc_direct_write_val;
271#endif
272}
diff --git a/arch/ppc/platforms/4xx/sycamore.h b/arch/ppc/platforms/4xx/sycamore.h
deleted file mode 100644
index 69b169eac053..000000000000
--- a/arch/ppc/platforms/4xx/sycamore.h
+++ /dev/null
@@ -1,49 +0,0 @@
1/*
2 * Sycamore board definitions
3 *
4 * Copyright (c) 2005 DENX Software Engineering
5 * Stefan Roese <sr@denx.de>
6 *
7 * Based on original work by
8 * Armin Kuster <akuster@mvista.com>
9 * 2000 (c) MontaVista, Software, Inc.
10 *
11 * This program is free software; you can redistribute it and/or modify it
12 * under the terms of the GNU General Public License as published by the
13 * Free Software Foundation; either version 2 of the License, or (at your
14 * option) any later version.
15 *
16 */
17
18#ifdef __KERNEL__
19#ifndef __ASM_SYCAMORE_H__
20#define __ASM_SYCAMORE_H__
21
22#include <platforms/4xx/ibm405gpr.h>
23#include <asm/ppcboot.h>
24
25/* Memory map for the IBM "Sycamore" 405GPr evaluation board.
26 * Generic 4xx plus RTC.
27 */
28
29#define SYCAMORE_RTC_PADDR ((uint)0xf0000000)
30#define SYCAMORE_RTC_VADDR SYCAMORE_RTC_PADDR
31#define SYCAMORE_RTC_SIZE ((uint)8*1024)
32
33#define BASE_BAUD 691200
34
35#define SYCAMORE_PS2_BASE 0xF0100000
36
37/* Flash */
38#define PPC40x_FPGA_BASE 0xF0300000
39#define PPC40x_FPGA_REG_OFFS 5 /* offset to flash map reg */
40#define PPC40x_FLASH_ONBD_N(x) (x & 0x02)
41#define PPC40x_FLASH_SRAM_SEL(x) (x & 0x01)
42#define PPC40x_FLASH_LOW 0xFFF00000
43#define PPC40x_FLASH_HIGH 0xFFF80000
44#define PPC40x_FLASH_SIZE 0x80000
45
46#define PPC4xx_MACHINE_NAME "IBM Sycamore"
47
48#endif /* __ASM_SYCAMORE_H__ */
49#endif /* __KERNEL__ */
diff --git a/arch/ppc/platforms/4xx/taishan.c b/arch/ppc/platforms/4xx/taishan.c
deleted file mode 100644
index 115694275083..000000000000
--- a/arch/ppc/platforms/4xx/taishan.c
+++ /dev/null
@@ -1,395 +0,0 @@
1/*
2 * arch/ppc/platforms/4xx/taishan.c
3 *
4 * AMCC Taishan board specific routines
5 *
6 * Copyright 2007 DENX Software Engineering, Stefan Roese <sr@denx.de>
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
12 */
13
14#include <linux/stddef.h>
15#include <linux/kernel.h>
16#include <linux/init.h>
17#include <linux/errno.h>
18#include <linux/reboot.h>
19#include <linux/pci.h>
20#include <linux/kdev_t.h>
21#include <linux/types.h>
22#include <linux/major.h>
23#include <linux/blkdev.h>
24#include <linux/console.h>
25#include <linux/delay.h>
26#include <linux/initrd.h>
27#include <linux/seq_file.h>
28#include <linux/root_dev.h>
29#include <linux/tty.h>
30#include <linux/serial.h>
31#include <linux/serial_core.h>
32#include <linux/serial_8250.h>
33#include <linux/platform_device.h>
34#include <linux/mtd/partitions.h>
35#include <linux/mtd/nand.h>
36#include <linux/mtd/ndfc.h>
37#include <linux/mtd/physmap.h>
38
39#include <asm/machdep.h>
40#include <asm/ocp.h>
41#include <asm/bootinfo.h>
42#include <asm/ppcboot.h>
43
44#include <syslib/gen550.h>
45#include <syslib/ibm440gx_common.h>
46
47extern bd_t __res;
48
49static struct ibm44x_clocks clocks __initdata;
50
51/*
52 * NOR FLASH configuration (using mtd physmap driver)
53 */
54
55/* start will be added dynamically, end is always fixed */
56static struct resource taishan_nor_resource = {
57 .start = TAISHAN_FLASH_ADDR,
58 .end = 0x1ffffffffULL,
59 .flags = IORESOURCE_MEM,
60};
61
62#define RW_PART0_OF 0
63#define RW_PART0_SZ 0x180000
64#define RW_PART1_SZ 0x200000
65/* Partition 2 will be autosized dynamically... */
66#define RW_PART3_SZ 0x80000
67#define RW_PART4_SZ 0x40000
68
69static struct mtd_partition taishan_nor_parts[] = {
70 {
71 .name = "kernel",
72 .offset = 0,
73 .size = RW_PART0_SZ
74 },
75 {
76 .name = "root",
77 .offset = MTDPART_OFS_APPEND,
78 .size = RW_PART1_SZ,
79 },
80 {
81 .name = "user",
82 .offset = MTDPART_OFS_APPEND,
83/* .size = RW_PART2_SZ */ /* will be adjusted dynamically */
84 },
85 {
86 .name = "env",
87 .offset = MTDPART_OFS_APPEND,
88 .size = RW_PART3_SZ,
89 },
90 {
91 .name = "u-boot",
92 .offset = MTDPART_OFS_APPEND,
93 .size = RW_PART4_SZ,
94 }
95};
96
97static struct physmap_flash_data taishan_nor_data = {
98 .width = 4,
99 .parts = taishan_nor_parts,
100 .nr_parts = ARRAY_SIZE(taishan_nor_parts),
101};
102
103static struct platform_device taishan_nor_device = {
104 .name = "physmap-flash",
105 .id = 0,
106 .dev = {
107 .platform_data = &taishan_nor_data,
108 },
109 .num_resources = 1,
110 .resource = &taishan_nor_resource,
111};
112
113static int taishan_setup_flash(void)
114{
115 /*
116 * Adjust partition 2 to flash size
117 */
118 taishan_nor_parts[2].size = __res.bi_flashsize -
119 RW_PART0_SZ - RW_PART1_SZ - RW_PART3_SZ - RW_PART4_SZ;
120
121 platform_device_register(&taishan_nor_device);
122
123 return 0;
124}
125arch_initcall(taishan_setup_flash);
126
127static void __init
128taishan_calibrate_decr(void)
129{
130 unsigned int freq;
131
132 if (mfspr(SPRN_CCR1) & CCR1_TCS)
133 freq = TAISHAN_TMR_CLK;
134 else
135 freq = clocks.cpu;
136
137 ibm44x_calibrate_decr(freq);
138}
139
140static int
141taishan_show_cpuinfo(struct seq_file *m)
142{
143 seq_printf(m, "vendor\t\t: AMCC\n");
144 seq_printf(m, "machine\t\t: PPC440GX EVB (Taishan)\n");
145 ibm440gx_show_cpuinfo(m);
146 return 0;
147}
148
149static inline int
150taishan_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
151{
152 static char pci_irq_table[][4] =
153 /*
154 * PCI IDSEL/INTPIN->INTLINE
155 * A B C D
156 */
157 {
158 { 23, 24, 25, 26 }, /* IDSEL 1 - PCI Slot 0 */
159 { 24, 25, 26, 23 }, /* IDSEL 2 - PCI Slot 1 */
160 };
161
162 const long min_idsel = 1, max_idsel = 2, irqs_per_slot = 4;
163 return PCI_IRQ_TABLE_LOOKUP;
164}
165
166static void __init taishan_set_emacdata(void)
167{
168 struct ocp_def *def;
169 struct ocp_func_emac_data *emacdata;
170 int i;
171
172 /* Set phy_map, phy_mode, and mac_addr for each EMAC */
173 for (i=2; i<4; i++) {
174 def = ocp_get_one_device(OCP_VENDOR_IBM, OCP_FUNC_EMAC, i);
175 emacdata = def->additions;
176 if (i < 2) {
177 emacdata->phy_map = 0x00000001; /* Skip 0x00 */
178 emacdata->phy_mode = PHY_MODE_SMII;
179 } else {
180 emacdata->phy_map = 0x00000001; /* Skip 0x00 */
181 emacdata->phy_mode = PHY_MODE_RGMII;
182 }
183 if (i == 0)
184 memcpy(emacdata->mac_addr, "\0\0\0\0\0\0", 6);
185 else if (i == 1)
186 memcpy(emacdata->mac_addr, "\0\0\0\0\0\0", 6);
187 else if (i == 2)
188 memcpy(emacdata->mac_addr, __res.bi_enetaddr, 6);
189 else if (i == 3)
190 memcpy(emacdata->mac_addr, __res.bi_enet1addr, 6);
191 }
192}
193
194#define PCIX_READW(offset) \
195 (readw(pcix_reg_base+offset))
196
197#define PCIX_WRITEW(value, offset) \
198 (writew(value, pcix_reg_base+offset))
199
200#define PCIX_WRITEL(value, offset) \
201 (writel(value, pcix_reg_base+offset))
202
203/*
204 * FIXME: This is only here to "make it work". This will move
205 * to a ibm_pcix.c which will contain a generic IBM PCIX bridge
206 * configuration library. -Matt
207 */
208static void __init
209taishan_setup_pcix(void)
210{
211 void *pcix_reg_base;
212
213 pcix_reg_base = ioremap64(PCIX0_REG_BASE, PCIX_REG_SIZE);
214
215 /* Enable PCIX0 I/O, Mem, and Busmaster cycles */
216 PCIX_WRITEW(PCIX_READW(PCIX0_COMMAND) | PCI_COMMAND_IO | PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER, PCIX0_COMMAND);
217
218 /* Disable all windows */
219 PCIX_WRITEL(0, PCIX0_POM0SA);
220 PCIX_WRITEL(0, PCIX0_POM1SA);
221 PCIX_WRITEL(0, PCIX0_POM2SA);
222 PCIX_WRITEL(0, PCIX0_PIM0SA);
223 PCIX_WRITEL(0, PCIX0_PIM0SAH);
224 PCIX_WRITEL(0, PCIX0_PIM1SA);
225 PCIX_WRITEL(0, PCIX0_PIM2SA);
226 PCIX_WRITEL(0, PCIX0_PIM2SAH);
227
228 /* Setup 2GB PLB->PCI outbound mem window (3_8000_0000->0_8000_0000) */
229 PCIX_WRITEL(0x00000003, PCIX0_POM0LAH);
230 PCIX_WRITEL(0x80000000, PCIX0_POM0LAL);
231 PCIX_WRITEL(0x00000000, PCIX0_POM0PCIAH);
232 PCIX_WRITEL(0x80000000, PCIX0_POM0PCIAL);
233 PCIX_WRITEL(0x80000001, PCIX0_POM0SA);
234
235 /* Setup 2GB PCI->PLB inbound memory window at 0, enable MSIs */
236 PCIX_WRITEL(0x00000000, PCIX0_PIM0LAH);
237 PCIX_WRITEL(0x00000000, PCIX0_PIM0LAL);
238 PCIX_WRITEL(0x80000007, PCIX0_PIM0SA);
239 PCIX_WRITEL(0xffffffff, PCIX0_PIM0SAH);
240
241 iounmap(pcix_reg_base);
242
243 eieio();
244}
245
246static void __init
247taishan_setup_hose(void)
248{
249 struct pci_controller *hose;
250
251 /* Configure windows on the PCI-X host bridge */
252 taishan_setup_pcix();
253
254 hose = pcibios_alloc_controller();
255
256 if (!hose)
257 return;
258
259 hose->first_busno = 0;
260 hose->last_busno = 0xff;
261
262 hose->pci_mem_offset = TAISHAN_PCI_MEM_OFFSET;
263
264 pci_init_resource(&hose->io_resource,
265 TAISHAN_PCI_LOWER_IO,
266 TAISHAN_PCI_UPPER_IO,
267 IORESOURCE_IO,
268 "PCI host bridge");
269
270 pci_init_resource(&hose->mem_resources[0],
271 TAISHAN_PCI_LOWER_MEM,
272 TAISHAN_PCI_UPPER_MEM,
273 IORESOURCE_MEM,
274 "PCI host bridge");
275
276 hose->io_space.start = TAISHAN_PCI_LOWER_IO;
277 hose->io_space.end = TAISHAN_PCI_UPPER_IO;
278 hose->mem_space.start = TAISHAN_PCI_LOWER_MEM;
279 hose->mem_space.end = TAISHAN_PCI_UPPER_MEM;
280 hose->io_base_virt = ioremap64(TAISHAN_PCI_IO_BASE, TAISHAN_PCI_IO_SIZE);
281 isa_io_base = (unsigned long) hose->io_base_virt;
282
283 setup_indirect_pci(hose,
284 TAISHAN_PCI_CFGA_PLB32,
285 TAISHAN_PCI_CFGD_PLB32);
286 hose->set_cfg_type = 1;
287
288 hose->last_busno = pciauto_bus_scan(hose, hose->first_busno);
289
290 ppc_md.pci_swizzle = common_swizzle;
291 ppc_md.pci_map_irq = taishan_map_irq;
292}
293
294
295static void __init
296taishan_early_serial_map(void)
297{
298 struct uart_port port;
299
300 /* Setup ioremapped serial port access */
301 memset(&port, 0, sizeof(port));
302 port.membase = ioremap64(PPC440GX_UART0_ADDR, 8);
303 port.irq = UART0_INT;
304 port.uartclk = clocks.uart0;
305 port.regshift = 0;
306 port.iotype = UPIO_MEM;
307 port.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST;
308 port.line = 0;
309
310 if (early_serial_setup(&port) != 0)
311 printk("Early serial init of port 0 failed\n");
312
313#if defined(CONFIG_SERIAL_TEXT_DEBUG) || defined(CONFIG_KGDB)
314 /* Configure debug serial access */
315 gen550_init(0, &port);
316
317 /* Purge TLB entry added in head_44x.S for early serial access */
318 _tlbie(UART0_IO_BASE, 0);
319#endif
320
321 port.membase = ioremap64(PPC440GX_UART1_ADDR, 8);
322 port.irq = UART1_INT;
323 port.uartclk = clocks.uart1;
324 port.line = 1;
325
326 if (early_serial_setup(&port) != 0)
327 printk("Early serial init of port 1 failed\n");
328
329#if defined(CONFIG_SERIAL_TEXT_DEBUG) || defined(CONFIG_KGDB)
330 /* Configure debug serial access */
331 gen550_init(1, &port);
332#endif
333}
334
335static void __init
336taishan_setup_arch(void)
337{
338 taishan_set_emacdata();
339
340 ibm440gx_tah_enable();
341
342 /*
343 * Determine various clocks.
344 * To be completely correct we should get SysClk
345 * from FPGA, because it can be changed by on-board switches
346 * --ebs
347 */
348 ibm440gx_get_clocks(&clocks, 33333333, 6 * 1843200);
349 ocp_sys_info.opb_bus_freq = clocks.opb;
350
351 /* init to some ~sane value until calibrate_delay() runs */
352 loops_per_jiffy = 50000000/HZ;
353
354 /* Setup PCI host bridge */
355 taishan_setup_hose();
356
357#ifdef CONFIG_BLK_DEV_INITRD
358 if (initrd_start)
359 ROOT_DEV = Root_RAM0;
360 else
361#endif
362#ifdef CONFIG_ROOT_NFS
363 ROOT_DEV = Root_NFS;
364#else
365 ROOT_DEV = Root_HDA1;
366#endif
367
368 taishan_early_serial_map();
369
370 /* Identify the system */
371 printk("AMCC PowerPC 440GX Taishan Platform\n");
372}
373
374static void __init taishan_init(void)
375{
376 ibm440gx_l2c_setup(&clocks);
377}
378
379void __init platform_init(unsigned long r3, unsigned long r4,
380 unsigned long r5, unsigned long r6, unsigned long r7)
381{
382 ibm44x_platform_init(r3, r4, r5, r6, r7);
383
384 ppc_md.setup_arch = taishan_setup_arch;
385 ppc_md.show_cpuinfo = taishan_show_cpuinfo;
386 ppc_md.get_irq = NULL; /* Set in ppc4xx_pic_init() */
387
388 ppc_md.calibrate_decr = taishan_calibrate_decr;
389
390#ifdef CONFIG_KGDB
391 ppc_md.early_serial_map = taishan_early_serial_map;
392#endif
393 ppc_md.init = taishan_init;
394}
395
diff --git a/arch/ppc/platforms/4xx/taishan.h b/arch/ppc/platforms/4xx/taishan.h
deleted file mode 100644
index ea7561a80457..000000000000
--- a/arch/ppc/platforms/4xx/taishan.h
+++ /dev/null
@@ -1,67 +0,0 @@
1/*
2 * arch/ppc/platforms/4xx/taishan.h
3 *
4 * AMCC Taishan board definitions
5 *
6 * Copyright 2007 DENX Software Engineering, Stefan Roese <sr@denx.de>
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
12 *
13 */
14
15#ifdef __KERNEL__
16#ifndef __ASM_TAISHAN_H__
17#define __ASM_TAISHAN_H__
18
19#include <platforms/4xx/ibm440gx.h>
20
21/* External timer clock frequency */
22#define TAISHAN_TMR_CLK 25000000
23
24/* Flash */
25#define TAISHAN_FPGA_ADDR 0x0000000141000000ULL
26#define TAISHAN_LCM_ADDR 0x0000000142000000ULL
27#define TAISHAN_FLASH_ADDR 0x00000001fc000000ULL
28#define TAISHAN_FLASH_SIZE 0x4000000
29
30/*
31 * Serial port defines
32 */
33#define RS_TABLE_SIZE 2
34
35/* head_44x.S created UART mapping, used before early_serial_setup.
36 * We cannot use default OpenBIOS UART mappings because they
37 * don't work for configurations with more than 512M RAM. --ebs
38 */
39#define UART0_IO_BASE 0xF0000200
40#define UART1_IO_BASE 0xF0000300
41
42#define BASE_BAUD 11059200/16
43#define STD_UART_OP(num) \
44 { 0, BASE_BAUD, 0, UART##num##_INT, \
45 (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST), \
46 iomem_base: (void*)UART##num##_IO_BASE, \
47 io_type: SERIAL_IO_MEM},
48
49#define SERIAL_PORT_DFNS \
50 STD_UART_OP(0) \
51 STD_UART_OP(1)
52
53/* PCI support */
54#define TAISHAN_PCI_LOWER_IO 0x00000000
55#define TAISHAN_PCI_UPPER_IO 0x0000ffff
56#define TAISHAN_PCI_LOWER_MEM 0x80000000
57#define TAISHAN_PCI_UPPER_MEM 0xffffefff
58
59#define TAISHAN_PCI_CFGA_PLB32 0x0ec00000
60#define TAISHAN_PCI_CFGD_PLB32 0x0ec00004
61
62#define TAISHAN_PCI_IO_BASE 0x0000000208000000ULL
63#define TAISHAN_PCI_IO_SIZE 0x00010000
64#define TAISHAN_PCI_MEM_OFFSET 0x00000000
65
66#endif /* __ASM_TAISHAN_H__ */
67#endif /* __KERNEL__ */
diff --git a/arch/ppc/platforms/4xx/virtex.h b/arch/ppc/platforms/4xx/virtex.h
deleted file mode 100644
index 738280420be5..000000000000
--- a/arch/ppc/platforms/4xx/virtex.h
+++ /dev/null
@@ -1,35 +0,0 @@
1/*
2 * Basic Virtex platform defines, included by <asm/ibm4xx.h>
3 *
4 * 2005-2007 (c) Secret Lab Technologies Ltd.
5 * 2002-2004 (c) MontaVista Software, Inc.
6 *
7 * This file is licensed under the terms of the GNU General Public License
8 * version 2. This program is licensed "as is" without any warranty of any
9 * kind, whether express or implied.
10 */
11
12#ifdef __KERNEL__
13#ifndef __ASM_VIRTEX_H__
14#define __ASM_VIRTEX_H__
15
16#include <asm/ibm405.h>
17#include <asm/ppcboot.h>
18
19/* Ugly, ugly, ugly! BASE_BAUD defined here to keep 8250.c happy. */
20#if !defined(BASE_BAUD)
21 #define BASE_BAUD (0) /* dummy value; not used */
22#endif
23
24#ifndef __ASSEMBLY__
25extern const char* virtex_machine_name;
26#define PPC4xx_MACHINE_NAME (virtex_machine_name)
27#endif /* !__ASSEMBLY__ */
28
29/* We don't need anything mapped. Size of zero will accomplish that. */
30#define PPC4xx_ONB_IO_PADDR 0u
31#define PPC4xx_ONB_IO_VADDR 0u
32#define PPC4xx_ONB_IO_SIZE 0u
33
34#endif /* __ASM_VIRTEX_H__ */
35#endif /* __KERNEL__ */
diff --git a/arch/ppc/platforms/4xx/walnut.c b/arch/ppc/platforms/4xx/walnut.c
deleted file mode 100644
index 2f9772340854..000000000000
--- a/arch/ppc/platforms/4xx/walnut.c
+++ /dev/null
@@ -1,246 +0,0 @@
1/*
2 * Architecture- / platform-specific boot-time initialization code for
3 * IBM PowerPC 4xx based boards. Adapted from original
4 * code by Gary Thomas, Cort Dougan <cort@fsmlabs.com>, and Dan Malek
5 * <dan@net4x.com>.
6 *
7 * Copyright(c) 1999-2000 Grant Erickson <grant@lcse.umn.edu>
8 *
9 * 2002 (c) MontaVista, Software, Inc. This file is licensed under
10 * the terms of the GNU General Public License version 2. This program
11 * is licensed "as is" without any warranty of any kind, whether express
12 * or implied.
13 */
14#include <linux/init.h>
15#include <linux/smp.h>
16#include <linux/threads.h>
17#include <linux/param.h>
18#include <linux/string.h>
19#include <linux/pci.h>
20#include <linux/rtc.h>
21
22#include <asm/system.h>
23#include <asm/pci-bridge.h>
24#include <asm/machdep.h>
25#include <asm/page.h>
26#include <asm/time.h>
27#include <asm/io.h>
28#include <asm/ocp.h>
29#include <asm/ibm_ocp_pci.h>
30#include <asm/todc.h>
31
32#undef DEBUG
33
34#ifdef DEBUG
35#define DBG(x...) printk(x)
36#else
37#define DBG(x...)
38#endif
39
40void *kb_cs;
41void *kb_data;
42void *walnut_rtc_base;
43
44/* Some IRQs unique to Walnut.
45 * Used by the generic 405 PCI setup functions in ppc4xx_pci.c
46 */
47int __init
48ppc405_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
49{
50 static char pci_irq_table[][4] =
51 /*
52 * PCI IDSEL/INTPIN->INTLINE
53 * A B C D
54 */
55 {
56 {28, 28, 28, 28}, /* IDSEL 1 - PCI slot 1 */
57 {29, 29, 29, 29}, /* IDSEL 2 - PCI slot 2 */
58 {30, 30, 30, 30}, /* IDSEL 3 - PCI slot 3 */
59 {31, 31, 31, 31}, /* IDSEL 4 - PCI slot 4 */
60 };
61
62 const long min_idsel = 1, max_idsel = 4, irqs_per_slot = 4;
63 return PCI_IRQ_TABLE_LOOKUP;
64};
65
66void __init
67walnut_setup_arch(void)
68{
69
70 void *fpga_brdc;
71 unsigned char fpga_brdc_data;
72 void *fpga_enable;
73 void *fpga_polarity;
74 void *fpga_status;
75 void *fpga_trigger;
76
77 ppc4xx_setup_arch();
78
79 ibm_ocp_set_emac(0, 0);
80
81 kb_data = ioremap(WALNUT_PS2_BASE, 8);
82 if (!kb_data) {
83 printk(KERN_CRIT
84 "walnut_setup_arch() kb_data ioremap failed\n");
85 return;
86 }
87
88 kb_cs = kb_data + 1;
89
90 fpga_status = ioremap(PPC40x_FPGA_BASE, 8);
91 if (!fpga_status) {
92 printk(KERN_CRIT
93 "walnut_setup_arch() fpga_status ioremap failed\n");
94 return;
95 }
96
97 fpga_enable = fpga_status + 1;
98 fpga_polarity = fpga_status + 2;
99 fpga_trigger = fpga_status + 3;
100 fpga_brdc = fpga_status + 4;
101
102 /* split the keyboard and mouse interrupts */
103 fpga_brdc_data = readb(fpga_brdc);
104 fpga_brdc_data |= 0x80;
105 writeb(fpga_brdc_data, fpga_brdc);
106
107 writeb(0x3, fpga_enable);
108
109 writeb(0x3, fpga_polarity);
110
111 writeb(0x3, fpga_trigger);
112
113 /* RTC step for the walnut */
114 walnut_rtc_base = (void *) WALNUT_RTC_VADDR;
115 TODC_INIT(TODC_TYPE_DS1743, walnut_rtc_base, walnut_rtc_base,
116 walnut_rtc_base, 8);
117 /* Identify the system */
118 printk("IBM Walnut port (C) 2000-2002 MontaVista Software, Inc. (source@mvista.com)\n");
119}
120
121void __init
122bios_fixup(struct pci_controller *hose, struct pcil0_regs *pcip)
123{
124#ifdef CONFIG_PCI
125 unsigned int bar_response, bar;
126 /*
127 * Expected PCI mapping:
128 *
129 * PLB addr PCI memory addr
130 * --------------------- ---------------------
131 * 0000'0000 - 7fff'ffff <--- 0000'0000 - 7fff'ffff
132 * 8000'0000 - Bfff'ffff ---> 8000'0000 - Bfff'ffff
133 *
134 * PLB addr PCI io addr
135 * --------------------- ---------------------
136 * e800'0000 - e800'ffff ---> 0000'0000 - 0001'0000
137 *
138 * The following code is simplified by assuming that the bootrom
139 * has been well behaved in following this mapping.
140 */
141
142#ifdef DEBUG
143 int i;
144
145 printk("ioremap PCLIO_BASE = 0x%x\n", pcip);
146 printk("PCI bridge regs before fixup \n");
147 for (i = 0; i <= 3; i++) {
148 printk(" pmm%dma\t0x%x\n", i, in_le32(&(pcip->pmm[i].ma)));
149 printk(" pmm%dma\t0x%x\n", i, in_le32(&(pcip->pmm[i].la)));
150 printk(" pmm%dma\t0x%x\n", i, in_le32(&(pcip->pmm[i].pcila)));
151 printk(" pmm%dma\t0x%x\n", i, in_le32(&(pcip->pmm[i].pciha)));
152 }
153 printk(" ptm1ms\t0x%x\n", in_le32(&(pcip->ptm1ms)));
154 printk(" ptm1la\t0x%x\n", in_le32(&(pcip->ptm1la)));
155 printk(" ptm2ms\t0x%x\n", in_le32(&(pcip->ptm2ms)));
156 printk(" ptm2la\t0x%x\n", in_le32(&(pcip->ptm2la)));
157
158#endif
159
160 /* added for IBM boot rom version 1.15 bios bar changes -AK */
161
162 /* Disable region first */
163 out_le32((void *) &(pcip->pmm[0].ma), 0x00000000);
164 /* PLB starting addr, PCI: 0x80000000 */
165 out_le32((void *) &(pcip->pmm[0].la), 0x80000000);
166 /* PCI start addr, 0x80000000 */
167 out_le32((void *) &(pcip->pmm[0].pcila), PPC405_PCI_MEM_BASE);
168 /* 512MB range of PLB to PCI */
169 out_le32((void *) &(pcip->pmm[0].pciha), 0x00000000);
170 /* Enable no pre-fetch, enable region */
171 out_le32((void *) &(pcip->pmm[0].ma), ((0xffffffff -
172 (PPC405_PCI_UPPER_MEM -
173 PPC405_PCI_MEM_BASE)) | 0x01));
174
175 /* Disable region one */
176 out_le32((void *) &(pcip->pmm[1].ma), 0x00000000);
177 out_le32((void *) &(pcip->pmm[1].la), 0x00000000);
178 out_le32((void *) &(pcip->pmm[1].pcila), 0x00000000);
179 out_le32((void *) &(pcip->pmm[1].pciha), 0x00000000);
180 out_le32((void *) &(pcip->pmm[1].ma), 0x00000000);
181 out_le32((void *) &(pcip->ptm1ms), 0x00000000);
182
183 /* Disable region two */
184 out_le32((void *) &(pcip->pmm[2].ma), 0x00000000);
185 out_le32((void *) &(pcip->pmm[2].la), 0x00000000);
186 out_le32((void *) &(pcip->pmm[2].pcila), 0x00000000);
187 out_le32((void *) &(pcip->pmm[2].pciha), 0x00000000);
188 out_le32((void *) &(pcip->pmm[2].ma), 0x00000000);
189 out_le32((void *) &(pcip->ptm2ms), 0x00000000);
190
191 /* Zero config bars */
192 for (bar = PCI_BASE_ADDRESS_1; bar <= PCI_BASE_ADDRESS_2; bar += 4) {
193 early_write_config_dword(hose, hose->first_busno,
194 PCI_FUNC(hose->first_busno), bar,
195 0x00000000);
196 early_read_config_dword(hose, hose->first_busno,
197 PCI_FUNC(hose->first_busno), bar,
198 &bar_response);
199 DBG("BUS %d, device %d, Function %d bar 0x%8.8x is 0x%8.8x\n",
200 hose->first_busno, PCI_SLOT(hose->first_busno),
201 PCI_FUNC(hose->first_busno), bar, bar_response);
202 }
203 /* end work around */
204
205#ifdef DEBUG
206 printk("PCI bridge regs after fixup \n");
207 for (i = 0; i <= 3; i++) {
208 printk(" pmm%dma\t0x%x\n", i, in_le32(&(pcip->pmm[i].ma)));
209 printk(" pmm%dma\t0x%x\n", i, in_le32(&(pcip->pmm[i].la)));
210 printk(" pmm%dma\t0x%x\n", i, in_le32(&(pcip->pmm[i].pcila)));
211 printk(" pmm%dma\t0x%x\n", i, in_le32(&(pcip->pmm[i].pciha)));
212 }
213 printk(" ptm1ms\t0x%x\n", in_le32(&(pcip->ptm1ms)));
214 printk(" ptm1la\t0x%x\n", in_le32(&(pcip->ptm1la)));
215 printk(" ptm2ms\t0x%x\n", in_le32(&(pcip->ptm2ms)));
216 printk(" ptm2la\t0x%x\n", in_le32(&(pcip->ptm2la)));
217
218#endif
219#endif
220}
221
222void __init
223walnut_map_io(void)
224{
225 ppc4xx_map_io();
226 io_block_mapping(WALNUT_RTC_VADDR,
227 WALNUT_RTC_PADDR, WALNUT_RTC_SIZE, _PAGE_IO);
228}
229
230void __init
231platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
232 unsigned long r6, unsigned long r7)
233{
234 ppc4xx_init(r3, r4, r5, r6, r7);
235
236 ppc_md.setup_arch = walnut_setup_arch;
237 ppc_md.setup_io_mappings = walnut_map_io;
238
239#ifdef CONFIG_GEN_RTC
240 ppc_md.time_init = todc_time_init;
241 ppc_md.set_rtc_time = todc_set_rtc_time;
242 ppc_md.get_rtc_time = todc_get_rtc_time;
243 ppc_md.nvram_read_val = todc_direct_read_val;
244 ppc_md.nvram_write_val = todc_direct_write_val;
245#endif
246}
diff --git a/arch/ppc/platforms/4xx/walnut.h b/arch/ppc/platforms/4xx/walnut.h
deleted file mode 100644
index d9c4eb788940..000000000000
--- a/arch/ppc/platforms/4xx/walnut.h
+++ /dev/null
@@ -1,52 +0,0 @@
1/*
2 * Walnut board definitions
3 *
4 * Copyright (c) 2005 DENX Software Engineering
5 * Stefan Roese <sr@denx.de>
6 *
7 * Based on original work by
8 * Copyright (c) 1999 Grant Erickson <grant@lcse.umn.edu>
9 * Frank Rowand <frank_rowand@mvista.com>
10 * Debbie Chu <debbie_chu@mvista.com>
11 * 2000 (c) MontaVista, Software, Inc.
12 *
13 * This program is free software; you can redistribute it and/or modify it
14 * under the terms of the GNU General Public License as published by the
15 * Free Software Foundation; either version 2 of the License, or (at your
16 * option) any later version.
17 *
18 */
19
20#ifdef __KERNEL__
21#ifndef __ASM_WALNUT_H__
22#define __ASM_WALNUT_H__
23
24#include <platforms/4xx/ibm405gp.h>
25#include <asm/ppcboot.h>
26
27/* Memory map for the IBM "Walnut" 405GP evaluation board.
28 * Generic 4xx plus RTC.
29 */
30
31#define WALNUT_RTC_PADDR ((uint)0xf0000000)
32#define WALNUT_RTC_VADDR WALNUT_RTC_PADDR
33#define WALNUT_RTC_SIZE ((uint)8*1024)
34
35#define BASE_BAUD 691200
36
37#define WALNUT_PS2_BASE 0xF0100000
38
39/* Flash */
40#define PPC40x_FPGA_BASE 0xF0300000
41#define PPC40x_FPGA_REG_OFFS 5 /* offset to flash map reg */
42#define PPC40x_FLASH_ONBD_N(x) (x & 0x02)
43#define PPC40x_FLASH_SRAM_SEL(x) (x & 0x01)
44#define PPC40x_FLASH_LOW 0xFFF00000
45#define PPC40x_FLASH_HIGH 0xFFF80000
46#define PPC40x_FLASH_SIZE 0x80000
47#define WALNUT_FPGA_BASE PPC40x_FPGA_BASE
48
49#define PPC4xx_MACHINE_NAME "IBM Walnut"
50
51#endif /* __ASM_WALNUT_H__ */
52#endif /* __KERNEL__ */
diff --git a/arch/ppc/platforms/4xx/xilinx_ml300.c b/arch/ppc/platforms/4xx/xilinx_ml300.c
deleted file mode 100644
index 6e522fefc26f..000000000000
--- a/arch/ppc/platforms/4xx/xilinx_ml300.c
+++ /dev/null
@@ -1,118 +0,0 @@
1/*
2 * Xilinx ML300 evaluation board initialization
3 *
4 * Author: MontaVista Software, Inc.
5 * source@mvista.com
6 *
7 * 2002-2004 (c) MontaVista Software, Inc. This file is licensed under the
8 * terms of the GNU General Public License version 2. This program is licensed
9 * "as is" without any warranty of any kind, whether express or implied.
10 */
11
12#include <linux/init.h>
13#include <linux/irq.h>
14#include <linux/tty.h>
15#include <linux/serial.h>
16#include <linux/serial_core.h>
17#include <linux/serial_8250.h>
18#include <linux/serialP.h>
19#include <asm/io.h>
20#include <asm/machdep.h>
21
22#include <syslib/gen550.h>
23#include <syslib/virtex_devices.h>
24#include <platforms/4xx/xparameters/xparameters.h>
25
26/*
27 * As an overview of how the following functions (platform_init,
28 * ml300_map_io, ml300_setup_arch and ml300_init_IRQ) fit into the
29 * kernel startup procedure, here's a call tree:
30 *
31 * start_here arch/ppc/kernel/head_4xx.S
32 * early_init arch/ppc/kernel/setup.c
33 * machine_init arch/ppc/kernel/setup.c
34 * platform_init this file
35 * ppc4xx_init arch/ppc/syslib/ppc4xx_setup.c
36 * parse_bootinfo
37 * find_bootinfo
38 * "setup some default ppc_md pointers"
39 * MMU_init arch/ppc/mm/init.c
40 * *ppc_md.setup_io_mappings == ml300_map_io this file
41 * ppc4xx_map_io arch/ppc/syslib/ppc4xx_setup.c
42 * start_kernel init/main.c
43 * setup_arch arch/ppc/kernel/setup.c
44 * #if defined(CONFIG_KGDB)
45 * *ppc_md.kgdb_map_scc() == gen550_kgdb_map_scc
46 * #endif
47 * *ppc_md.setup_arch == ml300_setup_arch this file
48 * ppc4xx_setup_arch arch/ppc/syslib/ppc4xx_setup.c
49 * ppc4xx_find_bridges arch/ppc/syslib/ppc405_pci.c
50 * init_IRQ arch/ppc/kernel/irq.c
51 * *ppc_md.init_IRQ == ml300_init_IRQ this file
52 * ppc4xx_init_IRQ arch/ppc/syslib/ppc4xx_setup.c
53 * ppc4xx_pic_init arch/ppc/syslib/xilinx_pic.c
54 */
55
56const char* virtex_machine_name = "ML300 Reference Design";
57
58#if defined(XPAR_POWER_0_POWERDOWN_BASEADDR)
59static volatile unsigned *powerdown_base =
60 (volatile unsigned *) XPAR_POWER_0_POWERDOWN_BASEADDR;
61
62static void
63xilinx_power_off(void)
64{
65 local_irq_disable();
66 out_be32(powerdown_base, XPAR_POWER_0_POWERDOWN_VALUE);
67 while (1) ;
68}
69#endif
70
71void __init
72ml300_map_io(void)
73{
74 ppc4xx_map_io();
75
76#if defined(XPAR_POWER_0_POWERDOWN_BASEADDR)
77 powerdown_base = ioremap((unsigned long) powerdown_base,
78 XPAR_POWER_0_POWERDOWN_HIGHADDR -
79 XPAR_POWER_0_POWERDOWN_BASEADDR + 1);
80#endif
81}
82
83void __init
84ml300_setup_arch(void)
85{
86 virtex_early_serial_map();
87 ppc4xx_setup_arch(); /* calls ppc4xx_find_bridges() */
88
89 /* Identify the system */
90 printk(KERN_INFO "Xilinx ML300 Reference System (Virtex-II Pro)\n");
91}
92
93/* Called after board_setup_irq from ppc4xx_init_IRQ(). */
94void __init
95ml300_init_irq(void)
96{
97 ppc4xx_init_IRQ();
98}
99
100void __init
101platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
102 unsigned long r6, unsigned long r7)
103{
104 ppc4xx_init(r3, r4, r5, r6, r7);
105
106 ppc_md.setup_arch = ml300_setup_arch;
107 ppc_md.setup_io_mappings = ml300_map_io;
108 ppc_md.init_IRQ = ml300_init_irq;
109
110#if defined(XPAR_POWER_0_POWERDOWN_BASEADDR)
111 ppc_md.power_off = xilinx_power_off;
112#endif
113
114#ifdef CONFIG_KGDB
115 ppc_md.early_serial_map = virtex_early_serial_map;
116#endif
117}
118
diff --git a/arch/ppc/platforms/4xx/xilinx_ml403.c b/arch/ppc/platforms/4xx/xilinx_ml403.c
deleted file mode 100644
index bc3ace3762e7..000000000000
--- a/arch/ppc/platforms/4xx/xilinx_ml403.c
+++ /dev/null
@@ -1,120 +0,0 @@
1/*
2 * Xilinx ML403 evaluation board initialization
3 *
4 * Author: Grant Likely <grant.likely@secretlab.ca>
5 *
6 * 2005-2007 (c) Secret Lab Technologies Ltd.
7 * 2002-2004 (c) MontaVista Software, Inc.
8 *
9 * This file is licensed under the terms of the GNU General Public License
10 * version 2. This program is licensed "as is" without any warranty of any
11 * kind, whether express or implied.
12 */
13
14#include <linux/init.h>
15#include <linux/irq.h>
16#include <linux/tty.h>
17#include <linux/serial.h>
18#include <linux/serial_core.h>
19#include <linux/serial_8250.h>
20#include <linux/serialP.h>
21#include <asm/io.h>
22#include <asm/machdep.h>
23
24#include <syslib/gen550.h>
25#include <syslib/virtex_devices.h>
26#include <platforms/4xx/xparameters/xparameters.h>
27
28/*
29 * As an overview of how the following functions (platform_init,
30 * ml403_map_io, ml403_setup_arch and ml403_init_IRQ) fit into the
31 * kernel startup procedure, here's a call tree:
32 *
33 * start_here arch/ppc/kernel/head_4xx.S
34 * early_init arch/ppc/kernel/setup.c
35 * machine_init arch/ppc/kernel/setup.c
36 * platform_init this file
37 * ppc4xx_init arch/ppc/syslib/ppc4xx_setup.c
38 * parse_bootinfo
39 * find_bootinfo
40 * "setup some default ppc_md pointers"
41 * MMU_init arch/ppc/mm/init.c
42 * *ppc_md.setup_io_mappings == ml403_map_io this file
43 * ppc4xx_map_io arch/ppc/syslib/ppc4xx_setup.c
44 * start_kernel init/main.c
45 * setup_arch arch/ppc/kernel/setup.c
46 * #if defined(CONFIG_KGDB)
47 * *ppc_md.kgdb_map_scc() == gen550_kgdb_map_scc
48 * #endif
49 * *ppc_md.setup_arch == ml403_setup_arch this file
50 * ppc4xx_setup_arch arch/ppc/syslib/ppc4xx_setup.c
51 * ppc4xx_find_bridges arch/ppc/syslib/ppc405_pci.c
52 * init_IRQ arch/ppc/kernel/irq.c
53 * *ppc_md.init_IRQ == ml403_init_IRQ this file
54 * ppc4xx_init_IRQ arch/ppc/syslib/ppc4xx_setup.c
55 * ppc4xx_pic_init arch/ppc/syslib/xilinx_pic.c
56 */
57
58const char* virtex_machine_name = "ML403 Reference Design";
59
60#if defined(XPAR_POWER_0_POWERDOWN_BASEADDR)
61static volatile unsigned *powerdown_base =
62 (volatile unsigned *) XPAR_POWER_0_POWERDOWN_BASEADDR;
63
64static void
65xilinx_power_off(void)
66{
67 local_irq_disable();
68 out_be32(powerdown_base, XPAR_POWER_0_POWERDOWN_VALUE);
69 while (1) ;
70}
71#endif
72
73void __init
74ml403_map_io(void)
75{
76 ppc4xx_map_io();
77
78#if defined(XPAR_POWER_0_POWERDOWN_BASEADDR)
79 powerdown_base = ioremap((unsigned long) powerdown_base,
80 XPAR_POWER_0_POWERDOWN_HIGHADDR -
81 XPAR_POWER_0_POWERDOWN_BASEADDR + 1);
82#endif
83}
84
85void __init
86ml403_setup_arch(void)
87{
88 virtex_early_serial_map();
89 ppc4xx_setup_arch(); /* calls ppc4xx_find_bridges() */
90
91 /* Identify the system */
92 printk(KERN_INFO "Xilinx ML403 Reference System (Virtex-4 FX)\n");
93}
94
95/* Called after board_setup_irq from ppc4xx_init_IRQ(). */
96void __init
97ml403_init_irq(void)
98{
99 ppc4xx_init_IRQ();
100}
101
102void __init
103platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
104 unsigned long r6, unsigned long r7)
105{
106 ppc4xx_init(r3, r4, r5, r6, r7);
107
108 ppc_md.setup_arch = ml403_setup_arch;
109 ppc_md.setup_io_mappings = ml403_map_io;
110 ppc_md.init_IRQ = ml403_init_irq;
111
112#if defined(XPAR_POWER_0_POWERDOWN_BASEADDR)
113 ppc_md.power_off = xilinx_power_off;
114#endif
115
116#ifdef CONFIG_KGDB
117 ppc_md.early_serial_map = virtex_early_serial_map;
118#endif
119}
120
diff --git a/arch/ppc/platforms/4xx/xparameters/xparameters.h b/arch/ppc/platforms/4xx/xparameters/xparameters.h
deleted file mode 100644
index 650888b00fb0..000000000000
--- a/arch/ppc/platforms/4xx/xparameters/xparameters.h
+++ /dev/null
@@ -1,104 +0,0 @@
1/*
2 * arch/ppc/platforms/4xx/xparameters/xparameters.h
3 *
4 * This file includes the correct xparameters.h for the CONFIG'ed board plus
5 * fixups to translate board specific XPAR values to a common set of names
6 *
7 * Author: MontaVista Software, Inc.
8 * source@mvista.com
9 *
10 * 2004 (c) MontaVista Software, Inc. This file is licensed under the terms
11 * of the GNU General Public License version 2. This program is licensed
12 * "as is" without any warranty of any kind, whether express or implied.
13 */
14
15
16#if defined(CONFIG_XILINX_ML300)
17 #include "xparameters_ml300.h"
18 #define XPAR_INTC_0_AC97_CONTROLLER_REF_0_PLAYBACK_VEC_ID \
19 XPAR_DCR_INTC_0_OPB_AC97_CONTROLLER_REF_0_PLAYBACK_INTERRUPT_INTR
20 #define XPAR_INTC_0_AC97_CONTROLLER_REF_0_RECORD_VEC_ID \
21 XPAR_DCR_INTC_0_OPB_AC97_CONTROLLER_REF_0_RECORD_INTERRUPT_INTR
22#elif defined(CONFIG_XILINX_ML403)
23 #include "xparameters_ml403.h"
24 #define XPAR_INTC_0_AC97_CONTROLLER_REF_0_PLAYBACK_VEC_ID \
25 XPAR_OPB_INTC_0_OPB_AC97_CONTROLLER_REF_0_PLAYBACK_INTERRUPT_INTR
26 #define XPAR_INTC_0_AC97_CONTROLLER_REF_0_RECORD_VEC_ID \
27 XPAR_OPB_INTC_0_OPB_AC97_CONTROLLER_REF_0_RECORD_INTERRUPT_INTR
28#else
29 /* Add other board xparameter includes here before the #else */
30 #error No xparameters_*.h file included
31#endif
32
33#ifndef SERIAL_PORT_DFNS
34 /* zImage serial port definitions */
35 #define RS_TABLE_SIZE 1
36 #define SERIAL_PORT_DFNS { \
37 .baud_base = XPAR_UARTNS550_0_CLOCK_FREQ_HZ/16, \
38 .irq = XPAR_INTC_0_UARTNS550_0_VEC_ID, \
39 .flags = ASYNC_BOOT_AUTOCONF, \
40 .iomem_base = (u8 *)XPAR_UARTNS550_0_BASEADDR + 3, \
41 .iomem_reg_shift = 2, \
42 .io_type = SERIAL_IO_MEM, \
43 },
44#endif
45
46/*
47 * A few reasonable defaults for the #defines which could be missing depending
48 * on the IP version or variant (e.g. OPB vs PLB)
49 */
50
51#ifndef XPAR_EMAC_0_CAM_EXIST
52#define XPAR_EMAC_0_CAM_EXIST 0
53#endif
54#ifndef XPAR_EMAC_0_JUMBO_EXIST
55#define XPAR_EMAC_0_JUMBO_EXIST 0
56#endif
57#ifndef XPAR_EMAC_0_TX_DRE_TYPE
58#define XPAR_EMAC_0_TX_DRE_TYPE 0
59#endif
60#ifndef XPAR_EMAC_0_RX_DRE_TYPE
61#define XPAR_EMAC_0_RX_DRE_TYPE 0
62#endif
63#ifndef XPAR_EMAC_0_TX_INCLUDE_CSUM
64#define XPAR_EMAC_0_TX_INCLUDE_CSUM 0
65#endif
66#ifndef XPAR_EMAC_0_RX_INCLUDE_CSUM
67#define XPAR_EMAC_0_RX_INCLUDE_CSUM 0
68#endif
69
70#ifndef XPAR_EMAC_1_CAM_EXIST
71#define XPAR_EMAC_1_CAM_EXIST 0
72#endif
73#ifndef XPAR_EMAC_1_JUMBO_EXIST
74#define XPAR_EMAC_1_JUMBO_EXIST 0
75#endif
76#ifndef XPAR_EMAC_1_TX_DRE_TYPE
77#define XPAR_EMAC_1_TX_DRE_TYPE 0
78#endif
79#ifndef XPAR_EMAC_1_RX_DRE_TYPE
80#define XPAR_EMAC_1_RX_DRE_TYPE 0
81#endif
82#ifndef XPAR_EMAC_1_TX_INCLUDE_CSUM
83#define XPAR_EMAC_1_TX_INCLUDE_CSUM 0
84#endif
85#ifndef XPAR_EMAC_1_RX_INCLUDE_CSUM
86#define XPAR_EMAC_1_RX_INCLUDE_CSUM 0
87#endif
88
89#ifndef XPAR_GPIO_0_IS_DUAL
90#define XPAR_GPIO_0_IS_DUAL 0
91#endif
92#ifndef XPAR_GPIO_1_IS_DUAL
93#define XPAR_GPIO_1_IS_DUAL 0
94#endif
95#ifndef XPAR_GPIO_2_IS_DUAL
96#define XPAR_GPIO_2_IS_DUAL 0
97#endif
98#ifndef XPAR_GPIO_3_IS_DUAL
99#define XPAR_GPIO_3_IS_DUAL 0
100#endif
101#ifndef XPAR_GPIO_4_IS_DUAL
102#define XPAR_GPIO_4_IS_DUAL 0
103#endif
104
diff --git a/arch/ppc/platforms/4xx/xparameters/xparameters_ml300.h b/arch/ppc/platforms/4xx/xparameters/xparameters_ml300.h
deleted file mode 100644
index 97e3f4d4bd54..000000000000
--- a/arch/ppc/platforms/4xx/xparameters/xparameters_ml300.h
+++ /dev/null
@@ -1,310 +0,0 @@
1/*******************************************************************
2*
3* Author: Xilinx, Inc.
4*
5*
6* This program is free software; you can redistribute it and/or modify it
7* under the terms of the GNU General Public License as published by the
8* Free Software Foundation; either version 2 of the License, or (at your
9* option) any later version.
10*
11*
12* XILINX IS PROVIDING THIS DESIGN, CODE, OR INFORMATION "AS IS" AS A
13* COURTESY TO YOU. BY PROVIDING THIS DESIGN, CODE, OR INFORMATION AS
14* ONE POSSIBLE IMPLEMENTATION OF THIS FEATURE, APPLICATION OR STANDARD,
15* XILINX IS MAKING NO REPRESENTATION THAT THIS IMPLEMENTATION IS FREE
16* FROM ANY CLAIMS OF INFRINGEMENT, AND YOU ARE RESPONSIBLE FOR OBTAINING
17* ANY THIRD PARTY RIGHTS YOU MAY REQUIRE FOR YOUR IMPLEMENTATION.
18* XILINX EXPRESSLY DISCLAIMS ANY WARRANTY WHATSOEVER WITH RESPECT TO
19* THE ADEQUACY OF THE IMPLEMENTATION, INCLUDING BUT NOT LIMITED TO ANY
20* WARRANTIES OR REPRESENTATIONS THAT THIS IMPLEMENTATION IS FREE FROM
21* CLAIMS OF INFRINGEMENT, IMPLIED WARRANTIES OF MERCHANTABILITY AND
22* FITNESS FOR A PARTICULAR PURPOSE.
23*
24*
25* Xilinx hardware products are not intended for use in life support
26* appliances, devices, or systems. Use in such applications is
27* expressly prohibited.
28*
29*
30* (c) Copyright 2002-2004 Xilinx Inc.
31* All rights reserved.
32*
33*
34* You should have received a copy of the GNU General Public License along
35* with this program; if not, write to the Free Software Foundation, Inc.,
36* 675 Mass Ave, Cambridge, MA 02139, USA.
37*
38* Description: Driver parameters
39*
40*******************************************************************/
41
42#define XPAR_XPCI_NUM_INSTANCES 1
43#define XPAR_XPCI_CLOCK_HZ 33333333
44#define XPAR_OPB_PCI_REF_0_DEVICE_ID 0
45#define XPAR_OPB_PCI_REF_0_BASEADDR 0x20000000
46#define XPAR_OPB_PCI_REF_0_HIGHADDR 0x3FFFFFFF
47#define XPAR_OPB_PCI_REF_0_CONFIG_ADDR 0x3C000000
48#define XPAR_OPB_PCI_REF_0_CONFIG_DATA 0x3C000004
49#define XPAR_OPB_PCI_REF_0_LCONFIG_ADDR 0x3E000000
50#define XPAR_OPB_PCI_REF_0_MEM_BASEADDR 0x20000000
51#define XPAR_OPB_PCI_REF_0_MEM_HIGHADDR 0x37FFFFFF
52#define XPAR_OPB_PCI_REF_0_IO_BASEADDR 0x38000000
53#define XPAR_OPB_PCI_REF_0_IO_HIGHADDR 0x3BFFFFFF
54
55/******************************************************************/
56
57#define XPAR_XEMAC_NUM_INSTANCES 1
58#define XPAR_OPB_ETHERNET_0_BASEADDR 0x60000000
59#define XPAR_OPB_ETHERNET_0_HIGHADDR 0x60003FFF
60#define XPAR_OPB_ETHERNET_0_DEVICE_ID 0
61#define XPAR_OPB_ETHERNET_0_ERR_COUNT_EXIST 1
62#define XPAR_OPB_ETHERNET_0_DMA_PRESENT 1
63#define XPAR_OPB_ETHERNET_0_MII_EXIST 1
64
65/******************************************************************/
66
67#define XPAR_MY_OPB_GPIO_0_DEVICE_ID_0 0
68#define XPAR_MY_OPB_GPIO_0_BASEADDR_0 0x90000000
69#define XPAR_MY_OPB_GPIO_0_HIGHADDR_0 (0x90000000+0x7)
70#define XPAR_MY_OPB_GPIO_0_DEVICE_ID_1 1
71#define XPAR_MY_OPB_GPIO_0_BASEADDR_1 (0x90000000+0x8)
72#define XPAR_MY_OPB_GPIO_0_HIGHADDR_1 (0x90000000+0x1F)
73#define XPAR_XGPIO_NUM_INSTANCES 2
74
75/******************************************************************/
76
77#define XPAR_XIIC_NUM_INSTANCES 1
78#define XPAR_OPB_IIC_0_BASEADDR 0xA8000000
79#define XPAR_OPB_IIC_0_HIGHADDR 0xA80001FF
80#define XPAR_OPB_IIC_0_DEVICE_ID 0
81#define XPAR_OPB_IIC_0_TEN_BIT_ADR 0
82
83/******************************************************************/
84
85#define XPAR_XUARTNS550_NUM_INSTANCES 2
86#define XPAR_XUARTNS550_CLOCK_HZ 100000000
87#define XPAR_OPB_UART16550_0_BASEADDR 0xA0000000
88#define XPAR_OPB_UART16550_0_HIGHADDR 0xA0001FFF
89#define XPAR_OPB_UART16550_0_DEVICE_ID 0
90#define XPAR_OPB_UART16550_1_BASEADDR 0xA0010000
91#define XPAR_OPB_UART16550_1_HIGHADDR 0xA0011FFF
92#define XPAR_OPB_UART16550_1_DEVICE_ID 1
93
94/******************************************************************/
95
96#define XPAR_XSPI_NUM_INSTANCES 1
97#define XPAR_OPB_SPI_0_BASEADDR 0xA4000000
98#define XPAR_OPB_SPI_0_HIGHADDR 0xA400007F
99#define XPAR_OPB_SPI_0_DEVICE_ID 0
100#define XPAR_OPB_SPI_0_FIFO_EXIST 1
101#define XPAR_OPB_SPI_0_SPI_SLAVE_ONLY 0
102#define XPAR_OPB_SPI_0_NUM_SS_BITS 1
103
104/******************************************************************/
105
106#define XPAR_XPS2_NUM_INSTANCES 2
107#define XPAR_OPB_PS2_DUAL_REF_0_DEVICE_ID_0 0
108#define XPAR_OPB_PS2_DUAL_REF_0_BASEADDR_0 0xA9000000
109#define XPAR_OPB_PS2_DUAL_REF_0_HIGHADDR_0 (0xA9000000+0x3F)
110#define XPAR_OPB_PS2_DUAL_REF_0_DEVICE_ID_1 1
111#define XPAR_OPB_PS2_DUAL_REF_0_BASEADDR_1 (0xA9000000+0x1000)
112#define XPAR_OPB_PS2_DUAL_REF_0_HIGHADDR_1 (0xA9000000+0x103F)
113
114/******************************************************************/
115
116#define XPAR_XTOUCHSCREEN_NUM_INSTANCES 1
117#define XPAR_OPB_TSD_REF_0_BASEADDR 0xAA000000
118#define XPAR_OPB_TSD_REF_0_HIGHADDR 0xAA000007
119#define XPAR_OPB_TSD_REF_0_DEVICE_ID 0
120
121/******************************************************************/
122
123#define XPAR_OPB_AC97_CONTROLLER_REF_0_BASEADDR 0xA6000000
124#define XPAR_OPB_AC97_CONTROLLER_REF_0_HIGHADDR 0xA60000FF
125#define XPAR_OPB_PAR_PORT_REF_0_BASEADDR 0x90010000
126#define XPAR_OPB_PAR_PORT_REF_0_HIGHADDR 0x900100FF
127#define XPAR_PLB_DDR_0_BASEADDR 0x00000000
128#define XPAR_PLB_DDR_0_HIGHADDR 0x0FFFFFFF
129
130/******************************************************************/
131
132#define XPAR_XINTC_HAS_IPR 1
133#define XPAR_INTC_MAX_NUM_INTR_INPUTS 18
134#define XPAR_XINTC_USE_DCR 0
135#define XPAR_XINTC_NUM_INSTANCES 1
136#define XPAR_DCR_INTC_0_BASEADDR 0xD0000FC0
137#define XPAR_DCR_INTC_0_HIGHADDR 0xD0000FDF
138#define XPAR_DCR_INTC_0_DEVICE_ID 0
139#define XPAR_DCR_INTC_0_KIND_OF_INTR 0x00038000
140
141/******************************************************************/
142
143#define XPAR_DCR_INTC_0_MISC_LOGIC_0_PHY_MII_INT_INTR 0
144#define XPAR_DCR_INTC_0_OPB_ETHERNET_0_IP2INTC_IRPT_INTR 1
145#define XPAR_DCR_INTC_0_MISC_LOGIC_0_IIC_TEMP_CRIT_INTR 2
146#define XPAR_DCR_INTC_0_MISC_LOGIC_0_IIC_IRQ_INTR 3
147#define XPAR_DCR_INTC_0_OPB_IIC_0_IP2INTC_IRPT_INTR 4
148#define XPAR_DCR_INTC_0_OPB_SYSACE_0_SYSACE_IRQ_INTR 5
149#define XPAR_DCR_INTC_0_OPB_UART16550_0_IP2INTC_IRPT_INTR 6
150#define XPAR_DCR_INTC_0_OPB_UART16550_1_IP2INTC_IRPT_INTR 7
151#define XPAR_DCR_INTC_0_OPB_PS2_DUAL_REF_0_SYS_INTR1_INTR 8
152#define XPAR_DCR_INTC_0_OPB_PS2_DUAL_REF_0_SYS_INTR2_INTR 9
153#define XPAR_DCR_INTC_0_OPB_SPI_0_IP2INTC_IRPT_INTR 10
154#define XPAR_DCR_INTC_0_OPB_TSD_REF_0_INTR_INTR 11
155#define XPAR_DCR_INTC_0_OPB_AC97_CONTROLLER_REF_0_PLAYBACK_INTERRUPT_INTR 12
156#define XPAR_DCR_INTC_0_OPB_AC97_CONTROLLER_REF_0_RECORD_INTERRUPT_INTR 13
157#define XPAR_DCR_INTC_0_OPB_PCI_REF_0_INTR_OUT_INTR 14
158#define XPAR_DCR_INTC_0_PLB2OPB_BRIDGE_0_BUS_ERROR_DET_INTR 15
159#define XPAR_DCR_INTC_0_PLB_V34_0_BUS_ERROR_DET_INTR 16
160#define XPAR_DCR_INTC_0_OPB2PLB_BRIDGE_0_BUS_ERROR_DET_INTR 17
161
162/******************************************************************/
163
164#define XPAR_XTFT_NUM_INSTANCES 1
165#define XPAR_PLB_TFT_CNTLR_REF_0_DCR_BASEADDR 0xD0000200
166#define XPAR_PLB_TFT_CNTLR_REF_0_DCR_HIGHADDR 0xD0000207
167#define XPAR_PLB_TFT_CNTLR_REF_0_DEVICE_ID 0
168
169/******************************************************************/
170
171#define XPAR_XSYSACE_MEM_WIDTH 8
172#define XPAR_XSYSACE_NUM_INSTANCES 1
173#define XPAR_OPB_SYSACE_0_BASEADDR 0xCF000000
174#define XPAR_OPB_SYSACE_0_HIGHADDR 0xCF0001FF
175#define XPAR_OPB_SYSACE_0_DEVICE_ID 0
176#define XPAR_OPB_SYSACE_0_MEM_WIDTH 8
177
178/******************************************************************/
179
180#define XPAR_CPU_PPC405_CORE_CLOCK_FREQ_HZ 300000000
181
182/******************************************************************/
183
184/******************************************************************/
185
186/* Linux Redefines */
187
188/******************************************************************/
189
190#define XPAR_UARTNS550_0_BASEADDR (XPAR_OPB_UART16550_0_BASEADDR+0x1000)
191#define XPAR_UARTNS550_0_HIGHADDR XPAR_OPB_UART16550_0_HIGHADDR
192#define XPAR_UARTNS550_0_CLOCK_FREQ_HZ XPAR_XUARTNS550_CLOCK_HZ
193#define XPAR_UARTNS550_0_DEVICE_ID XPAR_OPB_UART16550_0_DEVICE_ID
194#define XPAR_UARTNS550_1_BASEADDR (XPAR_OPB_UART16550_1_BASEADDR+0x1000)
195#define XPAR_UARTNS550_1_HIGHADDR XPAR_OPB_UART16550_1_HIGHADDR
196#define XPAR_UARTNS550_1_CLOCK_FREQ_HZ XPAR_XUARTNS550_CLOCK_HZ
197#define XPAR_UARTNS550_1_DEVICE_ID XPAR_OPB_UART16550_1_DEVICE_ID
198
199/******************************************************************/
200
201#define XPAR_GPIO_0_BASEADDR XPAR_MY_OPB_GPIO_0_BASEADDR_0
202#define XPAR_GPIO_0_HIGHADDR XPAR_MY_OPB_GPIO_0_HIGHADDR_0
203#define XPAR_GPIO_0_DEVICE_ID XPAR_MY_OPB_GPIO_0_DEVICE_ID_0
204#define XPAR_GPIO_1_BASEADDR XPAR_MY_OPB_GPIO_0_BASEADDR_1
205#define XPAR_GPIO_1_HIGHADDR XPAR_MY_OPB_GPIO_0_HIGHADDR_1
206#define XPAR_GPIO_1_DEVICE_ID XPAR_MY_OPB_GPIO_0_DEVICE_ID_1
207
208/******************************************************************/
209
210#define XPAR_IIC_0_BASEADDR XPAR_OPB_IIC_0_BASEADDR
211#define XPAR_IIC_0_HIGHADDR XPAR_OPB_IIC_0_HIGHADDR
212#define XPAR_IIC_0_TEN_BIT_ADR XPAR_OPB_IIC_0_TEN_BIT_ADR
213#define XPAR_IIC_0_DEVICE_ID XPAR_OPB_IIC_0_DEVICE_ID
214
215/******************************************************************/
216
217#define XPAR_SYSACE_0_BASEADDR XPAR_OPB_SYSACE_0_BASEADDR
218#define XPAR_SYSACE_0_HIGHADDR XPAR_OPB_SYSACE_0_HIGHADDR
219#define XPAR_SYSACE_0_DEVICE_ID XPAR_OPB_SYSACE_0_DEVICE_ID
220
221/******************************************************************/
222
223#define XPAR_INTC_0_BASEADDR XPAR_DCR_INTC_0_BASEADDR
224#define XPAR_INTC_0_HIGHADDR XPAR_DCR_INTC_0_HIGHADDR
225#define XPAR_INTC_0_KIND_OF_INTR XPAR_DCR_INTC_0_KIND_OF_INTR
226#define XPAR_INTC_0_DEVICE_ID XPAR_DCR_INTC_0_DEVICE_ID
227
228/******************************************************************/
229
230#define XPAR_INTC_0_EMAC_0_VEC_ID XPAR_DCR_INTC_0_OPB_ETHERNET_0_IP2INTC_IRPT_INTR
231#define XPAR_INTC_0_IIC_0_VEC_ID XPAR_DCR_INTC_0_OPB_IIC_0_IP2INTC_IRPT_INTR
232#define XPAR_INTC_0_SYSACE_0_VEC_ID XPAR_DCR_INTC_0_OPB_SYSACE_0_SYSACE_IRQ_INTR
233#define XPAR_INTC_0_UARTNS550_0_VEC_ID XPAR_DCR_INTC_0_OPB_UART16550_0_IP2INTC_IRPT_INTR
234#define XPAR_INTC_0_UARTNS550_1_VEC_ID XPAR_DCR_INTC_0_OPB_UART16550_1_IP2INTC_IRPT_INTR
235#define XPAR_INTC_0_PS2_0_VEC_ID XPAR_DCR_INTC_0_OPB_PS2_DUAL_REF_0_SYS_INTR1_INTR
236#define XPAR_INTC_0_PS2_1_VEC_ID XPAR_DCR_INTC_0_OPB_PS2_DUAL_REF_0_SYS_INTR2_INTR
237#define XPAR_INTC_0_SPI_0_VEC_ID XPAR_DCR_INTC_0_OPB_SPI_0_IP2INTC_IRPT_INTR
238#define XPAR_INTC_0_TOUCHSCREEN_0_VEC_ID XPAR_DCR_INTC_0_OPB_TSD_REF_0_INTR_INTR
239#define XPAR_INTC_0_PCI_0_VEC_ID_A XPAR_DCR_INTC_0_OPB_PCI_REF_0_INTR_OUT_INTR
240#define XPAR_INTC_0_PCI_0_VEC_ID_B XPAR_DCR_INTC_0_OPB_PCI_REF_0_INTR_OUT_INTR
241#define XPAR_INTC_0_PCI_0_VEC_ID_C XPAR_DCR_INTC_0_OPB_PCI_REF_0_INTR_OUT_INTR
242#define XPAR_INTC_0_PCI_0_VEC_ID_D XPAR_DCR_INTC_0_OPB_PCI_REF_0_INTR_OUT_INTR
243
244/******************************************************************/
245
246#define XPAR_EMAC_0_BASEADDR XPAR_OPB_ETHERNET_0_BASEADDR
247#define XPAR_EMAC_0_HIGHADDR XPAR_OPB_ETHERNET_0_HIGHADDR
248#define XPAR_EMAC_0_DMA_PRESENT XPAR_OPB_ETHERNET_0_DMA_PRESENT
249#define XPAR_EMAC_0_MII_EXIST XPAR_OPB_ETHERNET_0_MII_EXIST
250#define XPAR_EMAC_0_ERR_COUNT_EXIST XPAR_OPB_ETHERNET_0_ERR_COUNT_EXIST
251#define XPAR_EMAC_0_DEVICE_ID XPAR_OPB_ETHERNET_0_DEVICE_ID
252
253/******************************************************************/
254
255#define XPAR_SPI_0_BASEADDR XPAR_OPB_SPI_0_BASEADDR
256#define XPAR_SPI_0_HIGHADDR XPAR_OPB_SPI_0_HIGHADDR
257#define XPAR_SPI_0_DEVICE_ID XPAR_OPB_SPI_0_DEVICE_ID
258
259/******************************************************************/
260
261#define XPAR_TOUCHSCREEN_0_BASEADDR XPAR_OPB_TSD_REF_0_BASEADDR
262#define XPAR_TOUCHSCREEN_0_HIGHADDR XPAR_OPB_TSD_REF_0_HIGHADDR
263#define XPAR_TOUCHSCREEN_0_DEVICE_ID XPAR_OPB_TSD_REF_0_DEVICE_ID
264
265/******************************************************************/
266
267#define XPAR_TFT_0_BASEADDR XPAR_PLB_TFT_CNTLR_REF_0_DCR_BASEADDR
268
269/******************************************************************/
270
271#define XPAR_PCI_0_BASEADDR XPAR_OPB_PCI_REF_0_BASEADDR
272#define XPAR_PCI_0_HIGHADDR XPAR_OPB_PCI_REF_0_HIGHADDR
273#define XPAR_PCI_0_CONFIG_ADDR XPAR_OPB_PCI_REF_0_CONFIG_ADDR
274#define XPAR_PCI_0_CONFIG_DATA XPAR_OPB_PCI_REF_0_CONFIG_DATA
275#define XPAR_PCI_0_LCONFIG_ADDR XPAR_OPB_PCI_REF_0_LCONFIG_ADDR
276#define XPAR_PCI_0_MEM_BASEADDR XPAR_OPB_PCI_REF_0_MEM_BASEADDR
277#define XPAR_PCI_0_MEM_HIGHADDR XPAR_OPB_PCI_REF_0_MEM_HIGHADDR
278#define XPAR_PCI_0_IO_BASEADDR XPAR_OPB_PCI_REF_0_IO_BASEADDR
279#define XPAR_PCI_0_IO_HIGHADDR XPAR_OPB_PCI_REF_0_IO_HIGHADDR
280#define XPAR_PCI_0_CLOCK_FREQ_HZ XPAR_XPCI_CLOCK_HZ
281#define XPAR_PCI_0_DEVICE_ID XPAR_OPB_PCI_REF_0_DEVICE_ID
282
283/******************************************************************/
284
285#define XPAR_PS2_0_BASEADDR XPAR_OPB_PS2_DUAL_REF_0_BASEADDR_0
286#define XPAR_PS2_0_HIGHADDR XPAR_OPB_PS2_DUAL_REF_0_HIGHADDR_0
287#define XPAR_PS2_0_DEVICE_ID XPAR_OPB_PS2_DUAL_REF_0_DEVICE_ID_0
288#define XPAR_PS2_1_BASEADDR XPAR_OPB_PS2_DUAL_REF_0_BASEADDR_1
289#define XPAR_PS2_1_HIGHADDR XPAR_OPB_PS2_DUAL_REF_0_HIGHADDR_1
290#define XPAR_PS2_1_DEVICE_ID XPAR_OPB_PS2_DUAL_REF_0_DEVICE_ID_1
291
292/******************************************************************/
293
294#define XPAR_PLB_CLOCK_FREQ_HZ 100000000
295#define XPAR_CORE_CLOCK_FREQ_HZ XPAR_CPU_PPC405_CORE_CLOCK_FREQ_HZ
296#define XPAR_DDR_0_SIZE 0x08000000
297
298/******************************************************************/
299
300#define XPAR_PERSISTENT_0_IIC_0_BASEADDR 0x00000400
301#define XPAR_PERSISTENT_0_IIC_0_HIGHADDR 0x000007FF
302#define XPAR_PERSISTENT_0_IIC_0_EEPROMADDR 0xA0
303
304/******************************************************************/
305
306#define XPAR_POWER_0_POWERDOWN_BASEADDR 0x90000004
307#define XPAR_POWER_0_POWERDOWN_HIGHADDR 0x90000007
308#define XPAR_POWER_0_POWERDOWN_VALUE 0xFF
309
310/******************************************************************/
diff --git a/arch/ppc/platforms/4xx/xparameters/xparameters_ml403.h b/arch/ppc/platforms/4xx/xparameters/xparameters_ml403.h
deleted file mode 100644
index 5cacdcb3964d..000000000000
--- a/arch/ppc/platforms/4xx/xparameters/xparameters_ml403.h
+++ /dev/null
@@ -1,243 +0,0 @@
1
2/*******************************************************************
3*
4* CAUTION: This file is automatically generated by libgen.
5* Version: Xilinx EDK 7.1.2 EDK_H.12.5.1
6* DO NOT EDIT.
7*
8* Copyright (c) 2005 Xilinx, Inc. All rights reserved.
9*
10* Description: Driver parameters
11*
12*******************************************************************/
13
14#define XPAR_PLB_BRAM_IF_CNTLR_0_BASEADDR 0xFFFF0000
15#define XPAR_PLB_BRAM_IF_CNTLR_0_HIGHADDR 0xFFFFFFFF
16
17/******************************************************************/
18
19#define XPAR_OPB_EMC_0_MEM0_BASEADDR 0x20000000
20#define XPAR_OPB_EMC_0_MEM0_HIGHADDR 0x200FFFFF
21#define XPAR_OPB_EMC_0_MEM1_BASEADDR 0x28000000
22#define XPAR_OPB_EMC_0_MEM1_HIGHADDR 0x287FFFFF
23#define XPAR_OPB_AC97_CONTROLLER_REF_0_BASEADDR 0xA6000000
24#define XPAR_OPB_AC97_CONTROLLER_REF_0_HIGHADDR 0xA60000FF
25#define XPAR_OPB_EMC_USB_0_MEM0_BASEADDR 0xA5000000
26#define XPAR_OPB_EMC_USB_0_MEM0_HIGHADDR 0xA50000FF
27#define XPAR_PLB_DDR_0_MEM0_BASEADDR 0x00000000
28#define XPAR_PLB_DDR_0_MEM0_HIGHADDR 0x0FFFFFFF
29
30/******************************************************************/
31
32#define XPAR_XEMAC_NUM_INSTANCES 1
33#define XPAR_OPB_ETHERNET_0_BASEADDR 0x60000000
34#define XPAR_OPB_ETHERNET_0_HIGHADDR 0x60003FFF
35#define XPAR_OPB_ETHERNET_0_DEVICE_ID 0
36#define XPAR_OPB_ETHERNET_0_ERR_COUNT_EXIST 1
37#define XPAR_OPB_ETHERNET_0_DMA_PRESENT 1
38#define XPAR_OPB_ETHERNET_0_MII_EXIST 1
39
40/******************************************************************/
41
42#define XPAR_XUARTNS550_NUM_INSTANCES 1
43#define XPAR_XUARTNS550_CLOCK_HZ 100000000
44#define XPAR_OPB_UART16550_0_BASEADDR 0xA0000000
45#define XPAR_OPB_UART16550_0_HIGHADDR 0xA0001FFF
46#define XPAR_OPB_UART16550_0_DEVICE_ID 0
47
48/******************************************************************/
49
50#define XPAR_XGPIO_NUM_INSTANCES 3
51#define XPAR_OPB_GPIO_0_BASEADDR 0x90000000
52#define XPAR_OPB_GPIO_0_HIGHADDR 0x900001FF
53#define XPAR_OPB_GPIO_0_DEVICE_ID 0
54#define XPAR_OPB_GPIO_0_INTERRUPT_PRESENT 0
55#define XPAR_OPB_GPIO_0_IS_DUAL 1
56#define XPAR_OPB_GPIO_EXP_HDR_0_BASEADDR 0x90001000
57#define XPAR_OPB_GPIO_EXP_HDR_0_HIGHADDR 0x900011FF
58#define XPAR_OPB_GPIO_EXP_HDR_0_DEVICE_ID 1
59#define XPAR_OPB_GPIO_EXP_HDR_0_INTERRUPT_PRESENT 0
60#define XPAR_OPB_GPIO_EXP_HDR_0_IS_DUAL 1
61#define XPAR_OPB_GPIO_CHAR_LCD_0_BASEADDR 0x90002000
62#define XPAR_OPB_GPIO_CHAR_LCD_0_HIGHADDR 0x900021FF
63#define XPAR_OPB_GPIO_CHAR_LCD_0_DEVICE_ID 2
64#define XPAR_OPB_GPIO_CHAR_LCD_0_INTERRUPT_PRESENT 0
65#define XPAR_OPB_GPIO_CHAR_LCD_0_IS_DUAL 0
66
67/******************************************************************/
68
69#define XPAR_XPS2_NUM_INSTANCES 2
70#define XPAR_OPB_PS2_DUAL_REF_0_DEVICE_ID_0 0
71#define XPAR_OPB_PS2_DUAL_REF_0_BASEADDR_0 0xA9000000
72#define XPAR_OPB_PS2_DUAL_REF_0_HIGHADDR_0 (0xA9000000+0x3F)
73#define XPAR_OPB_PS2_DUAL_REF_0_DEVICE_ID_1 1
74#define XPAR_OPB_PS2_DUAL_REF_0_BASEADDR_1 (0xA9000000+0x1000)
75#define XPAR_OPB_PS2_DUAL_REF_0_HIGHADDR_1 (0xA9000000+0x103F)
76
77/******************************************************************/
78
79#define XPAR_XIIC_NUM_INSTANCES 1
80#define XPAR_OPB_IIC_0_BASEADDR 0xA8000000
81#define XPAR_OPB_IIC_0_HIGHADDR 0xA80001FF
82#define XPAR_OPB_IIC_0_DEVICE_ID 0
83#define XPAR_OPB_IIC_0_TEN_BIT_ADR 0
84#define XPAR_OPB_IIC_0_GPO_WIDTH 1
85
86/******************************************************************/
87
88#define XPAR_INTC_MAX_NUM_INTR_INPUTS 10
89#define XPAR_XINTC_HAS_IPR 1
90#define XPAR_XINTC_USE_DCR 0
91#define XPAR_XINTC_NUM_INSTANCES 1
92#define XPAR_OPB_INTC_0_BASEADDR 0xD1000FC0
93#define XPAR_OPB_INTC_0_HIGHADDR 0xD1000FDF
94#define XPAR_OPB_INTC_0_DEVICE_ID 0
95#define XPAR_OPB_INTC_0_KIND_OF_INTR 0x00000000
96
97/******************************************************************/
98
99#define XPAR_INTC_SINGLE_BASEADDR 0xD1000FC0
100#define XPAR_INTC_SINGLE_HIGHADDR 0xD1000FDF
101#define XPAR_INTC_SINGLE_DEVICE_ID XPAR_OPB_INTC_0_DEVICE_ID
102#define XPAR_OPB_ETHERNET_0_IP2INTC_IRPT_MASK 0X000001
103#define XPAR_OPB_INTC_0_OPB_ETHERNET_0_IP2INTC_IRPT_INTR 0
104#define XPAR_SYSTEM_USB_HPI_INT_MASK 0X000002
105#define XPAR_OPB_INTC_0_SYSTEM_USB_HPI_INT_INTR 1
106#define XPAR_MISC_LOGIC_0_PHY_MII_INT_MASK 0X000004
107#define XPAR_OPB_INTC_0_MISC_LOGIC_0_PHY_MII_INT_INTR 2
108#define XPAR_OPB_SYSACE_0_SYSACE_IRQ_MASK 0X000008
109#define XPAR_OPB_INTC_0_OPB_SYSACE_0_SYSACE_IRQ_INTR 3
110#define XPAR_OPB_AC97_CONTROLLER_REF_0_RECORD_INTERRUPT_MASK 0X000010
111#define XPAR_OPB_INTC_0_OPB_AC97_CONTROLLER_REF_0_RECORD_INTERRUPT_INTR 4
112#define XPAR_OPB_AC97_CONTROLLER_REF_0_PLAYBACK_INTERRUPT_MASK 0X000020
113#define XPAR_OPB_INTC_0_OPB_AC97_CONTROLLER_REF_0_PLAYBACK_INTERRUPT_INTR 5
114#define XPAR_OPB_IIC_0_IP2INTC_IRPT_MASK 0X000040
115#define XPAR_OPB_INTC_0_OPB_IIC_0_IP2INTC_IRPT_INTR 6
116#define XPAR_OPB_PS2_DUAL_REF_0_SYS_INTR2_MASK 0X000080
117#define XPAR_OPB_INTC_0_OPB_PS2_DUAL_REF_0_SYS_INTR2_INTR 7
118#define XPAR_OPB_PS2_DUAL_REF_0_SYS_INTR1_MASK 0X000100
119#define XPAR_OPB_INTC_0_OPB_PS2_DUAL_REF_0_SYS_INTR1_INTR 8
120#define XPAR_OPB_UART16550_0_IP2INTC_IRPT_MASK 0X000200
121#define XPAR_OPB_INTC_0_OPB_UART16550_0_IP2INTC_IRPT_INTR 9
122
123/******************************************************************/
124
125#define XPAR_XTFT_NUM_INSTANCES 1
126#define XPAR_PLB_TFT_CNTLR_REF_0_DCR_BASEADDR 0xD0000200
127#define XPAR_PLB_TFT_CNTLR_REF_0_DCR_HIGHADDR 0xD0000207
128#define XPAR_PLB_TFT_CNTLR_REF_0_DEVICE_ID 0
129
130/******************************************************************/
131
132#define XPAR_XSYSACE_MEM_WIDTH 16
133#define XPAR_XSYSACE_NUM_INSTANCES 1
134#define XPAR_OPB_SYSACE_0_BASEADDR 0xCF000000
135#define XPAR_OPB_SYSACE_0_HIGHADDR 0xCF0001FF
136#define XPAR_OPB_SYSACE_0_DEVICE_ID 0
137#define XPAR_OPB_SYSACE_0_MEM_WIDTH 16
138
139/******************************************************************/
140
141#define XPAR_CPU_PPC405_CORE_CLOCK_FREQ_HZ 300000000
142
143/******************************************************************/
144
145
146/******************************************************************/
147
148/* Linux Redefines */
149
150/******************************************************************/
151
152#define XPAR_UARTNS550_0_BASEADDR (XPAR_OPB_UART16550_0_BASEADDR+0x1000)
153#define XPAR_UARTNS550_0_HIGHADDR XPAR_OPB_UART16550_0_HIGHADDR
154#define XPAR_UARTNS550_0_CLOCK_FREQ_HZ XPAR_XUARTNS550_CLOCK_HZ
155#define XPAR_UARTNS550_0_DEVICE_ID XPAR_OPB_UART16550_0_DEVICE_ID
156
157/******************************************************************/
158
159#define XPAR_INTC_0_BASEADDR XPAR_OPB_INTC_0_BASEADDR
160#define XPAR_INTC_0_HIGHADDR XPAR_OPB_INTC_0_HIGHADDR
161#define XPAR_INTC_0_KIND_OF_INTR XPAR_OPB_INTC_0_KIND_OF_INTR
162#define XPAR_INTC_0_DEVICE_ID XPAR_OPB_INTC_0_DEVICE_ID
163
164/******************************************************************/
165
166#define XPAR_INTC_0_EMAC_0_VEC_ID XPAR_OPB_INTC_0_OPB_ETHERNET_0_IP2INTC_IRPT_INTR
167#define XPAR_INTC_0_SYSACE_0_VEC_ID XPAR_OPB_INTC_0_OPB_SYSACE_0_SYSACE_IRQ_INTR
168#define XPAR_INTC_0_IIC_0_VEC_ID XPAR_OPB_INTC_0_OPB_IIC_0_IP2INTC_IRPT_INTR
169#define XPAR_INTC_0_PS2_1_VEC_ID XPAR_OPB_INTC_0_OPB_PS2_DUAL_REF_0_SYS_INTR2_INTR
170#define XPAR_INTC_0_PS2_0_VEC_ID XPAR_OPB_INTC_0_OPB_PS2_DUAL_REF_0_SYS_INTR1_INTR
171#define XPAR_INTC_0_UARTNS550_0_VEC_ID XPAR_OPB_INTC_0_OPB_UART16550_0_IP2INTC_IRPT_INTR
172
173/******************************************************************/
174
175#define XPAR_TFT_0_BASEADDR XPAR_PLB_TFT_CNTLR_REF_0_DCR_BASEADDR
176
177/******************************************************************/
178
179#define XPAR_EMAC_0_BASEADDR XPAR_OPB_ETHERNET_0_BASEADDR
180#define XPAR_EMAC_0_HIGHADDR XPAR_OPB_ETHERNET_0_HIGHADDR
181#define XPAR_EMAC_0_DMA_PRESENT XPAR_OPB_ETHERNET_0_DMA_PRESENT
182#define XPAR_EMAC_0_MII_EXIST XPAR_OPB_ETHERNET_0_MII_EXIST
183#define XPAR_EMAC_0_ERR_COUNT_EXIST XPAR_OPB_ETHERNET_0_ERR_COUNT_EXIST
184#define XPAR_EMAC_0_DEVICE_ID XPAR_OPB_ETHERNET_0_DEVICE_ID
185
186/******************************************************************/
187
188#define XPAR_GPIO_0_BASEADDR XPAR_OPB_GPIO_0_BASEADDR_0
189#define XPAR_GPIO_0_HIGHADDR XPAR_OPB_GPIO_0_HIGHADDR_0
190#define XPAR_GPIO_0_DEVICE_ID XPAR_OPB_GPIO_0_DEVICE_ID_0
191#define XPAR_GPIO_1_BASEADDR XPAR_OPB_GPIO_0_BASEADDR_1
192#define XPAR_GPIO_1_HIGHADDR XPAR_OPB_GPIO_0_HIGHADDR_1
193#define XPAR_GPIO_1_DEVICE_ID XPAR_OPB_GPIO_0_DEVICE_ID_1
194#define XPAR_GPIO_2_BASEADDR XPAR_OPB_GPIO_EXP_HDR_0_BASEADDR_0
195#define XPAR_GPIO_2_HIGHADDR XPAR_OPB_GPIO_EXP_HDR_0_HIGHADDR_0
196#define XPAR_GPIO_2_DEVICE_ID XPAR_OPB_GPIO_EXP_HDR_0_DEVICE_ID_0
197#define XPAR_GPIO_3_BASEADDR XPAR_OPB_GPIO_EXP_HDR_0_BASEADDR_1
198#define XPAR_GPIO_3_HIGHADDR XPAR_OPB_GPIO_EXP_HDR_0_HIGHADDR_1
199#define XPAR_GPIO_3_DEVICE_ID XPAR_OPB_GPIO_EXP_HDR_0_DEVICE_ID_1
200#define XPAR_GPIO_4_BASEADDR XPAR_OPB_GPIO_CHAR_LCD_0_BASEADDR
201#define XPAR_GPIO_4_HIGHADDR XPAR_OPB_GPIO_CHAR_LCD_0_HIGHADDR
202#define XPAR_GPIO_4_DEVICE_ID XPAR_OPB_GPIO_CHAR_LCD_0_DEVICE_ID
203
204/******************************************************************/
205
206#define XPAR_PS2_0_BASEADDR XPAR_OPB_PS2_DUAL_REF_0_BASEADDR_0
207#define XPAR_PS2_0_HIGHADDR XPAR_OPB_PS2_DUAL_REF_0_HIGHADDR_0
208#define XPAR_PS2_0_DEVICE_ID XPAR_OPB_PS2_DUAL_REF_0_DEVICE_ID_0
209#define XPAR_PS2_1_BASEADDR XPAR_OPB_PS2_DUAL_REF_0_BASEADDR_1
210#define XPAR_PS2_1_HIGHADDR XPAR_OPB_PS2_DUAL_REF_0_HIGHADDR_1
211#define XPAR_PS2_1_DEVICE_ID XPAR_OPB_PS2_DUAL_REF_0_DEVICE_ID_1
212
213/******************************************************************/
214
215#define XPAR_SYSACE_0_BASEADDR XPAR_OPB_SYSACE_0_BASEADDR
216#define XPAR_SYSACE_0_HIGHADDR XPAR_OPB_SYSACE_0_HIGHADDR
217#define XPAR_SYSACE_0_DEVICE_ID XPAR_OPB_SYSACE_0_DEVICE_ID
218
219/******************************************************************/
220
221#define XPAR_IIC_0_BASEADDR XPAR_OPB_IIC_0_BASEADDR
222#define XPAR_IIC_0_HIGHADDR XPAR_OPB_IIC_0_HIGHADDR
223#define XPAR_IIC_0_TEN_BIT_ADR XPAR_OPB_IIC_0_TEN_BIT_ADR
224#define XPAR_IIC_0_DEVICE_ID XPAR_OPB_IIC_0_DEVICE_ID
225
226/******************************************************************/
227
228#define XPAR_PLB_CLOCK_FREQ_HZ 100000000
229#define XPAR_CORE_CLOCK_FREQ_HZ XPAR_CPU_PPC405_CORE_CLOCK_FREQ_HZ
230#define XPAR_DDR_0_SIZE 0x4000000
231
232/******************************************************************/
233
234#define XPAR_PERSISTENT_0_IIC_0_BASEADDR 0x00000400
235#define XPAR_PERSISTENT_0_IIC_0_HIGHADDR 0x000007FF
236#define XPAR_PERSISTENT_0_IIC_0_EEPROMADDR 0xA0
237
238/******************************************************************/
239
240#define XPAR_PCI_0_CLOCK_FREQ_HZ 0
241
242/******************************************************************/
243
diff --git a/arch/ppc/platforms/4xx/yucca.c b/arch/ppc/platforms/4xx/yucca.c
deleted file mode 100644
index f6cfd44281fc..000000000000
--- a/arch/ppc/platforms/4xx/yucca.c
+++ /dev/null
@@ -1,393 +0,0 @@
1/*
2 * Yucca board specific routines
3 *
4 * Roland Dreier <rolandd@cisco.com> (based on luan.c by Matt Porter)
5 *
6 * Copyright 2004-2005 MontaVista Software Inc.
7 * Copyright (c) 2005 Cisco Systems. All rights reserved.
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation; either version 2 of the License, or (at your
12 * option) any later version.
13 */
14
15#include <linux/stddef.h>
16#include <linux/kernel.h>
17#include <linux/init.h>
18#include <linux/errno.h>
19#include <linux/reboot.h>
20#include <linux/pci.h>
21#include <linux/kdev_t.h>
22#include <linux/types.h>
23#include <linux/major.h>
24#include <linux/blkdev.h>
25#include <linux/console.h>
26#include <linux/delay.h>
27#include <linux/initrd.h>
28#include <linux/seq_file.h>
29#include <linux/root_dev.h>
30#include <linux/tty.h>
31#include <linux/serial.h>
32#include <linux/serial_core.h>
33#include <linux/serial_8250.h>
34
35#include <asm/system.h>
36#include <asm/pgtable.h>
37#include <asm/page.h>
38#include <asm/dma.h>
39#include <asm/io.h>
40#include <asm/machdep.h>
41#include <asm/ocp.h>
42#include <asm/pci-bridge.h>
43#include <asm/time.h>
44#include <asm/todc.h>
45#include <asm/bootinfo.h>
46#include <asm/ppc4xx_pic.h>
47#include <asm/ppcboot.h>
48
49#include <syslib/ibm44x_common.h>
50#include <syslib/ibm440gx_common.h>
51#include <syslib/ibm440sp_common.h>
52#include <syslib/ppc440spe_pcie.h>
53
54extern bd_t __res;
55
56static struct ibm44x_clocks clocks __initdata;
57
58static void __init
59yucca_calibrate_decr(void)
60{
61 unsigned int freq;
62
63 if (mfspr(SPRN_CCR1) & CCR1_TCS)
64 freq = YUCCA_TMR_CLK;
65 else
66 freq = clocks.cpu;
67
68 ibm44x_calibrate_decr(freq);
69}
70
71static int
72yucca_show_cpuinfo(struct seq_file *m)
73{
74 seq_printf(m, "vendor\t\t: AMCC\n");
75 seq_printf(m, "machine\t\t: PPC440SPe EVB (Yucca)\n");
76
77 return 0;
78}
79
80static enum {
81 HOSE_UNKNOWN,
82 HOSE_PCIX,
83 HOSE_PCIE0,
84 HOSE_PCIE1,
85 HOSE_PCIE2
86} hose_type[4];
87
88static inline int
89yucca_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
90{
91 struct pci_controller *hose = pci_bus_to_hose(dev->bus->number);
92
93 if (hose_type[hose->index] == HOSE_PCIX) {
94 static char pci_irq_table[][4] =
95 /*
96 * PCI IDSEL/INTPIN->INTLINE
97 * A B C D
98 */
99 {
100 { 81, -1, -1, -1 }, /* IDSEL 1 - PCIX0 Slot 0 */
101 };
102 const long min_idsel = 1, max_idsel = 1, irqs_per_slot = 4;
103 return PCI_IRQ_TABLE_LOOKUP;
104 } else if (hose_type[hose->index] == HOSE_PCIE0) {
105 static char pci_irq_table[][4] =
106 /*
107 * PCI IDSEL/INTPIN->INTLINE
108 * A B C D
109 */
110 {
111 { 96, 97, 98, 99 },
112 };
113 const long min_idsel = 1, max_idsel = 1, irqs_per_slot = 4;
114 return PCI_IRQ_TABLE_LOOKUP;
115 } else if (hose_type[hose->index] == HOSE_PCIE1) {
116 static char pci_irq_table[][4] =
117 /*
118 * PCI IDSEL/INTPIN->INTLINE
119 * A B C D
120 */
121 {
122 { 100, 101, 102, 103 },
123 };
124 const long min_idsel = 1, max_idsel = 1, irqs_per_slot = 4;
125 return PCI_IRQ_TABLE_LOOKUP;
126 } else if (hose_type[hose->index] == HOSE_PCIE2) {
127 static char pci_irq_table[][4] =
128 /*
129 * PCI IDSEL/INTPIN->INTLINE
130 * A B C D
131 */
132 {
133 { 104, 105, 106, 107 },
134 };
135 const long min_idsel = 1, max_idsel = 1, irqs_per_slot = 4;
136 return PCI_IRQ_TABLE_LOOKUP;
137 }
138 return -1;
139}
140
141static void __init yucca_set_emacdata(void)
142{
143 struct ocp_def *def;
144 struct ocp_func_emac_data *emacdata;
145
146 /* Set phy_map, phy_mode, and mac_addr for the EMAC */
147 def = ocp_get_one_device(OCP_VENDOR_IBM, OCP_FUNC_EMAC, 0);
148 emacdata = def->additions;
149 emacdata->phy_map = 0x00000001; /* Skip 0x00 */
150 emacdata->phy_mode = PHY_MODE_GMII;
151 memcpy(emacdata->mac_addr, __res.bi_enetaddr, 6);
152}
153
154static int __init yucca_pcie_card_present(int port)
155{
156 void __iomem *pcie_fpga_base;
157 u16 reg;
158
159 pcie_fpga_base = ioremap64(YUCCA_FPGA_REG_BASE, YUCCA_FPGA_REG_SIZE);
160 reg = in_be16(pcie_fpga_base + FPGA_REG1C);
161 iounmap(pcie_fpga_base);
162
163 switch(port) {
164 case 0: return !(reg & FPGA_REG1C_PE0_PRSNT);
165 case 1: return !(reg & FPGA_REG1C_PE1_PRSNT);
166 case 2: return !(reg & FPGA_REG1C_PE2_PRSNT);
167 default: return 0;
168 }
169}
170
171/*
172 * For the given slot, set rootpoint mode, send power to the slot,
173 * turn on the green LED and turn off the yellow LED, enable the clock
174 * and turn off reset.
175 */
176static void __init yucca_setup_pcie_fpga_rootpoint(int port)
177{
178 void __iomem *pcie_reg_fpga_base;
179 u16 power, clock, green_led, yellow_led, reset_off, rootpoint, endpoint;
180
181 pcie_reg_fpga_base = ioremap64(YUCCA_FPGA_REG_BASE, YUCCA_FPGA_REG_SIZE);
182
183 switch(port) {
184 case 0:
185 rootpoint = FPGA_REG1C_PE0_ROOTPOINT;
186 endpoint = 0;
187 power = FPGA_REG1A_PE0_PWRON;
188 green_led = FPGA_REG1A_PE0_GLED;
189 clock = FPGA_REG1A_PE0_REFCLK_ENABLE;
190 yellow_led = FPGA_REG1A_PE0_YLED;
191 reset_off = FPGA_REG1C_PE0_PERST;
192 break;
193 case 1:
194 rootpoint = 0;
195 endpoint = FPGA_REG1C_PE1_ENDPOINT;
196 power = FPGA_REG1A_PE1_PWRON;
197 green_led = FPGA_REG1A_PE1_GLED;
198 clock = FPGA_REG1A_PE1_REFCLK_ENABLE;
199 yellow_led = FPGA_REG1A_PE1_YLED;
200 reset_off = FPGA_REG1C_PE1_PERST;
201 break;
202 case 2:
203 rootpoint = 0;
204 endpoint = FPGA_REG1C_PE2_ENDPOINT;
205 power = FPGA_REG1A_PE2_PWRON;
206 green_led = FPGA_REG1A_PE2_GLED;
207 clock = FPGA_REG1A_PE2_REFCLK_ENABLE;
208 yellow_led = FPGA_REG1A_PE2_YLED;
209 reset_off = FPGA_REG1C_PE2_PERST;
210 break;
211
212 default:
213 iounmap(pcie_reg_fpga_base);
214 return;
215 }
216
217 out_be16(pcie_reg_fpga_base + FPGA_REG1A,
218 ~(power | clock | green_led) &
219 (yellow_led | in_be16(pcie_reg_fpga_base + FPGA_REG1A)));
220 out_be16(pcie_reg_fpga_base + FPGA_REG1C,
221 ~(endpoint | reset_off) &
222 (rootpoint | in_be16(pcie_reg_fpga_base + FPGA_REG1C)));
223
224 /*
225 * Leave device in reset for a while after powering on the
226 * slot to give it a chance to initialize.
227 */
228 mdelay(250);
229
230 out_be16(pcie_reg_fpga_base + FPGA_REG1C,
231 reset_off | in_be16(pcie_reg_fpga_base + FPGA_REG1C));
232
233 iounmap(pcie_reg_fpga_base);
234}
235
236static void __init
237yucca_setup_hoses(void)
238{
239 struct pci_controller *hose;
240 char name[20];
241 int i;
242
243 if (0 && ppc440spe_init_pcie()) {
244 printk(KERN_WARNING "PPC440SPe PCI Express initialization failed\n");
245 return;
246 }
247
248 for (i = 0; i <= 2; ++i) {
249 if (!yucca_pcie_card_present(i))
250 continue;
251
252 printk(KERN_INFO "PCIE%d: card present\n", i);
253 yucca_setup_pcie_fpga_rootpoint(i);
254 if (ppc440spe_init_pcie_rootport(i)) {
255 printk(KERN_WARNING "PCIE%d: initialization failed\n", i);
256 continue;
257 }
258
259 hose = pcibios_alloc_controller();
260 if (!hose)
261 return;
262
263 sprintf(name, "PCIE%d host bridge", i);
264 pci_init_resource(&hose->io_resource,
265 YUCCA_PCIX_LOWER_IO,
266 YUCCA_PCIX_UPPER_IO,
267 IORESOURCE_IO,
268 name);
269
270 hose->mem_space.start = YUCCA_PCIE_LOWER_MEM +
271 i * YUCCA_PCIE_MEM_SIZE;
272 hose->mem_space.end = hose->mem_space.start +
273 YUCCA_PCIE_MEM_SIZE - 1;
274
275 pci_init_resource(&hose->mem_resources[0],
276 hose->mem_space.start,
277 hose->mem_space.end,
278 IORESOURCE_MEM,
279 name);
280
281 hose->first_busno = 0;
282 hose->last_busno = 15;
283 hose_type[hose->index] = HOSE_PCIE0 + i;
284
285 ppc440spe_setup_pcie(hose, i);
286 hose->last_busno = pciauto_bus_scan(hose, hose->first_busno);
287 }
288
289 ppc_md.pci_swizzle = common_swizzle;
290 ppc_md.pci_map_irq = yucca_map_irq;
291}
292
293TODC_ALLOC();
294
295static void __init
296yucca_early_serial_map(void)
297{
298 struct uart_port port;
299
300 /* Setup ioremapped serial port access */
301 memset(&port, 0, sizeof(port));
302 port.membase = ioremap64(PPC440SPE_UART0_ADDR, 8);
303 port.irq = UART0_INT;
304 port.uartclk = clocks.uart0;
305 port.regshift = 0;
306 port.iotype = UPIO_MEM;
307 port.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST;
308 port.line = 0;
309
310 if (early_serial_setup(&port) != 0) {
311 printk("Early serial init of port 0 failed\n");
312 }
313
314 port.membase = ioremap64(PPC440SPE_UART1_ADDR, 8);
315 port.irq = UART1_INT;
316 port.uartclk = clocks.uart1;
317 port.line = 1;
318
319 if (early_serial_setup(&port) != 0) {
320 printk("Early serial init of port 1 failed\n");
321 }
322
323 port.membase = ioremap64(PPC440SPE_UART2_ADDR, 8);
324 port.irq = UART2_INT;
325 port.uartclk = BASE_BAUD;
326 port.line = 2;
327
328 if (early_serial_setup(&port) != 0) {
329 printk("Early serial init of port 2 failed\n");
330 }
331}
332
333static void __init
334yucca_setup_arch(void)
335{
336 yucca_set_emacdata();
337
338#if !defined(CONFIG_BDI_SWITCH)
339 /*
340 * The Abatron BDI JTAG debugger does not tolerate others
341 * mucking with the debug registers.
342 */
343 mtspr(SPRN_DBCR0, (DBCR0_TDE | DBCR0_IDM));
344#endif
345
346 /*
347 * Determine various clocks.
348 * To be completely correct we should get SysClk
349 * from FPGA, because it can be changed by on-board switches
350 * --ebs
351 */
352 /* 440GX and 440SPe clocking is the same - rd */
353 ibm440gx_get_clocks(&clocks, 33333333, 6 * 1843200);
354 ocp_sys_info.opb_bus_freq = clocks.opb;
355
356 /* init to some ~sane value until calibrate_delay() runs */
357 loops_per_jiffy = 50000000/HZ;
358
359 /* Setup PCIXn host bridges */
360 yucca_setup_hoses();
361
362#ifdef CONFIG_BLK_DEV_INITRD
363 if (initrd_start)
364 ROOT_DEV = Root_RAM0;
365 else
366#endif
367#ifdef CONFIG_ROOT_NFS
368 ROOT_DEV = Root_NFS;
369#else
370 ROOT_DEV = Root_HDA1;
371#endif
372
373 yucca_early_serial_map();
374
375 /* Identify the system */
376 printk("Yucca port (Roland Dreier <rolandd@cisco.com>)\n");
377}
378
379void __init platform_init(unsigned long r3, unsigned long r4,
380 unsigned long r5, unsigned long r6, unsigned long r7)
381{
382 ibm44x_platform_init(r3, r4, r5, r6, r7);
383
384 ppc_md.setup_arch = yucca_setup_arch;
385 ppc_md.show_cpuinfo = yucca_show_cpuinfo;
386 ppc_md.find_end_of_memory = ibm440sp_find_end_of_memory;
387 ppc_md.get_irq = NULL; /* Set in ppc4xx_pic_init() */
388
389 ppc_md.calibrate_decr = yucca_calibrate_decr;
390#ifdef CONFIG_KGDB
391 ppc_md.early_serial_map = yucca_early_serial_map;
392#endif
393}
diff --git a/arch/ppc/platforms/4xx/yucca.h b/arch/ppc/platforms/4xx/yucca.h
deleted file mode 100644
index bc9684e66a84..000000000000
--- a/arch/ppc/platforms/4xx/yucca.h
+++ /dev/null
@@ -1,108 +0,0 @@
1/*
2 * Yucca board definitions
3 *
4 * Roland Dreier <rolandd@cisco.com> (based on luan.h by Matt Porter)
5 *
6 * Copyright 2004-2005 MontaVista Software Inc.
7 * Copyright (c) 2005 Cisco Systems. All rights reserved.
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation; either version 2 of the License, or (at your
12 * option) any later version.
13 *
14 */
15
16#ifdef __KERNEL__
17#ifndef __ASM_YUCCA_H__
18#define __ASM_YUCCA_H__
19
20#include <platforms/4xx/ppc440spe.h>
21
22/* F/W TLB mapping used in bootloader glue to reset EMAC */
23#define PPC44x_EMAC0_MR0 0xa0000800
24
25/* Location of MAC addresses in PIBS image */
26#define PIBS_FLASH_BASE 0xffe00000
27#define PIBS_MAC_BASE (PIBS_FLASH_BASE+0x1b0400)
28
29/* External timer clock frequency */
30#define YUCCA_TMR_CLK 25000000
31
32/*
33 * FPGA registers
34 */
35#define YUCCA_FPGA_REG_BASE 0x00000004e2000000ULL
36#define YUCCA_FPGA_REG_SIZE 0x24
37
38#define FPGA_REG1A 0x1a
39
40#define FPGA_REG1A_PE0_GLED 0x8000
41#define FPGA_REG1A_PE1_GLED 0x4000
42#define FPGA_REG1A_PE2_GLED 0x2000
43#define FPGA_REG1A_PE0_YLED 0x1000
44#define FPGA_REG1A_PE1_YLED 0x0800
45#define FPGA_REG1A_PE2_YLED 0x0400
46#define FPGA_REG1A_PE0_PWRON 0x0200
47#define FPGA_REG1A_PE1_PWRON 0x0100
48#define FPGA_REG1A_PE2_PWRON 0x0080
49#define FPGA_REG1A_PE0_REFCLK_ENABLE 0x0040
50#define FPGA_REG1A_PE1_REFCLK_ENABLE 0x0020
51#define FPGA_REG1A_PE2_REFCLK_ENABLE 0x0010
52#define FPGA_REG1A_PE_SPREAD0 0x0008
53#define FPGA_REG1A_PE_SPREAD1 0x0004
54#define FPGA_REG1A_PE_SELSOURCE_0 0x0002
55#define FPGA_REG1A_PE_SELSOURCE_1 0x0001
56
57#define FPGA_REG1C 0x1c
58
59#define FPGA_REG1C_PE0_ROOTPOINT 0x8000
60#define FPGA_REG1C_PE1_ENDPOINT 0x4000
61#define FPGA_REG1C_PE2_ENDPOINT 0x2000
62#define FPGA_REG1C_PE0_PRSNT 0x1000
63#define FPGA_REG1C_PE1_PRSNT 0x0800
64#define FPGA_REG1C_PE2_PRSNT 0x0400
65#define FPGA_REG1C_PE0_WAKE 0x0080
66#define FPGA_REG1C_PE1_WAKE 0x0040
67#define FPGA_REG1C_PE2_WAKE 0x0020
68#define FPGA_REG1C_PE0_PERST 0x0010
69#define FPGA_REG1C_PE1_PERST 0x0008
70#define FPGA_REG1C_PE2_PERST 0x0004
71
72/*
73 * Serial port defines
74 */
75#define RS_TABLE_SIZE 3
76
77/* PIBS defined UART mappings, used before early_serial_setup */
78#define UART0_IO_BASE 0xa0000200
79#define UART1_IO_BASE 0xa0000300
80#define UART2_IO_BASE 0xa0000600
81
82#define BASE_BAUD 11059200
83#define STD_UART_OP(num) \
84 { 0, BASE_BAUD, 0, UART##num##_INT, \
85 (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST), \
86 iomem_base: (void*)UART##num##_IO_BASE, \
87 io_type: SERIAL_IO_MEM},
88
89#define SERIAL_PORT_DFNS \
90 STD_UART_OP(0) \
91 STD_UART_OP(1) \
92 STD_UART_OP(2)
93
94/* PCI support */
95#define YUCCA_PCIX_LOWER_IO 0x00000000
96#define YUCCA_PCIX_UPPER_IO 0x0000ffff
97#define YUCCA_PCIX_LOWER_MEM 0x80000000
98#define YUCCA_PCIX_UPPER_MEM 0x8fffffff
99#define YUCCA_PCIE_LOWER_MEM 0x90000000
100#define YUCCA_PCIE_MEM_SIZE 0x10000000
101
102#define YUCCA_PCIX_MEM_SIZE 0x10000000
103#define YUCCA_PCIX_MEM_OFFSET 0x00000000
104#define YUCCA_PCIE_MEM_SIZE 0x10000000
105#define YUCCA_PCIE_MEM_OFFSET 0x00000000
106
107#endif /* __ASM_YUCCA_H__ */
108#endif /* __KERNEL__ */
diff --git a/arch/ppc/platforms/Makefile b/arch/ppc/platforms/Makefile
deleted file mode 100644
index 6260231987cb..000000000000
--- a/arch/ppc/platforms/Makefile
+++ /dev/null
@@ -1,25 +0,0 @@
1#
2# Makefile for the linux kernel.
3#
4
5obj-$(CONFIG_PPC_PREP) += prep_pci.o prep_setup.o
6obj-$(CONFIG_PREP_RESIDUAL) += residual.o
7obj-$(CONFIG_TQM8260) += tqm8260_setup.o
8obj-$(CONFIG_CPCI690) += cpci690.o
9obj-$(CONFIG_EV64260) += ev64260.o
10obj-$(CONFIG_CHESTNUT) += chestnut.o
11obj-$(CONFIG_LOPEC) += lopec.o
12obj-$(CONFIG_KATANA) += katana.o
13obj-$(CONFIG_HDPU) += hdpu.o
14obj-$(CONFIG_MVME5100) += mvme5100.o
15obj-$(CONFIG_PAL4) += pal4_setup.o pal4_pci.o
16obj-$(CONFIG_POWERPMC250) += powerpmc250.o
17obj-$(CONFIG_PPLUS) += pplus.o
18obj-$(CONFIG_PRPMC750) += prpmc750.o
19obj-$(CONFIG_PRPMC800) += prpmc800.o
20obj-$(CONFIG_RADSTONE_PPC7D) += radstone_ppc7d.o
21obj-$(CONFIG_SANDPOINT) += sandpoint.o
22obj-$(CONFIG_SBC82xx) += sbc82xx.o
23obj-$(CONFIG_SPRUCE) += spruce.o
24obj-$(CONFIG_LITE5200) += lite5200.o
25obj-$(CONFIG_EV64360) += ev64360.o
diff --git a/arch/ppc/platforms/bseip.h b/arch/ppc/platforms/bseip.h
deleted file mode 100644
index 691f4a52b0a5..000000000000
--- a/arch/ppc/platforms/bseip.h
+++ /dev/null
@@ -1,38 +0,0 @@
1/*
2 * A collection of structures, addresses, and values associated with
3 * the Bright Star Engineering ip-Engine board. Copied from the MBX stuff.
4 *
5 * Copyright (c) 1998 Dan Malek (dmalek@jlc.net)
6 */
7#ifndef __MACH_BSEIP_DEFS
8#define __MACH_BSEIP_DEFS
9
10#ifndef __ASSEMBLY__
11/* A Board Information structure that is given to a program when
12 * prom starts it up.
13 */
14typedef struct bd_info {
15 unsigned int bi_memstart; /* Memory start address */
16 unsigned int bi_memsize; /* Memory (end) size in bytes */
17 unsigned int bi_intfreq; /* Internal Freq, in Hz */
18 unsigned int bi_busfreq; /* Bus Freq, in Hz */
19 unsigned char bi_enetaddr[6];
20 unsigned int bi_baudrate;
21} bd_t;
22
23extern bd_t m8xx_board_info;
24
25/* Memory map is configured by the PROM startup.
26 * All we need to get started is the IMMR.
27 */
28#define IMAP_ADDR ((uint)0xff000000)
29#define IMAP_SIZE ((uint)(64 * 1024))
30#define PCMCIA_MEM_ADDR ((uint)0x04000000)
31#define PCMCIA_MEM_SIZE ((uint)(64 * 1024))
32#endif /* !__ASSEMBLY__ */
33
34/* We don't use the 8259.
35*/
36#define NR_8259_INTS 0
37
38#endif
diff --git a/arch/ppc/platforms/ccm.h b/arch/ppc/platforms/ccm.h
deleted file mode 100644
index 69000b1c7a4c..000000000000
--- a/arch/ppc/platforms/ccm.h
+++ /dev/null
@@ -1,27 +0,0 @@
1/*
2 * Siemens Card Controller Module specific definitions
3 *
4 * Copyright (C) 2001-2002 Wolfgang Denk (wd@denx.de)
5 */
6
7#ifndef __MACH_CCM_H
8#define __MACH_CCM_H
9
10
11#include <asm/ppcboot.h>
12
13#define CCM_IMMR_BASE 0xF0000000 /* phys. addr of IMMR */
14#define CCM_IMAP_SIZE (64 * 1024) /* size of mapped area */
15
16#define IMAP_ADDR CCM_IMMR_BASE /* physical base address of IMMR area */
17#define IMAP_SIZE CCM_IMAP_SIZE /* mapped size of IMMR area */
18
19#define FEC_INTERRUPT 13 /* = SIU_LEVEL6 */
20#define DEC_INTERRUPT 11 /* = SIU_LEVEL5 */
21#define CPM_INTERRUPT 9 /* = SIU_LEVEL4 */
22
23/* We don't use the 8259.
24*/
25#define NR_8259_INTS 0
26
27#endif /* __MACH_CCM_H */
diff --git a/arch/ppc/platforms/chestnut.c b/arch/ppc/platforms/chestnut.c
deleted file mode 100644
index 27c140f218ed..000000000000
--- a/arch/ppc/platforms/chestnut.c
+++ /dev/null
@@ -1,574 +0,0 @@
1/*
2 * Board setup routines for IBM Chestnut
3 *
4 * Author: <source@mvista.com>
5 *
6 * <2004> (c) MontaVista Software, Inc. This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10 */
11
12#include <linux/stddef.h>
13#include <linux/kernel.h>
14#include <linux/init.h>
15#include <linux/errno.h>
16#include <linux/reboot.h>
17#include <linux/kdev_t.h>
18#include <linux/major.h>
19#include <linux/blkdev.h>
20#include <linux/console.h>
21#include <linux/root_dev.h>
22#include <linux/initrd.h>
23#include <linux/delay.h>
24#include <linux/seq_file.h>
25#include <linux/serial.h>
26#include <linux/serial_core.h>
27#include <linux/serial_8250.h>
28#include <linux/mtd/physmap.h>
29#include <asm/system.h>
30#include <asm/pgtable.h>
31#include <asm/page.h>
32#include <asm/time.h>
33#include <asm/dma.h>
34#include <asm/io.h>
35#include <asm/hw_irq.h>
36#include <asm/machdep.h>
37#include <asm/kgdb.h>
38#include <asm/bootinfo.h>
39#include <asm/mv64x60.h>
40#include <platforms/chestnut.h>
41
42static void __iomem *sram_base; /* Virtual addr of Internal SRAM */
43static void __iomem *cpld_base; /* Virtual addr of CPLD Regs */
44
45static mv64x60_handle_t bh;
46
47extern void gen550_progress(char *, unsigned short);
48extern void gen550_init(int, struct uart_port *);
49extern void mv64360_pcibios_fixup(mv64x60_handle_t *bh);
50
51#define CHESTNUT_PRESERVE_MASK (BIT(MV64x60_CPU2DEV_0_WIN) | \
52 BIT(MV64x60_CPU2DEV_1_WIN) | \
53 BIT(MV64x60_CPU2DEV_2_WIN) | \
54 BIT(MV64x60_CPU2DEV_3_WIN) | \
55 BIT(MV64x60_CPU2BOOT_WIN))
56/**************************************************************************
57 * FUNCTION: chestnut_calibrate_decr
58 *
59 * DESCRIPTION: initialize decrementer interrupt frequency (used as system
60 * timer)
61 *
62 ****/
63static void __init
64chestnut_calibrate_decr(void)
65{
66 ulong freq;
67
68 freq = CHESTNUT_BUS_SPEED / 4;
69
70 printk("time_init: decrementer frequency = %lu.%.6lu MHz\n",
71 freq/1000000, freq%1000000);
72
73 tb_ticks_per_jiffy = freq / HZ;
74 tb_to_us = mulhwu_scale_factor(freq, 1000000);
75}
76
77static int
78chestnut_show_cpuinfo(struct seq_file *m)
79{
80 seq_printf(m, "vendor\t\t: IBM\n");
81 seq_printf(m, "machine\t\t: 750FX/GX Eval Board (Chestnut/Buckeye)\n");
82
83 return 0;
84}
85
86/**************************************************************************
87 * FUNCTION: chestnut_find_end_of_memory
88 *
89 * DESCRIPTION: ppc_md memory size callback
90 *
91 ****/
92unsigned long __init
93chestnut_find_end_of_memory(void)
94{
95 static int mem_size = 0;
96
97 if (mem_size == 0) {
98 mem_size = mv64x60_get_mem_size(CONFIG_MV64X60_NEW_BASE,
99 MV64x60_TYPE_MV64460);
100 }
101 return mem_size;
102}
103
104#if defined(CONFIG_SERIAL_8250)
105static void __init
106chestnut_early_serial_map(void)
107{
108 struct uart_port port;
109
110 /* Setup serial port access */
111 memset(&port, 0, sizeof(port));
112 port.uartclk = BASE_BAUD * 16;
113 port.irq = UART0_INT;
114 port.flags = STD_COM_FLAGS | UPF_IOREMAP;
115 port.iotype = UPIO_MEM;
116 port.mapbase = CHESTNUT_UART0_IO_BASE;
117 port.regshift = 0;
118
119 if (early_serial_setup(&port) != 0)
120 printk("Early serial init of port 0 failed\n");
121
122 /* Assume early_serial_setup() doesn't modify serial_req */
123 port.line = 1;
124 port.irq = UART1_INT;
125 port.mapbase = CHESTNUT_UART1_IO_BASE;
126
127 if (early_serial_setup(&port) != 0)
128 printk("Early serial init of port 1 failed\n");
129}
130#endif
131
132/**************************************************************************
133 * FUNCTION: chestnut_map_irq
134 *
135 * DESCRIPTION: 0 return since PCI IRQs not needed
136 *
137 ****/
138static int __init
139chestnut_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
140{
141 static char pci_irq_table[][4] = {
142 {CHESTNUT_PCI_SLOT0_IRQ, CHESTNUT_PCI_SLOT0_IRQ,
143 CHESTNUT_PCI_SLOT0_IRQ, CHESTNUT_PCI_SLOT0_IRQ},
144 {CHESTNUT_PCI_SLOT1_IRQ, CHESTNUT_PCI_SLOT1_IRQ,
145 CHESTNUT_PCI_SLOT1_IRQ, CHESTNUT_PCI_SLOT1_IRQ},
146 {CHESTNUT_PCI_SLOT2_IRQ, CHESTNUT_PCI_SLOT2_IRQ,
147 CHESTNUT_PCI_SLOT2_IRQ, CHESTNUT_PCI_SLOT2_IRQ},
148 {CHESTNUT_PCI_SLOT3_IRQ, CHESTNUT_PCI_SLOT3_IRQ,
149 CHESTNUT_PCI_SLOT3_IRQ, CHESTNUT_PCI_SLOT3_IRQ},
150 };
151 const long min_idsel = 1, max_idsel = 4, irqs_per_slot = 4;
152
153 return PCI_IRQ_TABLE_LOOKUP;
154}
155
156
157/**************************************************************************
158 * FUNCTION: chestnut_setup_bridge
159 *
160 * DESCRIPTION: initalize board-specific settings on the MV64360
161 *
162 ****/
163static void __init
164chestnut_setup_bridge(void)
165{
166 struct mv64x60_setup_info si;
167 int i;
168
169 if ( ppc_md.progress )
170 ppc_md.progress("chestnut_setup_bridge: enter", 0);
171
172 memset(&si, 0, sizeof(si));
173
174 si.phys_reg_base = CONFIG_MV64X60_NEW_BASE;
175
176 /* setup only PCI bus 0 (bus 1 not used) */
177 si.pci_0.enable_bus = 1;
178 si.pci_0.pci_io.cpu_base = CHESTNUT_PCI0_IO_PROC_ADDR;
179 si.pci_0.pci_io.pci_base_hi = 0;
180 si.pci_0.pci_io.pci_base_lo = CHESTNUT_PCI0_IO_PCI_ADDR;
181 si.pci_0.pci_io.size = CHESTNUT_PCI0_IO_SIZE;
182 si.pci_0.pci_io.swap = MV64x60_CPU2PCI_SWAP_NONE; /* no swapping */
183 si.pci_0.pci_mem[0].cpu_base = CHESTNUT_PCI0_MEM_PROC_ADDR;
184 si.pci_0.pci_mem[0].pci_base_hi = CHESTNUT_PCI0_MEM_PCI_HI_ADDR;
185 si.pci_0.pci_mem[0].pci_base_lo = CHESTNUT_PCI0_MEM_PCI_LO_ADDR;
186 si.pci_0.pci_mem[0].size = CHESTNUT_PCI0_MEM_SIZE;
187 si.pci_0.pci_mem[0].swap = MV64x60_CPU2PCI_SWAP_NONE; /* no swapping */
188 si.pci_0.pci_cmd_bits = 0;
189 si.pci_0.latency_timer = 0x80;
190
191 for (i=0; i<MV64x60_CPU2MEM_WINDOWS; i++) {
192#if defined(CONFIG_NOT_COHERENT_CACHE)
193 si.cpu_prot_options[i] = 0;
194 si.enet_options[i] = MV64360_ENET2MEM_SNOOP_NONE;
195 si.mpsc_options[i] = MV64360_MPSC2MEM_SNOOP_NONE;
196 si.idma_options[i] = MV64360_IDMA2MEM_SNOOP_NONE;
197
198 si.pci_1.acc_cntl_options[i] =
199 MV64360_PCI_ACC_CNTL_SNOOP_NONE |
200 MV64360_PCI_ACC_CNTL_SWAP_NONE |
201 MV64360_PCI_ACC_CNTL_MBURST_128_BYTES |
202 MV64360_PCI_ACC_CNTL_RDSIZE_256_BYTES;
203#else
204 si.cpu_prot_options[i] = 0;
205 si.enet_options[i] = MV64360_ENET2MEM_SNOOP_NONE; /* errata */
206 si.mpsc_options[i] = MV64360_MPSC2MEM_SNOOP_NONE; /* errata */
207 si.idma_options[i] = MV64360_IDMA2MEM_SNOOP_NONE; /* errata */
208
209 si.pci_1.acc_cntl_options[i] =
210 MV64360_PCI_ACC_CNTL_SNOOP_WB |
211 MV64360_PCI_ACC_CNTL_SWAP_NONE |
212 MV64360_PCI_ACC_CNTL_MBURST_32_BYTES |
213 MV64360_PCI_ACC_CNTL_RDSIZE_32_BYTES;
214#endif
215 }
216
217 /* Lookup host bridge - on CPU 0 - no SMP support */
218 if (mv64x60_init(&bh, &si)) {
219 printk("\n\nPCI Bridge initialization failed!\n");
220 }
221
222 pci_dram_offset = 0;
223 ppc_md.pci_swizzle = common_swizzle;
224 ppc_md.pci_map_irq = chestnut_map_irq;
225 ppc_md.pci_exclude_device = mv64x60_pci_exclude_device;
226
227 mv64x60_set_bus(&bh, 0, 0);
228 bh.hose_a->first_busno = 0;
229 bh.hose_a->last_busno = 0xff;
230 bh.hose_a->last_busno = pciauto_bus_scan(bh.hose_a, 0);
231}
232
233void __init
234chestnut_setup_peripherals(void)
235{
236 mv64x60_set_32bit_window(&bh, MV64x60_CPU2BOOT_WIN,
237 CHESTNUT_BOOT_8BIT_BASE, CHESTNUT_BOOT_8BIT_SIZE, 0);
238 bh.ci->enable_window_32bit(&bh, MV64x60_CPU2BOOT_WIN);
239
240 mv64x60_set_32bit_window(&bh, MV64x60_CPU2DEV_0_WIN,
241 CHESTNUT_32BIT_BASE, CHESTNUT_32BIT_SIZE, 0);
242 bh.ci->enable_window_32bit(&bh, MV64x60_CPU2DEV_0_WIN);
243
244 mv64x60_set_32bit_window(&bh, MV64x60_CPU2DEV_1_WIN,
245 CHESTNUT_CPLD_BASE, CHESTNUT_CPLD_SIZE, 0);
246 bh.ci->enable_window_32bit(&bh, MV64x60_CPU2DEV_1_WIN);
247 cpld_base = ioremap(CHESTNUT_CPLD_BASE, CHESTNUT_CPLD_SIZE);
248
249 mv64x60_set_32bit_window(&bh, MV64x60_CPU2DEV_2_WIN,
250 CHESTNUT_UART_BASE, CHESTNUT_UART_SIZE, 0);
251 bh.ci->enable_window_32bit(&bh, MV64x60_CPU2DEV_2_WIN);
252
253 mv64x60_set_32bit_window(&bh, MV64x60_CPU2DEV_3_WIN,
254 CHESTNUT_FRAM_BASE, CHESTNUT_FRAM_SIZE, 0);
255 bh.ci->enable_window_32bit(&bh, MV64x60_CPU2DEV_3_WIN);
256
257 mv64x60_set_32bit_window(&bh, MV64x60_CPU2SRAM_WIN,
258 CHESTNUT_INTERNAL_SRAM_BASE, MV64360_SRAM_SIZE, 0);
259 bh.ci->enable_window_32bit(&bh, MV64x60_CPU2SRAM_WIN);
260
261#ifdef CONFIG_NOT_COHERENT_CACHE
262 mv64x60_write(&bh, MV64360_SRAM_CONFIG, 0x001600b0);
263#else
264 mv64x60_write(&bh, MV64360_SRAM_CONFIG, 0x001600b2);
265#endif
266 sram_base = ioremap(CHESTNUT_INTERNAL_SRAM_BASE, MV64360_SRAM_SIZE);
267 memset(sram_base, 0, MV64360_SRAM_SIZE);
268
269 /*
270 * Configure MPP pins for PCI DMA
271 *
272 * PCI Slot GNT pin REQ pin
273 * 0 MPP16 MPP17
274 * 1 MPP18 MPP19
275 * 2 MPP20 MPP21
276 * 3 MPP22 MPP23
277 */
278 mv64x60_write(&bh, MV64x60_MPP_CNTL_2,
279 (0x1 << 0) | /* MPPSel16 PCI0_GNT[0] */
280 (0x1 << 4) | /* MPPSel17 PCI0_REQ[0] */
281 (0x1 << 8) | /* MPPSel18 PCI0_GNT[1] */
282 (0x1 << 12) | /* MPPSel19 PCI0_REQ[1] */
283 (0x1 << 16) | /* MPPSel20 PCI0_GNT[2] */
284 (0x1 << 20) | /* MPPSel21 PCI0_REQ[2] */
285 (0x1 << 24) | /* MPPSel22 PCI0_GNT[3] */
286 (0x1 << 28)); /* MPPSel23 PCI0_REQ[3] */
287 /*
288 * Set unused MPP pins for output, as per schematic note
289 *
290 * Unused Pins: MPP01, MPP02, MPP04, MPP05, MPP06
291 * MPP09, MPP10, MPP13, MPP14, MPP15
292 */
293 mv64x60_clr_bits(&bh, MV64x60_MPP_CNTL_0,
294 (0xf << 4) | /* MPPSel01 GPIO[1] */
295 (0xf << 8) | /* MPPSel02 GPIO[2] */
296 (0xf << 16) | /* MPPSel04 GPIO[4] */
297 (0xf << 20) | /* MPPSel05 GPIO[5] */
298 (0xf << 24)); /* MPPSel06 GPIO[6] */
299 mv64x60_clr_bits(&bh, MV64x60_MPP_CNTL_1,
300 (0xf << 4) | /* MPPSel09 GPIO[9] */
301 (0xf << 8) | /* MPPSel10 GPIO[10] */
302 (0xf << 20) | /* MPPSel13 GPIO[13] */
303 (0xf << 24) | /* MPPSel14 GPIO[14] */
304 (0xf << 28)); /* MPPSel15 GPIO[15] */
305 mv64x60_set_bits(&bh, MV64x60_GPP_IO_CNTL, /* Output */
306 BIT(1) | BIT(2) | BIT(4) | BIT(5) | BIT(6) |
307 BIT(9) | BIT(10) | BIT(13) | BIT(14) | BIT(15));
308
309 /*
310 * Configure the following MPP pins to indicate a level
311 * triggered interrupt
312 *
313 * MPP24 - Board Reset (just map the MPP & GPP for chestnut_reset)
314 * MPP25 - UART A (high)
315 * MPP26 - UART B (high)
316 * MPP28 - PCI Slot 3 (low)
317 * MPP29 - PCI Slot 2 (low)
318 * MPP30 - PCI Slot 1 (low)
319 * MPP31 - PCI Slot 0 (low)
320 */
321 mv64x60_clr_bits(&bh, MV64x60_MPP_CNTL_3,
322 BIT(3) | BIT(2) | BIT(1) | BIT(0) | /* MPP 24 */
323 BIT(7) | BIT(6) | BIT(5) | BIT(4) | /* MPP 25 */
324 BIT(11) | BIT(10) | BIT(9) | BIT(8) | /* MPP 26 */
325 BIT(19) | BIT(18) | BIT(17) | BIT(16) | /* MPP 28 */
326 BIT(23) | BIT(22) | BIT(21) | BIT(20) | /* MPP 29 */
327 BIT(27) | BIT(26) | BIT(25) | BIT(24) | /* MPP 30 */
328 BIT(31) | BIT(30) | BIT(29) | BIT(28)); /* MPP 31 */
329
330 /*
331 * Define GPP 25 (high), 26 (high), 28 (low), 29 (low), 30 (low),
332 * 31 (low) interrupt polarity input signal and level triggered
333 */
334 mv64x60_clr_bits(&bh, MV64x60_GPP_LEVEL_CNTL, BIT(25) | BIT(26));
335 mv64x60_set_bits(&bh, MV64x60_GPP_LEVEL_CNTL,
336 BIT(28) | BIT(29) | BIT(30) | BIT(31));
337 mv64x60_clr_bits(&bh, MV64x60_GPP_IO_CNTL,
338 BIT(25) | BIT(26) | BIT(28) | BIT(29) | BIT(30) |
339 BIT(31));
340
341 /* Config GPP interrupt controller to respond to level trigger */
342 mv64x60_set_bits(&bh, MV64360_COMM_ARBITER_CNTL, BIT(10));
343
344 /*
345 * Dismiss and then enable interrupt on GPP interrupt cause for CPU #0
346 */
347 mv64x60_write(&bh, MV64x60_GPP_INTR_CAUSE,
348 ~(BIT(25) | BIT(26) | BIT(28) | BIT(29) | BIT(30) |
349 BIT(31)));
350 mv64x60_set_bits(&bh, MV64x60_GPP_INTR_MASK,
351 BIT(25) | BIT(26) | BIT(28) | BIT(29) | BIT(30) |
352 BIT(31));
353
354 /*
355 * Dismiss and then enable interrupt on CPU #0 high cause register
356 * BIT27 summarizes GPP interrupts 24-31
357 */
358 mv64x60_set_bits(&bh, MV64360_IC_CPU0_INTR_MASK_HI, BIT(27));
359
360 if (ppc_md.progress)
361 ppc_md.progress("chestnut_setup_bridge: exit", 0);
362}
363
364/**************************************************************************
365 * FUNCTION: chestnut_setup_arch
366 *
367 * DESCRIPTION: ppc_md machine configuration callback
368 *
369 ****/
370static void __init
371chestnut_setup_arch(void)
372{
373 if (ppc_md.progress)
374 ppc_md.progress("chestnut_setup_arch: enter", 0);
375
376 /* init to some ~sane value until calibrate_delay() runs */
377 loops_per_jiffy = 50000000 / HZ;
378
379 /* if the time base value is greater than bus freq/4 (the TB and
380 * decrementer tick rate) + signed integer rollover value, we
381 * can spend a fair amount of time waiting for the rollover to
382 * happen. To get around this, initialize the time base register
383 * to a "safe" value.
384 */
385 set_tb(0, 0);
386
387#ifdef CONFIG_BLK_DEV_INITRD
388 if (initrd_start)
389 ROOT_DEV = Root_RAM0;
390 else
391#endif
392#ifdef CONFIG_ROOT_NFS
393 ROOT_DEV = Root_NFS;
394#else
395 ROOT_DEV = Root_SDA2;
396#endif
397
398 /*
399 * Set up the L2CR register.
400 */
401 _set_L2CR(_get_L2CR() | L2CR_L2E);
402
403 chestnut_setup_bridge();
404 chestnut_setup_peripherals();
405
406#ifdef CONFIG_DUMMY_CONSOLE
407 conswitchp = &dummy_con;
408#endif
409
410#if defined(CONFIG_SERIAL_8250)
411 chestnut_early_serial_map();
412#endif
413
414 /* Identify the system */
415 printk(KERN_INFO "System Identification: IBM 750FX/GX Eval Board\n");
416 printk(KERN_INFO "IBM 750FX/GX port (C) 2004 MontaVista Software, Inc."
417 " (source@mvista.com)\n");
418
419 if (ppc_md.progress)
420 ppc_md.progress("chestnut_setup_arch: exit", 0);
421}
422
423#ifdef CONFIG_MTD_PHYSMAP
424static struct mtd_partition ptbl;
425
426static int __init
427chestnut_setup_mtd(void)
428{
429 memset(&ptbl, 0, sizeof(ptbl));
430
431 ptbl.name = "User FS";
432 ptbl.size = CHESTNUT_32BIT_SIZE;
433
434 physmap_map.size = CHESTNUT_32BIT_SIZE;
435 physmap_set_partitions(&ptbl, 1);
436 return 0;
437}
438
439arch_initcall(chestnut_setup_mtd);
440#endif
441
442/**************************************************************************
443 * FUNCTION: chestnut_restart
444 *
445 * DESCRIPTION: ppc_md machine reset callback
446 * reset the board via the CPLD command register
447 *
448 ****/
449static void
450chestnut_restart(char *cmd)
451{
452 volatile ulong i = 10000000;
453
454 local_irq_disable();
455
456 /*
457 * Set CPLD Reg 3 bit 0 to 1 to allow MPP signals on reset to work
458 *
459 * MPP24 - board reset
460 */
461 writeb(0x1, cpld_base + 3);
462
463 /* GPP pin tied to MPP earlier */
464 mv64x60_set_bits(&bh, MV64x60_GPP_VALUE_SET, BIT(24));
465
466 while (i-- > 0);
467 panic("restart failed\n");
468}
469
470static void
471chestnut_halt(void)
472{
473 local_irq_disable();
474 for (;;);
475 /* NOTREACHED */
476}
477
478static void
479chestnut_power_off(void)
480{
481 chestnut_halt();
482 /* NOTREACHED */
483}
484
485/**************************************************************************
486 * FUNCTION: chestnut_map_io
487 *
488 * DESCRIPTION: configure fixed memory-mapped IO
489 *
490 ****/
491static void __init
492chestnut_map_io(void)
493{
494#if defined(CONFIG_SERIAL_TEXT_DEBUG) || defined(CONFIG_KGDB)
495 io_block_mapping(CHESTNUT_UART_BASE, CHESTNUT_UART_BASE, 0x100000,
496 _PAGE_IO);
497#endif
498}
499
500/**************************************************************************
501 * FUNCTION: chestnut_set_bat
502 *
503 * DESCRIPTION: configures a (temporary) bat mapping for early access to
504 * device I/O
505 *
506 ****/
507static __inline__ void
508chestnut_set_bat(void)
509{
510 mb();
511 mtspr(SPRN_DBAT3U, 0xf0001ffe);
512 mtspr(SPRN_DBAT3L, 0xf000002a);
513 mb();
514}
515
516/**************************************************************************
517 * FUNCTION: platform_init
518 *
519 * DESCRIPTION: main entry point for configuring board-specific machine
520 * callbacks
521 *
522 ****/
523void __init
524platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
525 unsigned long r6, unsigned long r7)
526{
527 parse_bootinfo(find_bootinfo());
528
529 /* Copy the kernel command line arguments to a safe place. */
530
531 if (r6) {
532 *(char *) (r7 + KERNELBASE) = 0;
533 strcpy(cmd_line, (char *) (r6 + KERNELBASE));
534 }
535
536 isa_mem_base = 0;
537
538 ppc_md.setup_arch = chestnut_setup_arch;
539 ppc_md.show_cpuinfo = chestnut_show_cpuinfo;
540 ppc_md.init_IRQ = mv64360_init_irq;
541 ppc_md.get_irq = mv64360_get_irq;
542 ppc_md.init = NULL;
543
544 ppc_md.find_end_of_memory = chestnut_find_end_of_memory;
545 ppc_md.setup_io_mappings = chestnut_map_io;
546
547 ppc_md.restart = chestnut_restart;
548 ppc_md.power_off = chestnut_power_off;
549 ppc_md.halt = chestnut_halt;
550
551 ppc_md.time_init = NULL;
552 ppc_md.set_rtc_time = NULL;
553 ppc_md.get_rtc_time = NULL;
554 ppc_md.calibrate_decr = chestnut_calibrate_decr;
555
556 ppc_md.nvram_read_val = NULL;
557 ppc_md.nvram_write_val = NULL;
558
559 ppc_md.heartbeat = NULL;
560
561 bh.p_base = CONFIG_MV64X60_NEW_BASE;
562
563 chestnut_set_bat();
564
565#if defined(CONFIG_SERIAL_TEXT_DEBUG)
566 ppc_md.progress = gen550_progress;
567#endif
568#if defined(CONFIG_KGDB)
569 ppc_md.kgdb_map_scc = gen550_kgdb_map_scc;
570#endif
571
572 if (ppc_md.progress)
573 ppc_md.progress("chestnut_init(): exit", 0);
574}
diff --git a/arch/ppc/platforms/chestnut.h b/arch/ppc/platforms/chestnut.h
deleted file mode 100644
index e00fd9f8bbd0..000000000000
--- a/arch/ppc/platforms/chestnut.h
+++ /dev/null
@@ -1,127 +0,0 @@
1/*
2 * Definitions for IBM 750FXGX Eval (Chestnut)
3 *
4 * Author: <source@mvista.com>
5 *
6 * Based on Artesyn Katana code done by Tim Montgomery <timm@artesyncp.com>
7 * Based on code done by Rabeeh Khoury - rabeeh@galileo.co.il
8 * Based on code done by Mark A. Greer <mgreer@mvista.com>
9 *
10 * <2004> (c) MontaVista Software, Inc. This file is licensed under
11 * the terms of the GNU General Public License version 2. This program
12 * is licensed "as is" without any warranty of any kind, whether express
13 * or implied.
14 */
15
16/*
17 * This is the CPU physical memory map (windows must be at least 1MB and start
18 * on a boundary that is a multiple of the window size):
19 *
20 * Seems on the IBM 750FXGX Eval board, the MV64460 Registers can be in
21 * only 2 places per switch U17 0x14000000 or 0xf1000000 easily - chose to
22 * implement at 0xf1000000 only at this time
23 *
24 * 0xfff00000-0xffffffff - 8 Flash
25 * 0xffe00000-0xffefffff - BOOT SRAM
26 * 0xffd00000-0xffd00004 - CPLD
27 * 0xffc00000-0xffc0000f - UART
28 * 0xffb00000-0xffb07fff - FRAM
29 * 0xff840000-0xffafffff - *** HOLE ***
30 * 0xff800000-0xff83ffff - MV64460 Integrated SRAM
31 * 0xfe000000-0xff8fffff - *** HOLE ***
32 * 0xfc000000-0xfdffffff - 32bit Flash
33 * 0xf1010000-0xfbffffff - *** HOLE ***
34 * 0xf1000000-0xf100ffff - MV64460 Registers
35 */
36
37#ifndef __PPC_PLATFORMS_CHESTNUT_H__
38#define __PPC_PLATFORMS_CHESTNUT_H__
39
40#define CHESTNUT_BOOT_8BIT_BASE 0xfff00000
41#define CHESTNUT_BOOT_8BIT_SIZE_ACTUAL (1024*1024)
42#define CHESTNUT_BOOT_SRAM_BASE 0xffe00000
43#define CHESTNUT_BOOT_SRAM_SIZE_ACTUAL (1024*1024)
44#define CHESTNUT_CPLD_BASE 0xffd00000
45#define CHESTNUT_CPLD_SIZE_ACTUAL 5
46#define CHESTNUT_CPLD_REG3 (CHESTNUT_CPLD_BASE+3)
47#define CHESTNUT_UART_BASE 0xffc00000
48#define CHESTNUT_UART_SIZE_ACTUAL 16
49#define CHESTNUT_FRAM_BASE 0xffb00000
50#define CHESTNUT_FRAM_SIZE_ACTUAL (32*1024)
51#define CHESTNUT_INTERNAL_SRAM_BASE 0xff800000
52#define CHESTNUT_32BIT_BASE 0xfc000000
53#define CHESTNUT_32BIT_SIZE (32*1024*1024)
54
55#define CHESTNUT_BOOT_8BIT_SIZE max(MV64360_WINDOW_SIZE_MIN, \
56 CHESTNUT_BOOT_8BIT_SIZE_ACTUAL)
57#define CHESTNUT_BOOT_SRAM_SIZE max(MV64360_WINDOW_SIZE_MIN, \
58 CHESTNUT_BOOT_SRAM_SIZE_ACTUAL)
59#define CHESTNUT_CPLD_SIZE max(MV64360_WINDOW_SIZE_MIN, \
60 CHESTNUT_CPLD_SIZE_ACTUAL)
61#define CHESTNUT_UART_SIZE max(MV64360_WINDOW_SIZE_MIN, \
62 CHESTNUT_UART_SIZE_ACTUAL)
63#define CHESTNUT_FRAM_SIZE max(MV64360_WINDOW_SIZE_MIN, \
64 CHESTNUT_FRAM_SIZE_ACTUAL)
65
66#define CHESTNUT_BUS_SPEED 200000000
67#define CHESTNUT_PIBS_DATABASE 0xf0000 /* from PIBS src code */
68
69#define KATANA_ETH0_PHY_ADDR 12
70#define KATANA_ETH1_PHY_ADDR 11
71#define KATANA_ETH2_PHY_ADDR 4
72
73#define CHESTNUT_ETH_TX_QUEUE_SIZE 800
74#define CHESTNUT_ETH_RX_QUEUE_SIZE 400
75
76/*
77 * PCI windows
78 */
79
80#define CHESTNUT_PCI0_MEM_PROC_ADDR 0x80000000
81#define CHESTNUT_PCI0_MEM_PCI_HI_ADDR 0x00000000
82#define CHESTNUT_PCI0_MEM_PCI_LO_ADDR 0x80000000
83#define CHESTNUT_PCI0_MEM_SIZE 0x10000000
84#define CHESTNUT_PCI0_IO_PROC_ADDR 0xa0000000
85#define CHESTNUT_PCI0_IO_PCI_ADDR 0x00000000
86#define CHESTNUT_PCI0_IO_SIZE 0x01000000
87
88/*
89 * Board-specific IRQ info
90 */
91#define CHESTNUT_PCI_SLOT0_IRQ (64 + 31)
92#define CHESTNUT_PCI_SLOT1_IRQ (64 + 30)
93#define CHESTNUT_PCI_SLOT2_IRQ (64 + 29)
94#define CHESTNUT_PCI_SLOT3_IRQ (64 + 28)
95
96/* serial port definitions */
97#define CHESTNUT_UART0_IO_BASE (CHESTNUT_UART_BASE + 8)
98#define CHESTNUT_UART1_IO_BASE CHESTNUT_UART_BASE
99
100#define UART0_INT (64 + 25)
101#define UART1_INT (64 + 26)
102
103#ifdef CONFIG_SERIAL_MANY_PORTS
104#define RS_TABLE_SIZE 64
105#else
106#define RS_TABLE_SIZE 2
107#endif
108
109/* Rate for the 3.6864 Mhz clock for the onboard serial chip */
110#define BASE_BAUD (3686400 / 16)
111
112#ifdef CONFIG_SERIAL_DETECT_IRQ
113#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF|ASYNC_SKIP_TEST|ASYNC_AUTO_IRQ)
114#else
115#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF|ASYNC_SKIP_TEST)
116#endif
117
118#define STD_UART_OP(num) \
119 { 0, BASE_BAUD, 0, UART##num##_INT, STD_COM_FLAGS, \
120 iomem_base: (u8 *)CHESTNUT_UART##num##_IO_BASE, \
121 io_type: SERIAL_IO_MEM},
122
123#define SERIAL_PORT_DFNS \
124 STD_UART_OP(0) \
125 STD_UART_OP(1)
126
127#endif /* __PPC_PLATFORMS_CHESTNUT_H__ */
diff --git a/arch/ppc/platforms/cpci690.c b/arch/ppc/platforms/cpci690.c
deleted file mode 100644
index 07f672d58767..000000000000
--- a/arch/ppc/platforms/cpci690.c
+++ /dev/null
@@ -1,453 +0,0 @@
1/*
2 * Board setup routines for the Force CPCI690 board.
3 *
4 * Author: Mark A. Greer <mgreer@mvista.com>
5 *
6 * 2003 (c) MontaVista Software, Inc. This file is licensed under
7 * the terms of the GNU General Public License version 2. This programr
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10 */
11#include <linux/delay.h>
12#include <linux/pci.h>
13#include <linux/irq.h>
14#include <linux/fs.h>
15#include <linux/seq_file.h>
16#include <linux/console.h>
17#include <linux/initrd.h>
18#include <linux/root_dev.h>
19#include <linux/mv643xx.h>
20#include <linux/platform_device.h>
21#include <asm/bootinfo.h>
22#include <asm/machdep.h>
23#include <asm/todc.h>
24#include <asm/time.h>
25#include <asm/mv64x60.h>
26#include <platforms/cpci690.h>
27
28#define BOARD_VENDOR "Force"
29#define BOARD_MACHINE "CPCI690"
30
31/* Set IDE controllers into Native mode? */
32#define SET_PCI_IDE_NATIVE
33
34static struct mv64x60_handle bh;
35static void __iomem *cpci690_br_base;
36
37TODC_ALLOC();
38
39static int __init
40cpci690_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
41{
42 struct pci_controller *hose = pci_bus_to_hose(dev->bus->number);
43
44 if (hose->index == 0) {
45 static char pci_irq_table[][4] =
46 /*
47 * PCI IDSEL/INTPIN->INTLINE
48 * A B C D
49 */
50 {
51 { 90, 91, 88, 89 }, /* IDSEL 30/20 - Sentinel */
52 };
53
54 const long min_idsel = 20, max_idsel = 20, irqs_per_slot = 4;
55 return PCI_IRQ_TABLE_LOOKUP;
56 } else {
57 static char pci_irq_table[][4] =
58 /*
59 * PCI IDSEL/INTPIN->INTLINE
60 * A B C D
61 */
62 {
63 { 93, 94, 95, 92 }, /* IDSEL 28/18 - PMC slot 2 */
64 { 0, 0, 0, 0 }, /* IDSEL 29/19 - Not used */
65 { 94, 95, 92, 93 }, /* IDSEL 30/20 - PMC slot 1 */
66 };
67
68 const long min_idsel = 18, max_idsel = 20, irqs_per_slot = 4;
69 return PCI_IRQ_TABLE_LOOKUP;
70 }
71}
72
73#define GB (1024UL * 1024UL * 1024UL)
74
75static u32
76cpci690_get_bus_freq(void)
77{
78 if (boot_mem_size >= (1*GB)) /* bus speed based on mem size */
79 return 100000000;
80 else
81 return 133333333;
82}
83
84static const unsigned int cpu_750xx[32] = { /* 750FX & 750GX */
85 0, 0, 2, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,/* 0-15*/
86 16, 17, 18, 19, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 0 /*16-31*/
87};
88
89static int
90cpci690_get_cpu_freq(void)
91{
92 unsigned long pll_cfg;
93
94 pll_cfg = (mfspr(SPRN_HID1) & 0xf8000000) >> 27;
95 return cpci690_get_bus_freq() * cpu_750xx[pll_cfg]/2;
96}
97
98static void __init
99cpci690_setup_bridge(void)
100{
101 struct mv64x60_setup_info si;
102 int i;
103
104 memset(&si, 0, sizeof(si));
105
106 si.phys_reg_base = CONFIG_MV64X60_NEW_BASE;
107
108 si.pci_0.enable_bus = 1;
109 si.pci_0.pci_io.cpu_base = CPCI690_PCI0_IO_START_PROC_ADDR;
110 si.pci_0.pci_io.pci_base_hi = 0;
111 si.pci_0.pci_io.pci_base_lo = CPCI690_PCI0_IO_START_PCI_ADDR;
112 si.pci_0.pci_io.size = CPCI690_PCI0_IO_SIZE;
113 si.pci_0.pci_io.swap = MV64x60_CPU2PCI_SWAP_NONE;
114 si.pci_0.pci_mem[0].cpu_base = CPCI690_PCI0_MEM_START_PROC_ADDR;
115 si.pci_0.pci_mem[0].pci_base_hi = CPCI690_PCI0_MEM_START_PCI_HI_ADDR;
116 si.pci_0.pci_mem[0].pci_base_lo = CPCI690_PCI0_MEM_START_PCI_LO_ADDR;
117 si.pci_0.pci_mem[0].size = CPCI690_PCI0_MEM_SIZE;
118 si.pci_0.pci_mem[0].swap = MV64x60_CPU2PCI_SWAP_NONE;
119 si.pci_0.pci_cmd_bits = 0;
120 si.pci_0.latency_timer = 0x80;
121
122 si.pci_1.enable_bus = 1;
123 si.pci_1.pci_io.cpu_base = CPCI690_PCI1_IO_START_PROC_ADDR;
124 si.pci_1.pci_io.pci_base_hi = 0;
125 si.pci_1.pci_io.pci_base_lo = CPCI690_PCI1_IO_START_PCI_ADDR;
126 si.pci_1.pci_io.size = CPCI690_PCI1_IO_SIZE;
127 si.pci_1.pci_io.swap = MV64x60_CPU2PCI_SWAP_NONE;
128 si.pci_1.pci_mem[0].cpu_base = CPCI690_PCI1_MEM_START_PROC_ADDR;
129 si.pci_1.pci_mem[0].pci_base_hi = CPCI690_PCI1_MEM_START_PCI_HI_ADDR;
130 si.pci_1.pci_mem[0].pci_base_lo = CPCI690_PCI1_MEM_START_PCI_LO_ADDR;
131 si.pci_1.pci_mem[0].size = CPCI690_PCI1_MEM_SIZE;
132 si.pci_1.pci_mem[0].swap = MV64x60_CPU2PCI_SWAP_NONE;
133 si.pci_1.pci_cmd_bits = 0;
134 si.pci_1.latency_timer = 0x80;
135
136 for (i=0; i<MV64x60_CPU2MEM_WINDOWS; i++) {
137 si.cpu_prot_options[i] = 0;
138 si.cpu_snoop_options[i] = GT64260_CPU_SNOOP_WB;
139 si.pci_0.acc_cntl_options[i] =
140 GT64260_PCI_ACC_CNTL_DREADEN |
141 GT64260_PCI_ACC_CNTL_RDPREFETCH |
142 GT64260_PCI_ACC_CNTL_RDLINEPREFETCH |
143 GT64260_PCI_ACC_CNTL_RDMULPREFETCH |
144 GT64260_PCI_ACC_CNTL_SWAP_NONE |
145 GT64260_PCI_ACC_CNTL_MBURST_32_BTYES;
146 si.pci_0.snoop_options[i] = GT64260_PCI_SNOOP_WB;
147 si.pci_1.acc_cntl_options[i] =
148 GT64260_PCI_ACC_CNTL_DREADEN |
149 GT64260_PCI_ACC_CNTL_RDPREFETCH |
150 GT64260_PCI_ACC_CNTL_RDLINEPREFETCH |
151 GT64260_PCI_ACC_CNTL_RDMULPREFETCH |
152 GT64260_PCI_ACC_CNTL_SWAP_NONE |
153 GT64260_PCI_ACC_CNTL_MBURST_32_BTYES;
154 si.pci_1.snoop_options[i] = GT64260_PCI_SNOOP_WB;
155 }
156
157 /* Lookup PCI host bridges */
158 if (mv64x60_init(&bh, &si))
159 printk(KERN_ERR "Bridge initialization failed.\n");
160
161 pci_dram_offset = 0; /* System mem at same addr on PCI & cpu bus */
162 ppc_md.pci_swizzle = common_swizzle;
163 ppc_md.pci_map_irq = cpci690_map_irq;
164 ppc_md.pci_exclude_device = mv64x60_pci_exclude_device;
165
166 mv64x60_set_bus(&bh, 0, 0);
167 bh.hose_a->first_busno = 0;
168 bh.hose_a->last_busno = 0xff;
169 bh.hose_a->last_busno = pciauto_bus_scan(bh.hose_a, 0);
170
171 bh.hose_b->first_busno = bh.hose_a->last_busno + 1;
172 mv64x60_set_bus(&bh, 1, bh.hose_b->first_busno);
173 bh.hose_b->last_busno = 0xff;
174 bh.hose_b->last_busno = pciauto_bus_scan(bh.hose_b,
175 bh.hose_b->first_busno);
176}
177
178static void __init
179cpci690_setup_peripherals(void)
180{
181 /* Set up windows to CPLD, RTC/TODC, IPMI. */
182 mv64x60_set_32bit_window(&bh, MV64x60_CPU2DEV_0_WIN, CPCI690_BR_BASE,
183 CPCI690_BR_SIZE, 0);
184 bh.ci->enable_window_32bit(&bh, MV64x60_CPU2DEV_0_WIN);
185 cpci690_br_base = ioremap(CPCI690_BR_BASE, CPCI690_BR_SIZE);
186
187 mv64x60_set_32bit_window(&bh, MV64x60_CPU2DEV_1_WIN, CPCI690_TODC_BASE,
188 CPCI690_TODC_SIZE, 0);
189 bh.ci->enable_window_32bit(&bh, MV64x60_CPU2DEV_1_WIN);
190 TODC_INIT(TODC_TYPE_MK48T35, 0, 0,
191 ioremap(CPCI690_TODC_BASE, CPCI690_TODC_SIZE), 8);
192
193 mv64x60_set_32bit_window(&bh, MV64x60_CPU2DEV_2_WIN, CPCI690_IPMI_BASE,
194 CPCI690_IPMI_SIZE, 0);
195 bh.ci->enable_window_32bit(&bh, MV64x60_CPU2DEV_2_WIN);
196
197 mv64x60_set_bits(&bh, MV64x60_PCI0_ARBITER_CNTL, (1<<31));
198 mv64x60_set_bits(&bh, MV64x60_PCI1_ARBITER_CNTL, (1<<31));
199
200 mv64x60_set_bits(&bh, MV64x60_CPU_MASTER_CNTL, (1<<9)); /* Only 1 cpu */
201
202 /*
203 * Turn off timer/counters. Not turning off watchdog timer because
204 * can't read its reg on the 64260A so don't know if we'll be enabling
205 * or disabling.
206 */
207 mv64x60_clr_bits(&bh, MV64x60_TIMR_CNTR_0_3_CNTL,
208 ((1<<0) | (1<<8) | (1<<16) | (1<<24)));
209 mv64x60_clr_bits(&bh, GT64260_TIMR_CNTR_4_7_CNTL,
210 ((1<<0) | (1<<8) | (1<<16) | (1<<24)));
211
212 /*
213 * Set MPSC Multiplex RMII
214 * NOTE: ethernet driver modifies bit 0 and 1
215 */
216 mv64x60_write(&bh, GT64260_MPP_SERIAL_PORTS_MULTIPLEX, 0x00001102);
217
218#define GPP_EXTERNAL_INTERRUPTS \
219 ((1<<24) | (1<<25) | (1<<26) | (1<<27) | \
220 (1<<28) | (1<<29) | (1<<30) | (1<<31))
221 /* PCI interrupts are inputs */
222 mv64x60_clr_bits(&bh, MV64x60_GPP_IO_CNTL, GPP_EXTERNAL_INTERRUPTS);
223 /* PCI interrupts are active low */
224 mv64x60_set_bits(&bh, MV64x60_GPP_LEVEL_CNTL, GPP_EXTERNAL_INTERRUPTS);
225
226 /* Clear any pending interrupts for these inputs and enable them. */
227 mv64x60_write(&bh, MV64x60_GPP_INTR_CAUSE, ~GPP_EXTERNAL_INTERRUPTS);
228 mv64x60_set_bits(&bh, MV64x60_GPP_INTR_MASK, GPP_EXTERNAL_INTERRUPTS);
229
230 /* Route MPP interrupt inputs to GPP */
231 mv64x60_write(&bh, MV64x60_MPP_CNTL_2, 0x00000000);
232 mv64x60_write(&bh, MV64x60_MPP_CNTL_3, 0x00000000);
233}
234
235static void __init
236cpci690_setup_arch(void)
237{
238 if (ppc_md.progress)
239 ppc_md.progress("cpci690_setup_arch: enter", 0);
240#ifdef CONFIG_BLK_DEV_INITRD
241 if (initrd_start)
242 ROOT_DEV = Root_RAM0;
243 else
244#endif
245#ifdef CONFIG_ROOT_NFS
246 ROOT_DEV = Root_NFS;
247#else
248 ROOT_DEV = Root_SDA2;
249#endif
250
251 if (ppc_md.progress)
252 ppc_md.progress("cpci690_setup_arch: Enabling L2 cache", 0);
253
254 /* Enable L2 and L3 caches (if 745x) */
255 _set_L2CR(_get_L2CR() | L2CR_L2E);
256 _set_L3CR(_get_L3CR() | L3CR_L3E);
257
258 if (ppc_md.progress)
259 ppc_md.progress("cpci690_setup_arch: Initializing bridge", 0);
260
261 cpci690_setup_bridge(); /* set up PCI bridge(s) */
262 cpci690_setup_peripherals(); /* set up chip selects/GPP/MPP etc */
263
264 if (ppc_md.progress)
265 ppc_md.progress("cpci690_setup_arch: bridge init complete", 0);
266
267 printk(KERN_INFO "%s %s port (C) 2003 MontaVista Software, Inc. "
268 "(source@mvista.com)\n", BOARD_VENDOR, BOARD_MACHINE);
269
270 if (ppc_md.progress)
271 ppc_md.progress("cpci690_setup_arch: exit", 0);
272}
273
274/* Platform device data fixup routines. */
275#if defined(CONFIG_SERIAL_MPSC)
276static void __init
277cpci690_fixup_mpsc_pdata(struct platform_device *pdev)
278{
279 struct mpsc_pdata *pdata;
280
281 pdata = (struct mpsc_pdata *)pdev->dev.platform_data;
282
283 pdata->max_idle = 40;
284 pdata->default_baud = CPCI690_MPSC_BAUD;
285 pdata->brg_clk_src = CPCI690_MPSC_CLK_SRC;
286 pdata->brg_clk_freq = cpci690_get_bus_freq();
287}
288
289static int
290cpci690_platform_notify(struct device *dev)
291{
292 static struct {
293 char *bus_id;
294 void ((*rtn)(struct platform_device *pdev));
295 } dev_map[] = {
296 { MPSC_CTLR_NAME ".0", cpci690_fixup_mpsc_pdata },
297 { MPSC_CTLR_NAME ".1", cpci690_fixup_mpsc_pdata },
298 };
299 struct platform_device *pdev;
300 int i;
301
302 if (dev && dev->bus_id)
303 for (i=0; i<ARRAY_SIZE(dev_map); i++)
304 if (!strncmp(dev->bus_id, dev_map[i].bus_id,
305 BUS_ID_SIZE)) {
306
307 pdev = container_of(dev,
308 struct platform_device, dev);
309 dev_map[i].rtn(pdev);
310 }
311
312 return 0;
313}
314#endif
315
316static void
317cpci690_reset_board(void)
318{
319 u32 i = 10000;
320
321 local_irq_disable();
322 out_8((cpci690_br_base + CPCI690_BR_SW_RESET), 0x11);
323
324 while (i != 0) i++;
325 panic("restart failed\n");
326}
327
328static void
329cpci690_restart(char *cmd)
330{
331 cpci690_reset_board();
332}
333
334static void
335cpci690_halt(void)
336{
337 while (1);
338 /* NOTREACHED */
339}
340
341static void
342cpci690_power_off(void)
343{
344 cpci690_halt();
345 /* NOTREACHED */
346}
347
348static int
349cpci690_show_cpuinfo(struct seq_file *m)
350{
351 char *s;
352
353 seq_printf(m, "cpu MHz\t\t: %d\n",
354 (cpci690_get_cpu_freq() + 500000) / 1000000);
355 seq_printf(m, "bus MHz\t\t: %d\n",
356 (cpci690_get_bus_freq() + 500000) / 1000000);
357 seq_printf(m, "vendor\t\t: " BOARD_VENDOR "\n");
358 seq_printf(m, "machine\t\t: " BOARD_MACHINE "\n");
359 seq_printf(m, "FPGA Revision\t: %d\n",
360 in_8(cpci690_br_base + CPCI690_BR_MEM_CTLR) >> 5);
361
362 switch(bh.type) {
363 case MV64x60_TYPE_GT64260A:
364 s = "gt64260a";
365 break;
366 case MV64x60_TYPE_GT64260B:
367 s = "gt64260b";
368 break;
369 case MV64x60_TYPE_MV64360:
370 s = "mv64360";
371 break;
372 case MV64x60_TYPE_MV64460:
373 s = "mv64460";
374 break;
375 default:
376 s = "Unknown";
377 }
378 seq_printf(m, "bridge type\t: %s\n", s);
379 seq_printf(m, "bridge rev\t: 0x%x\n", bh.rev);
380#if defined(CONFIG_NOT_COHERENT_CACHE)
381 seq_printf(m, "coherency\t: %s\n", "off");
382#else
383 seq_printf(m, "coherency\t: %s\n", "on");
384#endif
385
386 return 0;
387}
388
389static void __init
390cpci690_calibrate_decr(void)
391{
392 ulong freq;
393
394 freq = cpci690_get_bus_freq() / 4;
395
396 printk(KERN_INFO "time_init: decrementer frequency = %lu.%.6lu MHz\n",
397 freq/1000000, freq%1000000);
398
399 tb_ticks_per_jiffy = freq / HZ;
400 tb_to_us = mulhwu_scale_factor(freq, 1000000);
401}
402
403#if defined(CONFIG_SERIAL_TEXT_DEBUG) || defined(CONFIG_KGDB_MPSC)
404static void __init
405cpci690_map_io(void)
406{
407 io_block_mapping(CONFIG_MV64X60_NEW_BASE, CONFIG_MV64X60_NEW_BASE,
408 128 * 1024, _PAGE_IO);
409}
410#endif
411
412void __init
413platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
414 unsigned long r6, unsigned long r7)
415{
416 parse_bootinfo(find_bootinfo());
417
418#ifdef CONFIG_BLK_DEV_INITRD
419 /* take care of initrd if we have one */
420 if (r4) {
421 initrd_start = r4 + KERNELBASE;
422 initrd_end = r5 + KERNELBASE;
423 }
424#endif /* CONFIG_BLK_DEV_INITRD */
425
426 isa_mem_base = 0;
427
428 ppc_md.setup_arch = cpci690_setup_arch;
429 ppc_md.show_cpuinfo = cpci690_show_cpuinfo;
430 ppc_md.init_IRQ = gt64260_init_irq;
431 ppc_md.get_irq = gt64260_get_irq;
432 ppc_md.restart = cpci690_restart;
433 ppc_md.power_off = cpci690_power_off;
434 ppc_md.halt = cpci690_halt;
435 ppc_md.time_init = todc_time_init;
436 ppc_md.set_rtc_time = todc_set_rtc_time;
437 ppc_md.get_rtc_time = todc_get_rtc_time;
438 ppc_md.nvram_read_val = todc_direct_read_val;
439 ppc_md.nvram_write_val = todc_direct_write_val;
440 ppc_md.calibrate_decr = cpci690_calibrate_decr;
441
442#if defined(CONFIG_SERIAL_TEXT_DEBUG) || defined(CONFIG_KGDB_MPSC)
443 ppc_md.setup_io_mappings = cpci690_map_io;
444#ifdef CONFIG_SERIAL_TEXT_DEBUG
445 ppc_md.progress = mv64x60_mpsc_progress;
446 mv64x60_progress_init(CONFIG_MV64X60_NEW_BASE);
447#endif /* CONFIG_SERIAL_TEXT_DEBUG */
448#endif /* defined(CONFIG_SERIAL_TEXT_DEBUG) || defined(CONFIG_KGDB_MPSC) */
449
450#if defined(CONFIG_SERIAL_MPSC)
451 platform_notify = cpci690_platform_notify;
452#endif
453}
diff --git a/arch/ppc/platforms/cpci690.h b/arch/ppc/platforms/cpci690.h
deleted file mode 100644
index 0fa5a4c31b67..000000000000
--- a/arch/ppc/platforms/cpci690.h
+++ /dev/null
@@ -1,74 +0,0 @@
1/*
2 * Definitions for Force CPCI690
3 *
4 * Author: Mark A. Greer <mgreer@mvista.com>
5 *
6 * 2003 (c) MontaVista, Software, Inc. This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10 */
11
12/*
13 * The GT64260 has 2 PCI buses each with 1 window from the CPU bus to
14 * PCI I/O space and 4 windows from the CPU bus to PCI MEM space.
15 */
16
17#ifndef __PPC_PLATFORMS_CPCI690_H
18#define __PPC_PLATFORMS_CPCI690_H
19
20/*
21 * Define bd_t to pass in the MAC addresses used by the GT64260's enet ctlrs.
22 */
23#define CPCI690_BI_MAGIC 0xFE8765DC
24
25typedef struct board_info {
26 u32 bi_magic;
27 u8 bi_enetaddr[3][6];
28} bd_t;
29
30/* PCI bus Resource setup */
31#define CPCI690_PCI0_MEM_START_PROC_ADDR 0x80000000
32#define CPCI690_PCI0_MEM_START_PCI_HI_ADDR 0x00000000
33#define CPCI690_PCI0_MEM_START_PCI_LO_ADDR 0x80000000
34#define CPCI690_PCI0_MEM_SIZE 0x10000000
35#define CPCI690_PCI0_IO_START_PROC_ADDR 0xa0000000
36#define CPCI690_PCI0_IO_START_PCI_ADDR 0x00000000
37#define CPCI690_PCI0_IO_SIZE 0x01000000
38
39#define CPCI690_PCI1_MEM_START_PROC_ADDR 0x90000000
40#define CPCI690_PCI1_MEM_START_PCI_HI_ADDR 0x00000000
41#define CPCI690_PCI1_MEM_START_PCI_LO_ADDR 0x90000000
42#define CPCI690_PCI1_MEM_SIZE 0x10000000
43#define CPCI690_PCI1_IO_START_PROC_ADDR 0xa1000000
44#define CPCI690_PCI1_IO_START_PCI_ADDR 0x01000000
45#define CPCI690_PCI1_IO_SIZE 0x01000000
46
47/* Board Registers */
48#define CPCI690_BR_BASE 0xf0000000
49#define CPCI690_BR_SIZE_ACTUAL 0x8
50#define CPCI690_BR_SIZE max(GT64260_WINDOW_SIZE_MIN, \
51 CPCI690_BR_SIZE_ACTUAL)
52#define CPCI690_BR_LED_CNTL 0x00
53#define CPCI690_BR_SW_RESET 0x01
54#define CPCI690_BR_MISC_STATUS 0x02
55#define CPCI690_BR_SWITCH_STATUS 0x03
56#define CPCI690_BR_MEM_CTLR 0x04
57#define CPCI690_BR_LAST_RESET_1 0x05
58#define CPCI690_BR_LAST_RESET_2 0x06
59
60#define CPCI690_TODC_BASE 0xf0100000
61#define CPCI690_TODC_SIZE_ACTUAL 0x8000 /* Size or NVRAM + RTC */
62#define CPCI690_TODC_SIZE max(GT64260_WINDOW_SIZE_MIN, \
63 CPCI690_TODC_SIZE_ACTUAL)
64#define CPCI690_MAC_OFFSET 0x7c10 /* MAC in RTC NVRAM */
65
66#define CPCI690_IPMI_BASE 0xf0200000
67#define CPCI690_IPMI_SIZE_ACTUAL 0x10 /* 16 bytes of IPMI */
68#define CPCI690_IPMI_SIZE max(GT64260_WINDOW_SIZE_MIN, \
69 CPCI690_IPMI_SIZE_ACTUAL)
70
71#define CPCI690_MPSC_BAUD 9600
72#define CPCI690_MPSC_CLK_SRC 8 /* TCLK */
73
74#endif /* __PPC_PLATFORMS_CPCI690_H */
diff --git a/arch/ppc/platforms/est8260.h b/arch/ppc/platforms/est8260.h
deleted file mode 100644
index adba68ecf57b..000000000000
--- a/arch/ppc/platforms/est8260.h
+++ /dev/null
@@ -1,35 +0,0 @@
1/* Board information for the EST8260, which should be generic for
2 * all 8260 boards. The IMMR is now given to us so the hard define
3 * will soon be removed. All of the clock values are computed from
4 * the configuration SCMR and the Power-On-Reset word.
5 */
6#ifndef __EST8260_PLATFORM
7#define __EST8260_PLATFORM
8
9#define CPM_MAP_ADDR ((uint)0xf0000000)
10
11#define BOOTROM_RESTART_ADDR ((uint)0xff000104)
12
13/* For our show_cpuinfo hooks. */
14#define CPUINFO_VENDOR "EST Corporation"
15#define CPUINFO_MACHINE "SBC8260 PowerPC"
16
17/* A Board Information structure that is given to a program when
18 * prom starts it up.
19 */
20typedef struct bd_info {
21 unsigned int bi_memstart; /* Memory start address */
22 unsigned int bi_memsize; /* Memory (end) size in bytes */
23 unsigned int bi_intfreq; /* Internal Freq, in Hz */
24 unsigned int bi_busfreq; /* Bus Freq, in MHz */
25 unsigned int bi_cpmfreq; /* CPM Freq, in MHz */
26 unsigned int bi_brgfreq; /* BRG Freq, in MHz */
27 unsigned int bi_vco; /* VCO Out from PLL */
28 unsigned int bi_baudrate; /* Default console baud rate */
29 unsigned int bi_immr; /* IMMR when called from boot rom */
30 unsigned char bi_enetaddr[6];
31} bd_t;
32
33extern bd_t m8xx_board_info;
34
35#endif /* __EST8260_PLATFORM */
diff --git a/arch/ppc/platforms/ev64260.c b/arch/ppc/platforms/ev64260.c
deleted file mode 100644
index f522b31c46d7..000000000000
--- a/arch/ppc/platforms/ev64260.c
+++ /dev/null
@@ -1,649 +0,0 @@
1/*
2 * Board setup routines for the Marvell/Galileo EV-64260-BP Evaluation Board.
3 *
4 * Author: Mark A. Greer <mgreer@mvista.com>
5 *
6 * 2001-2003 (c) MontaVista, Software, Inc. This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10 */
11
12/*
13 * The EV-64260-BP port is the result of hard work from many people from
14 * many companies. In particular, employees of Marvell/Galileo, Mission
15 * Critical Linux, Xyterra, and MontaVista Software were heavily involved.
16 *
17 * Note: I have not been able to get *all* PCI slots to work reliably
18 * at 66 MHz. I recommend setting jumpers J15 & J16 to short pins 1&2
19 * so that 33 MHz is used. --MAG
20 * Note: The 750CXe and 7450 are not stable with a 125MHz or 133MHz TCLK/SYSCLK.
21 * At 100MHz, they are solid.
22 */
23
24#include <linux/delay.h>
25#include <linux/pci.h>
26#include <linux/irq.h>
27#include <linux/fs.h>
28#include <linux/seq_file.h>
29#include <linux/console.h>
30#include <linux/initrd.h>
31#include <linux/root_dev.h>
32#include <linux/platform_device.h>
33#if !defined(CONFIG_SERIAL_MPSC_CONSOLE)
34#include <linux/serial.h>
35#include <linux/tty.h>
36#include <linux/serial_core.h>
37#include <linux/serial_8250.h>
38#else
39#include <linux/mv643xx.h>
40#endif
41#include <asm/bootinfo.h>
42#include <asm/machdep.h>
43#include <asm/mv64x60.h>
44#include <asm/todc.h>
45#include <asm/time.h>
46
47#include <platforms/ev64260.h>
48
49#define BOARD_VENDOR "Marvell/Galileo"
50#define BOARD_MACHINE "EV-64260-BP"
51
52static struct mv64x60_handle bh;
53
54#if !defined(CONFIG_SERIAL_MPSC_CONSOLE)
55extern void gen550_progress(char *, unsigned short);
56extern void gen550_init(int, struct uart_port *);
57#endif
58
59static const unsigned int cpu_7xx[16] = { /* 7xx & 74xx (but not 745x) */
60 18, 15, 14, 2, 4, 13, 5, 9, 6, 11, 8, 10, 16, 12, 7, 0
61};
62static const unsigned int cpu_745x[2][16] = { /* PLL_EXT 0 & 1 */
63 { 1, 15, 14, 2, 4, 13, 5, 9, 6, 11, 8, 10, 16, 12, 7, 0 },
64 { 0, 30, 0, 2, 0, 26, 0, 18, 0, 22, 20, 24, 28, 32, 0, 0 }
65};
66
67
68TODC_ALLOC();
69
70static int
71ev64260_get_bus_speed(void)
72{
73 return 100000000;
74}
75
76static int
77ev64260_get_cpu_speed(void)
78{
79 unsigned long pvr, hid1, pll_ext;
80
81 pvr = PVR_VER(mfspr(SPRN_PVR));
82
83 if (pvr != PVR_VER(PVR_7450)) {
84 hid1 = mfspr(SPRN_HID1) >> 28;
85 return ev64260_get_bus_speed() * cpu_7xx[hid1]/2;
86 }
87 else {
88 hid1 = (mfspr(SPRN_HID1) & 0x0001e000) >> 13;
89 pll_ext = 0; /* No way to read; must get from schematic */
90 return ev64260_get_bus_speed() * cpu_745x[pll_ext][hid1]/2;
91 }
92}
93
94unsigned long __init
95ev64260_find_end_of_memory(void)
96{
97 return mv64x60_get_mem_size(CONFIG_MV64X60_NEW_BASE,
98 MV64x60_TYPE_GT64260A);
99}
100
101/*
102 * Marvell/Galileo EV-64260-BP Evaluation Board PCI interrupt routing.
103 * Note: By playing with J8 and JP1-4, you can get 2 IRQ's from the first
104 * PCI bus (in which cast, INTPIN B would be EV64260_PCI_1_IRQ).
105 * This is the most IRQs you can get from one bus with this board, though.
106 */
107static int __init
108ev64260_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
109{
110 struct pci_controller *hose = pci_bus_to_hose(dev->bus->number);
111
112 if (hose->index == 0) {
113 static char pci_irq_table[][4] =
114 /*
115 * PCI IDSEL/INTPIN->INTLINE
116 * A B C D
117 */
118 {
119 {EV64260_PCI_0_IRQ,0,0,0}, /* IDSEL 7 - PCI bus 0 */
120 {EV64260_PCI_0_IRQ,0,0,0}, /* IDSEL 8 - PCI bus 0 */
121 };
122
123 const long min_idsel = 7, max_idsel = 8, irqs_per_slot = 4;
124 return PCI_IRQ_TABLE_LOOKUP;
125 }
126 else {
127 static char pci_irq_table[][4] =
128 /*
129 * PCI IDSEL/INTPIN->INTLINE
130 * A B C D
131 */
132 {
133 { EV64260_PCI_1_IRQ,0,0,0}, /* IDSEL 7 - PCI bus 1 */
134 { EV64260_PCI_1_IRQ,0,0,0}, /* IDSEL 8 - PCI bus 1 */
135 };
136
137 const long min_idsel = 7, max_idsel = 8, irqs_per_slot = 4;
138 return PCI_IRQ_TABLE_LOOKUP;
139 }
140}
141
142static void __init
143ev64260_setup_peripherals(void)
144{
145 mv64x60_set_32bit_window(&bh, MV64x60_CPU2BOOT_WIN,
146 EV64260_EMB_FLASH_BASE, EV64260_EMB_FLASH_SIZE, 0);
147 bh.ci->enable_window_32bit(&bh, MV64x60_CPU2BOOT_WIN);
148 mv64x60_set_32bit_window(&bh, MV64x60_CPU2DEV_0_WIN,
149 EV64260_EXT_SRAM_BASE, EV64260_EXT_SRAM_SIZE, 0);
150 bh.ci->enable_window_32bit(&bh, MV64x60_CPU2DEV_0_WIN);
151 mv64x60_set_32bit_window(&bh, MV64x60_CPU2DEV_1_WIN,
152 EV64260_TODC_BASE, EV64260_TODC_SIZE, 0);
153 bh.ci->enable_window_32bit(&bh, MV64x60_CPU2DEV_1_WIN);
154 mv64x60_set_32bit_window(&bh, MV64x60_CPU2DEV_2_WIN,
155 EV64260_UART_BASE, EV64260_UART_SIZE, 0);
156 bh.ci->enable_window_32bit(&bh, MV64x60_CPU2DEV_2_WIN);
157 mv64x60_set_32bit_window(&bh, MV64x60_CPU2DEV_3_WIN,
158 EV64260_EXT_FLASH_BASE, EV64260_EXT_FLASH_SIZE, 0);
159 bh.ci->enable_window_32bit(&bh, MV64x60_CPU2DEV_3_WIN);
160
161 TODC_INIT(TODC_TYPE_DS1501, 0, 0,
162 ioremap(EV64260_TODC_BASE, EV64260_TODC_SIZE), 8);
163
164 mv64x60_clr_bits(&bh, MV64x60_CPU_CONFIG,((1<<12) | (1<<28) | (1<<29)));
165 mv64x60_set_bits(&bh, MV64x60_CPU_CONFIG, (1<<27));
166
167 if (ev64260_get_bus_speed() > 100000000)
168 mv64x60_set_bits(&bh, MV64x60_CPU_CONFIG, (1<<23));
169
170 mv64x60_set_bits(&bh, MV64x60_PCI0_PCI_DECODE_CNTL, ((1<<0) | (1<<3)));
171 mv64x60_set_bits(&bh, MV64x60_PCI1_PCI_DECODE_CNTL, ((1<<0) | (1<<3)));
172
173 /*
174 * Enabling of PCI internal-vs-external arbitration
175 * is a platform- and errata-dependent decision.
176 */
177 if (bh.type == MV64x60_TYPE_GT64260A ) {
178 mv64x60_set_bits(&bh, MV64x60_PCI0_ARBITER_CNTL, (1<<31));
179 mv64x60_set_bits(&bh, MV64x60_PCI1_ARBITER_CNTL, (1<<31));
180 }
181
182 mv64x60_set_bits(&bh, MV64x60_CPU_MASTER_CNTL, (1<<9)); /* Only 1 cpu */
183
184 /*
185 * Turn off timer/counters. Not turning off watchdog timer because
186 * can't read its reg on the 64260A so don't know if we'll be enabling
187 * or disabling.
188 */
189 mv64x60_clr_bits(&bh, MV64x60_TIMR_CNTR_0_3_CNTL,
190 ((1<<0) | (1<<8) | (1<<16) | (1<<24)));
191 mv64x60_clr_bits(&bh, GT64260_TIMR_CNTR_4_7_CNTL,
192 ((1<<0) | (1<<8) | (1<<16) | (1<<24)));
193
194 /*
195 * Set MPSC Multiplex RMII
196 * NOTE: ethernet driver modifies bit 0 and 1
197 */
198 mv64x60_write(&bh, GT64260_MPP_SERIAL_PORTS_MULTIPLEX, 0x00001102);
199
200 /*
201 * The EV-64260-BP uses several Multi-Purpose Pins (MPP) on the 64260
202 * bridge as interrupt inputs (via the General Purpose Ports (GPP)
203 * register). Need to route the MPP inputs to the GPP and set the
204 * polarity correctly.
205 *
206 * In MPP Control 2 Register
207 * MPP 21 -> GPP 21 (DUART channel A intr) bits 20-23 -> 0
208 * MPP 22 -> GPP 22 (DUART channel B intr) bits 24-27 -> 0
209 */
210 mv64x60_clr_bits(&bh, MV64x60_MPP_CNTL_2, (0xf<<20) | (0xf<<24) );
211
212 /*
213 * In MPP Control 3 Register
214 * MPP 26 -> GPP 26 (RTC INT) bits 8-11 -> 0
215 * MPP 27 -> GPP 27 (PCI 0 INTA) bits 12-15 -> 0
216 * MPP 29 -> GPP 29 (PCI 1 INTA) bits 20-23 -> 0
217 */
218 mv64x60_clr_bits(&bh, MV64x60_MPP_CNTL_3, (0xf<<8)|(0xf<<12)|(0xf<<20));
219
220#define GPP_EXTERNAL_INTERRUPTS \
221 ((1<<21) | (1<<22) | (1<<26) | (1<<27) | (1<<29))
222 /* DUART & PCI interrupts are inputs */
223 mv64x60_clr_bits(&bh, MV64x60_GPP_IO_CNTL, GPP_EXTERNAL_INTERRUPTS);
224 /* DUART & PCI interrupts are active low */
225 mv64x60_set_bits(&bh, MV64x60_GPP_LEVEL_CNTL, GPP_EXTERNAL_INTERRUPTS);
226
227 /* Clear any pending interrupts for these inputs and enable them. */
228 mv64x60_write(&bh, MV64x60_GPP_INTR_CAUSE, ~GPP_EXTERNAL_INTERRUPTS);
229 mv64x60_set_bits(&bh, MV64x60_GPP_INTR_MASK, GPP_EXTERNAL_INTERRUPTS);
230
231 return;
232}
233
234static void __init
235ev64260_setup_bridge(void)
236{
237 struct mv64x60_setup_info si;
238 int i;
239
240 memset(&si, 0, sizeof(si));
241
242 si.phys_reg_base = CONFIG_MV64X60_NEW_BASE;
243
244 si.pci_0.enable_bus = 1;
245 si.pci_0.pci_io.cpu_base = EV64260_PCI0_IO_CPU_BASE;
246 si.pci_0.pci_io.pci_base_hi = 0;
247 si.pci_0.pci_io.pci_base_lo = EV64260_PCI0_IO_PCI_BASE;
248 si.pci_0.pci_io.size = EV64260_PCI0_IO_SIZE;
249 si.pci_0.pci_io.swap = MV64x60_CPU2PCI_SWAP_NONE;
250 si.pci_0.pci_mem[0].cpu_base = EV64260_PCI0_MEM_CPU_BASE;
251 si.pci_0.pci_mem[0].pci_base_hi = 0;
252 si.pci_0.pci_mem[0].pci_base_lo = EV64260_PCI0_MEM_PCI_BASE;
253 si.pci_0.pci_mem[0].size = EV64260_PCI0_MEM_SIZE;
254 si.pci_0.pci_mem[0].swap = MV64x60_CPU2PCI_SWAP_NONE;
255 si.pci_0.pci_cmd_bits = 0;
256 si.pci_0.latency_timer = 0x8;
257
258 si.pci_1.enable_bus = 1;
259 si.pci_1.pci_io.cpu_base = EV64260_PCI1_IO_CPU_BASE;
260 si.pci_1.pci_io.pci_base_hi = 0;
261 si.pci_1.pci_io.pci_base_lo = EV64260_PCI1_IO_PCI_BASE;
262 si.pci_1.pci_io.size = EV64260_PCI1_IO_SIZE;
263 si.pci_1.pci_io.swap = MV64x60_CPU2PCI_SWAP_NONE;
264 si.pci_1.pci_mem[0].cpu_base = EV64260_PCI1_MEM_CPU_BASE;
265 si.pci_1.pci_mem[0].pci_base_hi = 0;
266 si.pci_1.pci_mem[0].pci_base_lo = EV64260_PCI1_MEM_PCI_BASE;
267 si.pci_1.pci_mem[0].size = EV64260_PCI1_MEM_SIZE;
268 si.pci_1.pci_mem[0].swap = MV64x60_CPU2PCI_SWAP_NONE;
269 si.pci_1.pci_cmd_bits = 0;
270 si.pci_1.latency_timer = 0x8;
271
272 for (i=0; i<MV64x60_CPU2MEM_WINDOWS; i++) {
273 si.cpu_prot_options[i] = 0;
274 si.cpu_snoop_options[i] = GT64260_CPU_SNOOP_WB;
275 si.pci_0.acc_cntl_options[i] =
276 GT64260_PCI_ACC_CNTL_DREADEN |
277 GT64260_PCI_ACC_CNTL_RDPREFETCH |
278 GT64260_PCI_ACC_CNTL_RDLINEPREFETCH |
279 GT64260_PCI_ACC_CNTL_RDMULPREFETCH |
280 GT64260_PCI_ACC_CNTL_SWAP_NONE |
281 GT64260_PCI_ACC_CNTL_MBURST_32_BTYES;
282 si.pci_0.snoop_options[i] = GT64260_PCI_SNOOP_WB;
283 si.pci_1.acc_cntl_options[i] =
284 GT64260_PCI_ACC_CNTL_DREADEN |
285 GT64260_PCI_ACC_CNTL_RDPREFETCH |
286 GT64260_PCI_ACC_CNTL_RDLINEPREFETCH |
287 GT64260_PCI_ACC_CNTL_RDMULPREFETCH |
288 GT64260_PCI_ACC_CNTL_SWAP_NONE |
289 GT64260_PCI_ACC_CNTL_MBURST_32_BTYES;
290 si.pci_1.snoop_options[i] = GT64260_PCI_SNOOP_WB;
291 }
292
293 /* Lookup PCI host bridges */
294 if (mv64x60_init(&bh, &si))
295 printk(KERN_ERR "Bridge initialization failed.\n");
296
297 pci_dram_offset = 0; /* System mem at same addr on PCI & cpu bus */
298 ppc_md.pci_swizzle = common_swizzle;
299 ppc_md.pci_map_irq = ev64260_map_irq;
300 ppc_md.pci_exclude_device = mv64x60_pci_exclude_device;
301
302 mv64x60_set_bus(&bh, 0, 0);
303 bh.hose_a->first_busno = 0;
304 bh.hose_a->last_busno = 0xff;
305 bh.hose_a->last_busno = pciauto_bus_scan(bh.hose_a, 0);
306
307 bh.hose_b->first_busno = bh.hose_a->last_busno + 1;
308 mv64x60_set_bus(&bh, 1, bh.hose_b->first_busno);
309 bh.hose_b->last_busno = 0xff;
310 bh.hose_b->last_busno = pciauto_bus_scan(bh.hose_b,
311 bh.hose_b->first_busno);
312
313 return;
314}
315
316#if defined(CONFIG_SERIAL_8250) && !defined(CONFIG_SERIAL_MPSC_CONSOLE)
317static void __init
318ev64260_early_serial_map(void)
319{
320 struct uart_port port;
321 static char first_time = 1;
322
323 if (first_time) {
324 memset(&port, 0, sizeof(port));
325
326 port.membase = ioremap(EV64260_SERIAL_0, EV64260_UART_SIZE);
327 port.irq = EV64260_UART_0_IRQ;
328 port.uartclk = BASE_BAUD * 16;
329 port.regshift = 2;
330 port.iotype = UPIO_MEM;
331 port.flags = STD_COM_FLAGS;
332
333#if defined(CONFIG_SERIAL_TEXT_DEBUG) || defined(CONFIG_KGDB)
334 gen550_init(0, &port);
335#endif
336
337 if (early_serial_setup(&port) != 0)
338 printk(KERN_WARNING "Early serial init of port 0 "
339 "failed\n");
340
341 first_time = 0;
342 }
343
344 return;
345}
346#elif defined(CONFIG_SERIAL_MPSC_CONSOLE)
347static void __init
348ev64260_early_serial_map(void)
349{
350}
351#endif
352
353static void __init
354ev64260_setup_arch(void)
355{
356 if (ppc_md.progress)
357 ppc_md.progress("ev64260_setup_arch: enter", 0);
358
359#ifdef CONFIG_BLK_DEV_INITRD
360 if (initrd_start)
361 ROOT_DEV = Root_RAM0;
362 else
363#endif
364#ifdef CONFIG_ROOT_NFS
365 ROOT_DEV = Root_NFS;
366#else
367 ROOT_DEV = Root_SDA2;
368#endif
369
370 if (ppc_md.progress)
371 ppc_md.progress("ev64260_setup_arch: Enabling L2 cache", 0);
372
373 /* Enable L2 and L3 caches (if 745x) */
374 _set_L2CR(_get_L2CR() | L2CR_L2E);
375 _set_L3CR(_get_L3CR() | L3CR_L3E);
376
377 if (ppc_md.progress)
378 ppc_md.progress("ev64260_setup_arch: Initializing bridge", 0);
379
380 ev64260_setup_bridge(); /* set up PCI bridge(s) */
381 ev64260_setup_peripherals(); /* set up chip selects/GPP/MPP etc */
382
383 if (ppc_md.progress)
384 ppc_md.progress("ev64260_setup_arch: bridge init complete", 0);
385
386#if defined(CONFIG_SERIAL_8250) || defined(CONFIG_SERIAL_MPSC_CONSOLE)
387 ev64260_early_serial_map();
388#endif
389
390 printk(KERN_INFO "%s %s port (C) 2001 MontaVista Software, Inc. "
391 "(source@mvista.com)\n", BOARD_VENDOR, BOARD_MACHINE);
392
393 if (ppc_md.progress)
394 ppc_md.progress("ev64260_setup_arch: exit", 0);
395
396 return;
397}
398
399/* Platform device data fixup routines. */
400#if defined(CONFIG_SERIAL_MPSC)
401static void __init
402ev64260_fixup_mpsc_pdata(struct platform_device *pdev)
403{
404 struct mpsc_pdata *pdata;
405
406 pdata = (struct mpsc_pdata *)pdev->dev.platform_data;
407
408 pdata->max_idle = 40;
409 pdata->default_baud = EV64260_DEFAULT_BAUD;
410 pdata->brg_clk_src = EV64260_MPSC_CLK_SRC;
411 pdata->brg_clk_freq = EV64260_MPSC_CLK_FREQ;
412
413 return;
414}
415
416static int
417ev64260_platform_notify(struct device *dev)
418{
419 static struct {
420 char *bus_id;
421 void ((*rtn)(struct platform_device *pdev));
422 } dev_map[] = {
423 { MPSC_CTLR_NAME ".0", ev64260_fixup_mpsc_pdata },
424 { MPSC_CTLR_NAME ".1", ev64260_fixup_mpsc_pdata },
425 };
426 struct platform_device *pdev;
427 int i;
428
429 if (dev && dev->bus_id)
430 for (i=0; i<ARRAY_SIZE(dev_map); i++)
431 if (!strncmp(dev->bus_id, dev_map[i].bus_id,
432 BUS_ID_SIZE)) {
433
434 pdev = container_of(dev,
435 struct platform_device, dev);
436 dev_map[i].rtn(pdev);
437 }
438
439 return 0;
440}
441#endif
442
443static void
444ev64260_reset_board(void *addr)
445{
446 local_irq_disable();
447
448 /* disable and invalidate the L2 cache */
449 _set_L2CR(0);
450 _set_L2CR(0x200000);
451
452 /* flush and disable L1 I/D cache */
453 __asm__ __volatile__
454 ("mfspr 3,1008\n\t"
455 "ori 5,5,0xcc00\n\t"
456 "ori 4,3,0xc00\n\t"
457 "andc 5,3,5\n\t"
458 "sync\n\t"
459 "mtspr 1008,4\n\t"
460 "isync\n\t"
461 "sync\n\t"
462 "mtspr 1008,5\n\t"
463 "isync\n\t"
464 "sync\n\t");
465
466 /* unmap any other random cs's that might overlap with bootcs */
467 mv64x60_set_32bit_window(&bh, MV64x60_CPU2DEV_0_WIN, 0, 0, 0);
468 bh.ci->disable_window_32bit(&bh, MV64x60_CPU2DEV_0_WIN);
469 mv64x60_set_32bit_window(&bh, MV64x60_CPU2DEV_1_WIN, 0, 0, 0);
470 bh.ci->disable_window_32bit(&bh, MV64x60_CPU2DEV_1_WIN);
471 mv64x60_set_32bit_window(&bh, MV64x60_CPU2DEV_2_WIN, 0, 0, 0);
472 bh.ci->disable_window_32bit(&bh, MV64x60_CPU2DEV_2_WIN);
473 mv64x60_set_32bit_window(&bh, MV64x60_CPU2DEV_3_WIN, 0, 0, 0);
474 bh.ci->disable_window_32bit(&bh, MV64x60_CPU2DEV_3_WIN);
475
476 /* map bootrom back in to gt @ reset defaults */
477 mv64x60_set_32bit_window(&bh, MV64x60_CPU2BOOT_WIN,
478 0xff800000, 8*1024*1024, 0);
479 bh.ci->enable_window_32bit(&bh, MV64x60_CPU2BOOT_WIN);
480
481 /* move reg base back to default, setup default pci0 */
482 mv64x60_write(&bh, MV64x60_INTERNAL_SPACE_DECODE,
483 (1<<24) | CONFIG_MV64X60_BASE >> 20);
484
485 /* NOTE: FROM NOW ON no more GT_REGS accesses.. 0x1 is not mapped
486 * via BAT or MMU, and MSR IR/DR is ON */
487 /* SRR0 has system reset vector, SRR1 has default MSR value */
488 /* rfi restores MSR from SRR1 and sets the PC to the SRR0 value */
489 /* NOTE: assumes reset vector is at 0xfff00100 */
490 __asm__ __volatile__
491 ("mtspr 26, %0\n\t"
492 "li 4,(1<<6)\n\t"
493 "mtspr 27,4\n\t"
494 "rfi\n\t"
495 :: "r" (addr):"r4");
496
497 return;
498}
499
500static void
501ev64260_restart(char *cmd)
502{
503 volatile ulong i = 10000000;
504
505 ev64260_reset_board((void *)0xfff00100);
506
507 while (i-- > 0);
508 panic("restart failed\n");
509}
510
511static void
512ev64260_halt(void)
513{
514 local_irq_disable();
515 while (1);
516 /* NOTREACHED */
517}
518
519static void
520ev64260_power_off(void)
521{
522 ev64260_halt();
523 /* NOTREACHED */
524}
525
526static int
527ev64260_show_cpuinfo(struct seq_file *m)
528{
529 uint pvid;
530
531 pvid = mfspr(SPRN_PVR);
532 seq_printf(m, "vendor\t\t: " BOARD_VENDOR "\n");
533 seq_printf(m, "machine\t\t: " BOARD_MACHINE "\n");
534 seq_printf(m, "cpu MHz\t\t: %d\n", ev64260_get_cpu_speed()/1000/1000);
535 seq_printf(m, "bus MHz\t\t: %d\n", ev64260_get_bus_speed()/1000/1000);
536
537 return 0;
538}
539
540/* DS1501 RTC has too much variation to use RTC for calibration */
541static void __init
542ev64260_calibrate_decr(void)
543{
544 ulong freq;
545
546 freq = ev64260_get_bus_speed()/4;
547
548 printk(KERN_INFO "time_init: decrementer frequency = %lu.%.6lu MHz\n",
549 freq/1000000, freq%1000000);
550
551 tb_ticks_per_jiffy = freq / HZ;
552 tb_to_us = mulhwu_scale_factor(freq, 1000000);
553
554 return;
555}
556
557/*
558 * Set BAT 3 to map 0xfb000000 to 0xfc000000 of physical memory space.
559 */
560static __inline__ void
561ev64260_set_bat(void)
562{
563 mb();
564 mtspr(SPRN_DBAT1U, 0xfb0001fe);
565 mtspr(SPRN_DBAT1L, 0xfb00002a);
566 mb();
567
568 return;
569}
570
571#if defined(CONFIG_SERIAL_TEXT_DEBUG) || defined(CONFIG_KGDB)
572static void __init
573ev64260_map_io(void)
574{
575 io_block_mapping(0xfb000000, 0xfb000000, 0x01000000, _PAGE_IO);
576}
577#endif
578
579void __init
580platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
581 unsigned long r6, unsigned long r7)
582{
583#ifdef CONFIG_BLK_DEV_INITRD
584 extern int initrd_below_start_ok;
585
586 initrd_start=initrd_end=0;
587 initrd_below_start_ok=0;
588#endif /* CONFIG_BLK_DEV_INITRD */
589
590 parse_bootinfo(find_bootinfo());
591
592 isa_mem_base = 0;
593 isa_io_base = EV64260_PCI0_IO_CPU_BASE;
594 pci_dram_offset = EV64260_PCI0_MEM_CPU_BASE;
595
596 loops_per_jiffy = ev64260_get_cpu_speed() / HZ;
597
598 ppc_md.setup_arch = ev64260_setup_arch;
599 ppc_md.show_cpuinfo = ev64260_show_cpuinfo;
600 ppc_md.init_IRQ = gt64260_init_irq;
601 ppc_md.get_irq = gt64260_get_irq;
602
603 ppc_md.restart = ev64260_restart;
604 ppc_md.power_off = ev64260_power_off;
605 ppc_md.halt = ev64260_halt;
606
607 ppc_md.find_end_of_memory = ev64260_find_end_of_memory;
608
609 ppc_md.init = NULL;
610
611 ppc_md.time_init = todc_time_init;
612 ppc_md.set_rtc_time = todc_set_rtc_time;
613 ppc_md.get_rtc_time = todc_get_rtc_time;
614 ppc_md.nvram_read_val = todc_direct_read_val;
615 ppc_md.nvram_write_val = todc_direct_write_val;
616 ppc_md.calibrate_decr = ev64260_calibrate_decr;
617
618 bh.p_base = CONFIG_MV64X60_NEW_BASE;
619
620 ev64260_set_bat();
621
622#ifdef CONFIG_SERIAL_8250
623#if defined(CONFIG_SERIAL_TEXT_DEBUG)
624 ppc_md.setup_io_mappings = ev64260_map_io;
625 ppc_md.progress = gen550_progress;
626#endif
627#if defined(CONFIG_KGDB)
628 ppc_md.setup_io_mappings = ev64260_map_io;
629 ppc_md.early_serial_map = ev64260_early_serial_map;
630#endif
631#elif defined(CONFIG_SERIAL_MPSC_CONSOLE)
632#ifdef CONFIG_SERIAL_TEXT_DEBUG
633 ppc_md.setup_io_mappings = ev64260_map_io;
634 ppc_md.progress = mv64x60_mpsc_progress;
635 mv64x60_progress_init(CONFIG_MV64X60_NEW_BASE);
636#endif /* CONFIG_SERIAL_TEXT_DEBUG */
637#ifdef CONFIG_KGDB
638 ppc_md.setup_io_mappings = ev64260_map_io;
639 ppc_md.early_serial_map = ev64260_early_serial_map;
640#endif /* CONFIG_KGDB */
641
642#endif
643
644#if defined(CONFIG_SERIAL_MPSC)
645 platform_notify = ev64260_platform_notify;
646#endif
647
648 return;
649}
diff --git a/arch/ppc/platforms/ev64260.h b/arch/ppc/platforms/ev64260.h
deleted file mode 100644
index 44d90d56745a..000000000000
--- a/arch/ppc/platforms/ev64260.h
+++ /dev/null
@@ -1,126 +0,0 @@
1/*
2 * Definitions for Marvell/Galileo EV-64260-BP Evaluation Board.
3 *
4 * Author: Mark A. Greer <mgreer@mvista.com>
5 *
6 * 2001-2002 (c) MontaVista, Software, Inc. This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10 */
11
12/*
13 * The MV64x60 has 2 PCI buses each with 1 window from the CPU bus to
14 * PCI I/O space and 4 windows from the CPU bus to PCI MEM space.
15 * We'll only use one PCI MEM window on each PCI bus.
16 *
17 * This is the CPU physical memory map (windows must be at least 1MB and start
18 * on a boundary that is a multiple of the window size):
19 *
20 * 0xfc000000-0xffffffff - External FLASH on device module
21 * 0xfbf00000-0xfbffffff - Embedded (on board) FLASH
22 * 0xfbe00000-0xfbefffff - GT64260 Registers (preferably)
23 * but really a config option
24 * 0xfbd00000-0xfbdfffff - External SRAM on device module
25 * 0xfbc00000-0xfbcfffff - TODC chip on device module
26 * 0xfbb00000-0xfbbfffff - External UART on device module
27 * 0xa2000000-0xfbafffff - <hole>
28 * 0xa1000000-0xa1ffffff - PCI 1 I/O (defined in gt64260.h)
29 * 0xa0000000-0xa0ffffff - PCI 0 I/O (defined in gt64260.h)
30 * 0x90000000-0x9fffffff - PCI 1 MEM (defined in gt64260.h)
31 * 0x80000000-0x8fffffff - PCI 0 MEM (defined in gt64260.h)
32 */
33
34#ifndef __PPC_PLATFORMS_EV64260_H
35#define __PPC_PLATFORMS_EV64260_H
36
37/* PCI mappings */
38#define EV64260_PCI0_IO_CPU_BASE 0xa0000000
39#define EV64260_PCI0_IO_PCI_BASE 0x00000000
40#define EV64260_PCI0_IO_SIZE 0x01000000
41
42#define EV64260_PCI0_MEM_CPU_BASE 0x80000000
43#define EV64260_PCI0_MEM_PCI_BASE 0x80000000
44#define EV64260_PCI0_MEM_SIZE 0x10000000
45
46#define EV64260_PCI1_IO_CPU_BASE (EV64260_PCI0_IO_CPU_BASE + \
47 EV64260_PCI0_IO_SIZE)
48#define EV64260_PCI1_IO_PCI_BASE (EV64260_PCI0_IO_PCI_BASE + \
49 EV64260_PCI0_IO_SIZE)
50#define EV64260_PCI1_IO_SIZE 0x01000000
51
52#define EV64260_PCI1_MEM_CPU_BASE (EV64260_PCI0_MEM_CPU_BASE + \
53 EV64260_PCI0_MEM_SIZE)
54#define EV64260_PCI1_MEM_PCI_BASE (EV64260_PCI0_MEM_PCI_BASE + \
55 EV64260_PCI0_MEM_SIZE)
56#define EV64260_PCI1_MEM_SIZE 0x10000000
57
58/* CPU Physical Memory Map setup (other than PCI) */
59#define EV64260_EXT_FLASH_BASE 0xfc000000
60#define EV64260_EMB_FLASH_BASE 0xfbf00000
61#define EV64260_EXT_SRAM_BASE 0xfbd00000
62#define EV64260_TODC_BASE 0xfbc00000
63#define EV64260_UART_BASE 0xfbb00000
64
65#define EV64260_EXT_FLASH_SIZE_ACTUAL 0x04000000 /* <= 64MB Extern FLASH */
66#define EV64260_EMB_FLASH_SIZE_ACTUAL 0x00080000 /* 512KB of Embed FLASH */
67#define EV64260_EXT_SRAM_SIZE_ACTUAL 0x00100000 /* 1MB SDRAM */
68#define EV64260_TODC_SIZE_ACTUAL 0x00000020 /* 32 bytes for TODC */
69#define EV64260_UART_SIZE_ACTUAL 0x00000040 /* 64 bytes for DUART */
70
71#define EV64260_EXT_FLASH_SIZE max(GT64260_WINDOW_SIZE_MIN, \
72 EV64260_EXT_FLASH_SIZE_ACTUAL)
73#define EV64260_EMB_FLASH_SIZE max(GT64260_WINDOW_SIZE_MIN, \
74 EV64260_EMB_FLASH_SIZE_ACTUAL)
75#define EV64260_EXT_SRAM_SIZE max(GT64260_WINDOW_SIZE_MIN, \
76 EV64260_EXT_SRAM_SIZE_ACTUAL)
77#define EV64260_TODC_SIZE max(GT64260_WINDOW_SIZE_MIN, \
78 EV64260_TODC_SIZE_ACTUAL)
79/* Assembler in bootwrapper blows up if 'max' is used */
80#define EV64260_UART_SIZE GT64260_WINDOW_SIZE_MIN
81#define EV64260_UART_END ((EV64260_UART_BASE + \
82 EV64260_UART_SIZE - 1) & 0xfff00000)
83
84/* Board-specific IRQ info */
85#define EV64260_UART_0_IRQ 85
86#define EV64260_UART_1_IRQ 86
87#define EV64260_PCI_0_IRQ 91
88#define EV64260_PCI_1_IRQ 93
89
90/* Serial port setup */
91#define EV64260_DEFAULT_BAUD 115200
92
93#if defined(CONFIG_SERIAL_MPSC_CONSOLE)
94#define SERIAL_PORT_DFNS
95
96#define EV64260_MPSC_CLK_SRC 8 /* TCLK */
97#define EV64260_MPSC_CLK_FREQ 100000000 /* 100MHz clk */
98#else
99#define EV64260_SERIAL_0 (EV64260_UART_BASE + 0x20)
100#define EV64260_SERIAL_1 EV64260_UART_BASE
101
102#define BASE_BAUD (EV64260_DEFAULT_BAUD * 2)
103
104#ifdef CONFIG_SERIAL_MANY_PORTS
105#define RS_TABLE_SIZE 64
106#else
107#define RS_TABLE_SIZE 2
108#endif
109
110#ifdef CONFIG_SERIAL_DETECT_IRQ
111#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF|ASYNC_SKIP_TEST|ASYNC_AUTO_IRQ)
112#else
113#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF|ASYNC_SKIP_TEST)
114#endif
115
116/* Required for bootloader's ns16550.c code */
117#define STD_SERIAL_PORT_DFNS \
118 { 0, BASE_BAUD, EV64260_SERIAL_0, EV64260_UART_0_IRQ, STD_COM_FLAGS, \
119 iomem_base: (u8 *)EV64260_SERIAL_0, /* ttyS0 */ \
120 iomem_reg_shift: 2, \
121 io_type: SERIAL_IO_MEM },
122
123#define SERIAL_PORT_DFNS \
124 STD_SERIAL_PORT_DFNS
125#endif
126#endif /* __PPC_PLATFORMS_EV64260_H */
diff --git a/arch/ppc/platforms/ev64360.c b/arch/ppc/platforms/ev64360.c
deleted file mode 100644
index 6765676a5c6b..000000000000
--- a/arch/ppc/platforms/ev64360.c
+++ /dev/null
@@ -1,517 +0,0 @@
1/*
2 * Board setup routines for the Marvell EV-64360-BP Evaluation Board.
3 *
4 * Author: Lee Nicks <allinux@gmail.com>
5 *
6 * Based on code done by Rabeeh Khoury - rabeeh@galileo.co.il
7 * Based on code done by - Mark A. Greer <mgreer@mvista.com>
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation; either version 2 of the License, or (at your
12 * option) any later version.
13 */
14#include <linux/kernel.h>
15#include <linux/pci.h>
16#include <linux/kdev_t.h>
17#include <linux/console.h>
18#include <linux/initrd.h>
19#include <linux/root_dev.h>
20#include <linux/delay.h>
21#include <linux/seq_file.h>
22#include <linux/bootmem.h>
23#include <linux/mtd/physmap.h>
24#include <linux/mv643xx.h>
25#include <linux/platform_device.h>
26#include <asm/page.h>
27#include <asm/time.h>
28#include <asm/smp.h>
29#include <asm/todc.h>
30#include <asm/bootinfo.h>
31#include <asm/ppcboot.h>
32#include <asm/mv64x60.h>
33#include <asm/machdep.h>
34#include <platforms/ev64360.h>
35
36#define BOARD_VENDOR "Marvell"
37#define BOARD_MACHINE "EV-64360-BP"
38
39static struct mv64x60_handle bh;
40static void __iomem *sram_base;
41
42static u32 ev64360_flash_size_0;
43static u32 ev64360_flash_size_1;
44
45static u32 ev64360_bus_frequency;
46
47unsigned char __res[sizeof(bd_t)];
48
49TODC_ALLOC();
50
51static int __init
52ev64360_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
53{
54 return 0;
55}
56
57static void __init
58ev64360_setup_bridge(void)
59{
60 struct mv64x60_setup_info si;
61 int i;
62
63 memset(&si, 0, sizeof(si));
64
65 si.phys_reg_base = CONFIG_MV64X60_NEW_BASE;
66
67 #ifdef CONFIG_PCI
68 si.pci_1.enable_bus = 1;
69 si.pci_1.pci_io.cpu_base = EV64360_PCI1_IO_START_PROC_ADDR;
70 si.pci_1.pci_io.pci_base_hi = 0;
71 si.pci_1.pci_io.pci_base_lo = EV64360_PCI1_IO_START_PCI_ADDR;
72 si.pci_1.pci_io.size = EV64360_PCI1_IO_SIZE;
73 si.pci_1.pci_io.swap = MV64x60_CPU2PCI_SWAP_NONE;
74 si.pci_1.pci_mem[0].cpu_base = EV64360_PCI1_MEM_START_PROC_ADDR;
75 si.pci_1.pci_mem[0].pci_base_hi = EV64360_PCI1_MEM_START_PCI_HI_ADDR;
76 si.pci_1.pci_mem[0].pci_base_lo = EV64360_PCI1_MEM_START_PCI_LO_ADDR;
77 si.pci_1.pci_mem[0].size = EV64360_PCI1_MEM_SIZE;
78 si.pci_1.pci_mem[0].swap = MV64x60_CPU2PCI_SWAP_NONE;
79 si.pci_1.pci_cmd_bits = 0;
80 si.pci_1.latency_timer = 0x80;
81 #else
82 si.pci_0.enable_bus = 0;
83 si.pci_1.enable_bus = 0;
84 #endif
85
86 for (i = 0; i < MV64x60_CPU2MEM_WINDOWS; i++) {
87#if defined(CONFIG_NOT_COHERENT_CACHE)
88 si.cpu_prot_options[i] = 0;
89 si.enet_options[i] = MV64360_ENET2MEM_SNOOP_NONE;
90 si.mpsc_options[i] = MV64360_MPSC2MEM_SNOOP_NONE;
91 si.idma_options[i] = MV64360_IDMA2MEM_SNOOP_NONE;
92
93 si.pci_1.acc_cntl_options[i] =
94 MV64360_PCI_ACC_CNTL_SNOOP_NONE |
95 MV64360_PCI_ACC_CNTL_SWAP_NONE |
96 MV64360_PCI_ACC_CNTL_MBURST_128_BYTES |
97 MV64360_PCI_ACC_CNTL_RDSIZE_256_BYTES;
98#else
99 si.cpu_prot_options[i] = 0;
100 si.enet_options[i] = MV64360_ENET2MEM_SNOOP_NONE; /* errata */
101 si.mpsc_options[i] = MV64360_MPSC2MEM_SNOOP_NONE; /* errata */
102 si.idma_options[i] = MV64360_IDMA2MEM_SNOOP_NONE; /* errata */
103
104 si.pci_1.acc_cntl_options[i] =
105 MV64360_PCI_ACC_CNTL_SNOOP_WB |
106 MV64360_PCI_ACC_CNTL_SWAP_NONE |
107 MV64360_PCI_ACC_CNTL_MBURST_32_BYTES |
108 MV64360_PCI_ACC_CNTL_RDSIZE_32_BYTES;
109#endif
110 }
111
112 if (mv64x60_init(&bh, &si))
113 printk(KERN_WARNING "Bridge initialization failed.\n");
114
115 #ifdef CONFIG_PCI
116 pci_dram_offset = 0; /* sys mem at same addr on PCI & cpu bus */
117 ppc_md.pci_swizzle = common_swizzle;
118 ppc_md.pci_map_irq = ev64360_map_irq;
119 ppc_md.pci_exclude_device = mv64x60_pci_exclude_device;
120
121 mv64x60_set_bus(&bh, 1, 0);
122 bh.hose_b->first_busno = 0;
123 bh.hose_b->last_busno = 0xff;
124 #endif
125}
126
127/* Bridge & platform setup routines */
128void __init
129ev64360_intr_setup(void)
130{
131 /* MPP 8, 9, and 10 */
132 mv64x60_clr_bits(&bh, MV64x60_MPP_CNTL_1, 0xfff);
133
134 /*
135 * Define GPP 8,9,and 10 interrupt polarity as active low
136 * input signal and level triggered
137 */
138 mv64x60_set_bits(&bh, MV64x60_GPP_LEVEL_CNTL, 0x700);
139 mv64x60_clr_bits(&bh, MV64x60_GPP_IO_CNTL, 0x700);
140
141 /* Config GPP intr ctlr to respond to level trigger */
142 mv64x60_set_bits(&bh, MV64x60_COMM_ARBITER_CNTL, (1<<10));
143
144 /* Erranum FEr PCI-#8 */
145 mv64x60_clr_bits(&bh, MV64x60_PCI0_CMD, (1<<5) | (1<<9));
146 mv64x60_clr_bits(&bh, MV64x60_PCI1_CMD, (1<<5) | (1<<9));
147
148 /*
149 * Dismiss and then enable interrupt on GPP interrupt cause
150 * for CPU #0
151 */
152 mv64x60_write(&bh, MV64x60_GPP_INTR_CAUSE, ~0x700);
153 mv64x60_set_bits(&bh, MV64x60_GPP_INTR_MASK, 0x700);
154
155 /*
156 * Dismiss and then enable interrupt on CPU #0 high cause reg
157 * BIT25 summarizes GPP interrupts 8-15
158 */
159 mv64x60_set_bits(&bh, MV64360_IC_CPU0_INTR_MASK_HI, (1<<25));
160}
161
162void __init
163ev64360_setup_peripherals(void)
164{
165 u32 base;
166
167 /* Set up window for boot CS */
168 mv64x60_set_32bit_window(&bh, MV64x60_CPU2BOOT_WIN,
169 EV64360_BOOT_WINDOW_BASE, EV64360_BOOT_WINDOW_SIZE, 0);
170 bh.ci->enable_window_32bit(&bh, MV64x60_CPU2BOOT_WIN);
171
172 /* We only use the 32-bit flash */
173 mv64x60_get_32bit_window(&bh, MV64x60_CPU2BOOT_WIN, &base,
174 &ev64360_flash_size_0);
175 ev64360_flash_size_1 = 0;
176
177 mv64x60_set_32bit_window(&bh, MV64x60_CPU2DEV_1_WIN,
178 EV64360_RTC_WINDOW_BASE, EV64360_RTC_WINDOW_SIZE, 0);
179 bh.ci->enable_window_32bit(&bh, MV64x60_CPU2DEV_1_WIN);
180
181 TODC_INIT(TODC_TYPE_DS1501, 0, 0,
182 ioremap(EV64360_RTC_WINDOW_BASE, EV64360_RTC_WINDOW_SIZE), 8);
183
184 mv64x60_set_32bit_window(&bh, MV64x60_CPU2SRAM_WIN,
185 EV64360_INTERNAL_SRAM_BASE, MV64360_SRAM_SIZE, 0);
186 bh.ci->enable_window_32bit(&bh, MV64x60_CPU2SRAM_WIN);
187 sram_base = ioremap(EV64360_INTERNAL_SRAM_BASE, MV64360_SRAM_SIZE);
188
189 /* Set up Enet->SRAM window */
190 mv64x60_set_32bit_window(&bh, MV64x60_ENET2MEM_4_WIN,
191 EV64360_INTERNAL_SRAM_BASE, MV64360_SRAM_SIZE, 0x2);
192 bh.ci->enable_window_32bit(&bh, MV64x60_ENET2MEM_4_WIN);
193
194 /* Give enet r/w access to memory region */
195 mv64x60_set_bits(&bh, MV64360_ENET2MEM_ACC_PROT_0, (0x3 << (4 << 1)));
196 mv64x60_set_bits(&bh, MV64360_ENET2MEM_ACC_PROT_1, (0x3 << (4 << 1)));
197 mv64x60_set_bits(&bh, MV64360_ENET2MEM_ACC_PROT_2, (0x3 << (4 << 1)));
198
199 mv64x60_clr_bits(&bh, MV64x60_PCI1_PCI_DECODE_CNTL, (1 << 3));
200 mv64x60_clr_bits(&bh, MV64x60_TIMR_CNTR_0_3_CNTL,
201 ((1 << 0) | (1 << 8) | (1 << 16) | (1 << 24)));
202
203#if defined(CONFIG_NOT_COHERENT_CACHE)
204 mv64x60_write(&bh, MV64360_SRAM_CONFIG, 0x00160000);
205#else
206 mv64x60_write(&bh, MV64360_SRAM_CONFIG, 0x001600b2);
207#endif
208
209 /*
210 * Setting the SRAM to 0. Note that this generates parity errors on
211 * internal data path in SRAM since it's first time accessing it
212 * while after reset it's not configured.
213 */
214 memset(sram_base, 0, MV64360_SRAM_SIZE);
215
216 /* set up PCI interrupt controller */
217 ev64360_intr_setup();
218}
219
220static void __init
221ev64360_setup_arch(void)
222{
223 if (ppc_md.progress)
224 ppc_md.progress("ev64360_setup_arch: enter", 0);
225
226 set_tb(0, 0);
227
228#ifdef CONFIG_BLK_DEV_INITRD
229 if (initrd_start)
230 ROOT_DEV = Root_RAM0;
231 else
232#endif
233#ifdef CONFIG_ROOT_NFS
234 ROOT_DEV = Root_NFS;
235#else
236 ROOT_DEV = Root_SDA2;
237#endif
238
239 /*
240 * Set up the L2CR register.
241 */
242 _set_L2CR(L2CR_L2E | L2CR_L2PE);
243
244 if (ppc_md.progress)
245 ppc_md.progress("ev64360_setup_arch: calling setup_bridge", 0);
246
247 ev64360_setup_bridge();
248 ev64360_setup_peripherals();
249 ev64360_bus_frequency = ev64360_bus_freq();
250
251 printk(KERN_INFO "%s %s port (C) 2005 Lee Nicks "
252 "(allinux@gmail.com)\n", BOARD_VENDOR, BOARD_MACHINE);
253 if (ppc_md.progress)
254 ppc_md.progress("ev64360_setup_arch: exit", 0);
255}
256
257/* Platform device data fixup routines. */
258#if defined(CONFIG_SERIAL_MPSC)
259static void __init
260ev64360_fixup_mpsc_pdata(struct platform_device *pdev)
261{
262 struct mpsc_pdata *pdata;
263
264 pdata = (struct mpsc_pdata *)pdev->dev.platform_data;
265
266 pdata->max_idle = 40;
267 pdata->default_baud = EV64360_DEFAULT_BAUD;
268 pdata->brg_clk_src = EV64360_MPSC_CLK_SRC;
269 /*
270 * TCLK (not SysCLk) is routed to BRG, then to the MPSC. On most parts,
271 * TCLK == SysCLK but on 64460, they are separate pins.
272 * SysCLK can go up to 200 MHz but TCLK can only go up to 133 MHz.
273 */
274 pdata->brg_clk_freq = min(ev64360_bus_frequency, MV64x60_TCLK_FREQ_MAX);
275}
276#endif
277
278#if defined(CONFIG_MV643XX_ETH)
279static void __init
280ev64360_fixup_eth_pdata(struct platform_device *pdev)
281{
282 struct mv643xx_eth_platform_data *eth_pd;
283 static u16 phy_addr[] = {
284 EV64360_ETH0_PHY_ADDR,
285 EV64360_ETH1_PHY_ADDR,
286 EV64360_ETH2_PHY_ADDR,
287 };
288
289 eth_pd = pdev->dev.platform_data;
290 eth_pd->force_phy_addr = 1;
291 eth_pd->phy_addr = phy_addr[pdev->id];
292 eth_pd->tx_queue_size = EV64360_ETH_TX_QUEUE_SIZE;
293 eth_pd->rx_queue_size = EV64360_ETH_RX_QUEUE_SIZE;
294}
295#endif
296
297static int
298ev64360_platform_notify(struct device *dev)
299{
300 static struct {
301 char *bus_id;
302 void ((*rtn)(struct platform_device *pdev));
303 } dev_map[] = {
304#if defined(CONFIG_SERIAL_MPSC)
305 { MPSC_CTLR_NAME ".0", ev64360_fixup_mpsc_pdata },
306 { MPSC_CTLR_NAME ".1", ev64360_fixup_mpsc_pdata },
307#endif
308#if defined(CONFIG_MV643XX_ETH)
309 { MV643XX_ETH_NAME ".0", ev64360_fixup_eth_pdata },
310 { MV643XX_ETH_NAME ".1", ev64360_fixup_eth_pdata },
311 { MV643XX_ETH_NAME ".2", ev64360_fixup_eth_pdata },
312#endif
313 };
314 struct platform_device *pdev;
315 int i;
316
317 if (dev && dev->bus_id)
318 for (i=0; i<ARRAY_SIZE(dev_map); i++)
319 if (!strncmp(dev->bus_id, dev_map[i].bus_id,
320 BUS_ID_SIZE)) {
321
322 pdev = container_of(dev,
323 struct platform_device, dev);
324 dev_map[i].rtn(pdev);
325 }
326
327 return 0;
328}
329
330#ifdef CONFIG_MTD_PHYSMAP
331
332#ifndef MB
333#define MB (1 << 20)
334#endif
335
336/*
337 * MTD Layout.
338 *
339 * FLASH Amount: 0xff000000 - 0xffffffff
340 * ------------- -----------------------
341 * Reserved: 0xff000000 - 0xff03ffff
342 * JFFS2 file system: 0xff040000 - 0xffefffff
343 * U-boot: 0xfff00000 - 0xffffffff
344 */
345static int __init
346ev64360_setup_mtd(void)
347{
348 u32 size;
349 int ptbl_entries;
350 static struct mtd_partition *ptbl;
351
352 size = ev64360_flash_size_0 + ev64360_flash_size_1;
353 if (!size)
354 return -ENOMEM;
355
356 ptbl_entries = 3;
357
358 if ((ptbl = kzalloc(ptbl_entries * sizeof(struct mtd_partition),
359 GFP_KERNEL)) == NULL) {
360
361 printk(KERN_WARNING "Can't alloc MTD partition table\n");
362 return -ENOMEM;
363 }
364
365 ptbl[0].name = "reserved";
366 ptbl[0].offset = 0;
367 ptbl[0].size = EV64360_MTD_RESERVED_SIZE;
368 ptbl[1].name = "jffs2";
369 ptbl[1].offset = EV64360_MTD_RESERVED_SIZE;
370 ptbl[1].size = EV64360_MTD_JFFS2_SIZE;
371 ptbl[2].name = "U-BOOT";
372 ptbl[2].offset = EV64360_MTD_RESERVED_SIZE + EV64360_MTD_JFFS2_SIZE;
373 ptbl[2].size = EV64360_MTD_UBOOT_SIZE;
374
375 physmap_map.size = size;
376 physmap_set_partitions(ptbl, ptbl_entries);
377 return 0;
378}
379
380arch_initcall(ev64360_setup_mtd);
381#endif
382
383static void
384ev64360_restart(char *cmd)
385{
386 ulong i = 0xffffffff;
387 volatile unsigned char * rtc_base = ioremap(EV64360_RTC_WINDOW_BASE,0x4000);
388
389 /* issue hard reset */
390 rtc_base[0xf] = 0x80;
391 rtc_base[0xc] = 0x00;
392 rtc_base[0xd] = 0x01;
393 rtc_base[0xf] = 0x83;
394
395 while (i-- > 0) ;
396 panic("restart failed\n");
397}
398
399static void
400ev64360_halt(void)
401{
402 while (1) ;
403 /* NOTREACHED */
404}
405
406static void
407ev64360_power_off(void)
408{
409 ev64360_halt();
410 /* NOTREACHED */
411}
412
413static int
414ev64360_show_cpuinfo(struct seq_file *m)
415{
416 seq_printf(m, "vendor\t\t: " BOARD_VENDOR "\n");
417 seq_printf(m, "machine\t\t: " BOARD_MACHINE "\n");
418 seq_printf(m, "bus speed\t: %dMHz\n", ev64360_bus_frequency/1000/1000);
419
420 return 0;
421}
422
423static void __init
424ev64360_calibrate_decr(void)
425{
426 u32 freq;
427
428 freq = ev64360_bus_frequency / 4;
429
430 printk(KERN_INFO "time_init: decrementer frequency = %lu.%.6lu MHz\n",
431 (long)freq / 1000000, (long)freq % 1000000);
432
433 tb_ticks_per_jiffy = freq / HZ;
434 tb_to_us = mulhwu_scale_factor(freq, 1000000);
435}
436
437unsigned long __init
438ev64360_find_end_of_memory(void)
439{
440 return mv64x60_get_mem_size(CONFIG_MV64X60_NEW_BASE,
441 MV64x60_TYPE_MV64360);
442}
443
444static inline void
445ev64360_set_bat(void)
446{
447 mb();
448 mtspr(SPRN_DBAT2U, 0xf0001ffe);
449 mtspr(SPRN_DBAT2L, 0xf000002a);
450 mb();
451}
452
453#if defined(CONFIG_SERIAL_TEXT_DEBUG) && defined(CONFIG_SERIAL_MPSC_CONSOLE)
454static void __init
455ev64360_map_io(void)
456{
457 io_block_mapping(CONFIG_MV64X60_NEW_BASE, \
458 CONFIG_MV64X60_NEW_BASE, \
459 0x00020000, _PAGE_IO);
460}
461#endif
462
463void __init
464platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
465 unsigned long r6, unsigned long r7)
466{
467 parse_bootinfo(find_bootinfo());
468
469 /* ASSUMPTION: If both r3 (bd_t pointer) and r6 (cmdline pointer)
470 * are non-zero, then we should use the board info from the bd_t
471 * structure and the cmdline pointed to by r6 instead of the
472 * information from birecs, if any. Otherwise, use the information
473 * from birecs as discovered by the preceding call to
474 * parse_bootinfo(). This rule should work with both PPCBoot, which
475 * uses a bd_t board info structure, and the kernel boot wrapper,
476 * which uses birecs.
477 */
478 if (r3 && r6) {
479 /* copy board info structure */
480 memcpy( (void *)__res,(void *)(r3+KERNELBASE), sizeof(bd_t) );
481 /* copy command line */
482 *(char *)(r7+KERNELBASE) = 0;
483 strcpy(cmd_line, (char *)(r6+KERNELBASE));
484 }
485 #ifdef CONFIG_ISA
486 isa_mem_base = 0;
487 #endif
488
489 ppc_md.setup_arch = ev64360_setup_arch;
490 ppc_md.show_cpuinfo = ev64360_show_cpuinfo;
491 ppc_md.init_IRQ = mv64360_init_irq;
492 ppc_md.get_irq = mv64360_get_irq;
493 ppc_md.restart = ev64360_restart;
494 ppc_md.power_off = ev64360_power_off;
495 ppc_md.halt = ev64360_halt;
496 ppc_md.find_end_of_memory = ev64360_find_end_of_memory;
497 ppc_md.init = NULL;
498
499 ppc_md.time_init = todc_time_init;
500 ppc_md.set_rtc_time = todc_set_rtc_time;
501 ppc_md.get_rtc_time = todc_get_rtc_time;
502 ppc_md.nvram_read_val = todc_direct_read_val;
503 ppc_md.nvram_write_val = todc_direct_write_val;
504 ppc_md.calibrate_decr = ev64360_calibrate_decr;
505
506#if defined(CONFIG_SERIAL_TEXT_DEBUG) && defined(CONFIG_SERIAL_MPSC_CONSOLE)
507 ppc_md.setup_io_mappings = ev64360_map_io;
508 ppc_md.progress = mv64x60_mpsc_progress;
509 mv64x60_progress_init(CONFIG_MV64X60_NEW_BASE);
510#endif
511
512#if defined(CONFIG_SERIAL_MPSC) || defined(CONFIG_MV643XX_ETH)
513 platform_notify = ev64360_platform_notify;
514#endif
515
516 ev64360_set_bat(); /* Need for ev64360_find_end_of_memory and progress */
517}
diff --git a/arch/ppc/platforms/ev64360.h b/arch/ppc/platforms/ev64360.h
deleted file mode 100644
index b30f4722690a..000000000000
--- a/arch/ppc/platforms/ev64360.h
+++ /dev/null
@@ -1,114 +0,0 @@
1/*
2 * Definitions for Marvell EV-64360-BP Evaluation Board.
3 *
4 * Author: Lee Nicks <allinux@gmail.com>
5 *
6 * Based on code done by Rabeeh Khoury - rabeeh@galileo.co.il
7 * Based on code done by Mark A. Greer <mgreer@mvista.com>
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation; either version 2 of the License, or (at your
12 * option) any later version.
13 */
14
15/*
16 * The MV64360 has 2 PCI buses each with 1 window from the CPU bus to
17 * PCI I/O space and 4 windows from the CPU bus to PCI MEM space.
18 * We'll only use one PCI MEM window on each PCI bus.
19 *
20 * This is the CPU physical memory map (windows must be at least 64KB and start
21 * on a boundary that is a multiple of the window size):
22 *
23 * 0x42000000-0x4203ffff - Internal SRAM
24 * 0xf1000000-0xf100ffff - MV64360 Registers (CONFIG_MV64X60_NEW_BASE)
25 * 0xfc800000-0xfcffffff - RTC
26 * 0xff000000-0xffffffff - Boot window, 16 MB flash
27 * 0xc0000000-0xc3ffffff - PCI I/O (second hose)
28 * 0x80000000-0xbfffffff - PCI MEM (second hose)
29 */
30
31#ifndef __PPC_PLATFORMS_EV64360_H
32#define __PPC_PLATFORMS_EV64360_H
33
34/* CPU Physical Memory Map setup. */
35#define EV64360_BOOT_WINDOW_BASE 0xff000000
36#define EV64360_BOOT_WINDOW_SIZE 0x01000000 /* 16 MB */
37#define EV64360_INTERNAL_SRAM_BASE 0x42000000
38#define EV64360_RTC_WINDOW_BASE 0xfc800000
39#define EV64360_RTC_WINDOW_SIZE 0x00800000 /* 8 MB */
40
41#define EV64360_PCI1_MEM_START_PROC_ADDR 0x80000000
42#define EV64360_PCI1_MEM_START_PCI_HI_ADDR 0x00000000
43#define EV64360_PCI1_MEM_START_PCI_LO_ADDR 0x80000000
44#define EV64360_PCI1_MEM_SIZE 0x40000000 /* 1 GB */
45#define EV64360_PCI1_IO_START_PROC_ADDR 0xc0000000
46#define EV64360_PCI1_IO_START_PCI_ADDR 0x00000000
47#define EV64360_PCI1_IO_SIZE 0x04000000 /* 64 MB */
48
49#define EV64360_DEFAULT_BAUD 115200
50#define EV64360_MPSC_CLK_SRC 8 /* TCLK */
51#define EV64360_MPSC_CLK_FREQ 133333333
52
53#define EV64360_MTD_RESERVED_SIZE 0x40000
54#define EV64360_MTD_JFFS2_SIZE 0xec0000
55#define EV64360_MTD_UBOOT_SIZE 0x100000
56
57#define EV64360_ETH0_PHY_ADDR 8
58#define EV64360_ETH1_PHY_ADDR 9
59#define EV64360_ETH2_PHY_ADDR 10
60
61#define EV64360_ETH_TX_QUEUE_SIZE 800
62#define EV64360_ETH_RX_QUEUE_SIZE 400
63
64#define EV64360_ETH_PORT_CONFIG_VALUE \
65 ETH_UNICAST_NORMAL_MODE | \
66 ETH_DEFAULT_RX_QUEUE_0 | \
67 ETH_DEFAULT_RX_ARP_QUEUE_0 | \
68 ETH_RECEIVE_BC_IF_NOT_IP_OR_ARP | \
69 ETH_RECEIVE_BC_IF_IP | \
70 ETH_RECEIVE_BC_IF_ARP | \
71 ETH_CAPTURE_TCP_FRAMES_DIS | \
72 ETH_CAPTURE_UDP_FRAMES_DIS | \
73 ETH_DEFAULT_RX_TCP_QUEUE_0 | \
74 ETH_DEFAULT_RX_UDP_QUEUE_0 | \
75 ETH_DEFAULT_RX_BPDU_QUEUE_0
76
77#define EV64360_ETH_PORT_CONFIG_EXTEND_VALUE \
78 ETH_SPAN_BPDU_PACKETS_AS_NORMAL | \
79 ETH_PARTITION_DISABLE
80
81#define GT_ETH_IPG_INT_RX(value) \
82 ((value & 0x3fff) << 8)
83
84#define EV64360_ETH_PORT_SDMA_CONFIG_VALUE \
85 ETH_RX_BURST_SIZE_4_64BIT | \
86 GT_ETH_IPG_INT_RX(0) | \
87 ETH_TX_BURST_SIZE_4_64BIT
88
89#define EV64360_ETH_PORT_SERIAL_CONTROL_VALUE \
90 ETH_FORCE_LINK_PASS | \
91 ETH_ENABLE_AUTO_NEG_FOR_DUPLX | \
92 ETH_DISABLE_AUTO_NEG_FOR_FLOW_CTRL | \
93 ETH_ADV_SYMMETRIC_FLOW_CTRL | \
94 ETH_FORCE_FC_MODE_NO_PAUSE_DIS_TX | \
95 ETH_FORCE_BP_MODE_NO_JAM | \
96 BIT9 | \
97 ETH_DO_NOT_FORCE_LINK_FAIL | \
98 ETH_RETRANSMIT_16_ATTEMPTS | \
99 ETH_ENABLE_AUTO_NEG_SPEED_GMII | \
100 ETH_DTE_ADV_0 | \
101 ETH_DISABLE_AUTO_NEG_BYPASS | \
102 ETH_AUTO_NEG_NO_CHANGE | \
103 ETH_MAX_RX_PACKET_9700BYTE | \
104 ETH_CLR_EXT_LOOPBACK | \
105 ETH_SET_FULL_DUPLEX_MODE | \
106 ETH_ENABLE_FLOW_CTRL_TX_RX_IN_FULL_DUPLEX
107
108static inline u32
109ev64360_bus_freq(void)
110{
111 return 133333333;
112}
113
114#endif /* __PPC_PLATFORMS_EV64360_H */
diff --git a/arch/ppc/platforms/fads.h b/arch/ppc/platforms/fads.h
deleted file mode 100644
index 5219366667b3..000000000000
--- a/arch/ppc/platforms/fads.h
+++ /dev/null
@@ -1,130 +0,0 @@
1/*
2 * A collection of structures, addresses, and values associated with
3 * the Motorola 860T FADS board. Copied from the MBX stuff.
4 *
5 * Copyright (c) 1998 Dan Malek (dmalek@jlc.net)
6 *
7 * Added MPC86XADS support.
8 * The MPC86xADS manual says the board "is compatible with the MPC8xxFADS
9 * for SW point of view". This is 99% correct.
10 *
11 * Author: MontaVista Software, Inc.
12 * source@mvista.com
13 * 2005 (c) MontaVista Software, Inc. This file is licensed under the
14 * terms of the GNU General Public License version 2. This program is licensed
15 * "as is" without any warranty of any kind, whether express or implied.
16 */
17
18#ifdef __KERNEL__
19#ifndef __ASM_FADS_H__
20#define __ASM_FADS_H__
21
22
23#include <asm/ppcboot.h>
24
25/* Memory map is configured by the PROM startup.
26 * I tried to follow the FADS manual, although the startup PROM
27 * dictates this and we simply have to move some of the physical
28 * addresses for Linux.
29 */
30#define BCSR_ADDR ((uint)0xff010000)
31
32/* PHY link change interrupt */
33#define PHY_INTERRUPT SIU_IRQ2
34
35#define BCSR_SIZE ((uint)(64 * 1024))
36#define BCSR0 ((uint)(BCSR_ADDR + 0x00))
37#define BCSR1 ((uint)(BCSR_ADDR + 0x04))
38#define BCSR2 ((uint)(BCSR_ADDR + 0x08))
39#define BCSR3 ((uint)(BCSR_ADDR + 0x0c))
40#define BCSR4 ((uint)(BCSR_ADDR + 0x10))
41
42#define IMAP_ADDR ((uint)0xff000000)
43#define IMAP_SIZE ((uint)(64 * 1024))
44
45#define PCMCIA_MEM_ADDR ((uint)0xff020000)
46#define PCMCIA_MEM_SIZE ((uint)(64 * 1024))
47
48/* Bits of interest in the BCSRs.
49 */
50#define BCSR1_ETHEN ((uint)0x20000000)
51#define BCSR1_IRDAEN ((uint)0x10000000)
52#define BCSR1_RS232EN_1 ((uint)0x01000000)
53#define BCSR1_PCCEN ((uint)0x00800000)
54#define BCSR1_PCCVCC0 ((uint)0x00400000)
55#define BCSR1_PCCVPP0 ((uint)0x00200000)
56#define BCSR1_PCCVPP1 ((uint)0x00100000)
57#define BCSR1_PCCVPP_MASK (BCSR1_PCCVPP0 | BCSR1_PCCVPP1)
58#define BCSR1_RS232EN_2 ((uint)0x00040000)
59#define BCSR1_PCCVCC1 ((uint)0x00010000)
60#define BCSR1_PCCVCC_MASK (BCSR1_PCCVCC0 | BCSR1_PCCVCC1)
61
62#define BCSR4_ETHLOOP ((uint)0x80000000) /* EEST Loopback */
63#define BCSR4_EEFDX ((uint)0x40000000) /* EEST FDX enable */
64#define BCSR4_FETH_EN ((uint)0x08000000) /* PHY enable */
65#define BCSR4_FETHCFG0 ((uint)0x04000000) /* PHY autoneg mode */
66#define BCSR4_FETHCFG1 ((uint)0x00400000) /* PHY autoneg mode */
67#define BCSR4_FETHFDE ((uint)0x02000000) /* PHY FDX advertise */
68#define BCSR4_FETHRST ((uint)0x00200000) /* PHY Reset */
69
70/* IO_BASE definition for pcmcia.
71 */
72#define _IO_BASE 0x80000000
73#define _IO_BASE_SIZE 0x1000
74
75#ifdef CONFIG_IDE
76#define MAX_HWIFS 1
77#endif
78
79/* Interrupt level assignments.
80 */
81#define FEC_INTERRUPT SIU_LEVEL1 /* FEC interrupt */
82
83/* We don't use the 8259.
84 */
85#define NR_8259_INTS 0
86
87/* CPM Ethernet through SCC1 or SCC2 */
88
89#if defined(CONFIG_SCC1_ENET) || defined(CONFIG_MPC8xx_SECOND_ETH_SCC1) /* Probably 860 variant */
90/* Bits in parallel I/O port registers that have to be set/cleared
91 * to configure the pins for SCC1 use.
92 * TCLK - CLK1, RCLK - CLK2.
93 */
94#define PA_ENET_RXD ((ushort)0x0001)
95#define PA_ENET_TXD ((ushort)0x0002)
96#define PA_ENET_TCLK ((ushort)0x0100)
97#define PA_ENET_RCLK ((ushort)0x0200)
98#define PB_ENET_TENA ((uint)0x00001000)
99#define PC_ENET_CLSN ((ushort)0x0010)
100#define PC_ENET_RENA ((ushort)0x0020)
101
102/* Control bits in the SICR to route TCLK (CLK1) and RCLK (CLK2) to
103 * SCC1. Also, make sure GR1 (bit 24) and SC1 (bit 25) are zero.
104 */
105#define SICR_ENET_MASK ((uint)0x000000ff)
106#define SICR_ENET_CLKRT ((uint)0x0000002c)
107#endif /* CONFIG_SCC1_ENET */
108
109#ifdef CONFIG_SCC2_ENET /* Probably 823/850 variant */
110/* Bits in parallel I/O port registers that have to be set/cleared
111 * to configure the pins for SCC1 use.
112 * TCLK - CLK1, RCLK - CLK2.
113 */
114#define PA_ENET_RXD ((ushort)0x0004)
115#define PA_ENET_TXD ((ushort)0x0008)
116#define PA_ENET_TCLK ((ushort)0x0400)
117#define PA_ENET_RCLK ((ushort)0x0200)
118#define PB_ENET_TENA ((uint)0x00002000)
119#define PC_ENET_CLSN ((ushort)0x0040)
120#define PC_ENET_RENA ((ushort)0x0080)
121
122/* Control bits in the SICR to route TCLK and RCLK to
123 * SCC2. Also, make sure GR1 (bit 24) and SC1 (bit 25) are zero.
124 */
125#define SICR_ENET_MASK ((uint)0x0000ff00)
126#define SICR_ENET_CLKRT ((uint)0x00002e00)
127#endif /* CONFIG_SCC2_ENET */
128
129#endif /* __ASM_FADS_H__ */
130#endif /* __KERNEL__ */
diff --git a/arch/ppc/platforms/hdpu.c b/arch/ppc/platforms/hdpu.c
deleted file mode 100644
index 904b518c152e..000000000000
--- a/arch/ppc/platforms/hdpu.c
+++ /dev/null
@@ -1,1015 +0,0 @@
1/*
2 * Board setup routines for the Sky Computers HDPU Compute Blade.
3 *
4 * Written by Brian Waite <waite@skycomputers.com>
5 *
6 * Based on code done by - Mark A. Greer <mgreer@mvista.com>
7 * Rabeeh Khoury - rabeeh@galileo.co.il
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation; either version 2 of the License, or (at your
12 * option) any later version.
13 */
14
15
16#include <linux/pci.h>
17#include <linux/delay.h>
18#include <linux/irq.h>
19#include <linux/seq_file.h>
20#include <linux/platform_device.h>
21
22#include <linux/initrd.h>
23#include <linux/root_dev.h>
24#include <linux/smp.h>
25
26#include <asm/time.h>
27#include <asm/machdep.h>
28#include <asm/todc.h>
29#include <asm/mv64x60.h>
30#include <asm/ppcboot.h>
31#include <platforms/hdpu.h>
32#include <linux/mv643xx.h>
33#include <linux/hdpu_features.h>
34#include <linux/device.h>
35#include <linux/mtd/physmap.h>
36
37#define BOARD_VENDOR "Sky Computers"
38#define BOARD_MACHINE "HDPU-CB-A"
39
40bd_t ppcboot_bd;
41int ppcboot_bd_valid = 0;
42
43static mv64x60_handle_t bh;
44
45extern char cmd_line[];
46
47unsigned long hdpu_find_end_of_memory(void);
48void hdpu_mpsc_progress(char *s, unsigned short hex);
49void hdpu_heartbeat(void);
50
51static void parse_bootinfo(unsigned long r3,
52 unsigned long r4, unsigned long r5,
53 unsigned long r6, unsigned long r7);
54static void hdpu_set_l1pe(void);
55static void hdpu_cpustate_set(unsigned char new_state);
56#ifdef CONFIG_SMP
57static DEFINE_SPINLOCK(timebase_lock);
58static unsigned int timebase_upper = 0, timebase_lower = 0;
59extern int smp_tb_synchronized;
60
61void __devinit hdpu_tben_give(void);
62void __devinit hdpu_tben_take(void);
63#endif
64
65static int __init
66hdpu_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
67{
68 struct pci_controller *hose = pci_bus_to_hose(dev->bus->number);
69
70 if (hose->index == 0) {
71 static char pci_irq_table[][4] = {
72 {HDPU_PCI_0_IRQ, 0, 0, 0},
73 {HDPU_PCI_0_IRQ, 0, 0, 0},
74 };
75
76 const long min_idsel = 1, max_idsel = 2, irqs_per_slot = 4;
77 return PCI_IRQ_TABLE_LOOKUP;
78 } else {
79 static char pci_irq_table[][4] = {
80 {HDPU_PCI_1_IRQ, 0, 0, 0},
81 };
82
83 const long min_idsel = 1, max_idsel = 1, irqs_per_slot = 4;
84 return PCI_IRQ_TABLE_LOOKUP;
85 }
86}
87
88static void __init hdpu_intr_setup(void)
89{
90 mv64x60_write(&bh, MV64x60_GPP_IO_CNTL,
91 (1 | (1 << 2) | (1 << 3) | (1 << 4) | (1 << 5) |
92 (1 << 6) | (1 << 7) | (1 << 12) | (1 << 16) |
93 (1 << 18) | (1 << 19) | (1 << 20) | (1 << 21) |
94 (1 << 22) | (1 << 23) | (1 << 24) | (1 << 25) |
95 (1 << 26) | (1 << 27) | (1 << 28) | (1 << 29)));
96
97 /* XXXX Erranum FEr PCI-#8 */
98 mv64x60_clr_bits(&bh, MV64x60_PCI0_CMD, (1 << 5) | (1 << 9));
99 mv64x60_clr_bits(&bh, MV64x60_PCI1_CMD, (1 << 5) | (1 << 9));
100
101 /*
102 * Dismiss and then enable interrupt on GPP interrupt cause
103 * for CPU #0
104 */
105 mv64x60_write(&bh, MV64x60_GPP_INTR_CAUSE, ~((1 << 8) | (1 << 13)));
106 mv64x60_set_bits(&bh, MV64x60_GPP_INTR_MASK, (1 << 8) | (1 << 13));
107
108 /*
109 * Dismiss and then enable interrupt on CPU #0 high cause reg
110 * BIT25 summarizes GPP interrupts 8-15
111 */
112 mv64x60_set_bits(&bh, MV64360_IC_CPU0_INTR_MASK_HI, (1 << 25));
113}
114
115static void __init hdpu_setup_peripherals(void)
116{
117 unsigned int val;
118
119 mv64x60_set_32bit_window(&bh, MV64x60_CPU2BOOT_WIN,
120 HDPU_EMB_FLASH_BASE, HDPU_EMB_FLASH_SIZE, 0);
121 bh.ci->enable_window_32bit(&bh, MV64x60_CPU2BOOT_WIN);
122
123 mv64x60_set_32bit_window(&bh, MV64x60_CPU2DEV_0_WIN,
124 HDPU_TBEN_BASE, HDPU_TBEN_SIZE, 0);
125 bh.ci->enable_window_32bit(&bh, MV64x60_CPU2DEV_0_WIN);
126
127 mv64x60_set_32bit_window(&bh, MV64x60_CPU2DEV_1_WIN,
128 HDPU_NEXUS_ID_BASE, HDPU_NEXUS_ID_SIZE, 0);
129 bh.ci->enable_window_32bit(&bh, MV64x60_CPU2DEV_1_WIN);
130
131 mv64x60_set_32bit_window(&bh, MV64x60_CPU2SRAM_WIN,
132 HDPU_INTERNAL_SRAM_BASE,
133 HDPU_INTERNAL_SRAM_SIZE, 0);
134 bh.ci->enable_window_32bit(&bh, MV64x60_CPU2SRAM_WIN);
135
136 bh.ci->disable_window_32bit(&bh, MV64x60_ENET2MEM_4_WIN);
137 mv64x60_set_32bit_window(&bh, MV64x60_ENET2MEM_4_WIN, 0, 0, 0);
138
139 mv64x60_clr_bits(&bh, MV64x60_PCI0_PCI_DECODE_CNTL, (1 << 3));
140 mv64x60_clr_bits(&bh, MV64x60_PCI1_PCI_DECODE_CNTL, (1 << 3));
141 mv64x60_clr_bits(&bh, MV64x60_TIMR_CNTR_0_3_CNTL,
142 ((1 << 0) | (1 << 8) | (1 << 16) | (1 << 24)));
143
144 /* Enable pipelining */
145 mv64x60_set_bits(&bh, MV64x60_CPU_CONFIG, (1 << 13));
146 /* Enable Snoop Pipelining */
147 mv64x60_set_bits(&bh, MV64360_D_UNIT_CONTROL_HIGH, (1 << 24));
148
149 /*
150 * Change DRAM read buffer assignment.
151 * Assign read buffer 0 dedicated only for CPU,
152 * and the rest read buffer 1.
153 */
154 val = mv64x60_read(&bh, MV64360_SDRAM_CONFIG);
155 val = val & 0x03ffffff;
156 val = val | 0xf8000000;
157 mv64x60_write(&bh, MV64360_SDRAM_CONFIG, val);
158
159 /*
160 * Configure internal SRAM -
161 * Cache coherent write back, if CONFIG_MV64360_SRAM_CACHE_COHERENT set
162 * Parity enabled.
163 * Parity error propagation
164 * Arbitration not parked for CPU only
165 * Other bits are reserved.
166 */
167#ifdef CONFIG_MV64360_SRAM_CACHE_COHERENT
168 mv64x60_write(&bh, MV64360_SRAM_CONFIG, 0x001600b2);
169#else
170 mv64x60_write(&bh, MV64360_SRAM_CONFIG, 0x001600b0);
171#endif
172
173 hdpu_intr_setup();
174}
175
176static void __init hdpu_setup_bridge(void)
177{
178 struct mv64x60_setup_info si;
179 int i;
180
181 memset(&si, 0, sizeof(si));
182
183 si.phys_reg_base = HDPU_BRIDGE_REG_BASE;
184 si.pci_0.enable_bus = 1;
185 si.pci_0.pci_io.cpu_base = HDPU_PCI0_IO_START_PROC_ADDR;
186 si.pci_0.pci_io.pci_base_hi = 0;
187 si.pci_0.pci_io.pci_base_lo = HDPU_PCI0_IO_START_PCI_ADDR;
188 si.pci_0.pci_io.size = HDPU_PCI0_IO_SIZE;
189 si.pci_0.pci_io.swap = MV64x60_CPU2PCI_SWAP_NONE;
190 si.pci_0.pci_mem[0].cpu_base = HDPU_PCI0_MEM_START_PROC_ADDR;
191 si.pci_0.pci_mem[0].pci_base_hi = HDPU_PCI0_MEM_START_PCI_HI_ADDR;
192 si.pci_0.pci_mem[0].pci_base_lo = HDPU_PCI0_MEM_START_PCI_LO_ADDR;
193 si.pci_0.pci_mem[0].size = HDPU_PCI0_MEM_SIZE;
194 si.pci_0.pci_mem[0].swap = MV64x60_CPU2PCI_SWAP_NONE;
195 si.pci_0.pci_cmd_bits = 0;
196 si.pci_0.latency_timer = 0x80;
197
198 si.pci_1.enable_bus = 1;
199 si.pci_1.pci_io.cpu_base = HDPU_PCI1_IO_START_PROC_ADDR;
200 si.pci_1.pci_io.pci_base_hi = 0;
201 si.pci_1.pci_io.pci_base_lo = HDPU_PCI1_IO_START_PCI_ADDR;
202 si.pci_1.pci_io.size = HDPU_PCI1_IO_SIZE;
203 si.pci_1.pci_io.swap = MV64x60_CPU2PCI_SWAP_NONE;
204 si.pci_1.pci_mem[0].cpu_base = HDPU_PCI1_MEM_START_PROC_ADDR;
205 si.pci_1.pci_mem[0].pci_base_hi = HDPU_PCI1_MEM_START_PCI_HI_ADDR;
206 si.pci_1.pci_mem[0].pci_base_lo = HDPU_PCI1_MEM_START_PCI_LO_ADDR;
207 si.pci_1.pci_mem[0].size = HDPU_PCI1_MEM_SIZE;
208 si.pci_1.pci_mem[0].swap = MV64x60_CPU2PCI_SWAP_NONE;
209 si.pci_1.pci_cmd_bits = 0;
210 si.pci_1.latency_timer = 0x80;
211
212 for (i = 0; i < MV64x60_CPU2MEM_WINDOWS; i++) {
213#if defined(CONFIG_NOT_COHERENT_CACHE)
214 si.cpu_prot_options[i] = 0;
215 si.enet_options[i] = MV64360_ENET2MEM_SNOOP_NONE;
216 si.mpsc_options[i] = MV64360_MPSC2MEM_SNOOP_NONE;
217 si.idma_options[i] = MV64360_IDMA2MEM_SNOOP_NONE;
218
219 si.pci_1.acc_cntl_options[i] =
220 MV64360_PCI_ACC_CNTL_SNOOP_NONE |
221 MV64360_PCI_ACC_CNTL_SWAP_NONE |
222 MV64360_PCI_ACC_CNTL_MBURST_128_BYTES |
223 MV64360_PCI_ACC_CNTL_RDSIZE_256_BYTES;
224
225 si.pci_0.acc_cntl_options[i] =
226 MV64360_PCI_ACC_CNTL_SNOOP_NONE |
227 MV64360_PCI_ACC_CNTL_SWAP_NONE |
228 MV64360_PCI_ACC_CNTL_MBURST_128_BYTES |
229 MV64360_PCI_ACC_CNTL_RDSIZE_256_BYTES;
230
231#else
232 si.cpu_prot_options[i] = 0;
233 si.enet_options[i] = MV64360_ENET2MEM_SNOOP_WB; /* errata */
234 si.mpsc_options[i] = MV64360_MPSC2MEM_SNOOP_WB; /* errata */
235 si.idma_options[i] = MV64360_IDMA2MEM_SNOOP_WB; /* errata */
236
237 si.pci_0.acc_cntl_options[i] =
238 MV64360_PCI_ACC_CNTL_SNOOP_WB |
239 MV64360_PCI_ACC_CNTL_SWAP_NONE |
240 MV64360_PCI_ACC_CNTL_MBURST_32_BYTES |
241 MV64360_PCI_ACC_CNTL_RDSIZE_256_BYTES;
242
243 si.pci_1.acc_cntl_options[i] =
244 MV64360_PCI_ACC_CNTL_SNOOP_WB |
245 MV64360_PCI_ACC_CNTL_SWAP_NONE |
246 MV64360_PCI_ACC_CNTL_MBURST_32_BYTES |
247 MV64360_PCI_ACC_CNTL_RDSIZE_256_BYTES;
248#endif
249 }
250
251 hdpu_cpustate_set(CPUSTATE_KERNEL_MAJOR | CPUSTATE_KERNEL_INIT_PCI);
252
253 /* Lookup PCI host bridges */
254 mv64x60_init(&bh, &si);
255 pci_dram_offset = 0; /* System mem at same addr on PCI & cpu bus */
256 ppc_md.pci_swizzle = common_swizzle;
257 ppc_md.pci_map_irq = hdpu_map_irq;
258
259 mv64x60_set_bus(&bh, 0, 0);
260 bh.hose_a->first_busno = 0;
261 bh.hose_a->last_busno = 0xff;
262 bh.hose_a->last_busno = pciauto_bus_scan(bh.hose_a, 0);
263
264 bh.hose_b->first_busno = bh.hose_a->last_busno + 1;
265 mv64x60_set_bus(&bh, 1, bh.hose_b->first_busno);
266 bh.hose_b->last_busno = 0xff;
267 bh.hose_b->last_busno = pciauto_bus_scan(bh.hose_b,
268 bh.hose_b->first_busno);
269
270 ppc_md.pci_exclude_device = mv64x60_pci_exclude_device;
271
272 hdpu_cpustate_set(CPUSTATE_KERNEL_MAJOR | CPUSTATE_KERNEL_INIT_REG);
273 /*
274 * Enabling of PCI internal-vs-external arbitration
275 * is a platform- and errata-dependent decision.
276 */
277 return;
278}
279
280#if defined(CONFIG_SERIAL_MPSC_CONSOLE)
281static void __init hdpu_early_serial_map(void)
282{
283#ifdef CONFIG_KGDB
284 static char first_time = 1;
285
286#if defined(CONFIG_KGDB_TTYS0)
287#define KGDB_PORT 0
288#elif defined(CONFIG_KGDB_TTYS1)
289#define KGDB_PORT 1
290#else
291#error "Invalid kgdb_tty port"
292#endif
293
294 if (first_time) {
295 gt_early_mpsc_init(KGDB_PORT,
296 B9600 | CS8 | CREAD | HUPCL | CLOCAL);
297 first_time = 0;
298 }
299
300 return;
301#endif
302}
303#endif
304
305static void hdpu_init2(void)
306{
307 return;
308}
309
310#if defined(CONFIG_MV643XX_ETH)
311static void __init hdpu_fixup_eth_pdata(struct platform_device *pd)
312{
313
314 struct mv643xx_eth_platform_data *eth_pd;
315 eth_pd = pd->dev.platform_data;
316
317 eth_pd->force_phy_addr = 1;
318 eth_pd->phy_addr = pd->id;
319 eth_pd->speed = SPEED_100;
320 eth_pd->duplex = DUPLEX_FULL;
321 eth_pd->tx_queue_size = 400;
322 eth_pd->rx_queue_size = 800;
323}
324#endif
325
326static void __init hdpu_fixup_mpsc_pdata(struct platform_device *pd)
327{
328
329 struct mpsc_pdata *pdata;
330
331 pdata = (struct mpsc_pdata *)pd->dev.platform_data;
332
333 pdata->max_idle = 40;
334 if (ppcboot_bd_valid)
335 pdata->default_baud = ppcboot_bd.bi_baudrate;
336 else
337 pdata->default_baud = HDPU_DEFAULT_BAUD;
338 pdata->brg_clk_src = HDPU_MPSC_CLK_SRC;
339 pdata->brg_clk_freq = HDPU_MPSC_CLK_FREQ;
340}
341
342#if defined(CONFIG_HDPU_FEATURES)
343static void __init hdpu_fixup_cpustate_pdata(struct platform_device *pd)
344{
345 struct platform_device *pds[1];
346 pds[0] = pd;
347 mv64x60_pd_fixup(&bh, pds, 1);
348}
349#endif
350
351static int hdpu_platform_notify(struct device *dev)
352{
353 static struct {
354 char *bus_id;
355 void ((*rtn) (struct platform_device * pdev));
356 } dev_map[] = {
357 {
358 MPSC_CTLR_NAME ".0", hdpu_fixup_mpsc_pdata},
359#if defined(CONFIG_MV643XX_ETH)
360 {
361 MV643XX_ETH_NAME ".0", hdpu_fixup_eth_pdata},
362#endif
363#if defined(CONFIG_HDPU_FEATURES)
364 {
365 HDPU_CPUSTATE_NAME ".0", hdpu_fixup_cpustate_pdata},
366#endif
367 };
368 struct platform_device *pdev;
369 int i;
370
371 if (dev && dev->bus_id)
372 for (i = 0; i < ARRAY_SIZE(dev_map); i++)
373 if (!strncmp(dev->bus_id, dev_map[i].bus_id,
374 BUS_ID_SIZE)) {
375
376 pdev = container_of(dev,
377 struct platform_device,
378 dev);
379 dev_map[i].rtn(pdev);
380 }
381
382 return 0;
383}
384
385static void __init hdpu_setup_arch(void)
386{
387 if (ppc_md.progress)
388 ppc_md.progress("hdpu_setup_arch: enter", 0);
389#ifdef CONFIG_BLK_DEV_INITRD
390 if (initrd_start)
391 ROOT_DEV = Root_RAM0;
392 else
393#endif
394#ifdef CONFIG_ROOT_NFS
395 ROOT_DEV = Root_NFS;
396#else
397 ROOT_DEV = Root_SDA2;
398#endif
399
400 ppc_md.heartbeat = hdpu_heartbeat;
401
402 ppc_md.heartbeat_reset = HZ;
403 ppc_md.heartbeat_count = 1;
404
405 if (ppc_md.progress)
406 ppc_md.progress("hdpu_setup_arch: Enabling L2 cache", 0);
407
408 /* Enable L1 Parity Bits */
409 hdpu_set_l1pe();
410
411 /* Enable L2 and L3 caches (if 745x) */
412 _set_L2CR(0x80080000);
413
414 if (ppc_md.progress)
415 ppc_md.progress("hdpu_setup_arch: enter", 0);
416
417 hdpu_setup_bridge();
418
419 hdpu_setup_peripherals();
420
421#ifdef CONFIG_SERIAL_MPSC_CONSOLE
422 hdpu_early_serial_map();
423#endif
424
425 printk("SKY HDPU Compute Blade \n");
426
427 if (ppc_md.progress)
428 ppc_md.progress("hdpu_setup_arch: exit", 0);
429
430 hdpu_cpustate_set(CPUSTATE_KERNEL_MAJOR | CPUSTATE_KERNEL_OK);
431 return;
432}
433static void __init hdpu_init_irq(void)
434{
435 mv64360_init_irq();
436}
437
438static void __init hdpu_set_l1pe()
439{
440 unsigned long ictrl;
441 asm volatile ("mfspr %0, 1011":"=r" (ictrl):);
442 ictrl |= ICTRL_EICE | ICTRL_EDC | ICTRL_EICP;
443 asm volatile ("mtspr 1011, %0"::"r" (ictrl));
444}
445
446/*
447 * Set BAT 1 to map 0xf1000000 to end of physical memory space.
448 */
449static __inline__ void hdpu_set_bat(void)
450{
451 mb();
452 mtspr(SPRN_DBAT1U, 0xf10001fe);
453 mtspr(SPRN_DBAT1L, 0xf100002a);
454 mb();
455
456 return;
457}
458
459unsigned long __init hdpu_find_end_of_memory(void)
460{
461 return mv64x60_get_mem_size(CONFIG_MV64X60_NEW_BASE,
462 MV64x60_TYPE_MV64360);
463}
464
465static void hdpu_reset_board(void)
466{
467 volatile int infinite = 1;
468
469 hdpu_cpustate_set(CPUSTATE_KERNEL_MAJOR | CPUSTATE_KERNEL_RESET);
470
471 local_irq_disable();
472
473 /* Clear all the LEDs */
474 mv64x60_write(&bh, MV64x60_GPP_VALUE_CLR, ((1 << 4) |
475 (1 << 5) | (1 << 6)));
476
477 /* disable and invalidate the L2 cache */
478 _set_L2CR(0);
479 _set_L2CR(0x200000);
480
481 /* flush and disable L1 I/D cache */
482 __asm__ __volatile__
483 ("\n"
484 "mfspr 3,1008\n"
485 "ori 5,5,0xcc00\n"
486 "ori 4,3,0xc00\n"
487 "andc 5,3,5\n"
488 "sync\n"
489 "mtspr 1008,4\n"
490 "isync\n" "sync\n" "mtspr 1008,5\n" "isync\n" "sync\n");
491
492 /* Hit the reset bit */
493 mv64x60_write(&bh, MV64x60_GPP_VALUE_CLR, (1 << 3));
494
495 while (infinite)
496 infinite = infinite;
497
498 return;
499}
500
501static void hdpu_restart(char *cmd)
502{
503 volatile ulong i = 10000000;
504
505 hdpu_reset_board();
506
507 while (i-- > 0) ;
508 panic("restart failed\n");
509}
510
511static void hdpu_halt(void)
512{
513 local_irq_disable();
514
515 hdpu_cpustate_set(CPUSTATE_KERNEL_MAJOR | CPUSTATE_KERNEL_HALT);
516
517 /* Clear all the LEDs */
518 mv64x60_write(&bh, MV64x60_GPP_VALUE_CLR, ((1 << 4) | (1 << 5) |
519 (1 << 6)));
520 while (1) ;
521 /* NOTREACHED */
522}
523
524static void hdpu_power_off(void)
525{
526 hdpu_halt();
527 /* NOTREACHED */
528}
529
530static int hdpu_show_cpuinfo(struct seq_file *m)
531{
532 uint pvid;
533
534 pvid = mfspr(SPRN_PVR);
535 seq_printf(m, "vendor\t\t: Sky Computers\n");
536 seq_printf(m, "machine\t\t: HDPU Compute Blade\n");
537 seq_printf(m, "PVID\t\t: 0x%x, vendor: %s\n",
538 pvid, (pvid & (1 << 15) ? "IBM" : "Motorola"));
539
540 return 0;
541}
542
543static void __init hdpu_calibrate_decr(void)
544{
545 ulong freq;
546
547 if (ppcboot_bd_valid)
548 freq = ppcboot_bd.bi_busfreq / 4;
549 else
550 freq = 133000000;
551
552 printk("time_init: decrementer frequency = %lu.%.6lu MHz\n",
553 freq / 1000000, freq % 1000000);
554
555 tb_ticks_per_jiffy = freq / HZ;
556 tb_to_us = mulhwu_scale_factor(freq, 1000000);
557
558 return;
559}
560
561static void parse_bootinfo(unsigned long r3,
562 unsigned long r4, unsigned long r5,
563 unsigned long r6, unsigned long r7)
564{
565 bd_t *bd = NULL;
566 char *cmdline_start = NULL;
567 int cmdline_len = 0;
568
569 if (r3) {
570 if ((r3 & 0xf0000000) == 0)
571 r3 += KERNELBASE;
572 if ((r3 & 0xf0000000) == KERNELBASE) {
573 bd = (void *)r3;
574
575 memcpy(&ppcboot_bd, bd, sizeof(ppcboot_bd));
576 ppcboot_bd_valid = 1;
577 }
578 }
579#ifdef CONFIG_BLK_DEV_INITRD
580 if (r4 && r5 && r5 > r4) {
581 if ((r4 & 0xf0000000) == 0)
582 r4 += KERNELBASE;
583 if ((r5 & 0xf0000000) == 0)
584 r5 += KERNELBASE;
585 if ((r4 & 0xf0000000) == KERNELBASE) {
586 initrd_start = r4;
587 initrd_end = r5;
588 initrd_below_start_ok = 1;
589 }
590 }
591#endif /* CONFIG_BLK_DEV_INITRD */
592
593 if (r6 && r7 && r7 > r6) {
594 if ((r6 & 0xf0000000) == 0)
595 r6 += KERNELBASE;
596 if ((r7 & 0xf0000000) == 0)
597 r7 += KERNELBASE;
598 if ((r6 & 0xf0000000) == KERNELBASE) {
599 cmdline_start = (void *)r6;
600 cmdline_len = (r7 - r6);
601 strncpy(cmd_line, cmdline_start, cmdline_len);
602 }
603 }
604}
605
606void hdpu_heartbeat(void)
607{
608 if (mv64x60_read(&bh, MV64x60_GPP_VALUE) & (1 << 5))
609 mv64x60_write(&bh, MV64x60_GPP_VALUE_CLR, (1 << 5));
610 else
611 mv64x60_write(&bh, MV64x60_GPP_VALUE_SET, (1 << 5));
612
613 ppc_md.heartbeat_count = ppc_md.heartbeat_reset;
614
615}
616
617static void __init hdpu_map_io(void)
618{
619 io_block_mapping(0xf1000000, 0xf1000000, 0x20000, _PAGE_IO);
620}
621
622#ifdef CONFIG_SMP
623char hdpu_smp0[] = "SMP Cpu #0";
624char hdpu_smp1[] = "SMP Cpu #1";
625
626static irqreturn_t hdpu_smp_cpu0_int_handler(int irq, void *dev_id)
627{
628 volatile unsigned int doorbell;
629
630 doorbell = mv64x60_read(&bh, MV64360_CPU0_DOORBELL);
631
632 /* Ack the doorbell interrupts */
633 mv64x60_write(&bh, MV64360_CPU0_DOORBELL_CLR, doorbell);
634
635 if (doorbell & 1) {
636 smp_message_recv(0);
637 }
638 if (doorbell & 2) {
639 smp_message_recv(1);
640 }
641 if (doorbell & 4) {
642 smp_message_recv(2);
643 }
644 if (doorbell & 8) {
645 smp_message_recv(3);
646 }
647 return IRQ_HANDLED;
648}
649
650static irqreturn_t hdpu_smp_cpu1_int_handler(int irq, void *dev_id)
651{
652 volatile unsigned int doorbell;
653
654 doorbell = mv64x60_read(&bh, MV64360_CPU1_DOORBELL);
655
656 /* Ack the doorbell interrupts */
657 mv64x60_write(&bh, MV64360_CPU1_DOORBELL_CLR, doorbell);
658
659 if (doorbell & 1) {
660 smp_message_recv(0);
661 }
662 if (doorbell & 2) {
663 smp_message_recv(1);
664 }
665 if (doorbell & 4) {
666 smp_message_recv(2);
667 }
668 if (doorbell & 8) {
669 smp_message_recv(3);
670 }
671 return IRQ_HANDLED;
672}
673
674static void smp_hdpu_CPU_two(void)
675{
676 __asm__ __volatile__
677 ("\n"
678 "lis 3,0x0000\n"
679 "ori 3,3,0x00c0\n"
680 "mtspr 26, 3\n" "li 4,0\n" "mtspr 27,4\n" "rfi");
681
682}
683
684static int smp_hdpu_probe(void)
685{
686 int *cpu_count_reg;
687 int num_cpus = 0;
688
689 cpu_count_reg = ioremap(HDPU_NEXUS_ID_BASE, HDPU_NEXUS_ID_SIZE);
690 if (cpu_count_reg) {
691 num_cpus = (*cpu_count_reg >> 20) & 0x3;
692 iounmap(cpu_count_reg);
693 }
694
695 /* Validate the bits in the CPLD. If we could not map the reg, return 2.
696 * If the register reported 0 or 3, return 2.
697 * Older CPLD revisions set these bits to all ones (val = 3).
698 */
699 if ((num_cpus < 1) || (num_cpus > 2)) {
700 printk
701 ("Unable to determine the number of processors %d . deafulting to 2.\n",
702 num_cpus);
703 num_cpus = 2;
704 }
705 return num_cpus;
706}
707
708static void
709smp_hdpu_message_pass(int target, int msg)
710{
711 if (msg > 0x3) {
712 printk("SMP %d: smp_message_pass: unknown msg %d\n",
713 smp_processor_id(), msg);
714 return;
715 }
716 switch (target) {
717 case MSG_ALL:
718 mv64x60_write(&bh, MV64360_CPU0_DOORBELL, 1 << msg);
719 mv64x60_write(&bh, MV64360_CPU1_DOORBELL, 1 << msg);
720 break;
721 case MSG_ALL_BUT_SELF:
722 if (smp_processor_id())
723 mv64x60_write(&bh, MV64360_CPU0_DOORBELL, 1 << msg);
724 else
725 mv64x60_write(&bh, MV64360_CPU1_DOORBELL, 1 << msg);
726 break;
727 default:
728 if (target == 0)
729 mv64x60_write(&bh, MV64360_CPU0_DOORBELL, 1 << msg);
730 else
731 mv64x60_write(&bh, MV64360_CPU1_DOORBELL, 1 << msg);
732 break;
733 }
734}
735
736static void smp_hdpu_kick_cpu(int nr)
737{
738 volatile unsigned int *bootaddr;
739
740 if (ppc_md.progress)
741 ppc_md.progress("smp_hdpu_kick_cpu", 0);
742
743 hdpu_cpustate_set(CPUSTATE_KERNEL_MAJOR | CPUSTATE_KERNEL_CPU1_KICK);
744
745 /* Disable BootCS. Must also reduce the windows size to zero. */
746 bh.ci->disable_window_32bit(&bh, MV64x60_CPU2BOOT_WIN);
747 mv64x60_set_32bit_window(&bh, MV64x60_CPU2BOOT_WIN, 0, 0, 0);
748
749 bootaddr = ioremap(HDPU_INTERNAL_SRAM_BASE, HDPU_INTERNAL_SRAM_SIZE);
750 if (!bootaddr) {
751 if (ppc_md.progress)
752 ppc_md.progress("smp_hdpu_kick_cpu: ioremap failed", 0);
753 return;
754 }
755
756 memcpy((void *)(bootaddr + 0x40), (void *)&smp_hdpu_CPU_two, 0x20);
757
758 /* map SRAM to 0xfff00000 */
759 bh.ci->disable_window_32bit(&bh, MV64x60_CPU2SRAM_WIN);
760
761 mv64x60_set_32bit_window(&bh, MV64x60_CPU2SRAM_WIN,
762 0xfff00000, HDPU_INTERNAL_SRAM_SIZE, 0);
763 bh.ci->enable_window_32bit(&bh, MV64x60_CPU2SRAM_WIN);
764
765 /* Enable CPU1 arbitration */
766 mv64x60_clr_bits(&bh, MV64x60_CPU_MASTER_CNTL, (1 << 9));
767
768 /*
769 * Wait 100mSecond until other CPU has reached __secondary_start.
770 * When it reaches, it is permittable to rever the SRAM mapping etc...
771 */
772 mdelay(100);
773 *(unsigned long *)KERNELBASE = nr;
774 asm volatile ("dcbf 0,%0"::"r" (KERNELBASE):"memory");
775
776 iounmap(bootaddr);
777
778 /* Set up window for internal sram (256KByte insize) */
779 bh.ci->disable_window_32bit(&bh, MV64x60_CPU2SRAM_WIN);
780 mv64x60_set_32bit_window(&bh, MV64x60_CPU2SRAM_WIN,
781 HDPU_INTERNAL_SRAM_BASE,
782 HDPU_INTERNAL_SRAM_SIZE, 0);
783 bh.ci->enable_window_32bit(&bh, MV64x60_CPU2SRAM_WIN);
784 /*
785 * Set up windows for embedded FLASH (using boot CS window).
786 */
787
788 bh.ci->disable_window_32bit(&bh, MV64x60_CPU2BOOT_WIN);
789 mv64x60_set_32bit_window(&bh, MV64x60_CPU2BOOT_WIN,
790 HDPU_EMB_FLASH_BASE, HDPU_EMB_FLASH_SIZE, 0);
791 bh.ci->enable_window_32bit(&bh, MV64x60_CPU2BOOT_WIN);
792}
793
794static void smp_hdpu_setup_cpu(int cpu_nr)
795{
796 if (cpu_nr == 0) {
797 if (ppc_md.progress)
798 ppc_md.progress("smp_hdpu_setup_cpu 0", 0);
799 mv64x60_write(&bh, MV64360_CPU0_DOORBELL_CLR, 0xff);
800 mv64x60_write(&bh, MV64360_CPU0_DOORBELL_MASK, 0xff);
801 request_irq(60, hdpu_smp_cpu0_int_handler,
802 IRQF_DISABLED, hdpu_smp0, 0);
803 }
804
805 if (cpu_nr == 1) {
806 if (ppc_md.progress)
807 ppc_md.progress("smp_hdpu_setup_cpu 1", 0);
808
809 hdpu_cpustate_set(CPUSTATE_KERNEL_MAJOR |
810 CPUSTATE_KERNEL_CPU1_OK);
811
812 /* Enable L1 Parity Bits */
813 hdpu_set_l1pe();
814
815 /* Enable L2 cache */
816 _set_L2CR(0);
817 _set_L2CR(0x80080000);
818
819 mv64x60_write(&bh, MV64360_CPU1_DOORBELL_CLR, 0x0);
820 mv64x60_write(&bh, MV64360_CPU1_DOORBELL_MASK, 0xff);
821 request_irq(28, hdpu_smp_cpu1_int_handler,
822 IRQF_DISABLED, hdpu_smp1, 0);
823 }
824
825}
826
827void __devinit hdpu_tben_give()
828{
829 volatile unsigned long *val = 0;
830
831 /* By writing 0 to the TBEN_BASE, the timebases is frozen */
832 val = ioremap(HDPU_TBEN_BASE, 4);
833 *val = 0;
834 mb();
835
836 spin_lock(&timebase_lock);
837 timebase_upper = get_tbu();
838 timebase_lower = get_tbl();
839 spin_unlock(&timebase_lock);
840
841 while (timebase_upper || timebase_lower)
842 barrier();
843
844 /* By writing 1 to the TBEN_BASE, the timebases is thawed */
845 *val = 1;
846 mb();
847
848 iounmap(val);
849
850}
851
852void __devinit hdpu_tben_take()
853{
854 while (!(timebase_upper || timebase_lower))
855 barrier();
856
857 spin_lock(&timebase_lock);
858 set_tb(timebase_upper, timebase_lower);
859 timebase_upper = 0;
860 timebase_lower = 0;
861 spin_unlock(&timebase_lock);
862}
863
864static struct smp_ops_t hdpu_smp_ops = {
865 .message_pass = smp_hdpu_message_pass,
866 .probe = smp_hdpu_probe,
867 .kick_cpu = smp_hdpu_kick_cpu,
868 .setup_cpu = smp_hdpu_setup_cpu,
869 .give_timebase = hdpu_tben_give,
870 .take_timebase = hdpu_tben_take,
871};
872#endif /* CONFIG_SMP */
873
874void __init
875platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
876 unsigned long r6, unsigned long r7)
877{
878 parse_bootinfo(r3, r4, r5, r6, r7);
879
880 isa_mem_base = 0;
881
882 ppc_md.setup_arch = hdpu_setup_arch;
883 ppc_md.init = hdpu_init2;
884 ppc_md.show_cpuinfo = hdpu_show_cpuinfo;
885 ppc_md.init_IRQ = hdpu_init_irq;
886 ppc_md.get_irq = mv64360_get_irq;
887 ppc_md.restart = hdpu_restart;
888 ppc_md.power_off = hdpu_power_off;
889 ppc_md.halt = hdpu_halt;
890 ppc_md.find_end_of_memory = hdpu_find_end_of_memory;
891 ppc_md.calibrate_decr = hdpu_calibrate_decr;
892 ppc_md.setup_io_mappings = hdpu_map_io;
893
894 bh.p_base = CONFIG_MV64X60_NEW_BASE;
895 bh.v_base = (unsigned long *)bh.p_base;
896
897 hdpu_set_bat();
898
899#if defined(CONFIG_SERIAL_TEXT_DEBUG)
900 ppc_md.progress = hdpu_mpsc_progress; /* embedded UART */
901 mv64x60_progress_init(bh.p_base);
902#endif /* CONFIG_SERIAL_TEXT_DEBUG */
903
904#ifdef CONFIG_SMP
905 smp_ops = &hdpu_smp_ops;
906#endif /* CONFIG_SMP */
907
908#if defined(CONFIG_SERIAL_MPSC) || defined(CONFIG_MV643XX_ETH)
909 platform_notify = hdpu_platform_notify;
910#endif
911 return;
912}
913
914#if defined(CONFIG_SERIAL_TEXT_DEBUG) && defined(CONFIG_SERIAL_MPSC_CONSOLE)
915/* SMP safe version of the serial text debug routine. Uses Semaphore 0 */
916void hdpu_mpsc_progress(char *s, unsigned short hex)
917{
918 while (mv64x60_read(&bh, MV64360_WHO_AM_I) !=
919 mv64x60_read(&bh, MV64360_SEMAPHORE_0)) {
920 }
921 mv64x60_mpsc_progress(s, hex);
922 mv64x60_write(&bh, MV64360_SEMAPHORE_0, 0xff);
923}
924#endif
925
926static void hdpu_cpustate_set(unsigned char new_state)
927{
928 unsigned int state = (new_state << 21);
929 mv64x60_write(&bh, MV64x60_GPP_VALUE_CLR, (0xff << 21));
930 mv64x60_write(&bh, MV64x60_GPP_VALUE_CLR, state);
931}
932
933#ifdef CONFIG_MTD_PHYSMAP
934static struct mtd_partition hdpu_partitions[] = {
935 {
936 .name = "Root FS",
937 .size = 0x03400000,
938 .offset = 0,
939 .mask_flags = 0,
940 },{
941 .name = "User FS",
942 .size = 0x00800000,
943 .offset = 0x03400000,
944 .mask_flags = 0,
945 },{
946 .name = "Kernel Image",
947 .size = 0x002C0000,
948 .offset = 0x03C00000,
949 .mask_flags = 0,
950 },{
951 .name = "bootEnv",
952 .size = 0x00040000,
953 .offset = 0x03EC0000,
954 .mask_flags = 0,
955 },{
956 .name = "bootROM",
957 .size = 0x00100000,
958 .offset = 0x03F00000,
959 .mask_flags = 0,
960 }
961};
962
963static int __init hdpu_setup_mtd(void)
964{
965
966 physmap_set_partitions(hdpu_partitions, 5);
967 return 0;
968}
969
970arch_initcall(hdpu_setup_mtd);
971#endif
972
973#ifdef CONFIG_HDPU_FEATURES
974
975static struct resource hdpu_cpustate_resources[] = {
976 [0] = {
977 .name = "addr base",
978 .start = MV64x60_GPP_VALUE_SET,
979 .end = MV64x60_GPP_VALUE_CLR + 1,
980 .flags = IORESOURCE_MEM,
981 },
982};
983
984static struct resource hdpu_nexus_resources[] = {
985 [0] = {
986 .name = "nexus register",
987 .start = HDPU_NEXUS_ID_BASE,
988 .end = HDPU_NEXUS_ID_BASE + HDPU_NEXUS_ID_SIZE,
989 .flags = IORESOURCE_MEM,
990 },
991};
992
993static struct platform_device hdpu_cpustate_device = {
994 .name = HDPU_CPUSTATE_NAME,
995 .id = 0,
996 .num_resources = ARRAY_SIZE(hdpu_cpustate_resources),
997 .resource = hdpu_cpustate_resources,
998};
999
1000static struct platform_device hdpu_nexus_device = {
1001 .name = HDPU_NEXUS_NAME,
1002 .id = 0,
1003 .num_resources = ARRAY_SIZE(hdpu_nexus_resources),
1004 .resource = hdpu_nexus_resources,
1005};
1006
1007static int __init hdpu_add_pds(void)
1008{
1009 platform_device_register(&hdpu_cpustate_device);
1010 platform_device_register(&hdpu_nexus_device);
1011 return 0;
1012}
1013
1014arch_initcall(hdpu_add_pds);
1015#endif
diff --git a/arch/ppc/platforms/hdpu.h b/arch/ppc/platforms/hdpu.h
deleted file mode 100644
index f9e020b6970c..000000000000
--- a/arch/ppc/platforms/hdpu.h
+++ /dev/null
@@ -1,80 +0,0 @@
1/*
2 * Definitions for Sky Computers HDPU board.
3 *
4 * Brian Waite <waite@skycomputers.com>
5 *
6 * Based on code done by Rabeeh Khoury - rabeeh@galileo.co.il
7 * Based on code done by Mark A. Greer <mgreer@mvista.com>
8 * Based on code done by Tim Montgomery <timm@artesyncp.com>
9 *
10 *
11 * This program is free software; you can redistribute it and/or modify it
12 * under the terms of the GNU General Public License as published by the
13 * Free Software Foundation; either version 2 of the License, or (at your
14 * option) any later version.
15 */
16
17/*
18 * The MV64360 has 2 PCI buses each with 1 window from the CPU bus to
19 * PCI I/O space and 4 windows from the CPU bus to PCI MEM space.
20 * We'll only use one PCI MEM window on each PCI bus.
21 *
22 * This is the CPU physical memory map (windows must be at least 64K and start
23 * on a boundary that is a multiple of the window size):
24 *
25 * 0x80000000-0x8fffffff - PCI 0 MEM
26 * 0xa0000000-0xafffffff - PCI 1 MEM
27 * 0xc0000000-0xc0ffffff - PCI 0 I/O
28 * 0xc1000000-0xc1ffffff - PCI 1 I/O
29
30 * 0xf1000000-0xf100ffff - MV64360 Registers
31 * 0xf1010000-0xfb9fffff - HOLE
32 * 0xfbfa0000-0xfbfaffff - TBEN
33 * 0xfbf00000-0xfbfbffff - NEXUS
34 * 0xfbfc0000-0xfbffffff - Internal SRAM
35 * 0xfc000000-0xffffffff - Boot window
36 */
37
38#ifndef __PPC_PLATFORMS_HDPU_H
39#define __PPC_PLATFORMS_HDPU_H
40
41/* CPU Physical Memory Map setup. */
42#define HDPU_BRIDGE_REG_BASE 0xf1000000
43
44#define HDPU_TBEN_BASE 0xfbfa0000
45#define HDPU_TBEN_SIZE 0x00010000
46#define HDPU_NEXUS_ID_BASE 0xfbfb0000
47#define HDPU_NEXUS_ID_SIZE 0x00010000
48#define HDPU_INTERNAL_SRAM_BASE 0xfbfc0000
49#define HDPU_INTERNAL_SRAM_SIZE 0x00040000
50#define HDPU_EMB_FLASH_BASE 0xfc000000
51#define HDPU_EMB_FLASH_SIZE 0x04000000
52
53/* PCI Mappings */
54
55#define HDPU_PCI0_MEM_START_PROC_ADDR 0x80000000
56#define HDPU_PCI0_MEM_START_PCI_HI_ADDR 0x00000000
57#define HDPU_PCI0_MEM_START_PCI_LO_ADDR HDPU_PCI0_MEM_START_PROC_ADDR
58#define HDPU_PCI0_MEM_SIZE 0x10000000
59
60#define HDPU_PCI1_MEM_START_PROC_ADDR 0xc0000000
61#define HDPU_PCI1_MEM_START_PCI_HI_ADDR 0x00000000
62#define HDPU_PCI1_MEM_START_PCI_LO_ADDR HDPU_PCI1_MEM_START_PROC_ADDR
63#define HDPU_PCI1_MEM_SIZE 0x20000000
64
65#define HDPU_PCI0_IO_START_PROC_ADDR 0xc0000000
66#define HDPU_PCI0_IO_START_PCI_ADDR 0x00000000
67#define HDPU_PCI0_IO_SIZE 0x01000000
68
69#define HDPU_PCI1_IO_START_PROC_ADDR 0xc1000000
70#define HDPU_PCI1_IO_START_PCI_ADDR 0x01000000
71#define HDPU_PCI1_IO_SIZE 0x01000000
72
73#define HDPU_DEFAULT_BAUD 115200
74#define HDPU_MPSC_CLK_SRC 8 /* TCLK */
75#define HDPU_MPSC_CLK_FREQ 133000000 /* 133 Mhz */
76
77#define HDPU_PCI_0_IRQ (8+64)
78#define HDPU_PCI_1_IRQ (13+64)
79
80#endif /* __PPC_PLATFORMS_HDPU_H */
diff --git a/arch/ppc/platforms/hermes.h b/arch/ppc/platforms/hermes.h
deleted file mode 100644
index de91afff8ca1..000000000000
--- a/arch/ppc/platforms/hermes.h
+++ /dev/null
@@ -1,26 +0,0 @@
1/*
2 * Multidata HERMES-PRO ( / SL ) board specific definitions
3 *
4 * Copyright (c) 2000, 2001 Wolfgang Denk (wd@denx.de)
5 */
6
7#ifndef __MACH_HERMES_H
8#define __MACH_HERMES_H
9
10
11#include <asm/ppcboot.h>
12
13#define HERMES_IMMR_BASE 0xFF000000 /* phys. addr of IMMR */
14#define HERMES_IMAP_SIZE (64 * 1024) /* size of mapped area */
15
16#define IMAP_ADDR HERMES_IMMR_BASE /* physical base address of IMMR area */
17#define IMAP_SIZE HERMES_IMAP_SIZE /* mapped size of IMMR area */
18
19#define FEC_INTERRUPT 9 /* = SIU_LEVEL4 */
20#define CPM_INTERRUPT 11 /* = SIU_LEVEL5 (was: SIU_LEVEL2) */
21
22/* We don't use the 8259.
23*/
24#define NR_8259_INTS 0
25
26#endif /* __MACH_HERMES_H */
diff --git a/arch/ppc/platforms/ip860.h b/arch/ppc/platforms/ip860.h
deleted file mode 100644
index 2f1f86ce1447..000000000000
--- a/arch/ppc/platforms/ip860.h
+++ /dev/null
@@ -1,35 +0,0 @@
1/*
2 * MicroSys IP860 VMEBus board specific definitions
3 *
4 * Copyright (c) 2000, 2001 Wolfgang Denk (wd@denx.de)
5 */
6
7#ifndef __MACH_IP860_H
8#define __MACH_IP860_H
9
10
11#include <asm/ppcboot.h>
12
13#define IP860_IMMR_BASE 0xF1000000 /* phys. addr of IMMR */
14#define IP860_IMAP_SIZE (64 * 1024) /* size of mapped area */
15
16#define IMAP_ADDR IP860_IMMR_BASE /* physical base address of IMMR area */
17#define IMAP_SIZE IP860_IMAP_SIZE /* mapped size of IMMR area */
18
19/*
20 * MPC8xx Chip Select Usage
21 */
22#define IP860_BOOT_CS 0 /* Boot (VMEBus or Flash) Chip Select 0 */
23#define IP860_FLASH_CS 1 /* Flash is on Chip Select 1 */
24#define IP860_SDRAM_CS 2 /* SDRAM is on Chip Select 2 */
25#define IP860_SRAM_CS 3 /* SRAM is on Chip Select 3 */
26#define IP860_BCSR_CS 4 /* BCSR is on Chip Select 4 */
27#define IP860_IP_CS 5 /* IP Slots are on Chip Select 5 */
28#define IP860_VME_STD_CS 6 /* VME Standard I/O is on Chip Select 6 */
29#define IP860_VME_SHORT_CS 7 /* VME Short I/O is on Chip Select 7 */
30
31/* We don't use the 8259.
32*/
33#define NR_8259_INTS 0
34
35#endif /* __MACH_IP860_H */
diff --git a/arch/ppc/platforms/ivms8.h b/arch/ppc/platforms/ivms8.h
deleted file mode 100644
index 9109e684ad9b..000000000000
--- a/arch/ppc/platforms/ivms8.h
+++ /dev/null
@@ -1,55 +0,0 @@
1/*
2 * Speech Design Integrated Voicemail board specific definitions
3 * - IVMS8 (small, 8 channels)
4 * - IVML24 (large, 24 channels)
5 *
6 * In 2.5 when we force a new bootloader, we can merge these two, and add
7 * in _MACH_'s for them. -- Tom
8 *
9 * Copyright (c) 2000, 2001 Wolfgang Denk (wd@denx.de)
10 */
11
12#ifdef __KERNEL__
13#ifndef __ASM_IVMS8_H__
14#define __ASM_IVMS8_H__
15
16
17#include <asm/ppcboot.h>
18
19#define IVMS_IMMR_BASE 0xFFF00000 /* phys. addr of IMMR */
20#define IVMS_IMAP_SIZE (64 * 1024) /* size of mapped area */
21
22#define IMAP_ADDR IVMS_IMMR_BASE /* phys. base address of IMMR area */
23#define IMAP_SIZE IVMS_IMAP_SIZE /* mapped size of IMMR area */
24
25#define PCMCIA_MEM_ADDR ((uint)0xFE100000)
26#define PCMCIA_MEM_SIZE ((uint)(64 * 1024))
27
28#define FEC_INTERRUPT 9 /* = SIU_LEVEL4 */
29#define IDE0_INTERRUPT 10 /* = IRQ5 */
30#define CPM_INTERRUPT 11 /* = SIU_LEVEL5 (was: SIU_LEVEL2) */
31#define PHY_INTERRUPT 12 /* = IRQ6 */
32
33/* override the default number of IDE hardware interfaces */
34#define MAX_HWIFS 1
35
36/*
37 * Definitions for IDE0 Interface
38 */
39#define IDE0_BASE_OFFSET 0x0000 /* Offset in PCMCIA memory */
40#define IDE0_DATA_REG_OFFSET 0x0000
41#define IDE0_ERROR_REG_OFFSET 0x0081
42#define IDE0_NSECTOR_REG_OFFSET 0x0082
43#define IDE0_SECTOR_REG_OFFSET 0x0083
44#define IDE0_LCYL_REG_OFFSET 0x0084
45#define IDE0_HCYL_REG_OFFSET 0x0085
46#define IDE0_SELECT_REG_OFFSET 0x0086
47#define IDE0_STATUS_REG_OFFSET 0x0087
48#define IDE0_CONTROL_REG_OFFSET 0x0106
49#define IDE0_IRQ_REG_OFFSET 0x000A /* not used */
50
51/* We don't use the 8259. */
52#define NR_8259_INTS 0
53
54#endif /* __ASM_IVMS8_H__ */
55#endif /* __KERNEL__ */
diff --git a/arch/ppc/platforms/katana.c b/arch/ppc/platforms/katana.c
deleted file mode 100644
index fe6e88cdb1cd..000000000000
--- a/arch/ppc/platforms/katana.c
+++ /dev/null
@@ -1,902 +0,0 @@
1/*
2 * Board setup routines for the Artesyn Katana cPCI boards.
3 *
4 * Author: Tim Montgomery <timm@artesyncp.com>
5 * Maintained by: Mark A. Greer <mgreer@mvista.com>
6 *
7 * Based on code done by Rabeeh Khoury - rabeeh@galileo.co.il
8 * Based on code done by - Mark A. Greer <mgreer@mvista.com>
9 *
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the
12 * Free Software Foundation; either version 2 of the License, or (at your
13 * option) any later version.
14 */
15/*
16 * Supports the Artesyn 750i, 752i, and 3750. The 752i is virtually identical
17 * to the 750i except that it has an mv64460 bridge.
18 */
19#include <linux/kernel.h>
20#include <linux/pci.h>
21#include <linux/kdev_t.h>
22#include <linux/console.h>
23#include <linux/initrd.h>
24#include <linux/root_dev.h>
25#include <linux/delay.h>
26#include <linux/seq_file.h>
27#include <linux/mtd/physmap.h>
28#include <linux/mv643xx.h>
29#include <linux/platform_device.h>
30#include <asm/io.h>
31#include <asm/unistd.h>
32#include <asm/page.h>
33#include <asm/time.h>
34#include <asm/smp.h>
35#include <asm/todc.h>
36#include <asm/bootinfo.h>
37#include <asm/ppcboot.h>
38#include <asm/mv64x60.h>
39#include <platforms/katana.h>
40#include <asm/machdep.h>
41
42static struct mv64x60_handle bh;
43static katana_id_t katana_id;
44static void __iomem *cpld_base;
45static void __iomem *sram_base;
46static u32 katana_flash_size_0;
47static u32 katana_flash_size_1;
48static u32 katana_bus_frequency;
49static struct pci_controller katana_hose_a;
50
51unsigned char __res[sizeof(bd_t)];
52
53/* PCI Interrupt routing */
54static int __init
55katana_irq_lookup_750i(unsigned char idsel, unsigned char pin)
56{
57 static char pci_irq_table[][4] = {
58 /*
59 * PCI IDSEL/INTPIN->INTLINE
60 * A B C D
61 */
62 /* IDSEL 4 (PMC 1) */
63 { KATANA_PCI_INTB_IRQ_750i, KATANA_PCI_INTC_IRQ_750i,
64 KATANA_PCI_INTD_IRQ_750i, KATANA_PCI_INTA_IRQ_750i },
65 /* IDSEL 5 (PMC 2) */
66 { KATANA_PCI_INTC_IRQ_750i, KATANA_PCI_INTD_IRQ_750i,
67 KATANA_PCI_INTA_IRQ_750i, KATANA_PCI_INTB_IRQ_750i },
68 /* IDSEL 6 (T8110) */
69 {KATANA_PCI_INTD_IRQ_750i, 0, 0, 0 },
70 /* IDSEL 7 (unused) */
71 {0, 0, 0, 0 },
72 /* IDSEL 8 (Intel 82544) (752i only but doesn't harm 750i) */
73 {KATANA_PCI_INTD_IRQ_750i, 0, 0, 0 },
74 };
75 const long min_idsel = 4, max_idsel = 8, irqs_per_slot = 4;
76
77 return PCI_IRQ_TABLE_LOOKUP;
78}
79
80static int __init
81katana_irq_lookup_3750(unsigned char idsel, unsigned char pin)
82{
83 static char pci_irq_table[][4] = {
84 /*
85 * PCI IDSEL/INTPIN->INTLINE
86 * A B C D
87 */
88 { KATANA_PCI_INTA_IRQ_3750, 0, 0, 0 }, /* IDSEL 3 (BCM5691) */
89 { KATANA_PCI_INTB_IRQ_3750, 0, 0, 0 }, /* IDSEL 4 (MV64360 #2)*/
90 { KATANA_PCI_INTC_IRQ_3750, 0, 0, 0 }, /* IDSEL 5 (MV64360 #3)*/
91 };
92 const long min_idsel = 3, max_idsel = 5, irqs_per_slot = 4;
93
94 return PCI_IRQ_TABLE_LOOKUP;
95}
96
97static int __init
98katana_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
99{
100 switch (katana_id) {
101 case KATANA_ID_750I:
102 case KATANA_ID_752I:
103 return katana_irq_lookup_750i(idsel, pin);
104
105 case KATANA_ID_3750:
106 return katana_irq_lookup_3750(idsel, pin);
107
108 default:
109 printk(KERN_ERR "Bogus board ID\n");
110 return 0;
111 }
112}
113
114/* Board info retrieval routines */
115void __init
116katana_get_board_id(void)
117{
118 switch (in_8(cpld_base + KATANA_CPLD_PRODUCT_ID)) {
119 case KATANA_PRODUCT_ID_3750:
120 katana_id = KATANA_ID_3750;
121 break;
122
123 case KATANA_PRODUCT_ID_750i:
124 katana_id = KATANA_ID_750I;
125 break;
126
127 case KATANA_PRODUCT_ID_752i:
128 katana_id = KATANA_ID_752I;
129 break;
130
131 default:
132 printk(KERN_ERR "Unsupported board\n");
133 }
134}
135
136int __init
137katana_get_proc_num(void)
138{
139 u16 val;
140 u8 save_exclude;
141 static int proc = -1;
142 static u8 first_time = 1;
143
144 if (first_time) {
145 if (katana_id != KATANA_ID_3750)
146 proc = 0;
147 else {
148 save_exclude = mv64x60_pci_exclude_bridge;
149 mv64x60_pci_exclude_bridge = 0;
150
151 early_read_config_word(bh.hose_b, 0,
152 PCI_DEVFN(0,0), PCI_DEVICE_ID, &val);
153
154 mv64x60_pci_exclude_bridge = save_exclude;
155
156 switch(val) {
157 case PCI_DEVICE_ID_KATANA_3750_PROC0:
158 proc = 0;
159 break;
160
161 case PCI_DEVICE_ID_KATANA_3750_PROC1:
162 proc = 1;
163 break;
164
165 case PCI_DEVICE_ID_KATANA_3750_PROC2:
166 proc = 2;
167 break;
168
169 default:
170 printk(KERN_ERR "Bogus Device ID\n");
171 }
172 }
173
174 first_time = 0;
175 }
176
177 return proc;
178}
179
180static inline int
181katana_is_monarch(void)
182{
183 return in_8(cpld_base + KATANA_CPLD_BD_CFG_3) &
184 KATANA_CPLD_BD_CFG_3_MONARCH;
185}
186
187static void __init
188katana_setup_bridge(void)
189{
190 struct pci_controller hose;
191 struct mv64x60_setup_info si;
192 void __iomem *vaddr;
193 int i;
194 u32 v;
195 u16 val, type;
196 u8 save_exclude;
197
198 /*
199 * Some versions of the Katana firmware mistakenly change the vendor
200 * & device id fields in the bridge's pci device (visible via pci
201 * config accesses). This breaks mv64x60_init() because those values
202 * are used to identify the type of bridge that's there. Artesyn
203 * claims that the subsystem vendor/device id's will have the correct
204 * Marvell values so this code puts back the correct values from there.
205 */
206 memset(&hose, 0, sizeof(hose));
207 vaddr = ioremap(CONFIG_MV64X60_NEW_BASE, MV64x60_INTERNAL_SPACE_SIZE);
208 setup_indirect_pci_nomap(&hose, vaddr + MV64x60_PCI0_CONFIG_ADDR,
209 vaddr + MV64x60_PCI0_CONFIG_DATA);
210 save_exclude = mv64x60_pci_exclude_bridge;
211 mv64x60_pci_exclude_bridge = 0;
212
213 early_read_config_word(&hose, 0, PCI_DEVFN(0, 0), PCI_VENDOR_ID, &val);
214
215 if (val != PCI_VENDOR_ID_MARVELL) {
216 early_read_config_word(&hose, 0, PCI_DEVFN(0, 0),
217 PCI_SUBSYSTEM_VENDOR_ID, &val);
218 early_write_config_word(&hose, 0, PCI_DEVFN(0, 0),
219 PCI_VENDOR_ID, val);
220 early_read_config_word(&hose, 0, PCI_DEVFN(0, 0),
221 PCI_SUBSYSTEM_ID, &val);
222 early_write_config_word(&hose, 0, PCI_DEVFN(0, 0),
223 PCI_DEVICE_ID, val);
224 }
225
226 /*
227 * While we're in here, set the hotswap register correctly.
228 * Turn off blue LED; mask ENUM#, clear insertion & extraction bits.
229 */
230 early_read_config_dword(&hose, 0, PCI_DEVFN(0, 0),
231 MV64360_PCICFG_CPCI_HOTSWAP, &v);
232 v &= ~(1<<19);
233 v |= ((1<<17) | (1<<22) | (1<<23));
234 early_write_config_dword(&hose, 0, PCI_DEVFN(0, 0),
235 MV64360_PCICFG_CPCI_HOTSWAP, v);
236
237 /* While we're at it, grab the bridge type for later */
238 early_read_config_word(&hose, 0, PCI_DEVFN(0, 0), PCI_DEVICE_ID, &type);
239
240 mv64x60_pci_exclude_bridge = save_exclude;
241 iounmap(vaddr);
242
243 memset(&si, 0, sizeof(si));
244
245 si.phys_reg_base = CONFIG_MV64X60_NEW_BASE;
246
247 si.pci_1.enable_bus = 1;
248 si.pci_1.pci_io.cpu_base = KATANA_PCI1_IO_START_PROC_ADDR;
249 si.pci_1.pci_io.pci_base_hi = 0;
250 si.pci_1.pci_io.pci_base_lo = KATANA_PCI1_IO_START_PCI_ADDR;
251 si.pci_1.pci_io.size = KATANA_PCI1_IO_SIZE;
252 si.pci_1.pci_io.swap = MV64x60_CPU2PCI_SWAP_NONE;
253 si.pci_1.pci_mem[0].cpu_base = KATANA_PCI1_MEM_START_PROC_ADDR;
254 si.pci_1.pci_mem[0].pci_base_hi = KATANA_PCI1_MEM_START_PCI_HI_ADDR;
255 si.pci_1.pci_mem[0].pci_base_lo = KATANA_PCI1_MEM_START_PCI_LO_ADDR;
256 si.pci_1.pci_mem[0].size = KATANA_PCI1_MEM_SIZE;
257 si.pci_1.pci_mem[0].swap = MV64x60_CPU2PCI_SWAP_NONE;
258 si.pci_1.pci_cmd_bits = 0;
259 si.pci_1.latency_timer = 0x80;
260
261 for (i = 0; i < MV64x60_CPU2MEM_WINDOWS; i++) {
262#if defined(CONFIG_NOT_COHERENT_CACHE)
263 si.cpu_prot_options[i] = 0;
264 si.enet_options[i] = MV64360_ENET2MEM_SNOOP_NONE;
265 si.mpsc_options[i] = MV64360_MPSC2MEM_SNOOP_NONE;
266 si.idma_options[i] = MV64360_IDMA2MEM_SNOOP_NONE;
267
268 si.pci_1.acc_cntl_options[i] =
269 MV64360_PCI_ACC_CNTL_SNOOP_NONE |
270 MV64360_PCI_ACC_CNTL_SWAP_NONE |
271 MV64360_PCI_ACC_CNTL_MBURST_128_BYTES |
272 MV64360_PCI_ACC_CNTL_RDSIZE_256_BYTES;
273#else
274 si.cpu_prot_options[i] = 0;
275 si.enet_options[i] = MV64360_ENET2MEM_SNOOP_WB;
276 si.mpsc_options[i] = MV64360_MPSC2MEM_SNOOP_WB;
277 si.idma_options[i] = MV64360_IDMA2MEM_SNOOP_WB;
278
279 si.pci_1.acc_cntl_options[i] =
280 MV64360_PCI_ACC_CNTL_SNOOP_WB |
281 MV64360_PCI_ACC_CNTL_SWAP_NONE |
282 MV64360_PCI_ACC_CNTL_MBURST_32_BYTES |
283 ((type == PCI_DEVICE_ID_MARVELL_MV64360) ?
284 MV64360_PCI_ACC_CNTL_RDSIZE_32_BYTES :
285 MV64360_PCI_ACC_CNTL_RDSIZE_256_BYTES);
286#endif
287 }
288
289 /* Lookup PCI host bridges */
290 if (mv64x60_init(&bh, &si))
291 printk(KERN_WARNING "Bridge initialization failed.\n");
292
293 pci_dram_offset = 0; /* sys mem at same addr on PCI & cpu bus */
294 ppc_md.pci_swizzle = common_swizzle;
295 ppc_md.pci_map_irq = katana_map_irq;
296 ppc_md.pci_exclude_device = mv64x60_pci_exclude_device;
297
298 mv64x60_set_bus(&bh, 1, 0);
299 bh.hose_b->first_busno = 0;
300 bh.hose_b->last_busno = 0xff;
301
302 /*
303 * Need to access hotswap reg which is in the pci config area of the
304 * bridge's hose 0. Note that pcibios_alloc_controller() can't be used
305 * to alloc hose_a b/c that would make hose 0 known to the generic
306 * pci code which we don't want.
307 */
308 bh.hose_a = &katana_hose_a;
309 setup_indirect_pci_nomap(bh.hose_a,
310 bh.v_base + MV64x60_PCI0_CONFIG_ADDR,
311 bh.v_base + MV64x60_PCI0_CONFIG_DATA);
312}
313
314/* Bridge & platform setup routines */
315void __init
316katana_intr_setup(void)
317{
318 if (bh.type == MV64x60_TYPE_MV64460) /* As per instns from Marvell */
319 mv64x60_clr_bits(&bh, MV64x60_CPU_MASTER_CNTL, 1 << 15);
320
321 /* MPP 8, 9, and 10 */
322 mv64x60_clr_bits(&bh, MV64x60_MPP_CNTL_1, 0xfff);
323
324 /* MPP 14 */
325 if ((katana_id == KATANA_ID_750I) || (katana_id == KATANA_ID_752I))
326 mv64x60_clr_bits(&bh, MV64x60_MPP_CNTL_1, 0x0f000000);
327
328 /*
329 * Define GPP 8,9,and 10 interrupt polarity as active low
330 * input signal and level triggered
331 */
332 mv64x60_set_bits(&bh, MV64x60_GPP_LEVEL_CNTL, 0x700);
333 mv64x60_clr_bits(&bh, MV64x60_GPP_IO_CNTL, 0x700);
334
335 if ((katana_id == KATANA_ID_750I) || (katana_id == KATANA_ID_752I)) {
336 mv64x60_set_bits(&bh, MV64x60_GPP_LEVEL_CNTL, (1<<14));
337 mv64x60_clr_bits(&bh, MV64x60_GPP_IO_CNTL, (1<<14));
338 }
339
340 /* Config GPP intr ctlr to respond to level trigger */
341 mv64x60_set_bits(&bh, MV64x60_COMM_ARBITER_CNTL, (1<<10));
342
343 if (bh.type == MV64x60_TYPE_MV64360) {
344 /* Erratum FEr PCI-#9 */
345 mv64x60_clr_bits(&bh, MV64x60_PCI1_CMD,
346 (1<<4) | (1<<5) | (1<<6) | (1<<7));
347 mv64x60_set_bits(&bh, MV64x60_PCI1_CMD, (1<<8) | (1<<9));
348 } else {
349 mv64x60_clr_bits(&bh, MV64x60_PCI1_CMD, (1<<6) | (1<<7));
350 mv64x60_set_bits(&bh, MV64x60_PCI1_CMD,
351 (1<<4) | (1<<5) | (1<<8) | (1<<9));
352 }
353
354 /*
355 * Dismiss and then enable interrupt on GPP interrupt cause
356 * for CPU #0
357 */
358 mv64x60_write(&bh, MV64x60_GPP_INTR_CAUSE, ~0x700);
359 mv64x60_set_bits(&bh, MV64x60_GPP_INTR_MASK, 0x700);
360
361 if ((katana_id == KATANA_ID_750I) || (katana_id == KATANA_ID_752I)) {
362 mv64x60_write(&bh, MV64x60_GPP_INTR_CAUSE, ~(1<<14));
363 mv64x60_set_bits(&bh, MV64x60_GPP_INTR_MASK, (1<<14));
364 }
365
366 /*
367 * Dismiss and then enable interrupt on CPU #0 high cause reg
368 * BIT25 summarizes GPP interrupts 8-15
369 */
370 mv64x60_set_bits(&bh, MV64360_IC_CPU0_INTR_MASK_HI, (1<<25));
371}
372
373void __init
374katana_setup_peripherals(void)
375{
376 u32 base;
377
378 /* Set up windows for boot CS, soldered & socketed flash, and CPLD */
379 mv64x60_set_32bit_window(&bh, MV64x60_CPU2BOOT_WIN,
380 KATANA_BOOT_WINDOW_BASE, KATANA_BOOT_WINDOW_SIZE, 0);
381 bh.ci->enable_window_32bit(&bh, MV64x60_CPU2BOOT_WIN);
382
383 /* Assume firmware set up window sizes correctly for dev 0 & 1 */
384 mv64x60_get_32bit_window(&bh, MV64x60_CPU2DEV_0_WIN, &base,
385 &katana_flash_size_0);
386
387 if (katana_flash_size_0 > 0) {
388 mv64x60_set_32bit_window(&bh, MV64x60_CPU2DEV_0_WIN,
389 KATANA_SOLDERED_FLASH_BASE, katana_flash_size_0, 0);
390 bh.ci->enable_window_32bit(&bh, MV64x60_CPU2DEV_0_WIN);
391 }
392
393 mv64x60_get_32bit_window(&bh, MV64x60_CPU2DEV_1_WIN, &base,
394 &katana_flash_size_1);
395
396 if (katana_flash_size_1 > 0) {
397 mv64x60_set_32bit_window(&bh, MV64x60_CPU2DEV_1_WIN,
398 (KATANA_SOLDERED_FLASH_BASE + katana_flash_size_0),
399 katana_flash_size_1, 0);
400 bh.ci->enable_window_32bit(&bh, MV64x60_CPU2DEV_1_WIN);
401 }
402
403 mv64x60_set_32bit_window(&bh, MV64x60_CPU2DEV_2_WIN,
404 KATANA_SOCKET_BASE, KATANA_SOCKETED_FLASH_SIZE, 0);
405 bh.ci->enable_window_32bit(&bh, MV64x60_CPU2DEV_2_WIN);
406
407 mv64x60_set_32bit_window(&bh, MV64x60_CPU2DEV_3_WIN,
408 KATANA_CPLD_BASE, KATANA_CPLD_SIZE, 0);
409 bh.ci->enable_window_32bit(&bh, MV64x60_CPU2DEV_3_WIN);
410 cpld_base = ioremap(KATANA_CPLD_BASE, KATANA_CPLD_SIZE);
411
412 mv64x60_set_32bit_window(&bh, MV64x60_CPU2SRAM_WIN,
413 KATANA_INTERNAL_SRAM_BASE, MV64360_SRAM_SIZE, 0);
414 bh.ci->enable_window_32bit(&bh, MV64x60_CPU2SRAM_WIN);
415 sram_base = ioremap(KATANA_INTERNAL_SRAM_BASE, MV64360_SRAM_SIZE);
416
417 /* Set up Enet->SRAM window */
418 mv64x60_set_32bit_window(&bh, MV64x60_ENET2MEM_4_WIN,
419 KATANA_INTERNAL_SRAM_BASE, MV64360_SRAM_SIZE, 0x2);
420 bh.ci->enable_window_32bit(&bh, MV64x60_ENET2MEM_4_WIN);
421
422 /* Give enet r/w access to memory region */
423 mv64x60_set_bits(&bh, MV64360_ENET2MEM_ACC_PROT_0, (0x3 << (4 << 1)));
424 mv64x60_set_bits(&bh, MV64360_ENET2MEM_ACC_PROT_1, (0x3 << (4 << 1)));
425 mv64x60_set_bits(&bh, MV64360_ENET2MEM_ACC_PROT_2, (0x3 << (4 << 1)));
426
427 mv64x60_clr_bits(&bh, MV64x60_PCI1_PCI_DECODE_CNTL, (1 << 3));
428 mv64x60_clr_bits(&bh, MV64x60_TIMR_CNTR_0_3_CNTL,
429 ((1 << 0) | (1 << 8) | (1 << 16) | (1 << 24)));
430
431 /* Must wait until window set up before retrieving board id */
432 katana_get_board_id();
433
434 /* Enumerate pci bus (must know board id before getting proc number) */
435 if (katana_get_proc_num() == 0)
436 bh.hose_b->last_busno = pciauto_bus_scan(bh.hose_b, 0);
437
438#if defined(CONFIG_NOT_COHERENT_CACHE)
439 mv64x60_write(&bh, MV64360_SRAM_CONFIG, 0x00160000);
440#else
441 mv64x60_write(&bh, MV64360_SRAM_CONFIG, 0x001600b2);
442#endif
443
444 /*
445 * Setting the SRAM to 0. Note that this generates parity errors on
446 * internal data path in SRAM since it's first time accessing it
447 * while after reset it's not configured.
448 */
449 memset(sram_base, 0, MV64360_SRAM_SIZE);
450
451 /* Only processor zero [on 3750] is an PCI interrupt controller */
452 if (katana_get_proc_num() == 0)
453 katana_intr_setup();
454}
455
456static void __init
457katana_enable_ipmi(void)
458{
459 u8 reset_out;
460
461 /* Enable access to IPMI ctlr by clearing IPMI PORTSEL bit in CPLD */
462 reset_out = in_8(cpld_base + KATANA_CPLD_RESET_OUT);
463 reset_out &= ~KATANA_CPLD_RESET_OUT_PORTSEL;
464 out_8(cpld_base + KATANA_CPLD_RESET_OUT, reset_out);
465}
466
467static void __init
468katana_setup_arch(void)
469{
470 if (ppc_md.progress)
471 ppc_md.progress("katana_setup_arch: enter", 0);
472
473 set_tb(0, 0);
474
475#ifdef CONFIG_BLK_DEV_INITRD
476 if (initrd_start)
477 ROOT_DEV = Root_RAM0;
478 else
479#endif
480#ifdef CONFIG_ROOT_NFS
481 ROOT_DEV = Root_NFS;
482#else
483 ROOT_DEV = Root_SDA2;
484#endif
485
486 /*
487 * Set up the L2CR register.
488 *
489 * 750FX has only L2E, L2PE (bits 2-8 are reserved)
490 * DD2.0 has bug that requires the L2 to be in WRT mode
491 * avoid dirty data in cache
492 */
493 if (PVR_REV(mfspr(SPRN_PVR)) == 0x0200) {
494 printk(KERN_INFO "DD2.0 detected. Setting L2 cache"
495 "to Writethrough mode\n");
496 _set_L2CR(L2CR_L2E | L2CR_L2PE | L2CR_L2WT);
497 } else
498 _set_L2CR(L2CR_L2E | L2CR_L2PE);
499
500 if (ppc_md.progress)
501 ppc_md.progress("katana_setup_arch: calling setup_bridge", 0);
502
503 katana_setup_bridge();
504 katana_setup_peripherals();
505 katana_enable_ipmi();
506
507 katana_bus_frequency = katana_bus_freq(cpld_base);
508
509 printk(KERN_INFO "Artesyn Communication Products, LLC - Katana(TM)\n");
510 if (ppc_md.progress)
511 ppc_md.progress("katana_setup_arch: exit", 0);
512}
513
514void
515katana_fixup_resources(struct pci_dev *dev)
516{
517 u16 v16;
518
519 pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE, L1_CACHE_BYTES>>2);
520
521 pci_read_config_word(dev, PCI_COMMAND, &v16);
522 v16 |= PCI_COMMAND_INVALIDATE | PCI_COMMAND_FAST_BACK;
523 pci_write_config_word(dev, PCI_COMMAND, v16);
524}
525
526static const unsigned int cpu_750xx[32] = { /* 750FX & 750GX */
527 0, 0, 2, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,/* 0-15*/
528 16, 17, 18, 19, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 0 /*16-31*/
529};
530
531static int
532katana_get_cpu_freq(void)
533{
534 unsigned long pll_cfg;
535
536 pll_cfg = (mfspr(SPRN_HID1) & 0xf8000000) >> 27;
537 return katana_bus_frequency * cpu_750xx[pll_cfg]/2;
538}
539
540/* Platform device data fixup routines. */
541#if defined(CONFIG_SERIAL_MPSC)
542static void __init
543katana_fixup_mpsc_pdata(struct platform_device *pdev)
544{
545 struct mpsc_pdata *pdata = (struct mpsc_pdata *)pdev->dev.platform_data;
546 bd_t *bdp = (bd_t *)__res;
547
548 if (bdp->bi_baudrate)
549 pdata->default_baud = bdp->bi_baudrate;
550 else
551 pdata->default_baud = KATANA_DEFAULT_BAUD;
552
553 pdata->max_idle = 40;
554 pdata->brg_clk_src = KATANA_MPSC_CLK_SRC;
555 /*
556 * TCLK (not SysCLk) is routed to BRG, then to the MPSC. On most parts,
557 * TCLK == SysCLK but on 64460, they are separate pins.
558 * SysCLK can go up to 200 MHz but TCLK can only go up to 133 MHz.
559 */
560 pdata->brg_clk_freq = min(katana_bus_frequency, MV64x60_TCLK_FREQ_MAX);
561}
562#endif
563
564#if defined(CONFIG_MV643XX_ETH)
565static void __init
566katana_fixup_eth_pdata(struct platform_device *pdev)
567{
568 struct mv643xx_eth_platform_data *eth_pd;
569 static u16 phy_addr[] = {
570 KATANA_ETH0_PHY_ADDR,
571 KATANA_ETH1_PHY_ADDR,
572 KATANA_ETH2_PHY_ADDR,
573 };
574
575 eth_pd = pdev->dev.platform_data;
576 eth_pd->force_phy_addr = 1;
577 eth_pd->phy_addr = phy_addr[pdev->id];
578 eth_pd->tx_queue_size = KATANA_ETH_TX_QUEUE_SIZE;
579 eth_pd->rx_queue_size = KATANA_ETH_RX_QUEUE_SIZE;
580}
581#endif
582
583#if defined(CONFIG_SYSFS)
584static void __init
585katana_fixup_mv64xxx_pdata(struct platform_device *pdev)
586{
587 struct mv64xxx_pdata *pdata = (struct mv64xxx_pdata *)
588 pdev->dev.platform_data;
589
590 /* Katana supports the mv64xxx hotswap register */
591 pdata->hs_reg_valid = 1;
592}
593#endif
594
595static int
596katana_platform_notify(struct device *dev)
597{
598 static struct {
599 char *bus_id;
600 void ((*rtn)(struct platform_device *pdev));
601 } dev_map[] = {
602#if defined(CONFIG_SERIAL_MPSC)
603 { MPSC_CTLR_NAME ".0", katana_fixup_mpsc_pdata },
604 { MPSC_CTLR_NAME ".1", katana_fixup_mpsc_pdata },
605#endif
606#if defined(CONFIG_MV643XX_ETH)
607 { MV643XX_ETH_NAME ".0", katana_fixup_eth_pdata },
608 { MV643XX_ETH_NAME ".1", katana_fixup_eth_pdata },
609 { MV643XX_ETH_NAME ".2", katana_fixup_eth_pdata },
610#endif
611#if defined(CONFIG_SYSFS)
612 { MV64XXX_DEV_NAME ".0", katana_fixup_mv64xxx_pdata },
613#endif
614 };
615 struct platform_device *pdev;
616 int i;
617
618 if (dev && dev->bus_id)
619 for (i=0; i<ARRAY_SIZE(dev_map); i++)
620 if (!strncmp(dev->bus_id, dev_map[i].bus_id,
621 BUS_ID_SIZE)) {
622 pdev = container_of(dev,
623 struct platform_device, dev);
624 dev_map[i].rtn(pdev);
625 }
626
627 return 0;
628}
629
630#ifdef CONFIG_MTD_PHYSMAP
631
632#ifndef MB
633#define MB (1 << 20)
634#endif
635
636/*
637 * MTD Layout depends on amount of soldered FLASH in system. Sizes in MB.
638 *
639 * FLASH Amount: 128 64 32 16
640 * ------------- --- -- -- --
641 * Monitor: 1 1 1 1
642 * Primary Kernel: 1.5 1.5 1.5 1.5
643 * Primary fs: 30 30 <end> <end>
644 * Secondary Kernel: 1.5 1.5 N/A N/A
645 * Secondary fs: <end> <end> N/A N/A
646 * User: <overlays entire FLASH except for "Monitor" section>
647 */
648static int __init
649katana_setup_mtd(void)
650{
651 u32 size;
652 int ptbl_entries;
653 static struct mtd_partition *ptbl;
654
655 size = katana_flash_size_0 + katana_flash_size_1;
656 if (!size)
657 return -ENOMEM;
658
659 ptbl_entries = (size >= (64*MB)) ? 6 : 4;
660
661 if ((ptbl = kcalloc(ptbl_entries, sizeof(struct mtd_partition),
662 GFP_KERNEL)) == NULL) {
663 printk(KERN_WARNING "Can't alloc MTD partition table\n");
664 return -ENOMEM;
665 }
666
667 ptbl[0].name = "Monitor";
668 ptbl[0].size = KATANA_MTD_MONITOR_SIZE;
669 ptbl[1].name = "Primary Kernel";
670 ptbl[1].offset = MTDPART_OFS_NXTBLK;
671 ptbl[1].size = 0x00180000; /* 1.5 MB */
672 ptbl[2].name = "Primary Filesystem";
673 ptbl[2].offset = MTDPART_OFS_APPEND;
674 ptbl[2].size = MTDPART_SIZ_FULL; /* Correct for 16 & 32 MB */
675 ptbl[ptbl_entries-1].name = "User FLASH";
676 ptbl[ptbl_entries-1].offset = KATANA_MTD_MONITOR_SIZE;
677 ptbl[ptbl_entries-1].size = MTDPART_SIZ_FULL;
678
679 if (size >= (64*MB)) {
680 ptbl[2].size = 30*MB;
681 ptbl[3].name = "Secondary Kernel";
682 ptbl[3].offset = MTDPART_OFS_NXTBLK;
683 ptbl[3].size = 0x00180000; /* 1.5 MB */
684 ptbl[4].name = "Secondary Filesystem";
685 ptbl[4].offset = MTDPART_OFS_APPEND;
686 ptbl[4].size = MTDPART_SIZ_FULL;
687 }
688
689 physmap_map.size = size;
690 physmap_set_partitions(ptbl, ptbl_entries);
691 return 0;
692}
693arch_initcall(katana_setup_mtd);
694#endif
695
696static void
697katana_restart(char *cmd)
698{
699 ulong i = 10000000;
700
701 /* issue hard reset to the reset command register */
702 out_8(cpld_base + KATANA_CPLD_RST_CMD, KATANA_CPLD_RST_CMD_HR);
703
704 while (i-- > 0) ;
705 panic("restart failed\n");
706}
707
708static void
709katana_halt(void)
710{
711 u8 v;
712
713 /* Turn on blue LED to indicate its okay to remove */
714 if (katana_id == KATANA_ID_750I) {
715 u32 v;
716 u8 save_exclude;
717
718 /* Set LOO bit in cPCI HotSwap reg of hose 0 to turn on LED. */
719 save_exclude = mv64x60_pci_exclude_bridge;
720 mv64x60_pci_exclude_bridge = 0;
721 early_read_config_dword(bh.hose_a, 0, PCI_DEVFN(0, 0),
722 MV64360_PCICFG_CPCI_HOTSWAP, &v);
723 v &= 0xff;
724 v |= (1 << 19);
725 early_write_config_dword(bh.hose_a, 0, PCI_DEVFN(0, 0),
726 MV64360_PCICFG_CPCI_HOTSWAP, v);
727 mv64x60_pci_exclude_bridge = save_exclude;
728 } else if (katana_id == KATANA_ID_752I) {
729 v = in_8(cpld_base + HSL_PLD_BASE + HSL_PLD_HOT_SWAP_OFF);
730 v |= HSL_PLD_HOT_SWAP_LED_BIT;
731 out_8(cpld_base + HSL_PLD_BASE + HSL_PLD_HOT_SWAP_OFF, v);
732 }
733
734 while (1) ;
735 /* NOTREACHED */
736}
737
738static void
739katana_power_off(void)
740{
741 katana_halt();
742 /* NOTREACHED */
743}
744
745static int
746katana_show_cpuinfo(struct seq_file *m)
747{
748 char *s;
749
750 seq_printf(m, "cpu freq\t: %dMHz\n",
751 (katana_get_cpu_freq() + 500000) / 1000000);
752 seq_printf(m, "bus freq\t: %ldMHz\n",
753 ((long)katana_bus_frequency + 500000) / 1000000);
754 seq_printf(m, "vendor\t\t: Artesyn Communication Products, LLC\n");
755
756 seq_printf(m, "board\t\t: ");
757 switch (katana_id) {
758 case KATANA_ID_3750:
759 seq_printf(m, "Katana 3750");
760 break;
761
762 case KATANA_ID_750I:
763 seq_printf(m, "Katana 750i");
764 break;
765
766 case KATANA_ID_752I:
767 seq_printf(m, "Katana 752i");
768 break;
769
770 default:
771 seq_printf(m, "Unknown");
772 break;
773 }
774 seq_printf(m, " (product id: 0x%x)\n",
775 in_8(cpld_base + KATANA_CPLD_PRODUCT_ID));
776
777 seq_printf(m, "pci mode\t: %sMonarch\n",
778 katana_is_monarch()? "" : "Non-");
779 seq_printf(m, "hardware rev\t: 0x%x\n",
780 in_8(cpld_base+KATANA_CPLD_HARDWARE_VER));
781 seq_printf(m, "pld rev\t\t: 0x%x\n",
782 in_8(cpld_base + KATANA_CPLD_PLD_VER));
783
784 switch(bh.type) {
785 case MV64x60_TYPE_GT64260A:
786 s = "gt64260a";
787 break;
788 case MV64x60_TYPE_GT64260B:
789 s = "gt64260b";
790 break;
791 case MV64x60_TYPE_MV64360:
792 s = "mv64360";
793 break;
794 case MV64x60_TYPE_MV64460:
795 s = "mv64460";
796 break;
797 default:
798 s = "Unknown";
799 }
800 seq_printf(m, "bridge type\t: %s\n", s);
801 seq_printf(m, "bridge rev\t: 0x%x\n", bh.rev);
802#if defined(CONFIG_NOT_COHERENT_CACHE)
803 seq_printf(m, "coherency\t: %s\n", "off");
804#else
805 seq_printf(m, "coherency\t: %s\n", "on");
806#endif
807
808 return 0;
809}
810
811static void __init
812katana_calibrate_decr(void)
813{
814 u32 freq;
815
816 freq = katana_bus_frequency / 4;
817
818 printk(KERN_INFO "time_init: decrementer frequency = %lu.%.6lu MHz\n",
819 (long)freq / 1000000, (long)freq % 1000000);
820
821 tb_ticks_per_jiffy = freq / HZ;
822 tb_to_us = mulhwu_scale_factor(freq, 1000000);
823}
824
825/*
826 * The katana supports both uImage and zImage. If uImage, get the mem size
827 * from the bd info. If zImage, the bootwrapper adds a BI_MEMSIZE entry in
828 * the bi_rec data which is sucked out and put into boot_mem_size by
829 * parse_bootinfo(). MMU_init() will then use the boot_mem_size for the mem
830 * size and not call this routine. The only way this will fail is when a uImage
831 * is used but the fw doesn't pass in a valid bi_memsize. This should never
832 * happen, though.
833 */
834unsigned long __init
835katana_find_end_of_memory(void)
836{
837 bd_t *bdp = (bd_t *)__res;
838 return bdp->bi_memsize;
839}
840
841#if defined(CONFIG_SERIAL_TEXT_DEBUG) && defined(CONFIG_SERIAL_MPSC_CONSOLE)
842static void __init
843katana_map_io(void)
844{
845 io_block_mapping(0xf8100000, 0xf8100000, 0x00020000, _PAGE_IO);
846}
847#endif
848
849void __init
850platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
851 unsigned long r6, unsigned long r7)
852{
853 parse_bootinfo(find_bootinfo());
854
855 /* ASSUMPTION: If both r3 (bd_t pointer) and r6 (cmdline pointer)
856 * are non-zero, then we should use the board info from the bd_t
857 * structure and the cmdline pointed to by r6 instead of the
858 * information from birecs, if any. Otherwise, use the information
859 * from birecs as discovered by the preceding call to
860 * parse_bootinfo(). This rule should work with both PPCBoot, which
861 * uses a bd_t board info structure, and the kernel boot wrapper,
862 * which uses birecs.
863 */
864 if (r3 && r6) {
865 /* copy board info structure */
866 memcpy((void *)__res, (void *)(r3+KERNELBASE), sizeof(bd_t));
867 /* copy command line */
868 *(char *)(r7+KERNELBASE) = 0;
869 strcpy(cmd_line, (char *)(r6+KERNELBASE));
870 }
871
872#ifdef CONFIG_BLK_DEV_INITRD
873 /* take care of initrd if we have one */
874 if (r4) {
875 initrd_start = r4 + KERNELBASE;
876 initrd_end = r5 + KERNELBASE;
877 }
878#endif /* CONFIG_BLK_DEV_INITRD */
879
880 isa_mem_base = 0;
881
882 ppc_md.setup_arch = katana_setup_arch;
883 ppc_md.pcibios_fixup_resources = katana_fixup_resources;
884 ppc_md.show_cpuinfo = katana_show_cpuinfo;
885 ppc_md.init_IRQ = mv64360_init_irq;
886 ppc_md.get_irq = mv64360_get_irq;
887 ppc_md.restart = katana_restart;
888 ppc_md.power_off = katana_power_off;
889 ppc_md.halt = katana_halt;
890 ppc_md.find_end_of_memory = katana_find_end_of_memory;
891 ppc_md.calibrate_decr = katana_calibrate_decr;
892
893#if defined(CONFIG_SERIAL_TEXT_DEBUG) && defined(CONFIG_SERIAL_MPSC_CONSOLE)
894 ppc_md.setup_io_mappings = katana_map_io;
895 ppc_md.progress = mv64x60_mpsc_progress;
896 mv64x60_progress_init(CONFIG_MV64X60_NEW_BASE);
897#endif
898
899#if defined(CONFIG_SERIAL_MPSC) || defined(CONFIG_MV643XX_ETH)
900 platform_notify = katana_platform_notify;
901#endif
902}
diff --git a/arch/ppc/platforms/katana.h b/arch/ppc/platforms/katana.h
deleted file mode 100644
index 0a9b036526b1..000000000000
--- a/arch/ppc/platforms/katana.h
+++ /dev/null
@@ -1,253 +0,0 @@
1/*
2 * Definitions for Artesyn Katana750i/3750 board.
3 *
4 * Author: Tim Montgomery <timm@artesyncp.com>
5 * Maintained by: Mark A. Greer <mgreer@mvista.com>
6 *
7 * Based on code done by Rabeeh Khoury - rabeeh@galileo.co.il
8 * Based on code done by Mark A. Greer <mgreer@mvista.com>
9 *
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the
12 * Free Software Foundation; either version 2 of the License, or (at your
13 * option) any later version.
14 */
15
16/*
17 * The MV64360 has 2 PCI buses each with 1 window from the CPU bus to
18 * PCI I/O space and 4 windows from the CPU bus to PCI MEM space.
19 * We'll only use one PCI MEM window on each PCI bus.
20 *
21 * This is the CPU physical memory map (windows must be at least 64 KB and start
22 * on a boundary that is a multiple of the window size):
23 *
24 * 0xff800000-0xffffffff - Boot window
25 * 0xf8400000-0xf843ffff - Internal SRAM
26 * 0xf8200000-0xf83fffff - CPLD
27 * 0xf8100000-0xf810ffff - MV64360 Registers (CONFIG_MV64X60_NEW_BASE)
28 * 0xf8000000-0xf80fffff - Socketed FLASH
29 * 0xe0000000-0xefffffff - Soldered FLASH
30 * 0xc0000000-0xc3ffffff - PCI I/O (second hose)
31 * 0x80000000-0xbfffffff - PCI MEM (second hose)
32 */
33
34#ifndef __PPC_PLATFORMS_KATANA_H
35#define __PPC_PLATFORMS_KATANA_H
36
37/* CPU Physical Memory Map setup. */
38#define KATANA_BOOT_WINDOW_BASE 0xff800000
39#define KATANA_BOOT_WINDOW_SIZE 0x00800000 /* 8 MB */
40#define KATANA_INTERNAL_SRAM_BASE 0xf8400000
41#define KATANA_CPLD_BASE 0xf8200000
42#define KATANA_CPLD_SIZE 0x00200000 /* 2 MB */
43#define KATANA_SOCKET_BASE 0xf8000000
44#define KATANA_SOCKETED_FLASH_SIZE 0x00100000 /* 1 MB */
45#define KATANA_SOLDERED_FLASH_BASE 0xe0000000
46#define KATANA_SOLDERED_FLASH_SIZE 0x10000000 /* 256 MB */
47
48#define KATANA_PCI1_MEM_START_PROC_ADDR 0x80000000
49#define KATANA_PCI1_MEM_START_PCI_HI_ADDR 0x00000000
50#define KATANA_PCI1_MEM_START_PCI_LO_ADDR 0x80000000
51#define KATANA_PCI1_MEM_SIZE 0x40000000 /* 1 GB */
52#define KATANA_PCI1_IO_START_PROC_ADDR 0xc0000000
53#define KATANA_PCI1_IO_START_PCI_ADDR 0x00000000
54#define KATANA_PCI1_IO_SIZE 0x04000000 /* 64 MB */
55
56/* Board-specific IRQ info */
57#define KATANA_PCI_INTA_IRQ_3750 (64+8)
58#define KATANA_PCI_INTB_IRQ_3750 (64+9)
59#define KATANA_PCI_INTC_IRQ_3750 (64+10)
60
61#define KATANA_PCI_INTA_IRQ_750i (64+8)
62#define KATANA_PCI_INTB_IRQ_750i (64+9)
63#define KATANA_PCI_INTC_IRQ_750i (64+10)
64#define KATANA_PCI_INTD_IRQ_750i (64+14)
65
66#define KATANA_CPLD_RST_EVENT 0x00000000
67#define KATANA_CPLD_RST_CMD 0x00001000
68#define KATANA_CPLD_PCI_ERR_INT_EN 0x00002000
69#define KATANA_CPLD_PCI_ERR_INT_PEND 0x00003000
70#define KATANA_CPLD_PRODUCT_ID 0x00004000
71#define KATANA_CPLD_EREADY 0x00005000
72
73#define KATANA_CPLD_HARDWARE_VER 0x00007000
74#define KATANA_CPLD_PLD_VER 0x00008000
75#define KATANA_CPLD_BD_CFG_0 0x00009000
76#define KATANA_CPLD_BD_CFG_1 0x0000a000
77#define KATANA_CPLD_BD_CFG_3 0x0000c000
78#define KATANA_CPLD_LED 0x0000d000
79#define KATANA_CPLD_RESET_OUT 0x0000e000
80
81#define KATANA_CPLD_RST_EVENT_INITACT 0x80
82#define KATANA_CPLD_RST_EVENT_SW 0x40
83#define KATANA_CPLD_RST_EVENT_WD 0x20
84#define KATANA_CPLD_RST_EVENT_COPS 0x10
85#define KATANA_CPLD_RST_EVENT_COPH 0x08
86#define KATANA_CPLD_RST_EVENT_CPCI 0x02
87#define KATANA_CPLD_RST_EVENT_FP 0x01
88
89#define KATANA_CPLD_RST_CMD_SCL 0x80
90#define KATANA_CPLD_RST_CMD_SDA 0x40
91#define KATANA_CPLD_RST_CMD_I2C 0x10
92#define KATANA_CPLD_RST_CMD_FR 0x08
93#define KATANA_CPLD_RST_CMD_SR 0x04
94#define KATANA_CPLD_RST_CMD_HR 0x01
95
96#define KATANA_CPLD_BD_CFG_0_SYSCLK_MASK 0xc0
97#define KATANA_CPLD_BD_CFG_0_SYSCLK_200 0x00
98#define KATANA_CPLD_BD_CFG_0_SYSCLK_166 0x80
99#define KATANA_CPLD_BD_CFG_0_SYSCLK_133 0xc0
100#define KATANA_CPLD_BD_CFG_0_SYSCLK_100 0x40
101
102#define KATANA_CPLD_BD_CFG_1_FL_BANK_MASK 0x03
103#define KATANA_CPLD_BD_CFG_1_FL_BANK_16MB 0x00
104#define KATANA_CPLD_BD_CFG_1_FL_BANK_32MB 0x01
105#define KATANA_CPLD_BD_CFG_1_FL_BANK_64MB 0x02
106#define KATANA_CPLD_BD_CFG_1_FL_BANK_128MB 0x03
107
108#define KATANA_CPLD_BD_CFG_1_FL_NUM_BANKS_MASK 0x04
109#define KATANA_CPLD_BD_CFG_1_FL_NUM_BANKS_ONE 0x00
110#define KATANA_CPLD_BD_CFG_1_FL_NUM_BANKS_TWO 0x04
111
112#define KATANA_CPLD_BD_CFG_3_MONARCH 0x04
113
114#define KATANA_CPLD_RESET_OUT_PORTSEL 0x80
115#define KATANA_CPLD_RESET_OUT_WD 0x20
116#define KATANA_CPLD_RESET_OUT_COPH 0x08
117#define KATANA_CPLD_RESET_OUT_PCI_RST_PCI 0x02
118#define KATANA_CPLD_RESET_OUT_PCI_RST_FP 0x01
119
120#define KATANA_MBOX_RESET_REQUEST 0xC83A
121#define KATANA_MBOX_RESET_ACK 0xE430
122#define KATANA_MBOX_RESET_DONE 0x32E5
123
124#define HSL_PLD_BASE 0x00010000
125#define HSL_PLD_J4SGA_REG_OFF 0
126#define HSL_PLD_J4GA_REG_OFF 1
127#define HSL_PLD_J2GA_REG_OFF 2
128#define HSL_PLD_HOT_SWAP_OFF 6
129#define HSL_PLD_HOT_SWAP_LED_BIT 0x1
130#define GA_MASK 0x1f
131#define HSL_PLD_SIZE 0x1000
132#define K3750_GPP_GEO_ADDR_PINS 0xf8000000
133#define K3750_GPP_GEO_ADDR_SHIFT 27
134
135#define K3750_GPP_EVENT_PROC_0 (1 << 21)
136#define K3750_GPP_EVENT_PROC_1_2 (1 << 2)
137
138#define PCI_VENDOR_ID_ARTESYN 0x1223
139#define PCI_DEVICE_ID_KATANA_3750_PROC0 0x0041
140#define PCI_DEVICE_ID_KATANA_3750_PROC1 0x0042
141#define PCI_DEVICE_ID_KATANA_3750_PROC2 0x0043
142
143#define COPROC_MEM_FUNCTION 0
144#define COPROC_MEM_BAR 0
145#define COPROC_REGS_FUNCTION 0
146#define COPROC_REGS_BAR 4
147#define COPROC_FLASH_FUNCTION 2
148#define COPROC_FLASH_BAR 4
149
150#define KATANA_IPMB_LOCAL_I2C_ADDR 0x08
151
152#define KATANA_DEFAULT_BAUD 9600
153#define KATANA_MPSC_CLK_SRC 8 /* TCLK */
154
155#define KATANA_MTD_MONITOR_SIZE (1 << 20) /* 1 MB */
156
157#define KATANA_ETH0_PHY_ADDR 12
158#define KATANA_ETH1_PHY_ADDR 11
159#define KATANA_ETH2_PHY_ADDR 4
160
161#define KATANA_PRODUCT_ID_3750 0x01
162#define KATANA_PRODUCT_ID_750i 0x02
163#define KATANA_PRODUCT_ID_752i 0x04
164
165#define KATANA_ETH_TX_QUEUE_SIZE 800
166#define KATANA_ETH_RX_QUEUE_SIZE 400
167
168#define KATANA_ETH_PORT_CONFIG_VALUE \
169 ETH_UNICAST_NORMAL_MODE | \
170 ETH_DEFAULT_RX_QUEUE_0 | \
171 ETH_DEFAULT_RX_ARP_QUEUE_0 | \
172 ETH_RECEIVE_BC_IF_NOT_IP_OR_ARP | \
173 ETH_RECEIVE_BC_IF_IP | \
174 ETH_RECEIVE_BC_IF_ARP | \
175 ETH_CAPTURE_TCP_FRAMES_DIS | \
176 ETH_CAPTURE_UDP_FRAMES_DIS | \
177 ETH_DEFAULT_RX_TCP_QUEUE_0 | \
178 ETH_DEFAULT_RX_UDP_QUEUE_0 | \
179 ETH_DEFAULT_RX_BPDU_QUEUE_0
180
181#define KATANA_ETH_PORT_CONFIG_EXTEND_VALUE \
182 ETH_SPAN_BPDU_PACKETS_AS_NORMAL | \
183 ETH_PARTITION_DISABLE
184
185#define GT_ETH_IPG_INT_RX(value) \
186 ((value & 0x3fff) << 8)
187
188#define KATANA_ETH_PORT_SDMA_CONFIG_VALUE \
189 ETH_RX_BURST_SIZE_4_64BIT | \
190 GT_ETH_IPG_INT_RX(0) | \
191 ETH_TX_BURST_SIZE_4_64BIT
192
193#define KATANA_ETH_PORT_SERIAL_CONTROL_VALUE \
194 ETH_FORCE_LINK_PASS | \
195 ETH_ENABLE_AUTO_NEG_FOR_DUPLX | \
196 ETH_DISABLE_AUTO_NEG_FOR_FLOW_CTRL | \
197 ETH_ADV_SYMMETRIC_FLOW_CTRL | \
198 ETH_FORCE_FC_MODE_NO_PAUSE_DIS_TX | \
199 ETH_FORCE_BP_MODE_NO_JAM | \
200 BIT9 | \
201 ETH_DO_NOT_FORCE_LINK_FAIL | \
202 ETH_RETRANSMIT_16_ATTEMPTS | \
203 ETH_ENABLE_AUTO_NEG_SPEED_GMII | \
204 ETH_DTE_ADV_0 | \
205 ETH_DISABLE_AUTO_NEG_BYPASS | \
206 ETH_AUTO_NEG_NO_CHANGE | \
207 ETH_MAX_RX_PACKET_9700BYTE | \
208 ETH_CLR_EXT_LOOPBACK | \
209 ETH_SET_FULL_DUPLEX_MODE | \
210 ETH_ENABLE_FLOW_CTRL_TX_RX_IN_FULL_DUPLEX
211
212#ifndef __ASSEMBLY__
213
214typedef enum {
215 KATANA_ID_3750,
216 KATANA_ID_750I,
217 KATANA_ID_752I,
218 KATANA_ID_MAX
219} katana_id_t;
220
221#endif
222
223static inline u32
224katana_bus_freq(void __iomem *cpld_base)
225{
226 u8 bd_cfg_0;
227
228 bd_cfg_0 = in_8(cpld_base + KATANA_CPLD_BD_CFG_0);
229
230 switch (bd_cfg_0 & KATANA_CPLD_BD_CFG_0_SYSCLK_MASK) {
231 case KATANA_CPLD_BD_CFG_0_SYSCLK_200:
232 return 200000000;
233 break;
234
235 case KATANA_CPLD_BD_CFG_0_SYSCLK_166:
236 return 166666666;
237 break;
238
239 case KATANA_CPLD_BD_CFG_0_SYSCLK_133:
240 return 133333333;
241 break;
242
243 case KATANA_CPLD_BD_CFG_0_SYSCLK_100:
244 return 100000000;
245 break;
246
247 default:
248 return 133333333;
249 break;
250 }
251}
252
253#endif /* __PPC_PLATFORMS_KATANA_H */
diff --git a/arch/ppc/platforms/lantec.h b/arch/ppc/platforms/lantec.h
deleted file mode 100644
index 5e5eb6d0f6aa..000000000000
--- a/arch/ppc/platforms/lantec.h
+++ /dev/null
@@ -1,20 +0,0 @@
1/*
2 * LANTEC board specific definitions
3 *
4 * Copyright (c) 2001 Wolfgang Denk (wd@denx.de)
5 */
6
7#ifndef __MACH_LANTEC_H
8#define __MACH_LANTEC_H
9
10
11#include <asm/ppcboot.h>
12
13#define IMAP_ADDR 0xFFF00000 /* physical base address of IMMR area */
14#define IMAP_SIZE (64 * 1024) /* mapped size of IMMR area */
15
16/* We don't use the 8259.
17*/
18#define NR_8259_INTS 0
19
20#endif /* __MACH_LANTEC_H */
diff --git a/arch/ppc/platforms/lite5200.c b/arch/ppc/platforms/lite5200.c
deleted file mode 100644
index b9e9db63f65b..000000000000
--- a/arch/ppc/platforms/lite5200.c
+++ /dev/null
@@ -1,245 +0,0 @@
1/*
2 * Platform support file for the Freescale LITE5200 based on MPC52xx.
3 * A maximum of this file should be moved to syslib/mpc52xx_?????
4 * so that new platform based on MPC52xx need a minimal platform file
5 * ( avoid code duplication )
6 *
7 *
8 * Maintainer : Sylvain Munaut <tnt@246tNt.com>
9 *
10 * Based on the 2.4 code written by Kent Borg,
11 * Dale Farnsworth <dale.farnsworth@mvista.com> and
12 * Wolfgang Denk <wd@denx.de>
13 *
14 * Copyright 2004-2005 Sylvain Munaut <tnt@246tNt.com>
15 * Copyright 2003 Motorola Inc.
16 * Copyright 2003 MontaVista Software Inc.
17 * Copyright 2003 DENX Software Engineering (wd@denx.de)
18 *
19 * This file is licensed under the terms of the GNU General Public License
20 * version 2. This program is licensed "as is" without any warranty of any
21 * kind, whether express or implied.
22 */
23
24#include <linux/initrd.h>
25#include <linux/seq_file.h>
26#include <linux/kdev_t.h>
27#include <linux/root_dev.h>
28#include <linux/console.h>
29#include <linux/module.h>
30
31#include <asm/bootinfo.h>
32#include <asm/io.h>
33#include <asm/mpc52xx.h>
34#include <asm/ppc_sys.h>
35#include <asm/machdep.h>
36#include <asm/pci-bridge.h>
37
38
39extern int powersave_nap;
40
41/* Board data given by U-Boot */
42bd_t __res;
43EXPORT_SYMBOL(__res); /* For modules */
44
45
46/* ======================================================================== */
47/* Platform specific code */
48/* ======================================================================== */
49
50/* Supported PSC function in "preference" order */
51struct mpc52xx_psc_func mpc52xx_psc_functions[] = {
52 { .id = 0,
53 .func = "uart",
54 },
55 { .id = -1, /* End entry */
56 .func = NULL,
57 }
58 };
59
60
61static int
62lite5200_show_cpuinfo(struct seq_file *m)
63{
64 seq_printf(m, "machine\t\t: Freescale LITE5200\n");
65 return 0;
66}
67
68#ifdef CONFIG_PCI
69#ifdef CONFIG_LITE5200B
70static int
71lite5200_map_irq(struct pci_dev *dev, unsigned char idsel,
72 unsigned char pin)
73{
74 static char pci_irq_table[][4] =
75 /*
76 * PCI IDSEL/INTPIN->INTLINE
77 * A B C D
78 */
79 {
80 {MPC52xx_IRQ0, MPC52xx_IRQ1, MPC52xx_IRQ2, MPC52xx_IRQ3},
81 {MPC52xx_IRQ1, MPC52xx_IRQ2, MPC52xx_IRQ3, MPC52xx_IRQ0},
82 };
83
84 const long min_idsel = 24, max_idsel = 25, irqs_per_slot = 4;
85 return PCI_IRQ_TABLE_LOOKUP;
86}
87#else /* Original Lite */
88static int
89lite5200_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
90{
91 return (pin == 1) && (idsel==24) ? MPC52xx_IRQ0 : -1;
92}
93#endif
94#endif
95
96static void __init
97lite5200_setup_cpu(void)
98{
99 struct mpc52xx_gpio __iomem *gpio;
100 struct mpc52xx_intr __iomem *intr;
101
102 u32 port_config;
103 u32 intr_ctrl;
104
105 /* Map zones */
106 gpio = ioremap(MPC52xx_PA(MPC52xx_GPIO_OFFSET), MPC52xx_GPIO_SIZE);
107 intr = ioremap(MPC52xx_PA(MPC52xx_INTR_OFFSET), MPC52xx_INTR_SIZE);
108
109 if (!gpio || !intr) {
110 printk(KERN_ERR __FILE__ ": "
111 "Error while mapping GPIO/INTR during "
112 "lite5200_setup_cpu\n");
113 goto unmap_regs;
114 }
115
116 /* Get port mux config */
117 port_config = in_be32(&gpio->port_config);
118
119 /* 48Mhz internal, pin is GPIO */
120 port_config &= ~0x00800000;
121
122 /* USB port */
123 port_config &= ~0x00007000; /* Differential mode - USB1 only */
124 port_config |= 0x00001000;
125
126 /* ATA CS is on csb_4/5 */
127 port_config &= ~0x03000000;
128 port_config |= 0x01000000;
129
130 /* Commit port config */
131 out_be32(&gpio->port_config, port_config);
132
133 /* IRQ[0-3] setup */
134 intr_ctrl = in_be32(&intr->ctrl);
135 intr_ctrl &= ~0x00ff0000;
136#ifdef CONFIG_LITE5200B
137 /* IRQ[0-3] Level Active Low */
138 intr_ctrl |= 0x00ff0000;
139#else
140 /* IRQ0 Level Active Low
141 * IRQ[1-3] Level Active High */
142 intr_ctrl |= 0x00c00000;
143#endif
144 out_be32(&intr->ctrl, intr_ctrl);
145
146 /* Unmap reg zone */
147unmap_regs:
148 if (gpio) iounmap(gpio);
149 if (intr) iounmap(intr);
150}
151
152static void __init
153lite5200_setup_arch(void)
154{
155 /* CPU & Port mux setup */
156 mpc52xx_setup_cpu(); /* Generic */
157 lite5200_setup_cpu(); /* Platform specific */
158
159#ifdef CONFIG_PCI
160 /* PCI Bridge setup */
161 mpc52xx_find_bridges();
162#endif
163}
164
165void __init
166platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
167 unsigned long r6, unsigned long r7)
168{
169 /* Generic MPC52xx platform initialization */
170 /* TODO Create one and move a max of stuff in it.
171 Put this init in the syslib */
172
173 struct bi_record *bootinfo = find_bootinfo();
174
175 if (bootinfo)
176 parse_bootinfo(bootinfo);
177 else {
178 /* Load the bd_t board info structure */
179 if (r3)
180 memcpy((void*)&__res,(void*)(r3+KERNELBASE),
181 sizeof(bd_t));
182
183#ifdef CONFIG_BLK_DEV_INITRD
184 /* Load the initrd */
185 if (r4) {
186 initrd_start = r4 + KERNELBASE;
187 initrd_end = r5 + KERNELBASE;
188 }
189#endif
190
191 /* Load the command line */
192 if (r6) {
193 *(char *)(r7+KERNELBASE) = 0;
194 strcpy(cmd_line, (char *)(r6+KERNELBASE));
195 }
196 }
197
198 /* PPC Sys identification */
199 identify_ppc_sys_by_id(mfspr(SPRN_SVR));
200
201 /* BAT setup */
202 mpc52xx_set_bat();
203
204 /* No ISA bus by default */
205#ifdef CONFIG_PCI
206 isa_io_base = 0;
207 isa_mem_base = 0;
208#endif
209
210 /* Powersave */
211 /* This is provided as an example on how to do it. But you
212 need to be aware that NAP disable bus snoop and that may
213 be required for some devices to work properly, like USB ... */
214 /* powersave_nap = 1; */
215
216
217 /* Setup the ppc_md struct */
218 ppc_md.setup_arch = lite5200_setup_arch;
219 ppc_md.show_cpuinfo = lite5200_show_cpuinfo;
220 ppc_md.show_percpuinfo = NULL;
221 ppc_md.init_IRQ = mpc52xx_init_irq;
222 ppc_md.get_irq = mpc52xx_get_irq;
223
224#ifdef CONFIG_PCI
225 ppc_md.pci_map_irq = lite5200_map_irq;
226#endif
227
228 ppc_md.find_end_of_memory = mpc52xx_find_end_of_memory;
229 ppc_md.setup_io_mappings = mpc52xx_map_io;
230
231 ppc_md.restart = mpc52xx_restart;
232 ppc_md.power_off = mpc52xx_power_off;
233 ppc_md.halt = mpc52xx_halt;
234
235 /* No time keeper on the LITE5200 */
236 ppc_md.time_init = NULL;
237 ppc_md.get_rtc_time = NULL;
238 ppc_md.set_rtc_time = NULL;
239
240 ppc_md.calibrate_decr = mpc52xx_calibrate_decr;
241#ifdef CONFIG_SERIAL_TEXT_DEBUG
242 ppc_md.progress = mpc52xx_progress;
243#endif
244}
245
diff --git a/arch/ppc/platforms/lite5200.h b/arch/ppc/platforms/lite5200.h
deleted file mode 100644
index 852a18e24d0b..000000000000
--- a/arch/ppc/platforms/lite5200.h
+++ /dev/null
@@ -1,21 +0,0 @@
1/*
2 * Definitions for Freescale LITE5200 : MPC52xx Standard Development
3 * Platform board support
4 *
5 * Maintainer : Sylvain Munaut <tnt@246tNt.com>
6 *
7 * Copyright (C) 2004 Sylvain Munaut <tnt@246tNt.com>
8 *
9 * This file is licensed under the terms of the GNU General Public License
10 * version 2. This program is licensed "as is" without any warranty of any
11 * kind, whether express or implied.
12 */
13
14#ifndef __PLATFORMS_LITE5200_H__
15#define __PLATFORMS_LITE5200_H__
16
17/* Serial port used for low-level debug */
18#define MPC52xx_PF_CONSOLE_PORT 1 /* PSC1 */
19
20
21#endif /* __PLATFORMS_LITE5200_H__ */
diff --git a/arch/ppc/platforms/lopec.c b/arch/ppc/platforms/lopec.c
deleted file mode 100644
index 1e3aa6e9b6c7..000000000000
--- a/arch/ppc/platforms/lopec.c
+++ /dev/null
@@ -1,310 +0,0 @@
1/*
2 * Setup routines for the Motorola LoPEC.
3 *
4 * Author: Dan Cox
5 * Maintainer: Tom Rini <trini@kernel.crashing.org>
6 *
7 * 2001-2004 (c) MontaVista, Software, Inc. This file is licensed under
8 * the terms of the GNU General Public License version 2. This program
9 * is licensed "as is" without any warranty of any kind, whether express
10 * or implied.
11 */
12
13#include <linux/types.h>
14#include <linux/delay.h>
15#include <linux/pci_ids.h>
16#include <linux/ioport.h>
17#include <linux/init.h>
18#include <linux/seq_file.h>
19#include <linux/initrd.h>
20#include <linux/console.h>
21#include <linux/root_dev.h>
22#include <linux/pci.h>
23
24#include <asm/machdep.h>
25#include <asm/pci-bridge.h>
26#include <asm/io.h>
27#include <asm/open_pic.h>
28#include <asm/i8259.h>
29#include <asm/todc.h>
30#include <asm/bootinfo.h>
31#include <asm/mpc10x.h>
32#include <asm/hw_irq.h>
33#include <asm/prep_nvram.h>
34#include <asm/kgdb.h>
35
36/*
37 * Define all of the IRQ senses and polarities. Taken from the
38 * LoPEC Programmer's Reference Guide.
39 */
40static u_char lopec_openpic_initsenses[16] __initdata = {
41 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* IRQ 0 */
42 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* IRQ 1 */
43 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* IRQ 2 */
44 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* IRQ 3 */
45 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* IRQ 4 */
46 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* IRQ 5 */
47 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* IRQ 6 */
48 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* IRQ 7 */
49 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* IRQ 8 */
50 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* IRQ 9 */
51 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* IRQ 10 */
52 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* IRQ 11 */
53 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* IRQ 12 */
54 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* IRQ 13 */
55 (IRQ_SENSE_EDGE | IRQ_POLARITY_NEGATIVE), /* IRQ 14 */
56 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE) /* IRQ 15 */
57};
58
59static inline int __init
60lopec_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
61{
62 int irq;
63 static char pci_irq_table[][4] = {
64 {16, 0, 0, 0}, /* ID 11 - Winbond */
65 {22, 0, 0, 0}, /* ID 12 - SCSI */
66 {0, 0, 0, 0}, /* ID 13 - nothing */
67 {17, 0, 0, 0}, /* ID 14 - 82559 Ethernet */
68 {27, 0, 0, 0}, /* ID 15 - USB */
69 {23, 0, 0, 0}, /* ID 16 - PMC slot 1 */
70 {24, 0, 0, 0}, /* ID 17 - PMC slot 2 */
71 {25, 0, 0, 0}, /* ID 18 - PCI slot */
72 {0, 0, 0, 0}, /* ID 19 - nothing */
73 {0, 0, 0, 0}, /* ID 20 - nothing */
74 {0, 0, 0, 0}, /* ID 21 - nothing */
75 {0, 0, 0, 0}, /* ID 22 - nothing */
76 {0, 0, 0, 0}, /* ID 23 - nothing */
77 {0, 0, 0, 0}, /* ID 24 - PMC slot 1b */
78 {0, 0, 0, 0}, /* ID 25 - nothing */
79 {0, 0, 0, 0} /* ID 26 - PMC Slot 2b */
80 };
81 const long min_idsel = 11, max_idsel = 26, irqs_per_slot = 4;
82
83 irq = PCI_IRQ_TABLE_LOOKUP;
84 if (!irq)
85 return 0;
86
87 return irq;
88}
89
90static void __init
91lopec_setup_winbond_83553(struct pci_controller *hose)
92{
93 int devfn;
94
95 devfn = PCI_DEVFN(11,0);
96
97 /* IDE interrupt routing (primary 14, secondary 15) */
98 early_write_config_byte(hose, 0, devfn, 0x43, 0xef);
99 /* PCI interrupt routing */
100 early_write_config_word(hose, 0, devfn, 0x44, 0x0000);
101
102 /* ISA-PCI address decoder */
103 early_write_config_byte(hose, 0, devfn, 0x48, 0xf0);
104
105 /* RTC, kb, not used in PPC */
106 early_write_config_byte(hose, 0, devfn, 0x4d, 0x00);
107 early_write_config_byte(hose, 0, devfn, 0x4e, 0x04);
108 devfn = PCI_DEVFN(11, 1);
109 early_write_config_byte(hose, 0, devfn, 0x09, 0x8f);
110 early_write_config_dword(hose, 0, devfn, 0x40, 0x00ff0011);
111}
112
113static void __init
114lopec_find_bridges(void)
115{
116 struct pci_controller *hose;
117
118 hose = pcibios_alloc_controller();
119 if (!hose)
120 return;
121
122 hose->first_busno = 0;
123 hose->last_busno = 0xff;
124
125 if (mpc10x_bridge_init(hose, MPC10X_MEM_MAP_B, MPC10X_MEM_MAP_B,
126 MPC10X_MAPB_EUMB_BASE) == 0) {
127
128 hose->mem_resources[0].end = 0xffffffff;
129 lopec_setup_winbond_83553(hose);
130 hose->last_busno = pciauto_bus_scan(hose, hose->first_busno);
131 ppc_md.pci_swizzle = common_swizzle;
132 ppc_md.pci_map_irq = lopec_map_irq;
133 }
134}
135
136static int
137lopec_show_cpuinfo(struct seq_file *m)
138{
139 seq_printf(m, "machine\t\t: Motorola LoPEC\n");
140 return 0;
141}
142
143static void
144lopec_restart(char *cmd)
145{
146#define LOPEC_SYSSTAT1 0xffe00000
147 /* force a hard reset, if possible */
148 unsigned char reg = *((unsigned char *) LOPEC_SYSSTAT1);
149 reg |= 0x80;
150 *((unsigned char *) LOPEC_SYSSTAT1) = reg;
151
152 local_irq_disable();
153 while(1);
154#undef LOPEC_SYSSTAT1
155}
156
157static void
158lopec_halt(void)
159{
160 local_irq_disable();
161 while(1);
162}
163
164static void
165lopec_power_off(void)
166{
167 lopec_halt();
168}
169
170static void __init
171lopec_init_IRQ(void)
172{
173 int i;
174
175 /*
176 * Provide the open_pic code with the correct table of interrupts.
177 */
178 OpenPIC_InitSenses = lopec_openpic_initsenses;
179 OpenPIC_NumInitSenses = sizeof(lopec_openpic_initsenses);
180
181 mpc10x_set_openpic();
182
183 /* We have a cascade on OpenPIC IRQ 0, Linux IRQ 16 */
184 openpic_hookup_cascade(NUM_8259_INTERRUPTS, "82c59 cascade",
185 &i8259_irq);
186
187 /*
188 * The EPIC allows for a read in the range of 0xFEF00000 ->
189 * 0xFEFFFFFF to generate a PCI interrupt-acknowledge transaction.
190 */
191 i8259_init(0xfef00000, 0);
192}
193
194static int __init
195lopec_request_io(void)
196{
197 outb(0x00, 0x4d0);
198 outb(0xc0, 0x4d1);
199
200 request_region(0x00, 0x20, "dma1");
201 request_region(0x20, 0x20, "pic1");
202 request_region(0x40, 0x20, "timer");
203 request_region(0x80, 0x10, "dma page reg");
204 request_region(0xa0, 0x20, "pic2");
205 request_region(0xc0, 0x20, "dma2");
206
207 return 0;
208}
209
210device_initcall(lopec_request_io);
211
212static void __init
213lopec_map_io(void)
214{
215 io_block_mapping(0xf0000000, 0xf0000000, 0x10000000, _PAGE_IO);
216 io_block_mapping(0xb0000000, 0xb0000000, 0x10000000, _PAGE_IO);
217}
218
219/*
220 * Set BAT 3 to map 0xf8000000 to end of physical memory space 1-to-1.
221 */
222static __inline__ void
223lopec_set_bat(void)
224{
225 mb();
226 mtspr(SPRN_DBAT1U, 0xf8000ffe);
227 mtspr(SPRN_DBAT1L, 0xf800002a);
228 mb();
229}
230
231TODC_ALLOC();
232
233static void __init
234lopec_setup_arch(void)
235{
236
237 TODC_INIT(TODC_TYPE_MK48T37, 0, 0,
238 ioremap(0xffe80000, 0x8000), 8);
239
240 loops_per_jiffy = 100000000/HZ;
241
242 lopec_find_bridges();
243
244#ifdef CONFIG_BLK_DEV_INITRD
245 if (initrd_start)
246 ROOT_DEV = Root_RAM0;
247 else
248#elif defined(CONFIG_ROOT_NFS)
249 ROOT_DEV = Root_NFS;
250#elif defined(CONFIG_BLK_DEV_IDEDISK)
251 ROOT_DEV = Root_HDA1;
252#else
253 ROOT_DEV = Root_SDA1;
254#endif
255
256#ifdef CONFIG_PPCBUG_NVRAM
257 /* Read in NVRAM data */
258 init_prep_nvram();
259
260 /* if no bootargs, look in NVRAM */
261 if ( cmd_line[0] == '\0' ) {
262 char *bootargs;
263 bootargs = prep_nvram_get_var("bootargs");
264 if (bootargs != NULL) {
265 strcpy(cmd_line, bootargs);
266 /* again.. */
267 strcpy(boot_command_line, cmd_line);
268 }
269 }
270#endif
271}
272
273void __init
274platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
275 unsigned long r6, unsigned long r7)
276{
277 parse_bootinfo(find_bootinfo());
278 lopec_set_bat();
279
280 isa_io_base = MPC10X_MAPB_ISA_IO_BASE;
281 isa_mem_base = MPC10X_MAPB_ISA_MEM_BASE;
282 pci_dram_offset = MPC10X_MAPB_DRAM_OFFSET;
283 ISA_DMA_THRESHOLD = 0x00ffffff;
284 DMA_MODE_READ = 0x44;
285 DMA_MODE_WRITE = 0x48;
286 ppc_do_canonicalize_irqs = 1;
287
288 ppc_md.setup_arch = lopec_setup_arch;
289 ppc_md.show_cpuinfo = lopec_show_cpuinfo;
290 ppc_md.init_IRQ = lopec_init_IRQ;
291 ppc_md.get_irq = openpic_get_irq;
292
293 ppc_md.restart = lopec_restart;
294 ppc_md.power_off = lopec_power_off;
295 ppc_md.halt = lopec_halt;
296
297 ppc_md.setup_io_mappings = lopec_map_io;
298
299 ppc_md.time_init = todc_time_init;
300 ppc_md.set_rtc_time = todc_set_rtc_time;
301 ppc_md.get_rtc_time = todc_get_rtc_time;
302 ppc_md.calibrate_decr = todc_calibrate_decr;
303
304 ppc_md.nvram_read_val = todc_direct_read_val;
305 ppc_md.nvram_write_val = todc_direct_write_val;
306
307#ifdef CONFIG_SERIAL_TEXT_DEBUG
308 ppc_md.progress = gen550_progress;
309#endif
310}
diff --git a/arch/ppc/platforms/lopec.h b/arch/ppc/platforms/lopec.h
deleted file mode 100644
index d597b6878693..000000000000
--- a/arch/ppc/platforms/lopec.h
+++ /dev/null
@@ -1,39 +0,0 @@
1/*
2 * arch/ppc/platforms/lopec.h
3 *
4 * Definitions for Motorola LoPEC board.
5 *
6 * Author: Dan Cox
7 * danc@mvista.com (or, alternately, source@mvista.com)
8 *
9 * 2001 (c) MontaVista, Software, Inc. This file is licensed under
10 * the terms of the GNU General Public License version 2. This program
11 * is licensed "as is" without any warranty of any kind, whether express
12 * or implied.
13 */
14
15#ifndef __H_LOPEC_SERIAL
16#define __H_LOPEC_SERIAL
17
18#define RS_TABLE_SIZE 3
19
20#define BASE_BAUD (1843200 / 16)
21
22#ifdef CONFIG_SERIAL_DETECT_IRQ
23#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF|ASYNC_SKIP_TEST|ASYNC_AUTO_IRQ)
24#else
25#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF|ASYNC_SKIP_TEST)
26#endif
27
28#define SERIAL_PORT_DFNS \
29 { 0, BASE_BAUD, 0xffe10000, 29, STD_COM_FLAGS, \
30 iomem_base: (u8 *) 0xffe10000, \
31 io_type: SERIAL_IO_MEM }, \
32 { 0, BASE_BAUD, 0xffe11000, 20, STD_COM_FLAGS, \
33 iomem_base: (u8 *) 0xffe11000, \
34 io_type: SERIAL_IO_MEM }, \
35 { 0, BASE_BAUD, 0xffe12000, 21, STD_COM_FLAGS, \
36 iomem_base: (u8 *) 0xffe12000, \
37 io_type: SERIAL_IO_MEM }
38
39#endif
diff --git a/arch/ppc/platforms/lwmon.h b/arch/ppc/platforms/lwmon.h
deleted file mode 100644
index e63f3b07a5db..000000000000
--- a/arch/ppc/platforms/lwmon.h
+++ /dev/null
@@ -1,59 +0,0 @@
1/*
2 * Liebherr LWMON board specific definitions
3 *
4 * Copyright (c) 2001 Wolfgang Denk (wd@denx.de)
5 */
6
7#ifndef __MACH_LWMON_H
8#define __MACH_LWMON_H
9
10
11#include <asm/ppcboot.h>
12
13#define IMAP_ADDR 0xFFF00000 /* physical base address of IMMR area */
14#define IMAP_SIZE (64 * 1024) /* mapped size of IMMR area */
15
16/*-----------------------------------------------------------------------
17 * PCMCIA stuff
18 *-----------------------------------------------------------------------
19 *
20 */
21#define PCMCIA_MEM_SIZE ( 64 << 20 )
22
23#define MAX_HWIFS 1 /* overwrite default in include/asm-ppc/ide.h */
24
25/*
26 * Definitions for IDE0 Interface
27 */
28#define IDE0_BASE_OFFSET 0
29#define IDE0_DATA_REG_OFFSET (PCMCIA_MEM_SIZE + 0x320)
30#define IDE0_ERROR_REG_OFFSET (2 * PCMCIA_MEM_SIZE + 0x320 + 1)
31#define IDE0_NSECTOR_REG_OFFSET (2 * PCMCIA_MEM_SIZE + 0x320 + 2)
32#define IDE0_SECTOR_REG_OFFSET (2 * PCMCIA_MEM_SIZE + 0x320 + 3)
33#define IDE0_LCYL_REG_OFFSET (2 * PCMCIA_MEM_SIZE + 0x320 + 4)
34#define IDE0_HCYL_REG_OFFSET (2 * PCMCIA_MEM_SIZE + 0x320 + 5)
35#define IDE0_SELECT_REG_OFFSET (2 * PCMCIA_MEM_SIZE + 0x320 + 6)
36#define IDE0_STATUS_REG_OFFSET (2 * PCMCIA_MEM_SIZE + 0x320 + 7)
37#define IDE0_CONTROL_REG_OFFSET 0x0106
38#define IDE0_IRQ_REG_OFFSET 0x000A /* not used */
39
40#define IDE0_INTERRUPT 13
41
42/*
43 * Definitions for I2C devices
44 */
45#define I2C_ADDR_AUDIO 0x28 /* Audio volume control */
46#define I2C_ADDR_SYSMON 0x2E /* LM87 System Monitor */
47#define I2C_ADDR_RTC 0x51 /* PCF8563 RTC */
48#define I2C_ADDR_POWER_A 0x52 /* PCMCIA/USB power switch, channel A */
49#define I2C_ADDR_POWER_B 0x53 /* PCMCIA/USB power switch, channel B */
50#define I2C_ADDR_KEYBD 0x56 /* PIC LWE keyboard */
51#define I2C_ADDR_PICIO 0x57 /* PIC IO Expander */
52#define I2C_ADDR_EEPROM 0x58 /* EEPROM AT24C164 */
53
54
55/* We don't use the 8259.
56*/
57#define NR_8259_INTS 0
58
59#endif /* __MACH_LWMON_H */
diff --git a/arch/ppc/platforms/mbx.h b/arch/ppc/platforms/mbx.h
deleted file mode 100644
index 1cf36fa3592d..000000000000
--- a/arch/ppc/platforms/mbx.h
+++ /dev/null
@@ -1,117 +0,0 @@
1/*
2 * A collection of structures, addresses, and values associated with
3 * the Motorola MBX boards. This was originally created for the
4 * MBX860, and probably needs revisions for other boards (like the 821).
5 * When this file gets out of control, we can split it up into more
6 * meaningful pieces.
7 *
8 * Copyright (c) 1997 Dan Malek (dmalek@jlc.net)
9 */
10#ifdef __KERNEL__
11#ifndef __MACH_MBX_DEFS
12#define __MACH_MBX_DEFS
13
14#ifndef __ASSEMBLY__
15/* A Board Information structure that is given to a program when
16 * EPPC-Bug starts it up.
17 */
18typedef struct bd_info {
19 unsigned int bi_tag; /* Should be 0x42444944 "BDID" */
20 unsigned int bi_size; /* Size of this structure */
21 unsigned int bi_revision; /* revision of this structure */
22 unsigned int bi_bdate; /* EPPCbug date, i.e. 0x11061997 */
23 unsigned int bi_memstart; /* Memory start address */
24 unsigned int bi_memsize; /* Memory (end) size in bytes */
25 unsigned int bi_intfreq; /* Internal Freq, in Hz */
26 unsigned int bi_busfreq; /* Bus Freq, in Hz */
27 unsigned int bi_clun; /* Boot device controller */
28 unsigned int bi_dlun; /* Boot device logical dev */
29
30 /* These fields are not part of the board information structure
31 * provided by the boot rom. They are filled in by embed_config.c
32 * so we have the information consistent with other platforms.
33 */
34 unsigned char bi_enetaddr[6];
35 unsigned int bi_baudrate;
36} bd_t;
37
38/* Memory map for the MBX as configured by EPPC-Bug. We could reprogram
39 * The SIU and PCI bridge, and try to use larger MMU pages, but the
40 * performance gain is not measurable and it certainly complicates the
41 * generic MMU model.
42 *
43 * In a effort to minimize memory usage for embedded applications, any
44 * PCI driver or ISA driver must request or map the region required by
45 * the device. For convenience (and since we can map up to 4 Mbytes with
46 * a single page table page), the MMU initialization will map the
47 * NVRAM, Status/Control registers, CPM Dual Port RAM, and the PCI
48 * Bridge CSRs 1:1 into the kernel address space.
49 */
50#define PCI_ISA_IO_ADDR ((unsigned)0x80000000)
51#define PCI_ISA_IO_SIZE ((uint)(512 * 1024 * 1024))
52#define PCI_IDE_ADDR ((unsigned)0x81000000)
53#define PCI_ISA_MEM_ADDR ((unsigned)0xc0000000)
54#define PCI_ISA_MEM_SIZE ((uint)(512 * 1024 * 1024))
55#define PCMCIA_MEM_ADDR ((uint)0xe0000000)
56#define PCMCIA_MEM_SIZE ((uint)(64 * 1024 * 1024))
57#define PCMCIA_DMA_ADDR ((uint)0xe4000000)
58#define PCMCIA_DMA_SIZE ((uint)(64 * 1024 * 1024))
59#define PCMCIA_ATTRB_ADDR ((uint)0xe8000000)
60#define PCMCIA_ATTRB_SIZE ((uint)(64 * 1024 * 1024))
61#define PCMCIA_IO_ADDR ((uint)0xec000000)
62#define PCMCIA_IO_SIZE ((uint)(64 * 1024 * 1024))
63#define NVRAM_ADDR ((uint)0xfa000000)
64#define NVRAM_SIZE ((uint)(1 * 1024 * 1024))
65#define MBX_CSR_ADDR ((uint)0xfa100000)
66#define MBX_CSR_SIZE ((uint)(1 * 1024 * 1024))
67#define IMAP_ADDR ((uint)0xfa200000)
68#define IMAP_SIZE ((uint)(64 * 1024))
69#define PCI_CSR_ADDR ((uint)0xfa210000)
70#define PCI_CSR_SIZE ((uint)(64 * 1024))
71
72/* Map additional physical space into well known virtual addresses. Due
73 * to virtual address mapping, these physical addresses are not accessible
74 * in a 1:1 virtual to physical mapping.
75 */
76#define ISA_IO_VIRT_ADDR ((uint)0xfa220000)
77#define ISA_IO_VIRT_SIZE ((uint)64 * 1024)
78
79/* Interrupt assignments.
80 * These are defined (and fixed) by the MBX hardware implementation.
81 */
82#define POWER_FAIL_INT SIU_IRQ0 /* Power fail */
83#define TEMP_HILO_INT SIU_IRQ1 /* Temperature sensor */
84#define QSPAN_INT SIU_IRQ2 /* PCI Bridge (DMA CTLR?) */
85#define ISA_BRIDGE_INT SIU_IRQ3 /* All those PC things */
86#define COMM_L_INT SIU_IRQ6 /* MBX Comm expansion connector pin */
87#define STOP_ABRT_INT SIU_IRQ7 /* Stop/Abort header pin */
88
89/* CPM Ethernet through SCCx.
90 *
91 * Bits in parallel I/O port registers that have to be set/cleared
92 * to configure the pins for SCC1 use. The TCLK and RCLK seem unique
93 * to the MBX860 board. Any two of the four available clocks could be
94 * used, and the MPC860 cookbook manual has an example using different
95 * clock pins.
96 */
97#define PA_ENET_RXD ((ushort)0x0001)
98#define PA_ENET_TXD ((ushort)0x0002)
99#define PA_ENET_TCLK ((ushort)0x0200)
100#define PA_ENET_RCLK ((ushort)0x0800)
101#define PC_ENET_TENA ((ushort)0x0001)
102#define PC_ENET_CLSN ((ushort)0x0010)
103#define PC_ENET_RENA ((ushort)0x0020)
104
105/* Control bits in the SICR to route TCLK (CLK2) and RCLK (CLK4) to
106 * SCC1. Also, make sure GR1 (bit 24) and SC1 (bit 25) are zero.
107 */
108#define SICR_ENET_MASK ((uint)0x000000ff)
109#define SICR_ENET_CLKRT ((uint)0x0000003d)
110
111/* The MBX uses the 8259.
112*/
113#define NR_8259_INTS 16
114
115#endif /* !__ASSEMBLY__ */
116#endif /* __MACH_MBX_DEFS */
117#endif /* __KERNEL__ */
diff --git a/arch/ppc/platforms/mpc866ads_setup.c b/arch/ppc/platforms/mpc866ads_setup.c
deleted file mode 100644
index 62370f4a5a0f..000000000000
--- a/arch/ppc/platforms/mpc866ads_setup.c
+++ /dev/null
@@ -1,413 +0,0 @@
1/*arch/ppc/platforms/mpc866ads_setup.c
2 *
3 * Platform setup for the Freescale mpc866ads board
4 *
5 * Vitaly Bordug <vbordug@ru.mvista.com>
6 *
7 * Copyright 2005-2006 MontaVista Software Inc.
8 *
9 * This file is licensed under the terms of the GNU General Public License
10 * version 2. This program is licensed "as is" without any warranty of any
11 * kind, whether express or implied.
12 */
13
14#include <linux/init.h>
15#include <linux/module.h>
16#include <linux/param.h>
17#include <linux/string.h>
18#include <linux/ioport.h>
19#include <linux/device.h>
20
21#include <linux/fs_enet_pd.h>
22#include <linux/fs_uart_pd.h>
23#include <linux/mii.h>
24#include <linux/phy.h>
25
26#include <asm/delay.h>
27#include <asm/io.h>
28#include <asm/machdep.h>
29#include <asm/page.h>
30#include <asm/processor.h>
31#include <asm/system.h>
32#include <asm/time.h>
33#include <asm/ppcboot.h>
34#include <asm/8xx_immap.h>
35#include <asm/cpm1.h>
36#include <asm/ppc_sys.h>
37#include <asm/mpc8xx.h>
38
39extern unsigned char __res[];
40
41static void setup_fec1_ioports(struct fs_platform_info*);
42static void setup_scc1_ioports(struct fs_platform_info*);
43static void setup_smc1_ioports(struct fs_uart_platform_info*);
44static void setup_smc2_ioports(struct fs_uart_platform_info*);
45
46static struct fs_mii_fec_platform_info mpc8xx_mdio_fec_pdata;
47
48static struct fs_mii_fec_platform_info mpc8xx_mdio_fec_pdata;
49
50static struct fs_platform_info mpc8xx_enet_pdata[] = {
51 [fsid_fec1] = {
52 .rx_ring = 128,
53 .tx_ring = 16,
54 .rx_copybreak = 240,
55
56 .use_napi = 1,
57 .napi_weight = 17,
58
59 .init_ioports = setup_fec1_ioports,
60
61 .bus_id = "0:0f",
62 .has_phy = 1,
63 },
64 [fsid_scc1] = {
65 .rx_ring = 64,
66 .tx_ring = 8,
67 .rx_copybreak = 240,
68 .use_napi = 1,
69 .napi_weight = 17,
70
71
72 .init_ioports = setup_scc1_ioports,
73
74 .bus_id = "fixed@100:1",
75 },
76};
77
78static struct fs_uart_platform_info mpc866_uart_pdata[] = {
79 [fsid_smc1_uart] = {
80 .brg = 1,
81 .fs_no = fsid_smc1_uart,
82 .init_ioports = setup_smc1_ioports,
83 .tx_num_fifo = 4,
84 .tx_buf_size = 32,
85 .rx_num_fifo = 4,
86 .rx_buf_size = 32,
87 },
88 [fsid_smc2_uart] = {
89 .brg = 2,
90 .fs_no = fsid_smc2_uart,
91 .init_ioports = setup_smc2_ioports,
92 .tx_num_fifo = 4,
93 .tx_buf_size = 32,
94 .rx_num_fifo = 4,
95 .rx_buf_size = 32,
96 },
97};
98
99void __init board_init(void)
100{
101 volatile cpm8xx_t *cp = cpmp;
102 unsigned *bcsr_io;
103
104 bcsr_io = ioremap(BCSR1, sizeof(unsigned long));
105
106 if (bcsr_io == NULL) {
107 printk(KERN_CRIT "Could not remap BCSR1\n");
108 return;
109 }
110
111#ifdef CONFIG_SERIAL_CPM_SMC1
112 cp->cp_simode &= ~(0xe0000000 >> 17); /* brg1 */
113 clrbits32(bcsr_io,(0x80000000 >> 7));
114 cp->cp_smc[0].smc_smcm |= (SMCM_RX | SMCM_TX);
115 cp->cp_smc[0].smc_smcmr &= ~(SMCMR_REN | SMCMR_TEN);
116#else
117 setbits32(bcsr_io,(0x80000000 >> 7));
118
119 cp->cp_pbpar &= ~(0x000000c0);
120 cp->cp_pbdir |= 0x000000c0;
121 cp->cp_smc[0].smc_smcmr = 0;
122 cp->cp_smc[0].smc_smce = 0;
123#endif
124
125#ifdef CONFIG_SERIAL_CPM_SMC2
126 cp->cp_simode &= ~(0xe0000000 >> 1);
127 cp->cp_simode |= (0x20000000 >> 1); /* brg2 */
128 clrbits32(bcsr_io,(0x80000000 >> 13));
129 cp->cp_smc[1].smc_smcm |= (SMCM_RX | SMCM_TX);
130 cp->cp_smc[1].smc_smcmr &= ~(SMCMR_REN | SMCMR_TEN);
131#else
132 clrbits32(bcsr_io,(0x80000000 >> 13));
133 cp->cp_pbpar &= ~(0x00000c00);
134 cp->cp_pbdir |= 0x00000c00;
135 cp->cp_smc[1].smc_smcmr = 0;
136 cp->cp_smc[1].smc_smce = 0;
137#endif
138 iounmap(bcsr_io);
139}
140
141static void setup_fec1_ioports(struct fs_platform_info* pdata)
142{
143 immap_t *immap = (immap_t *) IMAP_ADDR;
144
145 setbits16(&immap->im_ioport.iop_pdpar, 0x1fff);
146 setbits16(&immap->im_ioport.iop_pddir, 0x1fff);
147}
148
149static void setup_scc1_ioports(struct fs_platform_info* pdata)
150{
151 immap_t *immap = (immap_t *) IMAP_ADDR;
152 unsigned *bcsr_io;
153
154 bcsr_io = ioremap(BCSR1, sizeof(unsigned long));
155
156 if (bcsr_io == NULL) {
157 printk(KERN_CRIT "Could not remap BCSR1\n");
158 return;
159 }
160
161 /* Enable the PHY.
162 */
163 clrbits32(bcsr_io,BCSR1_ETHEN);
164
165 /* Configure port A pins for Txd and Rxd.
166 */
167 /* Disable receive and transmit in case EPPC-Bug started it.
168 */
169 setbits16(&immap->im_ioport.iop_papar, PA_ENET_RXD | PA_ENET_TXD);
170 clrbits16(&immap->im_ioport.iop_padir, PA_ENET_RXD | PA_ENET_TXD);
171 clrbits16(&immap->im_ioport.iop_paodr, PA_ENET_TXD);
172
173 /* Configure port C pins to enable CLSN and RENA.
174 */
175 clrbits16(&immap->im_ioport.iop_pcpar, PC_ENET_CLSN | PC_ENET_RENA);
176 clrbits16(&immap->im_ioport.iop_pcdir, PC_ENET_CLSN | PC_ENET_RENA);
177 setbits16(&immap->im_ioport.iop_pcso, PC_ENET_CLSN | PC_ENET_RENA);
178 /* Configure port A for TCLK and RCLK.
179 */
180 setbits16(&immap->im_ioport.iop_papar, PA_ENET_TCLK | PA_ENET_RCLK);
181 clrbits16(&immap->im_ioport.iop_padir, PA_ENET_TCLK | PA_ENET_RCLK);
182 clrbits32(&immap->im_cpm.cp_pbpar, PB_ENET_TENA);
183 clrbits32(&immap->im_cpm.cp_pbdir, PB_ENET_TENA);
184
185 /* Configure Serial Interface clock routing.
186 * First, clear all SCC bits to zero, then set the ones we want.
187 */
188 clrbits32(&immap->im_cpm.cp_sicr, SICR_ENET_MASK);
189 setbits32(&immap->im_cpm.cp_sicr, SICR_ENET_CLKRT);
190
191 /* In the original SCC enet driver the following code is placed at
192 the end of the initialization */
193 setbits32(&immap->im_cpm.cp_pbpar, PB_ENET_TENA);
194 setbits32(&immap->im_cpm.cp_pbdir, PB_ENET_TENA);
195
196}
197
198static void setup_smc1_ioports(struct fs_uart_platform_info* pdata)
199{
200 immap_t *immap = (immap_t *) IMAP_ADDR;
201 unsigned *bcsr_io;
202 unsigned int iobits = 0x000000c0;
203
204 bcsr_io = ioremap(BCSR1, sizeof(unsigned long));
205
206 if (bcsr_io == NULL) {
207 printk(KERN_CRIT "Could not remap BCSR1\n");
208 return;
209 }
210
211 clrbits32(bcsr_io,BCSR1_RS232EN_1);
212 iounmap(bcsr_io);
213
214 setbits32(&immap->im_cpm.cp_pbpar, iobits);
215 clrbits32(&immap->im_cpm.cp_pbdir, iobits);
216 clrbits16(&immap->im_cpm.cp_pbodr, iobits);
217
218}
219
220static void setup_smc2_ioports(struct fs_uart_platform_info* pdata)
221{
222 immap_t *immap = (immap_t *) IMAP_ADDR;
223 unsigned *bcsr_io;
224 unsigned int iobits = 0x00000c00;
225
226 bcsr_io = ioremap(BCSR1, sizeof(unsigned long));
227
228 if (bcsr_io == NULL) {
229 printk(KERN_CRIT "Could not remap BCSR1\n");
230 return;
231 }
232
233 clrbits32(bcsr_io,BCSR1_RS232EN_2);
234
235 iounmap(bcsr_io);
236
237#ifndef CONFIG_SERIAL_CPM_ALT_SMC2
238 setbits32(&immap->im_cpm.cp_pbpar, iobits);
239 clrbits32(&immap->im_cpm.cp_pbdir, iobits);
240 clrbits16(&immap->im_cpm.cp_pbodr, iobits);
241#else
242 setbits16(&immap->im_ioport.iop_papar, iobits);
243 clrbits16(&immap->im_ioport.iop_padir, iobits);
244 clrbits16(&immap->im_ioport.iop_paodr, iobits);
245#endif
246
247}
248
249static int ma_count = 0;
250
251static void mpc866ads_fixup_enet_pdata(struct platform_device *pdev, int fs_no)
252{
253 struct fs_platform_info *fpi;
254
255 volatile cpm8xx_t *cp;
256 bd_t *bd = (bd_t *) __res;
257 char *e;
258 int i;
259
260 /* Get pointer to Communication Processor */
261 cp = cpmp;
262
263 if(fs_no >= ARRAY_SIZE(mpc8xx_enet_pdata)) {
264 printk(KERN_ERR"No network-suitable #%d device on bus", fs_no);
265 return;
266 }
267
268
269 fpi = &mpc8xx_enet_pdata[fs_no];
270 fpi->fs_no = fs_no;
271 pdev->dev.platform_data = fpi;
272
273 e = (unsigned char *)&bd->bi_enetaddr;
274 for (i = 0; i < 6; i++)
275 fpi->macaddr[i] = *e++;
276
277 fpi->macaddr[5] += ma_count++;
278}
279
280static void mpc866ads_fixup_fec_enet_pdata(struct platform_device *pdev,
281 int idx)
282{
283 /* This is for FEC devices only */
284 if (!pdev || !pdev->name || (!strstr(pdev->name, "fsl-cpm-fec")))
285 return;
286 mpc866ads_fixup_enet_pdata(pdev, fsid_fec1 + pdev->id - 1);
287}
288
289static void mpc866ads_fixup_scc_enet_pdata(struct platform_device *pdev,
290 int idx)
291{
292 /* This is for SCC devices only */
293 if (!pdev || !pdev->name || (!strstr(pdev->name, "fsl-cpm-scc")))
294 return;
295
296 mpc866ads_fixup_enet_pdata(pdev, fsid_scc1 + pdev->id - 1);
297}
298
299static void __init mpc866ads_fixup_uart_pdata(struct platform_device *pdev,
300 int idx)
301{
302 bd_t *bd = (bd_t *) __res;
303 struct fs_uart_platform_info *pinfo;
304 int num = ARRAY_SIZE(mpc866_uart_pdata);
305
306 int id = fs_uart_id_smc2fsid(idx);
307
308 /* no need to alter anything if console */
309 if ((id < num) && (!pdev->dev.platform_data)) {
310 pinfo = &mpc866_uart_pdata[id];
311 pinfo->uart_clk = bd->bi_intfreq;
312 pdev->dev.platform_data = pinfo;
313 }
314}
315
316static int mpc866ads_platform_notify(struct device *dev)
317{
318 static const struct platform_notify_dev_map dev_map[] = {
319 {
320 .bus_id = "fsl-cpm-fec",
321 .rtn = mpc866ads_fixup_fec_enet_pdata,
322 },
323 {
324 .bus_id = "fsl-cpm-scc",
325 .rtn = mpc866ads_fixup_scc_enet_pdata,
326 },
327 {
328 .bus_id = "fsl-cpm-smc:uart",
329 .rtn = mpc866ads_fixup_uart_pdata
330 },
331 {
332 .bus_id = NULL
333 }
334 };
335
336 platform_notify_map(dev_map,dev);
337
338 return 0;
339}
340
341int __init mpc866ads_init(void)
342{
343 bd_t *bd = (bd_t *) __res;
344 struct fs_mii_fec_platform_info* fmpi;
345
346 printk(KERN_NOTICE "mpc866ads: Init\n");
347
348 platform_notify = mpc866ads_platform_notify;
349
350 ppc_sys_device_initfunc();
351 ppc_sys_device_disable_all();
352
353#ifdef CONFIG_MPC8xx_SECOND_ETH_SCC1
354 ppc_sys_device_enable(MPC8xx_CPM_SCC1);
355#endif
356 ppc_sys_device_enable(MPC8xx_CPM_FEC1);
357
358 ppc_sys_device_enable(MPC8xx_MDIO_FEC);
359
360 fmpi = ppc_sys_platform_devices[MPC8xx_MDIO_FEC].dev.platform_data =
361 &mpc8xx_mdio_fec_pdata;
362
363 fmpi->mii_speed = ((((bd->bi_intfreq + 4999999) / 2500000) / 2) & 0x3F) << 1;
364 /* No PHY interrupt line here */
365 fmpi->irq[0xf] = PHY_POLL;
366
367/* Since either of the uarts could be used as console, they need to ready */
368#ifdef CONFIG_SERIAL_CPM_SMC1
369 ppc_sys_device_enable(MPC8xx_CPM_SMC1);
370 ppc_sys_device_setfunc(MPC8xx_CPM_SMC1, PPC_SYS_FUNC_UART);
371#endif
372
373#ifdef CONFIG_SERIAL_CPM_SMC2
374 ppc_sys_device_enable(MPC8xx_CPM_SMC2);
375 ppc_sys_device_setfunc(MPC8xx_CPM_SMC2, PPC_SYS_FUNC_UART);
376#endif
377 ppc_sys_device_enable(MPC8xx_MDIO_FEC);
378
379 fmpi = ppc_sys_platform_devices[MPC8xx_MDIO_FEC].dev.platform_data =
380 &mpc8xx_mdio_fec_pdata;
381
382 fmpi->mii_speed = ((((bd->bi_intfreq + 4999999) / 2500000) / 2) & 0x3F) << 1;
383 /* No PHY interrupt line here */
384 fmpi->irq[0xf] = PHY_POLL;
385
386 return 0;
387}
388
389/*
390 To prevent confusion, console selection is gross:
391 by 0 assumed SMC1 and by 1 assumed SMC2
392 */
393struct platform_device* early_uart_get_pdev(int index)
394{
395 bd_t *bd = (bd_t *) __res;
396 struct fs_uart_platform_info *pinfo;
397
398 struct platform_device* pdev = NULL;
399 if(index) { /*assume SMC2 here*/
400 pdev = &ppc_sys_platform_devices[MPC8xx_CPM_SMC2];
401 pinfo = &mpc866_uart_pdata[1];
402 } else { /*over SMC1*/
403 pdev = &ppc_sys_platform_devices[MPC8xx_CPM_SMC1];
404 pinfo = &mpc866_uart_pdata[0];
405 }
406
407 pinfo->uart_clk = bd->bi_intfreq;
408 pdev->dev.platform_data = pinfo;
409 ppc_sys_fixup_mem_resource(pdev, IMAP_ADDR);
410 return NULL;
411}
412
413arch_initcall(mpc866ads_init);
diff --git a/arch/ppc/platforms/mvme5100.c b/arch/ppc/platforms/mvme5100.c
deleted file mode 100644
index 053b54ac88f2..000000000000
--- a/arch/ppc/platforms/mvme5100.c
+++ /dev/null
@@ -1,340 +0,0 @@
1/*
2 * Board setup routines for the Motorola MVME5100.
3 *
4 * Author: Matt Porter <mporter@mvista.com>
5 *
6 * 2001-2004 (c) MontaVista, Software, Inc. This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10 */
11
12#include <linux/stddef.h>
13#include <linux/kernel.h>
14#include <linux/init.h>
15#include <linux/errno.h>
16#include <linux/pci.h>
17#include <linux/initrd.h>
18#include <linux/console.h>
19#include <linux/delay.h>
20#include <linux/seq_file.h>
21#include <linux/kdev_t.h>
22#include <linux/root_dev.h>
23
24#include <asm/system.h>
25#include <asm/pgtable.h>
26#include <asm/page.h>
27#include <asm/dma.h>
28#include <asm/io.h>
29#include <asm/machdep.h>
30#include <asm/open_pic.h>
31#include <asm/i8259.h>
32#include <asm/todc.h>
33#include <asm/pci-bridge.h>
34#include <asm/bootinfo.h>
35#include <asm/hawk.h>
36
37#include <platforms/pplus.h>
38#include <platforms/mvme5100.h>
39
40static u_char mvme5100_openpic_initsenses[16] __initdata = {
41 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* i8259 cascade */
42 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* TL16C550 UART 1,2 */
43 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Enet1 front panel or P2 */
44 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Hawk Watchdog 1,2 */
45 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* DS1621 thermal alarm */
46 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Universe II LINT0# */
47 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Universe II LINT1# */
48 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Universe II LINT2# */
49 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Universe II LINT3# */
50 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* PMC1 INTA#, PMC2 INTB# */
51 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* PMC1 INTB#, PMC2 INTC# */
52 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* PMC1 INTC#, PMC2 INTD# */
53 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* PMC1 INTD#, PMC2 INTA# */
54 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Enet 2 (front panel) */
55 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Abort Switch */
56 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* RTC Alarm */
57};
58
59static inline int
60mvme5100_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
61{
62 int irq;
63
64 static char pci_irq_table[][4] =
65 /*
66 * PCI IDSEL/INTPIN->INTLINE
67 * A B C D
68 */
69 {
70 { 0, 0, 0, 0 }, /* IDSEL 11 - Winbond */
71 { 0, 0, 0, 0 }, /* IDSEL 12 - unused */
72 { 21, 22, 23, 24 }, /* IDSEL 13 - Universe II */
73 { 18, 0, 0, 0 }, /* IDSEL 14 - Enet 1 */
74 { 0, 0, 0, 0 }, /* IDSEL 15 - unused */
75 { 25, 26, 27, 28 }, /* IDSEL 16 - PMC Slot 1 */
76 { 28, 25, 26, 27 }, /* IDSEL 17 - PMC Slot 2 */
77 { 0, 0, 0, 0 }, /* IDSEL 18 - unused */
78 { 29, 0, 0, 0 }, /* IDSEL 19 - Enet 2 */
79 { 0, 0, 0, 0 }, /* IDSEL 20 - PMCSPAN */
80 };
81
82 const long min_idsel = 11, max_idsel = 20, irqs_per_slot = 4;
83 irq = PCI_IRQ_TABLE_LOOKUP;
84 /* If lookup is zero, always return 0 */
85 if (!irq)
86 return 0;
87 else
88#ifdef CONFIG_MVME5100_IPMC761_PRESENT
89 /* If IPMC761 present, return table value */
90 return irq;
91#else
92 /* If IPMC761 not present, we don't have an i8259 so adjust */
93 return (irq - NUM_8259_INTERRUPTS);
94#endif
95}
96
97static void
98mvme5100_pcibios_fixup_resources(struct pci_dev *dev)
99{
100 int i;
101
102 if ((dev->vendor == PCI_VENDOR_ID_MOTOROLA) &&
103 (dev->device == PCI_DEVICE_ID_MOTOROLA_HAWK))
104 for (i=0; i<DEVICE_COUNT_RESOURCE; i++)
105 {
106 dev->resource[i].start = 0;
107 dev->resource[i].end = 0;
108 }
109}
110
111static void __init
112mvme5100_setup_bridge(void)
113{
114 struct pci_controller* hose;
115
116 hose = pcibios_alloc_controller();
117
118 if (!hose)
119 return;
120
121 hose->first_busno = 0;
122 hose->last_busno = 0xff;
123 hose->pci_mem_offset = MVME5100_PCI_MEM_OFFSET;
124
125 pci_init_resource(&hose->io_resource, MVME5100_PCI_LOWER_IO,
126 MVME5100_PCI_UPPER_IO, IORESOURCE_IO,
127 "PCI host bridge");
128
129 pci_init_resource(&hose->mem_resources[0], MVME5100_PCI_LOWER_MEM,
130 MVME5100_PCI_UPPER_MEM, IORESOURCE_MEM,
131 "PCI host bridge");
132
133 hose->io_space.start = MVME5100_PCI_LOWER_IO;
134 hose->io_space.end = MVME5100_PCI_UPPER_IO;
135 hose->mem_space.start = MVME5100_PCI_LOWER_MEM;
136 hose->mem_space.end = MVME5100_PCI_UPPER_MEM;
137 hose->io_base_virt = (void *)MVME5100_ISA_IO_BASE;
138
139 /* Use indirect method of Hawk */
140 setup_indirect_pci(hose, MVME5100_PCI_CONFIG_ADDR,
141 MVME5100_PCI_CONFIG_DATA);
142
143 hose->last_busno = pciauto_bus_scan(hose, hose->first_busno);
144
145 ppc_md.pcibios_fixup_resources = mvme5100_pcibios_fixup_resources;
146 ppc_md.pci_swizzle = common_swizzle;
147 ppc_md.pci_map_irq = mvme5100_map_irq;
148}
149
150static void __init
151mvme5100_setup_arch(void)
152{
153 if ( ppc_md.progress )
154 ppc_md.progress("mvme5100_setup_arch: enter", 0);
155
156 loops_per_jiffy = 50000000 / HZ;
157
158#ifdef CONFIG_BLK_DEV_INITRD
159 if (initrd_start)
160 ROOT_DEV = Root_RAM0;
161 else
162#endif
163#ifdef CONFIG_ROOT_NFS
164 ROOT_DEV = Root_NFS;
165#else
166 ROOT_DEV = Root_SDA2;
167#endif
168
169 if ( ppc_md.progress )
170 ppc_md.progress("mvme5100_setup_arch: find_bridges", 0);
171
172 /* Setup PCI host bridge */
173 mvme5100_setup_bridge();
174
175 /* Find and map our OpenPIC */
176 hawk_mpic_init(MVME5100_PCI_MEM_OFFSET);
177 OpenPIC_InitSenses = mvme5100_openpic_initsenses;
178 OpenPIC_NumInitSenses = sizeof(mvme5100_openpic_initsenses);
179
180 printk("MVME5100 port (C) 2001 MontaVista Software, Inc. (source@mvista.com)\n");
181
182 if ( ppc_md.progress )
183 ppc_md.progress("mvme5100_setup_arch: exit", 0);
184
185 return;
186}
187
188static void __init
189mvme5100_init2(void)
190{
191#ifdef CONFIG_MVME5100_IPMC761_PRESENT
192 request_region(0x00,0x20,"dma1");
193 request_region(0x20,0x20,"pic1");
194 request_region(0x40,0x20,"timer");
195 request_region(0x80,0x10,"dma page reg");
196 request_region(0xa0,0x20,"pic2");
197 request_region(0xc0,0x20,"dma2");
198#endif
199 return;
200}
201
202/*
203 * Interrupt setup and service.
204 * Have MPIC on HAWK and cascaded 8259s on Winbond cascaded to MPIC.
205 */
206static void __init
207mvme5100_init_IRQ(void)
208{
209#ifdef CONFIG_MVME5100_IPMC761_PRESENT
210 int i;
211#endif
212
213 if ( ppc_md.progress )
214 ppc_md.progress("init_irq: enter", 0);
215
216 openpic_set_sources(0, 16, OpenPIC_Addr + 0x10000);
217#ifdef CONFIG_MVME5100_IPMC761_PRESENT
218 openpic_init(NUM_8259_INTERRUPTS);
219 openpic_hookup_cascade(NUM_8259_INTERRUPTS, "82c59 cascade",
220 &i8259_irq);
221
222 i8259_init(0, 0);
223#else
224 openpic_init(0);
225#endif
226
227 if ( ppc_md.progress )
228 ppc_md.progress("init_irq: exit", 0);
229
230 return;
231}
232
233/*
234 * Set BAT 3 to map 0xf0000000 to end of physical memory space.
235 */
236static __inline__ void
237mvme5100_set_bat(void)
238{
239 mb();
240 mtspr(SPRN_DBAT1U, 0xf0001ffe);
241 mtspr(SPRN_DBAT1L, 0xf000002a);
242 mb();
243}
244
245static unsigned long __init
246mvme5100_find_end_of_memory(void)
247{
248 return hawk_get_mem_size(MVME5100_HAWK_SMC_BASE);
249}
250
251static void __init
252mvme5100_map_io(void)
253{
254 io_block_mapping(0xfe000000, 0xfe000000, 0x02000000, _PAGE_IO);
255 ioremap_base = 0xfe000000;
256}
257
258static void
259mvme5100_reset_board(void)
260{
261 local_irq_disable();
262
263 /* Set exception prefix high - to the firmware */
264 _nmask_and_or_msr(0, MSR_IP);
265
266 out_8((u_char *)MVME5100_BOARD_MODRST_REG, 0x01);
267
268 return;
269}
270
271static void
272mvme5100_restart(char *cmd)
273{
274 volatile ulong i = 10000000;
275
276 mvme5100_reset_board();
277
278 while (i-- > 0);
279 panic("restart failed\n");
280}
281
282static void
283mvme5100_halt(void)
284{
285 local_irq_disable();
286 while (1);
287}
288
289static void
290mvme5100_power_off(void)
291{
292 mvme5100_halt();
293}
294
295static int
296mvme5100_show_cpuinfo(struct seq_file *m)
297{
298 seq_printf(m, "vendor\t\t: Motorola\n");
299 seq_printf(m, "machine\t\t: MVME5100\n");
300
301 return 0;
302}
303
304TODC_ALLOC();
305
306void __init
307platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
308 unsigned long r6, unsigned long r7)
309{
310 parse_bootinfo(find_bootinfo());
311 mvme5100_set_bat();
312
313 isa_io_base = MVME5100_ISA_IO_BASE;
314 isa_mem_base = MVME5100_ISA_MEM_BASE;
315 pci_dram_offset = MVME5100_PCI_DRAM_OFFSET;
316
317 ppc_md.setup_arch = mvme5100_setup_arch;
318 ppc_md.show_cpuinfo = mvme5100_show_cpuinfo;
319 ppc_md.init_IRQ = mvme5100_init_IRQ;
320 ppc_md.get_irq = openpic_get_irq;
321 ppc_md.init = mvme5100_init2;
322
323 ppc_md.restart = mvme5100_restart;
324 ppc_md.power_off = mvme5100_power_off;
325 ppc_md.halt = mvme5100_halt;
326
327 ppc_md.find_end_of_memory = mvme5100_find_end_of_memory;
328 ppc_md.setup_io_mappings = mvme5100_map_io;
329
330 TODC_INIT(TODC_TYPE_MK48T37, MVME5100_NVRAM_AS0, MVME5100_NVRAM_AS1,
331 MVME5100_NVRAM_DATA, 8);
332
333 ppc_md.time_init = todc_time_init;
334 ppc_md.set_rtc_time = todc_set_rtc_time;
335 ppc_md.get_rtc_time = todc_get_rtc_time;
336 ppc_md.calibrate_decr = todc_calibrate_decr;
337
338 ppc_md.nvram_read_val = todc_m48txx_read_val;
339 ppc_md.nvram_write_val = todc_m48txx_write_val;
340}
diff --git a/arch/ppc/platforms/mvme5100.h b/arch/ppc/platforms/mvme5100.h
deleted file mode 100644
index fbb5495165c7..000000000000
--- a/arch/ppc/platforms/mvme5100.h
+++ /dev/null
@@ -1,91 +0,0 @@
1/*
2 * arch/ppc/platforms/mvme5100.h
3 *
4 * Definitions for Motorola MVME5100.
5 *
6 * Author: Matt Porter <mporter@mvista.com>
7 *
8 * 2001 (c) MontaVista, Software, Inc. This file is licensed under
9 * the terms of the GNU General Public License version 2. This program
10 * is licensed "as is" without any warranty of any kind, whether express
11 * or implied.
12 */
13
14#ifdef __KERNEL__
15#ifndef __ASM_MVME5100_H__
16#define __ASM_MVME5100_H__
17
18#define MVME5100_HAWK_SMC_BASE 0xfef80000
19
20#define MVME5100_PCI_CONFIG_ADDR 0xfe000cf8
21#define MVME5100_PCI_CONFIG_DATA 0xfe000cfc
22
23#define MVME5100_PCI_IO_BASE 0xfe000000
24#define MVME5100_PCI_MEM_BASE 0x80000000
25
26#define MVME5100_PCI_MEM_OFFSET 0x00000000
27
28#define MVME5100_PCI_DRAM_OFFSET 0x00000000
29#define MVME5100_ISA_MEM_BASE 0x00000000
30#define MVME5100_ISA_IO_BASE MVME5100_PCI_IO_BASE
31
32#define MVME5100_PCI_LOWER_MEM 0x80000000
33#define MVME5100_PCI_UPPER_MEM 0xf3f7ffff
34#define MVME5100_PCI_LOWER_IO 0x00000000
35#define MVME5100_PCI_UPPER_IO 0x0077ffff
36
37/* MVME5100 board register addresses. */
38#define MVME5100_BOARD_STATUS_REG 0xfef88080
39#define MVME5100_BOARD_MODFAIL_REG 0xfef88090
40#define MVME5100_BOARD_MODRST_REG 0xfef880a0
41#define MVME5100_BOARD_TBEN_REG 0xfef880c0
42#define MVME5100_BOARD_SW_READ_REG 0xfef880e0
43#define MVME5100_BOARD_GEO_ADDR_REG 0xfef880e8
44#define MVME5100_BOARD_EXT_FEATURE1_REG 0xfef880f0
45#define MVME5100_BOARD_EXT_FEATURE2_REG 0xfef88100
46
47/* Define the NVRAM/RTC address strobe & data registers */
48#define MVME5100_PHYS_NVRAM_AS0 0xfef880c8
49#define MVME5100_PHYS_NVRAM_AS1 0xfef880d0
50#define MVME5100_PHYS_NVRAM_DATA 0xfef880d8
51
52#define MVME5100_NVRAM_AS0 (MVME5100_PHYS_NVRAM_AS0 - MVME5100_ISA_IO_BASE)
53#define MVME5100_NVRAM_AS1 (MVME5100_PHYS_NVRAM_AS1 - MVME5100_ISA_IO_BASE)
54#define MVME5100_NVRAM_DATA (MVME5100_PHYS_NVRAM_DATA - MVME5100_ISA_IO_BASE)
55
56/* UART clock, addresses, and irq */
57#define MVME5100_BASE_BAUD 1843200
58#define MVME5100_SERIAL_1 0xfef88000
59#define MVME5100_SERIAL_2 0xfef88200
60#ifdef CONFIG_MVME5100_IPMC761_PRESENT
61#define MVME5100_SERIAL_IRQ 17
62#else
63#define MVME5100_SERIAL_IRQ 1
64#endif
65
66#define RS_TABLE_SIZE 4
67
68#define BASE_BAUD ( MVME5100_BASE_BAUD / 16 )
69
70#define STD_COM_FLAGS ASYNC_BOOT_AUTOCONF
71
72/* All UART IRQs are wire-OR'd to one MPIC IRQ */
73#define STD_SERIAL_PORT_DFNS \
74 { 0, BASE_BAUD, MVME5100_SERIAL_1, \
75 MVME5100_SERIAL_IRQ, \
76 STD_COM_FLAGS, /* ttyS0 */ \
77 iomem_base: (unsigned char *)MVME5100_SERIAL_1, \
78 iomem_reg_shift: 4, \
79 io_type: SERIAL_IO_MEM }, \
80 { 0, BASE_BAUD, MVME5100_SERIAL_2, \
81 MVME5100_SERIAL_IRQ, \
82 STD_COM_FLAGS, /* ttyS1 */ \
83 iomem_base: (unsigned char *)MVME5100_SERIAL_2, \
84 iomem_reg_shift: 4, \
85 io_type: SERIAL_IO_MEM },
86
87#define SERIAL_PORT_DFNS \
88 STD_SERIAL_PORT_DFNS
89
90#endif /* __ASM_MVME5100_H__ */
91#endif /* __KERNEL__ */
diff --git a/arch/ppc/platforms/pal4.h b/arch/ppc/platforms/pal4.h
deleted file mode 100644
index 8569c423d887..000000000000
--- a/arch/ppc/platforms/pal4.h
+++ /dev/null
@@ -1,40 +0,0 @@
1/*
2 * Definitions for SBS Palomar IV board
3 *
4 * Author: Dan Cox
5 *
6 * 2002 (c) MontaVista, Software, Inc. This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10 */
11
12#ifndef __PPC_PLATFORMS_PAL4_H
13#define __PPC_PLATFORMS_PAL4_H
14
15#define PAL4_NVRAM 0xfffc0000
16#define PAL4_NVRAM_SIZE 0x8000
17
18#define PAL4_DRAM 0xfff80000
19#define PAL4_DRAM_BR_MASK 0xc0
20#define PAL4_DRAM_BR_SHIFT 6
21#define PAL4_DRAM_RESET 0x10
22#define PAL4_DRAM_EREADY 0x40
23
24#define PAL4_MISC 0xfff80004
25#define PAL4_MISC_FB_MASK 0xc0
26#define PAL4_MISC_FLASH 0x20 /* StratFlash mapping: 1->0xff80, 0->0xfff0 */
27#define PAL4_MISC_MISC 0x08
28#define PAL4_MISC_BITF 0x02
29#define PAL4_MISC_NVKS 0x01
30
31#define PAL4_L2 0xfff80008
32#define PAL4_L2_MASK 0x07
33
34#define PAL4_PLDR 0xfff8000c
35
36/* Only two Ethernet devices on the board... */
37#define PAL4_ETH 31
38#define PAL4_INTA 20
39
40#endif /* __PPC_PLATFORMS_PAL4_H */
diff --git a/arch/ppc/platforms/pal4_pci.c b/arch/ppc/platforms/pal4_pci.c
deleted file mode 100644
index d81ae1c7e1cf..000000000000
--- a/arch/ppc/platforms/pal4_pci.c
+++ /dev/null
@@ -1,75 +0,0 @@
1/*
2 * PCI support for SBS Palomar IV
3 *
4 * Author: Dan Cox
5 *
6 * 2002 (c) MontaVista, Software, Inc. This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10 */
11
12#include <linux/kernel.h>
13#include <linux/init.h>
14#include <linux/pci.h>
15
16#include <asm/byteorder.h>
17#include <asm/machdep.h>
18#include <asm/io.h>
19#include <asm/pci-bridge.h>
20#include <asm/uaccess.h>
21
22#include <syslib/cpc700.h>
23
24#include "pal4.h"
25
26/* not much to this.... */
27static inline int __init
28pal4_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
29{
30 if (idsel == 9)
31 return PAL4_ETH;
32 else
33 return PAL4_INTA + (idsel - 3);
34}
35
36void __init
37pal4_find_bridges(void)
38{
39 struct pci_controller *hose;
40
41 hose = pcibios_alloc_controller();
42 if (!hose)
43 return;
44
45 hose->first_busno = 0;
46 hose->last_busno = 0xff;
47 hose->pci_mem_offset = 0;
48
49 /* Could snatch these from the CPC700.... */
50 pci_init_resource(&hose->io_resource,
51 0x0,
52 0x03ffffff,
53 IORESOURCE_IO,
54 "PCI host bridge");
55
56 pci_init_resource(&hose->mem_resources[0],
57 0x90000000,
58 0x9fffffff,
59 IORESOURCE_MEM,
60 "PCI host bridge");
61
62 hose->io_space.start = 0x00800000;
63 hose->io_space.end = 0x03ffffff;
64 hose->mem_space.start = 0x90000000;
65 hose->mem_space.end = 0x9fffffff;
66 hose->io_base_virt = (void *) 0xf8000000;
67
68 setup_indirect_pci(hose, CPC700_PCI_CONFIG_ADDR,
69 CPC700_PCI_CONFIG_DATA);
70
71 hose->last_busno = pciauto_bus_scan(hose, hose->first_busno);
72
73 ppc_md.pci_swizzle = common_swizzle;
74 ppc_md.pci_map_irq = pal4_map_irq;
75}
diff --git a/arch/ppc/platforms/pal4_serial.h b/arch/ppc/platforms/pal4_serial.h
deleted file mode 100644
index a75343224cfd..000000000000
--- a/arch/ppc/platforms/pal4_serial.h
+++ /dev/null
@@ -1,37 +0,0 @@
1/*
2 * Definitions for SBS PalomarIV serial support
3 *
4 * Author: Dan Cox
5 *
6 * 2002 (c) MontaVista, Software, Inc. This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10 */
11
12#ifndef __PPC_PAL4_SERIAL_H
13#define __PPC_PAL4_SERIAL_H
14
15#define CPC700_SERIAL_1 0xff600300
16#define CPC700_SERIAL_2 0xff600400
17
18#define RS_TABLE_SIZE 2
19#define BASE_BAUD (33333333 / 4 / 16)
20
21#ifdef CONFIG_SERIAL_DETECT_IRQ
22#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF|ASYNC_SKIP_TEST|ASYNC_AUTO_IRQ)
23#define STD_COM4_FLAGS (ASYNC_BOOT_AUTOCONF|ASYNC_AUTO_IRQ)
24#else
25#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF|ASYNC_SKIP_TEST)
26#define STD_COM4_FLAGS (ASYNC_BOOT_AUTOCONF)
27#endif
28
29#define SERIAL_PORT_DFNS \
30 {0, BASE_BAUD, CPC700_SERIAL_1, 3, STD_COM_FLAGS, \
31 iomem_base: (unsigned char *) CPC700_SERIAL_1, \
32 io_type: SERIAL_IO_MEM}, /* ttyS0 */ \
33 {0, BASE_BAUD, CPC700_SERIAL_2, 4, STD_COM_FLAGS, \
34 iomem_base: (unsigned char *) CPC700_SERIAL_2, \
35 io_type: SERIAL_IO_MEM}
36
37#endif
diff --git a/arch/ppc/platforms/pal4_setup.c b/arch/ppc/platforms/pal4_setup.c
deleted file mode 100644
index 3da47d9ec7a2..000000000000
--- a/arch/ppc/platforms/pal4_setup.c
+++ /dev/null
@@ -1,173 +0,0 @@
1/*
2 * Board setup routines for the SBS PalomarIV.
3 *
4 * Author: Dan Cox
5 *
6 * 2002 (c) MontaVista, Software, Inc. This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10 */
11
12#include <linux/kernel.h>
13#include <linux/init.h>
14#include <linux/types.h>
15#include <linux/errno.h>
16#include <linux/reboot.h>
17#include <linux/time.h>
18#include <linux/irq.h>
19#include <linux/kdev_t.h>
20#include <linux/initrd.h>
21#include <linux/console.h>
22#include <linux/seq_file.h>
23#include <linux/root_dev.h>
24
25#include <asm/io.h>
26#include <asm/todc.h>
27#include <asm/bootinfo.h>
28#include <asm/machdep.h>
29
30#include <syslib/cpc700.h>
31
32#include "pal4.h"
33
34extern void pal4_find_bridges(void);
35
36unsigned int cpc700_irq_assigns[][2] = {
37 {1, 1}, /* IRQ 0: ECC correctable error */
38 {1, 1}, /* IRQ 1: PCI write to memory range */
39 {0, 1}, /* IRQ 2: PCI write to command register */
40 {0, 1}, /* IRQ 3: UART 0 */
41 {0, 1}, /* IRQ 4: UART 1 */
42 {0, 1}, /* IRQ 5: ICC 0 */
43 {0, 1}, /* IRQ 6: ICC 1 */
44 {0, 1}, /* IRQ 7: GPT compare 0 */
45 {0, 1}, /* IRQ 8: GPT compare 1 */
46 {0, 1}, /* IRQ 9: GPT compare 2 */
47 {0, 1}, /* IRQ 10: GPT compare 3 */
48 {0, 1}, /* IRQ 11: GPT compare 4 */
49 {0, 1}, /* IRQ 12: GPT capture 0 */
50 {0, 1}, /* IRQ 13: GPT capture 1 */
51 {0, 1}, /* IRQ 14: GPT capture 2 */
52 {0, 1}, /* IRQ 15: GPT capture 3 */
53 {0, 1}, /* IRQ 16: GPT capture 4 */
54 {0, 0}, /* IRQ 17: reserved */
55 {0, 0}, /* IRQ 18: reserved */
56 {0, 0}, /* IRQ 19: reserved */
57 {0, 0}, /* IRQ 20: reserved */
58 {0, 1}, /* IRQ 21: Ethernet */
59 {0, 0}, /* IRQ 22: reserved */
60 {0, 0}, /* IRQ 23: reserved */
61 {0, 0}, /* IRQ 24: resreved */
62 {0, 0}, /* IRQ 25: reserved */
63 {0, 0}, /* IRQ 26: reserved */
64 {0, 0}, /* IRQ 27: reserved */
65 {0, 0}, /* IRQ 28: reserved */
66 {0, 0}, /* IRQ 29: reserved */
67 {0, 0}, /* IRQ 30: reserved */
68 {0, 0}, /* IRQ 31: reserved */
69};
70
71static int
72pal4_show_cpuinfo(struct seq_file *m)
73{
74 seq_printf(m, "board\t\t: SBS Palomar IV\n");
75
76 return 0;
77}
78
79static void
80pal4_restart(char *cmd)
81{
82 local_irq_disable();
83 __asm__ __volatile__("lis 3,0xfff0\n \
84 ori 3,3,0x100\n \
85 mtspr 26,3\n \
86 li 3,0\n \
87 mtspr 27,3\n \
88 rfi");
89
90 for(;;);
91}
92
93static void
94pal4_power_off(void)
95{
96 local_irq_disable();
97 for(;;);
98}
99
100static void
101pal4_halt(void)
102{
103 pal4_power_off();
104}
105
106TODC_ALLOC();
107
108static void __init
109pal4_setup_arch(void)
110{
111 unsigned long l2;
112
113 TODC_INIT(TODC_TYPE_MK48T37, 0, 0,
114 ioremap(PAL4_NVRAM, PAL4_NVRAM_SIZE), 8);
115
116 pal4_find_bridges();
117
118#ifdef CONFIG_BLK_DEV_INITRD
119 if (initrd_start)
120 ROOT_DEV = Root_RAM0;
121 else
122#endif
123 ROOT_DEV = Root_NFS;
124
125 /* The L2 gets disabled in the bootloader, but all the proper
126 bits should be present from the fw, so just re-enable it */
127 l2 = _get_L2CR();
128 if (!(l2 & L2CR_L2E)) {
129 /* presume that it was initially set if the size is
130 still present. */
131 if (l2 ^ L2CR_L2SIZ_MASK)
132 _set_L2CR(l2 | L2CR_L2E);
133 else
134 printk("L2 not set by firmware; left disabled.\n");
135 }
136}
137
138static void __init
139pal4_map_io(void)
140{
141 io_block_mapping(0xf0000000, 0xf0000000, 0x10000000, _PAGE_IO);
142}
143
144void __init
145platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
146 unsigned long r6, unsigned long r7)
147{
148 parse_bootinfo(find_bootinfo());
149
150 isa_io_base = 0 /*PAL4_ISA_IO_BASE*/;
151 pci_dram_offset = 0 /*PAL4_PCI_SYS_MEM_BASE*/;
152
153 ppc_md.setup_arch = pal4_setup_arch;
154 ppc_md.show_cpuinfo = pal4_show_cpuinfo;
155
156 ppc_md.setup_io_mappings = pal4_map_io;
157
158 ppc_md.init_IRQ = cpc700_init_IRQ;
159 ppc_md.get_irq = cpc700_get_irq;
160
161 ppc_md.restart = pal4_restart;
162 ppc_md.halt = pal4_halt;
163 ppc_md.power_off = pal4_power_off;
164
165 ppc_md.time_init = todc_time_init;
166 ppc_md.set_rtc_time = todc_set_rtc_time;
167 ppc_md.get_rtc_time = todc_get_rtc_time;
168 ppc_md.calibrate_decr = todc_calibrate_decr;
169
170 ppc_md.nvram_read_val = todc_direct_read_val;
171 ppc_md.nvram_write_val = todc_direct_write_val;
172}
173
diff --git a/arch/ppc/platforms/pcu_e.h b/arch/ppc/platforms/pcu_e.h
deleted file mode 100644
index a2c03a22875e..000000000000
--- a/arch/ppc/platforms/pcu_e.h
+++ /dev/null
@@ -1,27 +0,0 @@
1/*
2 * Siemens PCU E board specific definitions
3 *
4 * Copyright (c) 2001 Wolfgang Denk (wd@denx.de)
5 */
6
7#ifndef __MACH_PCU_E_H
8#define __MACH_PCU_E_H
9
10
11#include <asm/ppcboot.h>
12
13#define PCU_E_IMMR_BASE 0xFE000000 /* phys. addr of IMMR */
14#define PCU_E_IMAP_SIZE (64 * 1024) /* size of mapped area */
15
16#define IMAP_ADDR PCU_E_IMMR_BASE /* physical base address of IMMR area */
17#define IMAP_SIZE PCU_E_IMAP_SIZE /* mapped size of IMMR area */
18
19#define FEC_INTERRUPT 15 /* = SIU_LEVEL7 */
20#define DEC_INTERRUPT 13 /* = SIU_LEVEL6 */
21#define CPM_INTERRUPT 11 /* = SIU_LEVEL5 (was: SIU_LEVEL2) */
22
23/* We don't use the 8259.
24*/
25#define NR_8259_INTS 0
26
27#endif /* __MACH_PCU_E_H */
diff --git a/arch/ppc/platforms/powerpmc250.c b/arch/ppc/platforms/powerpmc250.c
deleted file mode 100644
index 162dc85ff7be..000000000000
--- a/arch/ppc/platforms/powerpmc250.c
+++ /dev/null
@@ -1,378 +0,0 @@
1/*
2 * Board setup routines for Force PowerPMC-250 Processor PMC
3 *
4 * Author: Troy Benjegerdes <tbenjegerdes@mvista.com>
5 * Borrowed heavily from prpmc750_*.c by
6 * Matt Porter <mporter@mvista.com>
7 *
8 * 2001 (c) MontaVista, Software, Inc. This file is licensed under
9 * the terms of the GNU General Public License version 2. This program
10 * is licensed "as is" without any warranty of any kind, whether express
11 * or implied.
12 */
13
14#include <linux/stddef.h>
15#include <linux/kernel.h>
16#include <linux/init.h>
17#include <linux/errno.h>
18#include <linux/reboot.h>
19#include <linux/pci.h>
20#include <linux/kdev_t.h>
21#include <linux/types.h>
22#include <linux/major.h>
23#include <linux/initrd.h>
24#include <linux/console.h>
25#include <linux/delay.h>
26#include <linux/slab.h>
27#include <linux/seq_file.h>
28#include <linux/root_dev.h>
29
30#include <asm/byteorder.h>
31#include <asm/system.h>
32#include <asm/pgtable.h>
33#include <asm/page.h>
34#include <asm/dma.h>
35#include <asm/io.h>
36#include <asm/irq.h>
37#include <asm/machdep.h>
38#include <asm/time.h>
39#include <platforms/powerpmc250.h>
40#include <asm/open_pic.h>
41#include <asm/pci-bridge.h>
42#include <asm/mpc10x.h>
43#include <asm/uaccess.h>
44#include <asm/bootinfo.h>
45
46extern void powerpmc250_find_bridges(void);
47extern unsigned long loops_per_jiffy;
48
49static u_char powerpmc250_openpic_initsenses[] __initdata =
50{
51 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
52 1, /* PMC INTA (also MPC107 output interrupt INTA) */
53 1, /* PMC INTB (also I82559 Ethernet controller) */
54 1, /* PMC INTC */
55 1, /* PMC INTD */
56 0, /* DUART interrupt (active high) */
57};
58
59static int
60powerpmc250_show_cpuinfo(struct seq_file *m)
61{
62 seq_printf(m,"machine\t\t: Force PowerPMC250\n");
63
64 return 0;
65}
66
67static void __init
68powerpmc250_setup_arch(void)
69{
70 /* init to some ~sane value until calibrate_delay() runs */
71 loops_per_jiffy = 50000000/HZ;
72
73 /* Lookup PCI host bridges */
74 powerpmc250_find_bridges();
75
76#ifdef CONFIG_BLK_DEV_INITRD
77 if (initrd_start)
78 ROOT_DEV = Root_RAM0;
79 else
80#endif
81#ifdef CONFIG_ROOT_NFS
82 ROOT_DEV = Root_NFS;
83#else
84 ROOT_DEV = Root_SDA2;
85#endif
86
87 printk("Force PowerPMC250 port (C) 2001 MontaVista Software, Inc. (source@mvista.com)\n");
88}
89
90#if 0
91/*
92 * Compute the PrPMC750's bus speed using the baud clock as a
93 * reference.
94 */
95unsigned long __init powerpmc250_get_bus_speed(void)
96{
97 unsigned long tbl_start, tbl_end;
98 unsigned long current_state, old_state, bus_speed;
99 unsigned char lcr, dll, dlm;
100 int baud_divisor, count;
101
102 /* Read the UART's baud clock divisor */
103 lcr = readb(PRPMC750_SERIAL_0_LCR);
104 writeb(lcr | UART_LCR_DLAB, PRPMC750_SERIAL_0_LCR);
105 dll = readb(PRPMC750_SERIAL_0_DLL);
106 dlm = readb(PRPMC750_SERIAL_0_DLM);
107 writeb(lcr & ~UART_LCR_DLAB, PRPMC750_SERIAL_0_LCR);
108 baud_divisor = (dlm << 8) | dll;
109
110 /*
111 * Use the baud clock divisor and base baud clock
112 * to determine the baud rate and use that as
113 * the number of baud clock edges we use for
114 * the time base sample. Make it half the baud
115 * rate.
116 */
117 count = PRPMC750_BASE_BAUD / (baud_divisor * 16);
118
119 /* Find the first edge of the baud clock */
120 old_state = readb(PRPMC750_STATUS_REG) & PRPMC750_BAUDOUT_MASK;
121 do {
122 current_state = readb(PRPMC750_STATUS_REG) &
123 PRPMC750_BAUDOUT_MASK;
124 } while(old_state == current_state);
125
126 old_state = current_state;
127
128 /* Get the starting time base value */
129 tbl_start = get_tbl();
130
131 /*
132 * Loop until we have found a number of edges equal
133 * to half the count (half the baud rate)
134 */
135 do {
136 do {
137 current_state = readb(PRPMC750_STATUS_REG) &
138 PRPMC750_BAUDOUT_MASK;
139 } while(old_state == current_state);
140 old_state = current_state;
141 } while (--count);
142
143 /* Get the ending time base value */
144 tbl_end = get_tbl();
145
146 /* Compute bus speed */
147 bus_speed = (tbl_end-tbl_start)*128;
148
149 return bus_speed;
150}
151#endif
152
153static void __init
154powerpmc250_calibrate_decr(void)
155{
156 unsigned long freq;
157 int divisor = 4;
158
159 //freq = powerpmc250_get_bus_speed();
160#warning hardcoded bus freq
161 freq = 100000000;
162
163 tb_ticks_per_jiffy = freq / (HZ * divisor);
164 tb_to_us = mulhwu_scale_factor(freq/divisor, 1000000);
165}
166
167static void
168powerpmc250_restart(char *cmd)
169{
170 local_irq_disable();
171 /* Hard reset */
172 writeb(0x11, 0xfe000332);
173 while(1);
174}
175
176static void
177powerpmc250_halt(void)
178{
179 local_irq_disable();
180 while (1);
181}
182
183static void
184powerpmc250_power_off(void)
185{
186 powerpmc250_halt();
187}
188
189static void __init
190powerpmc250_init_IRQ(void)
191{
192
193 OpenPIC_InitSenses = powerpmc250_openpic_initsenses;
194 OpenPIC_NumInitSenses = sizeof(powerpmc250_openpic_initsenses);
195 mpc10x_set_openpic();
196}
197
198/*
199 * Set BAT 3 to map 0xf0000000 to end of physical memory space.
200 */
201static __inline__ void
202powerpmc250_set_bat(void)
203{
204 unsigned long bat3u, bat3l;
205 static int mapping_set = 0;
206
207 if (!mapping_set)
208 {
209 __asm__ __volatile__(
210 " lis %0,0xf000\n \
211 ori %1,%0,0x002a\n \
212 ori %0,%0,0x1ffe\n \
213 mtspr 0x21e,%0\n \
214 mtspr 0x21f,%1\n \
215 isync\n \
216 sync "
217 : "=r" (bat3u), "=r" (bat3l));
218
219 mapping_set = 1;
220 }
221 return;
222}
223
224static unsigned long __init
225powerpmc250_find_end_of_memory(void)
226{
227 /* Cover I/O space with a BAT */
228 /* yuck, better hope your ram size is a power of 2 -- paulus */
229 powerpmc250_set_bat();
230
231 return mpc10x_get_mem_size(MPC10X_MEM_MAP_B);
232}
233
234static void __init
235powerpmc250_map_io(void)
236{
237 io_block_mapping(0xfe000000, 0xfe000000, 0x02000000, _PAGE_IO);
238}
239
240void __init
241platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
242 unsigned long r6, unsigned long r7)
243{
244 parse_bootinfo(find_bootinfo());
245
246#ifdef CONFIG_BLK_DEV_INITRD
247 if ( r4 )
248 {
249 initrd_start = r4 + KERNELBASE;
250 initrd_end = r5 + KERNELBASE;
251 }
252#endif
253
254 /* Copy cmd_line parameters */
255 if ( r6)
256 {
257 *(char *)(r7 + KERNELBASE) = 0;
258 strcpy(cmd_line, (char *)(r6 + KERNELBASE));
259 }
260
261 isa_io_base = MPC10X_MAPB_ISA_IO_BASE;
262 isa_mem_base = MPC10X_MAPB_ISA_MEM_BASE;
263 pci_dram_offset = MPC10X_MAPB_DRAM_OFFSET;
264
265 ppc_md.setup_arch = powerpmc250_setup_arch;
266 ppc_md.show_cpuinfo = powerpmc250_show_cpuinfo;
267 ppc_md.init_IRQ = powerpmc250_init_IRQ;
268 ppc_md.get_irq = openpic_get_irq;
269
270 ppc_md.find_end_of_memory = powerpmc250_find_end_of_memory;
271 ppc_md.setup_io_mappings = powerpmc250_map_io;
272
273 ppc_md.restart = powerpmc250_restart;
274 ppc_md.power_off = powerpmc250_power_off;
275 ppc_md.halt = powerpmc250_halt;
276
277 /* PowerPMC250 has no timekeeper part */
278 ppc_md.time_init = NULL;
279 ppc_md.get_rtc_time = NULL;
280 ppc_md.set_rtc_time = NULL;
281 ppc_md.calibrate_decr = powerpmc250_calibrate_decr;
282}
283
284
285/*
286 * (This used to be arch/ppc/platforms/powerpmc250_pci.c)
287 *
288 * PCI support for Force PowerPMC250
289 *
290 */
291
292#undef DEBUG
293#ifdef DEBUG
294#define DBG(x...) printk(x)
295#else
296#define DBG(x...)
297#endif /* DEBUG */
298
299static inline int __init
300powerpmc250_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
301{
302 static char pci_irq_table[][4] =
303 /*
304 * PCI IDSEL/INTPIN->INTLINE
305 * A B C D
306 */
307 {
308 {17, 0, 0, 0}, /* Device 11 - 82559 */
309 {0, 0, 0, 0}, /* 12 */
310 {0, 0, 0, 0}, /* 13 */
311 {0, 0, 0, 0}, /* 14 */
312 {0, 0, 0, 0}, /* 15 */
313 {16, 17, 18, 19}, /* Device 16 - PMC A1?? */
314 };
315 const long min_idsel = 11, max_idsel = 16, irqs_per_slot = 4;
316 return PCI_IRQ_TABLE_LOOKUP;
317};
318
319static int
320powerpmc250_exclude_device(u_char bus, u_char devfn)
321{
322 /*
323 * While doing PCI Scan the MPC107 will 'detect' itself as
324 * device on the PCI Bus, will create an incorrect response and
325 * later will respond incorrectly to Configuration read coming
326 * from another device.
327 *
328 * The work around is that when doing a PCI Scan one
329 * should skip its own device number in the scan.
330 *
331 * The top IDsel is AD13 and the middle is AD14.
332 *
333 * -- Note from force
334 */
335
336 if ((bus == 0) && (PCI_SLOT(devfn) == 13 || PCI_SLOT(devfn) == 14)) {
337 return PCIBIOS_DEVICE_NOT_FOUND;
338 }
339 else {
340 return PCIBIOS_SUCCESSFUL;
341 }
342}
343
344void __init
345powerpmc250_find_bridges(void)
346{
347 struct pci_controller* hose;
348
349 hose = pcibios_alloc_controller();
350 if (!hose){
351 printk("Can't allocate PCI 'hose' structure!!!\n");
352 return;
353 }
354
355 hose->first_busno = 0;
356 hose->last_busno = 0xff;
357
358 if (mpc10x_bridge_init(hose,
359 MPC10X_MEM_MAP_B,
360 MPC10X_MEM_MAP_B,
361 MPC10X_MAPB_EUMB_BASE) == 0) {
362
363 hose->mem_resources[0].end = 0xffffffff;
364
365 hose->last_busno = pciauto_bus_scan(hose, hose->first_busno);
366
367 /* ppc_md.pcibios_fixup = pcore_pcibios_fixup; */
368 ppc_md.pci_swizzle = common_swizzle;
369
370 ppc_md.pci_exclude_device = powerpmc250_exclude_device;
371 ppc_md.pci_map_irq = powerpmc250_map_irq;
372 } else {
373 if (ppc_md.progress)
374 ppc_md.progress("Bridge init failed", 0x100);
375 printk("Host bridge init failed\n");
376 }
377
378}
diff --git a/arch/ppc/platforms/powerpmc250.h b/arch/ppc/platforms/powerpmc250.h
deleted file mode 100644
index d33ad8dc0439..000000000000
--- a/arch/ppc/platforms/powerpmc250.h
+++ /dev/null
@@ -1,52 +0,0 @@
1/*
2 * arch/ppc/platforms/powerpmc250.h
3 *
4 * Definitions for Force PowerPMC-250 board support
5 *
6 * Author: Troy Benjegerdes <tbenjegerdes@mvista.com>
7 *
8 * Borrowed heavily from prpmc750.h by Matt Porter <mporter@mvista.com>
9 *
10 * 2001-2004 (c) MontaVista, Software, Inc. This file is licensed under
11 * the terms of the GNU General Public License version 2. This program
12 * is licensed "as is" without any warranty of any kind, whether express
13 * or implied.
14 */
15
16#ifndef __ASMPPC_POWERPMC250_H
17#define __ASMPPC_POWERPMC250_H
18
19#define POWERPMC250_PCI_CONFIG_ADDR 0x80000cf8
20#define POWERPMC250_PCI_CONFIG_DATA 0x80000cfc
21
22#define POWERPMC250_PCI_PHY_MEM_BASE 0xc0000000
23#define POWERPMC250_PCI_MEM_BASE 0xf0000000
24#define POWERPMC250_PCI_IO_BASE 0x80000000
25
26#define POWERPMC250_ISA_IO_BASE POWERPMC250_PCI_IO_BASE
27#define POWERPMC250_ISA_MEM_BASE POWERPMC250_PCI_MEM_BASE
28#define POWERPMC250_PCI_MEM_OFFSET POWERPMC250_PCI_PHY_MEM_BASE
29
30#define POWERPMC250_SYS_MEM_BASE 0x80000000
31
32#define POWERPMC250_HAWK_SMC_BASE 0xfef80000
33
34#define POWERPMC250_BASE_BAUD 12288000
35#define POWERPMC250_SERIAL 0xff000000
36#define POWERPMC250_SERIAL_IRQ 20
37
38/* UART Defines. */
39#define RS_TABLE_SIZE 1
40
41#define BASE_BAUD (POWERPMC250_BASE_BAUD / 16)
42
43#define STD_COM_FLAGS ASYNC_BOOT_AUTOCONF
44
45#define SERIAL_PORT_DFNS \
46 { 0, BASE_BAUD, POWERPMC250_SERIAL, POWERPMC250_SERIAL_IRQ, \
47 STD_COM_FLAGS, /* ttyS0 */ \
48 iomem_base: (u8 *)POWERPMC250_SERIAL, \
49 iomem_reg_shift: 0, \
50 io_type: SERIAL_IO_MEM }
51
52#endif /* __ASMPPC_POWERPMC250_H */
diff --git a/arch/ppc/platforms/pplus.c b/arch/ppc/platforms/pplus.c
deleted file mode 100644
index cbcac85c7a78..000000000000
--- a/arch/ppc/platforms/pplus.c
+++ /dev/null
@@ -1,844 +0,0 @@
1/*
2 * Board and PCI setup routines for MCG PowerPlus
3 *
4 * Author: Randy Vinson <rvinson@mvista.com>
5 *
6 * Derived from original PowerPlus PReP work by
7 * Cort Dougan, Johnnie Peters, Matt Porter, and
8 * Troy Benjegerdes.
9 *
10 * 2001-2004 (c) MontaVista, Software, Inc. This file is licensed under
11 * the terms of the GNU General Public License version 2. This program
12 * is licensed "as is" without any warranty of any kind, whether express
13 * or implied.
14 */
15
16#include <linux/kernel.h>
17#include <linux/interrupt.h>
18#include <linux/init.h>
19#include <linux/ioport.h>
20#include <linux/console.h>
21#include <linux/pci.h>
22#include <linux/seq_file.h>
23#include <linux/root_dev.h>
24
25#include <asm/system.h>
26#include <asm/io.h>
27#include <asm/pgtable.h>
28#include <asm/dma.h>
29#include <asm/machdep.h>
30#include <asm/prep_nvram.h>
31#include <asm/vga.h>
32#include <asm/i8259.h>
33#include <asm/open_pic.h>
34#include <asm/hawk.h>
35#include <asm/todc.h>
36#include <asm/bootinfo.h>
37#include <asm/kgdb.h>
38#include <asm/reg.h>
39
40#include "pplus.h"
41
42#undef DUMP_DBATS
43
44TODC_ALLOC();
45
46extern void pplus_setup_hose(void);
47extern void pplus_set_VIA_IDE_native(void);
48
49extern unsigned long loops_per_jiffy;
50unsigned char *Motherboard_map_name;
51
52/* Tables for known hardware */
53
54/* Motorola Mesquite */
55static inline int
56mesquite_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
57{
58 static char pci_irq_table[][4] =
59 /*
60 * MPIC interrupts for various IDSEL values (MPIC IRQ0 =
61 * Linux IRQ16 (to leave room for ISA IRQs at 0-15).
62 * PCI IDSEL/INTPIN->INTLINE
63 * A B C D
64 */
65 {
66 {18, 0, 0, 0}, /* IDSEL 14 - Enet 0 */
67 { 0, 0, 0, 0}, /* IDSEL 15 - unused */
68 {19, 19, 19, 19}, /* IDSEL 16 - PMC Slot 1 */
69 { 0, 0, 0, 0}, /* IDSEL 17 - unused */
70 { 0, 0, 0, 0}, /* IDSEL 18 - unused */
71 { 0, 0, 0, 0}, /* IDSEL 19 - unused */
72 {24, 25, 26, 27}, /* IDSEL 20 - P2P bridge (to cPCI 1) */
73 { 0, 0, 0, 0}, /* IDSEL 21 - unused */
74 {28, 29, 30, 31} /* IDSEL 22 - P2P bridge (to cPCI 2) */
75 };
76
77 const long min_idsel = 14, max_idsel = 22, irqs_per_slot = 4;
78 return PCI_IRQ_TABLE_LOOKUP;
79}
80
81/* Motorola Sitka */
82static inline int
83sitka_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
84{
85 static char pci_irq_table[][4] =
86 /*
87 * MPIC interrupts for various IDSEL values (MPIC IRQ0 =
88 * Linux IRQ16 (to leave room for ISA IRQs at 0-15).
89 * PCI IDSEL/INTPIN->INTLINE
90 * A B C D
91 */
92 {
93 {18, 0, 0, 0}, /* IDSEL 14 - Enet 0 */
94 { 0, 0, 0, 0}, /* IDSEL 15 - unused */
95 {25, 26, 27, 28}, /* IDSEL 16 - PMC Slot 1 */
96 {28, 25, 26, 27}, /* IDSEL 17 - PMC Slot 2 */
97 { 0, 0, 0, 0}, /* IDSEL 18 - unused */
98 { 0, 0, 0, 0}, /* IDSEL 19 - unused */
99 {20, 0, 0, 0} /* IDSEL 20 - P2P bridge (to cPCI) */
100 };
101
102 const long min_idsel = 14, max_idsel = 20, irqs_per_slot = 4;
103 return PCI_IRQ_TABLE_LOOKUP;
104}
105
106/* Motorola MTX */
107static inline int
108MTX_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
109{
110 static char pci_irq_table[][4] =
111 /*
112 * MPIC interrupts for various IDSEL values (MPIC IRQ0 =
113 * Linux IRQ16 (to leave room for ISA IRQs at 0-15).
114 * PCI IDSEL/INTPIN->INTLINE
115 * A B C D
116 */
117 {
118 {19, 0, 0, 0}, /* IDSEL 12 - SCSI */
119 { 0, 0, 0, 0}, /* IDSEL 13 - unused */
120 {18, 0, 0, 0}, /* IDSEL 14 - Enet */
121 { 0, 0, 0, 0}, /* IDSEL 15 - unused */
122 {25, 26, 27, 28}, /* IDSEL 16 - PMC Slot 1 */
123 {26, 27, 28, 25}, /* IDSEL 17 - PMC Slot 2 */
124 {27, 28, 25, 26} /* IDSEL 18 - PCI Slot 3 */
125 };
126
127 const long min_idsel = 12, max_idsel = 18, irqs_per_slot = 4;
128 return PCI_IRQ_TABLE_LOOKUP;
129}
130
131/* Motorola MTX Plus */
132/* Secondary bus interrupt routing is not supported yet */
133static inline int
134MTXplus_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
135{
136 static char pci_irq_table[][4] =
137 /*
138 * MPIC interrupts for various IDSEL values (MPIC IRQ0 =
139 * Linux IRQ16 (to leave room for ISA IRQs at 0-15).
140 * PCI IDSEL/INTPIN->INTLINE
141 * A B C D
142 */
143 {
144 {19, 0, 0, 0}, /* IDSEL 12 - SCSI */
145 { 0, 0, 0, 0}, /* IDSEL 13 - unused */
146 {18, 0, 0, 0}, /* IDSEL 14 - Enet 1 */
147 { 0, 0, 0, 0}, /* IDSEL 15 - unused */
148 {25, 26, 27, 28}, /* IDSEL 16 - PCI Slot 1P */
149 {26, 27, 28, 25}, /* IDSEL 17 - PCI Slot 2P */
150 {27, 28, 25, 26}, /* IDSEL 18 - PCI Slot 3P */
151 {26, 0, 0, 0}, /* IDSEL 19 - Enet 2 */
152 { 0, 0, 0, 0} /* IDSEL 20 - P2P Bridge */
153 };
154
155 const long min_idsel = 12, max_idsel = 20, irqs_per_slot = 4;
156 return PCI_IRQ_TABLE_LOOKUP;
157}
158
159static inline int
160Genesis2_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
161{
162 /* 2600
163 * Raven 31
164 * ISA 11
165 * SCSI 12 - IRQ3
166 * Univ 13
167 * eth 14 - IRQ2
168 * VGA 15 - IRQ4
169 * PMC1 16 - IRQ9,10,11,12 = PMC1 A-D
170 * PMC2 17 - IRQ12,9,10,11 = A-D
171 * SCSI2 18 - IRQ11
172 * eth2 19 - IRQ10
173 * PCIX 20 - IRQ9,10,11,12 = PCI A-D
174 */
175
176 /* 2400
177 * Hawk 31
178 * ISA 11
179 * Univ 13
180 * eth 14 - IRQ2
181 * PMC1 16 - IRQ9,10,11,12 = PMC A-D
182 * PMC2 17 - IRQ12,9,10,11 = PMC A-D
183 * PCIX 20 - IRQ9,10,11,12 = PMC A-D
184 */
185
186 /* 2300
187 * Raven 31
188 * ISA 11
189 * Univ 13
190 * eth 14 - IRQ2
191 * PMC1 16 - 9,10,11,12 = A-D
192 * PMC2 17 - 9,10,11,12 = B,C,D,A
193 */
194
195 static char pci_irq_table[][4] =
196 /*
197 * MPIC interrupts for various IDSEL values (MPIC IRQ0 =
198 * Linux IRQ16 (to leave room for ISA IRQs at 0-15).
199 * PCI IDSEL/INTPIN->INTLINE
200 * A B C D
201 */
202 {
203 {19, 0, 0, 0}, /* IDSEL 12 - SCSI */
204 { 0, 0, 0, 0}, /* IDSEL 13 - Universe PCI - VME */
205 {18, 0, 0, 0}, /* IDSEL 14 - Enet 1 */
206 { 0, 0, 0, 0}, /* IDSEL 15 - unused */
207 {25, 26, 27, 28}, /* IDSEL 16 - PCI/PMC Slot 1P */
208 {28, 25, 26, 27}, /* IDSEL 17 - PCI/PMC Slot 2P */
209 {27, 28, 25, 26}, /* IDSEL 18 - PCI Slot 3P */
210 {26, 0, 0, 0}, /* IDSEL 19 - Enet 2 */
211 {25, 26, 27, 28} /* IDSEL 20 - P2P Bridge */
212 };
213
214 const long min_idsel = 12, max_idsel = 20, irqs_per_slot = 4;
215 return PCI_IRQ_TABLE_LOOKUP;
216}
217
218#define MOTOROLA_CPUTYPE_REG 0x800
219#define MOTOROLA_BASETYPE_REG 0x803
220#define MPIC_RAVEN_ID 0x48010000
221#define MPIC_HAWK_ID 0x48030000
222#define MOT_PROC2_BIT 0x800
223
224static u_char pplus_openpic_initsenses[] __initdata = {
225 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* MVME2600_INT_SIO */
226 (IRQ_SENSE_EDGE | IRQ_POLARITY_NEGATIVE),/*MVME2600_INT_FALCN_ECC_ERR */
227 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),/*MVME2600_INT_PCI_ETHERNET */
228 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* MVME2600_INT_PCI_SCSI */
229 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),/*MVME2600_INT_PCI_GRAPHICS */
230 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* MVME2600_INT_PCI_VME0 */
231 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* MVME2600_INT_PCI_VME1 */
232 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* MVME2600_INT_PCI_VME2 */
233 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* MVME2600_INT_PCI_VME3 */
234 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* MVME2600_INT_PCI_INTA */
235 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* MVME2600_INT_PCI_INTB */
236 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* MVME2600_INT_PCI_INTC */
237 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* MVME2600_INT_PCI_INTD */
238 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* MVME2600_INT_LM_SIG0 */
239 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* MVME2600_INT_LM_SIG1 */
240 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),
241};
242
243int mot_entry = -1;
244int prep_keybd_present = 1;
245int mot_multi = 0;
246
247struct brd_info {
248 /* 0x100 mask assumes for Raven and Hawk boards that the level/edge
249 * are set */
250 int cpu_type;
251 /* 0x200 if this board has a Hawk chip. */
252 int base_type;
253 /* or'ed with 0x80 if this board should be checked for multi CPU */
254 int max_cpu;
255 const char *name;
256 int (*map_irq) (struct pci_dev *, unsigned char, unsigned char);
257};
258struct brd_info mot_info[] = {
259 {0x300, 0x00, 0x00, "MVME 2400", Genesis2_map_irq},
260 {0x1E0, 0xE0, 0x00, "Mesquite cPCI (MCP750)", mesquite_map_irq},
261 {0x1E0, 0xE1, 0x00, "Sitka cPCI (MCPN750)", sitka_map_irq},
262 {0x1E0, 0xE2, 0x00, "Mesquite cPCI (MCP750) w/ HAC", mesquite_map_irq},
263 {0x1E0, 0xF6, 0x80, "MTX Plus", MTXplus_map_irq},
264 {0x1E0, 0xF6, 0x81, "Dual MTX Plus", MTXplus_map_irq},
265 {0x1E0, 0xF7, 0x80, "MTX wo/ Parallel Port", MTX_map_irq},
266 {0x1E0, 0xF7, 0x81, "Dual MTX wo/ Parallel Port", MTX_map_irq},
267 {0x1E0, 0xF8, 0x80, "MTX w/ Parallel Port", MTX_map_irq},
268 {0x1E0, 0xF8, 0x81, "Dual MTX w/ Parallel Port", MTX_map_irq},
269 {0x1E0, 0xF9, 0x00, "MVME 2300", Genesis2_map_irq},
270 {0x1E0, 0xFA, 0x00, "MVME 2300SC/2600", Genesis2_map_irq},
271 {0x1E0, 0xFB, 0x00, "MVME 2600 with MVME712M", Genesis2_map_irq},
272 {0x1E0, 0xFC, 0x00, "MVME 2600/2700 with MVME761", Genesis2_map_irq},
273 {0x1E0, 0xFD, 0x80, "MVME 3600 with MVME712M", Genesis2_map_irq},
274 {0x1E0, 0xFD, 0x81, "MVME 4600 with MVME712M", Genesis2_map_irq},
275 {0x1E0, 0xFE, 0x80, "MVME 3600 with MVME761", Genesis2_map_irq},
276 {0x1E0, 0xFE, 0x81, "MVME 4600 with MVME761", Genesis2_map_irq},
277 {0x000, 0x00, 0x00, "", NULL}
278};
279
280void __init pplus_set_board_type(void)
281{
282 unsigned char cpu_type;
283 unsigned char base_mod;
284 int entry;
285 unsigned short devid;
286 unsigned long *ProcInfo = NULL;
287
288 cpu_type = inb(MOTOROLA_CPUTYPE_REG) & 0xF0;
289 base_mod = inb(MOTOROLA_BASETYPE_REG);
290 early_read_config_word(0, 0, 0, PCI_VENDOR_ID, &devid);
291
292 for (entry = 0; mot_info[entry].cpu_type != 0; entry++) {
293 /* Check for Hawk chip */
294 if (mot_info[entry].cpu_type & 0x200) {
295 if (devid != PCI_DEVICE_ID_MOTOROLA_HAWK)
296 continue;
297 } else {
298 /* store the system config register for later use. */
299 ProcInfo =
300 (unsigned long *)ioremap(PPLUS_SYS_CONFIG_REG, 4);
301
302 /* Check non hawk boards */
303 if ((mot_info[entry].cpu_type & 0xff) != cpu_type)
304 continue;
305
306 if (mot_info[entry].base_type == 0) {
307 mot_entry = entry;
308 break;
309 }
310
311 if (mot_info[entry].base_type != base_mod)
312 continue;
313 }
314
315 if (!(mot_info[entry].max_cpu & 0x80)) {
316 mot_entry = entry;
317 break;
318 }
319
320 /* processor 1 not present and max processor zero indicated */
321 if ((*ProcInfo & MOT_PROC2_BIT)
322 && !(mot_info[entry].max_cpu & 0x7f)) {
323 mot_entry = entry;
324 break;
325 }
326
327 /* processor 1 present and max processor zero indicated */
328 if (!(*ProcInfo & MOT_PROC2_BIT)
329 && (mot_info[entry].max_cpu & 0x7f)) {
330 mot_entry = entry;
331 break;
332 }
333
334 /* Indicate to system if this is a multiprocessor board */
335 if (!(*ProcInfo & MOT_PROC2_BIT))
336 mot_multi = 1;
337 }
338
339 if (mot_entry == -1)
340 /* No particular cpu type found - assume Mesquite (MCP750) */
341 mot_entry = 1;
342
343 Motherboard_map_name = (unsigned char *)mot_info[mot_entry].name;
344 ppc_md.pci_map_irq = mot_info[mot_entry].map_irq;
345}
346void __init pplus_pib_init(void)
347{
348 unsigned char reg;
349 unsigned short short_reg;
350
351 struct pci_dev *dev = NULL;
352
353 /*
354 * Perform specific configuration for the Via Tech or
355 * or Winbond PCI-ISA-Bridge part.
356 */
357 if ((dev = pci_get_device(PCI_VENDOR_ID_VIA,
358 PCI_DEVICE_ID_VIA_82C586_1, dev))) {
359 /*
360 * PPCBUG does not set the enable bits
361 * for the IDE device. Force them on here.
362 */
363 pci_read_config_byte(dev, 0x40, &reg);
364
365 reg |= 0x03; /* IDE: Chip Enable Bits */
366 pci_write_config_byte(dev, 0x40, reg);
367 }
368
369 if ((dev = pci_get_device(PCI_VENDOR_ID_VIA,
370 PCI_DEVICE_ID_VIA_82C586_2,
371 dev)) && (dev->devfn = 0x5a)) {
372 /* Force correct USB interrupt */
373 dev->irq = 11;
374 pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq);
375 }
376
377 if ((dev = pci_get_device(PCI_VENDOR_ID_WINBOND,
378 PCI_DEVICE_ID_WINBOND_83C553, dev))) {
379 /* Clear PCI Interrupt Routing Control Register. */
380 short_reg = 0x0000;
381 pci_write_config_word(dev, 0x44, short_reg);
382 /* Route IDE interrupts to IRQ 14 */
383 reg = 0xEE;
384 pci_write_config_byte(dev, 0x43, reg);
385 }
386
387 if ((dev = pci_get_device(PCI_VENDOR_ID_WINBOND,
388 PCI_DEVICE_ID_WINBOND_82C105, dev))) {
389 /*
390 * Disable LEGIRQ mode so PCI INTS are routed
391 * directly to the 8259 and enable both channels
392 */
393 pci_write_config_dword(dev, 0x40, 0x10ff0033);
394
395 /* Force correct IDE interrupt */
396 dev->irq = 14;
397 pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq);
398 }
399 pci_dev_put(dev);
400}
401
402void __init pplus_set_VIA_IDE_legacy(void)
403{
404 unsigned short vend, dev;
405
406 early_read_config_word(0, 0, PCI_DEVFN(0xb, 1), PCI_VENDOR_ID, &vend);
407 early_read_config_word(0, 0, PCI_DEVFN(0xb, 1), PCI_DEVICE_ID, &dev);
408
409 if ((vend == PCI_VENDOR_ID_VIA) &&
410 (dev == PCI_DEVICE_ID_VIA_82C586_1)) {
411 unsigned char temp;
412
413 /* put back original "standard" port base addresses */
414 early_write_config_dword(0, 0, PCI_DEVFN(0xb, 1),
415 PCI_BASE_ADDRESS_0, 0x1f1);
416 early_write_config_dword(0, 0, PCI_DEVFN(0xb, 1),
417 PCI_BASE_ADDRESS_1, 0x3f5);
418 early_write_config_dword(0, 0, PCI_DEVFN(0xb, 1),
419 PCI_BASE_ADDRESS_2, 0x171);
420 early_write_config_dword(0, 0, PCI_DEVFN(0xb, 1),
421 PCI_BASE_ADDRESS_3, 0x375);
422 early_write_config_dword(0, 0, PCI_DEVFN(0xb, 1),
423 PCI_BASE_ADDRESS_4, 0xcc01);
424
425 /* put into legacy mode */
426 early_read_config_byte(0, 0, PCI_DEVFN(0xb, 1), PCI_CLASS_PROG,
427 &temp);
428 temp &= ~0x05;
429 early_write_config_byte(0, 0, PCI_DEVFN(0xb, 1), PCI_CLASS_PROG,
430 temp);
431 }
432}
433
434void pplus_set_VIA_IDE_native(void)
435{
436 unsigned short vend, dev;
437
438 early_read_config_word(0, 0, PCI_DEVFN(0xb, 1), PCI_VENDOR_ID, &vend);
439 early_read_config_word(0, 0, PCI_DEVFN(0xb, 1), PCI_DEVICE_ID, &dev);
440
441 if ((vend == PCI_VENDOR_ID_VIA) &&
442 (dev == PCI_DEVICE_ID_VIA_82C586_1)) {
443 unsigned char temp;
444
445 /* put into native mode */
446 early_read_config_byte(0, 0, PCI_DEVFN(0xb, 1), PCI_CLASS_PROG,
447 &temp);
448 temp |= 0x05;
449 early_write_config_byte(0, 0, PCI_DEVFN(0xb, 1), PCI_CLASS_PROG,
450 temp);
451 }
452}
453
454void __init pplus_pcibios_fixup(void)
455{
456
457 unsigned char reg;
458 unsigned short devid;
459 unsigned char base_mod;
460
461 printk(KERN_INFO "Setting PCI interrupts for a \"%s\"\n",
462 Motherboard_map_name);
463
464 /* Setup the Winbond or Via PIB */
465 pplus_pib_init();
466
467 /* Set up floppy in PS/2 mode */
468 outb(0x09, SIO_CONFIG_RA);
469 reg = inb(SIO_CONFIG_RD);
470 reg = (reg & 0x3F) | 0x40;
471 outb(reg, SIO_CONFIG_RD);
472 outb(reg, SIO_CONFIG_RD); /* Have to write twice to change! */
473
474 /* This is a hack. If this is a 2300 or 2400 mot board then there is
475 * no keyboard controller and we have to indicate that.
476 */
477
478 early_read_config_word(0, 0, 0, PCI_VENDOR_ID, &devid);
479 base_mod = inb(MOTOROLA_BASETYPE_REG);
480 if ((devid == PCI_DEVICE_ID_MOTOROLA_HAWK) ||
481 (base_mod == 0xF9) || (base_mod == 0xFA) || (base_mod == 0xE1))
482 prep_keybd_present = 0;
483}
484
485void __init pplus_find_bridges(void)
486{
487 struct pci_controller *hose;
488
489 hose = pcibios_alloc_controller();
490 if (!hose)
491 return;
492
493 hose->first_busno = 0;
494 hose->last_busno = 0xff;
495
496 hose->pci_mem_offset = PREP_ISA_MEM_BASE;
497 hose->io_base_virt = (void *)PREP_ISA_IO_BASE;
498
499 pci_init_resource(&hose->io_resource, PPLUS_PCI_IO_START,
500 PPLUS_PCI_IO_END, IORESOURCE_IO, "PCI host bridge");
501 pci_init_resource(&hose->mem_resources[0], PPLUS_PROC_PCI_MEM_START,
502 PPLUS_PROC_PCI_MEM_END, IORESOURCE_MEM,
503 "PCI host bridge");
504
505 hose->io_space.start = PPLUS_PCI_IO_START;
506 hose->io_space.end = PPLUS_PCI_IO_END;
507 hose->mem_space.start = PPLUS_PCI_MEM_START;
508 hose->mem_space.end = PPLUS_PCI_MEM_END - HAWK_MPIC_SIZE;
509
510 if (hawk_init(hose, PPLUS_HAWK_PPC_REG_BASE, PPLUS_PROC_PCI_MEM_START,
511 PPLUS_PROC_PCI_MEM_END - HAWK_MPIC_SIZE,
512 PPLUS_PROC_PCI_IO_START, PPLUS_PROC_PCI_IO_END,
513 PPLUS_PROC_PCI_MEM_END - HAWK_MPIC_SIZE + 1)
514 != 0) {
515 printk(KERN_CRIT "Could not initialize host bridge\n");
516
517 }
518
519 pplus_set_VIA_IDE_legacy();
520
521 hose->last_busno = pciauto_bus_scan(hose, hose->first_busno);
522
523 ppc_md.pcibios_fixup = pplus_pcibios_fixup;
524 ppc_md.pci_swizzle = common_swizzle;
525}
526
527static int pplus_show_cpuinfo(struct seq_file *m)
528{
529 seq_printf(m, "vendor\t\t: Motorola MCG\n");
530 seq_printf(m, "machine\t\t: %s\n", Motherboard_map_name);
531
532 return 0;
533}
534
535static void __init pplus_setup_arch(void)
536{
537 struct pci_controller *hose;
538
539 if (ppc_md.progress)
540 ppc_md.progress("pplus_setup_arch: enter", 0);
541
542 /* init to some ~sane value until calibrate_delay() runs */
543 loops_per_jiffy = 50000000;
544
545 if (ppc_md.progress)
546 ppc_md.progress("pplus_setup_arch: find_bridges", 0);
547
548 /* Setup PCI host bridge */
549 pplus_find_bridges();
550
551 hose = pci_bus_to_hose(0);
552 isa_io_base = (ulong) hose->io_base_virt;
553
554 if (ppc_md.progress)
555 ppc_md.progress("pplus_setup_arch: set_board_type", 0);
556
557 pplus_set_board_type();
558
559 /* Enable L2. Assume we don't need to flush -- Cort */
560 *(unsigned char *)(PPLUS_L2_CONTROL_REG) |= 3;
561
562#ifdef CONFIG_BLK_DEV_INITRD
563 if (initrd_start)
564 ROOT_DEV = Root_RAM0;
565 else
566#endif
567#ifdef CONFIG_ROOT_NFS
568 ROOT_DEV = Root_NFS;
569#else
570 ROOT_DEV = Root_SDA2;
571#endif
572
573 printk(KERN_INFO "Motorola PowerPlus Platform\n");
574 printk(KERN_INFO
575 "Port by MontaVista Software, Inc. (source@mvista.com)\n");
576
577#ifdef CONFIG_VGA_CONSOLE
578 /* remap the VGA memory */
579 vgacon_remap_base = (unsigned long)ioremap(PPLUS_ISA_MEM_BASE,
580 0x08000000);
581 conswitchp = &vga_con;
582#endif
583#ifdef CONFIG_PPCBUG_NVRAM
584 /* Read in NVRAM data */
585 init_prep_nvram();
586
587 /* if no bootargs, look in NVRAM */
588 if (cmd_line[0] == '\0') {
589 char *bootargs;
590 bootargs = prep_nvram_get_var("bootargs");
591 if (bootargs != NULL) {
592 strcpy(cmd_line, bootargs);
593 /* again.. */
594 strcpy(boot_command_line, cmd_line);
595 }
596 }
597#endif
598 if (ppc_md.progress)
599 ppc_md.progress("pplus_setup_arch: exit", 0);
600}
601
602static void pplus_restart(char *cmd)
603{
604 unsigned long i = 10000;
605
606 local_irq_disable();
607
608 /* set VIA IDE controller into native mode */
609 pplus_set_VIA_IDE_native();
610
611 /* set exception prefix high - to the prom */
612 _nmask_and_or_msr(0, MSR_IP);
613
614 /* make sure bit 0 (reset) is a 0 */
615 outb(inb(0x92) & ~1L, 0x92);
616 /* signal a reset to system control port A - soft reset */
617 outb(inb(0x92) | 1, 0x92);
618
619 while (i != 0)
620 i++;
621 panic("restart failed\n");
622}
623
624static void pplus_halt(void)
625{
626 /* set exception prefix high - to the prom */
627 _nmask_and_or_msr(MSR_EE, MSR_IP);
628
629 /* make sure bit 0 (reset) is a 0 */
630 outb(inb(0x92) & ~1L, 0x92);
631 /* signal a reset to system control port A - soft reset */
632 outb(inb(0x92) | 1, 0x92);
633
634 while (1) ;
635 /*
636 * Not reached
637 */
638}
639
640static void pplus_power_off(void)
641{
642 pplus_halt();
643}
644
645static void __init pplus_init_IRQ(void)
646{
647 int i;
648
649 if (ppc_md.progress)
650 ppc_md.progress("init_irq: enter", 0);
651
652 OpenPIC_InitSenses = pplus_openpic_initsenses;
653 OpenPIC_NumInitSenses = sizeof(pplus_openpic_initsenses);
654
655 if (OpenPIC_Addr != NULL) {
656
657 openpic_set_sources(0, 16, OpenPIC_Addr + 0x10000);
658 openpic_init(NUM_8259_INTERRUPTS);
659 openpic_hookup_cascade(NUM_8259_INTERRUPTS, "82c59 cascade",
660 i8259_irq);
661 ppc_md.get_irq = openpic_get_irq;
662 }
663
664 i8259_init(0, 0);
665
666 if (ppc_md.progress)
667 ppc_md.progress("init_irq: exit", 0);
668}
669
670#ifdef CONFIG_SMP
671/* PowerPlus (MTX) support */
672static int __init smp_pplus_probe(void)
673{
674 extern int mot_multi;
675
676 if (mot_multi) {
677 openpic_request_IPIs();
678 smp_hw_index[1] = 1;
679 return 2;
680 }
681
682 return 1;
683}
684
685static void __init smp_pplus_kick_cpu(int nr)
686{
687 *(unsigned long *)KERNELBASE = nr;
688 asm volatile ("dcbf 0,%0"::"r" (KERNELBASE):"memory");
689 printk(KERN_INFO "CPU1 reset, waiting\n");
690}
691
692static void __init smp_pplus_setup_cpu(int cpu_nr)
693{
694 if (OpenPIC_Addr)
695 do_openpic_setup_cpu();
696}
697
698static struct smp_ops_t pplus_smp_ops = {
699 smp_openpic_message_pass,
700 smp_pplus_probe,
701 smp_pplus_kick_cpu,
702 smp_pplus_setup_cpu,
703 .give_timebase = smp_generic_give_timebase,
704 .take_timebase = smp_generic_take_timebase,
705};
706#endif /* CONFIG_SMP */
707
708#ifdef DUMP_DBATS
709static void print_dbat(int idx, u32 bat)
710{
711
712 char str[64];
713
714 sprintf(str, "DBAT%c%c = 0x%08x\n",
715 (char)((idx - DBAT0U) / 2) + '0', (idx & 1) ? 'L' : 'U', bat);
716 ppc_md.progress(str, 0);
717}
718
719#define DUMP_DBAT(x) \
720 do { \
721 u32 __temp = mfspr(x);\
722 print_dbat(x, __temp); \
723 } while (0)
724
725static void dump_dbats(void)
726{
727 if (ppc_md.progress) {
728 DUMP_DBAT(DBAT0U);
729 DUMP_DBAT(DBAT0L);
730 DUMP_DBAT(DBAT1U);
731 DUMP_DBAT(DBAT1L);
732 DUMP_DBAT(DBAT2U);
733 DUMP_DBAT(DBAT2L);
734 DUMP_DBAT(DBAT3U);
735 DUMP_DBAT(DBAT3L);
736 }
737}
738#endif
739
740static unsigned long __init pplus_find_end_of_memory(void)
741{
742 unsigned long total;
743
744 if (ppc_md.progress)
745 ppc_md.progress("pplus_find_end_of_memory", 0);
746
747#ifdef DUMP_DBATS
748 dump_dbats();
749#endif
750
751 total = hawk_get_mem_size(PPLUS_HAWK_SMC_BASE);
752 return (total);
753}
754
755static void __init pplus_map_io(void)
756{
757 io_block_mapping(PPLUS_ISA_IO_BASE, PPLUS_ISA_IO_BASE, 0x10000000,
758 _PAGE_IO);
759 io_block_mapping(0xfef80000, 0xfef80000, 0x00080000, _PAGE_IO);
760}
761
762static void __init pplus_init2(void)
763{
764#ifdef CONFIG_NVRAM
765 request_region(PREP_NVRAM_AS0, 0x8, "nvram");
766#endif
767 request_region(0x20, 0x20, "pic1");
768 request_region(0xa0, 0x20, "pic2");
769 request_region(0x00, 0x20, "dma1");
770 request_region(0x40, 0x20, "timer");
771 request_region(0x80, 0x10, "dma page reg");
772 request_region(0xc0, 0x20, "dma2");
773}
774
775/*
776 * Set BAT 2 to access 0x8000000 so progress messages will work and set BAT 3
777 * to 0xf0000000 to access Falcon/Raven or Hawk registers
778 */
779static __inline__ void pplus_set_bat(void)
780{
781 /* wait for all outstanding memory accesses to complete */
782 mb();
783
784 /* setup DBATs */
785 mtspr(SPRN_DBAT2U, 0x80001ffe);
786 mtspr(SPRN_DBAT2L, 0x8000002a);
787 mtspr(SPRN_DBAT3U, 0xf0001ffe);
788 mtspr(SPRN_DBAT3L, 0xf000002a);
789
790 /* wait for updates */
791 mb();
792}
793
794void __init
795platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
796 unsigned long r6, unsigned long r7)
797{
798 parse_bootinfo(find_bootinfo());
799
800 /* Map in board regs, etc. */
801 pplus_set_bat();
802
803 isa_io_base = PREP_ISA_IO_BASE;
804 isa_mem_base = PREP_ISA_MEM_BASE;
805 pci_dram_offset = PREP_PCI_DRAM_OFFSET;
806 ISA_DMA_THRESHOLD = 0x00ffffff;
807 DMA_MODE_READ = 0x44;
808 DMA_MODE_WRITE = 0x48;
809 ppc_do_canonicalize_irqs = 1;
810
811 ppc_md.setup_arch = pplus_setup_arch;
812 ppc_md.show_cpuinfo = pplus_show_cpuinfo;
813 ppc_md.init_IRQ = pplus_init_IRQ;
814 /* this gets changed later on if we have an OpenPIC -- Cort */
815 ppc_md.get_irq = i8259_irq;
816 ppc_md.init = pplus_init2;
817
818 ppc_md.restart = pplus_restart;
819 ppc_md.power_off = pplus_power_off;
820 ppc_md.halt = pplus_halt;
821
822 TODC_INIT(TODC_TYPE_MK48T59, PREP_NVRAM_AS0, PREP_NVRAM_AS1,
823 PREP_NVRAM_DATA, 8);
824
825 ppc_md.time_init = todc_time_init;
826 ppc_md.set_rtc_time = todc_set_rtc_time;
827 ppc_md.get_rtc_time = todc_get_rtc_time;
828 ppc_md.calibrate_decr = todc_calibrate_decr;
829 ppc_md.nvram_read_val = todc_m48txx_read_val;
830 ppc_md.nvram_write_val = todc_m48txx_write_val;
831
832 ppc_md.find_end_of_memory = pplus_find_end_of_memory;
833 ppc_md.setup_io_mappings = pplus_map_io;
834
835#ifdef CONFIG_SERIAL_TEXT_DEBUG
836 ppc_md.progress = gen550_progress;
837#endif /* CONFIG_SERIAL_TEXT_DEBUG */
838#ifdef CONFIG_KGDB
839 ppc_md.kgdb_map_scc = gen550_kgdb_map_scc;
840#endif
841#ifdef CONFIG_SMP
842 smp_ops = &pplus_smp_ops;
843#endif /* CONFIG_SMP */
844}
diff --git a/arch/ppc/platforms/pplus.h b/arch/ppc/platforms/pplus.h
deleted file mode 100644
index a4bbaa8d858f..000000000000
--- a/arch/ppc/platforms/pplus.h
+++ /dev/null
@@ -1,65 +0,0 @@
1/*
2 * Definitions for Motorola MCG Falcon/Raven & HAWK North Bridge & Memory ctlr.
3 *
4 * Author: Mark A. Greerinclude/asm-ppc/hawk.h
5 * mgreer@mvista.com
6 *
7 * Modified by Randy Vinson (rvinson@mvista.com)
8 *
9 * 2001-2004 (c) MontaVista, Software, Inc. This file is licensed under
10 * the terms of the GNU General Public License version 2. This program
11 * is licensed "as is" without any warranty of any kind, whether express
12 * or implied.
13 */
14
15#ifndef __PPC_PPLUS_H
16#define __PPC_PPLUS_H
17
18#include <asm/io.h>
19
20/*
21 * Due to limitations imposed by legacy hardware (primarily IDE controllers),
22 * the PPLUS boards operate using a PReP address map.
23 *
24 * From Processor (physical) -> PCI:
25 * PCI Mem Space: 0xc0000000 - 0xfe000000 -> 0x00000000 - 0x3e000000 (768 MB)
26 * PCI I/O Space: 0x80000000 - 0x90000000 -> 0x00000000 - 0x10000000 (256 MB)
27 * Note: Must skip 0xfe000000-0xfe400000 for CONFIG_HIGHMEM/PKMAP area
28 *
29 * From PCI -> Processor (physical):
30 * System Memory: 0x80000000 -> 0x00000000
31 */
32
33#define PPLUS_ISA_MEM_BASE PREP_ISA_MEM_BASE
34#define PPLUS_ISA_IO_BASE PREP_ISA_IO_BASE
35
36/* PCI Memory space mapping info */
37#define PPLUS_PCI_MEM_SIZE 0x30000000U
38#define PPLUS_PROC_PCI_MEM_START PPLUS_ISA_MEM_BASE
39#define PPLUS_PROC_PCI_MEM_END (PPLUS_PROC_PCI_MEM_START + \
40 PPLUS_PCI_MEM_SIZE - 1)
41#define PPLUS_PCI_MEM_START 0x00000000U
42#define PPLUS_PCI_MEM_END (PPLUS_PCI_MEM_START + \
43 PPLUS_PCI_MEM_SIZE - 1)
44
45/* PCI I/O space mapping info */
46#define PPLUS_PCI_IO_SIZE 0x10000000U
47#define PPLUS_PROC_PCI_IO_START PPLUS_ISA_IO_BASE
48#define PPLUS_PROC_PCI_IO_END (PPLUS_PROC_PCI_IO_START + \
49 PPLUS_PCI_IO_SIZE - 1)
50#define PPLUS_PCI_IO_START 0x00000000U
51#define PPLUS_PCI_IO_END (PPLUS_PCI_IO_START + \
52 PPLUS_PCI_IO_SIZE - 1)
53/* System memory mapping info */
54#define PPLUS_PCI_DRAM_OFFSET PREP_PCI_DRAM_OFFSET
55#define PPLUS_PCI_PHY_MEM_OFFSET (PPLUS_ISA_MEM_BASE-PPLUS_PCI_MEM_START)
56
57/* Define base addresses for important sets of registers */
58#define PPLUS_HAWK_SMC_BASE 0xfef80000U
59#define PPLUS_HAWK_PPC_REG_BASE 0xfeff0000U
60#define PPLUS_SYS_CONFIG_REG 0xfef80400U
61#define PPLUS_L2_CONTROL_REG 0x8000081cU
62
63#define PPLUS_VGA_MEM_BASE 0xf0000000U
64
65#endif /* __PPC_PPLUS_H */
diff --git a/arch/ppc/platforms/prep_pci.c b/arch/ppc/platforms/prep_pci.c
deleted file mode 100644
index 8ed433e2a5c7..000000000000
--- a/arch/ppc/platforms/prep_pci.c
+++ /dev/null
@@ -1,1339 +0,0 @@
1/*
2 * PReP pci functions.
3 * Originally by Gary Thomas
4 * rewritten and updated by Cort Dougan (cort@cs.nmt.edu)
5 *
6 * The motherboard routes/maps will disappear shortly. -- Cort
7 */
8
9#include <linux/types.h>
10#include <linux/pci.h>
11#include <linux/kernel.h>
12#include <linux/init.h>
13
14#include <asm/sections.h>
15#include <asm/byteorder.h>
16#include <asm/io.h>
17#include <asm/ptrace.h>
18#include <asm/prom.h>
19#include <asm/pci-bridge.h>
20#include <asm/residual.h>
21#include <asm/irq.h>
22#include <asm/machdep.h>
23#include <asm/open_pic.h>
24
25extern void (*setup_ibm_pci)(char *irq_lo, char *irq_hi);
26
27/* Which PCI interrupt line does a given device [slot] use? */
28/* Note: This really should be two dimensional based in slot/pin used */
29static unsigned char *Motherboard_map;
30unsigned char *Motherboard_map_name;
31
32/* How is the 82378 PIRQ mapping setup? */
33static unsigned char *Motherboard_routes;
34
35static void (*Motherboard_non0)(struct pci_dev *);
36
37static void Powerplus_Map_Non0(struct pci_dev *);
38
39/* Used for Motorola to store system config register */
40static unsigned long *ProcInfo;
41
42/* Tables for known hardware */
43
44/* Motorola PowerStackII - Utah */
45static char Utah_pci_IRQ_map[23] =
46{
47 0, /* Slot 0 - unused */
48 0, /* Slot 1 - unused */
49 5, /* Slot 2 - SCSI - NCR825A */
50 0, /* Slot 3 - unused */
51 3, /* Slot 4 - Ethernet - DEC2114x */
52 0, /* Slot 5 - unused */
53 2, /* Slot 6 - PCI Card slot #1 */
54 3, /* Slot 7 - PCI Card slot #2 */
55 5, /* Slot 8 - PCI Card slot #3 */
56 5, /* Slot 9 - PCI Bridge */
57 /* added here in case we ever support PCI bridges */
58 /* Secondary PCI bus cards are at slot-9,6 & slot-9,7 */
59 0, /* Slot 10 - unused */
60 0, /* Slot 11 - unused */
61 5, /* Slot 12 - SCSI - NCR825A */
62 0, /* Slot 13 - unused */
63 3, /* Slot 14 - enet */
64 0, /* Slot 15 - unused */
65 2, /* Slot 16 - unused */
66 3, /* Slot 17 - unused */
67 5, /* Slot 18 - unused */
68 0, /* Slot 19 - unused */
69 0, /* Slot 20 - unused */
70 0, /* Slot 21 - unused */
71 0, /* Slot 22 - unused */
72};
73
74static char Utah_pci_IRQ_routes[] =
75{
76 0, /* Line 0 - Unused */
77 9, /* Line 1 */
78 10, /* Line 2 */
79 11, /* Line 3 */
80 14, /* Line 4 */
81 15, /* Line 5 */
82};
83
84/* Motorola PowerStackII - Omaha */
85/* no integrated SCSI or ethernet */
86static char Omaha_pci_IRQ_map[23] =
87{
88 0, /* Slot 0 - unused */
89 0, /* Slot 1 - unused */
90 3, /* Slot 2 - Winbond EIDE */
91 0, /* Slot 3 - unused */
92 0, /* Slot 4 - unused */
93 0, /* Slot 5 - unused */
94 1, /* Slot 6 - PCI slot 1 */
95 2, /* Slot 7 - PCI slot 2 */
96 3, /* Slot 8 - PCI slot 3 */
97 4, /* Slot 9 - PCI slot 4 */ /* needs indirect access */
98 0, /* Slot 10 - unused */
99 0, /* Slot 11 - unused */
100 0, /* Slot 12 - unused */
101 0, /* Slot 13 - unused */
102 0, /* Slot 14 - unused */
103 0, /* Slot 15 - unused */
104 1, /* Slot 16 - PCI slot 1 */
105 2, /* Slot 17 - PCI slot 2 */
106 3, /* Slot 18 - PCI slot 3 */
107 4, /* Slot 19 - PCI slot 4 */ /* needs indirect access */
108 0,
109 0,
110 0,
111};
112
113static char Omaha_pci_IRQ_routes[] =
114{
115 0, /* Line 0 - Unused */
116 9, /* Line 1 */
117 11, /* Line 2 */
118 14, /* Line 3 */
119 15 /* Line 4 */
120};
121
122/* Motorola PowerStack */
123static char Blackhawk_pci_IRQ_map[19] =
124{
125 0, /* Slot 0 - unused */
126 0, /* Slot 1 - unused */
127 0, /* Slot 2 - unused */
128 0, /* Slot 3 - unused */
129 0, /* Slot 4 - unused */
130 0, /* Slot 5 - unused */
131 0, /* Slot 6 - unused */
132 0, /* Slot 7 - unused */
133 0, /* Slot 8 - unused */
134 0, /* Slot 9 - unused */
135 0, /* Slot 10 - unused */
136 0, /* Slot 11 - unused */
137 3, /* Slot 12 - SCSI */
138 0, /* Slot 13 - unused */
139 1, /* Slot 14 - Ethernet */
140 0, /* Slot 15 - unused */
141 1, /* Slot P7 */
142 2, /* Slot P6 */
143 3, /* Slot P5 */
144};
145
146static char Blackhawk_pci_IRQ_routes[] =
147{
148 0, /* Line 0 - Unused */
149 9, /* Line 1 */
150 11, /* Line 2 */
151 15, /* Line 3 */
152 15 /* Line 4 */
153};
154
155/* Motorola Mesquite */
156static char Mesquite_pci_IRQ_map[23] =
157{
158 0, /* Slot 0 - unused */
159 0, /* Slot 1 - unused */
160 0, /* Slot 2 - unused */
161 0, /* Slot 3 - unused */
162 0, /* Slot 4 - unused */
163 0, /* Slot 5 - unused */
164 0, /* Slot 6 - unused */
165 0, /* Slot 7 - unused */
166 0, /* Slot 8 - unused */
167 0, /* Slot 9 - unused */
168 0, /* Slot 10 - unused */
169 0, /* Slot 11 - unused */
170 0, /* Slot 12 - unused */
171 0, /* Slot 13 - unused */
172 2, /* Slot 14 - Ethernet */
173 0, /* Slot 15 - unused */
174 3, /* Slot 16 - PMC */
175 0, /* Slot 17 - unused */
176 0, /* Slot 18 - unused */
177 0, /* Slot 19 - unused */
178 0, /* Slot 20 - unused */
179 0, /* Slot 21 - unused */
180 0, /* Slot 22 - unused */
181};
182
183/* Motorola Sitka */
184static char Sitka_pci_IRQ_map[21] =
185{
186 0, /* Slot 0 - unused */
187 0, /* Slot 1 - unused */
188 0, /* Slot 2 - unused */
189 0, /* Slot 3 - unused */
190 0, /* Slot 4 - unused */
191 0, /* Slot 5 - unused */
192 0, /* Slot 6 - unused */
193 0, /* Slot 7 - unused */
194 0, /* Slot 8 - unused */
195 0, /* Slot 9 - unused */
196 0, /* Slot 10 - unused */
197 0, /* Slot 11 - unused */
198 0, /* Slot 12 - unused */
199 0, /* Slot 13 - unused */
200 2, /* Slot 14 - Ethernet */
201 0, /* Slot 15 - unused */
202 9, /* Slot 16 - PMC 1 */
203 12, /* Slot 17 - PMC 2 */
204 0, /* Slot 18 - unused */
205 0, /* Slot 19 - unused */
206 4, /* Slot 20 - NT P2P bridge */
207};
208
209/* Motorola MTX */
210static char MTX_pci_IRQ_map[23] =
211{
212 0, /* Slot 0 - unused */
213 0, /* Slot 1 - unused */
214 0, /* Slot 2 - unused */
215 0, /* Slot 3 - unused */
216 0, /* Slot 4 - unused */
217 0, /* Slot 5 - unused */
218 0, /* Slot 6 - unused */
219 0, /* Slot 7 - unused */
220 0, /* Slot 8 - unused */
221 0, /* Slot 9 - unused */
222 0, /* Slot 10 - unused */
223 0, /* Slot 11 - unused */
224 3, /* Slot 12 - SCSI */
225 0, /* Slot 13 - unused */
226 2, /* Slot 14 - Ethernet */
227 0, /* Slot 15 - unused */
228 9, /* Slot 16 - PCI/PMC slot 1 */
229 10, /* Slot 17 - PCI/PMC slot 2 */
230 11, /* Slot 18 - PCI slot 3 */
231 0, /* Slot 19 - unused */
232 0, /* Slot 20 - unused */
233 0, /* Slot 21 - unused */
234 0, /* Slot 22 - unused */
235};
236
237/* Motorola MTX Plus */
238/* Secondary bus interrupt routing is not supported yet */
239static char MTXplus_pci_IRQ_map[23] =
240{
241 0, /* Slot 0 - unused */
242 0, /* Slot 1 - unused */
243 0, /* Slot 2 - unused */
244 0, /* Slot 3 - unused */
245 0, /* Slot 4 - unused */
246 0, /* Slot 5 - unused */
247 0, /* Slot 6 - unused */
248 0, /* Slot 7 - unused */
249 0, /* Slot 8 - unused */
250 0, /* Slot 9 - unused */
251 0, /* Slot 10 - unused */
252 0, /* Slot 11 - unused */
253 3, /* Slot 12 - SCSI */
254 0, /* Slot 13 - unused */
255 2, /* Slot 14 - Ethernet 1 */
256 0, /* Slot 15 - unused */
257 9, /* Slot 16 - PCI slot 1P */
258 10, /* Slot 17 - PCI slot 2P */
259 11, /* Slot 18 - PCI slot 3P */
260 10, /* Slot 19 - Ethernet 2 */
261 0, /* Slot 20 - P2P Bridge */
262 0, /* Slot 21 - unused */
263 0, /* Slot 22 - unused */
264};
265
266static char Raven_pci_IRQ_routes[] =
267{
268 0, /* This is a dummy structure */
269};
270
271/* Motorola MVME16xx */
272static char Genesis_pci_IRQ_map[16] =
273{
274 0, /* Slot 0 - unused */
275 0, /* Slot 1 - unused */
276 0, /* Slot 2 - unused */
277 0, /* Slot 3 - unused */
278 0, /* Slot 4 - unused */
279 0, /* Slot 5 - unused */
280 0, /* Slot 6 - unused */
281 0, /* Slot 7 - unused */
282 0, /* Slot 8 - unused */
283 0, /* Slot 9 - unused */
284 0, /* Slot 10 - unused */
285 0, /* Slot 11 - unused */
286 3, /* Slot 12 - SCSI */
287 0, /* Slot 13 - unused */
288 1, /* Slot 14 - Ethernet */
289 0, /* Slot 15 - unused */
290};
291
292static char Genesis_pci_IRQ_routes[] =
293{
294 0, /* Line 0 - Unused */
295 10, /* Line 1 */
296 11, /* Line 2 */
297 14, /* Line 3 */
298 15 /* Line 4 */
299};
300
301static char Genesis2_pci_IRQ_map[23] =
302{
303 0, /* Slot 0 - unused */
304 0, /* Slot 1 - unused */
305 0, /* Slot 2 - unused */
306 0, /* Slot 3 - unused */
307 0, /* Slot 4 - unused */
308 0, /* Slot 5 - unused */
309 0, /* Slot 6 - unused */
310 0, /* Slot 7 - unused */
311 0, /* Slot 8 - unused */
312 0, /* Slot 9 - unused */
313 0, /* Slot 10 - unused */
314 0, /* Slot 11 - IDE */
315 3, /* Slot 12 - SCSI */
316 5, /* Slot 13 - Universe PCI - VME Bridge */
317 2, /* Slot 14 - Ethernet */
318 0, /* Slot 15 - unused */
319 9, /* Slot 16 - PMC 1 */
320 12, /* Slot 17 - pci */
321 11, /* Slot 18 - pci */
322 10, /* Slot 19 - pci */
323 0, /* Slot 20 - pci */
324 0, /* Slot 21 - unused */
325 0, /* Slot 22 - unused */
326};
327
328/* Motorola Series-E */
329static char Comet_pci_IRQ_map[23] =
330{
331 0, /* Slot 0 - unused */
332 0, /* Slot 1 - unused */
333 0, /* Slot 2 - unused */
334 0, /* Slot 3 - unused */
335 0, /* Slot 4 - unused */
336 0, /* Slot 5 - unused */
337 0, /* Slot 6 - unused */
338 0, /* Slot 7 - unused */
339 0, /* Slot 8 - unused */
340 0, /* Slot 9 - unused */
341 0, /* Slot 10 - unused */
342 0, /* Slot 11 - unused */
343 3, /* Slot 12 - SCSI */
344 0, /* Slot 13 - unused */
345 1, /* Slot 14 - Ethernet */
346 0, /* Slot 15 - unused */
347 1, /* Slot 16 - PCI slot 1 */
348 2, /* Slot 17 - PCI slot 2 */
349 3, /* Slot 18 - PCI slot 3 */
350 4, /* Slot 19 - PCI bridge */
351 0,
352 0,
353 0,
354};
355
356static char Comet_pci_IRQ_routes[] =
357{
358 0, /* Line 0 - Unused */
359 10, /* Line 1 */
360 11, /* Line 2 */
361 14, /* Line 3 */
362 15 /* Line 4 */
363};
364
365/* Motorola Series-EX */
366static char Comet2_pci_IRQ_map[23] =
367{
368 0, /* Slot 0 - unused */
369 0, /* Slot 1 - unused */
370 3, /* Slot 2 - SCSI - NCR825A */
371 0, /* Slot 3 - unused */
372 1, /* Slot 4 - Ethernet - DEC2104X */
373 0, /* Slot 5 - unused */
374 1, /* Slot 6 - PCI slot 1 */
375 2, /* Slot 7 - PCI slot 2 */
376 3, /* Slot 8 - PCI slot 3 */
377 4, /* Slot 9 - PCI bridge */
378 0, /* Slot 10 - unused */
379 0, /* Slot 11 - unused */
380 3, /* Slot 12 - SCSI - NCR825A */
381 0, /* Slot 13 - unused */
382 1, /* Slot 14 - Ethernet - DEC2104X */
383 0, /* Slot 15 - unused */
384 1, /* Slot 16 - PCI slot 1 */
385 2, /* Slot 17 - PCI slot 2 */
386 3, /* Slot 18 - PCI slot 3 */
387 4, /* Slot 19 - PCI bridge */
388 0,
389 0,
390 0,
391};
392
393static char Comet2_pci_IRQ_routes[] =
394{
395 0, /* Line 0 - Unused */
396 10, /* Line 1 */
397 11, /* Line 2 */
398 14, /* Line 3 */
399 15, /* Line 4 */
400};
401
402/*
403 * ibm 830 (and 850?).
404 * This is actually based on the Carolina motherboard
405 * -- Cort
406 */
407static char ibm8xx_pci_IRQ_map[23] = {
408 0, /* Slot 0 - unused */
409 0, /* Slot 1 - unused */
410 0, /* Slot 2 - unused */
411 0, /* Slot 3 - unused */
412 0, /* Slot 4 - unused */
413 0, /* Slot 5 - unused */
414 0, /* Slot 6 - unused */
415 0, /* Slot 7 - unused */
416 0, /* Slot 8 - unused */
417 0, /* Slot 9 - unused */
418 0, /* Slot 10 - unused */
419 0, /* Slot 11 - FireCoral */
420 4, /* Slot 12 - Ethernet PCIINTD# */
421 2, /* Slot 13 - PCI Slot #2 */
422 2, /* Slot 14 - S3 Video PCIINTD# */
423 0, /* Slot 15 - onboard SCSI (INDI) [1] */
424 3, /* Slot 16 - NCR58C810 RS6000 Only PCIINTC# */
425 0, /* Slot 17 - unused */
426 2, /* Slot 18 - PCI Slot 2 PCIINTx# (See below) */
427 0, /* Slot 19 - unused */
428 0, /* Slot 20 - unused */
429 0, /* Slot 21 - unused */
430 2, /* Slot 22 - PCI slot 1 PCIINTx# (See below) */
431};
432
433static char ibm8xx_pci_IRQ_routes[] = {
434 0, /* Line 0 - unused */
435 15, /* Line 1 */
436 15, /* Line 2 */
437 15, /* Line 3 */
438 15, /* Line 4 */
439};
440
441/*
442 * a 6015 ibm board
443 * -- Cort
444 */
445static char ibm6015_pci_IRQ_map[23] = {
446 0, /* Slot 0 - unused */
447 0, /* Slot 1 - unused */
448 0, /* Slot 2 - unused */
449 0, /* Slot 3 - unused */
450 0, /* Slot 4 - unused */
451 0, /* Slot 5 - unused */
452 0, /* Slot 6 - unused */
453 0, /* Slot 7 - unused */
454 0, /* Slot 8 - unused */
455 0, /* Slot 9 - unused */
456 0, /* Slot 10 - unused */
457 0, /* Slot 11 - */
458 1, /* Slot 12 - SCSI */
459 2, /* Slot 13 - */
460 2, /* Slot 14 - */
461 1, /* Slot 15 - */
462 1, /* Slot 16 - */
463 0, /* Slot 17 - */
464 2, /* Slot 18 - */
465 0, /* Slot 19 - */
466 0, /* Slot 20 - */
467 0, /* Slot 21 - */
468 2, /* Slot 22 - */
469};
470
471static char ibm6015_pci_IRQ_routes[] = {
472 0, /* Line 0 - unused */
473 13, /* Line 1 */
474 15, /* Line 2 */
475 15, /* Line 3 */
476 15, /* Line 4 */
477};
478
479
480/* IBM Nobis and Thinkpad 850 */
481static char Nobis_pci_IRQ_map[23] ={
482 0, /* Slot 0 - unused */
483 0, /* Slot 1 - unused */
484 0, /* Slot 2 - unused */
485 0, /* Slot 3 - unused */
486 0, /* Slot 4 - unused */
487 0, /* Slot 5 - unused */
488 0, /* Slot 6 - unused */
489 0, /* Slot 7 - unused */
490 0, /* Slot 8 - unused */
491 0, /* Slot 9 - unused */
492 0, /* Slot 10 - unused */
493 0, /* Slot 11 - unused */
494 3, /* Slot 12 - SCSI */
495 0, /* Slot 13 - unused */
496 0, /* Slot 14 - unused */
497 0, /* Slot 15 - unused */
498};
499
500static char Nobis_pci_IRQ_routes[] = {
501 0, /* Line 0 - Unused */
502 13, /* Line 1 */
503 13, /* Line 2 */
504 13, /* Line 3 */
505 13 /* Line 4 */
506};
507
508/*
509 * IBM RS/6000 43p/140 -- paulus
510 * XXX we should get all this from the residual data
511 */
512static char ibm43p_pci_IRQ_map[23] = {
513 0, /* Slot 0 - unused */
514 0, /* Slot 1 - unused */
515 0, /* Slot 2 - unused */
516 0, /* Slot 3 - unused */
517 0, /* Slot 4 - unused */
518 0, /* Slot 5 - unused */
519 0, /* Slot 6 - unused */
520 0, /* Slot 7 - unused */
521 0, /* Slot 8 - unused */
522 0, /* Slot 9 - unused */
523 0, /* Slot 10 - unused */
524 0, /* Slot 11 - FireCoral ISA bridge */
525 6, /* Slot 12 - Ethernet */
526 0, /* Slot 13 - openpic */
527 0, /* Slot 14 - unused */
528 0, /* Slot 15 - unused */
529 7, /* Slot 16 - NCR58C825a onboard scsi */
530 0, /* Slot 17 - unused */
531 2, /* Slot 18 - PCI Slot 2 PCIINTx# (See below) */
532 0, /* Slot 19 - unused */
533 0, /* Slot 20 - unused */
534 0, /* Slot 21 - unused */
535 1, /* Slot 22 - PCI slot 1 PCIINTx# (See below) */
536};
537
538static char ibm43p_pci_IRQ_routes[] = {
539 0, /* Line 0 - unused */
540 15, /* Line 1 */
541 15, /* Line 2 */
542 15, /* Line 3 */
543 15, /* Line 4 */
544};
545
546/* Motorola PowerPlus architecture PCI IRQ tables */
547/* Interrupt line values for INTA-D on primary/secondary MPIC inputs */
548
549struct powerplus_irq_list
550{
551 unsigned char primary[4]; /* INT A-D */
552 unsigned char secondary[4]; /* INT A-D */
553};
554
555/*
556 * For standard PowerPlus boards, bus 0 PCI INTs A-D are routed to
557 * OpenPIC inputs 9-12. PCI INTs A-D from the on board P2P bridge
558 * are routed to OpenPIC inputs 5-8. These values are offset by
559 * 16 in the table to reflect the Linux kernel interrupt value.
560 */
561struct powerplus_irq_list Powerplus_pci_IRQ_list =
562{
563 {25, 26, 27, 28},
564 {21, 22, 23, 24}
565};
566
567/*
568 * For the MCP750 (system slot board), cPCI INTs A-D are routed to
569 * OpenPIC inputs 8-11 and the PMC INTs A-D are routed to OpenPIC
570 * input 3. On a hot swap MCP750, the companion card PCI INTs A-D
571 * are routed to OpenPIC inputs 12-15. These values are offset by
572 * 16 in the table to reflect the Linux kernel interrupt value.
573 */
574struct powerplus_irq_list Mesquite_pci_IRQ_list =
575{
576 {24, 25, 26, 27},
577 {28, 29, 30, 31}
578};
579
580/*
581 * This table represents the standard PCI swizzle defined in the
582 * PCI bus specification.
583 */
584static unsigned char prep_pci_intpins[4][4] =
585{
586 { 1, 2, 3, 4}, /* Buses 0, 4, 8, ... */
587 { 2, 3, 4, 1}, /* Buses 1, 5, 9, ... */
588 { 3, 4, 1, 2}, /* Buses 2, 6, 10 ... */
589 { 4, 1, 2, 3}, /* Buses 3, 7, 11 ... */
590};
591
592/* We have to turn on LEVEL mode for changed IRQs */
593/* All PCI IRQs need to be level mode, so this should be something
594 * other than hard-coded as well... IRQs are individually mappable
595 * to either edge or level.
596 */
597
598/*
599 * 8259 edge/level control definitions
600 */
601#define ISA8259_M_ELCR 0x4d0
602#define ISA8259_S_ELCR 0x4d1
603
604#define ELCRS_INT15_LVL 0x80
605#define ELCRS_INT14_LVL 0x40
606#define ELCRS_INT12_LVL 0x10
607#define ELCRS_INT11_LVL 0x08
608#define ELCRS_INT10_LVL 0x04
609#define ELCRS_INT9_LVL 0x02
610#define ELCRS_INT8_LVL 0x01
611#define ELCRM_INT7_LVL 0x80
612#define ELCRM_INT5_LVL 0x20
613
614#if 0
615/*
616 * PCI config space access.
617 */
618#define CFGADDR(dev) ((1<<(dev>>3)) | ((dev&7)<<8))
619#define DEVNO(dev) (dev>>3)
620
621#define MIN_DEVNR 11
622#define MAX_DEVNR 22
623
624static int
625prep_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
626 int len, u32 *val)
627{
628 struct pci_controller *hose = bus->sysdata;
629 volatile void __iomem *cfg_data;
630
631 if (bus->number != 0 || DEVNO(devfn) < MIN_DEVNR
632 || DEVNO(devfn) > MAX_DEVNR)
633 return PCIBIOS_DEVICE_NOT_FOUND;
634
635 /*
636 * Note: the caller has already checked that offset is
637 * suitably aligned and that len is 1, 2 or 4.
638 */
639 cfg_data = hose->cfg_data + CFGADDR(devfn) + offset;
640 switch (len) {
641 case 1:
642 *val = in_8(cfg_data);
643 break;
644 case 2:
645 *val = in_le16(cfg_data);
646 break;
647 default:
648 *val = in_le32(cfg_data);
649 break;
650 }
651 return PCIBIOS_SUCCESSFUL;
652}
653
654static int
655prep_write_config(struct pci_bus *bus, unsigned int devfn, int offset,
656 int len, u32 val)
657{
658 struct pci_controller *hose = bus->sysdata;
659 volatile void __iomem *cfg_data;
660
661 if (bus->number != 0 || DEVNO(devfn) < MIN_DEVNR
662 || DEVNO(devfn) > MAX_DEVNR)
663 return PCIBIOS_DEVICE_NOT_FOUND;
664
665 /*
666 * Note: the caller has already checked that offset is
667 * suitably aligned and that len is 1, 2 or 4.
668 */
669 cfg_data = hose->cfg_data + CFGADDR(devfn) + offset;
670 switch (len) {
671 case 1:
672 out_8(cfg_data, val);
673 break;
674 case 2:
675 out_le16(cfg_data, val);
676 break;
677 default:
678 out_le32(cfg_data, val);
679 break;
680 }
681 return PCIBIOS_SUCCESSFUL;
682}
683
684static struct pci_ops prep_pci_ops =
685{
686 prep_read_config,
687 prep_write_config
688};
689#endif
690
691#define MOTOROLA_CPUTYPE_REG 0x800
692#define MOTOROLA_BASETYPE_REG 0x803
693#define MPIC_RAVEN_ID 0x48010000
694#define MPIC_HAWK_ID 0x48030000
695#define MOT_PROC2_BIT 0x800
696
697static u_char prep_openpic_initsenses[] __initdata = {
698 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* MVME2600_INT_SIO */
699 (IRQ_SENSE_EDGE | IRQ_POLARITY_NEGATIVE), /* MVME2600_INT_FALCN_ECC_ERR */
700 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* MVME2600_INT_PCI_ETHERNET */
701 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* MVME2600_INT_PCI_SCSI */
702 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* MVME2600_INT_PCI_GRAPHICS */
703 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* MVME2600_INT_PCI_VME0 */
704 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* MVME2600_INT_PCI_VME1 */
705 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* MVME2600_INT_PCI_VME2 */
706 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* MVME2600_INT_PCI_VME3 */
707 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* MVME2600_INT_PCI_INTA */
708 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* MVME2600_INT_PCI_INTB */
709 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* MVME2600_INT_PCI_INTC */
710 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* MVME2600_INT_PCI_INTD */
711 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* MVME2600_INT_LM_SIG0 */
712 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* MVME2600_INT_LM_SIG1 */
713};
714
715#define MOT_RAVEN_PRESENT 0x1
716#define MOT_HAWK_PRESENT 0x2
717
718int mot_entry = -1;
719int prep_keybd_present = 1;
720int MotMPIC;
721int mot_multi;
722
723int __init
724raven_init(void)
725{
726 unsigned int devid;
727 unsigned int pci_membase;
728 unsigned char base_mod;
729
730 /* Check to see if the Raven chip exists. */
731 if ( _prep_type != _PREP_Motorola) {
732 OpenPIC_Addr = NULL;
733 return 0;
734 }
735
736 /* Check to see if this board is a type that might have a Raven. */
737 if ((inb(MOTOROLA_CPUTYPE_REG) & 0xF0) != 0xE0) {
738 OpenPIC_Addr = NULL;
739 return 0;
740 }
741
742 /* Check the first PCI device to see if it is a Raven. */
743 early_read_config_dword(NULL, 0, 0, PCI_VENDOR_ID, &devid);
744
745 switch (devid & 0xffff0000) {
746 case MPIC_RAVEN_ID:
747 MotMPIC = MOT_RAVEN_PRESENT;
748 break;
749 case MPIC_HAWK_ID:
750 MotMPIC = MOT_HAWK_PRESENT;
751 break;
752 default:
753 OpenPIC_Addr = NULL;
754 return 0;
755 }
756
757
758 /* Read the memory base register. */
759 early_read_config_dword(NULL, 0, 0, PCI_BASE_ADDRESS_1, &pci_membase);
760
761 if (pci_membase == 0) {
762 OpenPIC_Addr = NULL;
763 return 0;
764 }
765
766 /* Map the Raven MPIC registers to virtual memory. */
767 OpenPIC_Addr = ioremap(pci_membase+0xC0000000, 0x22000);
768
769 OpenPIC_InitSenses = prep_openpic_initsenses;
770 OpenPIC_NumInitSenses = sizeof(prep_openpic_initsenses);
771
772 ppc_md.get_irq = openpic_get_irq;
773
774 /* If raven is present on Motorola store the system config register
775 * for later use.
776 */
777 ProcInfo = (unsigned long *)ioremap(0xfef80400, 4);
778
779 /* Indicate to system if this is a multiprocessor board */
780 if (!(*ProcInfo & MOT_PROC2_BIT)) {
781 mot_multi = 1;
782 }
783
784 /* This is a hack. If this is a 2300 or 2400 mot board then there is
785 * no keyboard controller and we have to indicate that.
786 */
787 base_mod = inb(MOTOROLA_BASETYPE_REG);
788 if ((MotMPIC == MOT_HAWK_PRESENT) || (base_mod == 0xF9) ||
789 (base_mod == 0xFA) || (base_mod == 0xE1))
790 prep_keybd_present = 0;
791
792 return 1;
793}
794
795struct mot_info {
796 int cpu_type; /* 0x100 mask assumes for Raven and Hawk boards that the level/edge are set */
797 /* 0x200 if this board has a Hawk chip. */
798 int base_type;
799 int max_cpu; /* ored with 0x80 if this board should be checked for multi CPU */
800 const char *name;
801 unsigned char *map;
802 unsigned char *routes;
803 void (*map_non0_bus)(struct pci_dev *); /* For boards with more than bus 0 devices. */
804 struct powerplus_irq_list *pci_irq_list; /* List of PCI MPIC inputs */
805 unsigned char secondary_bridge_devfn; /* devfn of secondary bus transparent bridge */
806} mot_info[] = {
807 {0x300, 0x00, 0x00, "MVME 2400", Genesis2_pci_IRQ_map, Raven_pci_IRQ_routes, Powerplus_Map_Non0, &Powerplus_pci_IRQ_list, 0xFF},
808 {0x010, 0x00, 0x00, "Genesis", Genesis_pci_IRQ_map, Genesis_pci_IRQ_routes, Powerplus_Map_Non0, &Powerplus_pci_IRQ_list, 0x00},
809 {0x020, 0x00, 0x00, "Powerstack (Series E)", Comet_pci_IRQ_map, Comet_pci_IRQ_routes, NULL, NULL, 0x00},
810 {0x040, 0x00, 0x00, "Blackhawk (Powerstack)", Blackhawk_pci_IRQ_map, Blackhawk_pci_IRQ_routes, NULL, NULL, 0x00},
811 {0x050, 0x00, 0x00, "Omaha (PowerStack II Pro3000)", Omaha_pci_IRQ_map, Omaha_pci_IRQ_routes, NULL, NULL, 0x00},
812 {0x060, 0x00, 0x00, "Utah (Powerstack II Pro4000)", Utah_pci_IRQ_map, Utah_pci_IRQ_routes, NULL, NULL, 0x00},
813 {0x0A0, 0x00, 0x00, "Powerstack (Series EX)", Comet2_pci_IRQ_map, Comet2_pci_IRQ_routes, NULL, NULL, 0x00},
814 {0x1E0, 0xE0, 0x00, "Mesquite cPCI (MCP750)", Mesquite_pci_IRQ_map, Raven_pci_IRQ_routes, Powerplus_Map_Non0, &Mesquite_pci_IRQ_list, 0xFF},
815 {0x1E0, 0xE1, 0x00, "Sitka cPCI (MCPN750)", Sitka_pci_IRQ_map, Raven_pci_IRQ_routes, Powerplus_Map_Non0, &Powerplus_pci_IRQ_list, 0xFF},
816 {0x1E0, 0xE2, 0x00, "Mesquite cPCI (MCP750) w/ HAC", Mesquite_pci_IRQ_map, Raven_pci_IRQ_routes, Powerplus_Map_Non0, &Mesquite_pci_IRQ_list, 0xC0},
817 {0x1E0, 0xF6, 0x80, "MTX Plus", MTXplus_pci_IRQ_map, Raven_pci_IRQ_routes, Powerplus_Map_Non0, &Powerplus_pci_IRQ_list, 0xA0},
818 {0x1E0, 0xF6, 0x81, "Dual MTX Plus", MTXplus_pci_IRQ_map, Raven_pci_IRQ_routes, Powerplus_Map_Non0, &Powerplus_pci_IRQ_list, 0xA0},
819 {0x1E0, 0xF7, 0x80, "MTX wo/ Parallel Port", MTX_pci_IRQ_map, Raven_pci_IRQ_routes, Powerplus_Map_Non0, &Powerplus_pci_IRQ_list, 0x00},
820 {0x1E0, 0xF7, 0x81, "Dual MTX wo/ Parallel Port", MTX_pci_IRQ_map, Raven_pci_IRQ_routes, Powerplus_Map_Non0, &Powerplus_pci_IRQ_list, 0x00},
821 {0x1E0, 0xF8, 0x80, "MTX w/ Parallel Port", MTX_pci_IRQ_map, Raven_pci_IRQ_routes, Powerplus_Map_Non0, &Powerplus_pci_IRQ_list, 0x00},
822 {0x1E0, 0xF8, 0x81, "Dual MTX w/ Parallel Port", MTX_pci_IRQ_map, Raven_pci_IRQ_routes, Powerplus_Map_Non0, &Powerplus_pci_IRQ_list, 0x00},
823 {0x1E0, 0xF9, 0x00, "MVME 2300", Genesis2_pci_IRQ_map, Raven_pci_IRQ_routes, Powerplus_Map_Non0, &Powerplus_pci_IRQ_list, 0xFF},
824 {0x1E0, 0xFA, 0x00, "MVME 2300SC/2600", Genesis2_pci_IRQ_map, Raven_pci_IRQ_routes, Powerplus_Map_Non0, &Powerplus_pci_IRQ_list, 0xFF},
825 {0x1E0, 0xFB, 0x00, "MVME 2600 with MVME712M", Genesis2_pci_IRQ_map, Raven_pci_IRQ_routes, Powerplus_Map_Non0, &Powerplus_pci_IRQ_list, 0xFF},
826 {0x1E0, 0xFC, 0x00, "MVME 2600/2700 with MVME761", Genesis2_pci_IRQ_map, Raven_pci_IRQ_routes, Powerplus_Map_Non0, &Powerplus_pci_IRQ_list, 0xFF},
827 {0x1E0, 0xFD, 0x80, "MVME 3600 with MVME712M", Genesis2_pci_IRQ_map, Raven_pci_IRQ_routes, Powerplus_Map_Non0, &Powerplus_pci_IRQ_list, 0x00},
828 {0x1E0, 0xFD, 0x81, "MVME 4600 with MVME712M", Genesis2_pci_IRQ_map, Raven_pci_IRQ_routes, Powerplus_Map_Non0, &Powerplus_pci_IRQ_list, 0xFF},
829 {0x1E0, 0xFE, 0x80, "MVME 3600 with MVME761", Genesis2_pci_IRQ_map, Raven_pci_IRQ_routes, Powerplus_Map_Non0, &Powerplus_pci_IRQ_list, 0xFF},
830 {0x1E0, 0xFE, 0x81, "MVME 4600 with MVME761", Genesis2_pci_IRQ_map, Raven_pci_IRQ_routes, Powerplus_Map_Non0, &Powerplus_pci_IRQ_list, 0xFF},
831 {0x1E0, 0xFF, 0x00, "MVME 1600-001 or 1600-011", Genesis2_pci_IRQ_map, Raven_pci_IRQ_routes, Powerplus_Map_Non0, &Powerplus_pci_IRQ_list, 0xFF},
832 {0x000, 0x00, 0x00, "", NULL, NULL, NULL, NULL, 0x00}
833};
834
835void __init
836ibm_prep_init(void)
837{
838 if (have_residual_data) {
839 u32 addr, real_addr, len, offset;
840 PPC_DEVICE *mpic;
841 PnP_TAG_PACKET *pkt;
842
843 /* Use the PReP residual data to determine if an OpenPIC is
844 * present. If so, get the large vendor packet which will
845 * tell us the base address and length in memory.
846 * If we are successful, ioremap the memory area and set
847 * OpenPIC_Addr (this indicates that the OpenPIC was found).
848 */
849 mpic = residual_find_device(-1, NULL, SystemPeripheral,
850 ProgrammableInterruptController, MPIC, 0);
851 if (!mpic)
852 return;
853
854 pkt = PnP_find_large_vendor_packet(res->DevicePnPHeap +
855 mpic->AllocatedOffset, 9, 0);
856
857 if (!pkt)
858 return;
859
860#define p pkt->L4_Pack.L4_Data.L4_PPCPack
861 if (p.PPCData[1] == 32) {
862 switch (p.PPCData[0]) {
863 case 1: offset = PREP_ISA_IO_BASE; break;
864 case 2: offset = PREP_ISA_MEM_BASE; break;
865 default: return; /* Not I/O or memory?? */
866 }
867 }
868 else
869 return; /* Not a 32-bit address */
870
871 real_addr = ld_le32((unsigned int *) (p.PPCData + 4));
872 if (real_addr == 0xffffffff)
873 return;
874
875 /* Adjust address to be as seen by CPU */
876 addr = real_addr + offset;
877
878 len = ld_le32((unsigned int *) (p.PPCData + 12));
879 if (!len)
880 return;
881#undef p
882 OpenPIC_Addr = ioremap(addr, len);
883 ppc_md.get_irq = openpic_get_irq;
884
885 OpenPIC_InitSenses = prep_openpic_initsenses;
886 OpenPIC_NumInitSenses = sizeof(prep_openpic_initsenses);
887
888 printk(KERN_INFO "MPIC at 0x%08x (0x%08x), length 0x%08x "
889 "mapped to 0x%p\n", addr, real_addr, len, OpenPIC_Addr);
890 }
891}
892
893static void __init
894ibm43p_pci_map_non0(struct pci_dev *dev)
895{
896 unsigned char intpin;
897 static unsigned char bridge_intrs[4] = { 3, 4, 5, 8 };
898
899 if (dev == NULL)
900 return;
901 pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &intpin);
902 if (intpin < 1 || intpin > 4)
903 return;
904 intpin = (PCI_SLOT(dev->devfn) + intpin - 1) & 3;
905 dev->irq = openpic_to_irq(bridge_intrs[intpin]);
906 pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq);
907}
908
909void __init
910prep_residual_setup_pci(char *irq_edge_mask_lo, char *irq_edge_mask_hi)
911{
912 if (have_residual_data) {
913 Motherboard_map_name = res->VitalProductData.PrintableModel;
914 Motherboard_map = NULL;
915 Motherboard_routes = NULL;
916 residual_irq_mask(irq_edge_mask_lo, irq_edge_mask_hi);
917 }
918}
919
920void __init
921prep_sandalfoot_setup_pci(char *irq_edge_mask_lo, char *irq_edge_mask_hi)
922{
923 Motherboard_map_name = "IBM 6015/7020 (Sandalfoot/Sandalbow)";
924 Motherboard_map = ibm6015_pci_IRQ_map;
925 Motherboard_routes = ibm6015_pci_IRQ_routes;
926 *irq_edge_mask_lo = 0x00; /* IRQs 0-7 all edge-triggered */
927 *irq_edge_mask_hi = 0xA0; /* IRQs 13, 15 level-triggered */
928}
929
930void __init
931prep_thinkpad_setup_pci(char *irq_edge_mask_lo, char *irq_edge_mask_hi)
932{
933 Motherboard_map_name = "IBM Thinkpad 850/860";
934 Motherboard_map = Nobis_pci_IRQ_map;
935 Motherboard_routes = Nobis_pci_IRQ_routes;
936 *irq_edge_mask_lo = 0x00; /* IRQs 0-7 all edge-triggered */
937 *irq_edge_mask_hi = 0xA0; /* IRQs 13, 15 level-triggered */
938}
939
940void __init
941prep_carolina_setup_pci(char *irq_edge_mask_lo, char *irq_edge_mask_hi)
942{
943 Motherboard_map_name = "IBM 7248, PowerSeries 830/850 (Carolina)";
944 Motherboard_map = ibm8xx_pci_IRQ_map;
945 Motherboard_routes = ibm8xx_pci_IRQ_routes;
946 *irq_edge_mask_lo = 0x00; /* IRQs 0-7 all edge-triggered */
947 *irq_edge_mask_hi = 0xA4; /* IRQs 10, 13, 15 level-triggered */
948}
949
950void __init
951prep_tiger1_setup_pci(char *irq_edge_mask_lo, char *irq_edge_mask_hi)
952{
953 Motherboard_map_name = "IBM 43P-140 (Tiger1)";
954 Motherboard_map = ibm43p_pci_IRQ_map;
955 Motherboard_routes = ibm43p_pci_IRQ_routes;
956 Motherboard_non0 = ibm43p_pci_map_non0;
957 *irq_edge_mask_lo = 0x00; /* IRQs 0-7 all edge-triggered */
958 *irq_edge_mask_hi = 0xA0; /* IRQs 13, 15 level-triggered */
959}
960
961void __init
962prep_route_pci_interrupts(void)
963{
964 unsigned char *ibc_pirq = (unsigned char *)0x80800860;
965 unsigned char *ibc_pcicon = (unsigned char *)0x80800840;
966 int i;
967
968 if ( _prep_type == _PREP_Motorola)
969 {
970 unsigned short irq_mode;
971 unsigned char cpu_type;
972 unsigned char base_mod;
973 int entry;
974
975 cpu_type = inb(MOTOROLA_CPUTYPE_REG) & 0xF0;
976 base_mod = inb(MOTOROLA_BASETYPE_REG);
977
978 for (entry = 0; mot_info[entry].cpu_type != 0; entry++) {
979 if (mot_info[entry].cpu_type & 0x200) { /* Check for Hawk chip */
980 if (!(MotMPIC & MOT_HAWK_PRESENT))
981 continue;
982 } else { /* Check non hawk boards */
983 if ((mot_info[entry].cpu_type & 0xff) != cpu_type)
984 continue;
985
986 if (mot_info[entry].base_type == 0) {
987 mot_entry = entry;
988 break;
989 }
990
991 if (mot_info[entry].base_type != base_mod)
992 continue;
993 }
994
995 if (!(mot_info[entry].max_cpu & 0x80)) {
996 mot_entry = entry;
997 break;
998 }
999
1000 /* processor 1 not present and max processor zero indicated */
1001 if ((*ProcInfo & MOT_PROC2_BIT) && !(mot_info[entry].max_cpu & 0x7f)) {
1002 mot_entry = entry;
1003 break;
1004 }
1005
1006 /* processor 1 present and max processor zero indicated */
1007 if (!(*ProcInfo & MOT_PROC2_BIT) && (mot_info[entry].max_cpu & 0x7f)) {
1008 mot_entry = entry;
1009 break;
1010 }
1011 }
1012
1013 if (mot_entry == -1) /* No particular cpu type found - assume Blackhawk */
1014 mot_entry = 3;
1015
1016 Motherboard_map_name = (unsigned char *)mot_info[mot_entry].name;
1017 Motherboard_map = mot_info[mot_entry].map;
1018 Motherboard_routes = mot_info[mot_entry].routes;
1019 Motherboard_non0 = mot_info[mot_entry].map_non0_bus;
1020
1021 if (!(mot_info[entry].cpu_type & 0x100)) {
1022 /* AJF adjust level/edge control according to routes */
1023 irq_mode = 0;
1024 for (i = 1; i <= 4; i++)
1025 irq_mode |= ( 1 << Motherboard_routes[i] );
1026 outb( irq_mode & 0xff, 0x4d0 );
1027 outb( (irq_mode >> 8) & 0xff, 0x4d1 );
1028 }
1029 } else if ( _prep_type == _PREP_IBM ) {
1030 unsigned char irq_edge_mask_lo, irq_edge_mask_hi;
1031 unsigned short irq_edge_mask;
1032 int i;
1033
1034 setup_ibm_pci(&irq_edge_mask_lo, &irq_edge_mask_hi);
1035
1036 outb(inb(0x04d0)|irq_edge_mask_lo, 0x4d0); /* primary 8259 */
1037 outb(inb(0x04d1)|irq_edge_mask_hi, 0x4d1); /* cascaded 8259 */
1038
1039 irq_edge_mask = (irq_edge_mask_hi << 8) | irq_edge_mask_lo;
1040 for (i = 0; i < 16; ++i, irq_edge_mask >>= 1)
1041 if (irq_edge_mask & 1)
1042 irq_desc[i].status |= IRQ_LEVEL;
1043 } else {
1044 printk("No known machine pci routing!\n");
1045 return;
1046 }
1047
1048 /* Set up mapping from slots */
1049 if (Motherboard_routes) {
1050 for (i = 1; i <= 4; i++)
1051 ibc_pirq[i-1] = Motherboard_routes[i];
1052
1053 /* Enable PCI interrupts */
1054 *ibc_pcicon |= 0x20;
1055 }
1056}
1057
1058void __init
1059prep_pib_init(void)
1060{
1061 unsigned char reg;
1062 unsigned short short_reg;
1063
1064 struct pci_dev *dev = NULL;
1065
1066 if (( _prep_type == _PREP_Motorola) && (OpenPIC_Addr)) {
1067 /*
1068 * Perform specific configuration for the Via Tech or
1069 * or Winbond PCI-ISA-Bridge part.
1070 */
1071 if ((dev = pci_get_device(PCI_VENDOR_ID_VIA,
1072 PCI_DEVICE_ID_VIA_82C586_1, dev))) {
1073 /*
1074 * PPCBUG does not set the enable bits
1075 * for the IDE device. Force them on here.
1076 */
1077 pci_read_config_byte(dev, 0x40, &reg);
1078
1079 reg |= 0x03; /* IDE: Chip Enable Bits */
1080 pci_write_config_byte(dev, 0x40, reg);
1081 }
1082 if ((dev = pci_get_device(PCI_VENDOR_ID_VIA,
1083 PCI_DEVICE_ID_VIA_82C586_2,
1084 dev)) && (dev->devfn = 0x5a)) {
1085 /* Force correct USB interrupt */
1086 dev->irq = 11;
1087 pci_write_config_byte(dev,
1088 PCI_INTERRUPT_LINE,
1089 dev->irq);
1090 }
1091 if ((dev = pci_get_device(PCI_VENDOR_ID_WINBOND,
1092 PCI_DEVICE_ID_WINBOND_83C553, dev))) {
1093 /* Clear PCI Interrupt Routing Control Register. */
1094 short_reg = 0x0000;
1095 pci_write_config_word(dev, 0x44, short_reg);
1096 if (OpenPIC_Addr){
1097 /* Route IDE interrupts to IRQ 14 */
1098 reg = 0xEE;
1099 pci_write_config_byte(dev, 0x43, reg);
1100 }
1101 }
1102 }
1103
1104 if ((dev = pci_get_device(PCI_VENDOR_ID_WINBOND,
1105 PCI_DEVICE_ID_WINBOND_82C105, dev))){
1106 if (OpenPIC_Addr){
1107 /*
1108 * Disable LEGIRQ mode so PCI INTS are routed
1109 * directly to the 8259 and enable both channels
1110 */
1111 pci_write_config_dword(dev, 0x40, 0x10ff0033);
1112
1113 /* Force correct IDE interrupt */
1114 dev->irq = 14;
1115 pci_write_config_byte(dev,
1116 PCI_INTERRUPT_LINE,
1117 dev->irq);
1118 } else {
1119 /* Enable LEGIRQ for PCI INT -> 8259 IRQ routing */
1120 pci_write_config_dword(dev, 0x40, 0x10ff08a1);
1121 }
1122 }
1123 pci_dev_put(dev);
1124}
1125
1126static void __init
1127Powerplus_Map_Non0(struct pci_dev *dev)
1128{
1129 struct pci_bus *pbus; /* Parent bus structure pointer */
1130 struct pci_dev *tdev = dev; /* Temporary device structure */
1131 unsigned int devnum; /* Accumulated device number */
1132 unsigned char intline; /* Linux interrupt value */
1133 unsigned char intpin; /* PCI interrupt pin */
1134
1135 /* Check for valid PCI dev pointer */
1136 if (dev == NULL) return;
1137
1138 /* Initialize bridge IDSEL variable */
1139 devnum = PCI_SLOT(tdev->devfn);
1140
1141 /* Read the interrupt pin of the device and adjust for indexing */
1142 pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &intpin);
1143
1144 /* If device doesn't request an interrupt, return */
1145 if ( (intpin < 1) || (intpin > 4) )
1146 return;
1147
1148 intpin--;
1149
1150 /*
1151 * Walk up to bus 0, adjusting the interrupt pin for the standard
1152 * PCI bus swizzle.
1153 */
1154 do {
1155 intpin = (prep_pci_intpins[devnum % 4][intpin]) - 1;
1156 pbus = tdev->bus; /* up one level */
1157 tdev = pbus->self;
1158 devnum = PCI_SLOT(tdev->devfn);
1159 } while(tdev->bus->number);
1160
1161 /* Use the primary interrupt inputs by default */
1162 intline = mot_info[mot_entry].pci_irq_list->primary[intpin];
1163
1164 /*
1165 * If the board has secondary interrupt inputs, walk the bus and
1166 * note the devfn of the bridge from bus 0. If it is the same as
1167 * the devfn of the bus bridge with secondary inputs, use those.
1168 * Otherwise, assume it's a PMC site and get the interrupt line
1169 * value from the interrupt routing table.
1170 */
1171 if (mot_info[mot_entry].secondary_bridge_devfn) {
1172 pbus = dev->bus;
1173
1174 while (pbus->primary != 0)
1175 pbus = pbus->parent;
1176
1177 if ((pbus->self)->devfn != 0xA0) {
1178 if ((pbus->self)->devfn == mot_info[mot_entry].secondary_bridge_devfn)
1179 intline = mot_info[mot_entry].pci_irq_list->secondary[intpin];
1180 else {
1181 if ((char *)(mot_info[mot_entry].map) == (char *)Mesquite_pci_IRQ_map)
1182 intline = mot_info[mot_entry].map[((pbus->self)->devfn)/8] + 16;
1183 else {
1184 int i;
1185 for (i=0;i<3;i++)
1186 intpin = (prep_pci_intpins[devnum % 4][intpin]) - 1;
1187 intline = mot_info[mot_entry].pci_irq_list->primary[intpin];
1188 }
1189 }
1190 }
1191 }
1192
1193 /* Write calculated interrupt value to header and device list */
1194 dev->irq = intline;
1195 pci_write_config_byte(dev, PCI_INTERRUPT_LINE, (u8)dev->irq);
1196}
1197
1198void __init
1199prep_pcibios_fixup(void)
1200{
1201 struct pci_dev *dev = NULL;
1202 int irq;
1203 int have_openpic = (OpenPIC_Addr != NULL);
1204
1205 prep_route_pci_interrupts();
1206
1207 printk("Setting PCI interrupts for a \"%s\"\n", Motherboard_map_name);
1208
1209 /* Iterate through all the PCI devices, setting the IRQ */
1210 for_each_pci_dev(dev) {
1211 /*
1212 * If we have residual data, then this is easy: query the
1213 * residual data for the IRQ line allocated to the device.
1214 * This works the same whether we have an OpenPic or not.
1215 */
1216 if (have_residual_data) {
1217 irq = residual_pcidev_irq(dev);
1218 dev->irq = have_openpic ? openpic_to_irq(irq) : irq;
1219 }
1220 /*
1221 * If we don't have residual data, then we need to use
1222 * tables to determine the IRQ. The table organisation
1223 * is different depending on whether there is an OpenPIC
1224 * or not. The tables are only used for bus 0, so check
1225 * this first.
1226 */
1227 else if (dev->bus->number == 0) {
1228 irq = Motherboard_map[PCI_SLOT(dev->devfn)];
1229 dev->irq = have_openpic ? openpic_to_irq(irq)
1230 : Motherboard_routes[irq];
1231 }
1232 /*
1233 * Finally, if we don't have residual data and the bus is
1234 * non-zero, use the callback (if provided)
1235 */
1236 else {
1237 if (Motherboard_non0 != NULL)
1238 Motherboard_non0(dev);
1239
1240 continue;
1241 }
1242
1243 pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq);
1244 }
1245
1246 /* Setup the Winbond or Via PIB - prep_pib_init() is coded for
1247 * the non-openpic case, but it breaks (at least) the Utah
1248 * (Powerstack II Pro4000), so only call it if we have an
1249 * openpic.
1250 */
1251 if (have_openpic)
1252 prep_pib_init();
1253}
1254
1255static void __init
1256prep_pcibios_after_init(void)
1257{
1258#if 0
1259 struct pci_dev *dev;
1260
1261 /* If there is a WD 90C, reset the IO BAR to 0x0 (it started that
1262 * way, but the PCI layer relocated it because it thought 0x0 was
1263 * invalid for a BAR).
1264 * If you don't do this, the card's VGA base will be <IO BAR>+0xc0000
1265 * instead of 0xc0000. vgacon.c (for example) is completely unaware of
1266 * this little quirk.
1267 */
1268 dev = pci_get_device(PCI_VENDOR_ID_WD, PCI_DEVICE_ID_WD_90C, NULL);
1269 if (dev) {
1270 dev->resource[1].end -= dev->resource[1].start;
1271 dev->resource[1].start = 0;
1272 /* tell the hardware */
1273 pci_write_config_dword(dev, PCI_BASE_ADDRESS_1, 0x0);
1274 pci_dev_put(dev);
1275 }
1276#endif
1277}
1278
1279static void __init
1280prep_init_resource(struct resource *res, unsigned long start,
1281 unsigned long end, int flags)
1282{
1283 res->flags = flags;
1284 res->start = start;
1285 res->end = end;
1286 res->name = "PCI host bridge";
1287 res->parent = NULL;
1288 res->sibling = NULL;
1289 res->child = NULL;
1290}
1291
1292void __init
1293prep_find_bridges(void)
1294{
1295 struct pci_controller* hose;
1296
1297 hose = pcibios_alloc_controller();
1298 if (!hose)
1299 return;
1300
1301 hose->first_busno = 0;
1302 hose->last_busno = 0xff;
1303 hose->pci_mem_offset = PREP_ISA_MEM_BASE;
1304 hose->io_base_phys = PREP_ISA_IO_BASE;
1305 hose->io_base_virt = ioremap(PREP_ISA_IO_BASE, 0x800000);
1306 prep_init_resource(&hose->io_resource, 0, 0x007fffff, IORESOURCE_IO);
1307 prep_init_resource(&hose->mem_resources[0], 0xc0000000, 0xfeffffff,
1308 IORESOURCE_MEM);
1309 setup_indirect_pci(hose, PREP_ISA_IO_BASE + 0xcf8,
1310 PREP_ISA_IO_BASE + 0xcfc);
1311
1312 printk("PReP architecture\n");
1313
1314 if (have_residual_data) {
1315 PPC_DEVICE *hostbridge;
1316
1317 hostbridge = residual_find_device(PROCESSORDEVICE, NULL,
1318 BridgeController, PCIBridge, -1, 0);
1319 if (hostbridge &&
1320 ((hostbridge->DeviceId.Interface == PCIBridgeIndirect) ||
1321 (hostbridge->DeviceId.Interface == PCIBridgeRS6K))) {
1322 PnP_TAG_PACKET * pkt;
1323 pkt = PnP_find_large_vendor_packet(
1324 res->DevicePnPHeap+hostbridge->AllocatedOffset,
1325 3, 0);
1326 if(pkt) {
1327#define p pkt->L4_Pack.L4_Data.L4_PPCPack
1328 setup_indirect_pci(hose,
1329 ld_le32((unsigned *) (p.PPCData)),
1330 ld_le32((unsigned *) (p.PPCData+8)));
1331#undef p
1332 } else
1333 setup_indirect_pci(hose, 0x80000cf8, 0x80000cfc);
1334 }
1335 }
1336
1337 ppc_md.pcibios_fixup = prep_pcibios_fixup;
1338 ppc_md.pcibios_after_init = prep_pcibios_after_init;
1339}
diff --git a/arch/ppc/platforms/prep_setup.c b/arch/ppc/platforms/prep_setup.c
deleted file mode 100644
index 465b658c927d..000000000000
--- a/arch/ppc/platforms/prep_setup.c
+++ /dev/null
@@ -1,1043 +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 * Support for PReP (Motorola MTX/MVME)
7 * by Troy Benjegerdes (hozer@drgw.net)
8 */
9
10/*
11 * bootup setup stuff..
12 */
13
14#include <linux/delay.h>
15#include <linux/module.h>
16#include <linux/errno.h>
17#include <linux/sched.h>
18#include <linux/kernel.h>
19#include <linux/mm.h>
20#include <linux/stddef.h>
21#include <linux/unistd.h>
22#include <linux/ptrace.h>
23#include <linux/slab.h>
24#include <linux/user.h>
25#include <linux/a.out.h>
26#include <linux/screen_info.h>
27#include <linux/major.h>
28#include <linux/interrupt.h>
29#include <linux/reboot.h>
30#include <linux/init.h>
31#include <linux/initrd.h>
32#include <linux/ioport.h>
33#include <linux/console.h>
34#include <linux/timex.h>
35#include <linux/pci.h>
36#include <linux/seq_file.h>
37#include <linux/root_dev.h>
38
39#include <asm/sections.h>
40#include <asm/mmu.h>
41#include <asm/processor.h>
42#include <asm/residual.h>
43#include <asm/io.h>
44#include <asm/pgtable.h>
45#include <asm/cache.h>
46#include <asm/dma.h>
47#include <asm/machdep.h>
48#include <asm/mc146818rtc.h>
49#include <asm/mk48t59.h>
50#include <asm/prep_nvram.h>
51#include <asm/raven.h>
52#include <asm/vga.h>
53#include <asm/time.h>
54#include <asm/mpc10x.h>
55#include <asm/i8259.h>
56#include <asm/open_pic.h>
57#include <asm/pci-bridge.h>
58#include <asm/todc.h>
59
60/* prep registers for L2 */
61#define CACHECRBA 0x80000823 /* Cache configuration register address */
62#define L2CACHE_MASK 0x03 /* Mask for 2 L2 Cache bits */
63#define L2CACHE_512KB 0x00 /* 512KB */
64#define L2CACHE_256KB 0x01 /* 256KB */
65#define L2CACHE_1MB 0x02 /* 1MB */
66#define L2CACHE_NONE 0x03 /* NONE */
67#define L2CACHE_PARITY 0x08 /* Mask for L2 Cache Parity Protected bit */
68
69TODC_ALLOC();
70
71extern unsigned char prep_nvram_read_val(int addr);
72extern void prep_nvram_write_val(int addr,
73 unsigned char val);
74extern unsigned char rs_nvram_read_val(int addr);
75extern void rs_nvram_write_val(int addr,
76 unsigned char val);
77extern void ibm_prep_init(void);
78
79extern void prep_find_bridges(void);
80
81int _prep_type;
82
83extern void prep_residual_setup_pci(char *irq_edge_mask_lo, char *irq_edge_mask_hi);
84extern void prep_sandalfoot_setup_pci(char *irq_edge_mask_lo, char *irq_edge_mask_hi);
85extern void prep_thinkpad_setup_pci(char *irq_edge_mask_lo, char *irq_edge_mask_hi);
86extern void prep_carolina_setup_pci(char *irq_edge_mask_lo, char *irq_edge_mask_hi);
87extern void prep_tiger1_setup_pci(char *irq_edge_mask_lo, char *irq_edge_mask_hi);
88
89
90#define cached_21 (((char *)(ppc_cached_irq_mask))[3])
91#define cached_A1 (((char *)(ppc_cached_irq_mask))[2])
92
93extern PTE *Hash, *Hash_end;
94extern unsigned long Hash_size, Hash_mask;
95extern int probingmem;
96extern unsigned long loops_per_jiffy;
97
98/* useful ISA ports */
99#define PREP_SYSCTL 0x81c
100/* present in the IBM reference design; possibly identical in Mot boxes: */
101#define PREP_IBM_SIMM_ID 0x803 /* SIMM size: 32 or 8 MiB */
102#define PREP_IBM_SIMM_PRESENCE 0x804
103#define PREP_IBM_EQUIPMENT 0x80c
104#define PREP_IBM_L2INFO 0x80d
105#define PREP_IBM_PM1 0x82a /* power management register 1 */
106#define PREP_IBM_PLANAR 0x852 /* planar ID - identifies the motherboard */
107#define PREP_IBM_DISP 0x8c0 /* 4-digit LED display */
108
109/* Equipment Present Register masks: */
110#define PREP_IBM_EQUIPMENT_RESERVED 0x80
111#define PREP_IBM_EQUIPMENT_SCSIFUSE 0x40
112#define PREP_IBM_EQUIPMENT_L2_COPYBACK 0x08
113#define PREP_IBM_EQUIPMENT_L2_256 0x04
114#define PREP_IBM_EQUIPMENT_CPU 0x02
115#define PREP_IBM_EQUIPMENT_L2 0x01
116
117/* planar ID values: */
118/* Sandalfoot/Sandalbow (6015/7020) */
119#define PREP_IBM_SANDALFOOT 0xfc
120/* Woodfield, Thinkpad 850/860 (6042/7249) */
121#define PREP_IBM_THINKPAD 0xff /* planar ID unimplemented */
122/* PowerSeries 830/850 (6050/6070) */
123#define PREP_IBM_CAROLINA_IDE_0 0xf0
124#define PREP_IBM_CAROLINA_IDE_1 0xf1
125#define PREP_IBM_CAROLINA_IDE_2 0xf2
126#define PREP_IBM_CAROLINA_IDE_3 0xf3
127/* 7248-43P */
128#define PREP_IBM_CAROLINA_SCSI_0 0xf4
129#define PREP_IBM_CAROLINA_SCSI_1 0xf5
130#define PREP_IBM_CAROLINA_SCSI_2 0xf6
131#define PREP_IBM_CAROLINA_SCSI_3 0xf7 /* missing from Carolina Tech Spec */
132/* Tiger1 (7043-140) */
133#define PREP_IBM_TIGER1_133 0xd1
134#define PREP_IBM_TIGER1_166 0xd2
135#define PREP_IBM_TIGER1_180 0xd3
136#define PREP_IBM_TIGER1_xxx 0xd4 /* unknown, but probably exists */
137#define PREP_IBM_TIGER1_333 0xd5 /* missing from Tiger Tech Spec */
138
139/* setup_ibm_pci:
140 * set Motherboard_map_name, Motherboard_map, Motherboard_routes.
141 * return 8259 edge/level masks.
142 */
143void (*setup_ibm_pci)(char *irq_lo, char *irq_hi);
144
145extern char *Motherboard_map_name; /* for use in *_cpuinfo */
146
147/*
148 * As found in the PReP reference implementation.
149 * Used by Thinkpad, Sandalfoot (6015/7020), and all Motorola PReP.
150 */
151static void __init
152prep_gen_enable_l2(void)
153{
154 outb(inb(PREP_SYSCTL) | 0x3, PREP_SYSCTL);
155}
156
157/* Used by Carolina and Tiger1 */
158static void __init
159prep_carolina_enable_l2(void)
160{
161 outb(inb(PREP_SYSCTL) | 0xc0, PREP_SYSCTL);
162}
163
164/* cpuinfo code common to all IBM PReP */
165static void
166prep_ibm_cpuinfo(struct seq_file *m)
167{
168 unsigned int equip_reg = inb(PREP_IBM_EQUIPMENT);
169
170 seq_printf(m, "machine\t\t: PReP %s\n", Motherboard_map_name);
171
172 seq_printf(m, "upgrade cpu\t: ");
173 if (equip_reg & PREP_IBM_EQUIPMENT_CPU) {
174 seq_printf(m, "not ");
175 }
176 seq_printf(m, "present\n");
177
178 /* print info about the SCSI fuse */
179 seq_printf(m, "scsi fuse\t: ");
180 if (equip_reg & PREP_IBM_EQUIPMENT_SCSIFUSE)
181 seq_printf(m, "ok");
182 else
183 seq_printf(m, "bad");
184 seq_printf(m, "\n");
185
186 /* print info about SIMMs */
187 if (have_residual_data) {
188 int i;
189 seq_printf(m, "simms\t\t: ");
190 for (i = 0; (res->ActualNumMemories) && (i < MAX_MEMS); i++) {
191 if (res->Memories[i].SIMMSize != 0)
192 seq_printf(m, "%d:%ldMiB ", i,
193 (res->Memories[i].SIMMSize > 1024) ?
194 res->Memories[i].SIMMSize>>20 :
195 res->Memories[i].SIMMSize);
196 }
197 seq_printf(m, "\n");
198 }
199}
200
201static int
202prep_gen_cpuinfo(struct seq_file *m)
203{
204 prep_ibm_cpuinfo(m);
205 return 0;
206}
207
208static int
209prep_sandalfoot_cpuinfo(struct seq_file *m)
210{
211 unsigned int equip_reg = inb(PREP_IBM_EQUIPMENT);
212
213 prep_ibm_cpuinfo(m);
214
215 /* report amount and type of L2 cache present */
216 seq_printf(m, "L2 cache\t: ");
217 if (equip_reg & PREP_IBM_EQUIPMENT_L2) {
218 seq_printf(m, "not present");
219 } else {
220 if (equip_reg & PREP_IBM_EQUIPMENT_L2_256)
221 seq_printf(m, "256KiB");
222 else
223 seq_printf(m, "unknown size");
224
225 if (equip_reg & PREP_IBM_EQUIPMENT_L2_COPYBACK)
226 seq_printf(m, ", copy-back");
227 else
228 seq_printf(m, ", write-through");
229 }
230 seq_printf(m, "\n");
231
232 return 0;
233}
234
235static int
236prep_thinkpad_cpuinfo(struct seq_file *m)
237{
238 unsigned int equip_reg = inb(PREP_IBM_EQUIPMENT);
239 char *cpubus_speed, *pci_speed;
240
241 prep_ibm_cpuinfo(m);
242
243 /* report amount and type of L2 cache present */
244 seq_printf(m, "l2 cache\t: ");
245 if ((equip_reg & 0x1) == 0) {
246 switch ((equip_reg & 0xc) >> 2) {
247 case 0x0:
248 seq_printf(m, "128KiB look-aside 2-way write-through\n");
249 break;
250 case 0x1:
251 seq_printf(m, "512KiB look-aside direct-mapped write-back\n");
252 break;
253 case 0x2:
254 seq_printf(m, "256KiB look-aside 2-way write-through\n");
255 break;
256 case 0x3:
257 seq_printf(m, "256KiB look-aside direct-mapped write-back\n");
258 break;
259 }
260 } else {
261 seq_printf(m, "not present\n");
262 }
263
264 /* report bus speeds because we can */
265 if ((equip_reg & 0x80) == 0) {
266 switch ((equip_reg & 0x30) >> 4) {
267 case 0x1:
268 cpubus_speed = "50";
269 pci_speed = "25";
270 break;
271 case 0x3:
272 cpubus_speed = "66";
273 pci_speed = "33";
274 break;
275 default:
276 cpubus_speed = "unknown";
277 pci_speed = "unknown";
278 break;
279 }
280 } else {
281 switch ((equip_reg & 0x30) >> 4) {
282 case 0x1:
283 cpubus_speed = "25";
284 pci_speed = "25";
285 break;
286 case 0x2:
287 cpubus_speed = "60";
288 pci_speed = "30";
289 break;
290 case 0x3:
291 cpubus_speed = "33";
292 pci_speed = "33";
293 break;
294 default:
295 cpubus_speed = "unknown";
296 pci_speed = "unknown";
297 break;
298 }
299 }
300 seq_printf(m, "60x bus\t\t: %sMHz\n", cpubus_speed);
301 seq_printf(m, "pci bus\t\t: %sMHz\n", pci_speed);
302
303 return 0;
304}
305
306static int
307prep_carolina_cpuinfo(struct seq_file *m)
308{
309 unsigned int equip_reg = inb(PREP_IBM_EQUIPMENT);
310
311 prep_ibm_cpuinfo(m);
312
313 /* report amount and type of L2 cache present */
314 seq_printf(m, "l2 cache\t: ");
315 if ((equip_reg & 0x1) == 0) {
316 unsigned int l2_reg = inb(PREP_IBM_L2INFO);
317
318 /* L2 size */
319 if ((l2_reg & 0x60) == 0)
320 seq_printf(m, "256KiB");
321 else if ((l2_reg & 0x60) == 0x20)
322 seq_printf(m, "512KiB");
323 else
324 seq_printf(m, "unknown size");
325
326 /* L2 type */
327 if ((l2_reg & 0x3) == 0)
328 seq_printf(m, ", async");
329 else if ((l2_reg & 0x3) == 1)
330 seq_printf(m, ", sync");
331 else
332 seq_printf(m, ", unknown type");
333
334 seq_printf(m, "\n");
335 } else {
336 seq_printf(m, "not present\n");
337 }
338
339 return 0;
340}
341
342static int
343prep_tiger1_cpuinfo(struct seq_file *m)
344{
345 unsigned int l2_reg = inb(PREP_IBM_L2INFO);
346
347 prep_ibm_cpuinfo(m);
348
349 /* report amount and type of L2 cache present */
350 seq_printf(m, "l2 cache\t: ");
351 if ((l2_reg & 0xf) == 0xf) {
352 seq_printf(m, "not present\n");
353 } else {
354 if (l2_reg & 0x8)
355 seq_printf(m, "async, ");
356 else
357 seq_printf(m, "sync burst, ");
358
359 if (l2_reg & 0x4)
360 seq_printf(m, "parity, ");
361 else
362 seq_printf(m, "no parity, ");
363
364 switch (l2_reg & 0x3) {
365 case 0x0:
366 seq_printf(m, "256KiB\n");
367 break;
368 case 0x1:
369 seq_printf(m, "512KiB\n");
370 break;
371 case 0x2:
372 seq_printf(m, "1MiB\n");
373 break;
374 default:
375 seq_printf(m, "unknown size\n");
376 break;
377 }
378 }
379
380 return 0;
381}
382
383
384/* Used by all Motorola PReP */
385static int
386prep_mot_cpuinfo(struct seq_file *m)
387{
388 unsigned int cachew = *((unsigned char *)CACHECRBA);
389
390 seq_printf(m, "machine\t\t: PReP %s\n", Motherboard_map_name);
391
392 /* report amount and type of L2 cache present */
393 seq_printf(m, "l2 cache\t: ");
394 switch (cachew & L2CACHE_MASK) {
395 case L2CACHE_512KB:
396 seq_printf(m, "512KiB");
397 break;
398 case L2CACHE_256KB:
399 seq_printf(m, "256KiB");
400 break;
401 case L2CACHE_1MB:
402 seq_printf(m, "1MiB");
403 break;
404 case L2CACHE_NONE:
405 seq_printf(m, "none\n");
406 goto no_l2;
407 break;
408 default:
409 seq_printf(m, "%x\n", cachew);
410 }
411
412 seq_printf(m, ", parity %s",
413 (cachew & L2CACHE_PARITY)? "enabled" : "disabled");
414
415 seq_printf(m, " SRAM:");
416
417 switch ( ((cachew & 0xf0) >> 4) & ~(0x3) ) {
418 case 1: seq_printf(m, "synchronous, parity, flow-through\n");
419 break;
420 case 2: seq_printf(m, "asynchronous, no parity\n");
421 break;
422 case 3: seq_printf(m, "asynchronous, parity\n");
423 break;
424 default:seq_printf(m, "synchronous, pipelined, no parity\n");
425 break;
426 }
427
428no_l2:
429 /* print info about SIMMs */
430 if (have_residual_data) {
431 int i;
432 seq_printf(m, "simms\t\t: ");
433 for (i = 0; (res->ActualNumMemories) && (i < MAX_MEMS); i++) {
434 if (res->Memories[i].SIMMSize != 0)
435 seq_printf(m, "%d:%ldM ", i,
436 (res->Memories[i].SIMMSize > 1024) ?
437 res->Memories[i].SIMMSize>>20 :
438 res->Memories[i].SIMMSize);
439 }
440 seq_printf(m, "\n");
441 }
442
443 return 0;
444}
445
446static void
447prep_restart(char *cmd)
448{
449#define PREP_SP92 0x92 /* Special Port 92 */
450 local_irq_disable(); /* no interrupts */
451
452 /* set exception prefix high - to the prom */
453 _nmask_and_or_msr(0, MSR_IP);
454
455 /* make sure bit 0 (reset) is a 0 */
456 outb( inb(PREP_SP92) & ~1L , PREP_SP92);
457 /* signal a reset to system control port A - soft reset */
458 outb( inb(PREP_SP92) | 1 , PREP_SP92);
459
460 while ( 1 ) ;
461 /* not reached */
462#undef PREP_SP92
463}
464
465static void
466prep_halt(void)
467{
468 local_irq_disable(); /* no interrupts */
469
470 /* set exception prefix high - to the prom */
471 _nmask_and_or_msr(0, MSR_IP);
472
473 while ( 1 ) ;
474 /* not reached */
475}
476
477/* Carrera is the power manager in the Thinkpads. Unfortunately not much is
478 * known about it, so we can't power down.
479 */
480static void
481prep_carrera_poweroff(void)
482{
483 prep_halt();
484}
485
486/*
487 * On most IBM PReP's, power management is handled by a Signetics 87c750
488 * behind the Utah component on the ISA bus. To access the 750 you must write
489 * a series of nibbles to port 0x82a (decoded by the Utah). This is described
490 * somewhat in the IBM Carolina Technical Specification.
491 * -Hollis
492 */
493static void
494utah_sig87c750_setbit(unsigned int bytenum, unsigned int bitnum, int value)
495{
496 /*
497 * byte1: 0 0 0 1 0 d a5 a4
498 * byte2: 0 0 0 1 a3 a2 a1 a0
499 *
500 * d = the bit's value, enabled or disabled
501 * (a5 a4 a3) = the byte number, minus 20
502 * (a2 a1 a0) = the bit number
503 *
504 * example: set the 5th bit of byte 21 (21.5)
505 * a5 a4 a3 = 001 (byte 1)
506 * a2 a1 a0 = 101 (bit 5)
507 *
508 * byte1 = 0001 0100 (0x14)
509 * byte2 = 0001 1101 (0x1d)
510 */
511 unsigned char byte1=0x10, byte2=0x10;
512
513 /* the 750's '20.0' is accessed as '0.0' through Utah (which adds 20) */
514 bytenum -= 20;
515
516 byte1 |= (!!value) << 2; /* set d */
517 byte1 |= (bytenum >> 1) & 0x3; /* set a5, a4 */
518
519 byte2 |= (bytenum & 0x1) << 3; /* set a3 */
520 byte2 |= bitnum & 0x7; /* set a2, a1, a0 */
521
522 outb(byte1, PREP_IBM_PM1); /* first nibble */
523 mb();
524 udelay(100); /* important: let controller recover */
525
526 outb(byte2, PREP_IBM_PM1); /* second nibble */
527 mb();
528 udelay(100); /* important: let controller recover */
529}
530
531static void
532prep_sig750_poweroff(void)
533{
534 /* tweak the power manager found in most IBM PRePs (except Thinkpads) */
535
536 local_irq_disable();
537 /* set exception prefix high - to the prom */
538 _nmask_and_or_msr(0, MSR_IP);
539
540 utah_sig87c750_setbit(21, 5, 1); /* set bit 21.5, "PMEXEC_OFF" */
541
542 while (1) ;
543 /* not reached */
544}
545
546static int
547prep_show_percpuinfo(struct seq_file *m, int i)
548{
549 /* PREP's without residual data will give incorrect values here */
550 seq_printf(m, "clock\t\t: ");
551 if (have_residual_data)
552 seq_printf(m, "%ldMHz\n",
553 (res->VitalProductData.ProcessorHz > 1024) ?
554 res->VitalProductData.ProcessorHz / 1000000 :
555 res->VitalProductData.ProcessorHz);
556 else
557 seq_printf(m, "???\n");
558
559 return 0;
560}
561
562/*
563 * Fill out screen_info according to the residual data. This allows us to use
564 * at least vesafb.
565 */
566static void __init
567prep_init_vesa(void)
568{
569#if (defined(CONFIG_FB_VGA16) || defined(CONFIG_FB_VGA16_MODULE) || \
570 defined(CONFIG_FB_VESA))
571 PPC_DEVICE *vgadev = NULL;
572
573 if (have_residual_data)
574 vgadev = residual_find_device(~0, NULL, DisplayController,
575 SVGAController, -1, 0);
576
577 if (vgadev != NULL) {
578 PnP_TAG_PACKET *pkt;
579
580 pkt = PnP_find_large_vendor_packet(
581 (unsigned char *)&res->DevicePnPHeap[vgadev->AllocatedOffset],
582 0x04, 0); /* 0x04 = Display Tag */
583 if (pkt != NULL) {
584 unsigned char *ptr = (unsigned char *)pkt;
585
586 if (ptr[4]) {
587 /* graphics mode */
588 screen_info.orig_video_isVGA = VIDEO_TYPE_VLFB;
589
590 screen_info.lfb_depth = ptr[4] * 8;
591
592 screen_info.lfb_width = swab16(*(short *)(ptr+6));
593 screen_info.lfb_height = swab16(*(short *)(ptr+8));
594 screen_info.lfb_linelength = swab16(*(short *)(ptr+10));
595
596 screen_info.lfb_base = swab32(*(long *)(ptr+12));
597 screen_info.lfb_size = swab32(*(long *)(ptr+20)) / 65536;
598 }
599 }
600 }
601#endif
602}
603
604/*
605 * Set DBAT 2 to access 0x80000000 so early progress messages will work
606 */
607static __inline__ void
608prep_set_bat(void)
609{
610 /* wait for all outstanding memory access to complete */
611 mb();
612
613 /* setup DBATs */
614 mtspr(SPRN_DBAT2U, 0x80001ffe);
615 mtspr(SPRN_DBAT2L, 0x8000002a);
616
617 /* wait for updates */
618 mb();
619}
620
621/*
622 * IBM 3-digit status LED
623 */
624static unsigned int ibm_statusled_base;
625
626static void
627ibm_statusled_progress(char *s, unsigned short hex);
628
629static int
630ibm_statusled_panic(struct notifier_block *dummy1, unsigned long dummy2,
631 void * dummy3)
632{
633 ibm_statusled_progress(NULL, 0x505); /* SOS */
634 return NOTIFY_DONE;
635}
636
637static struct notifier_block ibm_statusled_block = {
638 ibm_statusled_panic,
639 NULL,
640 INT_MAX /* try to do it first */
641};
642
643static void
644ibm_statusled_progress(char *s, unsigned short hex)
645{
646 static int notifier_installed;
647 /*
648 * Progress uses 4 digits and we have only 3. So, we map 0xffff to
649 * 0xfff for display switch off. Out of range values are mapped to
650 * 0xeff, as I'm told 0xf00 and above are reserved for hardware codes.
651 * Install the panic notifier when the display is first switched off.
652 */
653 if (hex == 0xffff) {
654 hex = 0xfff;
655 if (!notifier_installed) {
656 ++notifier_installed;
657 atomic_notifier_chain_register(&panic_notifier_list,
658 &ibm_statusled_block);
659 }
660 }
661 else
662 if (hex > 0xfff)
663 hex = 0xeff;
664
665 mb();
666 outw(hex, ibm_statusled_base);
667}
668
669static void __init
670ibm_statusled_init(void)
671{
672 /*
673 * The IBM 3-digit LED display is specified in the residual data
674 * as an operator panel device, type "System Status LED". Find
675 * that device and determine its address. We validate all the
676 * other parameters on the off-chance another, similar device
677 * exists.
678 */
679 if (have_residual_data) {
680 PPC_DEVICE *led;
681 PnP_TAG_PACKET *pkt;
682
683 led = residual_find_device(~0, NULL, SystemPeripheral,
684 OperatorPanel, SystemStatusLED, 0);
685 if (!led)
686 return;
687
688 pkt = PnP_find_packet((unsigned char *)
689 &res->DevicePnPHeap[led->AllocatedOffset], S8_Packet, 0);
690 if (!pkt)
691 return;
692
693 if (pkt->S8_Pack.IOInfo != ISAAddr16bit)
694 return;
695 if (*(unsigned short *)pkt->S8_Pack.RangeMin !=
696 *(unsigned short *)pkt->S8_Pack.RangeMax)
697 return;
698 if (pkt->S8_Pack.IOAlign != 2)
699 return;
700 if (pkt->S8_Pack.IONum != 2)
701 return;
702
703 ibm_statusled_base = ld_le16((unsigned short *)
704 (pkt->S8_Pack.RangeMin));
705 ppc_md.progress = ibm_statusled_progress;
706 }
707}
708
709static void __init
710prep_setup_arch(void)
711{
712 unsigned char reg;
713 int is_ide=0;
714
715 /* init to some ~sane value until calibrate_delay() runs */
716 loops_per_jiffy = 50000000;
717
718 /* Lookup PCI host bridges */
719 prep_find_bridges();
720
721 /* Set up floppy in PS/2 mode */
722 outb(0x09, SIO_CONFIG_RA);
723 reg = inb(SIO_CONFIG_RD);
724 reg = (reg & 0x3F) | 0x40;
725 outb(reg, SIO_CONFIG_RD);
726 outb(reg, SIO_CONFIG_RD); /* Have to write twice to change! */
727
728 switch ( _prep_type )
729 {
730 case _PREP_IBM:
731 reg = inb(PREP_IBM_PLANAR);
732 printk(KERN_INFO "IBM planar ID: %02x", reg);
733 switch (reg) {
734 case PREP_IBM_SANDALFOOT:
735 prep_gen_enable_l2();
736 setup_ibm_pci = prep_sandalfoot_setup_pci;
737 ppc_md.power_off = prep_sig750_poweroff;
738 ppc_md.show_cpuinfo = prep_sandalfoot_cpuinfo;
739 break;
740 case PREP_IBM_THINKPAD:
741 prep_gen_enable_l2();
742 setup_ibm_pci = prep_thinkpad_setup_pci;
743 ppc_md.power_off = prep_carrera_poweroff;
744 ppc_md.show_cpuinfo = prep_thinkpad_cpuinfo;
745 break;
746 default:
747 if (have_residual_data) {
748 prep_gen_enable_l2();
749 setup_ibm_pci = prep_residual_setup_pci;
750 ppc_md.power_off = prep_halt;
751 ppc_md.show_cpuinfo = prep_gen_cpuinfo;
752 break;
753 }
754 else
755 printk(" - unknown! Assuming Carolina");
756 /* fall through */
757 case PREP_IBM_CAROLINA_IDE_0:
758 case PREP_IBM_CAROLINA_IDE_1:
759 case PREP_IBM_CAROLINA_IDE_2:
760 case PREP_IBM_CAROLINA_IDE_3:
761 is_ide = 1;
762 case PREP_IBM_CAROLINA_SCSI_0:
763 case PREP_IBM_CAROLINA_SCSI_1:
764 case PREP_IBM_CAROLINA_SCSI_2:
765 case PREP_IBM_CAROLINA_SCSI_3:
766 prep_carolina_enable_l2();
767 setup_ibm_pci = prep_carolina_setup_pci;
768 ppc_md.power_off = prep_sig750_poweroff;
769 ppc_md.show_cpuinfo = prep_carolina_cpuinfo;
770 break;
771 case PREP_IBM_TIGER1_133:
772 case PREP_IBM_TIGER1_166:
773 case PREP_IBM_TIGER1_180:
774 case PREP_IBM_TIGER1_xxx:
775 case PREP_IBM_TIGER1_333:
776 prep_carolina_enable_l2();
777 setup_ibm_pci = prep_tiger1_setup_pci;
778 ppc_md.power_off = prep_sig750_poweroff;
779 ppc_md.show_cpuinfo = prep_tiger1_cpuinfo;
780 break;
781 }
782 printk("\n");
783
784 /* default root device */
785 if (is_ide)
786 ROOT_DEV = MKDEV(IDE0_MAJOR, 3);
787 else
788 ROOT_DEV = MKDEV(SCSI_DISK0_MAJOR, 3);
789
790 break;
791 case _PREP_Motorola:
792 prep_gen_enable_l2();
793 ppc_md.power_off = prep_halt;
794 ppc_md.show_cpuinfo = prep_mot_cpuinfo;
795
796#ifdef CONFIG_BLK_DEV_INITRD
797 if (initrd_start)
798 ROOT_DEV = Root_RAM0;
799 else
800#endif
801#ifdef CONFIG_ROOT_NFS
802 ROOT_DEV = Root_NFS;
803#else
804 ROOT_DEV = Root_SDA2;
805#endif
806 break;
807 }
808
809 /* Read in NVRAM data */
810 init_prep_nvram();
811
812 /* if no bootargs, look in NVRAM */
813 if ( cmd_line[0] == '\0' ) {
814 char *bootargs;
815 bootargs = prep_nvram_get_var("bootargs");
816 if (bootargs != NULL) {
817 strcpy(cmd_line, bootargs);
818 /* again.. */
819 strcpy(boot_command_line, cmd_line);
820 }
821 }
822
823 prep_init_vesa();
824
825 switch (_prep_type) {
826 case _PREP_Motorola:
827 raven_init();
828 break;
829 case _PREP_IBM:
830 ibm_prep_init();
831 break;
832 }
833
834#ifdef CONFIG_VGA_CONSOLE
835 /* vgacon.c needs to know where we mapped IO memory in io_block_mapping() */
836 vgacon_remap_base = 0xf0000000;
837 conswitchp = &vga_con;
838#endif
839}
840
841/*
842 * First, see if we can get this information from the residual data.
843 * This is important on some IBM PReP systems. If we cannot, we let the
844 * TODC code handle doing this.
845 */
846static void __init
847prep_calibrate_decr(void)
848{
849 if (have_residual_data) {
850 unsigned long freq, divisor = 4;
851
852 if ( res->VitalProductData.ProcessorBusHz ) {
853 freq = res->VitalProductData.ProcessorBusHz;
854 printk("time_init: decrementer frequency = %lu.%.6lu MHz\n",
855 (freq/divisor)/1000000,
856 (freq/divisor)%1000000);
857 tb_to_us = mulhwu_scale_factor(freq/divisor, 1000000);
858 tb_ticks_per_jiffy = freq / HZ / divisor;
859 }
860 }
861 else
862 todc_calibrate_decr();
863}
864
865static void __init
866prep_init_IRQ(void)
867{
868 unsigned int pci_viddid, pci_did;
869
870 if (OpenPIC_Addr != NULL) {
871 openpic_init(NUM_8259_INTERRUPTS);
872 /* We have a cascade on OpenPIC IRQ 0, Linux IRQ 16 */
873 openpic_hookup_cascade(NUM_8259_INTERRUPTS, "82c59 cascade",
874 i8259_irq);
875 }
876
877 if (have_residual_data) {
878 i8259_init(residual_isapic_addr(), 0);
879 return;
880 }
881
882 /* If we have a Raven PCI bridge or a Hawk PCI bridge / Memory
883 * controller, we poll (as they have a different int-ack address). */
884 early_read_config_dword(NULL, 0, 0, PCI_VENDOR_ID, &pci_viddid);
885 pci_did = (pci_viddid & 0xffff0000) >> 16;
886 if (((pci_viddid & 0xffff) == PCI_VENDOR_ID_MOTOROLA)
887 && ((pci_did == PCI_DEVICE_ID_MOTOROLA_RAVEN)
888 || (pci_did == PCI_DEVICE_ID_MOTOROLA_HAWK)))
889 i8259_init(0, 0);
890 else
891 /* PCI interrupt ack address given in section 6.1.8 of the
892 * PReP specification. */
893 i8259_init(MPC10X_MAPA_PCI_INTACK_ADDR, 0);
894}
895
896#ifdef CONFIG_SMP
897/* PReP (MTX) support */
898static int __init
899smp_prep_probe(void)
900{
901 extern int mot_multi;
902
903 if (mot_multi) {
904 openpic_request_IPIs();
905 smp_hw_index[1] = 1;
906 return 2;
907 }
908
909 return 1;
910}
911
912static void __init
913smp_prep_kick_cpu(int nr)
914{
915 *(unsigned long *)KERNELBASE = nr;
916 asm volatile("dcbf 0,%0"::"r"(KERNELBASE):"memory");
917 printk("CPU1 released, waiting\n");
918}
919
920static void __init
921smp_prep_setup_cpu(int cpu_nr)
922{
923 if (OpenPIC_Addr)
924 do_openpic_setup_cpu();
925}
926
927static struct smp_ops_t prep_smp_ops = {
928 smp_openpic_message_pass,
929 smp_prep_probe,
930 smp_prep_kick_cpu,
931 smp_prep_setup_cpu,
932 .give_timebase = smp_generic_give_timebase,
933 .take_timebase = smp_generic_take_timebase,
934};
935#endif /* CONFIG_SMP */
936
937/*
938 * Setup the bat mappings we're going to load that cover
939 * the io areas. RAM was mapped by mapin_ram().
940 * -- Cort
941 */
942static void __init
943prep_map_io(void)
944{
945 io_block_mapping(0x80000000, PREP_ISA_IO_BASE, 0x10000000, _PAGE_IO);
946 io_block_mapping(0xf0000000, PREP_ISA_MEM_BASE, 0x08000000, _PAGE_IO);
947}
948
949static int __init
950prep_request_io(void)
951{
952#ifdef CONFIG_NVRAM
953 request_region(PREP_NVRAM_AS0, 0x8, "nvram");
954#endif
955 request_region(0x00,0x20,"dma1");
956 request_region(0x40,0x20,"timer");
957 request_region(0x80,0x10,"dma page reg");
958 request_region(0xc0,0x20,"dma2");
959
960 return 0;
961}
962
963device_initcall(prep_request_io);
964
965void __init
966prep_init(unsigned long r3, unsigned long r4, unsigned long r5,
967 unsigned long r6, unsigned long r7)
968{
969#ifdef CONFIG_PREP_RESIDUAL
970 /* make a copy of residual data */
971 if ( r3 ) {
972 memcpy((void *)res,(void *)(r3+KERNELBASE),
973 sizeof(RESIDUAL));
974 }
975#endif
976
977 isa_io_base = PREP_ISA_IO_BASE;
978 isa_mem_base = PREP_ISA_MEM_BASE;
979 pci_dram_offset = PREP_PCI_DRAM_OFFSET;
980 ISA_DMA_THRESHOLD = 0x00ffffff;
981 DMA_MODE_READ = 0x44;
982 DMA_MODE_WRITE = 0x48;
983 ppc_do_canonicalize_irqs = 1;
984
985 /* figure out what kind of prep workstation we are */
986 if (have_residual_data) {
987 if ( !strncmp(res->VitalProductData.PrintableModel,"IBM",3) )
988 _prep_type = _PREP_IBM;
989 else
990 _prep_type = _PREP_Motorola;
991 }
992 else {
993 /* assume motorola if no residual (netboot?) */
994 _prep_type = _PREP_Motorola;
995 }
996
997#ifdef CONFIG_PREP_RESIDUAL
998 /* Switch off all residual data processing if the user requests it */
999 if (strstr(cmd_line, "noresidual") != NULL)
1000 res = NULL;
1001#endif
1002
1003 /* Initialise progress early to get maximum benefit */
1004 prep_set_bat();
1005 ibm_statusled_init();
1006
1007 ppc_md.setup_arch = prep_setup_arch;
1008 ppc_md.show_percpuinfo = prep_show_percpuinfo;
1009 ppc_md.show_cpuinfo = NULL; /* set in prep_setup_arch() */
1010 ppc_md.init_IRQ = prep_init_IRQ;
1011 /* this gets changed later on if we have an OpenPIC -- Cort */
1012 ppc_md.get_irq = i8259_irq;
1013
1014 ppc_md.phys_mem_access_prot = pci_phys_mem_access_prot;
1015
1016 ppc_md.restart = prep_restart;
1017 ppc_md.power_off = NULL; /* set in prep_setup_arch() */
1018 ppc_md.halt = prep_halt;
1019
1020 ppc_md.nvram_read_val = prep_nvram_read_val;
1021 ppc_md.nvram_write_val = prep_nvram_write_val;
1022
1023 ppc_md.time_init = todc_time_init;
1024 if (_prep_type == _PREP_IBM) {
1025 ppc_md.rtc_read_val = todc_mc146818_read_val;
1026 ppc_md.rtc_write_val = todc_mc146818_write_val;
1027 TODC_INIT(TODC_TYPE_MC146818, RTC_PORT(0), NULL, RTC_PORT(1),
1028 8);
1029 } else {
1030 TODC_INIT(TODC_TYPE_MK48T59, PREP_NVRAM_AS0, PREP_NVRAM_AS1,
1031 PREP_NVRAM_DATA, 8);
1032 }
1033
1034 ppc_md.calibrate_decr = prep_calibrate_decr;
1035 ppc_md.set_rtc_time = todc_set_rtc_time;
1036 ppc_md.get_rtc_time = todc_get_rtc_time;
1037
1038 ppc_md.setup_io_mappings = prep_map_io;
1039
1040#ifdef CONFIG_SMP
1041 smp_ops = &prep_smp_ops;
1042#endif /* CONFIG_SMP */
1043}
diff --git a/arch/ppc/platforms/prpmc750.c b/arch/ppc/platforms/prpmc750.c
deleted file mode 100644
index 93bd593cf957..000000000000
--- a/arch/ppc/platforms/prpmc750.c
+++ /dev/null
@@ -1,360 +0,0 @@
1/*
2 * Board setup routines for Motorola PrPMC750
3 *
4 * Author: Matt Porter <mporter@mvista.com>
5 *
6 * 2001-2004 (c) MontaVista, Software, Inc. This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10 */
11
12#include <linux/stddef.h>
13#include <linux/kernel.h>
14#include <linux/init.h>
15#include <linux/errno.h>
16#include <linux/reboot.h>
17#include <linux/pci.h>
18#include <linux/kdev_t.h>
19#include <linux/types.h>
20#include <linux/major.h>
21#include <linux/initrd.h>
22#include <linux/console.h>
23#include <linux/delay.h>
24#include <linux/seq_file.h>
25#include <linux/root_dev.h>
26#include <linux/slab.h>
27#include <linux/serial_reg.h>
28
29#include <asm/byteorder.h>
30#include <asm/system.h>
31#include <asm/pgtable.h>
32#include <asm/page.h>
33#include <asm/dma.h>
34#include <asm/io.h>
35#include <asm/irq.h>
36#include <asm/machdep.h>
37#include <asm/pci-bridge.h>
38#include <asm/uaccess.h>
39#include <asm/time.h>
40#include <asm/open_pic.h>
41#include <asm/bootinfo.h>
42#include <asm/hawk.h>
43
44#include "prpmc750.h"
45
46extern unsigned long loops_per_jiffy;
47
48extern void gen550_progress(char *, unsigned short);
49
50static u_char prpmc750_openpic_initsenses[] __initdata =
51{
52 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* PRPMC750_INT_HOSTINT0 */
53 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* PRPMC750_INT_UART */
54 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* PRPMC750_INT_DEBUGINT */
55 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* PRPMC750_INT_HAWK_WDT */
56 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* PRPMC750_INT_UNUSED */
57 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* PRPMC750_INT_ABORT */
58 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* PRPMC750_INT_HOSTINT1 */
59 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* PRPMC750_INT_HOSTINT2 */
60 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* PRPMC750_INT_HOSTINT3 */
61 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* PRPMC750_INT_PMC_INTA */
62 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* PRPMC750_INT_PMC_INTB */
63 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* PRPMC750_INT_PMC_INTC */
64 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* PRPMC750_INT_PMC_INTD */
65 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* PRPMC750_INT_UNUSED */
66 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* PRPMC750_INT_UNUSED */
67 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* PRPMC750_INT_UNUSED */
68};
69
70/*
71 * Motorola PrPMC750/PrPMC800 in PrPMCBASE or PrPMC-Carrier
72 * Combined irq tables. Only Base has IDSEL 14, only Carrier has 21 and 22.
73 */
74static inline int
75prpmc_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
76{
77 static char pci_irq_table[][4] =
78 /*
79 * PCI IDSEL/INTPIN->INTLINE
80 * A B C D
81 */
82 {
83 {12, 0, 0, 0}, /* IDSEL 14 - Ethernet, base */
84 {0, 0, 0, 0}, /* IDSEL 15 - unused */
85 {10, 11, 12, 9}, /* IDSEL 16 - PMC A1, PMC1 */
86 {10, 11, 12, 9}, /* IDSEL 17 - PrPMC-A-B, PMC2-B */
87 {11, 12, 9, 10}, /* IDSEL 18 - PMC A1-B, PMC1-B */
88 {0, 0, 0, 0}, /* IDSEL 19 - unused */
89 {9, 10, 11, 12}, /* IDSEL 20 - P2P Bridge */
90 {11, 12, 9, 10}, /* IDSEL 21 - PMC A2, carrier */
91 {12, 9, 10, 11}, /* IDSEL 22 - PMC A2-B, carrier */
92 };
93 const long min_idsel = 14, max_idsel = 22, irqs_per_slot = 4;
94 return PCI_IRQ_TABLE_LOOKUP;
95};
96
97static void __init prpmc750_pcibios_fixup(void)
98{
99 struct pci_dev *dev;
100 unsigned short wtmp;
101
102 /*
103 * Kludge to clean up after PPC6BUG which doesn't
104 * configure the CL5446 VGA card. Also the
105 * resource subsystem doesn't fixup the
106 * PCI mem resources on the CL5446.
107 */
108 if ((dev = pci_get_device(PCI_VENDOR_ID_CIRRUS,
109 PCI_DEVICE_ID_CIRRUS_5446, 0))) {
110 dev->resource[0].start += PRPMC750_PCI_PHY_MEM_OFFSET;
111 dev->resource[0].end += PRPMC750_PCI_PHY_MEM_OFFSET;
112 pci_read_config_word(dev, PCI_COMMAND, &wtmp);
113 pci_write_config_word(dev, PCI_COMMAND, wtmp | 3);
114 /* Enable Color mode in MISC reg */
115 outb(0x03, 0x3c2);
116 /* Select DRAM config reg */
117 outb(0x0f, 0x3c4);
118 /* Set proper DRAM config */
119 outb(0xdf, 0x3c5);
120 pci_dev_put(dev);
121 }
122}
123
124void __init prpmc750_find_bridges(void)
125{
126 struct pci_controller *hose;
127
128 hose = pcibios_alloc_controller();
129 if (!hose)
130 return;
131
132 hose->first_busno = 0;
133 hose->last_busno = 0xff;
134 hose->io_base_virt = (void *)PRPMC750_ISA_IO_BASE;
135 hose->pci_mem_offset = PRPMC750_PCI_PHY_MEM_OFFSET;
136
137 pci_init_resource(&hose->io_resource,
138 PRPMC750_PCI_IO_START,
139 PRPMC750_PCI_IO_END,
140 IORESOURCE_IO, "PCI host bridge");
141
142 pci_init_resource(&hose->mem_resources[0],
143 PRPMC750_PROC_PCI_MEM_START,
144 PRPMC750_PROC_PCI_MEM_END,
145 IORESOURCE_MEM, "PCI host bridge");
146
147 hose->io_space.start = PRPMC750_PCI_IO_START;
148 hose->io_space.end = PRPMC750_PCI_IO_END;
149 hose->mem_space.start = PRPMC750_PCI_MEM_START;
150 hose->mem_space.end = PRPMC750_PCI_MEM_END - HAWK_MPIC_SIZE;
151
152 if (hawk_init(hose, PRPMC750_HAWK_PPC_REG_BASE,
153 PRPMC750_PROC_PCI_MEM_START,
154 PRPMC750_PROC_PCI_MEM_END - HAWK_MPIC_SIZE,
155 PRPMC750_PROC_PCI_IO_START, PRPMC750_PROC_PCI_IO_END,
156 PRPMC750_PROC_PCI_MEM_END - HAWK_MPIC_SIZE + 1)
157 != 0) {
158 printk(KERN_CRIT "Could not initialize host bridge\n");
159 }
160
161 hose->last_busno = pciauto_bus_scan(hose, hose->first_busno);
162
163 ppc_md.pcibios_fixup = prpmc750_pcibios_fixup;
164 ppc_md.pci_swizzle = common_swizzle;
165 ppc_md.pci_map_irq = prpmc_map_irq;
166}
167static int prpmc750_show_cpuinfo(struct seq_file *m)
168{
169 seq_printf(m, "machine\t\t: PrPMC750\n");
170
171 return 0;
172}
173
174static void __init prpmc750_setup_arch(void)
175{
176 /* init to some ~sane value until calibrate_delay() runs */
177 loops_per_jiffy = 50000000 / HZ;
178
179 /* Lookup PCI host bridges */
180 prpmc750_find_bridges();
181
182#ifdef CONFIG_BLK_DEV_INITRD
183 if (initrd_start)
184 ROOT_DEV = Root_RAM0;
185 else
186#endif
187#ifdef CONFIG_ROOT_NFS
188 ROOT_DEV = Root_NFS;
189#else
190 ROOT_DEV = Root_SDA2;
191#endif
192
193 OpenPIC_InitSenses = prpmc750_openpic_initsenses;
194 OpenPIC_NumInitSenses = sizeof(prpmc750_openpic_initsenses);
195
196 printk(KERN_INFO "Port by MontaVista Software, Inc. "
197 "(source@mvista.com)\n");
198}
199
200/*
201 * Compute the PrPMC750's bus speed using the baud clock as a
202 * reference.
203 */
204static unsigned long __init prpmc750_get_bus_speed(void)
205{
206 unsigned long tbl_start, tbl_end;
207 unsigned long current_state, old_state, bus_speed;
208 unsigned char lcr, dll, dlm;
209 int baud_divisor, count;
210
211 /* Read the UART's baud clock divisor */
212 lcr = readb(PRPMC750_SERIAL_0_LCR);
213 writeb(lcr | UART_LCR_DLAB, PRPMC750_SERIAL_0_LCR);
214 dll = readb(PRPMC750_SERIAL_0_DLL);
215 dlm = readb(PRPMC750_SERIAL_0_DLM);
216 writeb(lcr & ~UART_LCR_DLAB, PRPMC750_SERIAL_0_LCR);
217 baud_divisor = (dlm << 8) | dll;
218
219 /*
220 * Use the baud clock divisor and base baud clock
221 * to determine the baud rate and use that as
222 * the number of baud clock edges we use for
223 * the time base sample. Make it half the baud
224 * rate.
225 */
226 count = PRPMC750_BASE_BAUD / (baud_divisor * 16);
227
228 /* Find the first edge of the baud clock */
229 old_state = readb(PRPMC750_STATUS_REG) & PRPMC750_BAUDOUT_MASK;
230 do {
231 current_state = readb(PRPMC750_STATUS_REG) &
232 PRPMC750_BAUDOUT_MASK;
233 } while (old_state == current_state);
234
235 old_state = current_state;
236
237 /* Get the starting time base value */
238 tbl_start = get_tbl();
239
240 /*
241 * Loop until we have found a number of edges equal
242 * to half the count (half the baud rate)
243 */
244 do {
245 do {
246 current_state = readb(PRPMC750_STATUS_REG) &
247 PRPMC750_BAUDOUT_MASK;
248 } while (old_state == current_state);
249 old_state = current_state;
250 } while (--count);
251
252 /* Get the ending time base value */
253 tbl_end = get_tbl();
254
255 /* Compute bus speed */
256 bus_speed = (tbl_end - tbl_start) * 128;
257
258 return bus_speed;
259}
260
261static void __init prpmc750_calibrate_decr(void)
262{
263 unsigned long freq;
264 int divisor = 4;
265
266 freq = prpmc750_get_bus_speed();
267
268 tb_ticks_per_jiffy = freq / (HZ * divisor);
269 tb_to_us = mulhwu_scale_factor(freq / divisor, 1000000);
270}
271
272static void prpmc750_restart(char *cmd)
273{
274 local_irq_disable();
275 writeb(PRPMC750_MODRST_MASK, PRPMC750_MODRST_REG);
276 while (1) ;
277}
278
279static void prpmc750_halt(void)
280{
281 local_irq_disable();
282 while (1) ;
283}
284
285static void prpmc750_power_off(void)
286{
287 prpmc750_halt();
288}
289
290static void __init prpmc750_init_IRQ(void)
291{
292 openpic_init(0);
293}
294
295/*
296 * Set BAT 3 to map 0xf0000000 to end of physical memory space.
297 */
298static __inline__ void prpmc750_set_bat(void)
299{
300 mb();
301 mtspr(SPRN_DBAT1U, 0xf0001ffe);
302 mtspr(SPRN_DBAT1L, 0xf000002a);
303 mb();
304}
305
306/*
307 * We need to read the Falcon/Hawk memory controller
308 * to properly determine this value
309 */
310static unsigned long __init prpmc750_find_end_of_memory(void)
311{
312 /* Read the memory size from the Hawk SMC */
313 return hawk_get_mem_size(PRPMC750_HAWK_SMC_BASE);
314}
315
316static void __init prpmc750_map_io(void)
317{
318 io_block_mapping(PRPMC750_ISA_IO_BASE, PRPMC750_ISA_IO_BASE,
319 0x10000000, _PAGE_IO);
320#if 0
321 io_block_mapping(0xf0000000, 0xc0000000, 0x08000000, _PAGE_IO);
322#endif
323 io_block_mapping(0xf8000000, 0xf8000000, 0x08000000, _PAGE_IO);
324}
325
326void __init
327platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
328 unsigned long r6, unsigned long r7)
329{
330 parse_bootinfo(find_bootinfo());
331
332 /* Cover the Hawk registers with a BAT */
333 prpmc750_set_bat();
334
335 isa_io_base = PRPMC750_ISA_IO_BASE;
336 isa_mem_base = PRPMC750_ISA_MEM_BASE;
337 pci_dram_offset = PRPMC750_PCI_DRAM_OFFSET;
338
339 ppc_md.setup_arch = prpmc750_setup_arch;
340 ppc_md.show_cpuinfo = prpmc750_show_cpuinfo;
341 ppc_md.init_IRQ = prpmc750_init_IRQ;
342 ppc_md.get_irq = openpic_get_irq;
343
344 ppc_md.find_end_of_memory = prpmc750_find_end_of_memory;
345 ppc_md.setup_io_mappings = prpmc750_map_io;
346
347 ppc_md.restart = prpmc750_restart;
348 ppc_md.power_off = prpmc750_power_off;
349 ppc_md.halt = prpmc750_halt;
350
351 /* PrPMC750 has no timekeeper part */
352 ppc_md.time_init = NULL;
353 ppc_md.get_rtc_time = NULL;
354 ppc_md.set_rtc_time = NULL;
355 ppc_md.calibrate_decr = prpmc750_calibrate_decr;
356
357#ifdef CONFIG_SERIAL_TEXT_DEBUG
358 ppc_md.progress = gen550_progress;
359#endif /* CONFIG_SERIAL_TEXT_DEBUG */
360}
diff --git a/arch/ppc/platforms/prpmc750.h b/arch/ppc/platforms/prpmc750.h
deleted file mode 100644
index c4dcff09d7ca..000000000000
--- a/arch/ppc/platforms/prpmc750.h
+++ /dev/null
@@ -1,95 +0,0 @@
1/*
2 * arch/ppc/platforms/prpmc750.h
3 *
4 * Definitions for Motorola PrPMC750 board support
5 *
6 * Author: Matt Porter <mporter@mvista.com>
7 *
8 * 2001-2004 (c) MontaVista, Software, Inc. This file is licensed under
9 * the terms of the GNU General Public License version 2. This program
10 * is licensed "as is" without any warranty of any kind, whether express
11 * or implied.
12 */
13
14#ifdef __KERNEL__
15#ifndef __ASM_PRPMC750_H__
16#define __ASM_PRPMC750_H__
17
18/*
19 * Due to limitations imposed by legacy hardware (primarily IDE controllers),
20 * the PrPMC750 carrier board operates using a PReP address map.
21 *
22 * From Processor (physical) -> PCI:
23 * PCI Mem Space: 0xc0000000 - 0xfe000000 -> 0x00000000 - 0x3e000000 (768 MB)
24 * PCI I/O Space: 0x80000000 - 0x90000000 -> 0x00000000 - 0x10000000 (256 MB)
25 * Note: Must skip 0xfe000000-0xfe400000 for CONFIG_HIGHMEM/PKMAP area
26 *
27 * From PCI -> Processor (physical):
28 * System Memory: 0x80000000 -> 0x00000000
29 */
30
31#define PRPMC750_ISA_IO_BASE PREP_ISA_IO_BASE
32#define PRPMC750_ISA_MEM_BASE PREP_ISA_MEM_BASE
33
34/* PCI Memory space mapping info */
35#define PRPMC750_PCI_MEM_SIZE 0x30000000U
36#define PRPMC750_PROC_PCI_MEM_START PRPMC750_ISA_MEM_BASE
37#define PRPMC750_PROC_PCI_MEM_END (PRPMC750_PROC_PCI_MEM_START + \
38 PRPMC750_PCI_MEM_SIZE - 1)
39#define PRPMC750_PCI_MEM_START 0x00000000U
40#define PRPMC750_PCI_MEM_END (PRPMC750_PCI_MEM_START + \
41 PRPMC750_PCI_MEM_SIZE - 1)
42
43/* PCI I/O space mapping info */
44#define PRPMC750_PCI_IO_SIZE 0x10000000U
45#define PRPMC750_PROC_PCI_IO_START PRPMC750_ISA_IO_BASE
46#define PRPMC750_PROC_PCI_IO_END (PRPMC750_PROC_PCI_IO_START + \
47 PRPMC750_PCI_IO_SIZE - 1)
48#define PRPMC750_PCI_IO_START 0x00000000U
49#define PRPMC750_PCI_IO_END (PRPMC750_PCI_IO_START + \
50 PRPMC750_PCI_IO_SIZE - 1)
51
52/* System memory mapping info */
53#define PRPMC750_PCI_DRAM_OFFSET PREP_PCI_DRAM_OFFSET
54#define PRPMC750_PCI_PHY_MEM_OFFSET (PRPMC750_ISA_MEM_BASE-PRPMC750_PCI_MEM_START)
55
56/* Register address definitions */
57#define PRPMC750_HAWK_SMC_BASE 0xfef80000U
58#define PRPMC750_HAWK_PPC_REG_BASE 0xfeff0000U
59
60#define PRPMC750_BASE_BAUD 1843200
61#define PRPMC750_SERIAL_0 0xfef88000
62#define PRPMC750_SERIAL_0_DLL (PRPMC750_SERIAL_0 + (UART_DLL << 4))
63#define PRPMC750_SERIAL_0_DLM (PRPMC750_SERIAL_0 + (UART_DLM << 4))
64#define PRPMC750_SERIAL_0_LCR (PRPMC750_SERIAL_0 + (UART_LCR << 4))
65
66#define PRPMC750_STATUS_REG 0xfef88080
67#define PRPMC750_BAUDOUT_MASK 0x02
68#define PRPMC750_MONARCH_MASK 0x01
69
70#define PRPMC750_MODRST_REG 0xfef880a0
71#define PRPMC750_MODRST_MASK 0x01
72
73#define PRPMC750_PIRQ_REG 0xfef880b0
74#define PRPMC750_SEL1_MASK 0x02
75#define PRPMC750_SEL0_MASK 0x01
76
77#define PRPMC750_TBEN_REG 0xfef880c0
78#define PRPMC750_TBEN_MASK 0x01
79
80/* UART Defines. */
81#define RS_TABLE_SIZE 4
82
83/* Rate for the 1.8432 Mhz clock for the onboard serial chip */
84#define BASE_BAUD (PRPMC750_BASE_BAUD / 16)
85
86#define STD_COM_FLAGS ASYNC_BOOT_AUTOCONF
87
88#define SERIAL_PORT_DFNS \
89 { 0, BASE_BAUD, PRPMC750_SERIAL_0, 1, STD_COM_FLAGS, \
90 iomem_base: (unsigned char *)PRPMC750_SERIAL_0, \
91 iomem_reg_shift: 4, \
92 io_type: SERIAL_IO_MEM } /* ttyS0 */
93
94#endif /* __ASM_PRPMC750_H__ */
95#endif /* __KERNEL__ */
diff --git a/arch/ppc/platforms/prpmc800.c b/arch/ppc/platforms/prpmc800.c
deleted file mode 100644
index 5bcda7f92cd0..000000000000
--- a/arch/ppc/platforms/prpmc800.c
+++ /dev/null
@@ -1,472 +0,0 @@
1/*
2 * Author: Dale Farnsworth <dale.farnsworth@mvista.com>
3 *
4 * 2001-2004 (c) MontaVista, Software, Inc. This file is licensed under
5 * the terms of the GNU General Public License version 2. This program
6 * is licensed "as is" without any warranty of any kind, whether express
7 * or implied.
8 */
9
10#include <linux/stddef.h>
11#include <linux/kernel.h>
12#include <linux/init.h>
13#include <linux/errno.h>
14#include <linux/reboot.h>
15#include <linux/pci.h>
16#include <linux/kdev_t.h>
17#include <linux/types.h>
18#include <linux/major.h>
19#include <linux/initrd.h>
20#include <linux/console.h>
21#include <linux/delay.h>
22#include <linux/seq_file.h>
23#include <linux/root_dev.h>
24#include <linux/harrier_defs.h>
25
26#include <asm/byteorder.h>
27#include <asm/system.h>
28#include <asm/pgtable.h>
29#include <asm/page.h>
30#include <asm/dma.h>
31#include <asm/io.h>
32#include <asm/irq.h>
33#include <asm/machdep.h>
34#include <asm/time.h>
35#include <asm/pci-bridge.h>
36#include <asm/open_pic.h>
37#include <asm/bootinfo.h>
38#include <asm/harrier.h>
39
40#include "prpmc800.h"
41
42#define HARRIER_REVI_REG (PRPMC800_HARRIER_XCSR_BASE+HARRIER_REVI_OFF)
43#define HARRIER_UCTL_REG (PRPMC800_HARRIER_XCSR_BASE+HARRIER_UCTL_OFF)
44#define HARRIER_MISC_CSR_REG (PRPMC800_HARRIER_XCSR_BASE+HARRIER_MISC_CSR_OFF)
45#define HARRIER_IFEVP_REG (PRPMC800_HARRIER_MPIC_BASE+HARRIER_MPIC_IFEVP_OFF)
46#define HARRIER_IFEDE_REG (PRPMC800_HARRIER_MPIC_BASE+HARRIER_MPIC_IFEDE_OFF)
47#define HARRIER_FEEN_REG (PRPMC800_HARRIER_XCSR_BASE+HARRIER_FEEN_OFF)
48#define HARRIER_FEMA_REG (PRPMC800_HARRIER_XCSR_BASE+HARRIER_FEMA_OFF)
49
50#define HARRIER_VENI_REG (PRPMC800_HARRIER_XCSR_BASE + HARRIER_VENI_OFF)
51#define HARRIER_MISC_CSR (PRPMC800_HARRIER_XCSR_BASE + \
52 HARRIER_MISC_CSR_OFF)
53
54#define MONARCH (monarch != 0)
55#define NON_MONARCH (monarch == 0)
56
57extern int mpic_init(void);
58extern unsigned long loops_per_jiffy;
59extern void gen550_progress(char *, unsigned short);
60
61static int monarch = 0;
62static int found_self = 0;
63static int self = 0;
64
65static u_char prpmc800_openpic_initsenses[] __initdata =
66{
67 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* PRPMC800_INT_HOSTINT0 */
68 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* PRPMC800_INT_UNUSED */
69 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* PRPMC800_INT_DEBUGINT */
70 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* PRPMC800_INT_HARRIER_WDT */
71 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* PRPMC800_INT_UNUSED */
72 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* PRPMC800_INT_UNUSED */
73 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* PRPMC800_INT_HOSTINT1 */
74 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* PRPMC800_INT_HOSTINT2 */
75 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* PRPMC800_INT_HOSTINT3 */
76 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* PRPMC800_INT_PMC_INTA */
77 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* PRPMC800_INT_PMC_INTB */
78 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* PRPMC800_INT_PMC_INTC */
79 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* PRPMC800_INT_PMC_INTD */
80 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* PRPMC800_INT_UNUSED */
81 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* PRPMC800_INT_UNUSED */
82 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* PRPMC800_INT_UNUSED */
83 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* PRPMC800_INT_HARRIER_INT (UARTS, ABORT, DMA) */
84};
85
86/*
87 * Motorola PrPMC750/PrPMC800 in PrPMCBASE or PrPMC-Carrier
88 * Combined irq tables. Only Base has IDSEL 14, only Carrier has 21 and 22.
89 */
90static inline int
91prpmc_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
92{
93 static char pci_irq_table[][4] =
94 /*
95 * PCI IDSEL/INTPIN->INTLINE
96 * A B C D
97 */
98 {
99 {12, 0, 0, 0}, /* IDSEL 14 - Ethernet, base */
100 {0, 0, 0, 0}, /* IDSEL 15 - unused */
101 {10, 11, 12, 9}, /* IDSEL 16 - PMC A1, PMC1 */
102 {10, 11, 12, 9}, /* IDSEL 17 - PrPMC-A-B, PMC2-B */
103 {11, 12, 9, 10}, /* IDSEL 18 - PMC A1-B, PMC1-B */
104 {0, 0, 0, 0}, /* IDSEL 19 - unused */
105 {9, 10, 11, 12}, /* IDSEL 20 - P2P Bridge */
106 {11, 12, 9, 10}, /* IDSEL 21 - PMC A2, carrier */
107 {12, 9, 10, 11}, /* IDSEL 22 - PMC A2-B, carrier */
108 };
109 const long min_idsel = 14, max_idsel = 22, irqs_per_slot = 4;
110 return PCI_IRQ_TABLE_LOOKUP;
111};
112
113static int
114prpmc_read_config_dword(struct pci_controller *hose, u8 bus, u8 devfn,
115 int offset, u32 * val)
116{
117 /* paranoia */
118 if ((hose == NULL) ||
119 (hose->cfg_addr == NULL) || (hose->cfg_data == NULL))
120 return PCIBIOS_DEVICE_NOT_FOUND;
121
122 out_be32(hose->cfg_addr, ((offset & 0xfc) << 24) | (devfn << 16)
123 | ((bus - hose->bus_offset) << 8) | 0x80);
124 *val = in_le32((u32 *) (hose->cfg_data + (offset & 3)));
125
126 return PCIBIOS_SUCCESSFUL;
127}
128
129#define HARRIER_PCI_VEND_DEV_ID (PCI_VENDOR_ID_MOTOROLA | \
130 (PCI_DEVICE_ID_MOTOROLA_HARRIER << 16))
131static int prpmc_self(u8 bus, u8 devfn)
132{
133 /*
134 * Harriers always view themselves as being on bus 0. If we're not
135 * looking at bus 0, we're not going to find ourselves.
136 */
137 if (bus != 0)
138 return PCIBIOS_DEVICE_NOT_FOUND;
139 else {
140 int result;
141 int val;
142 struct pci_controller *hose;
143
144 hose = pci_bus_to_hose(bus);
145
146 /* See if target device is a Harrier */
147 result = prpmc_read_config_dword(hose, bus, devfn,
148 PCI_VENDOR_ID, &val);
149 if ((result != PCIBIOS_SUCCESSFUL) ||
150 (val != HARRIER_PCI_VEND_DEV_ID))
151 return PCIBIOS_DEVICE_NOT_FOUND;
152
153 /*
154 * LBA bit is set if target Harrier == initiating Harrier
155 * (i.e. if we are reading our own PCI header).
156 */
157 result = prpmc_read_config_dword(hose, bus, devfn,
158 HARRIER_LBA_OFF, &val);
159 if ((result != PCIBIOS_SUCCESSFUL) ||
160 ((val & HARRIER_LBA_MSK) != HARRIER_LBA_MSK))
161 return PCIBIOS_DEVICE_NOT_FOUND;
162
163 /* It's us, save our location for later */
164 self = devfn;
165 found_self = 1;
166 return PCIBIOS_SUCCESSFUL;
167 }
168}
169
170static int prpmc_exclude_device(u8 bus, u8 devfn)
171{
172 /*
173 * Monarch is allowed to access all PCI devices. Non-monarch is
174 * only allowed to access its own Harrier.
175 */
176
177 if (MONARCH)
178 return PCIBIOS_SUCCESSFUL;
179 if (found_self)
180 if ((bus == 0) && (devfn == self))
181 return PCIBIOS_SUCCESSFUL;
182 else
183 return PCIBIOS_DEVICE_NOT_FOUND;
184 else
185 return prpmc_self(bus, devfn);
186}
187
188void __init prpmc800_find_bridges(void)
189{
190 struct pci_controller *hose;
191 int host_bridge;
192
193 hose = pcibios_alloc_controller();
194 if (!hose)
195 return;
196
197 hose->first_busno = 0;
198 hose->last_busno = 0xff;
199
200 ppc_md.pci_exclude_device = prpmc_exclude_device;
201 ppc_md.pcibios_fixup = NULL;
202 ppc_md.pcibios_fixup_bus = NULL;
203 ppc_md.pci_swizzle = common_swizzle;
204 ppc_md.pci_map_irq = prpmc_map_irq;
205
206 setup_indirect_pci(hose,
207 PRPMC800_PCI_CONFIG_ADDR, PRPMC800_PCI_CONFIG_DATA);
208
209 /* Get host bridge vendor/dev id */
210
211 host_bridge = in_be32((uint *) (HARRIER_VENI_REG));
212
213 if (host_bridge != HARRIER_VEND_DEV_ID) {
214 printk(KERN_CRIT "Host bridge 0x%x not supported\n",
215 host_bridge);
216 return;
217 }
218
219 monarch = in_be32((uint *) HARRIER_MISC_CSR) & HARRIER_SYSCON;
220
221 printk(KERN_INFO "Running as %s.\n",
222 MONARCH ? "Monarch" : "Non-Monarch");
223
224 hose->io_space.start = PRPMC800_PCI_IO_START;
225 hose->io_space.end = PRPMC800_PCI_IO_END;
226 hose->io_base_virt = (void *)PRPMC800_ISA_IO_BASE;
227 hose->pci_mem_offset = PRPMC800_PCI_PHY_MEM_OFFSET;
228
229 pci_init_resource(&hose->io_resource,
230 PRPMC800_PCI_IO_START, PRPMC800_PCI_IO_END,
231 IORESOURCE_IO, "PCI host bridge");
232
233 if (MONARCH) {
234 hose->mem_space.start = PRPMC800_PCI_MEM_START;
235 hose->mem_space.end = PRPMC800_PCI_MEM_END;
236
237 pci_init_resource(&hose->mem_resources[0],
238 PRPMC800_PCI_MEM_START,
239 PRPMC800_PCI_MEM_END,
240 IORESOURCE_MEM, "PCI host bridge");
241
242 if (harrier_init(hose,
243 PRPMC800_HARRIER_XCSR_BASE,
244 PRPMC800_PROC_PCI_MEM_START,
245 PRPMC800_PROC_PCI_MEM_END,
246 PRPMC800_PROC_PCI_IO_START,
247 PRPMC800_PROC_PCI_IO_END,
248 PRPMC800_HARRIER_MPIC_BASE) != 0)
249 printk(KERN_CRIT "Could not initialize HARRIER "
250 "bridge\n");
251
252 harrier_release_eready(PRPMC800_HARRIER_XCSR_BASE);
253 harrier_wait_eready(PRPMC800_HARRIER_XCSR_BASE);
254 hose->last_busno = pciauto_bus_scan(hose, hose->first_busno);
255
256 } else {
257 pci_init_resource(&hose->mem_resources[0],
258 PRPMC800_NM_PCI_MEM_START,
259 PRPMC800_NM_PCI_MEM_END,
260 IORESOURCE_MEM, "PCI host bridge");
261
262 hose->mem_space.start = PRPMC800_NM_PCI_MEM_START;
263 hose->mem_space.end = PRPMC800_NM_PCI_MEM_END;
264
265 if (harrier_init(hose,
266 PRPMC800_HARRIER_XCSR_BASE,
267 PRPMC800_NM_PROC_PCI_MEM_START,
268 PRPMC800_NM_PROC_PCI_MEM_END,
269 PRPMC800_PROC_PCI_IO_START,
270 PRPMC800_PROC_PCI_IO_END,
271 PRPMC800_HARRIER_MPIC_BASE) != 0)
272 printk(KERN_CRIT "Could not initialize HARRIER "
273 "bridge\n");
274
275 harrier_setup_nonmonarch(PRPMC800_HARRIER_XCSR_BASE,
276 HARRIER_ITSZ_1MB);
277 harrier_release_eready(PRPMC800_HARRIER_XCSR_BASE);
278 }
279}
280
281static int prpmc800_show_cpuinfo(struct seq_file *m)
282{
283 seq_printf(m, "machine\t\t: PrPMC800\n");
284
285 return 0;
286}
287
288static void __init prpmc800_setup_arch(void)
289{
290 /* init to some ~sane value until calibrate_delay() runs */
291 loops_per_jiffy = 50000000 / HZ;
292
293 /* Lookup PCI host bridges */
294 prpmc800_find_bridges();
295
296#ifdef CONFIG_BLK_DEV_INITRD
297 if (initrd_start)
298 ROOT_DEV = Root_RAM0;
299 else
300#endif
301#ifdef CONFIG_ROOT_NFS
302 ROOT_DEV = Root_NFS;
303#else
304 ROOT_DEV = Root_SDA2;
305#endif
306
307 printk(KERN_INFO "Port by MontaVista Software, Inc. "
308 "(source@mvista.com)\n");
309}
310
311/*
312 * Compute the PrPMC800's tbl frequency using the baud clock as a reference.
313 */
314static void __init prpmc800_calibrate_decr(void)
315{
316 unsigned long tbl_start, tbl_end;
317 unsigned long current_state, old_state, tb_ticks_per_second;
318 unsigned int count;
319 unsigned int harrier_revision;
320
321 harrier_revision = readb(HARRIER_REVI_REG);
322 if (harrier_revision < 2) {
323 /* XTAL64 was broken in harrier revision 1 */
324 printk(KERN_INFO "time_init: Harrier revision %d, assuming "
325 "100 Mhz bus\n", harrier_revision);
326 tb_ticks_per_second = 100000000 / 4;
327 tb_ticks_per_jiffy = tb_ticks_per_second / HZ;
328 tb_to_us = mulhwu_scale_factor(tb_ticks_per_second, 1000000);
329 return;
330 }
331
332 /*
333 * The XTAL64 bit oscillates at the 1/64 the base baud clock
334 * Set count to XTAL64 cycles per second. Since we'll count
335 * half-cycles, we'll reach the count in half a second.
336 */
337 count = PRPMC800_BASE_BAUD / 64;
338
339 /* Find the first edge of the baud clock */
340 old_state = readb(HARRIER_UCTL_REG) & HARRIER_XTAL64_MASK;
341 do {
342 current_state = readb(HARRIER_UCTL_REG) & HARRIER_XTAL64_MASK;
343 } while (old_state == current_state);
344
345 old_state = current_state;
346
347 /* Get the starting time base value */
348 tbl_start = get_tbl();
349
350 /*
351 * Loop until we have found a number of edges (half-cycles)
352 * equal to the count (half a second)
353 */
354 do {
355 do {
356 current_state = readb(HARRIER_UCTL_REG) &
357 HARRIER_XTAL64_MASK;
358 } while (old_state == current_state);
359 old_state = current_state;
360 } while (--count);
361
362 /* Get the ending time base value */
363 tbl_end = get_tbl();
364
365 /* We only counted for half a second, so double to get ticks/second */
366 tb_ticks_per_second = (tbl_end - tbl_start) * 2;
367 tb_ticks_per_jiffy = tb_ticks_per_second / HZ;
368 tb_to_us = mulhwu_scale_factor(tb_ticks_per_second, 1000000);
369}
370
371static void prpmc800_restart(char *cmd)
372{
373 ulong temp;
374
375 local_irq_disable();
376 temp = in_be32((uint *) HARRIER_MISC_CSR_REG);
377 temp |= HARRIER_RSTOUT;
378 out_be32((uint *) HARRIER_MISC_CSR_REG, temp);
379 while (1) ;
380}
381
382static void prpmc800_halt(void)
383{
384 local_irq_disable();
385 while (1) ;
386}
387
388static void prpmc800_power_off(void)
389{
390 prpmc800_halt();
391}
392
393static void __init prpmc800_init_IRQ(void)
394{
395 OpenPIC_InitSenses = prpmc800_openpic_initsenses;
396 OpenPIC_NumInitSenses = sizeof(prpmc800_openpic_initsenses);
397
398 /* Setup external interrupt sources. */
399 openpic_set_sources(0, 16, OpenPIC_Addr + 0x10000);
400 /* Setup internal UART interrupt source. */
401 openpic_set_sources(16, 1, OpenPIC_Addr + 0x10200);
402
403 /* Do the MPIC initialization based on the above settings. */
404 openpic_init(0);
405
406 /* enable functional exceptions for uarts and abort */
407 out_8((u8 *) HARRIER_FEEN_REG, (HARRIER_FE_UA0 | HARRIER_FE_UA1));
408 out_8((u8 *) HARRIER_FEMA_REG, ~(HARRIER_FE_UA0 | HARRIER_FE_UA1));
409}
410
411/*
412 * Set BAT 3 to map 0xf0000000 to end of physical memory space.
413 */
414static __inline__ void prpmc800_set_bat(void)
415{
416 mb();
417 mtspr(SPRN_DBAT1U, 0xf0001ffe);
418 mtspr(SPRN_DBAT1L, 0xf000002a);
419 mb();
420}
421
422/*
423 * We need to read the Harrier memory controller
424 * to properly determine this value
425 */
426static unsigned long __init prpmc800_find_end_of_memory(void)
427{
428 /* Read the memory size from the Harrier XCSR */
429 return harrier_get_mem_size(PRPMC800_HARRIER_XCSR_BASE);
430}
431
432static void __init prpmc800_map_io(void)
433{
434 io_block_mapping(0x80000000, 0x80000000, 0x10000000, _PAGE_IO);
435 io_block_mapping(0xf0000000, 0xf0000000, 0x10000000, _PAGE_IO);
436}
437
438void __init
439platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
440 unsigned long r6, unsigned long r7)
441{
442 parse_bootinfo(find_bootinfo());
443
444 prpmc800_set_bat();
445
446 isa_io_base = PRPMC800_ISA_IO_BASE;
447 isa_mem_base = PRPMC800_ISA_MEM_BASE;
448 pci_dram_offset = PRPMC800_PCI_DRAM_OFFSET;
449
450 ppc_md.setup_arch = prpmc800_setup_arch;
451 ppc_md.show_cpuinfo = prpmc800_show_cpuinfo;
452 ppc_md.init_IRQ = prpmc800_init_IRQ;
453 ppc_md.get_irq = openpic_get_irq;
454
455 ppc_md.find_end_of_memory = prpmc800_find_end_of_memory;
456 ppc_md.setup_io_mappings = prpmc800_map_io;
457
458 ppc_md.restart = prpmc800_restart;
459 ppc_md.power_off = prpmc800_power_off;
460 ppc_md.halt = prpmc800_halt;
461
462 /* PrPMC800 has no timekeeper part */
463 ppc_md.time_init = NULL;
464 ppc_md.get_rtc_time = NULL;
465 ppc_md.set_rtc_time = NULL;
466 ppc_md.calibrate_decr = prpmc800_calibrate_decr;
467#ifdef CONFIG_SERIAL_TEXT_DEBUG
468 ppc_md.progress = gen550_progress;
469#else /* !CONFIG_SERIAL_TEXT_DEBUG */
470 ppc_md.progress = NULL;
471#endif /* CONFIG_SERIAL_TEXT_DEBUG */
472}
diff --git a/arch/ppc/platforms/prpmc800.h b/arch/ppc/platforms/prpmc800.h
deleted file mode 100644
index 26f604e05cfa..000000000000
--- a/arch/ppc/platforms/prpmc800.h
+++ /dev/null
@@ -1,82 +0,0 @@
1/*
2 * arch/ppc/platforms/prpmc800.h
3 *
4 * Definitions for Motorola PrPMC800 board support
5 *
6 * Author: Dale Farnsworth <dale.farnsworth@mvista.com>
7 *
8 * 2001-2004 (c) MontaVista, Software, Inc. This file is licensed under
9 * the terms of the GNU General Public License version 2. This program
10 * is licensed "as is" without any warranty of any kind, whether express
11 * or implied.
12 */
13 /*
14 * From Processor to PCI:
15 * PCI Mem Space: 0x80000000 - 0xa0000000 -> 0x80000000 - 0xa0000000 (512 MB)
16 * PCI I/O Space: 0xfe400000 - 0xfeef0000 -> 0x00000000 - 0x00b00000 (11 MB)
17 * Note: Must skip 0xfe000000-0xfe400000 for CONFIG_HIGHMEM/PKMAP area
18 *
19 * From PCI to Processor:
20 * System Memory: 0x00000000 -> 0x00000000
21 */
22
23#ifndef __ASMPPC_PRPMC800_H
24#define __ASMPPC_PRPMC800_H
25
26#define PRPMC800_PCI_CONFIG_ADDR 0xfe000cf8
27#define PRPMC800_PCI_CONFIG_DATA 0xfe000cfc
28
29#define PRPMC800_PROC_PCI_IO_START 0xfe400000U
30#define PRPMC800_PROC_PCI_IO_END 0xfeefffffU
31#define PRPMC800_PCI_IO_START 0x00000000U
32#define PRPMC800_PCI_IO_END 0x00afffffU
33
34#define PRPMC800_PROC_PCI_MEM_START 0x80000000U
35#define PRPMC800_PROC_PCI_MEM_END 0x9fffffffU
36#define PRPMC800_PCI_MEM_START 0x80000000U
37#define PRPMC800_PCI_MEM_END 0x9fffffffU
38
39#define PRPMC800_NM_PROC_PCI_MEM_START 0x40000000U
40#define PRPMC800_NM_PROC_PCI_MEM_END 0xdfffffffU
41#define PRPMC800_NM_PCI_MEM_START 0x40000000U
42#define PRPMC800_NM_PCI_MEM_END 0xdfffffffU
43
44#define PRPMC800_PCI_DRAM_OFFSET 0x00000000U
45#define PRPMC800_PCI_PHY_MEM_OFFSET 0x00000000U
46
47#define PRPMC800_ISA_IO_BASE PRPMC800_PROC_PCI_IO_START
48#define PRPMC800_ISA_MEM_BASE 0x00000000U
49
50#define PRPMC800_HARRIER_XCSR_BASE HARRIER_DEFAULT_XCSR_BASE
51#define PRPMC800_HARRIER_MPIC_BASE 0xff000000
52
53#define PRPMC800_SERIAL_1 0xfeff00c0
54
55#define PRPMC800_BASE_BAUD 1843200
56
57/*
58 * interrupt vector number and priority for harrier internal interrupt
59 * sources
60 */
61#define PRPMC800_INT_IRQ 16
62#define PRPMC800_INT_PRI 15
63
64/* UART Defines. */
65#define RS_TABLE_SIZE 4
66
67/* Rate for the 1.8432 Mhz clock for the onboard serial chip */
68#define BASE_BAUD (PRPMC800_BASE_BAUD / 16)
69
70#define STD_COM_FLAGS ASYNC_BOOT_AUTOCONF
71
72/* UARTS are at IRQ 16 */
73#define STD_SERIAL_PORT_DFNS \
74 { 0, BASE_BAUD, PRPMC800_SERIAL_1, 16, STD_COM_FLAGS, /* ttyS0 */\
75 iomem_base: (unsigned char *)PRPMC800_SERIAL_1, \
76 iomem_reg_shift: 0, \
77 io_type: SERIAL_IO_MEM },
78
79#define SERIAL_PORT_DFNS \
80 STD_SERIAL_PORT_DFNS
81
82#endif /* __ASMPPC_PRPMC800_H */
diff --git a/arch/ppc/platforms/radstone_ppc7d.c b/arch/ppc/platforms/radstone_ppc7d.c
deleted file mode 100644
index f1dee1e87809..000000000000
--- a/arch/ppc/platforms/radstone_ppc7d.c
+++ /dev/null
@@ -1,1492 +0,0 @@
1/*
2 * Board setup routines for the Radstone PPC7D boards.
3 *
4 * Author: James Chapman <jchapman@katalix.com>
5 *
6 * Based on code done by Rabeeh Khoury - rabeeh@galileo.co.il
7 * Based on code done by - Mark A. Greer <mgreer@mvista.com>
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation; either version 2 of the License, or (at your
12 * option) any later version.
13 */
14
15/* Radstone PPC7D boards are rugged VME boards with PPC 7447A CPUs,
16 * Discovery-II, dual gigabit ethernet, dual PMC, USB, keyboard/mouse,
17 * 4 serial ports, 2 high speed serial ports (MPSCs) and optional
18 * SCSI / VGA.
19 */
20
21#include <linux/stddef.h>
22#include <linux/kernel.h>
23#include <linux/init.h>
24#include <linux/errno.h>
25#include <linux/reboot.h>
26#include <linux/pci.h>
27#include <linux/kdev_t.h>
28#include <linux/major.h>
29#include <linux/initrd.h>
30#include <linux/console.h>
31#include <linux/delay.h>
32#include <linux/seq_file.h>
33#include <linux/root_dev.h>
34#include <linux/serial.h>
35#include <linux/tty.h> /* for linux/serial_core.h */
36#include <linux/serial_core.h>
37#include <linux/serial_8250.h>
38#include <linux/mv643xx.h>
39#include <linux/netdevice.h>
40#include <linux/platform_device.h>
41
42#include <asm/system.h>
43#include <asm/pgtable.h>
44#include <asm/page.h>
45#include <asm/time.h>
46#include <asm/dma.h>
47#include <asm/io.h>
48#include <asm/machdep.h>
49#include <asm/prom.h>
50#include <asm/smp.h>
51#include <asm/vga.h>
52#include <asm/open_pic.h>
53#include <asm/i8259.h>
54#include <asm/todc.h>
55#include <asm/bootinfo.h>
56#include <asm/mpc10x.h>
57#include <asm/pci-bridge.h>
58#include <asm/mv64x60.h>
59
60#include "radstone_ppc7d.h"
61
62#undef DEBUG
63
64#define PPC7D_RST_PIN 17 /* GPP17 */
65
66extern u32 mv64360_irq_base;
67extern spinlock_t rtc_lock;
68
69static struct mv64x60_handle bh;
70static int ppc7d_has_alma;
71
72extern void gen550_progress(char *, unsigned short);
73extern void gen550_init(int, struct uart_port *);
74
75/* FIXME - move to h file */
76extern int ds1337_do_command(int id, int cmd, void *arg);
77#define DS1337_GET_DATE 0
78#define DS1337_SET_DATE 1
79
80/* residual data */
81unsigned char __res[sizeof(bd_t)];
82
83/*****************************************************************************
84 * Serial port code
85 *****************************************************************************/
86
87#if defined(CONFIG_KGDB) || defined(CONFIG_SERIAL_TEXT_DEBUG)
88static void __init ppc7d_early_serial_map(void)
89{
90#if defined(CONFIG_SERIAL_MPSC_CONSOLE)
91 mv64x60_progress_init(CONFIG_MV64X60_NEW_BASE);
92#elif defined(CONFIG_SERIAL_8250)
93 struct uart_port serial_req;
94
95 /* Setup serial port access */
96 memset(&serial_req, 0, sizeof(serial_req));
97 serial_req.uartclk = UART_CLK;
98 serial_req.irq = 4;
99 serial_req.flags = STD_COM_FLAGS;
100 serial_req.iotype = UPIO_MEM;
101 serial_req.membase = (u_char *) PPC7D_SERIAL_0;
102
103 gen550_init(0, &serial_req);
104 if (early_serial_setup(&serial_req) != 0)
105 printk(KERN_ERR "Early serial init of port 0 failed\n");
106
107 /* Assume early_serial_setup() doesn't modify serial_req */
108 serial_req.line = 1;
109 serial_req.irq = 3;
110 serial_req.membase = (u_char *) PPC7D_SERIAL_1;
111
112 gen550_init(1, &serial_req);
113 if (early_serial_setup(&serial_req) != 0)
114 printk(KERN_ERR "Early serial init of port 1 failed\n");
115#else
116#error CONFIG_KGDB || CONFIG_SERIAL_TEXT_DEBUG has no supported CONFIG_SERIAL_XXX
117#endif
118}
119#endif /* CONFIG_KGDB || CONFIG_SERIAL_TEXT_DEBUG */
120
121/*****************************************************************************
122 * Low-level board support code
123 *****************************************************************************/
124
125static unsigned long __init ppc7d_find_end_of_memory(void)
126{
127 bd_t *bp = (bd_t *) __res;
128
129 if (bp->bi_memsize)
130 return bp->bi_memsize;
131
132 return (256 * 1024 * 1024);
133}
134
135static void __init ppc7d_map_io(void)
136{
137 /* remove temporary mapping */
138 mtspr(SPRN_DBAT3U, 0x00000000);
139 mtspr(SPRN_DBAT3L, 0x00000000);
140
141 io_block_mapping(0xe8000000, 0xe8000000, 0x08000000, _PAGE_IO);
142 io_block_mapping(0xfe000000, 0xfe000000, 0x02000000, _PAGE_IO);
143}
144
145static void ppc7d_restart(char *cmd)
146{
147 u32 data;
148
149 /* Disable GPP17 interrupt */
150 data = mv64x60_read(&bh, MV64x60_GPP_INTR_MASK);
151 data &= ~(1 << PPC7D_RST_PIN);
152 mv64x60_write(&bh, MV64x60_GPP_INTR_MASK, data);
153
154 /* Configure MPP17 as GPP */
155 data = mv64x60_read(&bh, MV64x60_MPP_CNTL_2);
156 data &= ~(0x0000000f << 4);
157 mv64x60_write(&bh, MV64x60_MPP_CNTL_2, data);
158
159 /* Enable pin GPP17 for output */
160 data = mv64x60_read(&bh, MV64x60_GPP_IO_CNTL);
161 data |= (1 << PPC7D_RST_PIN);
162 mv64x60_write(&bh, MV64x60_GPP_IO_CNTL, data);
163
164 /* Toggle GPP9 pin to reset the board */
165 mv64x60_write(&bh, MV64x60_GPP_VALUE_CLR, 1 << PPC7D_RST_PIN);
166 mv64x60_write(&bh, MV64x60_GPP_VALUE_SET, 1 << PPC7D_RST_PIN);
167
168 for (;;) ; /* Spin until reset happens */
169 /* NOTREACHED */
170}
171
172static void ppc7d_power_off(void)
173{
174 u32 data;
175
176 local_irq_disable();
177
178 /* Ensure that internal MV643XX watchdog is disabled.
179 * The Disco watchdog uses MPP17 on this hardware.
180 */
181 data = mv64x60_read(&bh, MV64x60_MPP_CNTL_2);
182 data &= ~(0x0000000f << 4);
183 mv64x60_write(&bh, MV64x60_MPP_CNTL_2, data);
184
185 data = mv64x60_read(&bh, MV64x60_WDT_WDC);
186 if (data & 0x80000000) {
187 mv64x60_write(&bh, MV64x60_WDT_WDC, 1 << 24);
188 mv64x60_write(&bh, MV64x60_WDT_WDC, 2 << 24);
189 }
190
191 for (;;) ; /* No way to shut power off with software */
192 /* NOTREACHED */
193}
194
195static void ppc7d_halt(void)
196{
197 ppc7d_power_off();
198 /* NOTREACHED */
199}
200
201static unsigned long ppc7d_led_no_pulse;
202
203static int __init ppc7d_led_pulse_disable(char *str)
204{
205 ppc7d_led_no_pulse = 1;
206 return 1;
207}
208
209/* This kernel option disables the heartbeat pulsing of a board LED */
210__setup("ledoff", ppc7d_led_pulse_disable);
211
212static void ppc7d_heartbeat(void)
213{
214 u32 data32;
215 u8 data8;
216 static int max706_wdog = 0;
217
218 /* Unfortunately we can't access the LED control registers
219 * during early init because they're on the CPLD which is the
220 * other side of a PCI bridge which goes unreachable during
221 * PCI scan. So write the LEDs only if the MV64360 watchdog is
222 * enabled (i.e. userspace apps are running so kernel is up)..
223 */
224 data32 = mv64x60_read(&bh, MV64x60_WDT_WDC);
225 if (data32 & 0x80000000) {
226 /* Enable MAX706 watchdog if not done already */
227 if (!max706_wdog) {
228 outb(3, PPC7D_CPLD_RESET);
229 max706_wdog = 1;
230 }
231
232 /* Hit the MAX706 watchdog */
233 outb(0, PPC7D_CPLD_WATCHDOG_TRIG);
234
235 /* Pulse LED DS219 if not disabled */
236 if (!ppc7d_led_no_pulse) {
237 static int led_on = 0;
238
239 data8 = inb(PPC7D_CPLD_LEDS);
240 if (led_on)
241 data8 &= ~PPC7D_CPLD_LEDS_DS219_MASK;
242 else
243 data8 |= PPC7D_CPLD_LEDS_DS219_MASK;
244
245 outb(data8, PPC7D_CPLD_LEDS);
246 led_on = !led_on;
247 }
248 }
249 ppc_md.heartbeat_count = ppc_md.heartbeat_reset;
250}
251
252static int ppc7d_show_cpuinfo(struct seq_file *m)
253{
254 u8 val;
255 u8 val1, val2;
256 static int flash_sizes[4] = { 64, 32, 0, 16 };
257 static int flash_banks[4] = { 4, 3, 2, 1 };
258 static int sdram_bank_sizes[4] = { 128, 256, 512, 1 };
259 int sdram_num_banks = 2;
260 static char *pci_modes[] = { "PCI33", "PCI66",
261 "Unknown", "Unknown",
262 "PCIX33", "PCIX66",
263 "PCIX100", "PCIX133"
264 };
265
266 seq_printf(m, "vendor\t\t: Radstone Technology\n");
267 seq_printf(m, "machine\t\t: PPC7D\n");
268
269 val = inb(PPC7D_CPLD_BOARD_REVISION);
270 val1 = (val & PPC7D_CPLD_BOARD_REVISION_NUMBER_MASK) >> 5;
271 val2 = (val & PPC7D_CPLD_BOARD_REVISION_LETTER_MASK);
272 seq_printf(m, "revision\t: %hd%c%c\n",
273 val1,
274 (val2 <= 0x18) ? 'A' + val2 : 'Y',
275 (val2 > 0x18) ? 'A' + (val2 - 0x19) : ' ');
276
277 val = inb(PPC7D_CPLD_MOTHERBOARD_TYPE);
278 val1 = val & PPC7D_CPLD_MB_TYPE_PLL_MASK;
279 val2 = val & (PPC7D_CPLD_MB_TYPE_ECC_FITTED_MASK |
280 PPC7D_CPLD_MB_TYPE_ECC_ENABLE_MASK);
281 seq_printf(m, "bus speed\t: %dMHz\n",
282 (val1 == PPC7D_CPLD_MB_TYPE_PLL_133) ? 133 :
283 (val1 == PPC7D_CPLD_MB_TYPE_PLL_100) ? 100 :
284 (val1 == PPC7D_CPLD_MB_TYPE_PLL_64) ? 64 : 0);
285
286 val = inb(PPC7D_CPLD_MEM_CONFIG);
287 if (val & PPC7D_CPLD_SDRAM_BANK_NUM_MASK) sdram_num_banks--;
288
289 val = inb(PPC7D_CPLD_MEM_CONFIG_EXTEND);
290 val1 = (val & PPC7D_CPLD_SDRAM_BANK_SIZE_MASK) >> 6;
291 seq_printf(m, "SDRAM\t\t: %d banks of %d%c, total %d%c",
292 sdram_num_banks,
293 sdram_bank_sizes[val1],
294 (sdram_bank_sizes[val1] < 128) ? 'G' : 'M',
295 sdram_num_banks * sdram_bank_sizes[val1],
296 (sdram_bank_sizes[val1] < 128) ? 'G' : 'M');
297 if (val2 & PPC7D_CPLD_MB_TYPE_ECC_FITTED_MASK) {
298 seq_printf(m, " [ECC %sabled]",
299 (val2 & PPC7D_CPLD_MB_TYPE_ECC_ENABLE_MASK) ? "en" :
300 "dis");
301 }
302 seq_printf(m, "\n");
303
304 val1 = (val & PPC7D_CPLD_FLASH_DEV_SIZE_MASK);
305 val2 = (val & PPC7D_CPLD_FLASH_BANK_NUM_MASK) >> 2;
306 seq_printf(m, "FLASH\t\t: %d banks of %dM, total %dM\n",
307 flash_banks[val2], flash_sizes[val1],
308 flash_banks[val2] * flash_sizes[val1]);
309
310 val = inb(PPC7D_CPLD_FLASH_WRITE_CNTL);
311 val1 = inb(PPC7D_CPLD_SW_FLASH_WRITE_PROTECT);
312 seq_printf(m, " write links\t: %s%s%s%s\n",
313 (val & PPD7D_CPLD_FLASH_CNTL_WR_LINK_MASK) ? "WRITE " : "",
314 (val & PPD7D_CPLD_FLASH_CNTL_BOOT_LINK_MASK) ? "BOOT " : "",
315 (val & PPD7D_CPLD_FLASH_CNTL_USER_LINK_MASK) ? "USER " : "",
316 (val & (PPD7D_CPLD_FLASH_CNTL_WR_LINK_MASK |
317 PPD7D_CPLD_FLASH_CNTL_BOOT_LINK_MASK |
318 PPD7D_CPLD_FLASH_CNTL_USER_LINK_MASK)) ==
319 0 ? "NONE" : "");
320 seq_printf(m, " write sector h/w enables: %s%s%s%s%s\n",
321 (val & PPD7D_CPLD_FLASH_CNTL_RECO_WR_MASK) ? "RECOVERY " :
322 "",
323 (val & PPD7D_CPLD_FLASH_CNTL_BOOT_WR_MASK) ? "BOOT " : "",
324 (val & PPD7D_CPLD_FLASH_CNTL_USER_WR_MASK) ? "USER " : "",
325 (val1 & PPC7D_CPLD_FLASH_CNTL_NVRAM_PROT_MASK) ? "NVRAM " :
326 "",
327 (((val &
328 (PPD7D_CPLD_FLASH_CNTL_RECO_WR_MASK |
329 PPD7D_CPLD_FLASH_CNTL_BOOT_WR_MASK |
330 PPD7D_CPLD_FLASH_CNTL_BOOT_WR_MASK)) == 0)
331 && ((val1 & PPC7D_CPLD_FLASH_CNTL_NVRAM_PROT_MASK) ==
332 0)) ? "NONE" : "");
333 val1 =
334 inb(PPC7D_CPLD_SW_FLASH_WRITE_PROTECT) &
335 (PPC7D_CPLD_SW_FLASH_WRPROT_SYSBOOT_MASK |
336 PPC7D_CPLD_SW_FLASH_WRPROT_USER_MASK);
337 seq_printf(m, " software sector enables: %s%s%s\n",
338 (val1 & PPC7D_CPLD_SW_FLASH_WRPROT_SYSBOOT_MASK) ? "SYSBOOT "
339 : "",
340 (val1 & PPC7D_CPLD_SW_FLASH_WRPROT_USER_MASK) ? "USER " : "",
341 (val1 == 0) ? "NONE " : "");
342
343 seq_printf(m, "Boot options\t: %s%s%s%s\n",
344 (val & PPC7D_CPLD_FLASH_CNTL_ALTBOOT_LINK_MASK) ?
345 "ALTERNATE " : "",
346 (val & PPC7D_CPLD_FLASH_CNTL_VMEBOOT_LINK_MASK) ? "VME " :
347 "",
348 (val & PPC7D_CPLD_FLASH_CNTL_RECBOOT_LINK_MASK) ? "RECOVERY "
349 : "",
350 ((val &
351 (PPC7D_CPLD_FLASH_CNTL_ALTBOOT_LINK_MASK |
352 PPC7D_CPLD_FLASH_CNTL_VMEBOOT_LINK_MASK |
353 PPC7D_CPLD_FLASH_CNTL_RECBOOT_LINK_MASK)) ==
354 0) ? "NONE" : "");
355
356 val = inb(PPC7D_CPLD_EQUIPMENT_PRESENT_1);
357 seq_printf(m, "Fitted modules\t: %s%s%s%s\n",
358 (val & PPC7D_CPLD_EQPT_PRES_1_PMC1_MASK) ? "" : "PMC1 ",
359 (val & PPC7D_CPLD_EQPT_PRES_1_PMC2_MASK) ? "" : "PMC2 ",
360 (val & PPC7D_CPLD_EQPT_PRES_1_AFIX_MASK) ? "AFIX " : "",
361 ((val & (PPC7D_CPLD_EQPT_PRES_1_PMC1_MASK |
362 PPC7D_CPLD_EQPT_PRES_1_PMC2_MASK |
363 PPC7D_CPLD_EQPT_PRES_1_AFIX_MASK)) ==
364 (PPC7D_CPLD_EQPT_PRES_1_PMC1_MASK |
365 PPC7D_CPLD_EQPT_PRES_1_PMC2_MASK)) ? "NONE" : "");
366
367 if (val & PPC7D_CPLD_EQPT_PRES_1_AFIX_MASK) {
368 static const char *ids[] = {
369 "unknown",
370 "1553 (Dual Channel)",
371 "1553 (Single Channel)",
372 "8-bit SCSI + VGA",
373 "16-bit SCSI + VGA",
374 "1553 (Single Channel with sideband)",
375 "1553 (Dual Channel with sideband)",
376 NULL
377 };
378 u8 id = __raw_readb((void *)PPC7D_AFIX_REG_BASE + 0x03);
379 seq_printf(m, "AFIX module\t: 0x%hx [%s]\n", id,
380 id < 7 ? ids[id] : "unknown");
381 }
382
383 val = inb(PPC7D_CPLD_PCI_CONFIG);
384 val1 = (val & PPC7D_CPLD_PCI_CONFIG_PCI0_MASK) >> 4;
385 val2 = (val & PPC7D_CPLD_PCI_CONFIG_PCI1_MASK);
386 seq_printf(m, "PCI#0\t\t: %s\nPCI#1\t\t: %s\n",
387 pci_modes[val1], pci_modes[val2]);
388
389 val = inb(PPC7D_CPLD_EQUIPMENT_PRESENT_2);
390 seq_printf(m, "PMC1\t\t: %s\nPMC2\t\t: %s\n",
391 (val & PPC7D_CPLD_EQPT_PRES_3_PMC1_V_MASK) ? "3.3v" : "5v",
392 (val & PPC7D_CPLD_EQPT_PRES_3_PMC2_V_MASK) ? "3.3v" : "5v");
393 seq_printf(m, "PMC power source: %s\n",
394 (val & PPC7D_CPLD_EQPT_PRES_3_PMC_POWER_MASK) ? "VME" :
395 "internal");
396
397 val = inb(PPC7D_CPLD_EQUIPMENT_PRESENT_4);
398 val2 = inb(PPC7D_CPLD_EQUIPMENT_PRESENT_2);
399 seq_printf(m, "Fit options\t: %s%s%s%s%s%s%s\n",
400 (val & PPC7D_CPLD_EQPT_PRES_4_LPT_MASK) ? "LPT " : "",
401 (val & PPC7D_CPLD_EQPT_PRES_4_PS2_FITTED) ? "PS2 " : "",
402 (val & PPC7D_CPLD_EQPT_PRES_4_USB2_FITTED) ? "USB2 " : "",
403 (val2 & PPC7D_CPLD_EQPT_PRES_2_UNIVERSE_MASK) ? "VME " : "",
404 (val2 & PPC7D_CPLD_EQPT_PRES_2_COM36_MASK) ? "COM3-6 " : "",
405 (val2 & PPC7D_CPLD_EQPT_PRES_2_GIGE_MASK) ? "eth0 " : "",
406 (val2 & PPC7D_CPLD_EQPT_PRES_2_DUALGIGE_MASK) ? "eth1 " :
407 "");
408
409 val = inb(PPC7D_CPLD_ID_LINK);
410 val1 = val & (PPC7D_CPLD_ID_LINK_E6_MASK |
411 PPC7D_CPLD_ID_LINK_E7_MASK |
412 PPC7D_CPLD_ID_LINK_E12_MASK |
413 PPC7D_CPLD_ID_LINK_E13_MASK);
414
415 val = inb(PPC7D_CPLD_FLASH_WRITE_CNTL) &
416 (PPD7D_CPLD_FLASH_CNTL_WR_LINK_MASK |
417 PPD7D_CPLD_FLASH_CNTL_BOOT_LINK_MASK |
418 PPD7D_CPLD_FLASH_CNTL_USER_LINK_MASK);
419
420 seq_printf(m, "Board links present: %s%s%s%s%s%s%s%s\n",
421 (val1 & PPC7D_CPLD_ID_LINK_E6_MASK) ? "E6 " : "",
422 (val1 & PPC7D_CPLD_ID_LINK_E7_MASK) ? "E7 " : "",
423 (val & PPD7D_CPLD_FLASH_CNTL_WR_LINK_MASK) ? "E9 " : "",
424 (val & PPD7D_CPLD_FLASH_CNTL_BOOT_LINK_MASK) ? "E10 " : "",
425 (val & PPD7D_CPLD_FLASH_CNTL_USER_LINK_MASK) ? "E11 " : "",
426 (val1 & PPC7D_CPLD_ID_LINK_E12_MASK) ? "E12 " : "",
427 (val1 & PPC7D_CPLD_ID_LINK_E13_MASK) ? "E13 " : "",
428 ((val == 0) && (val1 == 0)) ? "NONE" : "");
429
430 val = inb(PPC7D_CPLD_WDOG_RESETSW_MASK);
431 seq_printf(m, "Front panel reset switch: %sabled\n",
432 (val & PPC7D_CPLD_WDOG_RESETSW_MASK) ? "dis" : "en");
433
434 return 0;
435}
436
437static void __init ppc7d_calibrate_decr(void)
438{
439 ulong freq;
440
441 freq = 100000000 / 4;
442
443 pr_debug("time_init: decrementer frequency = %lu.%.6lu MHz\n",
444 freq / 1000000, freq % 1000000);
445
446 tb_ticks_per_jiffy = freq / HZ;
447 tb_to_us = mulhwu_scale_factor(freq, 1000000);
448}
449
450/*****************************************************************************
451 * Interrupt stuff
452 *****************************************************************************/
453
454static irqreturn_t ppc7d_i8259_intr(int irq, void *dev_id)
455{
456 u32 temp = mv64x60_read(&bh, MV64x60_GPP_INTR_CAUSE);
457 if (temp & (1 << 28)) {
458 i8259_irq();
459 mv64x60_write(&bh, MV64x60_GPP_INTR_CAUSE, temp & (~(1 << 28)));
460 return IRQ_HANDLED;
461 }
462
463 return IRQ_NONE;
464}
465
466/*
467 * Each interrupt cause is assigned an IRQ number.
468 * Southbridge has 16*2 (two 8259's) interrupts.
469 * Discovery-II has 96 interrupts (cause-hi, cause-lo, gpp x 32).
470 * If multiple interrupts are pending, get_irq() returns the
471 * lowest pending irq number first.
472 *
473 *
474 * IRQ # Source Trig Active
475 * =============================================================
476 *
477 * Southbridge
478 * -----------
479 * IRQ # Source Trig
480 * =============================================================
481 * 0 ISA High Resolution Counter Edge
482 * 1 Keyboard Edge
483 * 2 Cascade From (IRQ 8-15) Edge
484 * 3 Com 2 (Uart 2) Edge
485 * 4 Com 1 (Uart 1) Edge
486 * 5 PCI Int D/AFIX IRQZ ID4 (2,7) Level
487 * 6 GPIO Level
488 * 7 LPT Edge
489 * 8 RTC Alarm Edge
490 * 9 PCI Int A/PMC 2/AFIX IRQW ID1 (2,0) Level
491 * 10 PCI Int B/PMC 1/AFIX IRQX ID2 (2,1) Level
492 * 11 USB2 Level
493 * 12 Mouse Edge
494 * 13 Reserved internally by Ali M1535+
495 * 14 PCI Int C/VME/AFIX IRQY ID3 (2,6) Level
496 * 15 COM 5/6 Level
497 *
498 * 16..112 Discovery-II...
499 *
500 * MPP28 Southbridge Edge High
501 *
502 *
503 * Interrupts are cascaded through to the Discovery-II.
504 *
505 * PCI ---
506 * \
507 * CPLD --> ALI1535 -------> DISCOVERY-II
508 * INTF MPP28
509 */
510static void __init ppc7d_init_irq(void)
511{
512 int irq;
513
514 pr_debug("%s\n", __func__);
515 i8259_init(0, 0);
516 mv64360_init_irq();
517
518 /* IRQs 5,6,9,10,11,14,15 are level sensitive */
519 irq_desc[5].status |= IRQ_LEVEL;
520 irq_desc[6].status |= IRQ_LEVEL;
521 irq_desc[9].status |= IRQ_LEVEL;
522 irq_desc[10].status |= IRQ_LEVEL;
523 irq_desc[11].status |= IRQ_LEVEL;
524 irq_desc[14].status |= IRQ_LEVEL;
525 irq_desc[15].status |= IRQ_LEVEL;
526
527 /* GPP28 is edge triggered */
528 irq_desc[mv64360_irq_base + MV64x60_IRQ_GPP28].status &= ~IRQ_LEVEL;
529}
530
531static u32 ppc7d_irq_canonicalize(u32 irq)
532{
533 if ((irq >= 16) && (irq < (16 + 96)))
534 irq -= 16;
535
536 return irq;
537}
538
539static int ppc7d_get_irq(void)
540{
541 int irq;
542
543 irq = mv64360_get_irq();
544 if (irq == (mv64360_irq_base + MV64x60_IRQ_GPP28))
545 irq = i8259_irq();
546 return irq;
547}
548
549/*
550 * 9 PCI Int A/PMC 2/AFIX IRQW ID1 (2,0) Level
551 * 10 PCI Int B/PMC 1/AFIX IRQX ID2 (2,1) Level
552 * 14 PCI Int C/VME/AFIX IRQY ID3 (2,6) Level
553 * 5 PCI Int D/AFIX IRQZ ID4 (2,7) Level
554 */
555static int __init ppc7d_map_irq(struct pci_dev *dev, unsigned char idsel,
556 unsigned char pin)
557{
558 static const char pci_irq_table[][4] =
559 /*
560 * PCI IDSEL/INTPIN->INTLINE
561 * A B C D
562 */
563 {
564 {10, 14, 5, 9}, /* IDSEL 10 - PMC2 / AFIX IRQW */
565 {9, 10, 14, 5}, /* IDSEL 11 - PMC1 / AFIX IRQX */
566 {5, 9, 10, 14}, /* IDSEL 12 - AFIX IRQY */
567 {14, 5, 9, 10}, /* IDSEL 13 - AFIX IRQZ */
568 };
569 const long min_idsel = 10, max_idsel = 14, irqs_per_slot = 4;
570
571 pr_debug("%s: %04x/%04x/%x: idsel=%hx pin=%hu\n", __func__,
572 dev->vendor, dev->device, PCI_FUNC(dev->devfn), idsel, pin);
573
574 return PCI_IRQ_TABLE_LOOKUP;
575}
576
577void __init ppc7d_intr_setup(void)
578{
579 u32 data;
580
581 /*
582 * Define GPP 28 interrupt polarity as active high
583 * input signal and level triggered
584 */
585 data = mv64x60_read(&bh, MV64x60_GPP_LEVEL_CNTL);
586 data &= ~(1 << 28);
587 mv64x60_write(&bh, MV64x60_GPP_LEVEL_CNTL, data);
588 data = mv64x60_read(&bh, MV64x60_GPP_IO_CNTL);
589 data &= ~(1 << 28);
590 mv64x60_write(&bh, MV64x60_GPP_IO_CNTL, data);
591
592 /* Config GPP intr ctlr to respond to level trigger */
593 data = mv64x60_read(&bh, MV64x60_COMM_ARBITER_CNTL);
594 data |= (1 << 10);
595 mv64x60_write(&bh, MV64x60_COMM_ARBITER_CNTL, data);
596
597 /* XXXX Erranum FEr PCI-#8 */
598 data = mv64x60_read(&bh, MV64x60_PCI0_CMD);
599 data &= ~((1 << 5) | (1 << 9));
600 mv64x60_write(&bh, MV64x60_PCI0_CMD, data);
601 data = mv64x60_read(&bh, MV64x60_PCI1_CMD);
602 data &= ~((1 << 5) | (1 << 9));
603 mv64x60_write(&bh, MV64x60_PCI1_CMD, data);
604
605 /*
606 * Dismiss and then enable interrupt on GPP interrupt cause
607 * for CPU #0
608 */
609 mv64x60_write(&bh, MV64x60_GPP_INTR_CAUSE, ~(1 << 28));
610 data = mv64x60_read(&bh, MV64x60_GPP_INTR_MASK);
611 data |= (1 << 28);
612 mv64x60_write(&bh, MV64x60_GPP_INTR_MASK, data);
613
614 /*
615 * Dismiss and then enable interrupt on CPU #0 high cause reg
616 * BIT27 summarizes GPP interrupts 23-31
617 */
618 mv64x60_write(&bh, MV64360_IC_MAIN_CAUSE_HI, ~(1 << 27));
619 data = mv64x60_read(&bh, MV64360_IC_CPU0_INTR_MASK_HI);
620 data |= (1 << 27);
621 mv64x60_write(&bh, MV64360_IC_CPU0_INTR_MASK_HI, data);
622}
623
624/*****************************************************************************
625 * Platform device data fixup routines.
626 *****************************************************************************/
627
628#if defined(CONFIG_SERIAL_MPSC)
629static void __init ppc7d_fixup_mpsc_pdata(struct platform_device *pdev)
630{
631 struct mpsc_pdata *pdata;
632
633 pdata = (struct mpsc_pdata *)pdev->dev.platform_data;
634
635 pdata->max_idle = 40;
636 pdata->default_baud = PPC7D_DEFAULT_BAUD;
637 pdata->brg_clk_src = PPC7D_MPSC_CLK_SRC;
638 pdata->brg_clk_freq = PPC7D_MPSC_CLK_FREQ;
639
640 return;
641}
642#endif
643
644#if defined(CONFIG_MV643XX_ETH)
645static void __init ppc7d_fixup_eth_pdata(struct platform_device *pdev)
646{
647 struct mv643xx_eth_platform_data *eth_pd;
648 static u16 phy_addr[] = {
649 PPC7D_ETH0_PHY_ADDR,
650 PPC7D_ETH1_PHY_ADDR,
651 PPC7D_ETH2_PHY_ADDR,
652 };
653 int i;
654
655 eth_pd = pdev->dev.platform_data;
656 eth_pd->force_phy_addr = 1;
657 eth_pd->phy_addr = phy_addr[pdev->id];
658 eth_pd->tx_queue_size = PPC7D_ETH_TX_QUEUE_SIZE;
659 eth_pd->rx_queue_size = PPC7D_ETH_RX_QUEUE_SIZE;
660
661 /* Adjust IRQ by mv64360_irq_base */
662 for (i = 0; i < pdev->num_resources; i++) {
663 struct resource *r = &pdev->resource[i];
664
665 if (r->flags & IORESOURCE_IRQ) {
666 r->start += mv64360_irq_base;
667 r->end += mv64360_irq_base;
668 pr_debug("%s, uses IRQ %d\n", pdev->name,
669 (int)r->start);
670 }
671 }
672
673}
674#endif
675
676#if defined(CONFIG_I2C_MV64XXX)
677static void __init
678ppc7d_fixup_i2c_pdata(struct platform_device *pdev)
679{
680 struct mv64xxx_i2c_pdata *pdata;
681 int i;
682
683 pdata = pdev->dev.platform_data;
684 if (pdata == NULL) {
685 pdata = kzalloc(sizeof(*pdata), GFP_KERNEL);
686 if (pdata == NULL)
687 return;
688
689 pdev->dev.platform_data = pdata;
690 }
691
692 /* divisors M=8, N=3 for 100kHz I2C from 133MHz system clock */
693 pdata->freq_m = 8;
694 pdata->freq_n = 3;
695 pdata->timeout = 500;
696 pdata->retries = 3;
697
698 /* Adjust IRQ by mv64360_irq_base */
699 for (i = 0; i < pdev->num_resources; i++) {
700 struct resource *r = &pdev->resource[i];
701
702 if (r->flags & IORESOURCE_IRQ) {
703 r->start += mv64360_irq_base;
704 r->end += mv64360_irq_base;
705 pr_debug("%s, uses IRQ %d\n", pdev->name, (int) r->start);
706 }
707 }
708}
709#endif
710
711static int ppc7d_platform_notify(struct device *dev)
712{
713 static struct {
714 char *bus_id;
715 void ((*rtn) (struct platform_device * pdev));
716 } dev_map[] = {
717#if defined(CONFIG_SERIAL_MPSC)
718 { MPSC_CTLR_NAME ".0", ppc7d_fixup_mpsc_pdata },
719 { MPSC_CTLR_NAME ".1", ppc7d_fixup_mpsc_pdata },
720#endif
721#if defined(CONFIG_MV643XX_ETH)
722 { MV643XX_ETH_NAME ".0", ppc7d_fixup_eth_pdata },
723 { MV643XX_ETH_NAME ".1", ppc7d_fixup_eth_pdata },
724 { MV643XX_ETH_NAME ".2", ppc7d_fixup_eth_pdata },
725#endif
726#if defined(CONFIG_I2C_MV64XXX)
727 { MV64XXX_I2C_CTLR_NAME ".0", ppc7d_fixup_i2c_pdata },
728#endif
729 };
730 struct platform_device *pdev;
731 int i;
732
733 if (dev && dev->bus_id)
734 for (i = 0; i < ARRAY_SIZE(dev_map); i++)
735 if (!strncmp(dev->bus_id, dev_map[i].bus_id,
736 BUS_ID_SIZE)) {
737
738 pdev = container_of(dev,
739 struct platform_device,
740 dev);
741 dev_map[i].rtn(pdev);
742 }
743
744 return 0;
745}
746
747/*****************************************************************************
748 * PCI device fixups.
749 * These aren't really fixups per se. They are used to init devices as they
750 * are found during PCI scan.
751 *
752 * The PPC7D has an HB8 PCI-X bridge which must be set up during a PCI
753 * scan in order to find other devices on its secondary side.
754 *****************************************************************************/
755
756static void __init ppc7d_fixup_hb8(struct pci_dev *dev)
757{
758 u16 val16;
759
760 if (dev->bus->number == 0) {
761 pr_debug("PCI: HB8 init\n");
762
763 pci_write_config_byte(dev, 0x1c,
764 ((PPC7D_PCI0_IO_START_PCI_ADDR & 0xf000)
765 >> 8) | 0x01);
766 pci_write_config_byte(dev, 0x1d,
767 (((PPC7D_PCI0_IO_START_PCI_ADDR +
768 PPC7D_PCI0_IO_SIZE -
769 1) & 0xf000) >> 8) | 0x01);
770 pci_write_config_word(dev, 0x30,
771 PPC7D_PCI0_IO_START_PCI_ADDR >> 16);
772 pci_write_config_word(dev, 0x32,
773 ((PPC7D_PCI0_IO_START_PCI_ADDR +
774 PPC7D_PCI0_IO_SIZE -
775 1) >> 16) & 0xffff);
776
777 pci_write_config_word(dev, 0x20,
778 PPC7D_PCI0_MEM0_START_PCI_LO_ADDR >> 16);
779 pci_write_config_word(dev, 0x22,
780 ((PPC7D_PCI0_MEM0_START_PCI_LO_ADDR +
781 PPC7D_PCI0_MEM0_SIZE -
782 1) >> 16) & 0xffff);
783 pci_write_config_word(dev, 0x24, 0);
784 pci_write_config_word(dev, 0x26, 0);
785 pci_write_config_dword(dev, 0x28, 0);
786 pci_write_config_dword(dev, 0x2c, 0);
787
788 pci_read_config_word(dev, 0x3e, &val16);
789 val16 |= ((1 << 5) | (1 << 1)); /* signal master aborts and
790 * SERR to primary
791 */
792 val16 &= ~(1 << 2); /* ISA disable, so all ISA
793 * ports forwarded to secondary
794 */
795 pci_write_config_word(dev, 0x3e, val16);
796 }
797}
798
799DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_HINT, 0x0028, ppc7d_fixup_hb8);
800
801/* This should perhaps be a separate driver as we're actually initializing
802 * the chip for this board here. It's hardly a fixup...
803 */
804static void __init ppc7d_fixup_ali1535(struct pci_dev *dev)
805{
806 pr_debug("PCI: ALI1535 init\n");
807
808 if (dev->bus->number == 1) {
809 /* Configure the ISA Port Settings */
810 pci_write_config_byte(dev, 0x43, 0x00);
811
812 /* Disable PCI Interrupt polling mode */
813 pci_write_config_byte(dev, 0x45, 0x00);
814
815 /* Multifunction pin select INTFJ -> INTF */
816 pci_write_config_byte(dev, 0x78, 0x00);
817
818 /* Set PCI INT -> IRQ Routing control in for external
819 * pins south bridge.
820 */
821 pci_write_config_byte(dev, 0x48, 0x31); /* [7-4] INT B -> IRQ10
822 * [3-0] INT A -> IRQ9
823 */
824 pci_write_config_byte(dev, 0x49, 0x5D); /* [7-4] INT D -> IRQ5
825 * [3-0] INT C -> IRQ14
826 */
827
828 /* PPC7D setup */
829 /* NEC USB device on IRQ 11 (INTE) - INTF disabled */
830 pci_write_config_byte(dev, 0x4A, 0x09);
831
832 /* GPIO on IRQ 6 */
833 pci_write_config_byte(dev, 0x76, 0x07);
834
835 /* SIRQ I (COMS 5/6) use IRQ line 15.
836 * Positive (not subtractive) address decode.
837 */
838 pci_write_config_byte(dev, 0x44, 0x0f);
839
840 /* SIRQ II disabled */
841 pci_write_config_byte(dev, 0x75, 0x0);
842
843 /* On board USB and RTC disabled */
844 pci_write_config_word(dev, 0x52, (1 << 14));
845 pci_write_config_byte(dev, 0x74, 0x00);
846
847 /* On board IDE disabled */
848 pci_write_config_byte(dev, 0x58, 0x00);
849
850 /* Decode 32-bit addresses */
851 pci_write_config_byte(dev, 0x5b, 0);
852
853 /* Disable docking IO */
854 pci_write_config_word(dev, 0x5c, 0x0000);
855
856 /* Disable modem, enable sound */
857 pci_write_config_byte(dev, 0x77, (1 << 6));
858
859 /* Disable hot-docking mode */
860 pci_write_config_byte(dev, 0x7d, 0x00);
861 }
862}
863
864DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x1533, ppc7d_fixup_ali1535);
865
866static int ppc7d_pci_exclude_device(u8 bus, u8 devfn)
867{
868 /* Early versions of this board were fitted with IBM ALMA
869 * PCI-VME bridge chips. The PCI config space of these devices
870 * was not set up correctly and causes PCI scan problems.
871 */
872 if ((bus == 1) && (PCI_SLOT(devfn) == 4) && ppc7d_has_alma)
873 return PCIBIOS_DEVICE_NOT_FOUND;
874
875 return mv64x60_pci_exclude_device(bus, devfn);
876}
877
878/* This hook is called when each PCI bus is probed.
879 */
880static void ppc7d_pci_fixup_bus(struct pci_bus *bus)
881{
882 pr_debug("PCI BUS %hu: %lx/%lx %lx/%lx %lx/%lx %lx/%lx\n",
883 bus->number,
884 bus->resource[0] ? bus->resource[0]->start : 0,
885 bus->resource[0] ? bus->resource[0]->end : 0,
886 bus->resource[1] ? bus->resource[1]->start : 0,
887 bus->resource[1] ? bus->resource[1]->end : 0,
888 bus->resource[2] ? bus->resource[2]->start : 0,
889 bus->resource[2] ? bus->resource[2]->end : 0,
890 bus->resource[3] ? bus->resource[3]->start : 0,
891 bus->resource[3] ? bus->resource[3]->end : 0);
892
893 if ((bus->number == 1) && (bus->resource[2] != NULL)) {
894 /* Hide PCI window 2 of Bus 1 which is used only to
895 * map legacy ISA memory space.
896 */
897 bus->resource[2]->start = 0;
898 bus->resource[2]->end = 0;
899 bus->resource[2]->flags = 0;
900 }
901}
902
903/*****************************************************************************
904 * Board device setup code
905 *****************************************************************************/
906
907void __init ppc7d_setup_peripherals(void)
908{
909 u32 val32;
910
911 /* Set up windows for boot CS */
912 mv64x60_set_32bit_window(&bh, MV64x60_CPU2BOOT_WIN,
913 PPC7D_BOOT_WINDOW_BASE, PPC7D_BOOT_WINDOW_SIZE,
914 0);
915 bh.ci->enable_window_32bit(&bh, MV64x60_CPU2BOOT_WIN);
916
917 /* Boot firmware configures the following DevCS addresses.
918 * DevCS0 - board control/status
919 * DevCS1 - test registers
920 * DevCS2 - AFIX port/address registers (for identifying)
921 * DevCS3 - FLASH
922 *
923 * We don't use DevCS0, DevCS1.
924 */
925 val32 = mv64x60_read(&bh, MV64360_CPU_BAR_ENABLE);
926 val32 |= ((1 << 4) | (1 << 5));
927 mv64x60_write(&bh, MV64360_CPU_BAR_ENABLE, val32);
928 mv64x60_write(&bh, MV64x60_CPU2DEV_0_BASE, 0);
929 mv64x60_write(&bh, MV64x60_CPU2DEV_0_SIZE, 0);
930 mv64x60_write(&bh, MV64x60_CPU2DEV_1_BASE, 0);
931 mv64x60_write(&bh, MV64x60_CPU2DEV_1_SIZE, 0);
932
933 mv64x60_set_32bit_window(&bh, MV64x60_CPU2DEV_2_WIN,
934 PPC7D_AFIX_REG_BASE, PPC7D_AFIX_REG_SIZE, 0);
935 bh.ci->enable_window_32bit(&bh, MV64x60_CPU2DEV_2_WIN);
936
937 mv64x60_set_32bit_window(&bh, MV64x60_CPU2DEV_3_WIN,
938 PPC7D_FLASH_BASE, PPC7D_FLASH_SIZE_ACTUAL, 0);
939 bh.ci->enable_window_32bit(&bh, MV64x60_CPU2DEV_3_WIN);
940
941 mv64x60_set_32bit_window(&bh, MV64x60_CPU2SRAM_WIN,
942 PPC7D_INTERNAL_SRAM_BASE, MV64360_SRAM_SIZE,
943 0);
944 bh.ci->enable_window_32bit(&bh, MV64x60_CPU2SRAM_WIN);
945
946 /* Set up Enet->SRAM window */
947 mv64x60_set_32bit_window(&bh, MV64x60_ENET2MEM_4_WIN,
948 PPC7D_INTERNAL_SRAM_BASE, MV64360_SRAM_SIZE,
949 0x2);
950 bh.ci->enable_window_32bit(&bh, MV64x60_ENET2MEM_4_WIN);
951
952 /* Give enet r/w access to memory region */
953 val32 = mv64x60_read(&bh, MV64360_ENET2MEM_ACC_PROT_0);
954 val32 |= (0x3 << (4 << 1));
955 mv64x60_write(&bh, MV64360_ENET2MEM_ACC_PROT_0, val32);
956 val32 = mv64x60_read(&bh, MV64360_ENET2MEM_ACC_PROT_1);
957 val32 |= (0x3 << (4 << 1));
958 mv64x60_write(&bh, MV64360_ENET2MEM_ACC_PROT_1, val32);
959 val32 = mv64x60_read(&bh, MV64360_ENET2MEM_ACC_PROT_2);
960 val32 |= (0x3 << (4 << 1));
961 mv64x60_write(&bh, MV64360_ENET2MEM_ACC_PROT_2, val32);
962
963 val32 = mv64x60_read(&bh, MV64x60_TIMR_CNTR_0_3_CNTL);
964 val32 &= ~((1 << 0) | (1 << 8) | (1 << 16) | (1 << 24));
965 mv64x60_write(&bh, MV64x60_TIMR_CNTR_0_3_CNTL, val32);
966
967 /* Enumerate pci bus.
968 *
969 * We scan PCI#0 first (the bus with the HB8 and other
970 * on-board peripherals). We must configure the 64360 before
971 * each scan, according to the bus number assignments. Busses
972 * are assigned incrementally, starting at 0. PCI#0 is
973 * usually assigned bus#0, the secondary side of the HB8 gets
974 * bus#1 and PCI#1 (second PMC site) gets bus#2. However, if
975 * any PMC card has a PCI bridge, these bus assignments will
976 * change.
977 */
978
979 /* Turn off PCI retries */
980 val32 = mv64x60_read(&bh, MV64x60_CPU_CONFIG);
981 val32 |= (1 << 17);
982 mv64x60_write(&bh, MV64x60_CPU_CONFIG, val32);
983
984 /* Scan PCI#0 */
985 mv64x60_set_bus(&bh, 0, 0);
986 bh.hose_a->first_busno = 0;
987 bh.hose_a->last_busno = 0xff;
988 bh.hose_a->last_busno = pciauto_bus_scan(bh.hose_a, 0);
989 printk(KERN_INFO "PCI#0: first=%d last=%d\n",
990 bh.hose_a->first_busno, bh.hose_a->last_busno);
991
992 /* Scan PCI#1 */
993 bh.hose_b->first_busno = bh.hose_a->last_busno + 1;
994 mv64x60_set_bus(&bh, 1, bh.hose_b->first_busno);
995 bh.hose_b->last_busno = 0xff;
996 bh.hose_b->last_busno = pciauto_bus_scan(bh.hose_b,
997 bh.hose_b->first_busno);
998 printk(KERN_INFO "PCI#1: first=%d last=%d\n",
999 bh.hose_b->first_busno, bh.hose_b->last_busno);
1000
1001 /* Turn on PCI retries */
1002 val32 = mv64x60_read(&bh, MV64x60_CPU_CONFIG);
1003 val32 &= ~(1 << 17);
1004 mv64x60_write(&bh, MV64x60_CPU_CONFIG, val32);
1005
1006 /* Setup interrupts */
1007 ppc7d_intr_setup();
1008}
1009
1010static void __init ppc7d_setup_bridge(void)
1011{
1012 struct mv64x60_setup_info si;
1013 int i;
1014 u32 temp;
1015
1016 mv64360_irq_base = 16; /* first 16 intrs are 2 x 8259's */
1017
1018 memset(&si, 0, sizeof(si));
1019
1020 si.phys_reg_base = CONFIG_MV64X60_NEW_BASE;
1021
1022 si.pci_0.enable_bus = 1;
1023 si.pci_0.pci_io.cpu_base = PPC7D_PCI0_IO_START_PROC_ADDR;
1024 si.pci_0.pci_io.pci_base_hi = 0;
1025 si.pci_0.pci_io.pci_base_lo = PPC7D_PCI0_IO_START_PCI_ADDR;
1026 si.pci_0.pci_io.size = PPC7D_PCI0_IO_SIZE;
1027 si.pci_0.pci_io.swap = MV64x60_CPU2PCI_SWAP_NONE;
1028 si.pci_0.pci_mem[0].cpu_base = PPC7D_PCI0_MEM0_START_PROC_ADDR;
1029 si.pci_0.pci_mem[0].pci_base_hi = PPC7D_PCI0_MEM0_START_PCI_HI_ADDR;
1030 si.pci_0.pci_mem[0].pci_base_lo = PPC7D_PCI0_MEM0_START_PCI_LO_ADDR;
1031 si.pci_0.pci_mem[0].size = PPC7D_PCI0_MEM0_SIZE;
1032 si.pci_0.pci_mem[0].swap = MV64x60_CPU2PCI_SWAP_NONE;
1033 si.pci_0.pci_mem[1].cpu_base = PPC7D_PCI0_MEM1_START_PROC_ADDR;
1034 si.pci_0.pci_mem[1].pci_base_hi = PPC7D_PCI0_MEM1_START_PCI_HI_ADDR;
1035 si.pci_0.pci_mem[1].pci_base_lo = PPC7D_PCI0_MEM1_START_PCI_LO_ADDR;
1036 si.pci_0.pci_mem[1].size = PPC7D_PCI0_MEM1_SIZE;
1037 si.pci_0.pci_mem[1].swap = MV64x60_CPU2PCI_SWAP_NONE;
1038 si.pci_0.pci_cmd_bits = 0;
1039 si.pci_0.latency_timer = 0x80;
1040
1041 si.pci_1.enable_bus = 1;
1042 si.pci_1.pci_io.cpu_base = PPC7D_PCI1_IO_START_PROC_ADDR;
1043 si.pci_1.pci_io.pci_base_hi = 0;
1044 si.pci_1.pci_io.pci_base_lo = PPC7D_PCI1_IO_START_PCI_ADDR;
1045 si.pci_1.pci_io.size = PPC7D_PCI1_IO_SIZE;
1046 si.pci_1.pci_io.swap = MV64x60_CPU2PCI_SWAP_NONE;
1047 si.pci_1.pci_mem[0].cpu_base = PPC7D_PCI1_MEM0_START_PROC_ADDR;
1048 si.pci_1.pci_mem[0].pci_base_hi = PPC7D_PCI1_MEM0_START_PCI_HI_ADDR;
1049 si.pci_1.pci_mem[0].pci_base_lo = PPC7D_PCI1_MEM0_START_PCI_LO_ADDR;
1050 si.pci_1.pci_mem[0].size = PPC7D_PCI1_MEM0_SIZE;
1051 si.pci_1.pci_mem[0].swap = MV64x60_CPU2PCI_SWAP_NONE;
1052 si.pci_1.pci_mem[1].cpu_base = PPC7D_PCI1_MEM1_START_PROC_ADDR;
1053 si.pci_1.pci_mem[1].pci_base_hi = PPC7D_PCI1_MEM1_START_PCI_HI_ADDR;
1054 si.pci_1.pci_mem[1].pci_base_lo = PPC7D_PCI1_MEM1_START_PCI_LO_ADDR;
1055 si.pci_1.pci_mem[1].size = PPC7D_PCI1_MEM1_SIZE;
1056 si.pci_1.pci_mem[1].swap = MV64x60_CPU2PCI_SWAP_NONE;
1057 si.pci_1.pci_cmd_bits = 0;
1058 si.pci_1.latency_timer = 0x80;
1059
1060 /* Don't clear the SRAM window since we use it for debug */
1061 si.window_preserve_mask_32_lo = (1 << MV64x60_CPU2SRAM_WIN);
1062
1063 printk(KERN_INFO "PCI: MV64360 PCI#0 IO at %x, size %x\n",
1064 si.pci_0.pci_io.cpu_base, si.pci_0.pci_io.size);
1065 printk(KERN_INFO "PCI: MV64360 PCI#1 IO at %x, size %x\n",
1066 si.pci_1.pci_io.cpu_base, si.pci_1.pci_io.size);
1067
1068 for (i = 0; i < MV64x60_CPU2MEM_WINDOWS; i++) {
1069#if defined(CONFIG_NOT_COHERENT_CACHE)
1070 si.cpu_prot_options[i] = 0;
1071 si.enet_options[i] = MV64360_ENET2MEM_SNOOP_NONE;
1072 si.mpsc_options[i] = MV64360_MPSC2MEM_SNOOP_NONE;
1073 si.idma_options[i] = MV64360_IDMA2MEM_SNOOP_NONE;
1074
1075 si.pci_0.acc_cntl_options[i] =
1076 MV64360_PCI_ACC_CNTL_SNOOP_NONE |
1077 MV64360_PCI_ACC_CNTL_SWAP_NONE |
1078 MV64360_PCI_ACC_CNTL_MBURST_128_BYTES |
1079 MV64360_PCI_ACC_CNTL_RDSIZE_256_BYTES;
1080
1081 si.pci_1.acc_cntl_options[i] =
1082 MV64360_PCI_ACC_CNTL_SNOOP_NONE |
1083 MV64360_PCI_ACC_CNTL_SWAP_NONE |
1084 MV64360_PCI_ACC_CNTL_MBURST_128_BYTES |
1085 MV64360_PCI_ACC_CNTL_RDSIZE_256_BYTES;
1086#else
1087 si.cpu_prot_options[i] = 0;
1088 /* All PPC7D hardware uses B0 or newer MV64360 silicon which
1089 * does not have snoop bugs.
1090 */
1091 si.enet_options[i] = MV64360_ENET2MEM_SNOOP_WB;
1092 si.mpsc_options[i] = MV64360_MPSC2MEM_SNOOP_WB;
1093 si.idma_options[i] = MV64360_IDMA2MEM_SNOOP_WB;
1094
1095 si.pci_0.acc_cntl_options[i] =
1096 MV64360_PCI_ACC_CNTL_SNOOP_WB |
1097 MV64360_PCI_ACC_CNTL_SWAP_NONE |
1098 MV64360_PCI_ACC_CNTL_MBURST_32_BYTES |
1099 MV64360_PCI_ACC_CNTL_RDSIZE_32_BYTES;
1100
1101 si.pci_1.acc_cntl_options[i] =
1102 MV64360_PCI_ACC_CNTL_SNOOP_WB |
1103 MV64360_PCI_ACC_CNTL_SWAP_NONE |
1104 MV64360_PCI_ACC_CNTL_MBURST_32_BYTES |
1105 MV64360_PCI_ACC_CNTL_RDSIZE_32_BYTES;
1106#endif
1107 }
1108
1109 /* Lookup PCI host bridges */
1110 if (mv64x60_init(&bh, &si))
1111 printk(KERN_ERR "MV64360 initialization failed.\n");
1112
1113 pr_debug("MV64360 regs @ %lx/%p\n", bh.p_base, bh.v_base);
1114
1115 /* Enable WB Cache coherency on SRAM */
1116 temp = mv64x60_read(&bh, MV64360_SRAM_CONFIG);
1117 pr_debug("SRAM_CONFIG: %x\n", temp);
1118#if defined(CONFIG_NOT_COHERENT_CACHE)
1119 mv64x60_write(&bh, MV64360_SRAM_CONFIG, temp & ~0x2);
1120#else
1121 mv64x60_write(&bh, MV64360_SRAM_CONFIG, temp | 0x2);
1122#endif
1123 /* If system operates with internal bus arbiter (CPU master
1124 * control bit8) clear AACK Delay bit [25] in CPU
1125 * configuration register.
1126 */
1127 temp = mv64x60_read(&bh, MV64x60_CPU_MASTER_CNTL);
1128 if (temp & (1 << 8)) {
1129 temp = mv64x60_read(&bh, MV64x60_CPU_CONFIG);
1130 mv64x60_write(&bh, MV64x60_CPU_CONFIG, (temp & ~(1 << 25)));
1131 }
1132
1133 /* Data and address parity is enabled */
1134 temp = mv64x60_read(&bh, MV64x60_CPU_CONFIG);
1135 mv64x60_write(&bh, MV64x60_CPU_CONFIG,
1136 (temp | (1 << 26) | (1 << 19)));
1137
1138 pci_dram_offset = 0; /* sys mem at same addr on PCI & cpu bus */
1139 ppc_md.pci_swizzle = common_swizzle;
1140 ppc_md.pci_map_irq = ppc7d_map_irq;
1141 ppc_md.pci_exclude_device = ppc7d_pci_exclude_device;
1142
1143 mv64x60_set_bus(&bh, 0, 0);
1144 bh.hose_a->first_busno = 0;
1145 bh.hose_a->last_busno = 0xff;
1146 bh.hose_a->mem_space.start = PPC7D_PCI0_MEM0_START_PCI_LO_ADDR;
1147 bh.hose_a->mem_space.end =
1148 PPC7D_PCI0_MEM0_START_PCI_LO_ADDR + PPC7D_PCI0_MEM0_SIZE;
1149
1150 /* These will be set later, as a result of PCI0 scan */
1151 bh.hose_b->first_busno = 0;
1152 bh.hose_b->last_busno = 0xff;
1153 bh.hose_b->mem_space.start = PPC7D_PCI1_MEM0_START_PCI_LO_ADDR;
1154 bh.hose_b->mem_space.end =
1155 PPC7D_PCI1_MEM0_START_PCI_LO_ADDR + PPC7D_PCI1_MEM0_SIZE;
1156
1157 pr_debug("MV64360: PCI#0 IO decode %08x/%08x IO remap %08x\n",
1158 mv64x60_read(&bh, 0x48), mv64x60_read(&bh, 0x50),
1159 mv64x60_read(&bh, 0xf0));
1160}
1161
1162static void __init ppc7d_setup_arch(void)
1163{
1164 int port;
1165
1166 loops_per_jiffy = 100000000 / HZ;
1167
1168#ifdef CONFIG_BLK_DEV_INITRD
1169 if (initrd_start)
1170 ROOT_DEV = Root_RAM0;
1171 else
1172#endif
1173#ifdef CONFIG_ROOT_NFS
1174 ROOT_DEV = Root_NFS;
1175#else
1176 ROOT_DEV = Root_HDA1;
1177#endif
1178
1179 if ((cur_cpu_spec->cpu_features & CPU_FTR_SPEC7450) ||
1180 (cur_cpu_spec->cpu_features & CPU_FTR_L3CR))
1181 /* 745x is different. We only want to pass along enable. */
1182 _set_L2CR(L2CR_L2E);
1183 else if (cur_cpu_spec->cpu_features & CPU_FTR_L2CR)
1184 /* All modules have 1MB of L2. We also assume that an
1185 * L2 divisor of 3 will work.
1186 */
1187 _set_L2CR(L2CR_L2E | L2CR_L2SIZ_1MB | L2CR_L2CLK_DIV3
1188 | L2CR_L2RAM_PIPE | L2CR_L2OH_1_0 | L2CR_L2DF);
1189
1190 if (cur_cpu_spec->cpu_features & CPU_FTR_L3CR)
1191 /* No L3 cache */
1192 _set_L3CR(0);
1193
1194#ifdef CONFIG_DUMMY_CONSOLE
1195 conswitchp = &dummy_con;
1196#endif
1197
1198 /* Lookup PCI host bridges */
1199 if (ppc_md.progress)
1200 ppc_md.progress("ppc7d_setup_arch: calling setup_bridge", 0);
1201
1202 ppc7d_setup_bridge();
1203 ppc7d_setup_peripherals();
1204
1205 /* Disable ethernet. It might have been setup by the bootrom */
1206 for (port = 0; port < 3; port++)
1207 mv64x60_write(&bh, MV643XX_ETH_RECEIVE_QUEUE_COMMAND_REG(port),
1208 0x0000ff00);
1209
1210 /* Clear queue pointers to ensure they are all initialized,
1211 * otherwise since queues 1-7 are unused, they have random
1212 * pointers which look strange in register dumps. Don't bother
1213 * with queue 0 since it will be initialized later.
1214 */
1215 for (port = 0; port < 3; port++) {
1216 mv64x60_write(&bh,
1217 MV643XX_ETH_RX_CURRENT_QUEUE_DESC_PTR_1(port),
1218 0x00000000);
1219 mv64x60_write(&bh,
1220 MV643XX_ETH_RX_CURRENT_QUEUE_DESC_PTR_2(port),
1221 0x00000000);
1222 mv64x60_write(&bh,
1223 MV643XX_ETH_RX_CURRENT_QUEUE_DESC_PTR_3(port),
1224 0x00000000);
1225 mv64x60_write(&bh,
1226 MV643XX_ETH_RX_CURRENT_QUEUE_DESC_PTR_4(port),
1227 0x00000000);
1228 mv64x60_write(&bh,
1229 MV643XX_ETH_RX_CURRENT_QUEUE_DESC_PTR_5(port),
1230 0x00000000);
1231 mv64x60_write(&bh,
1232 MV643XX_ETH_RX_CURRENT_QUEUE_DESC_PTR_6(port),
1233 0x00000000);
1234 mv64x60_write(&bh,
1235 MV643XX_ETH_RX_CURRENT_QUEUE_DESC_PTR_7(port),
1236 0x00000000);
1237 }
1238
1239 printk(KERN_INFO "Radstone Technology PPC7D\n");
1240 if (ppc_md.progress)
1241 ppc_md.progress("ppc7d_setup_arch: exit", 0);
1242
1243}
1244
1245/* Real Time Clock support.
1246 * PPC7D has a DS1337 accessed by I2C.
1247 */
1248static ulong ppc7d_get_rtc_time(void)
1249{
1250 struct rtc_time tm;
1251 int result;
1252
1253 spin_lock(&rtc_lock);
1254 result = ds1337_do_command(0, DS1337_GET_DATE, &tm);
1255 spin_unlock(&rtc_lock);
1256
1257 if (result == 0)
1258 result = mktime(tm.tm_year, tm.tm_mon, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec);
1259
1260 return result;
1261}
1262
1263static int ppc7d_set_rtc_time(unsigned long nowtime)
1264{
1265 struct rtc_time tm;
1266 int result;
1267
1268 spin_lock(&rtc_lock);
1269 to_tm(nowtime, &tm);
1270 result = ds1337_do_command(0, DS1337_SET_DATE, &tm);
1271 spin_unlock(&rtc_lock);
1272
1273 return result;
1274}
1275
1276/* This kernel command line parameter can be used to have the target
1277 * wait for a JTAG debugger to attach. Of course, a JTAG debugger
1278 * with hardware breakpoint support can have the target stop at any
1279 * location during init, but this is a convenience feature that makes
1280 * it easier in the common case of loading the code using the ppcboot
1281 * bootloader..
1282 */
1283static unsigned long ppc7d_wait_debugger;
1284
1285static int __init ppc7d_waitdbg(char *str)
1286{
1287 ppc7d_wait_debugger = 1;
1288 return 1;
1289}
1290
1291__setup("waitdbg", ppc7d_waitdbg);
1292
1293/* Second phase board init, called after other (architecture common)
1294 * low-level services have been initialized.
1295 */
1296static void ppc7d_init2(void)
1297{
1298 unsigned long flags;
1299 u32 data;
1300 u8 data8;
1301
1302 pr_debug("%s: enter\n", __func__);
1303
1304 /* Wait for debugger? */
1305 if (ppc7d_wait_debugger) {
1306 printk("Waiting for debugger...\n");
1307
1308 while (readl(&ppc7d_wait_debugger)) ;
1309 }
1310
1311 /* Hook up i8259 interrupt which is connected to GPP28 */
1312 request_irq(mv64360_irq_base + MV64x60_IRQ_GPP28, ppc7d_i8259_intr,
1313 IRQF_DISABLED, "I8259 (GPP28) interrupt", (void *)0);
1314
1315 /* Configure MPP16 as watchdog NMI, MPP17 as watchdog WDE */
1316 spin_lock_irqsave(&mv64x60_lock, flags);
1317 data = mv64x60_read(&bh, MV64x60_MPP_CNTL_2);
1318 data &= ~(0x0000000f << 0);
1319 data |= (0x00000004 << 0);
1320 data &= ~(0x0000000f << 4);
1321 data |= (0x00000004 << 4);
1322 mv64x60_write(&bh, MV64x60_MPP_CNTL_2, data);
1323 spin_unlock_irqrestore(&mv64x60_lock, flags);
1324
1325 /* All LEDs off */
1326 data8 = inb(PPC7D_CPLD_LEDS);
1327 data8 &= ~0x08;
1328 data8 |= 0x07;
1329 outb(data8, PPC7D_CPLD_LEDS);
1330
1331 /* Hook up RTC. We couldn't do this earlier because we need the I2C subsystem */
1332 ppc_md.set_rtc_time = ppc7d_set_rtc_time;
1333 ppc_md.get_rtc_time = ppc7d_get_rtc_time;
1334
1335 pr_debug("%s: exit\n", __func__);
1336}
1337
1338/* Called from machine_init(), early, before any of the __init functions
1339 * have run. We must init software-configurable pins before other functions
1340 * such as interrupt controllers are initialised.
1341 */
1342void __init platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
1343 unsigned long r6, unsigned long r7)
1344{
1345 u8 val8;
1346 u8 rev_num;
1347
1348 /* Map 0xe0000000-0xffffffff early because we need access to SRAM
1349 * and the ISA memory space (for serial port) here. This mapping
1350 * is redone properly in ppc7d_map_io() later.
1351 */
1352 mtspr(SPRN_DBAT3U, 0xe0003fff);
1353 mtspr(SPRN_DBAT3L, 0xe000002a);
1354
1355 /*
1356 * Zero SRAM. Note that this generates parity errors on
1357 * internal data path in SRAM if it's first time accessing it
1358 * after reset.
1359 *
1360 * We do this ASAP to avoid parity errors when reading
1361 * uninitialized SRAM.
1362 */
1363 memset((void *)PPC7D_INTERNAL_SRAM_BASE, 0, MV64360_SRAM_SIZE);
1364
1365 pr_debug("platform_init: r3-r7: %lx %lx %lx %lx %lx\n",
1366 r3, r4, r5, r6, r7);
1367
1368 parse_bootinfo(find_bootinfo());
1369
1370 /* ASSUMPTION: If both r3 (bd_t pointer) and r6 (cmdline pointer)
1371 * are non-zero, then we should use the board info from the bd_t
1372 * structure and the cmdline pointed to by r6 instead of the
1373 * information from birecs, if any. Otherwise, use the information
1374 * from birecs as discovered by the preceding call to
1375 * parse_bootinfo(). This rule should work with both PPCBoot, which
1376 * uses a bd_t board info structure, and the kernel boot wrapper,
1377 * which uses birecs.
1378 */
1379 if (r3 && r6) {
1380 bd_t *bp = (bd_t *) __res;
1381
1382 /* copy board info structure */
1383 memcpy((void *)__res, (void *)(r3 + KERNELBASE), sizeof(bd_t));
1384 /* copy command line */
1385 *(char *)(r7 + KERNELBASE) = 0;
1386 strcpy(cmd_line, (char *)(r6 + KERNELBASE));
1387
1388 printk(KERN_INFO "Board info data:-\n");
1389 printk(KERN_INFO " Internal freq: %lu MHz, bus freq: %lu MHz\n",
1390 bp->bi_intfreq, bp->bi_busfreq);
1391 printk(KERN_INFO " Memory: %lx, size %lx\n", bp->bi_memstart,
1392 bp->bi_memsize);
1393 printk(KERN_INFO " Console baudrate: %lu\n", bp->bi_baudrate);
1394 printk(KERN_INFO " Ethernet address: "
1395 "%02x:%02x:%02x:%02x:%02x:%02x\n",
1396 bp->bi_enetaddr[0], bp->bi_enetaddr[1],
1397 bp->bi_enetaddr[2], bp->bi_enetaddr[3],
1398 bp->bi_enetaddr[4], bp->bi_enetaddr[5]);
1399 }
1400#ifdef CONFIG_BLK_DEV_INITRD
1401 /* take care of initrd if we have one */
1402 if (r4) {
1403 initrd_start = r4 + KERNELBASE;
1404 initrd_end = r5 + KERNELBASE;
1405 printk(KERN_INFO "INITRD @ %lx/%lx\n", initrd_start, initrd_end);
1406 }
1407#endif /* CONFIG_BLK_DEV_INITRD */
1408
1409 /* Map in board regs, etc. */
1410 isa_io_base = 0xe8000000;
1411 isa_mem_base = 0xe8000000;
1412 pci_dram_offset = 0x00000000;
1413 ISA_DMA_THRESHOLD = 0x00ffffff;
1414 DMA_MODE_READ = 0x44;
1415 DMA_MODE_WRITE = 0x48;
1416
1417 ppc_md.setup_arch = ppc7d_setup_arch;
1418 ppc_md.init = ppc7d_init2;
1419 ppc_md.show_cpuinfo = ppc7d_show_cpuinfo;
1420 /* XXX this is broken... */
1421 ppc_md.irq_canonicalize = ppc7d_irq_canonicalize;
1422 ppc_md.init_IRQ = ppc7d_init_irq;
1423 ppc_md.get_irq = ppc7d_get_irq;
1424
1425 ppc_md.restart = ppc7d_restart;
1426 ppc_md.power_off = ppc7d_power_off;
1427 ppc_md.halt = ppc7d_halt;
1428
1429 ppc_md.find_end_of_memory = ppc7d_find_end_of_memory;
1430 ppc_md.setup_io_mappings = ppc7d_map_io;
1431
1432 ppc_md.time_init = NULL;
1433 ppc_md.set_rtc_time = NULL;
1434 ppc_md.get_rtc_time = NULL;
1435 ppc_md.calibrate_decr = ppc7d_calibrate_decr;
1436 ppc_md.nvram_read_val = NULL;
1437 ppc_md.nvram_write_val = NULL;
1438
1439 ppc_md.heartbeat = ppc7d_heartbeat;
1440 ppc_md.heartbeat_reset = HZ;
1441 ppc_md.heartbeat_count = ppc_md.heartbeat_reset;
1442
1443 ppc_md.pcibios_fixup_bus = ppc7d_pci_fixup_bus;
1444
1445#if defined(CONFIG_SERIAL_MPSC) || defined(CONFIG_MV643XX_ETH) || \
1446 defined(CONFIG_I2C_MV64XXX)
1447 platform_notify = ppc7d_platform_notify;
1448#endif
1449
1450#ifdef CONFIG_SERIAL_MPSC
1451 /* On PPC7D, we must configure MPSC support via CPLD control
1452 * registers.
1453 */
1454 outb(PPC7D_CPLD_RTS_COM4_SCLK |
1455 PPC7D_CPLD_RTS_COM56_ENABLED, PPC7D_CPLD_RTS);
1456 outb(PPC7D_CPLD_COMS_COM3_TCLKEN |
1457 PPC7D_CPLD_COMS_COM3_TXEN |
1458 PPC7D_CPLD_COMS_COM4_TCLKEN |
1459 PPC7D_CPLD_COMS_COM4_TXEN, PPC7D_CPLD_COMS);
1460#endif /* CONFIG_SERIAL_MPSC */
1461
1462#if defined(CONFIG_KGDB) || defined(CONFIG_SERIAL_TEXT_DEBUG)
1463 ppc7d_early_serial_map();
1464#ifdef CONFIG_SERIAL_TEXT_DEBUG
1465#if defined(CONFIG_SERIAL_MPSC_CONSOLE)
1466 ppc_md.progress = mv64x60_mpsc_progress;
1467#elif defined(CONFIG_SERIAL_8250)
1468 ppc_md.progress = gen550_progress;
1469#else
1470#error CONFIG_KGDB || CONFIG_SERIAL_TEXT_DEBUG has no supported CONFIG_SERIAL_XXX
1471#endif /* CONFIG_SERIAL_8250 */
1472#endif /* CONFIG_SERIAL_TEXT_DEBUG */
1473#endif /* CONFIG_KGDB || CONFIG_SERIAL_TEXT_DEBUG */
1474
1475 /* Enable write access to user flash. This is necessary for
1476 * flash probe.
1477 */
1478 val8 = readb((void *)isa_io_base + PPC7D_CPLD_SW_FLASH_WRITE_PROTECT);
1479 writeb(val8 | (PPC7D_CPLD_SW_FLASH_WRPROT_ENABLED &
1480 PPC7D_CPLD_SW_FLASH_WRPROT_USER_MASK),
1481 (void *)isa_io_base + PPC7D_CPLD_SW_FLASH_WRITE_PROTECT);
1482
1483 /* Determine if this board has IBM ALMA VME devices */
1484 val8 = readb((void *)isa_io_base + PPC7D_CPLD_BOARD_REVISION);
1485 rev_num = (val8 & PPC7D_CPLD_BOARD_REVISION_NUMBER_MASK) >> 5;
1486 if (rev_num <= 1)
1487 ppc7d_has_alma = 1;
1488
1489#ifdef DEBUG
1490 console_printk[0] = 8;
1491#endif
1492}
diff --git a/arch/ppc/platforms/radstone_ppc7d.h b/arch/ppc/platforms/radstone_ppc7d.h
deleted file mode 100644
index 2bb093a0c03e..000000000000
--- a/arch/ppc/platforms/radstone_ppc7d.h
+++ /dev/null
@@ -1,433 +0,0 @@
1/*
2 * Board definitions for the Radstone PPC7D boards.
3 *
4 * Author: James Chapman <jchapman@katalix.com>
5 *
6 * Based on code done by Rabeeh Khoury - rabeeh@galileo.co.il
7 * Based on code done by - Mark A. Greer <mgreer@mvista.com>
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation; either version 2 of the License, or (at your
12 * option) any later version.
13 */
14
15/*
16 * The MV64360 has 2 PCI buses each with 1 window from the CPU bus to
17 * PCI I/O space and 4 windows from the CPU bus to PCI MEM space.
18 * We'll only use one PCI MEM window on each PCI bus.
19 *
20 * This is the CPU physical memory map (windows must be at least 1MB
21 * and start on a boundary that is a multiple of the window size):
22 *
23 * 0xff800000-0xffffffff - Boot window
24 * 0xff000000-0xff000fff - AFIX registers (DevCS2)
25 * 0xfef00000-0xfef0ffff - Internal MV64x60 registers
26 * 0xfef40000-0xfef7ffff - Internal SRAM
27 * 0xfef00000-0xfef0ffff - MV64360 Registers
28 * 0x70000000-0x7fffffff - soldered flash (DevCS3)
29 * 0xe8000000-0xe9ffffff - PCI I/O
30 * 0x80000000-0xbfffffff - PCI MEM
31 */
32
33#ifndef __PPC_PLATFORMS_PPC7D_H
34#define __PPC_PLATFORMS_PPC7D_H
35
36#include <asm/ppcboot.h>
37
38/*****************************************************************************
39 * CPU Physical Memory Map setup.
40 *****************************************************************************/
41
42#define PPC7D_BOOT_WINDOW_BASE 0xff800000
43#define PPC7D_AFIX_REG_BASE 0xff000000
44#define PPC7D_INTERNAL_SRAM_BASE 0xfef40000
45#define PPC7D_FLASH_BASE 0x70000000
46
47#define PPC7D_BOOT_WINDOW_SIZE_ACTUAL 0x00800000 /* 8MB */
48#define PPC7D_FLASH_SIZE_ACTUAL 0x10000000 /* 256MB */
49
50#define PPC7D_BOOT_WINDOW_SIZE max(MV64360_WINDOW_SIZE_MIN, \
51 PPC7D_BOOT_WINDOW_SIZE_ACTUAL)
52#define PPC7D_FLASH_SIZE max(MV64360_WINDOW_SIZE_MIN, \
53 PPC7D_FLASH_SIZE_ACTUAL)
54#define PPC7D_AFIX_REG_SIZE max(MV64360_WINDOW_SIZE_MIN, 0xff)
55
56
57#define PPC7D_PCI0_MEM0_START_PROC_ADDR 0x80000000UL
58#define PPC7D_PCI0_MEM0_START_PCI_HI_ADDR 0x00000000UL
59#define PPC7D_PCI0_MEM0_START_PCI_LO_ADDR 0x80000000UL
60#define PPC7D_PCI0_MEM0_SIZE 0x20000000UL
61#define PPC7D_PCI0_MEM1_START_PROC_ADDR 0xe8010000UL
62#define PPC7D_PCI0_MEM1_START_PCI_HI_ADDR 0x00000000UL
63#define PPC7D_PCI0_MEM1_START_PCI_LO_ADDR 0x00000000UL
64#define PPC7D_PCI0_MEM1_SIZE 0x000f0000UL
65#define PPC7D_PCI0_IO_START_PROC_ADDR 0xe8000000UL
66#define PPC7D_PCI0_IO_START_PCI_ADDR 0x00000000UL
67#define PPC7D_PCI0_IO_SIZE 0x00010000UL
68
69#define PPC7D_PCI1_MEM0_START_PROC_ADDR 0xa0000000UL
70#define PPC7D_PCI1_MEM0_START_PCI_HI_ADDR 0x00000000UL
71#define PPC7D_PCI1_MEM0_START_PCI_LO_ADDR 0xa0000000UL
72#define PPC7D_PCI1_MEM0_SIZE 0x20000000UL
73#define PPC7D_PCI1_MEM1_START_PROC_ADDR 0xe9800000UL
74#define PPC7D_PCI1_MEM1_START_PCI_HI_ADDR 0x00000000UL
75#define PPC7D_PCI1_MEM1_START_PCI_LO_ADDR 0x00000000UL
76#define PPC7D_PCI1_MEM1_SIZE 0x00800000UL
77#define PPC7D_PCI1_IO_START_PROC_ADDR 0xe9000000UL
78#define PPC7D_PCI1_IO_START_PCI_ADDR 0x00000000UL
79#define PPC7D_PCI1_IO_SIZE 0x00010000UL
80
81#define PPC7D_DEFAULT_BAUD 9600
82#define PPC7D_MPSC_CLK_SRC 8 /* TCLK */
83#define PPC7D_MPSC_CLK_FREQ 133333333 /* 133.3333... MHz */
84
85#define PPC7D_ETH0_PHY_ADDR 8
86#define PPC7D_ETH1_PHY_ADDR 9
87#define PPC7D_ETH2_PHY_ADDR 0
88
89#define PPC7D_ETH_TX_QUEUE_SIZE 400
90#define PPC7D_ETH_RX_QUEUE_SIZE 400
91
92#define PPC7D_ETH_PORT_CONFIG_VALUE \
93 MV64340_ETH_UNICAST_NORMAL_MODE | \
94 MV64340_ETH_DEFAULT_RX_QUEUE_0 | \
95 MV64340_ETH_DEFAULT_RX_ARP_QUEUE_0 | \
96 MV64340_ETH_RECEIVE_BC_IF_NOT_IP_OR_ARP | \
97 MV64340_ETH_RECEIVE_BC_IF_IP | \
98 MV64340_ETH_RECEIVE_BC_IF_ARP | \
99 MV64340_ETH_CAPTURE_TCP_FRAMES_DIS | \
100 MV64340_ETH_CAPTURE_UDP_FRAMES_DIS | \
101 MV64340_ETH_DEFAULT_RX_TCP_QUEUE_0 | \
102 MV64340_ETH_DEFAULT_RX_UDP_QUEUE_0 | \
103 MV64340_ETH_DEFAULT_RX_BPDU_QUEUE_0
104
105#define PPC7D_ETH_PORT_CONFIG_EXTEND_VALUE \
106 MV64340_ETH_SPAN_BPDU_PACKETS_AS_NORMAL | \
107 MV64340_ETH_PARTITION_DISABLE
108
109#define GT_ETH_IPG_INT_RX(value) \
110 ((value & 0x3fff) << 8)
111
112#define PPC7D_ETH_PORT_SDMA_CONFIG_VALUE \
113 MV64340_ETH_RX_BURST_SIZE_4_64BIT | \
114 GT_ETH_IPG_INT_RX(0) | \
115 MV64340_ETH_TX_BURST_SIZE_4_64BIT
116
117#define PPC7D_ETH_PORT_SERIAL_CONTROL_VALUE \
118 MV64340_ETH_ENABLE_AUTO_NEG_FOR_DUPLX | \
119 MV64340_ETH_DISABLE_AUTO_NEG_FOR_FLOW_CTRL | \
120 MV64340_ETH_ADV_SYMMETRIC_FLOW_CTRL | \
121 MV64340_ETH_FORCE_FC_MODE_NO_PAUSE_DIS_TX | \
122 MV64340_ETH_FORCE_BP_MODE_NO_JAM | \
123 (1 << 9) | \
124 MV64340_ETH_DO_NOT_FORCE_LINK_FAIL | \
125 MV64340_ETH_RETRANSMIT_16_ATTEMPTS | \
126 MV64340_ETH_ENABLE_AUTO_NEG_SPEED_GMII | \
127 MV64340_ETH_DTE_ADV_0 | \
128 MV64340_ETH_DISABLE_AUTO_NEG_BYPASS | \
129 MV64340_ETH_AUTO_NEG_NO_CHANGE | \
130 MV64340_ETH_MAX_RX_PACKET_9700BYTE | \
131 MV64340_ETH_CLR_EXT_LOOPBACK | \
132 MV64340_ETH_SET_FULL_DUPLEX_MODE | \
133 MV64340_ETH_ENABLE_FLOW_CTRL_TX_RX_IN_FULL_DUPLEX
134
135/*****************************************************************************
136 * Serial defines.
137 *****************************************************************************/
138
139#define PPC7D_SERIAL_0 0xe80003f8
140#define PPC7D_SERIAL_1 0xe80002f8
141
142#define RS_TABLE_SIZE 2
143
144/* Rate for the 1.8432 Mhz clock for the onboard serial chip */
145#define UART_CLK 1843200
146#define BASE_BAUD ( UART_CLK / 16 )
147
148#ifdef CONFIG_SERIAL_DETECT_IRQ
149#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF|ASYNC_AUTO_IRQ)
150#else
151#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF)
152#endif
153
154#define STD_SERIAL_PORT_DFNS \
155 { 0, BASE_BAUD, PPC7D_SERIAL_0, 4, STD_COM_FLAGS, /* ttyS0 */ \
156 iomem_base: (u8 *)PPC7D_SERIAL_0, \
157 io_type: SERIAL_IO_MEM, }, \
158 { 0, BASE_BAUD, PPC7D_SERIAL_1, 3, STD_COM_FLAGS, /* ttyS1 */ \
159 iomem_base: (u8 *)PPC7D_SERIAL_1, \
160 io_type: SERIAL_IO_MEM },
161
162#define SERIAL_PORT_DFNS \
163 STD_SERIAL_PORT_DFNS
164
165/*****************************************************************************
166 * CPLD defines.
167 *
168 * Register map:-
169 *
170 * 0000 to 000F South Bridge DMA 1 Control
171 * 0020 and 0021 South Bridge Interrupt 1 Control
172 * 0040 to 0043 South Bridge Counter Control
173 * 0060 Keyboard
174 * 0061 South Bridge NMI Status and Control
175 * 0064 Keyboard
176 * 0071 and 0072 RTC R/W
177 * 0078 to 007B South Bridge BIOS Timer
178 * 0080 to 0090 South Bridge DMA Pages
179 * 00A0 and 00A1 South Bridge Interrupt 2 Control
180 * 00C0 to 00DE South Bridge DMA 2 Control
181 * 02E8 to 02EF COM6 R/W
182 * 02F8 to 02FF South Bridge COM2 R/W
183 * 03E8 to 03EF COM5 R/W
184 * 03F8 to 03FF South Bridge COM1 R/W
185 * 040A South Bridge DMA Scatter/Gather RO
186 * 040B DMA 1 Extended Mode WO
187 * 0410 to 043F South Bridge DMA Scatter/Gather
188 * 0481 to 048B South Bridge DMA High Pages
189 * 04D0 and 04D1 South Bridge Edge/Level Control
190 * 04D6 DMA 2 Extended Mode WO
191 * 0804 Memory Configuration RO
192 * 0806 Memory Configuration Extend RO
193 * 0808 SCSI Activity LED R/W
194 * 080C Equipment Present 1 RO
195 * 080E Equipment Present 2 RO
196 * 0810 Equipment Present 3 RO
197 * 0812 Equipment Present 4 RO
198 * 0818 Key Lock RO
199 * 0820 LEDS R/W
200 * 0824 COMs R/W
201 * 0826 RTS R/W
202 * 0828 Reset R/W
203 * 082C Watchdog Trig R/W
204 * 082E Interrupt R/W
205 * 0830 Interrupt Status RO
206 * 0832 PCI configuration RO
207 * 0854 Board Revision RO
208 * 0858 Extended ID RO
209 * 0864 ID Link RO
210 * 0866 Motherboard Type RO
211 * 0868 FLASH Write control RO
212 * 086A Software FLASH write protect R/W
213 * 086E FLASH Control R/W
214 *****************************************************************************/
215
216#define PPC7D_CPLD_MEM_CONFIG 0x0804
217#define PPC7D_CPLD_MEM_CONFIG_EXTEND 0x0806
218#define PPC7D_CPLD_SCSI_ACTIVITY_LED 0x0808
219#define PPC7D_CPLD_EQUIPMENT_PRESENT_1 0x080C
220#define PPC7D_CPLD_EQUIPMENT_PRESENT_2 0x080E
221#define PPC7D_CPLD_EQUIPMENT_PRESENT_3 0x0810
222#define PPC7D_CPLD_EQUIPMENT_PRESENT_4 0x0812
223#define PPC7D_CPLD_KEY_LOCK 0x0818
224#define PPC7D_CPLD_LEDS 0x0820
225#define PPC7D_CPLD_COMS 0x0824
226#define PPC7D_CPLD_RTS 0x0826
227#define PPC7D_CPLD_RESET 0x0828
228#define PPC7D_CPLD_WATCHDOG_TRIG 0x082C
229#define PPC7D_CPLD_INTR 0x082E
230#define PPC7D_CPLD_INTR_STATUS 0x0830
231#define PPC7D_CPLD_PCI_CONFIG 0x0832
232#define PPC7D_CPLD_BOARD_REVISION 0x0854
233#define PPC7D_CPLD_EXTENDED_ID 0x0858
234#define PPC7D_CPLD_ID_LINK 0x0864
235#define PPC7D_CPLD_MOTHERBOARD_TYPE 0x0866
236#define PPC7D_CPLD_FLASH_WRITE_CNTL 0x0868
237#define PPC7D_CPLD_SW_FLASH_WRITE_PROTECT 0x086A
238#define PPC7D_CPLD_FLASH_CNTL 0x086E
239
240/* MEMORY_CONFIG_EXTEND */
241#define PPC7D_CPLD_SDRAM_BANK_NUM_MASK 0x02
242#define PPC7D_CPLD_SDRAM_BANK_SIZE_MASK 0xc0
243#define PPC7D_CPLD_SDRAM_BANK_SIZE_128M 0
244#define PPC7D_CPLD_SDRAM_BANK_SIZE_256M 0x40
245#define PPC7D_CPLD_SDRAM_BANK_SIZE_512M 0x80
246#define PPC7D_CPLD_SDRAM_BANK_SIZE_1G 0xc0
247#define PPC7D_CPLD_FLASH_DEV_SIZE_MASK 0x03
248#define PPC7D_CPLD_FLASH_BANK_NUM_MASK 0x0c
249#define PPC7D_CPLD_FLASH_DEV_SIZE_64M 0
250#define PPC7D_CPLD_FLASH_DEV_SIZE_32M 1
251#define PPC7D_CPLD_FLASH_DEV_SIZE_16M 3
252#define PPC7D_CPLD_FLASH_BANK_NUM_4 0x00
253#define PPC7D_CPLD_FLASH_BANK_NUM_3 0x04
254#define PPC7D_CPLD_FLASH_BANK_NUM_2 0x08
255#define PPC7D_CPLD_FLASH_BANK_NUM_1 0x0c
256
257/* SCSI_LED */
258#define PPC7D_CPLD_SCSI_ACTIVITY_LED_OFF 0
259#define PPC7D_CPLD_SCSI_ACTIVITY_LED_ON 1
260
261/* EQUIPMENT_PRESENT_1 */
262#define PPC7D_CPLD_EQPT_PRES_1_FITTED 0
263#define PPC7D_CPLD_EQPT_PRES_1_PMC2_MASK (0x80 >> 2)
264#define PPC7D_CPLD_EQPT_PRES_1_PMC1_MASK (0x80 >> 3)
265#define PPC7D_CPLD_EQPT_PRES_1_AFIX_MASK (0x80 >> 4)
266
267/* EQUIPMENT_PRESENT_2 */
268#define PPC7D_CPLD_EQPT_PRES_2_FITTED !0
269#define PPC7D_CPLD_EQPT_PRES_2_UNIVERSE_MASK (0x80 >> 0)
270#define PPC7D_CPLD_EQPT_PRES_2_COM36_MASK (0x80 >> 2)
271#define PPC7D_CPLD_EQPT_PRES_2_GIGE_MASK (0x80 >> 3)
272#define PPC7D_CPLD_EQPT_PRES_2_DUALGIGE_MASK (0x80 >> 4)
273
274/* EQUIPMENT_PRESENT_3 */
275#define PPC7D_CPLD_EQPT_PRES_3_PMC2_V_MASK (0x80 >> 3)
276#define PPC7D_CPLD_EQPT_PRES_3_PMC2_5V (0 >> 3)
277#define PPC7D_CPLD_EQPT_PRES_3_PMC2_3V (0x80 >> 3)
278#define PPC7D_CPLD_EQPT_PRES_3_PMC1_V_MASK (0x80 >> 4)
279#define PPC7D_CPLD_EQPT_PRES_3_PMC1_5V (0 >> 4)
280#define PPC7D_CPLD_EQPT_PRES_3_PMC1_3V (0x80 >> 4)
281#define PPC7D_CPLD_EQPT_PRES_3_PMC_POWER_MASK (0x80 >> 5)
282#define PPC7D_CPLD_EQPT_PRES_3_PMC_POWER_INTER (0 >> 5)
283#define PPC7D_CPLD_EQPT_PRES_3_PMC_POWER_VME (0x80 >> 5)
284
285/* EQUIPMENT_PRESENT_4 */
286#define PPC7D_CPLD_EQPT_PRES_4_LPT_MASK (0x80 >> 2)
287#define PPC7D_CPLD_EQPT_PRES_4_LPT_FITTED (0x80 >> 2)
288#define PPC7D_CPLD_EQPT_PRES_4_PS2_USB2_MASK (0xc0 >> 6)
289#define PPC7D_CPLD_EQPT_PRES_4_PS2_FITTED (0x40 >> 6)
290#define PPC7D_CPLD_EQPT_PRES_4_USB2_FITTED (0x80 >> 6)
291
292/* CPLD_LEDS */
293#define PPC7D_CPLD_LEDS_ON (!0)
294#define PPC7D_CPLD_LEDS_OFF (0)
295#define PPC7D_CPLD_LEDS_NVRAM_PAGE_MASK (0xc0 >> 2)
296#define PPC7D_CPLD_LEDS_DS201_MASK (0x80 >> 4)
297#define PPC7D_CPLD_LEDS_DS219_MASK (0x80 >> 5)
298#define PPC7D_CPLD_LEDS_DS220_MASK (0x80 >> 6)
299#define PPC7D_CPLD_LEDS_DS221_MASK (0x80 >> 7)
300
301/* CPLD_COMS */
302#define PPC7D_CPLD_COMS_COM3_TCLKEN (0x80 >> 0)
303#define PPC7D_CPLD_COMS_COM3_RTCLKEN (0x80 >> 1)
304#define PPC7D_CPLD_COMS_COM3_MODE_MASK (0x80 >> 2)
305#define PPC7D_CPLD_COMS_COM3_MODE_RS232 (0)
306#define PPC7D_CPLD_COMS_COM3_MODE_RS422 (0x80 >> 2)
307#define PPC7D_CPLD_COMS_COM3_TXEN (0x80 >> 3)
308#define PPC7D_CPLD_COMS_COM4_TCLKEN (0x80 >> 4)
309#define PPC7D_CPLD_COMS_COM4_RTCLKEN (0x80 >> 5)
310#define PPC7D_CPLD_COMS_COM4_MODE_MASK (0x80 >> 6)
311#define PPC7D_CPLD_COMS_COM4_MODE_RS232 (0)
312#define PPC7D_CPLD_COMS_COM4_MODE_RS422 (0x80 >> 6)
313#define PPC7D_CPLD_COMS_COM4_TXEN (0x80 >> 7)
314
315/* CPLD_RTS */
316#define PPC7D_CPLD_RTS_COM36_LOOPBACK (0x80 >> 0)
317#define PPC7D_CPLD_RTS_COM4_SCLK (0x80 >> 1)
318#define PPC7D_CPLD_RTS_COM3_TXFUNC_MASK (0xc0 >> 2)
319#define PPC7D_CPLD_RTS_COM3_TXFUNC_DISABLED (0 >> 2)
320#define PPC7D_CPLD_RTS_COM3_TXFUNC_ENABLED (0x80 >> 2)
321#define PPC7D_CPLD_RTS_COM3_TXFUNC_ENABLED_RTG3 (0xc0 >> 2)
322#define PPC7D_CPLD_RTS_COM3_TXFUNC_ENABLED_RTG3S (0xc0 >> 2)
323#define PPC7D_CPLD_RTS_COM56_MODE_MASK (0x80 >> 4)
324#define PPC7D_CPLD_RTS_COM56_MODE_RS232 (0)
325#define PPC7D_CPLD_RTS_COM56_MODE_RS422 (0x80 >> 4)
326#define PPC7D_CPLD_RTS_COM56_ENABLE_MASK (0x80 >> 5)
327#define PPC7D_CPLD_RTS_COM56_DISABLED (0)
328#define PPC7D_CPLD_RTS_COM56_ENABLED (0x80 >> 5)
329#define PPC7D_CPLD_RTS_COM4_TXFUNC_MASK (0xc0 >> 6)
330#define PPC7D_CPLD_RTS_COM4_TXFUNC_DISABLED (0 >> 6)
331#define PPC7D_CPLD_RTS_COM4_TXFUNC_ENABLED (0x80 >> 6)
332#define PPC7D_CPLD_RTS_COM4_TXFUNC_ENABLED_RTG3 (0x40 >> 6)
333#define PPC7D_CPLD_RTS_COM4_TXFUNC_ENABLED_RTG3S (0x40 >> 6)
334
335/* WATCHDOG_TRIG */
336#define PPC7D_CPLD_WDOG_CAUSE_MASK (0x80 >> 0)
337#define PPC7D_CPLD_WDOG_CAUSE_NORMAL_RESET (0 >> 0)
338#define PPC7D_CPLD_WDOG_CAUSE_WATCHDOG (0x80 >> 0)
339#define PPC7D_CPLD_WDOG_ENABLE_MASK (0x80 >> 6)
340#define PPC7D_CPLD_WDOG_ENABLE_OFF (0 >> 6)
341#define PPC7D_CPLD_WDOG_ENABLE_ON (0x80 >> 6)
342#define PPC7D_CPLD_WDOG_RESETSW_MASK (0x80 >> 7)
343#define PPC7D_CPLD_WDOG_RESETSW_OFF (0 >> 7)
344#define PPC7D_CPLD_WDOG_RESETSW_ON (0x80 >> 7)
345
346/* Interrupt mask and status bits */
347#define PPC7D_CPLD_INTR_TEMP_MASK (0x80 >> 0)
348#define PPC7D_CPLD_INTR_HB8_MASK (0x80 >> 1)
349#define PPC7D_CPLD_INTR_PHY1_MASK (0x80 >> 2)
350#define PPC7D_CPLD_INTR_PHY0_MASK (0x80 >> 3)
351#define PPC7D_CPLD_INTR_ISANMI_MASK (0x80 >> 5)
352#define PPC7D_CPLD_INTR_CRITTEMP_MASK (0x80 >> 6)
353
354/* CPLD_INTR */
355#define PPC7D_CPLD_INTR_ENABLE_OFF (0)
356#define PPC7D_CPLD_INTR_ENABLE_ON (!0)
357
358/* CPLD_INTR_STATUS */
359#define PPC7D_CPLD_INTR_STATUS_OFF (0)
360#define PPC7D_CPLD_INTR_STATUS_ON (!0)
361
362/* CPLD_PCI_CONFIG */
363#define PPC7D_CPLD_PCI_CONFIG_PCI0_MASK 0x70
364#define PPC7D_CPLD_PCI_CONFIG_PCI0_PCI33 0x00
365#define PPC7D_CPLD_PCI_CONFIG_PCI0_PCI66 0x10
366#define PPC7D_CPLD_PCI_CONFIG_PCI0_PCIX33 0x40
367#define PPC7D_CPLD_PCI_CONFIG_PCI0_PCIX66 0x50
368#define PPC7D_CPLD_PCI_CONFIG_PCI0_PCIX100 0x60
369#define PPC7D_CPLD_PCI_CONFIG_PCI0_PCIX133 0x70
370#define PPC7D_CPLD_PCI_CONFIG_PCI1_MASK 0x07
371#define PPC7D_CPLD_PCI_CONFIG_PCI1_PCI33 0x00
372#define PPC7D_CPLD_PCI_CONFIG_PCI1_PCI66 0x01
373#define PPC7D_CPLD_PCI_CONFIG_PCI1_PCIX33 0x04
374#define PPC7D_CPLD_PCI_CONFIG_PCI1_PCIX66 0x05
375#define PPC7D_CPLD_PCI_CONFIG_PCI1_PCIX100 0x06
376#define PPC7D_CPLD_PCI_CONFIG_PCI1_PCIX133 0x07
377
378/* CPLD_BOARD_REVISION */
379#define PPC7D_CPLD_BOARD_REVISION_NUMBER_MASK 0xe0
380#define PPC7D_CPLD_BOARD_REVISION_LETTER_MASK 0x1f
381
382/* CPLD_EXTENDED_ID */
383#define PPC7D_CPLD_EXTENDED_ID_PPC7D 0x18
384
385/* CPLD_ID_LINK */
386#define PPC7D_CPLD_ID_LINK_VME64_GAP_MASK (0x80 >> 2)
387#define PPC7D_CPLD_ID_LINK_VME64_GA4_MASK (0x80 >> 3)
388#define PPC7D_CPLD_ID_LINK_E13_MASK (0x80 >> 4)
389#define PPC7D_CPLD_ID_LINK_E12_MASK (0x80 >> 5)
390#define PPC7D_CPLD_ID_LINK_E7_MASK (0x80 >> 6)
391#define PPC7D_CPLD_ID_LINK_E6_MASK (0x80 >> 7)
392
393/* CPLD_MOTHERBOARD_TYPE */
394#define PPC7D_CPLD_MB_TYPE_ECC_ENABLE_MASK (0x80 >> 0)
395#define PPC7D_CPLD_MB_TYPE_ECC_ENABLED (0x80 >> 0)
396#define PPC7D_CPLD_MB_TYPE_ECC_DISABLED (0 >> 0)
397#define PPC7D_CPLD_MB_TYPE_ECC_FITTED_MASK (0x80 >> 3)
398#define PPC7D_CPLD_MB_TYPE_PLL_MASK 0x0c
399#define PPC7D_CPLD_MB_TYPE_PLL_133 0x00
400#define PPC7D_CPLD_MB_TYPE_PLL_100 0x08
401#define PPC7D_CPLD_MB_TYPE_PLL_64 0x04
402#define PPC7D_CPLD_MB_TYPE_HW_ID_MASK 0x03
403
404/* CPLD_FLASH_WRITE_CNTL */
405#define PPD7D_CPLD_FLASH_CNTL_WR_LINK_MASK (0x80 >> 0)
406#define PPD7D_CPLD_FLASH_CNTL_WR_LINK_FITTED (0x80 >> 0)
407#define PPD7D_CPLD_FLASH_CNTL_BOOT_LINK_MASK (0x80 >> 2)
408#define PPD7D_CPLD_FLASH_CNTL_BOOT_LINK_FITTED (0x80 >> 2)
409#define PPD7D_CPLD_FLASH_CNTL_USER_LINK_MASK (0x80 >> 3)
410#define PPD7D_CPLD_FLASH_CNTL_USER_LINK_FITTED (0x80 >> 3)
411#define PPD7D_CPLD_FLASH_CNTL_RECO_WR_MASK (0x80 >> 5)
412#define PPD7D_CPLD_FLASH_CNTL_RECO_WR_ENABLED (0x80 >> 5)
413#define PPD7D_CPLD_FLASH_CNTL_BOOT_WR_MASK (0x80 >> 6)
414#define PPD7D_CPLD_FLASH_CNTL_BOOT_WR_ENABLED (0x80 >> 6)
415#define PPD7D_CPLD_FLASH_CNTL_USER_WR_MASK (0x80 >> 7)
416#define PPD7D_CPLD_FLASH_CNTL_USER_WR_ENABLED (0x80 >> 7)
417
418/* CPLD_SW_FLASH_WRITE_PROTECT */
419#define PPC7D_CPLD_SW_FLASH_WRPROT_ENABLED (!0)
420#define PPC7D_CPLD_SW_FLASH_WRPROT_DISABLED (0)
421#define PPC7D_CPLD_SW_FLASH_WRPROT_SYSBOOT_MASK (0x80 >> 6)
422#define PPC7D_CPLD_SW_FLASH_WRPROT_USER_MASK (0x80 >> 7)
423
424/* CPLD_FLASH_WRITE_CNTL */
425#define PPC7D_CPLD_FLASH_CNTL_NVRAM_PROT_MASK (0x80 >> 0)
426#define PPC7D_CPLD_FLASH_CNTL_NVRAM_DISABLED (0 >> 0)
427#define PPC7D_CPLD_FLASH_CNTL_NVRAM_ENABLED (0x80 >> 0)
428#define PPC7D_CPLD_FLASH_CNTL_ALTBOOT_LINK_MASK (0x80 >> 1)
429#define PPC7D_CPLD_FLASH_CNTL_VMEBOOT_LINK_MASK (0x80 >> 2)
430#define PPC7D_CPLD_FLASH_CNTL_RECBOOT_LINK_MASK (0x80 >> 3)
431
432
433#endif /* __PPC_PLATFORMS_PPC7D_H */
diff --git a/arch/ppc/platforms/residual.c b/arch/ppc/platforms/residual.c
deleted file mode 100644
index d687b0f8763b..000000000000
--- a/arch/ppc/platforms/residual.c
+++ /dev/null
@@ -1,1034 +0,0 @@
1/*
2 * Code to deal with the PReP residual data.
3 *
4 * Written by: Cort Dougan (cort@cs.nmt.edu)
5 * Improved _greatly_ and rewritten by Gabriel Paubert (paubert@iram.es)
6 *
7 * This file is based on the following documentation:
8 *
9 * IBM Power Personal Systems Architecture
10 * Residual Data
11 * Document Number: PPS-AR-FW0001
12 *
13 * This file is subject to the terms and conditions of the GNU General Public
14 * License. See the file COPYING in the main directory of this archive
15 * for more details.
16 *
17 */
18
19#include <linux/string.h>
20#include <asm/residual.h>
21#include <asm/pnp.h>
22#include <asm/byteorder.h>
23
24#include <linux/errno.h>
25#include <linux/sched.h>
26#include <linux/kernel.h>
27#include <linux/mm.h>
28#include <linux/stddef.h>
29#include <linux/unistd.h>
30#include <linux/ptrace.h>
31#include <linux/slab.h>
32#include <linux/user.h>
33#include <linux/a.out.h>
34#include <linux/tty.h>
35#include <linux/major.h>
36#include <linux/interrupt.h>
37#include <linux/reboot.h>
38#include <linux/init.h>
39#include <linux/ioport.h>
40#include <linux/pci.h>
41#include <linux/proc_fs.h>
42
43#include <asm/sections.h>
44#include <asm/mmu.h>
45#include <asm/io.h>
46#include <asm/pgtable.h>
47#include <asm/ide.h>
48
49
50unsigned char __res[sizeof(RESIDUAL)] = {0,};
51RESIDUAL *res = (RESIDUAL *)&__res;
52
53char * PnP_BASE_TYPES[] __initdata = {
54 "Reserved",
55 "MassStorageDevice",
56 "NetworkInterfaceController",
57 "DisplayController",
58 "MultimediaController",
59 "MemoryController",
60 "BridgeController",
61 "CommunicationsDevice",
62 "SystemPeripheral",
63 "InputDevice",
64 "ServiceProcessor"
65 };
66
67/* Device Sub Type Codes */
68
69unsigned char * PnP_SUB_TYPES[] __initdata = {
70 "\001\000SCSIController",
71 "\001\001IDEController",
72 "\001\002FloppyController",
73 "\001\003IPIController",
74 "\001\200OtherMassStorageController",
75 "\002\000EthernetController",
76 "\002\001TokenRingController",
77 "\002\002FDDIController",
78 "\002\0x80OtherNetworkController",
79 "\003\000VGAController",
80 "\003\001SVGAController",
81 "\003\002XGAController",
82 "\003\200OtherDisplayController",
83 "\004\000VideoController",
84 "\004\001AudioController",
85 "\004\200OtherMultimediaController",
86 "\005\000RAM",
87 "\005\001FLASH",
88 "\005\200OtherMemoryDevice",
89 "\006\000HostProcessorBridge",
90 "\006\001ISABridge",
91 "\006\002EISABridge",
92 "\006\003MicroChannelBridge",
93 "\006\004PCIBridge",
94 "\006\005PCMCIABridge",
95 "\006\006VMEBridge",
96 "\006\200OtherBridgeDevice",
97 "\007\000RS232Device",
98 "\007\001ATCompatibleParallelPort",
99 "\007\200OtherCommunicationsDevice",
100 "\010\000ProgrammableInterruptController",
101 "\010\001DMAController",
102 "\010\002SystemTimer",
103 "\010\003RealTimeClock",
104 "\010\004L2Cache",
105 "\010\005NVRAM",
106 "\010\006PowerManagement",
107 "\010\007CMOS",
108 "\010\010OperatorPanel",
109 "\010\011ServiceProcessorClass1",
110 "\010\012ServiceProcessorClass2",
111 "\010\013ServiceProcessorClass3",
112 "\010\014GraphicAssist",
113 "\010\017SystemPlanar",
114 "\010\200OtherSystemPeripheral",
115 "\011\000KeyboardController",
116 "\011\001Digitizer",
117 "\011\002MouseController",
118 "\011\003TabletController",
119 "\011\0x80OtherInputController",
120 "\012\000GeneralMemoryController",
121 NULL
122};
123
124/* Device Interface Type Codes */
125
126unsigned char * PnP_INTERFACES[] __initdata = {
127 "\000\000\000General",
128 "\001\000\000GeneralSCSI",
129 "\001\001\000GeneralIDE",
130 "\001\001\001ATACompatible",
131
132 "\001\002\000GeneralFloppy",
133 "\001\002\001Compatible765",
134 "\001\002\002NS398_Floppy", /* NS Super I/O wired to use index
135 register at port 398 and data
136 register at port 399 */
137 "\001\002\003NS26E_Floppy", /* Ports 26E and 26F */
138 "\001\002\004NS15C_Floppy", /* Ports 15C and 15D */
139 "\001\002\005NS2E_Floppy", /* Ports 2E and 2F */
140 "\001\002\006CHRP_Floppy", /* CHRP Floppy in PR*P system */
141
142 "\001\003\000GeneralIPI",
143
144 "\002\000\000GeneralEther",
145 "\002\001\000GeneralToken",
146 "\002\002\000GeneralFDDI",
147
148 "\003\000\000GeneralVGA",
149 "\003\001\000GeneralSVGA",
150 "\003\002\000GeneralXGA",
151
152 "\004\000\000GeneralVideo",
153 "\004\001\000GeneralAudio",
154 "\004\001\001CS4232Audio", /* CS 4232 Plug 'n Play Configured */
155
156 "\005\000\000GeneralRAM",
157 /* This one is obviously wrong ! */
158 "\005\000\000PCIMemoryController", /* PCI Config Method */
159 "\005\000\001RS6KMemoryController", /* RS6K Config Method */
160 "\005\001\000GeneralFLASH",
161
162 "\006\000\000GeneralHostBridge",
163 "\006\001\000GeneralISABridge",
164 "\006\002\000GeneralEISABridge",
165 "\006\003\000GeneralMCABridge",
166 /* GeneralPCIBridge = 0, */
167 "\006\004\000PCIBridgeDirect",
168 "\006\004\001PCIBridgeIndirect",
169 "\006\004\002PCIBridgeRS6K",
170 "\006\005\000GeneralPCMCIABridge",
171 "\006\006\000GeneralVMEBridge",
172
173 "\007\000\000GeneralRS232",
174 "\007\000\001COMx",
175 "\007\000\002Compatible16450",
176 "\007\000\003Compatible16550",
177 "\007\000\004NS398SerPort", /* NS Super I/O wired to use index
178 register at port 398 and data
179 register at port 399 */
180 "\007\000\005NS26ESerPort", /* Ports 26E and 26F */
181 "\007\000\006NS15CSerPort", /* Ports 15C and 15D */
182 "\007\000\007NS2ESerPort", /* Ports 2E and 2F */
183
184 "\007\001\000GeneralParPort",
185 "\007\001\001LPTx",
186 "\007\001\002NS398ParPort", /* NS Super I/O wired to use index
187 register at port 398 and data
188 register at port 399 */
189 "\007\001\003NS26EParPort", /* Ports 26E and 26F */
190 "\007\001\004NS15CParPort", /* Ports 15C and 15D */
191 "\007\001\005NS2EParPort", /* Ports 2E and 2F */
192
193 "\010\000\000GeneralPIC",
194 "\010\000\001ISA_PIC",
195 "\010\000\002EISA_PIC",
196 "\010\000\003MPIC",
197 "\010\000\004RS6K_PIC",
198
199 "\010\001\000GeneralDMA",
200 "\010\001\001ISA_DMA",
201 "\010\001\002EISA_DMA",
202
203 "\010\002\000GeneralTimer",
204 "\010\002\001ISA_Timer",
205 "\010\002\002EISA_Timer",
206 "\010\003\000GeneralRTC",
207 "\010\003\001ISA_RTC",
208
209 "\010\004\001StoreThruOnly",
210 "\010\004\002StoreInEnabled",
211 "\010\004\003RS6KL2Cache",
212
213 "\010\005\000IndirectNVRAM", /* Indirectly addressed */
214 "\010\005\001DirectNVRAM", /* Memory Mapped */
215 "\010\005\002IndirectNVRAM24", /* Indirectly addressed - 24 bit */
216
217 "\010\006\000GeneralPowerManagement",
218 "\010\006\001EPOWPowerManagement",
219 "\010\006\002PowerControl", // d1378
220
221 "\010\007\000GeneralCMOS",
222
223 "\010\010\000GeneralOPPanel",
224 "\010\010\001HarddiskLight",
225 "\010\010\002CDROMLight",
226 "\010\010\003PowerLight",
227 "\010\010\004KeyLock",
228 "\010\010\005ANDisplay", /* AlphaNumeric Display */
229 "\010\010\006SystemStatusLED", /* 3 digit 7 segment LED */
230 "\010\010\007CHRP_SystemStatusLED", /* CHRP LEDs in PR*P system */
231
232 "\010\011\000GeneralServiceProcessor",
233 "\010\012\000GeneralServiceProcessor",
234 "\010\013\000GeneralServiceProcessor",
235
236 "\010\014\001TransferData",
237 "\010\014\002IGMC32",
238 "\010\014\003IGMC64",
239
240 "\010\017\000GeneralSystemPlanar", /* 10/5/95 */
241 NULL
242 };
243
244static const unsigned char __init *PnP_SUB_TYPE_STR(unsigned char BaseType,
245 unsigned char SubType) {
246 unsigned char ** s=PnP_SUB_TYPES;
247 while (*s && !((*s)[0]==BaseType
248 && (*s)[1]==SubType)) s++;
249 if (*s) return *s+2;
250 else return("Unknown !");
251};
252
253static const unsigned char __init *PnP_INTERFACE_STR(unsigned char BaseType,
254 unsigned char SubType,
255 unsigned char Interface) {
256 unsigned char ** s=PnP_INTERFACES;
257 while (*s && !((*s)[0]==BaseType
258 && (*s)[1]==SubType
259 && (*s)[2]==Interface)) s++;
260 if (*s) return *s+3;
261 else return NULL;
262};
263
264static void __init printsmallvendor(PnP_TAG_PACKET *pkt, int size) {
265 int i, c;
266 char decomp[4];
267#define p pkt->S14_Pack.S14_Data.S14_PPCPack
268 switch(p.Type) {
269 case 1:
270 /* Decompress first 3 chars */
271 c = *(unsigned short *)p.PPCData;
272 decomp[0]='A'-1+((c>>10)&0x1F);
273 decomp[1]='A'-1+((c>>5)&0x1F);
274 decomp[2]='A'-1+(c&0x1F);
275 decomp[3]=0;
276 printk(" Chip identification: %s%4.4X\n",
277 decomp, ld_le16((unsigned short *)(p.PPCData+2)));
278 break;
279 default:
280 printk(" Small vendor item type 0x%2.2x, data (hex): ",
281 p.Type);
282 for(i=0; i<size-2; i++) printk("%2.2x ", p.PPCData[i]);
283 printk("\n");
284 break;
285 }
286#undef p
287}
288
289static void __init printsmallpacket(PnP_TAG_PACKET * pkt, int size) {
290 static const unsigned char * intlevel[] = {"high", "low"};
291 static const unsigned char * intsense[] = {"edge", "level"};
292
293 switch (tag_small_item_name(pkt->S1_Pack.Tag)) {
294 case PnPVersion:
295 printk(" PnPversion 0x%x.%x\n",
296 pkt->S1_Pack.Version[0], /* How to interpret version ? */
297 pkt->S1_Pack.Version[1]);
298 break;
299// case Logicaldevice:
300 break;
301// case CompatibleDevice:
302 break;
303 case IRQFormat:
304#define p pkt->S4_Pack
305 printk(" IRQ Mask 0x%4.4x, %s %s sensitive\n",
306 ld_le16((unsigned short *)p.IRQMask),
307 intlevel[(size>3) ? !(p.IRQInfo&0x05) : 0],
308 intsense[(size>3) ? !(p.IRQInfo&0x03) : 0]);
309#undef p
310 break;
311 case DMAFormat:
312#define p pkt->S5_Pack
313 printk(" DMA channel mask 0x%2.2x, info 0x%2.2x\n",
314 p.DMAMask, p.DMAInfo);
315#undef p
316 break;
317 case StartDepFunc:
318 printk("Start dependent function:\n");
319 break;
320 case EndDepFunc:
321 printk("End dependent function\n");
322 break;
323 case IOPort:
324#define p pkt->S8_Pack
325 printk(" Variable (%d decoded bits) I/O port\n"
326 " from 0x%4.4x to 0x%4.4x, alignment %d, %d ports\n",
327 p.IOInfo&ISAAddr16bit?16:10,
328 ld_le16((unsigned short *)p.RangeMin),
329 ld_le16((unsigned short *)p.RangeMax),
330 p.IOAlign, p.IONum);
331#undef p
332 break;
333 case FixedIOPort:
334#define p pkt->S9_Pack
335 printk(" Fixed (10 decoded bits) I/O port from %3.3x to %3.3x\n",
336 (p.Range[1]<<8)|p.Range[0],
337 ((p.Range[1]<<8)|p.Range[0])+p.IONum-1);
338#undef p
339 break;
340 case Res1:
341 case Res2:
342 case Res3:
343 printk(" Undefined packet type %d!\n",
344 tag_small_item_name(pkt->S1_Pack.Tag));
345 break;
346 case SmallVendorItem:
347 printsmallvendor(pkt,size);
348 break;
349 default:
350 printk(" Type 0x2.2x%d, size=%d\n",
351 pkt->S1_Pack.Tag, size);
352 break;
353 }
354}
355
356static void __init printlargevendor(PnP_TAG_PACKET * pkt, int size) {
357 static const unsigned char * addrtype[] = {"I/O", "Memory", "System"};
358 static const unsigned char * inttype[] = {"8259", "MPIC", "RS6k BUID %d"};
359 static const unsigned char * convtype[] = {"Bus Memory", "Bus I/O", "DMA"};
360 static const unsigned char * transtype[] = {"direct", "mapped", "direct-store segment"};
361 static const unsigned char * L2type[] = {"WriteThru", "CopyBack"};
362 static const unsigned char * L2assoc[] = {"DirectMapped", "2-way set"};
363
364 int i;
365 char tmpstr[30], *t;
366#define p pkt->L4_Pack.L4_Data.L4_PPCPack
367 switch(p.Type) {
368 case 2:
369 printk(" %d K %s %s L2 cache, %d/%d bytes line/sector size\n",
370 ld_le32((unsigned int *)p.PPCData),
371 L2type[p.PPCData[10]-1],
372 L2assoc[p.PPCData[4]-1],
373 ld_le16((unsigned short *)p.PPCData+3),
374 ld_le16((unsigned short *)p.PPCData+4));
375 break;
376 case 3:
377 printk(" PCI Bridge parameters\n"
378 " ConfigBaseAddress %0x\n"
379 " ConfigBaseData %0x\n"
380 " Bus number %d\n",
381 ld_le32((unsigned int *)p.PPCData),
382 ld_le32((unsigned int *)(p.PPCData+8)),
383 p.PPCData[16]);
384 for(i=20; i<size-4; i+=12) {
385 int j, first;
386 if(p.PPCData[i]) printk(" PCI Slot %d", p.PPCData[i]);
387 else printk (" Integrated PCI device");
388 for(j=0, first=1, t=tmpstr; j<4; j++) {
389 int line=ld_le16((unsigned short *)(p.PPCData+i+4)+j);
390 if(line!=0xffff){
391 if(first) first=0; else *t++='/';
392 *t++='A'+j;
393 }
394 }
395 *t='\0';
396 printk(" DevFunc 0x%x interrupt line(s) %s routed to",
397 p.PPCData[i+1],tmpstr);
398 sprintf(tmpstr,
399 inttype[p.PPCData[i+2]-1],
400 p.PPCData[i+3]);
401 printk(" %s line(s) ",
402 tmpstr);
403 for(j=0, first=1, t=tmpstr; j<4; j++) {
404 int line=ld_le16((unsigned short *)(p.PPCData+i+4)+j);
405 if(line!=0xffff){
406 if(first) first=0; else *t++='/';
407 t+=sprintf(t,"%d(%c)",
408 line&0x7fff,
409 line&0x8000?'E':'L');
410 }
411 }
412 printk("%s\n",tmpstr);
413 }
414 break;
415 case 5:
416 printk(" Bridge address translation, %s decoding:\n"
417 " Processor Bus Size Conversion Translation\n"
418 " 0x%8.8x 0x%8.8x 0x%8.8x %s %s\n",
419 p.PPCData[0]&1 ? "positive" : "subtractive",
420 ld_le32((unsigned int *)p.PPCData+1),
421 ld_le32((unsigned int *)p.PPCData+3),
422 ld_le32((unsigned int *)p.PPCData+5),
423 convtype[p.PPCData[2]-1],
424 transtype[p.PPCData[1]-1]);
425 break;
426 case 6:
427 printk(" Bus speed %d Hz, %d slot(s)\n",
428 ld_le32((unsigned int *)p.PPCData),
429 p.PPCData[4]);
430 break;
431 case 7:
432 printk(" SCSI buses: %d, id(s):", p.PPCData[0]);
433 for(i=1; i<=p.PPCData[0]; i++)
434 printk(" %d%c", p.PPCData[i], i==p.PPCData[0] ? '\n' : ',');
435 break;
436 case 9:
437 printk(" %s address (%d bits), at 0x%x size 0x%x bytes\n",
438 addrtype[p.PPCData[0]-1],
439 p.PPCData[1],
440 ld_le32((unsigned int *)(p.PPCData+4)),
441 ld_le32((unsigned int *)(p.PPCData+12)));
442 break;
443 case 10:
444 sprintf(tmpstr,
445 inttype[p.PPCData[0]-1],
446 p.PPCData[1]);
447
448 printk(" ISA interrupts routed to %s\n"
449 " lines",
450 tmpstr);
451 for(i=0; i<16; i++) {
452 int line=ld_le16((unsigned short *)p.PPCData+i+1);
453 if (line!=0xffff) printk(" %d(IRQ%d)", line, i);
454 }
455 printk("\n");
456 break;
457 default:
458 printk(" Large vendor item type 0x%2.2x\n Data (hex):",
459 p.Type);
460 for(i=0; i<size-4; i++) printk(" %2.2x", p.PPCData[i]);
461 printk("\n");
462#undef p
463 }
464}
465
466static void __init printlargepacket(PnP_TAG_PACKET * pkt, int size) {
467 switch (tag_large_item_name(pkt->S1_Pack.Tag)) {
468 case LargeVendorItem:
469 printlargevendor(pkt, size);
470 break;
471 default:
472 printk(" Type 0x2.2x%d, size=%d\n",
473 pkt->S1_Pack.Tag, size);
474 break;
475 }
476}
477
478static void __init printpackets(PnP_TAG_PACKET * pkt, const char * cat)
479{
480 if (pkt->S1_Pack.Tag== END_TAG) {
481 printk(" No packets describing %s resources.\n", cat);
482 return;
483 }
484 printk( " Packets describing %s resources:\n",cat);
485 do {
486 int size;
487 if (tag_type(pkt->S1_Pack.Tag)) {
488 size= 3 +
489 pkt->L1_Pack.Count0 +
490 pkt->L1_Pack.Count1*256;
491 printlargepacket(pkt, size);
492 } else {
493 size=tag_small_count(pkt->S1_Pack.Tag)+1;
494 printsmallpacket(pkt, size);
495 }
496 pkt = (PnP_TAG_PACKET *)((unsigned char *) pkt + size);
497 } while (pkt->S1_Pack.Tag != END_TAG);
498}
499
500void __init print_residual_device_info(void)
501{
502 int i;
503 PPC_DEVICE *dev;
504#define did dev->DeviceId
505
506 /* make sure we have residual data first */
507 if (!have_residual_data)
508 return;
509
510 printk("Residual: %ld devices\n", res->ActualNumDevices);
511 for ( i = 0;
512 i < res->ActualNumDevices ;
513 i++)
514 {
515 char decomp[4], sn[20];
516 const char * s;
517 dev = &res->Devices[i];
518 s = PnP_INTERFACE_STR(did.BaseType, did.SubType,
519 did.Interface);
520 if(!s) {
521 sprintf(sn, "interface %d", did.Interface);
522 s=sn;
523 }
524 if ( did.BusId & PCIDEVICE )
525 printk("PCI Device, Bus %d, DevFunc 0x%x:",
526 dev->BusAccess.PCIAccess.BusNumber,
527 dev->BusAccess.PCIAccess.DevFuncNumber);
528 if ( did.BusId & PNPISADEVICE ) printk("PNPISA Device:");
529 if ( did.BusId & ISADEVICE )
530 printk("ISA Device, Slot %d, LogicalDev %d:",
531 dev->BusAccess.ISAAccess.SlotNumber,
532 dev->BusAccess.ISAAccess.LogicalDevNumber);
533 if ( did.BusId & EISADEVICE ) printk("EISA Device:");
534 if ( did.BusId & PROCESSORDEVICE )
535 printk("ProcBus Device, Bus %d, BUID %d: ",
536 dev->BusAccess.ProcBusAccess.BusNumber,
537 dev->BusAccess.ProcBusAccess.BUID);
538 if ( did.BusId & PCMCIADEVICE ) printk("PCMCIA ");
539 if ( did.BusId & VMEDEVICE ) printk("VME ");
540 if ( did.BusId & MCADEVICE ) printk("MCA ");
541 if ( did.BusId & MXDEVICE ) printk("MX ");
542 /* Decompress first 3 chars */
543 decomp[0]='A'-1+((did.DevId>>26)&0x1F);
544 decomp[1]='A'-1+((did.DevId>>21)&0x1F);
545 decomp[2]='A'-1+((did.DevId>>16)&0x1F);
546 decomp[3]=0;
547 printk(" %s%4.4lX, %s, %s, %s\n",
548 decomp, did.DevId&0xffff,
549 PnP_BASE_TYPES[did.BaseType],
550 PnP_SUB_TYPE_STR(did.BaseType,did.SubType),
551 s);
552 if ( dev->AllocatedOffset )
553 printpackets( (union _PnP_TAG_PACKET *)
554 &res->DevicePnPHeap[dev->AllocatedOffset],
555 "allocated");
556 if ( dev->PossibleOffset )
557 printpackets( (union _PnP_TAG_PACKET *)
558 &res->DevicePnPHeap[dev->PossibleOffset],
559 "possible");
560 if ( dev->CompatibleOffset )
561 printpackets( (union _PnP_TAG_PACKET *)
562 &res->DevicePnPHeap[dev->CompatibleOffset],
563 "compatible");
564 }
565}
566
567
568#if 0
569static void __init printVPD(void) {
570#define vpd res->VitalProductData
571 int ps=vpd.PageSize, i, j;
572 static const char* Usage[]={
573 "FirmwareStack", "FirmwareHeap", "FirmwareCode", "BootImage",
574 "Free", "Unpopulated", "ISAAddr", "PCIConfig",
575 "IOMemory", "SystemIO", "SystemRegs", "PCIAddr",
576 "UnPopSystemRom", "SystemROM", "ResumeBlock", "Other"
577 };
578 static const unsigned char *FWMan[]={
579 "IBM", "Motorola", "FirmWorks", "Bull"
580 };
581 static const unsigned char *FWFlags[]={
582 "Conventional", "OpenFirmware", "Diagnostics", "LowDebug",
583 "MultiBoot", "LowClient", "Hex41", "FAT",
584 "ISO9660", "SCSI_ID_Override", "Tape_Boot", "FW_Boot_Path"
585 };
586 static const unsigned char *ESM[]={
587 "Port92", "PCIConfigA8", "FF001030", "????????"
588 };
589 static const unsigned char *SIOM[]={
590 "Port850", "????????", "PCIConfigA8", "????????"
591 };
592
593 printk("Model: %s\n",vpd.PrintableModel);
594 printk("Serial: %s\n", vpd.Serial);
595 printk("FirmwareSupplier: %s\n", FWMan[vpd.FirmwareSupplier]);
596 printk("FirmwareFlags:");
597 for(j=0; j<12; j++) {
598 if (vpd.FirmwareSupports & (1<<j)) {
599 printk(" %s%c", FWFlags[j],
600 vpd.FirmwareSupports&(-2<<j) ? ',' : '\n');
601 }
602 }
603 printk("NVRamSize: %ld\n", vpd.NvramSize);
604 printk("SIMMslots: %ld\n", vpd.NumSIMMSlots);
605 printk("EndianSwitchMethod: %s\n",
606 ESM[vpd.EndianSwitchMethod>2 ? 2 : vpd.EndianSwitchMethod]);
607 printk("SpreadIOMethod: %s\n",
608 SIOM[vpd.SpreadIOMethod>3 ? 3 : vpd.SpreadIOMethod]);
609 printk("Processor/Bus frequencies (Hz): %ld/%ld\n",
610 vpd.ProcessorHz, vpd.ProcessorBusHz);
611 printk("Time Base Divisor: %ld\n", vpd.TimeBaseDivisor);
612 printk("WordWidth, PageSize: %ld, %d\n", vpd.WordWidth, ps);
613 printk("Cache sector size, Lock granularity: %ld, %ld\n",
614 vpd.CoherenceBlockSize, vpd.GranuleSize);
615 for (i=0; i<res->ActualNumMemSegs; i++) {
616 int mask=res->Segs[i].Usage, first, j;
617 printk("%8.8lx-%8.8lx ",
618 res->Segs[i].BasePage*ps,
619 (res->Segs[i].PageCount+res->Segs[i].BasePage)*ps-1);
620 for(j=15, first=1; j>=0; j--) {
621 if (mask&(1<<j)) {
622 if (first) first=0;
623 else printk(", ");
624 printk("%s", Usage[j]);
625 }
626 }
627 printk("\n");
628 }
629}
630
631/*
632 * Spit out some info about residual data
633 */
634void print_residual_device_info(void)
635{
636 int i;
637 union _PnP_TAG_PACKET *pkt;
638 PPC_DEVICE *dev;
639#define did dev->DeviceId
640
641 /* make sure we have residual data first */
642 if (!have_residual_data)
643 return;
644 printk("Residual: %ld devices\n", res->ActualNumDevices);
645 for ( i = 0;
646 i < res->ActualNumDevices ;
647 i++)
648 {
649 dev = &res->Devices[i];
650 /*
651 * pci devices
652 */
653 if ( did.BusId & PCIDEVICE )
654 {
655 printk("PCI Device:");
656 /* unknown vendor */
657 if ( !strncmp( "Unknown", pci_strvendor(did.DevId>>16), 7) )
658 printk(" id %08lx types %d/%d", did.DevId,
659 did.BaseType, did.SubType);
660 /* known vendor */
661 else
662 printk(" %s %s",
663 pci_strvendor(did.DevId>>16),
664 pci_strdev(did.DevId>>16,
665 did.DevId&0xffff)
666 );
667
668 if ( did.BusId & PNPISADEVICE )
669 {
670 printk(" pnp:");
671 /* get pnp info on the device */
672 pkt = (union _PnP_TAG_PACKET *)
673 &res->DevicePnPHeap[dev->AllocatedOffset];
674 for (; pkt->S1_Pack.Tag != DF_END_TAG;
675 pkt++ )
676 {
677 if ( (pkt->S1_Pack.Tag == S4_Packet) ||
678 (pkt->S1_Pack.Tag == S4_Packet_flags) )
679 printk(" irq %02x%02x",
680 pkt->S4_Pack.IRQMask[0],
681 pkt->S4_Pack.IRQMask[1]);
682 }
683 }
684 printk("\n");
685 continue;
686 }
687 /*
688 * isa devices
689 */
690 if ( did.BusId & ISADEVICE )
691 {
692 printk("ISA Device: basetype: %d subtype: %d",
693 did.BaseType, did.SubType);
694 printk("\n");
695 continue;
696 }
697 /*
698 * eisa devices
699 */
700 if ( did.BusId & EISADEVICE )
701 {
702 printk("EISA Device: basetype: %d subtype: %d",
703 did.BaseType, did.SubType);
704 printk("\n");
705 continue;
706 }
707 /*
708 * proc bus devices
709 */
710 if ( did.BusId & PROCESSORDEVICE )
711 {
712 printk("ProcBus Device: basetype: %d subtype: %d",
713 did.BaseType, did.SubType);
714 printk("\n");
715 continue;
716 }
717 /*
718 * pcmcia devices
719 */
720 if ( did.BusId & PCMCIADEVICE )
721 {
722 printk("PCMCIA Device: basetype: %d subtype: %d",
723 did.BaseType, did.SubType);
724 printk("\n");
725 continue;
726 }
727 printk("Unknown bus access device: busid %lx\n",
728 did.BusId);
729 }
730}
731#endif
732
733/* Returns the device index in the residual data,
734 any of the search items may be set as -1 for wildcard,
735 DevID number field (second halfword) is big endian !
736
737 Examples:
738 - search for the Interrupt controller (8259 type), 2 methods:
739 1) i8259 = residual_find_device(~0,
740 NULL,
741 SystemPeripheral,
742 ProgrammableInterruptController,
743 ISA_PIC,
744 0);
745 2) i8259 = residual_find_device(~0, "PNP0000", -1, -1, -1, 0)
746
747 - search for the first two serial devices, whatever their type)
748 iserial1 = residual_find_device(~0,NULL,
749 CommunicationsDevice,
750 RS232Device,
751 -1, 0)
752 iserial2 = residual_find_device(~0,NULL,
753 CommunicationsDevice,
754 RS232Device,
755 -1, 1)
756 - but search for typical COM1 and COM2 is not easy due to the
757 fact that the interface may be anything and the name "PNP0500" or
758 "PNP0501". Quite bad.
759
760*/
761
762/* devid are easier to uncompress than to compress, so to minimize bloat
763in this rarely used area we unencode and compare */
764
765/* in residual data number is big endian in the device table and
766little endian in the heap, so we use two parameters to avoid writing
767two very similar functions */
768
769static int __init same_DevID(unsigned short vendor,
770 unsigned short Number,
771 char * str)
772{
773 static unsigned const char hexdigit[]="0123456789ABCDEF";
774 if (strlen(str)!=7) return 0;
775 if ( ( ((vendor>>10)&0x1f)+'A'-1 == str[0]) &&
776 ( ((vendor>>5)&0x1f)+'A'-1 == str[1]) &&
777 ( (vendor&0x1f)+'A'-1 == str[2]) &&
778 (hexdigit[(Number>>12)&0x0f] == str[3]) &&
779 (hexdigit[(Number>>8)&0x0f] == str[4]) &&
780 (hexdigit[(Number>>4)&0x0f] == str[5]) &&
781 (hexdigit[Number&0x0f] == str[6]) ) return 1;
782 return 0;
783}
784
785PPC_DEVICE __init *residual_find_device(unsigned long BusMask,
786 unsigned char * DevID,
787 int BaseType,
788 int SubType,
789 int Interface,
790 int n)
791{
792 int i;
793 if (!have_residual_data) return NULL;
794 for (i=0; i<res->ActualNumDevices; i++) {
795#define Dev res->Devices[i].DeviceId
796 if ( (Dev.BusId&BusMask) &&
797 (BaseType==-1 || Dev.BaseType==BaseType) &&
798 (SubType==-1 || Dev.SubType==SubType) &&
799 (Interface==-1 || Dev.Interface==Interface) &&
800 (DevID==NULL || same_DevID((Dev.DevId>>16)&0xffff,
801 Dev.DevId&0xffff, DevID)) &&
802 !(n--) ) return res->Devices+i;
803#undef Dev
804 }
805 return NULL;
806}
807
808PPC_DEVICE __init *residual_find_device_id(unsigned long BusMask,
809 unsigned short DevID,
810 int BaseType,
811 int SubType,
812 int Interface,
813 int n)
814{
815 int i;
816 if (!have_residual_data) return NULL;
817 for (i=0; i<res->ActualNumDevices; i++) {
818#define Dev res->Devices[i].DeviceId
819 if ( (Dev.BusId&BusMask) &&
820 (BaseType==-1 || Dev.BaseType==BaseType) &&
821 (SubType==-1 || Dev.SubType==SubType) &&
822 (Interface==-1 || Dev.Interface==Interface) &&
823 (DevID==0xffff || (Dev.DevId&0xffff) == DevID) &&
824 !(n--) ) return res->Devices+i;
825#undef Dev
826 }
827 return NULL;
828}
829
830static int __init
831residual_scan_pcibridge(PnP_TAG_PACKET * pkt, struct pci_dev *dev)
832{
833 int irq = -1;
834
835#define data pkt->L4_Pack.L4_Data.L4_PPCPack.PPCData
836 if (dev->bus->number == data[16]) {
837 int i, size;
838
839 size = 3 + ld_le16((u_short *) (&pkt->L4_Pack.Count0));
840 for (i = 20; i < size - 4; i += 12) {
841 unsigned char pin;
842 int line_irq;
843
844 if (dev->devfn != data[i + 1])
845 continue;
846
847 pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin);
848 if (pin) {
849 line_irq = ld_le16((unsigned short *)
850 (&data[i + 4 + 2 * (pin - 1)]));
851 irq = (line_irq == 0xffff) ? 0
852 : line_irq & 0x7fff;
853 } else
854 irq = 0;
855
856 break;
857 }
858 }
859#undef data
860
861 return irq;
862}
863
864int __init
865residual_pcidev_irq(struct pci_dev *dev)
866{
867 int i = 0;
868 int irq = -1;
869 PPC_DEVICE *bridge;
870
871 while ((bridge = residual_find_device
872 (-1, NULL, BridgeController, PCIBridge, -1, i++))) {
873
874 PnP_TAG_PACKET *pkt;
875 if (bridge->AllocatedOffset) {
876 pkt = PnP_find_large_vendor_packet(res->DevicePnPHeap +
877 bridge->AllocatedOffset, 3, 0);
878 if (!pkt)
879 continue;
880
881 irq = residual_scan_pcibridge(pkt, dev);
882 if (irq != -1)
883 break;
884 }
885 }
886
887 return (irq < 0) ? 0 : irq;
888}
889
890void __init residual_irq_mask(char *irq_edge_mask_lo, char *irq_edge_mask_hi)
891{
892 PPC_DEVICE *dev;
893 int i = 0;
894 unsigned short irq_mask = 0x000; /* default to edge */
895
896 while ((dev = residual_find_device(-1, NULL, -1, -1, -1, i++))) {
897 PnP_TAG_PACKET *pkt;
898 unsigned short mask;
899 int size;
900 int offset = dev->AllocatedOffset;
901
902 if (!offset)
903 continue;
904
905 pkt = PnP_find_packet(res->DevicePnPHeap + offset,
906 IRQFormat, 0);
907 if (!pkt)
908 continue;
909
910 size = tag_small_count(pkt->S1_Pack.Tag) + 1;
911 mask = ld_le16((unsigned short *)pkt->S4_Pack.IRQMask);
912 if (size > 3 && (pkt->S4_Pack.IRQInfo & 0x0c))
913 irq_mask |= mask;
914 }
915
916 *irq_edge_mask_lo = irq_mask & 0xff;
917 *irq_edge_mask_hi = irq_mask >> 8;
918}
919
920unsigned int __init residual_isapic_addr(void)
921{
922 PPC_DEVICE *isapic;
923 PnP_TAG_PACKET *pkt;
924 unsigned int addr;
925
926 isapic = residual_find_device(~0, NULL, SystemPeripheral,
927 ProgrammableInterruptController,
928 ISA_PIC, 0);
929 if (!isapic)
930 goto unknown;
931
932 pkt = PnP_find_large_vendor_packet(res->DevicePnPHeap +
933 isapic->AllocatedOffset, 9, 0);
934 if (!pkt)
935 goto unknown;
936
937#define p pkt->L4_Pack.L4_Data.L4_PPCPack
938 /* Must be 32-bit system address */
939 if (!((p.PPCData[0] == 3) && (p.PPCData[1] == 32)))
940 goto unknown;
941
942 /* It doesn't seem to work where length != 1 (what can I say? :-/ ) */
943 if (ld_le32((unsigned int *)(p.PPCData + 12)) != 1)
944 goto unknown;
945
946 addr = ld_le32((unsigned int *) (p.PPCData + 4));
947#undef p
948 return addr;
949unknown:
950 return 0;
951}
952
953PnP_TAG_PACKET *PnP_find_packet(unsigned char *p,
954 unsigned packet_tag,
955 int n)
956{
957 unsigned mask, masked_tag, size;
958 if(!p) return NULL;
959 if (tag_type(packet_tag)) mask=0xff; else mask=0xF8;
960 masked_tag = packet_tag&mask;
961 for(; *p != END_TAG; p+=size) {
962 if ((*p & mask) == masked_tag && !(n--))
963 return (PnP_TAG_PACKET *) p;
964 if (tag_type(*p))
965 size=ld_le16((unsigned short *)(p+1))+3;
966 else
967 size=tag_small_count(*p)+1;
968 }
969 return NULL; /* not found */
970}
971
972PnP_TAG_PACKET __init *PnP_find_small_vendor_packet(unsigned char *p,
973 unsigned packet_type,
974 int n)
975{
976 int next=0;
977 while (p) {
978 p = (unsigned char *) PnP_find_packet(p, 0x70, next);
979 if (p && p[1]==packet_type && !(n--))
980 return (PnP_TAG_PACKET *) p;
981 next = 1;
982 };
983 return NULL; /* not found */
984}
985
986PnP_TAG_PACKET __init *PnP_find_large_vendor_packet(unsigned char *p,
987 unsigned packet_type,
988 int n)
989{
990 int next=0;
991 while (p) {
992 p = (unsigned char *) PnP_find_packet(p, 0x84, next);
993 if (p && p[3]==packet_type && !(n--))
994 return (PnP_TAG_PACKET *) p;
995 next = 1;
996 };
997 return NULL; /* not found */
998}
999
1000#ifdef CONFIG_PROC_PREPRESIDUAL
1001static int proc_prep_residual_read(char * buf, char ** start, off_t off,
1002 int count, int *eof, void *data)
1003{
1004 int n;
1005
1006 n = res->ResidualLength - off;
1007 if (n < 0) {
1008 *eof = 1;
1009 n = 0;
1010 }
1011 else {
1012 if (n > count)
1013 n = count;
1014 else
1015 *eof = 1;
1016
1017 memcpy(buf, (char *)res + off, n);
1018 *start = buf;
1019 }
1020
1021 return n;
1022}
1023
1024int __init
1025proc_prep_residual_init(void)
1026{
1027 if (have_residual_data)
1028 create_proc_read_entry("residual", S_IRUGO, NULL,
1029 proc_prep_residual_read, NULL);
1030 return 0;
1031}
1032
1033__initcall(proc_prep_residual_init);
1034#endif
diff --git a/arch/ppc/platforms/rpx8260.h b/arch/ppc/platforms/rpx8260.h
deleted file mode 100644
index 843494a50ef3..000000000000
--- a/arch/ppc/platforms/rpx8260.h
+++ /dev/null
@@ -1,81 +0,0 @@
1/*
2 * A collection of structures, addresses, and values associated with
3 * the Embedded Planet RPX6 (or RPX Super) MPC8260 board.
4 * Copied from the RPX-Classic and SBS8260 stuff.
5 *
6 * Copyright (c) 2001 Dan Malek <dan@embeddededge.com>
7 */
8#ifdef __KERNEL__
9#ifndef __ASM_PLATFORMS_RPX8260_H__
10#define __ASM_PLATFORMS_RPX8260_H__
11
12/* A Board Information structure that is given to a program when
13 * prom starts it up.
14 */
15typedef struct bd_info {
16 unsigned int bi_memstart; /* Memory start address */
17 unsigned int bi_memsize; /* Memory (end) size in bytes */
18 unsigned int bi_nvsize; /* NVRAM size in bytes (can be 0) */
19 unsigned int bi_intfreq; /* Internal Freq, in Hz */
20 unsigned int bi_busfreq; /* Bus Freq, in MHz */
21 unsigned int bi_cpmfreq; /* CPM Freq, in MHz */
22 unsigned int bi_brgfreq; /* BRG Freq, in MHz */
23 unsigned int bi_vco; /* VCO Out from PLL */
24 unsigned int bi_baudrate; /* Default console baud rate */
25 unsigned int bi_immr; /* IMMR when called from boot rom */
26 unsigned char bi_enetaddr[6];
27} bd_t;
28
29extern bd_t m8xx_board_info;
30
31/* Memory map is configured by the PROM startup.
32 * We just map a few things we need. The CSR is actually 4 byte-wide
33 * registers that can be accessed as 8-, 16-, or 32-bit values.
34 */
35#define CPM_MAP_ADDR ((uint)0xf0000000)
36#define RPX_CSR_ADDR ((uint)0xfa000000)
37#define RPX_CSR_SIZE ((uint)(512 * 1024))
38#define RPX_NVRTC_ADDR ((uint)0xfa080000)
39#define RPX_NVRTC_SIZE ((uint)(512 * 1024))
40
41/* The RPX6 has 16, byte wide control/status registers.
42 * Not all are used (yet).
43 */
44extern volatile u_char *rpx6_csr_addr;
45
46/* Things of interest in the CSR.
47*/
48#define BCSR0_ID_MASK ((u_char)0xf0) /* Read only */
49#define BCSR0_SWITCH_MASK ((u_char)0x0f) /* Read only */
50#define BCSR1_XCVR_SMC1 ((u_char)0x80)
51#define BCSR1_XCVR_SMC2 ((u_char)0x40)
52#define BCSR2_FLASH_WENABLE ((u_char)0x20)
53#define BCSR2_NVRAM_ENABLE ((u_char)0x10)
54#define BCSR2_ALT_IRQ2 ((u_char)0x08)
55#define BCSR2_ALT_IRQ3 ((u_char)0x04)
56#define BCSR2_PRST ((u_char)0x02) /* Force reset */
57#define BCSR2_ENPRST ((u_char)0x01) /* Enable POR */
58#define BCSR3_MODCLK_MASK ((u_char)0xe0)
59#define BCSR3_ENCLKHDR ((u_char)0x10)
60#define BCSR3_LED5 ((u_char)0x04) /* 0 == on */
61#define BCSR3_LED6 ((u_char)0x02) /* 0 == on */
62#define BCSR3_LED7 ((u_char)0x01) /* 0 == on */
63#define BCSR4_EN_PHY ((u_char)0x80) /* Enable PHY */
64#define BCSR4_EN_MII ((u_char)0x40) /* Enable PHY */
65#define BCSR4_MII_READ ((u_char)0x04)
66#define BCSR4_MII_MDC ((u_char)0x02)
67#define BCSR4_MII_MDIO ((u_char)0x01)
68#define BCSR13_FETH_IRQMASK ((u_char)0xf0)
69#define BCSR15_FETH_IRQ ((u_char)0x20)
70
71#define PHY_INTERRUPT SIU_INT_IRQ7
72
73/* For our show_cpuinfo hooks. */
74#define CPUINFO_VENDOR "Embedded Planet"
75#define CPUINFO_MACHINE "EP8260 PowerPC"
76
77/* Warm reset vector. */
78#define BOOTROM_RESTART_ADDR ((uint)0xfff00104)
79
80#endif /* __ASM_PLATFORMS_RPX8260_H__ */
81#endif /* __KERNEL__ */
diff --git a/arch/ppc/platforms/rpxclassic.h b/arch/ppc/platforms/rpxclassic.h
deleted file mode 100644
index a3c1118e5b09..000000000000
--- a/arch/ppc/platforms/rpxclassic.h
+++ /dev/null
@@ -1,114 +0,0 @@
1/*
2 * A collection of structures, addresses, and values associated with
3 * the RPCG RPX-Classic board. Copied from the RPX-Lite stuff.
4 *
5 * Copyright (c) 1998 Dan Malek (dmalek@jlc.net)
6 */
7#ifdef __KERNEL__
8#ifndef __MACH_RPX_DEFS
9#define __MACH_RPX_DEFS
10
11
12#ifndef __ASSEMBLY__
13/* A Board Information structure that is given to a program when
14 * prom starts it up.
15 */
16typedef struct bd_info {
17 unsigned int bi_memstart; /* Memory start address */
18 unsigned int bi_memsize; /* Memory (end) size in bytes */
19 unsigned int bi_intfreq; /* Internal Freq, in Hz */
20 unsigned int bi_busfreq; /* Bus Freq, in Hz */
21 unsigned char bi_enetaddr[6];
22 unsigned int bi_baudrate;
23} bd_t;
24
25extern bd_t m8xx_board_info;
26
27/* Memory map is configured by the PROM startup.
28 * We just map a few things we need. The CSR is actually 4 byte-wide
29 * registers that can be accessed as 8-, 16-, or 32-bit values.
30 */
31#define PCI_ISA_IO_ADDR ((unsigned)0x80000000)
32#define PCI_ISA_IO_SIZE ((uint)(512 * 1024 * 1024))
33#define PCI_ISA_MEM_ADDR ((unsigned)0xc0000000)
34#define PCI_ISA_MEM_SIZE ((uint)(512 * 1024 * 1024))
35#define RPX_CSR_ADDR ((uint)0xfa400000)
36#define RPX_CSR_SIZE ((uint)(4 * 1024))
37#define IMAP_ADDR ((uint)0xfa200000)
38#define IMAP_SIZE ((uint)(64 * 1024))
39#define PCI_CSR_ADDR ((uint)0x80000000)
40#define PCI_CSR_SIZE ((uint)(64 * 1024))
41#define PCMCIA_MEM_ADDR ((uint)0xe0000000)
42#define PCMCIA_MEM_SIZE ((uint)(64 * 1024))
43#define PCMCIA_IO_ADDR ((uint)0xe4000000)
44#define PCMCIA_IO_SIZE ((uint)(4 * 1024))
45#define PCMCIA_ATTRB_ADDR ((uint)0xe8000000)
46#define PCMCIA_ATTRB_SIZE ((uint)(4 * 1024))
47
48/* Things of interest in the CSR.
49*/
50#define BCSR0_ETHEN ((uint)0x80000000)
51#define BCSR0_ETHLPBK ((uint)0x40000000)
52#define BCSR0_COLTESTDIS ((uint)0x20000000)
53#define BCSR0_FULLDPLXDIS ((uint)0x10000000)
54#define BCSR0_ENFLSHSEL ((uint)0x04000000)
55#define BCSR0_FLASH_SEL ((uint)0x02000000)
56#define BCSR0_ENMONXCVR ((uint)0x01000000)
57
58#define BCSR0_PCMCIAVOLT ((uint)0x000f0000) /* CLLF */
59#define BCSR0_PCMCIA3VOLT ((uint)0x000a0000) /* CLLF */
60#define BCSR0_PCMCIA5VOLT ((uint)0x00060000) /* CLLF */
61
62#define BCSR1_IPB5SEL ((uint)0x00100000)
63#define BCSR1_PCVCTL4 ((uint)0x00080000)
64#define BCSR1_PCVCTL5 ((uint)0x00040000)
65#define BCSR1_PCVCTL6 ((uint)0x00020000)
66#define BCSR1_PCVCTL7 ((uint)0x00010000)
67
68#define BCSR2_EN232XCVR ((uint)0x00008000)
69#define BCSR2_QSPACESEL ((uint)0x00004000)
70#define BCSR2_FETHLEDMODE ((uint)0x00000800) /* CLLF */
71
72/* define IO_BASE for pcmcia, CLLF only */
73#if !defined(CONFIG_PCI)
74#define _IO_BASE 0x80000000
75#define _IO_BASE_SIZE 0x1000
76
77/* for pcmcia sandisk */
78#ifdef CONFIG_IDE
79# define MAX_HWIFS 1
80#endif
81#endif
82
83/* Interrupt level assignments.
84*/
85#define FEC_INTERRUPT SIU_LEVEL1 /* FEC interrupt */
86
87
88/* CPM Ethernet through SCCx.
89 *
90 * Bits in parallel I/O port registers that have to be set/cleared
91 * to configure the pins for SCC1 use.
92 */
93#define PA_ENET_RXD ((ushort)0x0001)
94#define PA_ENET_TXD ((ushort)0x0002)
95#define PA_ENET_TCLK ((ushort)0x0200)
96#define PA_ENET_RCLK ((ushort)0x0800)
97#define PB_ENET_TENA ((uint)0x00001000)
98#define PC_ENET_CLSN ((ushort)0x0010)
99#define PC_ENET_RENA ((ushort)0x0020)
100
101/* Control bits in the SICR to route TCLK (CLK2) and RCLK (CLK4) to
102 * SCC1. Also, make sure GR1 (bit 24) and SC1 (bit 25) are zero.
103 */
104#define SICR_ENET_MASK ((uint)0x000000ff)
105#define SICR_ENET_CLKRT ((uint)0x0000003d)
106
107/* We don't use the 8259.
108*/
109
110#define NR_8259_INTS 0
111
112#endif /* !__ASSEMBLY__ */
113#endif /* __MACH_RPX_DEFS */
114#endif /* __KERNEL__ */
diff --git a/arch/ppc/platforms/rpxlite.h b/arch/ppc/platforms/rpxlite.h
deleted file mode 100644
index b615501d55fc..000000000000
--- a/arch/ppc/platforms/rpxlite.h
+++ /dev/null
@@ -1,91 +0,0 @@
1/*
2 * A collection of structures, addresses, and values associated with
3 * the RPCG RPX-Lite board. Copied from the MBX stuff.
4 *
5 * Copyright (c) 1998 Dan Malek (dmalek@jlc.net)
6 */
7#ifdef __KERNEL__
8#ifndef __MACH_RPX_DEFS
9#define __MACH_RPX_DEFS
10
11
12#ifndef __ASSEMBLY__
13/* A Board Information structure that is given to a program when
14 * prom starts it up.
15 */
16typedef struct bd_info {
17 unsigned int bi_memstart; /* Memory start address */
18 unsigned int bi_memsize; /* Memory (end) size in bytes */
19 unsigned int bi_intfreq; /* Internal Freq, in Hz */
20 unsigned int bi_busfreq; /* Bus Freq, in Hz */
21 unsigned char bi_enetaddr[6];
22 unsigned int bi_baudrate;
23} bd_t;
24
25extern bd_t m8xx_board_info;
26
27/* Memory map is configured by the PROM startup.
28 * We just map a few things we need. The CSR is actually 4 byte-wide
29 * registers that can be accessed as 8-, 16-, or 32-bit values.
30 */
31#define RPX_CSR_ADDR ((uint)0xfa400000)
32#define RPX_CSR_SIZE ((uint)(4 * 1024))
33#define IMAP_ADDR ((uint)0xfa200000)
34#define IMAP_SIZE ((uint)(64 * 1024))
35#define PCMCIA_MEM_ADDR ((uint)0x04000000)
36#define PCMCIA_MEM_SIZE ((uint)(64 * 1024))
37#define PCMCIA_IO_ADDR ((uint)0x04400000)
38#define PCMCIA_IO_SIZE ((uint)(4 * 1024))
39
40/* Things of interest in the CSR.
41*/
42#define BCSR0_ETHEN ((uint)0x80000000)
43#define BCSR0_ETHLPBK ((uint)0x40000000)
44#define BCSR0_COLTESTDIS ((uint)0x20000000)
45#define BCSR0_FULLDPLXDIS ((uint)0x10000000)
46#define BCSR0_LEDOFF ((uint)0x08000000)
47#define BCSR0_USBDISABLE ((uint)0x04000000)
48#define BCSR0_USBHISPEED ((uint)0x02000000)
49#define BCSR0_USBPWREN ((uint)0x01000000)
50#define BCSR0_PCMCIAVOLT ((uint)0x000f0000)
51#define BCSR0_PCMCIA3VOLT ((uint)0x000a0000)
52#define BCSR0_PCMCIA5VOLT ((uint)0x00060000)
53
54#define BCSR1_IPB5SEL ((uint)0x00100000)
55#define BCSR1_PCVCTL4 ((uint)0x00080000)
56#define BCSR1_PCVCTL5 ((uint)0x00040000)
57#define BCSR1_PCVCTL6 ((uint)0x00020000)
58#define BCSR1_PCVCTL7 ((uint)0x00010000)
59
60/* define IO_BASE for pcmcia */
61#define _IO_BASE 0x80000000
62#define _IO_BASE_SIZE 0x1000
63
64#ifdef CONFIG_IDE
65# define MAX_HWIFS 1
66#endif
67
68/* CPM Ethernet through SCCx.
69 *
70 * This ENET stuff is for the MPC850 with ethernet on SCC2. Some of
71 * this may be unique to the RPX-Lite configuration.
72 * Note TENA is on Port B.
73 */
74#define PA_ENET_RXD ((ushort)0x0004)
75#define PA_ENET_TXD ((ushort)0x0008)
76#define PA_ENET_TCLK ((ushort)0x0200)
77#define PA_ENET_RCLK ((ushort)0x0800)
78#define PB_ENET_TENA ((uint)0x00002000)
79#define PC_ENET_CLSN ((ushort)0x0040)
80#define PC_ENET_RENA ((ushort)0x0080)
81
82#define SICR_ENET_MASK ((uint)0x0000ff00)
83#define SICR_ENET_CLKRT ((uint)0x00003d00)
84
85/* We don't use the 8259.
86*/
87#define NR_8259_INTS 0
88
89#endif /* !__ASSEMBLY__ */
90#endif /* __MACH_RPX_DEFS */
91#endif /* __KERNEL__ */
diff --git a/arch/ppc/platforms/sandpoint.c b/arch/ppc/platforms/sandpoint.c
deleted file mode 100644
index b4897bdb742a..000000000000
--- a/arch/ppc/platforms/sandpoint.c
+++ /dev/null
@@ -1,651 +0,0 @@
1/*
2 * Board setup routines for the Motorola SPS Sandpoint Test Platform.
3 *
4 * Author: Mark A. Greer
5 * mgreer@mvista.com
6 *
7 * 2000-2003 (c) MontaVista Software, Inc. This file is licensed under
8 * the terms of the GNU General Public License version 2. This program
9 * is licensed "as is" without any warranty of any kind, whether express
10 * or implied.
11 */
12
13/*
14 * This file adds support for the Motorola SPS Sandpoint Test Platform.
15 * These boards have a PPMC slot for the processor so any combination
16 * of cpu and host bridge can be attached. This port is for an 8240 PPMC
17 * module from Motorola SPS and other closely related cpu/host bridge
18 * combinations (e.g., 750/755/7400 with MPC107 host bridge).
19 * The sandpoint itself has a Windbond 83c553 (PCI-ISA bridge, 2 DMA ctlrs, 2
20 * cascaded 8259 interrupt ctlrs, 8254 Timer/Counter, and an IDE ctlr), a
21 * National 87308 (RTC, 2 UARTs, Keyboard & mouse ctlrs, and a floppy ctlr),
22 * and 4 PCI slots (only 2 of which are usable; the other 2 are keyed for 3.3V
23 * but are really 5V).
24 *
25 * The firmware on the sandpoint is called DINK (not my acronym :). This port
26 * depends on DINK to do some basic initialization (e.g., initialize the memory
27 * ctlr) and to ensure that the processor is using MAP B (CHRP map).
28 *
29 * The switch settings for the Sandpoint board MUST be as follows:
30 * S3: down
31 * S4: up
32 * S5: up
33 * S6: down
34 *
35 * 'down' is in the direction from the PCI slots towards the PPMC slot;
36 * 'up' is in the direction from the PPMC slot towards the PCI slots.
37 * Be careful, the way the sandpoint board is installed in XT chasses will
38 * make the directions reversed.
39 *
40 * Since Motorola listened to our suggestions for improvement, we now have
41 * the Sandpoint X3 board. All of the PCI slots are available, it uses
42 * the serial interrupt interface (just a hardware thing we need to
43 * configure properly).
44 *
45 * Use the default X3 switch settings. The interrupts are then:
46 * EPIC Source
47 * 0 SIOINT (8259, active low)
48 * 1 PCI #1
49 * 2 PCI #2
50 * 3 PCI #3
51 * 4 PCI #4
52 * 7 Winbond INTC (IDE interrupt)
53 * 8 Winbond INTD (IDE interrupt)
54 *
55 *
56 * Motorola has finally released a version of DINK32 that correctly
57 * (seemingly) initializes the memory controller correctly, regardless
58 * of the amount of memory in the system. Once a method of determining
59 * what version of DINK initializes the system for us, if applicable, is
60 * found, we can hopefully stop hardcoding 32MB of RAM.
61 */
62
63#include <linux/stddef.h>
64#include <linux/kernel.h>
65#include <linux/init.h>
66#include <linux/errno.h>
67#include <linux/reboot.h>
68#include <linux/pci.h>
69#include <linux/kdev_t.h>
70#include <linux/major.h>
71#include <linux/initrd.h>
72#include <linux/console.h>
73#include <linux/delay.h>
74#include <linux/seq_file.h>
75#include <linux/root_dev.h>
76#include <linux/serial.h>
77#include <linux/tty.h> /* for linux/serial_core.h */
78#include <linux/serial_core.h>
79#include <linux/serial_8250.h>
80
81#include <asm/system.h>
82#include <asm/pgtable.h>
83#include <asm/page.h>
84#include <asm/time.h>
85#include <asm/dma.h>
86#include <asm/io.h>
87#include <asm/machdep.h>
88#include <asm/prom.h>
89#include <asm/smp.h>
90#include <asm/vga.h>
91#include <asm/open_pic.h>
92#include <asm/i8259.h>
93#include <asm/todc.h>
94#include <asm/bootinfo.h>
95#include <asm/mpc10x.h>
96#include <asm/pci-bridge.h>
97#include <asm/kgdb.h>
98#include <asm/ppc_sys.h>
99
100#include "sandpoint.h"
101
102/* Set non-zero if an X2 Sandpoint detected. */
103static int sandpoint_is_x2;
104
105unsigned char __res[sizeof(bd_t)];
106
107static void sandpoint_halt(void);
108static void sandpoint_probe_type(void);
109
110/*
111 * Define all of the IRQ senses and polarities. Taken from the
112 * Sandpoint X3 User's manual.
113 */
114static u_char sandpoint_openpic_initsenses[] __initdata = {
115 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* 0: SIOINT */
116 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* 2: PCI Slot 1 */
117 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* 3: PCI Slot 2 */
118 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* 4: PCI Slot 3 */
119 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* 5: PCI Slot 4 */
120 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* 8: IDE (INT C) */
121 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE) /* 9: IDE (INT D) */
122};
123
124/*
125 * Motorola SPS Sandpoint interrupt routing.
126 */
127static inline int
128x3_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
129{
130 static char pci_irq_table[][4] =
131 /*
132 * PCI IDSEL/INTPIN->INTLINE
133 * A B C D
134 */
135 {
136 { 16, 0, 0, 0 }, /* IDSEL 11 - i8259 on Winbond */
137 { 0, 0, 0, 0 }, /* IDSEL 12 - unused */
138 { 18, 21, 20, 19 }, /* IDSEL 13 - PCI slot 1 */
139 { 19, 18, 21, 20 }, /* IDSEL 14 - PCI slot 2 */
140 { 20, 19, 18, 21 }, /* IDSEL 15 - PCI slot 3 */
141 { 21, 20, 19, 18 }, /* IDSEL 16 - PCI slot 4 */
142 };
143
144 const long min_idsel = 11, max_idsel = 16, irqs_per_slot = 4;
145 return PCI_IRQ_TABLE_LOOKUP;
146}
147
148static inline int
149x2_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
150{
151 static char pci_irq_table[][4] =
152 /*
153 * PCI IDSEL/INTPIN->INTLINE
154 * A B C D
155 */
156 {
157 { 18, 0, 0, 0 }, /* IDSEL 11 - i8259 on Windbond */
158 { 0, 0, 0, 0 }, /* IDSEL 12 - unused */
159 { 16, 17, 18, 19 }, /* IDSEL 13 - PCI slot 1 */
160 { 17, 18, 19, 16 }, /* IDSEL 14 - PCI slot 2 */
161 { 18, 19, 16, 17 }, /* IDSEL 15 - PCI slot 3 */
162 { 19, 16, 17, 18 }, /* IDSEL 16 - PCI slot 4 */
163 };
164
165 const long min_idsel = 11, max_idsel = 16, irqs_per_slot = 4;
166 return PCI_IRQ_TABLE_LOOKUP;
167}
168
169static void __init
170sandpoint_setup_winbond_83553(struct pci_controller *hose)
171{
172 int devfn;
173
174 /*
175 * Route IDE interrupts directly to the 8259's IRQ 14 & 15.
176 * We can't route the IDE interrupt to PCI INTC# or INTD# because those
177 * woule interfere with the PMC's INTC# and INTD# lines.
178 */
179 /*
180 * Winbond Fcn 0
181 */
182 devfn = PCI_DEVFN(11,0);
183
184 early_write_config_byte(hose,
185 0,
186 devfn,
187 0x43, /* IDE Interrupt Routing Control */
188 0xef);
189 early_write_config_word(hose,
190 0,
191 devfn,
192 0x44, /* PCI Interrupt Routing Control */
193 0x0000);
194
195 /* Want ISA memory cycles to be forwarded to PCI bus */
196 early_write_config_byte(hose,
197 0,
198 devfn,
199 0x48, /* ISA-to-PCI Addr Decoder Control */
200 0xf0);
201
202 /* Enable Port 92. */
203 early_write_config_byte(hose,
204 0,
205 devfn,
206 0x4e, /* AT System Control Register */
207 0x06);
208 /*
209 * Winbond Fcn 1
210 */
211 devfn = PCI_DEVFN(11,1);
212
213 /* Put IDE controller into native mode. */
214 early_write_config_byte(hose,
215 0,
216 devfn,
217 0x09, /* Programming interface Register */
218 0x8f);
219
220 /* Init IRQ routing, enable both ports, disable fast 16 */
221 early_write_config_dword(hose,
222 0,
223 devfn,
224 0x40, /* IDE Control/Status Register */
225 0x00ff0011);
226 return;
227}
228
229/* On the sandpoint X2, we must avoid sending configuration cycles to
230 * device #12 (IDSEL addr = AD12).
231 */
232static int
233x2_exclude_device(u_char bus, u_char devfn)
234{
235 if ((bus == 0) && (PCI_SLOT(devfn) == SANDPOINT_HOST_BRIDGE_IDSEL))
236 return PCIBIOS_DEVICE_NOT_FOUND;
237 else
238 return PCIBIOS_SUCCESSFUL;
239}
240
241static void __init
242sandpoint_find_bridges(void)
243{
244 struct pci_controller *hose;
245
246 hose = pcibios_alloc_controller();
247
248 if (!hose)
249 return;
250
251 hose->first_busno = 0;
252 hose->last_busno = 0xff;
253
254 if (mpc10x_bridge_init(hose,
255 MPC10X_MEM_MAP_B,
256 MPC10X_MEM_MAP_B,
257 MPC10X_MAPB_EUMB_BASE) == 0) {
258
259 /* Do early winbond init, then scan PCI bus */
260 sandpoint_setup_winbond_83553(hose);
261 hose->last_busno = pciauto_bus_scan(hose, hose->first_busno);
262
263 ppc_md.pcibios_fixup = NULL;
264 ppc_md.pcibios_fixup_bus = NULL;
265 ppc_md.pci_swizzle = common_swizzle;
266 if (sandpoint_is_x2) {
267 ppc_md.pci_map_irq = x2_map_irq;
268 ppc_md.pci_exclude_device = x2_exclude_device;
269 } else
270 ppc_md.pci_map_irq = x3_map_irq;
271 }
272 else {
273 if (ppc_md.progress)
274 ppc_md.progress("Bridge init failed", 0x100);
275 printk("Host bridge init failed\n");
276 }
277
278 return;
279}
280
281static void __init
282sandpoint_setup_arch(void)
283{
284 /* Probe for Sandpoint model */
285 sandpoint_probe_type();
286 if (sandpoint_is_x2)
287 epic_serial_mode = 0;
288
289 loops_per_jiffy = 100000000 / HZ;
290
291#ifdef CONFIG_BLK_DEV_INITRD
292 if (initrd_start)
293 ROOT_DEV = Root_RAM0;
294 else
295#endif
296#ifdef CONFIG_ROOT_NFS
297 ROOT_DEV = Root_NFS;
298#else
299 ROOT_DEV = Root_HDA1;
300#endif
301
302 /* Lookup PCI host bridges */
303 sandpoint_find_bridges();
304
305 if (strncmp (cur_ppc_sys_spec->ppc_sys_name, "8245", 4) == 0)
306 {
307 bd_t *bp = (bd_t *)__res;
308 struct plat_serial8250_port *pdata;
309
310 pdata = (struct plat_serial8250_port *) ppc_sys_get_pdata(MPC10X_UART0);
311 if (pdata)
312 {
313 pdata[0].uartclk = bp->bi_busfreq;
314 }
315
316#ifdef CONFIG_SANDPOINT_ENABLE_UART1
317 pdata = (struct plat_serial8250_port *) ppc_sys_get_pdata(MPC10X_UART1);
318 if (pdata)
319 {
320 pdata[0].uartclk = bp->bi_busfreq;
321 }
322#else
323 ppc_sys_device_remove(MPC10X_UART1);
324#endif
325 }
326
327 printk(KERN_INFO "Motorola SPS Sandpoint Test Platform\n");
328 printk(KERN_INFO "Port by MontaVista Software, Inc. (source@mvista.com)\n");
329
330 /* DINK32 12.3 and below do not correctly enable any caches.
331 * We will do this now with good known values. Future versions
332 * of DINK32 are supposed to get this correct.
333 */
334 if (cpu_has_feature(CPU_FTR_SPEC7450))
335 /* 745x is different. We only want to pass along enable. */
336 _set_L2CR(L2CR_L2E);
337 else if (cpu_has_feature(CPU_FTR_L2CR))
338 /* All modules have 1MB of L2. We also assume that an
339 * L2 divisor of 3 will work.
340 */
341 _set_L2CR(L2CR_L2E | L2CR_L2SIZ_1MB | L2CR_L2CLK_DIV3
342 | L2CR_L2RAM_PIPE | L2CR_L2OH_1_0 | L2CR_L2DF);
343#if 0
344 /* Untested right now. */
345 if (cpu_has_feature(CPU_FTR_L3CR)) {
346 /* Magic value. */
347 _set_L3CR(0x8f032000);
348 }
349#endif
350}
351
352#define SANDPOINT_87308_CFG_ADDR 0x15c
353#define SANDPOINT_87308_CFG_DATA 0x15d
354
355#define SANDPOINT_87308_CFG_INB(addr, byte) { \
356 outb((addr), SANDPOINT_87308_CFG_ADDR); \
357 (byte) = inb(SANDPOINT_87308_CFG_DATA); \
358}
359
360#define SANDPOINT_87308_CFG_OUTB(addr, byte) { \
361 outb((addr), SANDPOINT_87308_CFG_ADDR); \
362 outb((byte), SANDPOINT_87308_CFG_DATA); \
363}
364
365#define SANDPOINT_87308_SELECT_DEV(dev_num) { \
366 SANDPOINT_87308_CFG_OUTB(0x07, (dev_num)); \
367}
368
369#define SANDPOINT_87308_DEV_ENABLE(dev_num) { \
370 SANDPOINT_87308_SELECT_DEV(dev_num); \
371 SANDPOINT_87308_CFG_OUTB(0x30, 0x01); \
372}
373
374/*
375 * To probe the Sandpoint type, we need to check for a connection between GPIO
376 * pins 6 and 7 on the NS87308 SuperIO.
377 */
378static void __init sandpoint_probe_type(void)
379{
380 u8 x;
381 /* First, ensure that the GPIO pins are enabled. */
382 SANDPOINT_87308_SELECT_DEV(0x07); /* Select GPIO logical device */
383 SANDPOINT_87308_CFG_OUTB(0x60, 0x07); /* Base address 0x700 */
384 SANDPOINT_87308_CFG_OUTB(0x61, 0x00);
385 SANDPOINT_87308_CFG_OUTB(0x30, 0x01); /* Enable */
386
387 /* Now, set pin 7 to output and pin 6 to input. */
388 outb((inb(0x701) | 0x80) & 0xbf, 0x701);
389 /* Set push-pull output */
390 outb(inb(0x702) | 0x80, 0x702);
391 /* Set pull-up on input */
392 outb(inb(0x703) | 0x40, 0x703);
393 /* Set output high and check */
394 x = inb(0x700);
395 outb(x | 0x80, 0x700);
396 x = inb(0x700);
397 sandpoint_is_x2 = ! (x & 0x40);
398 if (ppc_md.progress && sandpoint_is_x2)
399 ppc_md.progress("High output says X2", 0);
400 /* Set output low and check */
401 outb(x & 0x7f, 0x700);
402 sandpoint_is_x2 |= inb(0x700) & 0x40;
403 if (ppc_md.progress && sandpoint_is_x2)
404 ppc_md.progress("Low output says X2", 0);
405 if (ppc_md.progress && ! sandpoint_is_x2)
406 ppc_md.progress("Sandpoint is X3", 0);
407}
408
409/*
410 * Fix IDE interrupts.
411 */
412static int __init
413sandpoint_fix_winbond_83553(void)
414{
415 /* Make some 8259 interrupt level sensitive */
416 outb(0xe0, 0x4d0);
417 outb(0xde, 0x4d1);
418
419 return 0;
420}
421
422arch_initcall(sandpoint_fix_winbond_83553);
423
424/*
425 * Initialize the ISA devices on the Nat'l PC87308VUL SuperIO chip.
426 */
427static int __init
428sandpoint_setup_natl_87308(void)
429{
430 u_char reg;
431
432 /*
433 * Enable all the devices on the Super I/O chip.
434 */
435 SANDPOINT_87308_SELECT_DEV(0x00); /* Select kbd logical device */
436 SANDPOINT_87308_CFG_OUTB(0xf0, 0x00); /* Set KBC clock to 8 Mhz */
437 SANDPOINT_87308_DEV_ENABLE(0x00); /* Enable keyboard */
438 SANDPOINT_87308_DEV_ENABLE(0x01); /* Enable mouse */
439 SANDPOINT_87308_DEV_ENABLE(0x02); /* Enable rtc */
440 SANDPOINT_87308_DEV_ENABLE(0x03); /* Enable fdc (floppy) */
441 SANDPOINT_87308_DEV_ENABLE(0x04); /* Enable parallel */
442 SANDPOINT_87308_DEV_ENABLE(0x05); /* Enable UART 2 */
443 SANDPOINT_87308_CFG_OUTB(0xf0, 0x82); /* Enable bank select regs */
444 SANDPOINT_87308_DEV_ENABLE(0x06); /* Enable UART 1 */
445 SANDPOINT_87308_CFG_OUTB(0xf0, 0x82); /* Enable bank select regs */
446
447 /* Set up floppy in PS/2 mode */
448 outb(0x09, SIO_CONFIG_RA);
449 reg = inb(SIO_CONFIG_RD);
450 reg = (reg & 0x3F) | 0x40;
451 outb(reg, SIO_CONFIG_RD);
452 outb(reg, SIO_CONFIG_RD); /* Have to write twice to change! */
453
454 return 0;
455}
456
457arch_initcall(sandpoint_setup_natl_87308);
458
459static int __init
460sandpoint_request_io(void)
461{
462 request_region(0x00,0x20,"dma1");
463 request_region(0x20,0x20,"pic1");
464 request_region(0x40,0x20,"timer");
465 request_region(0x80,0x10,"dma page reg");
466 request_region(0xa0,0x20,"pic2");
467 request_region(0xc0,0x20,"dma2");
468
469 return 0;
470}
471
472arch_initcall(sandpoint_request_io);
473
474/*
475 * Interrupt setup and service. Interrupts on the Sandpoint come
476 * from the four PCI slots plus the 8259 in the Winbond Super I/O (SIO).
477 * The 8259 is cascaded from EPIC IRQ0, IRQ1-4 map to PCI slots 1-4,
478 * IDE is on EPIC 7 and 8.
479 */
480static void __init
481sandpoint_init_IRQ(void)
482{
483 int i;
484
485 OpenPIC_InitSenses = sandpoint_openpic_initsenses;
486 OpenPIC_NumInitSenses = sizeof(sandpoint_openpic_initsenses);
487
488 mpc10x_set_openpic();
489 openpic_hookup_cascade(sandpoint_is_x2 ? 17 : NUM_8259_INTERRUPTS, "82c59 cascade",
490 i8259_irq);
491
492 /*
493 * The EPIC allows for a read in the range of 0xFEF00000 ->
494 * 0xFEFFFFFF to generate a PCI interrupt-acknowledge transaction.
495 */
496 i8259_init(0xfef00000, 0);
497}
498
499static unsigned long __init
500sandpoint_find_end_of_memory(void)
501{
502 bd_t *bp = (bd_t *)__res;
503
504 if (bp->bi_memsize)
505 return bp->bi_memsize;
506
507 /* DINK32 13.0 correctly initializes things, so iff you use
508 * this you _should_ be able to change this instead of a
509 * hardcoded value. */
510#if 0
511 return mpc10x_get_mem_size(MPC10X_MEM_MAP_B);
512#else
513 return 32*1024*1024;
514#endif
515}
516
517static void __init
518sandpoint_map_io(void)
519{
520 io_block_mapping(0xfe000000, 0xfe000000, 0x02000000, _PAGE_IO);
521}
522
523static void
524sandpoint_restart(char *cmd)
525{
526 local_irq_disable();
527
528 /* Set exception prefix high - to the firmware */
529 _nmask_and_or_msr(0, MSR_IP);
530
531 /* Reset system via Port 92 */
532 outb(0x00, 0x92);
533 outb(0x01, 0x92);
534 for(;;); /* Spin until reset happens */
535}
536
537static void
538sandpoint_power_off(void)
539{
540 local_irq_disable();
541 for(;;); /* No way to shut power off with software */
542 /* NOTREACHED */
543}
544
545static void
546sandpoint_halt(void)
547{
548 sandpoint_power_off();
549 /* NOTREACHED */
550}
551
552static int
553sandpoint_show_cpuinfo(struct seq_file *m)
554{
555 seq_printf(m, "vendor\t\t: Motorola SPS\n");
556 seq_printf(m, "machine\t\t: Sandpoint\n");
557
558 return 0;
559}
560
561/*
562 * Set BAT 3 to map 0xf8000000 to end of physical memory space 1-to-1.
563 */
564static __inline__ void
565sandpoint_set_bat(void)
566{
567 unsigned long bat3u, bat3l;
568
569 __asm__ __volatile__(
570 " lis %0,0xf800\n \
571 ori %1,%0,0x002a\n \
572 ori %0,%0,0x0ffe\n \
573 mtspr 0x21e,%0\n \
574 mtspr 0x21f,%1\n \
575 isync\n \
576 sync "
577 : "=r" (bat3u), "=r" (bat3l));
578}
579
580TODC_ALLOC();
581
582void __init
583platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
584 unsigned long r6, unsigned long r7)
585{
586 parse_bootinfo(find_bootinfo());
587
588 /* ASSUMPTION: If both r3 (bd_t pointer) and r6 (cmdline pointer)
589 * are non-zero, then we should use the board info from the bd_t
590 * structure and the cmdline pointed to by r6 instead of the
591 * information from birecs, if any. Otherwise, use the information
592 * from birecs as discovered by the preceding call to
593 * parse_bootinfo(). This rule should work with both PPCBoot, which
594 * uses a bd_t board info structure, and the kernel boot wrapper,
595 * which uses birecs.
596 */
597 if (r3 && r6) {
598 /* copy board info structure */
599 memcpy( (void *)__res,(void *)(r3+KERNELBASE), sizeof(bd_t) );
600 /* copy command line */
601 *(char *)(r7+KERNELBASE) = 0;
602 strcpy(cmd_line, (char *)(r6+KERNELBASE));
603 }
604
605#ifdef CONFIG_BLK_DEV_INITRD
606 /* take care of initrd if we have one */
607 if (r4) {
608 initrd_start = r4 + KERNELBASE;
609 initrd_end = r5 + KERNELBASE;
610 }
611#endif /* CONFIG_BLK_DEV_INITRD */
612
613 /* Map in board regs, etc. */
614 sandpoint_set_bat();
615
616 isa_io_base = MPC10X_MAPB_ISA_IO_BASE;
617 isa_mem_base = MPC10X_MAPB_ISA_MEM_BASE;
618 pci_dram_offset = MPC10X_MAPB_DRAM_OFFSET;
619 ISA_DMA_THRESHOLD = 0x00ffffff;
620 DMA_MODE_READ = 0x44;
621 DMA_MODE_WRITE = 0x48;
622 ppc_do_canonicalize_irqs = 1;
623
624 ppc_md.setup_arch = sandpoint_setup_arch;
625 ppc_md.show_cpuinfo = sandpoint_show_cpuinfo;
626 ppc_md.init_IRQ = sandpoint_init_IRQ;
627 ppc_md.get_irq = openpic_get_irq;
628
629 ppc_md.restart = sandpoint_restart;
630 ppc_md.power_off = sandpoint_power_off;
631 ppc_md.halt = sandpoint_halt;
632
633 ppc_md.find_end_of_memory = sandpoint_find_end_of_memory;
634 ppc_md.setup_io_mappings = sandpoint_map_io;
635
636 TODC_INIT(TODC_TYPE_PC97307, 0x70, 0x00, 0x71, 8);
637 ppc_md.time_init = todc_time_init;
638 ppc_md.set_rtc_time = todc_set_rtc_time;
639 ppc_md.get_rtc_time = todc_get_rtc_time;
640 ppc_md.calibrate_decr = todc_calibrate_decr;
641
642 ppc_md.nvram_read_val = todc_mc146818_read_val;
643 ppc_md.nvram_write_val = todc_mc146818_write_val;
644
645#ifdef CONFIG_KGDB
646 ppc_md.kgdb_map_scc = gen550_kgdb_map_scc;
647#endif
648#ifdef CONFIG_SERIAL_TEXT_DEBUG
649 ppc_md.progress = gen550_progress;
650#endif
651}
diff --git a/arch/ppc/platforms/sandpoint.h b/arch/ppc/platforms/sandpoint.h
deleted file mode 100644
index ed83759e4044..000000000000
--- a/arch/ppc/platforms/sandpoint.h
+++ /dev/null
@@ -1,75 +0,0 @@
1/*
2 * Definitions for Motorola SPS Sandpoint Test Platform
3 *
4 * Author: Mark A. Greer
5 * mgreer@mvista.com
6 *
7 * 2000-2003 (c) MontaVista, Software, Inc. This file is licensed under
8 * the terms of the GNU General Public License version 2. This program
9 * is licensed "as is" without any warranty of any kind, whether express
10 * or implied.
11 */
12
13/*
14 * Sandpoint uses the CHRP map (Map B).
15 */
16
17#ifndef __PPC_PLATFORMS_SANDPOINT_H
18#define __PPC_PLATFORMS_SANDPOINT_H
19
20#include <asm/ppcboot.h>
21
22#if 0
23/* The Sandpoint X3 allows the IDE interrupt to be directly connected
24 * from the Windbond (PCI INTC or INTD) to the serial EPIC. Someday
25 * we should try this, but it was easier to use the existing 83c553
26 * initialization than change it to route the different interrupts :-).
27 * -- Dan
28 */
29#define SANDPOINT_IDE_INT0 23 /* EPIC 7 */
30#define SANDPOINT_IDE_INT1 24 /* EPIC 8 */
31#endif
32
33/*
34 * The sandpoint boards have processor modules that either have an 8240 or
35 * an MPC107 host bridge on them. These bridges have an IDSEL line that allows
36 * them to respond to PCI transactions as if they were a normal PCI devices.
37 * However, the processor on the processor side of the bridge can not reach
38 * out onto the PCI bus and then select the bridge or bad things will happen
39 * (documented in the 8240 and 107 manuals).
40 * Because of this, we always skip the bridge PCI device when accessing the
41 * PCI bus. The PCI slot that the bridge occupies is defined by the macro
42 * below.
43 */
44#define SANDPOINT_HOST_BRIDGE_IDSEL 12
45
46/*
47 * Serial defines.
48 */
49#define SANDPOINT_SERIAL_0 0xfe0003f8
50#define SANDPOINT_SERIAL_1 0xfe0002f8
51
52#define RS_TABLE_SIZE 2
53
54/* Rate for the 1.8432 Mhz clock for the onboard serial chip */
55#define BASE_BAUD ( 1843200 / 16 )
56#define UART_CLK 1843200
57
58#ifdef CONFIG_SERIAL_DETECT_IRQ
59#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF|ASYNC_AUTO_IRQ)
60#else
61#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF)
62#endif
63
64#define STD_SERIAL_PORT_DFNS \
65 { 0, BASE_BAUD, SANDPOINT_SERIAL_0, 4, STD_COM_FLAGS, /* ttyS0 */ \
66 iomem_base: (u8 *)SANDPOINT_SERIAL_0, \
67 io_type: SERIAL_IO_MEM }, \
68 { 0, BASE_BAUD, SANDPOINT_SERIAL_1, 3, STD_COM_FLAGS, /* ttyS1 */ \
69 iomem_base: (u8 *)SANDPOINT_SERIAL_1, \
70 io_type: SERIAL_IO_MEM },
71
72#define SERIAL_PORT_DFNS \
73 STD_SERIAL_PORT_DFNS
74
75#endif /* __PPC_PLATFORMS_SANDPOINT_H */
diff --git a/arch/ppc/platforms/sbc82xx.c b/arch/ppc/platforms/sbc82xx.c
deleted file mode 100644
index 24f6e0694ac1..000000000000
--- a/arch/ppc/platforms/sbc82xx.c
+++ /dev/null
@@ -1,256 +0,0 @@
1/*
2 * SBC82XX platform support
3 *
4 * Author: Guy Streeter <streeter@redhat.com>
5 *
6 * Derived from: est8260_setup.c by Allen Curtis, ONZ
7 *
8 * Copyright 2004 Red Hat, Inc.
9 *
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the
12 * Free Software Foundation; either version 2 of the License, or (at your
13 * option) any later version.
14 */
15
16#include <linux/stddef.h>
17#include <linux/interrupt.h>
18#include <linux/irq.h>
19#include <linux/init.h>
20#include <linux/pci.h>
21
22#include <asm/mpc8260.h>
23#include <asm/machdep.h>
24#include <asm/io.h>
25#include <asm/todc.h>
26#include <asm/immap_cpm2.h>
27#include <asm/pci.h>
28
29static void (*callback_init_IRQ)(void);
30
31extern unsigned char __res[sizeof(bd_t)];
32
33#ifdef CONFIG_GEN_RTC
34TODC_ALLOC();
35
36/*
37 * Timer init happens before mem_init but after paging init, so we cannot
38 * directly use ioremap() at that time.
39 * late_time_init() is call after paging init.
40 */
41
42static void sbc82xx_time_init(void)
43{
44 volatile memctl_cpm2_t *mc = &cpm2_immr->im_memctl;
45
46 /* Set up CS11 for RTC chip */
47 mc->memc_br11=0;
48 mc->memc_or11=0xffff0836;
49 mc->memc_br11=SBC82xx_TODC_NVRAM_ADDR | 0x0801;
50
51 TODC_INIT(TODC_TYPE_MK48T59, 0, 0, SBC82xx_TODC_NVRAM_ADDR, 0);
52
53 todc_info->nvram_data =
54 (unsigned int)ioremap(todc_info->nvram_data, 0x2000);
55 BUG_ON(!todc_info->nvram_data);
56 ppc_md.get_rtc_time = todc_get_rtc_time;
57 ppc_md.set_rtc_time = todc_set_rtc_time;
58 ppc_md.nvram_read_val = todc_direct_read_val;
59 ppc_md.nvram_write_val = todc_direct_write_val;
60 todc_time_init();
61}
62#endif /* CONFIG_GEN_RTC */
63
64static volatile char *sbc82xx_i8259_map;
65static char sbc82xx_i8259_mask = 0xff;
66static DEFINE_SPINLOCK(sbc82xx_i8259_lock);
67
68static void sbc82xx_i8259_mask_and_ack_irq(unsigned int irq_nr)
69{
70 unsigned long flags;
71
72 irq_nr -= NR_SIU_INTS;
73
74 spin_lock_irqsave(&sbc82xx_i8259_lock, flags);
75 sbc82xx_i8259_mask |= 1 << irq_nr;
76 (void) sbc82xx_i8259_map[1]; /* Dummy read */
77 sbc82xx_i8259_map[1] = sbc82xx_i8259_mask;
78 sbc82xx_i8259_map[0] = 0x20; /* OCW2: Non-specific EOI */
79 spin_unlock_irqrestore(&sbc82xx_i8259_lock, flags);
80}
81
82static void sbc82xx_i8259_mask_irq(unsigned int irq_nr)
83{
84 unsigned long flags;
85
86 irq_nr -= NR_SIU_INTS;
87
88 spin_lock_irqsave(&sbc82xx_i8259_lock, flags);
89 sbc82xx_i8259_mask |= 1 << irq_nr;
90 sbc82xx_i8259_map[1] = sbc82xx_i8259_mask;
91 spin_unlock_irqrestore(&sbc82xx_i8259_lock, flags);
92}
93
94static void sbc82xx_i8259_unmask_irq(unsigned int irq_nr)
95{
96 unsigned long flags;
97
98 irq_nr -= NR_SIU_INTS;
99
100 spin_lock_irqsave(&sbc82xx_i8259_lock, flags);
101 sbc82xx_i8259_mask &= ~(1 << irq_nr);
102 sbc82xx_i8259_map[1] = sbc82xx_i8259_mask;
103 spin_unlock_irqrestore(&sbc82xx_i8259_lock, flags);
104}
105
106static void sbc82xx_i8259_end_irq(unsigned int irq)
107{
108 if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS))
109 && irq_desc[irq].action)
110 sbc82xx_i8259_unmask_irq(irq);
111}
112
113
114struct hw_interrupt_type sbc82xx_i8259_ic = {
115 .typename = " i8259 ",
116 .enable = sbc82xx_i8259_unmask_irq,
117 .disable = sbc82xx_i8259_mask_irq,
118 .ack = sbc82xx_i8259_mask_and_ack_irq,
119 .end = sbc82xx_i8259_end_irq,
120};
121
122static irqreturn_t sbc82xx_i8259_demux(int dummy, void *dev_id)
123{
124 int irq;
125
126 spin_lock(&sbc82xx_i8259_lock);
127
128 sbc82xx_i8259_map[0] = 0x0c; /* OCW3: Read IR register on RD# pulse */
129 irq = sbc82xx_i8259_map[0] & 7; /* Read IRR */
130
131 if (irq == 7) {
132 /* Possible spurious interrupt */
133 int isr;
134 sbc82xx_i8259_map[0] = 0x0b; /* OCW3: Read IS register on RD# pulse */
135 isr = sbc82xx_i8259_map[0]; /* Read ISR */
136
137 if (!(isr & 0x80)) {
138 printk(KERN_INFO "Spurious i8259 interrupt\n");
139 return IRQ_HANDLED;
140 }
141 }
142 __do_IRQ(NR_SIU_INTS + irq);
143 return IRQ_HANDLED;
144}
145
146static struct irqaction sbc82xx_i8259_irqaction = {
147 .handler = sbc82xx_i8259_demux,
148 .flags = IRQF_DISABLED,
149 .mask = CPU_MASK_NONE,
150 .name = "i8259 demux",
151};
152
153void __init sbc82xx_init_IRQ(void)
154{
155 volatile memctl_cpm2_t *mc = &cpm2_immr->im_memctl;
156 volatile intctl_cpm2_t *ic = &cpm2_immr->im_intctl;
157 int i;
158
159 callback_init_IRQ();
160
161 /* u-boot doesn't always set the board up correctly */
162 mc->memc_br5 = 0;
163 mc->memc_or5 = 0xfff00856;
164 mc->memc_br5 = 0x22000801;
165
166 sbc82xx_i8259_map = ioremap(0x22008000, 2);
167 if (!sbc82xx_i8259_map) {
168 printk(KERN_CRIT "Mapping i8259 interrupt controller failed\n");
169 return;
170 }
171
172 /* Set up the interrupt handlers for the i8259 IRQs */
173 for (i = NR_SIU_INTS; i < NR_SIU_INTS + 8; i++) {
174 irq_desc[i].chip = &sbc82xx_i8259_ic;
175 irq_desc[i].status |= IRQ_LEVEL;
176 }
177
178 /* make IRQ6 level sensitive */
179 ic->ic_siexr &= ~(1 << (14 - (SIU_INT_IRQ6 - SIU_INT_IRQ1)));
180 irq_desc[SIU_INT_IRQ6].status |= IRQ_LEVEL;
181
182 /* Initialise the i8259 */
183 sbc82xx_i8259_map[0] = 0x1b; /* ICW1: Level, no cascade, ICW4 */
184 sbc82xx_i8259_map[1] = 0x00; /* ICW2: vector base */
185 /* No ICW3 (no cascade) */
186 sbc82xx_i8259_map[1] = 0x01; /* ICW4: 8086 mode, normal EOI */
187
188 sbc82xx_i8259_map[0] = 0x0b; /* OCW3: Read IS register on RD# pulse */
189
190 sbc82xx_i8259_map[1] = sbc82xx_i8259_mask; /* Set interrupt mask */
191
192 /* Request cascade IRQ */
193 if (setup_irq(SIU_INT_IRQ6, &sbc82xx_i8259_irqaction)) {
194 printk("Installation of i8259 IRQ demultiplexer failed.\n");
195 }
196}
197
198static int sbc82xx_pci_map_irq(struct pci_dev *dev, unsigned char idsel,
199 unsigned char pin)
200{
201 static char pci_irq_table[][4] = {
202 /*
203 * PCI IDSEL/INTPIN->INTLINE
204 * A B C D
205 */
206 { SBC82xx_PIRQA, SBC82xx_PIRQB, SBC82xx_PIRQC, SBC82xx_PIRQD }, /* IDSEL 16 - PMC slot */
207 { SBC82xx_PC_IRQA, SBC82xx_PC_IRQB, -1, -1 }, /* IDSEL 17 - CardBus */
208 { SBC82xx_PIRQA, SBC82xx_PIRQB, SBC82xx_PIRQC, SBC82xx_PIRQD }, /* IDSEL 18 - PCI-X bridge */
209 };
210
211 const long min_idsel = 16, max_idsel = 18, irqs_per_slot = 4;
212
213 return PCI_IRQ_TABLE_LOOKUP;
214}
215
216static void __devinit quirk_sbc8260_cardbus(struct pci_dev *pdev)
217{
218 uint32_t ctrl;
219
220 if (pdev->bus->number != 0 || pdev->devfn != PCI_DEVFN(17, 0))
221 return;
222
223 printk(KERN_INFO "Setting up CardBus controller\n");
224
225 /* Set P2CCLK bit in System Control Register */
226 pci_read_config_dword(pdev, 0x80, &ctrl);
227 ctrl |= (1<<27);
228 pci_write_config_dword(pdev, 0x80, ctrl);
229
230 /* Set MFUNC up for PCI IRQ routing via INTA and INTB, and LEDs. */
231 pci_write_config_dword(pdev, 0x8c, 0x00c01d22);
232
233}
234DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_1420, quirk_sbc8260_cardbus);
235
236void __init
237m82xx_board_init(void)
238{
239 /* u-boot may be using one of the FCC Ethernet devices.
240 Use the MAC address to the SCC. */
241 __res[offsetof(bd_t, bi_enetaddr[5])] &= ~3;
242
243 /* Anything special for this platform */
244 callback_init_IRQ = ppc_md.init_IRQ;
245
246 ppc_md.init_IRQ = sbc82xx_init_IRQ;
247 ppc_md.pci_map_irq = sbc82xx_pci_map_irq;
248#ifdef CONFIG_GEN_RTC
249 ppc_md.time_init = NULL;
250 ppc_md.get_rtc_time = NULL;
251 ppc_md.set_rtc_time = NULL;
252 ppc_md.nvram_read_val = NULL;
253 ppc_md.nvram_write_val = NULL;
254 late_time_init = sbc82xx_time_init;
255#endif /* CONFIG_GEN_RTC */
256}
diff --git a/arch/ppc/platforms/sbc82xx.h b/arch/ppc/platforms/sbc82xx.h
deleted file mode 100644
index e4042d4995f6..000000000000
--- a/arch/ppc/platforms/sbc82xx.h
+++ /dev/null
@@ -1,36 +0,0 @@
1/* Board information for the SBCPowerQUICCII, which should be generic for
2 * all 8260 boards. The IMMR is now given to us so the hard define
3 * will soon be removed. All of the clock values are computed from
4 * the configuration SCMR and the Power-On-Reset word.
5 */
6
7#ifndef __PPC_SBC82xx_H__
8#define __PPC_SBC82xx_H__
9
10#include <asm/ppcboot.h>
11
12#define CPM_MAP_ADDR 0xf0000000
13
14#define SBC82xx_TODC_NVRAM_ADDR 0xd0000000
15
16#define SBC82xx_MACADDR_NVRAM_FCC1 0x220000c9 /* JP6B */
17#define SBC82xx_MACADDR_NVRAM_SCC1 0x220000cf /* JP6A */
18#define SBC82xx_MACADDR_NVRAM_FCC2 0x220000d5 /* JP7A */
19#define SBC82xx_MACADDR_NVRAM_FCC3 0x220000db /* JP7B */
20
21/* For our show_cpuinfo hooks. */
22#define CPUINFO_VENDOR "Wind River"
23#define CPUINFO_MACHINE "SBC PowerQUICC II"
24
25#define BOOTROM_RESTART_ADDR ((uint)0x40000104)
26
27#define SBC82xx_PC_IRQA (NR_SIU_INTS+0)
28#define SBC82xx_PC_IRQB (NR_SIU_INTS+1)
29#define SBC82xx_MPC185_IRQ (NR_SIU_INTS+2)
30#define SBC82xx_ATM_IRQ (NR_SIU_INTS+3)
31#define SBC82xx_PIRQA (NR_SIU_INTS+4)
32#define SBC82xx_PIRQB (NR_SIU_INTS+5)
33#define SBC82xx_PIRQC (NR_SIU_INTS+6)
34#define SBC82xx_PIRQD (NR_SIU_INTS+7)
35
36#endif /* __PPC_SBC82xx_H__ */
diff --git a/arch/ppc/platforms/sbs8260.h b/arch/ppc/platforms/sbs8260.h
deleted file mode 100644
index d51427a0f0d4..000000000000
--- a/arch/ppc/platforms/sbs8260.h
+++ /dev/null
@@ -1,28 +0,0 @@
1#ifndef __ASSEMBLY__
2/* Board information for various SBS 8260 cards, which should be generic for
3 * all 8260 boards. The IMMR is now given to us so the hard define
4 * will soon be removed. All of the clock values are computed from
5 * the configuration SCMR and the Power-On-Reset word.
6 */
7
8#define CPM_MAP_ADDR ((uint)0xfe000000)
9
10
11/* A Board Information structure that is given to a program when
12 * prom starts it up.
13 */
14typedef struct bd_info {
15 unsigned int bi_memstart; /* Memory start address */
16 unsigned int bi_memsize; /* Memory (end) size in bytes */
17 unsigned int bi_intfreq; /* Internal Freq, in Hz */
18 unsigned int bi_busfreq; /* Bus Freq, in MHz */
19 unsigned int bi_cpmfreq; /* CPM Freq, in MHz */
20 unsigned int bi_brgfreq; /* BRG Freq, in MHz */
21 unsigned int bi_vco; /* VCO Out from PLL */
22 unsigned int bi_baudrate; /* Default console baud rate */
23 unsigned int bi_immr; /* IMMR when called from boot rom */
24 unsigned char bi_enetaddr[6];
25} bd_t;
26
27extern bd_t m8xx_board_info;
28#endif /* !__ASSEMBLY__ */
diff --git a/arch/ppc/platforms/spruce.c b/arch/ppc/platforms/spruce.c
deleted file mode 100644
index a344134f14b8..000000000000
--- a/arch/ppc/platforms/spruce.c
+++ /dev/null
@@ -1,322 +0,0 @@
1/*
2 * Board and PCI setup routines for IBM Spruce
3 *
4 * Author: MontaVista Software <source@mvista.com>
5 *
6 * 2000-2004 (c) MontaVista, Software, Inc. This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10 */
11
12#include <linux/stddef.h>
13#include <linux/kernel.h>
14#include <linux/init.h>
15#include <linux/errno.h>
16#include <linux/reboot.h>
17#include <linux/pci.h>
18#include <linux/kdev_t.h>
19#include <linux/types.h>
20#include <linux/major.h>
21#include <linux/initrd.h>
22#include <linux/console.h>
23#include <linux/delay.h>
24#include <linux/seq_file.h>
25#include <linux/root_dev.h>
26#include <linux/serial.h>
27#include <linux/tty.h>
28#include <linux/serial_core.h>
29#include <linux/serial_8250.h>
30
31#include <asm/system.h>
32#include <asm/pgtable.h>
33#include <asm/page.h>
34#include <asm/dma.h>
35#include <asm/io.h>
36#include <asm/machdep.h>
37#include <asm/time.h>
38#include <asm/todc.h>
39#include <asm/bootinfo.h>
40#include <asm/kgdb.h>
41
42#include <syslib/cpc700.h>
43
44#include "spruce.h"
45
46static inline int
47spruce_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
48{
49 static char pci_irq_table[][4] =
50 /*
51 * PCI IDSEL/INTPIN->INTLINE
52 * A B C D
53 */
54 {
55 {23, 24, 25, 26}, /* IDSEL 1 - PCI slot 3 */
56 {24, 25, 26, 23}, /* IDSEL 2 - PCI slot 2 */
57 {25, 26, 23, 24}, /* IDSEL 3 - PCI slot 1 */
58 {26, 23, 24, 25}, /* IDSEL 4 - PCI slot 0 */
59 };
60
61 const long min_idsel = 1, max_idsel = 4, irqs_per_slot = 4;
62 return PCI_IRQ_TABLE_LOOKUP;
63}
64
65static void __init
66spruce_setup_hose(void)
67{
68 struct pci_controller *hose;
69
70 /* Setup hose */
71 hose = pcibios_alloc_controller();
72 if (!hose)
73 return;
74
75 hose->first_busno = 0;
76 hose->last_busno = 0xff;
77
78 pci_init_resource(&hose->io_resource,
79 SPRUCE_PCI_LOWER_IO,
80 SPRUCE_PCI_UPPER_IO,
81 IORESOURCE_IO,
82 "PCI host bridge");
83
84 pci_init_resource(&hose->mem_resources[0],
85 SPRUCE_PCI_LOWER_MEM,
86 SPRUCE_PCI_UPPER_MEM,
87 IORESOURCE_MEM,
88 "PCI host bridge");
89
90 hose->io_space.start = SPRUCE_PCI_LOWER_IO;
91 hose->io_space.end = SPRUCE_PCI_UPPER_IO;
92 hose->mem_space.start = SPRUCE_PCI_LOWER_MEM;
93 hose->mem_space.end = SPRUCE_PCI_UPPER_MEM;
94 hose->io_base_virt = (void *)SPRUCE_ISA_IO_BASE;
95
96 setup_indirect_pci(hose,
97 SPRUCE_PCI_CONFIG_ADDR,
98 SPRUCE_PCI_CONFIG_DATA);
99
100 hose->last_busno = pciauto_bus_scan(hose, hose->first_busno);
101
102 ppc_md.pci_swizzle = common_swizzle;
103 ppc_md.pci_map_irq = spruce_map_irq;
104}
105
106/*
107 * CPC700 PIC interrupt programming table
108 *
109 * First entry is the sensitivity (level/edge), second is the polarity.
110 */
111unsigned int cpc700_irq_assigns[32][2] = {
112 { 1, 1 }, /* IRQ 0: ECC Correctable Error - rising edge */
113 { 1, 1 }, /* IRQ 1: PCI Write Mem Range - rising edge */
114 { 0, 1 }, /* IRQ 2: PCI Write Command Reg - active high */
115 { 0, 1 }, /* IRQ 3: UART 0 - active high */
116 { 0, 1 }, /* IRQ 4: UART 1 - active high */
117 { 0, 1 }, /* IRQ 5: ICC 0 - active high */
118 { 0, 1 }, /* IRQ 6: ICC 1 - active high */
119 { 0, 1 }, /* IRQ 7: GPT Compare 0 - active high */
120 { 0, 1 }, /* IRQ 8: GPT Compare 1 - active high */
121 { 0, 1 }, /* IRQ 9: GPT Compare 2 - active high */
122 { 0, 1 }, /* IRQ 10: GPT Compare 3 - active high */
123 { 0, 1 }, /* IRQ 11: GPT Compare 4 - active high */
124 { 0, 1 }, /* IRQ 12: GPT Capture 0 - active high */
125 { 0, 1 }, /* IRQ 13: GPT Capture 1 - active high */
126 { 0, 1 }, /* IRQ 14: GPT Capture 2 - active high */
127 { 0, 1 }, /* IRQ 15: GPT Capture 3 - active high */
128 { 0, 1 }, /* IRQ 16: GPT Capture 4 - active high */
129 { 0, 0 }, /* IRQ 17: Reserved */
130 { 0, 0 }, /* IRQ 18: Reserved */
131 { 0, 0 }, /* IRQ 19: Reserved */
132 { 0, 1 }, /* IRQ 20: FPGA EXT_IRQ0 - active high */
133 { 1, 1 }, /* IRQ 21: Mouse - rising edge */
134 { 1, 1 }, /* IRQ 22: Keyboard - rising edge */
135 { 0, 0 }, /* IRQ 23: PCI Slot 3 - active low */
136 { 0, 0 }, /* IRQ 24: PCI Slot 2 - active low */
137 { 0, 0 }, /* IRQ 25: PCI Slot 1 - active low */
138 { 0, 0 }, /* IRQ 26: PCI Slot 0 - active low */
139};
140
141static void __init
142spruce_calibrate_decr(void)
143{
144 int freq, divisor = 4;
145
146 /* determine processor bus speed */
147 freq = SPRUCE_BUS_SPEED;
148 tb_ticks_per_jiffy = freq / HZ / divisor;
149 tb_to_us = mulhwu_scale_factor(freq/divisor, 1000000);
150}
151
152static int
153spruce_show_cpuinfo(struct seq_file *m)
154{
155 seq_printf(m, "vendor\t\t: IBM\n");
156 seq_printf(m, "machine\t\t: Spruce\n");
157
158 return 0;
159}
160
161static void __init
162spruce_early_serial_map(void)
163{
164 u32 uart_clk;
165 struct uart_port serial_req;
166
167 if (SPRUCE_UARTCLK_IS_33M(readb(SPRUCE_FPGA_REG_A)))
168 uart_clk = SPRUCE_BAUD_33M * 16;
169 else
170 uart_clk = SPRUCE_BAUD_30M * 16;
171
172 /* Setup serial port access */
173 memset(&serial_req, 0, sizeof(serial_req));
174 serial_req.uartclk = uart_clk;
175 serial_req.irq = UART0_INT;
176 serial_req.flags = UPF_BOOT_AUTOCONF;
177 serial_req.iotype = UPIO_MEM;
178 serial_req.membase = (u_char *)UART0_IO_BASE;
179 serial_req.regshift = 0;
180
181#if defined(CONFIG_KGDB) || defined(CONFIG_SERIAL_TEXT_DEBUG)
182 gen550_init(0, &serial_req);
183#endif
184#ifdef CONFIG_SERIAL_8250
185 if (early_serial_setup(&serial_req) != 0)
186 printk("Early serial init of port 0 failed\n");
187#endif
188
189 /* Assume early_serial_setup() doesn't modify serial_req */
190 serial_req.line = 1;
191 serial_req.irq = UART1_INT;
192 serial_req.membase = (u_char *)UART1_IO_BASE;
193
194#if defined(CONFIG_KGDB) || defined(CONFIG_SERIAL_TEXT_DEBUG)
195 gen550_init(1, &serial_req);
196#endif
197#ifdef CONFIG_SERIAL_8250
198 if (early_serial_setup(&serial_req) != 0)
199 printk("Early serial init of port 1 failed\n");
200#endif
201}
202
203TODC_ALLOC();
204
205static void __init
206spruce_setup_arch(void)
207{
208 /* Setup TODC access */
209 TODC_INIT(TODC_TYPE_DS1643, 0, 0, SPRUCE_RTC_BASE_ADDR, 8);
210
211 /* init to some ~sane value until calibrate_delay() runs */
212 loops_per_jiffy = 50000000 / HZ;
213
214 /* Setup PCI host bridge */
215 spruce_setup_hose();
216
217#ifdef CONFIG_BLK_DEV_INITRD
218 if (initrd_start)
219 ROOT_DEV = Root_RAM0;
220 else
221#endif
222#ifdef CONFIG_ROOT_NFS
223 ROOT_DEV = Root_NFS;
224#else
225 ROOT_DEV = Root_SDA1;
226#endif
227
228 /* Identify the system */
229 printk(KERN_INFO "System Identification: IBM Spruce\n");
230 printk(KERN_INFO "Port by MontaVista Software, Inc. (source@mvista.com)\n");
231}
232
233static void
234spruce_restart(char *cmd)
235{
236 local_irq_disable();
237
238 /* SRR0 has system reset vector, SRR1 has default MSR value */
239 /* rfi restores MSR from SRR1 and sets the PC to the SRR0 value */
240 __asm__ __volatile__
241 ("\n\
242 lis 3,0xfff0 \n\
243 ori 3,3,0x0100 \n\
244 mtspr 26,3 \n\
245 li 3,0 \n\
246 mtspr 27,3 \n\
247 rfi \n\
248 ");
249 for(;;);
250}
251
252static void
253spruce_power_off(void)
254{
255 for(;;);
256}
257
258static void
259spruce_halt(void)
260{
261 spruce_restart(NULL);
262}
263
264static void __init
265spruce_map_io(void)
266{
267 io_block_mapping(SPRUCE_PCI_IO_BASE, SPRUCE_PCI_PHY_IO_BASE,
268 0x08000000, _PAGE_IO);
269}
270
271/*
272 * Set BAT 3 to map 0xf8000000 to end of physical memory space 1-to-1.
273 */
274static __inline__ void
275spruce_set_bat(void)
276{
277 mb();
278 mtspr(SPRN_DBAT1U, 0xf8000ffe);
279 mtspr(SPRN_DBAT1L, 0xf800002a);
280 mb();
281}
282
283void __init
284platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
285 unsigned long r6, unsigned long r7)
286{
287 parse_bootinfo(find_bootinfo());
288
289 /* Map in board regs, etc. */
290 spruce_set_bat();
291
292 isa_io_base = SPRUCE_ISA_IO_BASE;
293 pci_dram_offset = SPRUCE_PCI_SYS_MEM_BASE;
294
295 ppc_md.setup_arch = spruce_setup_arch;
296 ppc_md.show_cpuinfo = spruce_show_cpuinfo;
297 ppc_md.init_IRQ = cpc700_init_IRQ;
298 ppc_md.get_irq = cpc700_get_irq;
299
300 ppc_md.setup_io_mappings = spruce_map_io;
301
302 ppc_md.restart = spruce_restart;
303 ppc_md.power_off = spruce_power_off;
304 ppc_md.halt = spruce_halt;
305
306 ppc_md.time_init = todc_time_init;
307 ppc_md.set_rtc_time = todc_set_rtc_time;
308 ppc_md.get_rtc_time = todc_get_rtc_time;
309 ppc_md.calibrate_decr = spruce_calibrate_decr;
310
311 ppc_md.nvram_read_val = todc_direct_read_val;
312 ppc_md.nvram_write_val = todc_direct_write_val;
313
314 spruce_early_serial_map();
315
316#ifdef CONFIG_SERIAL_TEXT_DEBUG
317 ppc_md.progress = gen550_progress;
318#endif /* CONFIG_SERIAL_TEXT_DEBUG */
319#ifdef CONFIG_KGDB
320 ppc_md.kgdb_map_scc = gen550_kgdb_map_scc;
321#endif
322}
diff --git a/arch/ppc/platforms/spruce.h b/arch/ppc/platforms/spruce.h
deleted file mode 100644
index f1f96f1de72a..000000000000
--- a/arch/ppc/platforms/spruce.h
+++ /dev/null
@@ -1,71 +0,0 @@
1/*
2 * arch/ppc/platforms/spruce.h
3 *
4 * Definitions for IBM Spruce reference board support
5 *
6 * Authors: Matt Porter and Johnnie Peters
7 * mporter@mvista.com
8 * jpeters@mvista.com
9 *
10 * 2001 (c) MontaVista, Software, Inc. This file is licensed under
11 * the terms of the GNU General Public License version 2. This program
12 * is licensed "as is" without any warranty of any kind, whether express
13 * or implied.
14 */
15
16#ifdef __KERNEL__
17#ifndef __ASM_SPRUCE_H__
18#define __ASM_SPRUCE_H__
19
20#define SPRUCE_PCI_CONFIG_ADDR 0xfec00000
21#define SPRUCE_PCI_CONFIG_DATA 0xfec00004
22
23#define SPRUCE_PCI_PHY_IO_BASE 0xf8000000
24#define SPRUCE_PCI_IO_BASE SPRUCE_PCI_PHY_IO_BASE
25
26#define SPRUCE_PCI_SYS_MEM_BASE 0x00000000
27
28#define SPRUCE_PCI_LOWER_MEM 0x80000000
29#define SPRUCE_PCI_UPPER_MEM 0x9fffffff
30#define SPRUCE_PCI_LOWER_IO 0x00000000
31#define SPRUCE_PCI_UPPER_IO 0x03ffffff
32
33#define SPRUCE_ISA_IO_BASE SPRUCE_PCI_IO_BASE
34
35#define SPRUCE_MEM_SIZE 0x04000000
36#define SPRUCE_BUS_SPEED 66666667
37
38#define SPRUCE_NVRAM_BASE_ADDR 0xff800000
39#define SPRUCE_RTC_BASE_ADDR SPRUCE_NVRAM_BASE_ADDR
40
41/*
42 * Serial port defines
43 */
44#define SPRUCE_FPGA_REG_A 0xff820000
45#define SPRUCE_UARTCLK_33M 0x02
46#define SPRUCE_UARTCLK_IS_33M(reg) (reg & SPRUCE_UARTCLK_33M)
47
48#define UART0_IO_BASE 0xff600300
49#define UART1_IO_BASE 0xff600400
50
51#define RS_TABLE_SIZE 2
52
53#define SPRUCE_BAUD_33M (33000000/64)
54#define SPRUCE_BAUD_30M (30000000/64)
55#define BASE_BAUD SPRUCE_BAUD_33M
56
57#define UART0_INT 3
58#define UART1_INT 4
59
60#define STD_UART_OP(num) \
61 { 0, BASE_BAUD, 0, UART##num##_INT, \
62 ASYNC_BOOT_AUTOCONF, \
63 iomem_base: (unsigned char *) UART##num##_IO_BASE, \
64 io_type: SERIAL_IO_MEM},
65
66#define SERIAL_PORT_DFNS \
67 STD_UART_OP(0) \
68 STD_UART_OP(1)
69
70#endif /* __ASM_SPRUCE_H__ */
71#endif /* __KERNEL__ */
diff --git a/arch/ppc/platforms/tqm8260.h b/arch/ppc/platforms/tqm8260.h
deleted file mode 100644
index 7f8c9a6928f8..000000000000
--- a/arch/ppc/platforms/tqm8260.h
+++ /dev/null
@@ -1,22 +0,0 @@
1/*
2 * TQM8260 board specific definitions
3 *
4 * Copyright (c) 2001 Wolfgang Denk (wd@denx.de)
5 */
6
7#ifndef __TQM8260_PLATFORM
8#define __TQM8260_PLATFORM
9
10
11#include <asm/ppcboot.h>
12
13#define CPM_MAP_ADDR ((uint)0xFFF00000)
14#define PHY_INTERRUPT 25
15
16/* For our show_cpuinfo hooks. */
17#define CPUINFO_VENDOR "IN2 Systems"
18#define CPUINFO_MACHINE "TQM8260 PowerPC"
19
20#define BOOTROM_RESTART_ADDR ((uint)0x40000104)
21
22#endif /* __TQM8260_PLATFORM */
diff --git a/arch/ppc/platforms/tqm8260_setup.c b/arch/ppc/platforms/tqm8260_setup.c
deleted file mode 100644
index b766339f44ac..000000000000
--- a/arch/ppc/platforms/tqm8260_setup.c
+++ /dev/null
@@ -1,42 +0,0 @@
1/*
2 * TQM8260 platform support
3 *
4 * Author: Allen Curtis <acurtis@onz.com>
5 * Derived from: m8260_setup.c by Dan Malek, MVista
6 *
7 * Copyright 2002 Ones and Zeros, Inc.
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation; either version 2 of the License, or (at your
12 * option) any later version.
13 */
14
15#include <linux/init.h>
16
17#include <asm/mpc8260.h>
18#include <asm/cpm2.h>
19#include <asm/machdep.h>
20
21static int
22tqm8260_set_rtc_time(unsigned long time)
23{
24 ((cpm2_map_t *)CPM_MAP_ADDR)->im_sit.sit_tmcnt = time;
25 ((cpm2_map_t *)CPM_MAP_ADDR)->im_sit.sit_tmcntsc = 0x3;
26
27 return(0);
28}
29
30static unsigned long
31tqm8260_get_rtc_time(void)
32{
33 return ((cpm2_map_t *)CPM_MAP_ADDR)->im_sit.sit_tmcnt;
34}
35
36void __init
37m82xx_board_init(void)
38{
39 /* Anything special for this platform */
40 ppc_md.set_rtc_time = tqm8260_set_rtc_time;
41 ppc_md.get_rtc_time = tqm8260_get_rtc_time;
42}
diff --git a/arch/ppc/platforms/tqm8xx.h b/arch/ppc/platforms/tqm8xx.h
deleted file mode 100644
index 662131d0eb39..000000000000
--- a/arch/ppc/platforms/tqm8xx.h
+++ /dev/null
@@ -1,155 +0,0 @@
1/*
2 * TQM8xx(L) board specific definitions
3 *
4 * Copyright (c) 1999-2002 Wolfgang Denk (wd@denx.de)
5 */
6
7#ifdef __KERNEL__
8#ifndef __MACH_TQM8xx_H
9#define __MACH_TQM8xx_H
10
11
12#include <asm/ppcboot.h>
13
14#ifndef __ASSEMBLY__
15#define TQM_IMMR_BASE 0xFFF00000 /* phys. addr of IMMR */
16#define TQM_IMAP_SIZE (64 * 1024) /* size of mapped area */
17
18#define IMAP_ADDR TQM_IMMR_BASE /* physical base address of IMMR area */
19#define IMAP_SIZE TQM_IMAP_SIZE /* mapped size of IMMR area */
20
21/*-----------------------------------------------------------------------
22 * PCMCIA stuff
23 *-----------------------------------------------------------------------
24 *
25 */
26#define PCMCIA_MEM_SIZE ( 64 << 20 )
27
28#ifndef CONFIG_KUP4K
29# define MAX_HWIFS 1 /* overwrite default in include/asm-ppc/ide.h */
30
31#else /* CONFIG_KUP4K */
32
33# define MAX_HWIFS 2 /* overwrite default in include/asm-ppc/ide.h */
34# ifndef __ASSEMBLY__
35# include <asm/8xx_immap.h>
36static __inline__ void ide_led(int on)
37{
38 volatile immap_t *immap = (immap_t *)IMAP_ADDR;
39
40 if (on) {
41 immap->im_ioport.iop_padat &= ~0x80;
42 } else {
43 immap->im_ioport.iop_padat |= 0x80;
44 }
45}
46# endif /* __ASSEMBLY__ */
47# define IDE_LED(x) ide_led((x))
48#endif /* CONFIG_KUP4K */
49
50/*
51 * Definitions for IDE0 Interface
52 */
53#define IDE0_BASE_OFFSET 0
54#define IDE0_DATA_REG_OFFSET (PCMCIA_MEM_SIZE + 0x320)
55#define IDE0_ERROR_REG_OFFSET (2 * PCMCIA_MEM_SIZE + 0x320 + 1)
56#define IDE0_NSECTOR_REG_OFFSET (2 * PCMCIA_MEM_SIZE + 0x320 + 2)
57#define IDE0_SECTOR_REG_OFFSET (2 * PCMCIA_MEM_SIZE + 0x320 + 3)
58#define IDE0_LCYL_REG_OFFSET (2 * PCMCIA_MEM_SIZE + 0x320 + 4)
59#define IDE0_HCYL_REG_OFFSET (2 * PCMCIA_MEM_SIZE + 0x320 + 5)
60#define IDE0_SELECT_REG_OFFSET (2 * PCMCIA_MEM_SIZE + 0x320 + 6)
61#define IDE0_STATUS_REG_OFFSET (2 * PCMCIA_MEM_SIZE + 0x320 + 7)
62#define IDE0_CONTROL_REG_OFFSET 0x0106
63#define IDE0_IRQ_REG_OFFSET 0x000A /* not used */
64
65/* define IO_BASE for PCMCIA */
66#define _IO_BASE 0x80000000
67#define _IO_BASE_SIZE (64<<10)
68
69#define FEC_INTERRUPT 9 /* = SIU_LEVEL4 */
70#define PHY_INTERRUPT 12 /* = IRQ6 */
71#define IDE0_INTERRUPT 13
72
73#ifdef CONFIG_IDE
74#endif
75
76/*-----------------------------------------------------------------------
77 * CPM Ethernet through SCCx.
78 *-----------------------------------------------------------------------
79 *
80 */
81
82/*** TQM823L, TQM850L ***********************************************/
83
84#if defined(CONFIG_TQM823L) || defined(CONFIG_TQM850L)
85/* Bits in parallel I/O port registers that have to be set/cleared
86 * to configure the pins for SCC1 use.
87 */
88#define PA_ENET_RXD ((ushort)0x0004) /* PA 13 */
89#define PA_ENET_TXD ((ushort)0x0008) /* PA 12 */
90#define PA_ENET_RCLK ((ushort)0x0100) /* PA 7 */
91#define PA_ENET_TCLK ((ushort)0x0400) /* PA 5 */
92
93#define PB_ENET_TENA ((uint)0x00002000) /* PB 18 */
94
95#define PC_ENET_CLSN ((ushort)0x0040) /* PC 9 */
96#define PC_ENET_RENA ((ushort)0x0080) /* PC 8 */
97
98/* Control bits in the SICR to route TCLK (CLK3) and RCLK (CLK1) to
99 * SCC2. Also, make sure GR2 (bit 16) and SC2 (bit 17) are zero.
100 */
101#define SICR_ENET_MASK ((uint)0x0000ff00)
102#define SICR_ENET_CLKRT ((uint)0x00002600)
103#endif /* CONFIG_TQM823L, CONFIG_TQM850L */
104
105/*** TQM860L ********************************************************/
106
107#ifdef CONFIG_TQM860L
108/* Bits in parallel I/O port registers that have to be set/cleared
109 * to configure the pins for SCC1 use.
110 */
111#define PA_ENET_RXD ((ushort)0x0001) /* PA 15 */
112#define PA_ENET_TXD ((ushort)0x0002) /* PA 14 */
113#define PA_ENET_RCLK ((ushort)0x0100) /* PA 7 */
114#define PA_ENET_TCLK ((ushort)0x0400) /* PA 5 */
115
116#define PC_ENET_TENA ((ushort)0x0001) /* PC 15 */
117#define PC_ENET_CLSN ((ushort)0x0010) /* PC 11 */
118#define PC_ENET_RENA ((ushort)0x0020) /* PC 10 */
119
120/* Control bits in the SICR to route TCLK (CLK3) and RCLK (CLK1) to
121 * SCC1. Also, make sure GR1 (bit 24) and SC1 (bit 25) are zero.
122 */
123#define SICR_ENET_MASK ((uint)0x000000ff)
124#define SICR_ENET_CLKRT ((uint)0x00000026)
125#endif /* CONFIG_TQM860L */
126
127/*** FPS850L *********************************************************/
128
129#ifdef CONFIG_FPS850L
130/* Bits in parallel I/O port registers that have to be set/cleared
131 * to configure the pins for SCC1 use.
132 */
133#define PA_ENET_RXD ((ushort)0x0004) /* PA 13 */
134#define PA_ENET_TXD ((ushort)0x0008) /* PA 12 */
135#define PA_ENET_RCLK ((ushort)0x0100) /* PA 7 */
136#define PA_ENET_TCLK ((ushort)0x0400) /* PA 5 */
137
138#define PC_ENET_TENA ((ushort)0x0002) /* PC 14 */
139#define PC_ENET_CLSN ((ushort)0x0040) /* PC 9 */
140#define PC_ENET_RENA ((ushort)0x0080) /* PC 8 */
141
142/* Control bits in the SICR to route TCLK (CLK2) and RCLK (CLK4) to
143 * SCC2. Also, make sure GR2 (bit 16) and SC2 (bit 17) are zero.
144 */
145#define SICR_ENET_MASK ((uint)0x0000ff00)
146#define SICR_ENET_CLKRT ((uint)0x00002600)
147#endif /* CONFIG_FPS850L */
148
149/* We don't use the 8259.
150*/
151#define NR_8259_INTS 0
152
153#endif /* !__ASSEMBLY__ */
154#endif /* __MACH_TQM8xx_H */
155#endif /* __KERNEL__ */
diff --git a/arch/ppc/syslib/Makefile b/arch/ppc/syslib/Makefile
deleted file mode 100644
index 52ddebe6c6d1..000000000000
--- a/arch/ppc/syslib/Makefile
+++ /dev/null
@@ -1,96 +0,0 @@
1#
2# Makefile for the linux kernel.
3#
4
5CFLAGS_prom_init.o += -fPIC
6CFLAGS_btext.o += -fPIC
7
8wdt-mpc8xx-$(CONFIG_8xx_WDT) += m8xx_wdt.o
9
10obj-$(CONFIG_PPC_INDIRECT_PCI) += indirect_pci.o
11obj-$(CONFIG_PPCBUG_NVRAM) += prep_nvram.o
12obj-$(CONFIG_PPC_OCP) += ocp.o
13obj-$(CONFIG_IBM_OCP) += ibm_ocp.o
14obj-$(CONFIG_44x) += ibm44x_common.o
15obj-$(CONFIG_440EP) += ibm440gx_common.o
16obj-$(CONFIG_440GP) += ibm440gp_common.o
17obj-$(CONFIG_440GX) += ibm440gx_common.o
18obj-$(CONFIG_440SP) += ibm440gx_common.o ibm440sp_common.o
19obj-$(CONFIG_440SPE) += ibm440gx_common.o ibm440sp_common.o ppc440spe_pcie.o
20ifeq ($(CONFIG_4xx),y)
21ifeq ($(CONFIG_XILINX_VIRTEX),y)
22obj-$(CONFIG_40x) += xilinx_pic.o
23obj-y += virtex_devices.o
24else
25ifeq ($(CONFIG_403),y)
26obj-$(CONFIG_40x) += ppc403_pic.o
27else
28obj-$(CONFIG_40x) += ppc4xx_pic.o
29endif
30endif
31obj-$(CONFIG_44x) += ppc4xx_pic.o
32obj-$(CONFIG_40x) += ppc4xx_setup.o
33obj-$(CONFIG_GEN_RTC) += todc_time.o
34obj-$(CONFIG_PPC4xx_DMA) += ppc4xx_dma.o
35obj-$(CONFIG_PPC4xx_EDMA) += ppc4xx_sgdma.o
36ifeq ($(CONFIG_40x),y)
37obj-$(CONFIG_PCI) += pci_auto.o ppc405_pci.o
38endif
39endif
40obj-$(CONFIG_8xx) += m8xx_setup.o ppc8xx_pic.o $(wdt-mpc8xx-y) \
41 ppc_sys.o mpc8xx_devices.o mpc8xx_sys.o
42obj-$(CONFIG_PCI_QSPAN) += qspan_pci.o
43obj-$(CONFIG_PPC_PREP) += open_pic.o todc_time.o
44obj-$(CONFIG_BAMBOO) += pci_auto.o todc_time.o
45obj-$(CONFIG_CPCI690) += todc_time.o pci_auto.o
46obj-$(CONFIG_EBONY) += pci_auto.o todc_time.o
47obj-$(CONFIG_EV64260) += todc_time.o pci_auto.o
48obj-$(CONFIG_EV64360) += todc_time.o
49obj-$(CONFIG_CHESTNUT) += mv64360_pic.o pci_auto.o
50obj-$(CONFIG_GT64260) += gt64260_pic.o
51obj-$(CONFIG_LOPEC) += pci_auto.o todc_time.o
52obj-$(CONFIG_HDPU) += pci_auto.o
53obj-$(CONFIG_LUAN) += pci_auto.o todc_time.o
54obj-$(CONFIG_YUCCA) += pci_auto.o todc_time.o
55obj-$(CONFIG_KATANA) += pci_auto.o
56obj-$(CONFIG_MV64360) += mv64360_pic.o
57obj-$(CONFIG_MV64X60) += mv64x60.o mv64x60_win.o
58obj-$(CONFIG_MVME5100) += open_pic.o todc_time.o \
59 pci_auto.o hawk_common.o
60obj-$(CONFIG_OCOTEA) += pci_auto.o todc_time.o
61obj-$(CONFIG_PAL4) += cpc700_pic.o
62obj-$(CONFIG_POWERPMC250) += pci_auto.o
63obj-$(CONFIG_PPLUS) += hawk_common.o open_pic.o \
64 todc_time.o pci_auto.o
65obj-$(CONFIG_PRPMC750) += open_pic.o pci_auto.o \
66 hawk_common.o
67obj-$(CONFIG_HARRIER) += harrier.o
68obj-$(CONFIG_PRPMC800) += open_pic.o pci_auto.o
69obj-$(CONFIG_RADSTONE_PPC7D) += pci_auto.o
70obj-$(CONFIG_SANDPOINT) += pci_auto.o todc_time.o
71obj-$(CONFIG_SBC82xx) += todc_time.o
72obj-$(CONFIG_SPRUCE) += cpc700_pic.o pci_auto.o \
73 todc_time.o
74obj-$(CONFIG_TAISHAN) += pci_auto.o
75obj-$(CONFIG_8260) += m8260_setup.o pq2_devices.o pq2_sys.o \
76 ppc_sys.o
77obj-$(CONFIG_PCI_8260) += m82xx_pci.o pci_auto.o
78obj-$(CONFIG_8260_PCI9) += m8260_pci_erratum9.o
79obj-$(CONFIG_CPM2) += cpm2_common.o cpm2_pic.o
80ifeq ($(CONFIG_PPC_GEN550),y)
81obj-$(CONFIG_KGDB) += gen550_kgdb.o gen550_dbg.o
82obj-$(CONFIG_SERIAL_TEXT_DEBUG) += gen550_dbg.o
83endif
84ifeq ($(CONFIG_SERIAL_MPSC_CONSOLE),y)
85obj-$(CONFIG_SERIAL_TEXT_DEBUG) += mv64x60_dbg.o
86endif
87obj-$(CONFIG_BOOTX_TEXT) += btext.o
88obj-$(CONFIG_MPC10X_BRIDGE) += mpc10x_common.o ppc_sys.o
89obj-$(CONFIG_MPC10X_OPENPIC) += open_pic.o
90obj-$(CONFIG_PPC_MPC52xx) += mpc52xx_setup.o mpc52xx_pic.o \
91 mpc52xx_sys.o mpc52xx_devices.o ppc_sys.o
92ifeq ($(CONFIG_PPC_MPC52xx),y)
93obj-$(CONFIG_PCI) += mpc52xx_pci.o
94endif
95
96obj-$(CONFIG_PPC_I8259) += i8259.o
diff --git a/arch/ppc/syslib/btext.c b/arch/ppc/syslib/btext.c
deleted file mode 100644
index d11667046f21..000000000000
--- a/arch/ppc/syslib/btext.c
+++ /dev/null
@@ -1,860 +0,0 @@
1/*
2 * Procedures for drawing on the screen early on in the boot process.
3 *
4 * Benjamin Herrenschmidt <benh@kernel.crashing.org>
5 */
6#include <linux/kernel.h>
7#include <linux/string.h>
8#include <linux/init.h>
9#include <linux/utsrelease.h>
10
11#include <asm/sections.h>
12#include <asm/bootx.h>
13#include <asm/btext.h>
14#include <asm/prom.h>
15#include <asm/page.h>
16#include <asm/mmu.h>
17#include <asm/pgtable.h>
18#include <asm/io.h>
19#include <asm/reg.h>
20
21#define NO_SCROLL
22
23#ifndef NO_SCROLL
24static void scrollscreen(void);
25#endif
26
27static void draw_byte(unsigned char c, long locX, long locY);
28static void draw_byte_32(unsigned char *bits, unsigned long *base, int rb);
29static void draw_byte_16(unsigned char *bits, unsigned long *base, int rb);
30static void draw_byte_8(unsigned char *bits, unsigned long *base, int rb);
31
32static int g_loc_X;
33static int g_loc_Y;
34static int g_max_loc_X;
35static int g_max_loc_Y;
36
37unsigned long disp_BAT[2] __initdata = {0, 0};
38
39#define cmapsz (16*256)
40
41static unsigned char vga_font[cmapsz];
42
43int boot_text_mapped;
44int force_printk_to_btext = 0;
45
46boot_infos_t disp_bi;
47
48extern char *klimit;
49
50/*
51 * Powermac can use btext_* after boot for xmon,
52 * chrp only uses it during early boot.
53 */
54#ifdef CONFIG_XMON
55#define BTEXT
56#define BTDATA
57#else
58#define BTEXT __init
59#define BTDATA __initdata
60#endif /* CONFIG_XMON */
61
62/*
63 * This is called only when we are booted via BootX.
64 */
65void __init
66btext_init(boot_infos_t *bi)
67{
68 g_loc_X = 0;
69 g_loc_Y = 0;
70 g_max_loc_X = (bi->dispDeviceRect[2] - bi->dispDeviceRect[0]) / 8;
71 g_max_loc_Y = (bi->dispDeviceRect[3] - bi->dispDeviceRect[1]) / 16;
72 disp_bi = *bi;
73 boot_text_mapped = 1;
74}
75
76void __init
77btext_welcome(void)
78{
79 unsigned long flags;
80 unsigned long pvr;
81 boot_infos_t* bi = &disp_bi;
82
83 btext_drawstring("Welcome to Linux, kernel " UTS_RELEASE "\n");
84 btext_drawstring("\nlinked at : 0x");
85 btext_drawhex(KERNELBASE);
86 btext_drawstring("\nframe buffer at : 0x");
87 btext_drawhex((unsigned long)bi->dispDeviceBase);
88 btext_drawstring(" (phys), 0x");
89 btext_drawhex((unsigned long)bi->logicalDisplayBase);
90 btext_drawstring(" (log)");
91 btext_drawstring("\nklimit : 0x");
92 btext_drawhex((unsigned long)klimit);
93 btext_drawstring("\nMSR : 0x");
94 __asm__ __volatile__ ("mfmsr %0" : "=r" (flags));
95 btext_drawhex(flags);
96 __asm__ __volatile__ ("mfspr %0, 287" : "=r" (pvr));
97 pvr >>= 16;
98 if (pvr > 1) {
99 btext_drawstring("\nHID0 : 0x");
100 __asm__ __volatile__ ("mfspr %0, 1008" : "=r" (flags));
101 btext_drawhex(flags);
102 }
103 if (pvr == 8 || pvr == 12 || pvr == 0x800c) {
104 btext_drawstring("\nICTC : 0x");
105 __asm__ __volatile__ ("mfspr %0, 1019" : "=r" (flags));
106 btext_drawhex(flags);
107 }
108 btext_drawstring("\n\n");
109}
110
111/* Calc BAT values for mapping the display and store them
112 * in disp_BAT. Those values are then used from head.S to map
113 * the display during identify_machine() and MMU_Init()
114 *
115 * The display is mapped to virtual address 0xD0000000, rather
116 * than 1:1, because some some CHRP machines put the frame buffer
117 * in the region starting at 0xC0000000 (KERNELBASE).
118 * This mapping is temporary and will disappear as soon as the
119 * setup done by MMU_Init() is applied.
120 *
121 * For now, we align the BAT and then map 8Mb on 601 and 16Mb
122 * on other PPCs. This may cause trouble if the framebuffer
123 * is really badly aligned, but I didn't encounter this case
124 * yet.
125 */
126void __init
127btext_prepare_BAT(void)
128{
129 boot_infos_t* bi = &disp_bi;
130 unsigned long vaddr = KERNELBASE + 0x10000000;
131 unsigned long addr;
132 unsigned long lowbits;
133
134 addr = (unsigned long)bi->dispDeviceBase;
135 if (!addr) {
136 boot_text_mapped = 0;
137 return;
138 }
139 if (PVR_VER(mfspr(SPRN_PVR)) != 1) {
140 /* 603, 604, G3, G4, ... */
141 lowbits = addr & ~0xFF000000UL;
142 addr &= 0xFF000000UL;
143 disp_BAT[0] = vaddr | (BL_16M<<2) | 2;
144 disp_BAT[1] = addr | (_PAGE_NO_CACHE | _PAGE_GUARDED | BPP_RW);
145 } else {
146 /* 601 */
147 lowbits = addr & ~0xFF800000UL;
148 addr &= 0xFF800000UL;
149 disp_BAT[0] = vaddr | (_PAGE_NO_CACHE | PP_RWXX) | 4;
150 disp_BAT[1] = addr | BL_8M | 0x40;
151 }
152 bi->logicalDisplayBase = (void *) (vaddr + lowbits);
153}
154
155/* This function will enable the early boot text when doing OF booting. This
156 * way, xmon output should work too
157 */
158void __init
159btext_setup_display(int width, int height, int depth, int pitch,
160 unsigned long address)
161{
162 boot_infos_t* bi = &disp_bi;
163
164 g_loc_X = 0;
165 g_loc_Y = 0;
166 g_max_loc_X = width / 8;
167 g_max_loc_Y = height / 16;
168 bi->logicalDisplayBase = (unsigned char *)address;
169 bi->dispDeviceBase = (unsigned char *)address;
170 bi->dispDeviceRowBytes = pitch;
171 bi->dispDeviceDepth = depth;
172 bi->dispDeviceRect[0] = bi->dispDeviceRect[1] = 0;
173 bi->dispDeviceRect[2] = width;
174 bi->dispDeviceRect[3] = height;
175 boot_text_mapped = 1;
176}
177
178/* Here's a small text engine to use during early boot
179 * or for debugging purposes
180 *
181 * todo:
182 *
183 * - build some kind of vgacon with it to enable early printk
184 * - move to a separate file
185 * - add a few video driver hooks to keep in sync with display
186 * changes.
187 */
188
189void
190map_boot_text(void)
191{
192 unsigned long base, offset, size;
193 boot_infos_t *bi = &disp_bi;
194 unsigned char *vbase;
195
196 /* By default, we are no longer mapped */
197 boot_text_mapped = 0;
198 if (bi->dispDeviceBase == 0)
199 return;
200 base = ((unsigned long) bi->dispDeviceBase) & 0xFFFFF000UL;
201 offset = ((unsigned long) bi->dispDeviceBase) - base;
202 size = bi->dispDeviceRowBytes * bi->dispDeviceRect[3] + offset
203 + bi->dispDeviceRect[0];
204 vbase = ioremap(base, size);
205 if (vbase == 0)
206 return;
207 bi->logicalDisplayBase = vbase + offset;
208 boot_text_mapped = 1;
209}
210
211/* Calc the base address of a given point (x,y) */
212static unsigned char * BTEXT
213calc_base(boot_infos_t *bi, int x, int y)
214{
215 unsigned char *base;
216
217 base = bi->logicalDisplayBase;
218 if (base == 0)
219 base = bi->dispDeviceBase;
220 base += (x + bi->dispDeviceRect[0]) * (bi->dispDeviceDepth >> 3);
221 base += (y + bi->dispDeviceRect[1]) * bi->dispDeviceRowBytes;
222 return base;
223}
224
225/* Adjust the display to a new resolution */
226void
227btext_update_display(unsigned long phys, int width, int height,
228 int depth, int pitch)
229{
230 boot_infos_t *bi = &disp_bi;
231
232 if (bi->dispDeviceBase == 0)
233 return;
234
235 /* check it's the same frame buffer (within 256MB) */
236 if ((phys ^ (unsigned long)bi->dispDeviceBase) & 0xf0000000)
237 return;
238
239 bi->dispDeviceBase = (__u8 *) phys;
240 bi->dispDeviceRect[0] = 0;
241 bi->dispDeviceRect[1] = 0;
242 bi->dispDeviceRect[2] = width;
243 bi->dispDeviceRect[3] = height;
244 bi->dispDeviceDepth = depth;
245 bi->dispDeviceRowBytes = pitch;
246 if (boot_text_mapped) {
247 iounmap(bi->logicalDisplayBase);
248 boot_text_mapped = 0;
249 }
250 map_boot_text();
251 g_loc_X = 0;
252 g_loc_Y = 0;
253 g_max_loc_X = width / 8;
254 g_max_loc_Y = height / 16;
255}
256
257void BTEXT btext_clearscreen(void)
258{
259 boot_infos_t* bi = &disp_bi;
260 unsigned long *base = (unsigned long *)calc_base(bi, 0, 0);
261 unsigned long width = ((bi->dispDeviceRect[2] - bi->dispDeviceRect[0]) *
262 (bi->dispDeviceDepth >> 3)) >> 2;
263 int i,j;
264
265 for (i=0; i<(bi->dispDeviceRect[3] - bi->dispDeviceRect[1]); i++)
266 {
267 unsigned long *ptr = base;
268 for(j=width; j; --j)
269 *(ptr++) = 0;
270 base += (bi->dispDeviceRowBytes >> 2);
271 }
272}
273
274__inline__ void dcbst(const void* addr)
275{
276 __asm__ __volatile__ ("dcbst 0,%0" :: "r" (addr));
277}
278
279void BTEXT btext_flushscreen(void)
280{
281 boot_infos_t* bi = &disp_bi;
282 unsigned long *base = (unsigned long *)calc_base(bi, 0, 0);
283 unsigned long width = ((bi->dispDeviceRect[2] - bi->dispDeviceRect[0]) *
284 (bi->dispDeviceDepth >> 3)) >> 2;
285 int i,j;
286
287 for (i=0; i<(bi->dispDeviceRect[3] - bi->dispDeviceRect[1]); i++)
288 {
289 unsigned long *ptr = base;
290 for(j=width; j>0; j-=8) {
291 dcbst(ptr);
292 ptr += 8;
293 }
294 base += (bi->dispDeviceRowBytes >> 2);
295 }
296}
297
298#ifndef NO_SCROLL
299static BTEXT void
300scrollscreen(void)
301{
302 boot_infos_t* bi = &disp_bi;
303 unsigned long *src = (unsigned long *)calc_base(bi,0,16);
304 unsigned long *dst = (unsigned long *)calc_base(bi,0,0);
305 unsigned long width = ((bi->dispDeviceRect[2] - bi->dispDeviceRect[0]) *
306 (bi->dispDeviceDepth >> 3)) >> 2;
307 int i,j;
308
309#ifdef CONFIG_ADB_PMU
310 pmu_suspend(); /* PMU will not shut us down ! */
311#endif
312 for (i=0; i<(bi->dispDeviceRect[3] - bi->dispDeviceRect[1] - 16); i++)
313 {
314 unsigned long *src_ptr = src;
315 unsigned long *dst_ptr = dst;
316 for(j=width; j; --j)
317 *(dst_ptr++) = *(src_ptr++);
318 src += (bi->dispDeviceRowBytes >> 2);
319 dst += (bi->dispDeviceRowBytes >> 2);
320 }
321 for (i=0; i<16; i++)
322 {
323 unsigned long *dst_ptr = dst;
324 for(j=width; j; --j)
325 *(dst_ptr++) = 0;
326 dst += (bi->dispDeviceRowBytes >> 2);
327 }
328#ifdef CONFIG_ADB_PMU
329 pmu_resume(); /* PMU will not shut us down ! */
330#endif
331}
332#endif /* ndef NO_SCROLL */
333
334void BTEXT btext_drawchar(char c)
335{
336 int cline = 0, x;
337
338 if (!boot_text_mapped)
339 return;
340
341 switch (c) {
342 case '\b':
343 if (g_loc_X > 0)
344 --g_loc_X;
345 break;
346 case '\t':
347 g_loc_X = (g_loc_X & -8) + 8;
348 break;
349 case '\r':
350 g_loc_X = 0;
351 break;
352 case '\n':
353 g_loc_X = 0;
354 g_loc_Y++;
355 cline = 1;
356 break;
357 default:
358 draw_byte(c, g_loc_X++, g_loc_Y);
359 }
360 if (g_loc_X >= g_max_loc_X) {
361 g_loc_X = 0;
362 g_loc_Y++;
363 cline = 1;
364 }
365#ifndef NO_SCROLL
366 while (g_loc_Y >= g_max_loc_Y) {
367 scrollscreen();
368 g_loc_Y--;
369 }
370#else
371 /* wrap around from bottom to top of screen so we don't
372 waste time scrolling each line. -- paulus. */
373 if (g_loc_Y >= g_max_loc_Y)
374 g_loc_Y = 0;
375 if (cline) {
376 for (x = 0; x < g_max_loc_X; ++x)
377 draw_byte(' ', x, g_loc_Y);
378 }
379#endif
380}
381
382void BTEXT
383btext_drawstring(const char *c)
384{
385 if (!boot_text_mapped)
386 return;
387 while (*c)
388 btext_drawchar(*c++);
389}
390
391void BTEXT
392btext_drawhex(unsigned long v)
393{
394 static char hex_table[] = "0123456789abcdef";
395
396 if (!boot_text_mapped)
397 return;
398 btext_drawchar(hex_table[(v >> 28) & 0x0000000FUL]);
399 btext_drawchar(hex_table[(v >> 24) & 0x0000000FUL]);
400 btext_drawchar(hex_table[(v >> 20) & 0x0000000FUL]);
401 btext_drawchar(hex_table[(v >> 16) & 0x0000000FUL]);
402 btext_drawchar(hex_table[(v >> 12) & 0x0000000FUL]);
403 btext_drawchar(hex_table[(v >> 8) & 0x0000000FUL]);
404 btext_drawchar(hex_table[(v >> 4) & 0x0000000FUL]);
405 btext_drawchar(hex_table[(v >> 0) & 0x0000000FUL]);
406 btext_drawchar(' ');
407}
408
409static void BTEXT
410draw_byte(unsigned char c, long locX, long locY)
411{
412 boot_infos_t* bi = &disp_bi;
413 unsigned char *base = calc_base(bi, locX << 3, locY << 4);
414 unsigned char *font = &vga_font[((unsigned long)c) * 16];
415 int rb = bi->dispDeviceRowBytes;
416
417 switch(bi->dispDeviceDepth) {
418 case 24:
419 case 32:
420 draw_byte_32(font, (unsigned long *)base, rb);
421 break;
422 case 15:
423 case 16:
424 draw_byte_16(font, (unsigned long *)base, rb);
425 break;
426 case 8:
427 draw_byte_8(font, (unsigned long *)base, rb);
428 break;
429 }
430}
431
432static unsigned long expand_bits_8[16] BTDATA = {
433 0x00000000,
434 0x000000ff,
435 0x0000ff00,
436 0x0000ffff,
437 0x00ff0000,
438 0x00ff00ff,
439 0x00ffff00,
440 0x00ffffff,
441 0xff000000,
442 0xff0000ff,
443 0xff00ff00,
444 0xff00ffff,
445 0xffff0000,
446 0xffff00ff,
447 0xffffff00,
448 0xffffffff
449};
450
451static unsigned long expand_bits_16[4] BTDATA = {
452 0x00000000,
453 0x0000ffff,
454 0xffff0000,
455 0xffffffff
456};
457
458
459static void BTEXT
460draw_byte_32(unsigned char *font, unsigned long *base, int rb)
461{
462 int l, bits;
463 int fg = 0xFFFFFFFFUL;
464 int bg = 0x00000000UL;
465
466 for (l = 0; l < 16; ++l)
467 {
468 bits = *font++;
469 base[0] = (-(bits >> 7) & fg) ^ bg;
470 base[1] = (-((bits >> 6) & 1) & fg) ^ bg;
471 base[2] = (-((bits >> 5) & 1) & fg) ^ bg;
472 base[3] = (-((bits >> 4) & 1) & fg) ^ bg;
473 base[4] = (-((bits >> 3) & 1) & fg) ^ bg;
474 base[5] = (-((bits >> 2) & 1) & fg) ^ bg;
475 base[6] = (-((bits >> 1) & 1) & fg) ^ bg;
476 base[7] = (-(bits & 1) & fg) ^ bg;
477 base = (unsigned long *) ((char *)base + rb);
478 }
479}
480
481static void BTEXT
482draw_byte_16(unsigned char *font, unsigned long *base, int rb)
483{
484 int l, bits;
485 int fg = 0xFFFFFFFFUL;
486 int bg = 0x00000000UL;
487 unsigned long *eb = expand_bits_16;
488
489 for (l = 0; l < 16; ++l)
490 {
491 bits = *font++;
492 base[0] = (eb[bits >> 6] & fg) ^ bg;
493 base[1] = (eb[(bits >> 4) & 3] & fg) ^ bg;
494 base[2] = (eb[(bits >> 2) & 3] & fg) ^ bg;
495 base[3] = (eb[bits & 3] & fg) ^ bg;
496 base = (unsigned long *) ((char *)base + rb);
497 }
498}
499
500static void BTEXT
501draw_byte_8(unsigned char *font, unsigned long *base, int rb)
502{
503 int l, bits;
504 int fg = 0x0F0F0F0FUL;
505 int bg = 0x00000000UL;
506 unsigned long *eb = expand_bits_8;
507
508 for (l = 0; l < 16; ++l)
509 {
510 bits = *font++;
511 base[0] = (eb[bits >> 4] & fg) ^ bg;
512 base[1] = (eb[bits & 0xf] & fg) ^ bg;
513 base = (unsigned long *) ((char *)base + rb);
514 }
515}
516
517static unsigned char vga_font[cmapsz] BTDATA = {
5180x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
5190x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x81, 0xa5, 0x81, 0x81, 0xbd,
5200x99, 0x81, 0x81, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0xff,
5210xdb, 0xff, 0xff, 0xc3, 0xe7, 0xff, 0xff, 0x7e, 0x00, 0x00, 0x00, 0x00,
5220x00, 0x00, 0x00, 0x00, 0x6c, 0xfe, 0xfe, 0xfe, 0xfe, 0x7c, 0x38, 0x10,
5230x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x7c, 0xfe,
5240x7c, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18,
5250x3c, 0x3c, 0xe7, 0xe7, 0xe7, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00,
5260x00, 0x00, 0x00, 0x18, 0x3c, 0x7e, 0xff, 0xff, 0x7e, 0x18, 0x18, 0x3c,
5270x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3c,
5280x3c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
5290xff, 0xff, 0xe7, 0xc3, 0xc3, 0xe7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
5300x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x66, 0x42, 0x42, 0x66, 0x3c, 0x00,
5310x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc3, 0x99, 0xbd,
5320xbd, 0x99, 0xc3, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x1e, 0x0e,
5330x1a, 0x32, 0x78, 0xcc, 0xcc, 0xcc, 0xcc, 0x78, 0x00, 0x00, 0x00, 0x00,
5340x00, 0x00, 0x3c, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x18, 0x7e, 0x18, 0x18,
5350x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x33, 0x3f, 0x30, 0x30, 0x30,
5360x30, 0x70, 0xf0, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x63,
5370x7f, 0x63, 0x63, 0x63, 0x63, 0x67, 0xe7, 0xe6, 0xc0, 0x00, 0x00, 0x00,
5380x00, 0x00, 0x00, 0x18, 0x18, 0xdb, 0x3c, 0xe7, 0x3c, 0xdb, 0x18, 0x18,
5390x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfe, 0xf8,
5400xf0, 0xe0, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x06, 0x0e,
5410x1e, 0x3e, 0xfe, 0x3e, 0x1e, 0x0e, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00,
5420x00, 0x00, 0x18, 0x3c, 0x7e, 0x18, 0x18, 0x18, 0x7e, 0x3c, 0x18, 0x00,
5430x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66,
5440x66, 0x00, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xdb,
5450xdb, 0xdb, 0x7b, 0x1b, 0x1b, 0x1b, 0x1b, 0x1b, 0x00, 0x00, 0x00, 0x00,
5460x00, 0x7c, 0xc6, 0x60, 0x38, 0x6c, 0xc6, 0xc6, 0x6c, 0x38, 0x0c, 0xc6,
5470x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
5480xfe, 0xfe, 0xfe, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3c,
5490x7e, 0x18, 0x18, 0x18, 0x7e, 0x3c, 0x18, 0x7e, 0x00, 0x00, 0x00, 0x00,
5500x00, 0x00, 0x18, 0x3c, 0x7e, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
5510x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
5520x18, 0x7e, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
5530x00, 0x18, 0x0c, 0xfe, 0x0c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
5540x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x60, 0xfe, 0x60, 0x30, 0x00, 0x00,
5550x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0,
5560xc0, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
5570x00, 0x24, 0x66, 0xff, 0x66, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
5580x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x38, 0x7c, 0x7c, 0xfe, 0xfe, 0x00,
5590x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xfe, 0x7c, 0x7c,
5600x38, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
5610x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
5620x00, 0x00, 0x18, 0x3c, 0x3c, 0x3c, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18,
5630x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x66, 0x24, 0x00, 0x00, 0x00,
5640x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6c,
5650x6c, 0xfe, 0x6c, 0x6c, 0x6c, 0xfe, 0x6c, 0x6c, 0x00, 0x00, 0x00, 0x00,
5660x18, 0x18, 0x7c, 0xc6, 0xc2, 0xc0, 0x7c, 0x06, 0x06, 0x86, 0xc6, 0x7c,
5670x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc2, 0xc6, 0x0c, 0x18,
5680x30, 0x60, 0xc6, 0x86, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6c,
5690x6c, 0x38, 0x76, 0xdc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00,
5700x00, 0x30, 0x30, 0x30, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
5710x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x18, 0x30, 0x30, 0x30, 0x30,
5720x30, 0x30, 0x18, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x18,
5730x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00,
5740x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x3c, 0xff, 0x3c, 0x66, 0x00, 0x00,
5750x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x7e,
5760x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
5770x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x30, 0x00, 0x00, 0x00,
5780x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00,
5790x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
5800x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
5810x02, 0x06, 0x0c, 0x18, 0x30, 0x60, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00,
5820x00, 0x00, 0x7c, 0xc6, 0xc6, 0xce, 0xde, 0xf6, 0xe6, 0xc6, 0xc6, 0x7c,
5830x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x38, 0x78, 0x18, 0x18, 0x18,
5840x18, 0x18, 0x18, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6,
5850x06, 0x0c, 0x18, 0x30, 0x60, 0xc0, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00,
5860x00, 0x00, 0x7c, 0xc6, 0x06, 0x06, 0x3c, 0x06, 0x06, 0x06, 0xc6, 0x7c,
5870x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x1c, 0x3c, 0x6c, 0xcc, 0xfe,
5880x0c, 0x0c, 0x0c, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xc0,
5890xc0, 0xc0, 0xfc, 0x06, 0x06, 0x06, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
5900x00, 0x00, 0x38, 0x60, 0xc0, 0xc0, 0xfc, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c,
5910x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xc6, 0x06, 0x06, 0x0c, 0x18,
5920x30, 0x30, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6,
5930xc6, 0xc6, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
5940x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x06, 0x06, 0x0c, 0x78,
5950x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00,
5960x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
5970x18, 0x18, 0x00, 0x00, 0x00, 0x18, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00,
5980x00, 0x00, 0x00, 0x06, 0x0c, 0x18, 0x30, 0x60, 0x30, 0x18, 0x0c, 0x06,
5990x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00,
6000x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60,
6010x30, 0x18, 0x0c, 0x06, 0x0c, 0x18, 0x30, 0x60, 0x00, 0x00, 0x00, 0x00,
6020x00, 0x00, 0x7c, 0xc6, 0xc6, 0x0c, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18,
6030x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xde, 0xde,
6040xde, 0xdc, 0xc0, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38,
6050x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00,
6060x00, 0x00, 0xfc, 0x66, 0x66, 0x66, 0x7c, 0x66, 0x66, 0x66, 0x66, 0xfc,
6070x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x66, 0xc2, 0xc0, 0xc0, 0xc0,
6080xc0, 0xc2, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x6c,
6090x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x6c, 0xf8, 0x00, 0x00, 0x00, 0x00,
6100x00, 0x00, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x68, 0x60, 0x62, 0x66, 0xfe,
6110x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x68,
6120x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x66,
6130xc2, 0xc0, 0xc0, 0xde, 0xc6, 0xc6, 0x66, 0x3a, 0x00, 0x00, 0x00, 0x00,
6140x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6,
6150x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x18,
6160x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x0c,
6170x0c, 0x0c, 0x0c, 0x0c, 0xcc, 0xcc, 0xcc, 0x78, 0x00, 0x00, 0x00, 0x00,
6180x00, 0x00, 0xe6, 0x66, 0x66, 0x6c, 0x78, 0x78, 0x6c, 0x66, 0x66, 0xe6,
6190x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x60, 0x60, 0x60, 0x60, 0x60,
6200x60, 0x62, 0x66, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0xe7,
6210xff, 0xff, 0xdb, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0x00, 0x00, 0x00, 0x00,
6220x00, 0x00, 0xc6, 0xe6, 0xf6, 0xfe, 0xde, 0xce, 0xc6, 0xc6, 0xc6, 0xc6,
6230x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6,
6240xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x66,
6250x66, 0x66, 0x7c, 0x60, 0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00,
6260x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xd6, 0xde, 0x7c,
6270x0c, 0x0e, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x66, 0x66, 0x66, 0x7c, 0x6c,
6280x66, 0x66, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6,
6290xc6, 0x60, 0x38, 0x0c, 0x06, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
6300x00, 0x00, 0xff, 0xdb, 0x99, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c,
6310x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6,
6320xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0xc3,
6330xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0x66, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00,
6340x00, 0x00, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xdb, 0xdb, 0xff, 0x66, 0x66,
6350x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0xc3, 0x66, 0x3c, 0x18, 0x18,
6360x3c, 0x66, 0xc3, 0xc3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0xc3,
6370xc3, 0x66, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00,
6380x00, 0x00, 0xff, 0xc3, 0x86, 0x0c, 0x18, 0x30, 0x60, 0xc1, 0xc3, 0xff,
6390x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x30, 0x30, 0x30, 0x30, 0x30,
6400x30, 0x30, 0x30, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
6410xc0, 0xe0, 0x70, 0x38, 0x1c, 0x0e, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00,
6420x00, 0x00, 0x3c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x3c,
6430x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0x00, 0x00, 0x00, 0x00,
6440x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6450x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00,
6460x30, 0x30, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6470x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x0c, 0x7c,
6480xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x60,
6490x60, 0x78, 0x6c, 0x66, 0x66, 0x66, 0x66, 0x7c, 0x00, 0x00, 0x00, 0x00,
6500x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc0, 0xc0, 0xc0, 0xc6, 0x7c,
6510x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x0c, 0x0c, 0x3c, 0x6c, 0xcc,
6520xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6530x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
6540x00, 0x00, 0x38, 0x6c, 0x64, 0x60, 0xf0, 0x60, 0x60, 0x60, 0x60, 0xf0,
6550x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xcc, 0xcc,
6560xcc, 0xcc, 0xcc, 0x7c, 0x0c, 0xcc, 0x78, 0x00, 0x00, 0x00, 0xe0, 0x60,
6570x60, 0x6c, 0x76, 0x66, 0x66, 0x66, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00,
6580x00, 0x00, 0x18, 0x18, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c,
6590x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, 0x00, 0x0e, 0x06, 0x06,
6600x06, 0x06, 0x06, 0x06, 0x66, 0x66, 0x3c, 0x00, 0x00, 0x00, 0xe0, 0x60,
6610x60, 0x66, 0x6c, 0x78, 0x78, 0x6c, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00,
6620x00, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c,
6630x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe6, 0xff, 0xdb,
6640xdb, 0xdb, 0xdb, 0xdb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6650x00, 0xdc, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00,
6660x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c,
6670x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x66, 0x66,
6680x66, 0x66, 0x66, 0x7c, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00,
6690x00, 0x76, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x7c, 0x0c, 0x0c, 0x1e, 0x00,
6700x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x76, 0x66, 0x60, 0x60, 0x60, 0xf0,
6710x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0x60,
6720x38, 0x0c, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x30,
6730x30, 0xfc, 0x30, 0x30, 0x30, 0x30, 0x36, 0x1c, 0x00, 0x00, 0x00, 0x00,
6740x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76,
6750x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0xc3, 0xc3,
6760xc3, 0x66, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6770x00, 0xc3, 0xc3, 0xc3, 0xdb, 0xdb, 0xff, 0x66, 0x00, 0x00, 0x00, 0x00,
6780x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0x66, 0x3c, 0x18, 0x3c, 0x66, 0xc3,
6790x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0xc6, 0xc6,
6800xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x0c, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00,
6810x00, 0xfe, 0xcc, 0x18, 0x30, 0x60, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00,
6820x00, 0x00, 0x0e, 0x18, 0x18, 0x18, 0x70, 0x18, 0x18, 0x18, 0x18, 0x0e,
6830x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x00, 0x18,
6840x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x18,
6850x18, 0x18, 0x0e, 0x18, 0x18, 0x18, 0x18, 0x70, 0x00, 0x00, 0x00, 0x00,
6860x00, 0x00, 0x76, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6870x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6c, 0xc6,
6880xc6, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x66,
6890xc2, 0xc0, 0xc0, 0xc0, 0xc2, 0x66, 0x3c, 0x0c, 0x06, 0x7c, 0x00, 0x00,
6900x00, 0x00, 0xcc, 0x00, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76,
6910x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x18, 0x30, 0x00, 0x7c, 0xc6, 0xfe,
6920xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6c,
6930x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00,
6940x00, 0x00, 0xcc, 0x00, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76,
6950x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x30, 0x18, 0x00, 0x78, 0x0c, 0x7c,
6960xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6c, 0x38,
6970x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00,
6980x00, 0x00, 0x00, 0x00, 0x3c, 0x66, 0x60, 0x60, 0x66, 0x3c, 0x0c, 0x06,
6990x3c, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6c, 0x00, 0x7c, 0xc6, 0xfe,
7000xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x00,
7010x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
7020x00, 0x60, 0x30, 0x18, 0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c,
7030x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x00, 0x00, 0x38, 0x18, 0x18,
7040x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3c, 0x66,
7050x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00,
7060x00, 0x60, 0x30, 0x18, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c,
7070x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0xc6,
7080xfe, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6c, 0x38, 0x00,
7090x38, 0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00,
7100x18, 0x30, 0x60, 0x00, 0xfe, 0x66, 0x60, 0x7c, 0x60, 0x60, 0x66, 0xfe,
7110x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6e, 0x3b, 0x1b,
7120x7e, 0xd8, 0xdc, 0x77, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x6c,
7130xcc, 0xcc, 0xfe, 0xcc, 0xcc, 0xcc, 0xcc, 0xce, 0x00, 0x00, 0x00, 0x00,
7140x00, 0x10, 0x38, 0x6c, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c,
7150x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x00, 0x00, 0x7c, 0xc6, 0xc6,
7160xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x30, 0x18,
7170x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
7180x00, 0x30, 0x78, 0xcc, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76,
7190x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x30, 0x18, 0x00, 0xcc, 0xcc, 0xcc,
7200xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x00,
7210x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x0c, 0x78, 0x00,
7220x00, 0xc6, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c,
7230x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6,
7240xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x7e,
7250xc3, 0xc0, 0xc0, 0xc0, 0xc3, 0x7e, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00,
7260x00, 0x38, 0x6c, 0x64, 0x60, 0xf0, 0x60, 0x60, 0x60, 0x60, 0xe6, 0xfc,
7270x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0x66, 0x3c, 0x18, 0xff, 0x18,
7280xff, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x66, 0x66,
7290x7c, 0x62, 0x66, 0x6f, 0x66, 0x66, 0x66, 0xf3, 0x00, 0x00, 0x00, 0x00,
7300x00, 0x0e, 0x1b, 0x18, 0x18, 0x18, 0x7e, 0x18, 0x18, 0x18, 0x18, 0x18,
7310xd8, 0x70, 0x00, 0x00, 0x00, 0x18, 0x30, 0x60, 0x00, 0x78, 0x0c, 0x7c,
7320xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x18, 0x30,
7330x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00,
7340x00, 0x18, 0x30, 0x60, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c,
7350x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x30, 0x60, 0x00, 0xcc, 0xcc, 0xcc,
7360xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xdc,
7370x00, 0xdc, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00,
7380x76, 0xdc, 0x00, 0xc6, 0xe6, 0xf6, 0xfe, 0xde, 0xce, 0xc6, 0xc6, 0xc6,
7390x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x6c, 0x6c, 0x3e, 0x00, 0x7e, 0x00,
7400x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6c, 0x6c,
7410x38, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7420x00, 0x00, 0x30, 0x30, 0x00, 0x30, 0x30, 0x60, 0xc0, 0xc6, 0xc6, 0x7c,
7430x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xc0,
7440xc0, 0xc0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7450x00, 0x00, 0xfe, 0x06, 0x06, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00,
7460x00, 0xc0, 0xc0, 0xc2, 0xc6, 0xcc, 0x18, 0x30, 0x60, 0xce, 0x9b, 0x06,
7470x0c, 0x1f, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0xc2, 0xc6, 0xcc, 0x18, 0x30,
7480x66, 0xce, 0x96, 0x3e, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18,
7490x00, 0x18, 0x18, 0x18, 0x3c, 0x3c, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00,
7500x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x6c, 0xd8, 0x6c, 0x36, 0x00, 0x00,
7510x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd8, 0x6c, 0x36,
7520x6c, 0xd8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x44, 0x11, 0x44,
7530x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44,
7540x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa,
7550x55, 0xaa, 0x55, 0xaa, 0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77,
7560xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77, 0x18, 0x18, 0x18, 0x18,
7570x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
7580x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, 0x18, 0x18, 0x18, 0x18,
7590x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, 0x18, 0xf8,
7600x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x36, 0x36, 0x36, 0x36,
7610x36, 0x36, 0x36, 0xf6, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
7620x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x36, 0x36, 0x36, 0x36,
7630x36, 0x36, 0x36, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x18, 0xf8,
7640x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x36, 0x36, 0x36, 0x36,
7650x36, 0xf6, 0x06, 0xf6, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
7660x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
7670x36, 0x36, 0x36, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x06, 0xf6,
7680x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
7690x36, 0xf6, 0x06, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7700x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xfe, 0x00, 0x00, 0x00, 0x00,
7710x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, 0x18, 0xf8,
7720x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7730x00, 0x00, 0x00, 0xf8, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
7740x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1f, 0x00, 0x00, 0x00, 0x00,
7750x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xff,
7760x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7770x00, 0x00, 0x00, 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
7780x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1f, 0x18, 0x18, 0x18, 0x18,
7790x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff,
7800x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18,
7810x18, 0x18, 0x18, 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
7820x18, 0x18, 0x18, 0x18, 0x18, 0x1f, 0x18, 0x1f, 0x18, 0x18, 0x18, 0x18,
7830x18, 0x18, 0x18, 0x18, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x37,
7840x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
7850x36, 0x37, 0x30, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7860x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x30, 0x37, 0x36, 0x36, 0x36, 0x36,
7870x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xf7, 0x00, 0xff,
7880x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7890x00, 0xff, 0x00, 0xf7, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
7900x36, 0x36, 0x36, 0x36, 0x36, 0x37, 0x30, 0x37, 0x36, 0x36, 0x36, 0x36,
7910x36, 0x36, 0x36, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff,
7920x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x36, 0x36, 0x36,
7930x36, 0xf7, 0x00, 0xf7, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
7940x18, 0x18, 0x18, 0x18, 0x18, 0xff, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00,
7950x00, 0x00, 0x00, 0x00, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xff,
7960x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7970x00, 0xff, 0x00, 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
7980x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x36, 0x36, 0x36, 0x36,
7990x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x3f,
8000x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18,
8010x18, 0x1f, 0x18, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
8020x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x18, 0x1f, 0x18, 0x18, 0x18, 0x18,
8030x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f,
8040x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
8050x36, 0x36, 0x36, 0xff, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
8060x18, 0x18, 0x18, 0x18, 0x18, 0xff, 0x18, 0xff, 0x18, 0x18, 0x18, 0x18,
8070x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8,
8080x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
8090x00, 0x00, 0x00, 0x1f, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
8100xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
8110xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff,
8120xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0,
8130xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0,
8140x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f,
8150x0f, 0x0f, 0x0f, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,
8160x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
8170x00, 0x76, 0xdc, 0xd8, 0xd8, 0xd8, 0xdc, 0x76, 0x00, 0x00, 0x00, 0x00,
8180x00, 0x00, 0x78, 0xcc, 0xcc, 0xcc, 0xd8, 0xcc, 0xc6, 0xc6, 0xc6, 0xcc,
8190x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xc6, 0xc6, 0xc0, 0xc0, 0xc0,
8200xc0, 0xc0, 0xc0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
8210xfe, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x00, 0x00, 0x00, 0x00,
8220x00, 0x00, 0x00, 0xfe, 0xc6, 0x60, 0x30, 0x18, 0x30, 0x60, 0xc6, 0xfe,
8230x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0xd8, 0xd8,
8240xd8, 0xd8, 0xd8, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
8250x66, 0x66, 0x66, 0x66, 0x66, 0x7c, 0x60, 0x60, 0xc0, 0x00, 0x00, 0x00,
8260x00, 0x00, 0x00, 0x00, 0x76, 0xdc, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
8270x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x18, 0x3c, 0x66, 0x66,
8280x66, 0x3c, 0x18, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38,
8290x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0x6c, 0x38, 0x00, 0x00, 0x00, 0x00,
8300x00, 0x00, 0x38, 0x6c, 0xc6, 0xc6, 0xc6, 0x6c, 0x6c, 0x6c, 0x6c, 0xee,
8310x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x30, 0x18, 0x0c, 0x3e, 0x66,
8320x66, 0x66, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
8330x00, 0x7e, 0xdb, 0xdb, 0xdb, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
8340x00, 0x00, 0x00, 0x03, 0x06, 0x7e, 0xdb, 0xdb, 0xf3, 0x7e, 0x60, 0xc0,
8350x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x30, 0x60, 0x60, 0x7c, 0x60,
8360x60, 0x60, 0x30, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c,
8370xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00,
8380x00, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0xfe, 0x00, 0x00, 0xfe, 0x00,
8390x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x7e, 0x18,
8400x18, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30,
8410x18, 0x0c, 0x06, 0x0c, 0x18, 0x30, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00,
8420x00, 0x00, 0x00, 0x0c, 0x18, 0x30, 0x60, 0x30, 0x18, 0x0c, 0x00, 0x7e,
8430x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x1b, 0x1b, 0x1b, 0x18, 0x18,
8440x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
8450x18, 0x18, 0x18, 0x18, 0xd8, 0xd8, 0xd8, 0x70, 0x00, 0x00, 0x00, 0x00,
8460x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x7e, 0x00, 0x18, 0x18, 0x00,
8470x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xdc, 0x00,
8480x76, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6c, 0x6c,
8490x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
8500x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00,
8510x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
8520x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0c, 0x0c,
8530x0c, 0x0c, 0x0c, 0xec, 0x6c, 0x6c, 0x3c, 0x1c, 0x00, 0x00, 0x00, 0x00,
8540x00, 0xd8, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00,
8550x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0xd8, 0x30, 0x60, 0xc8, 0xf8, 0x00,
8560x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
8570x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00,
8580x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
8590x00, 0x00, 0x00, 0x00,
860};
diff --git a/arch/ppc/syslib/cpc700.h b/arch/ppc/syslib/cpc700.h
deleted file mode 100644
index 987e9aa0dd45..000000000000
--- a/arch/ppc/syslib/cpc700.h
+++ /dev/null
@@ -1,96 +0,0 @@
1/*
2 * Header file for IBM CPC700 Host Bridge, et. al.
3 *
4 * Author: Mark A. Greer
5 * mgreer@mvista.com
6 *
7 * 2000-2002 (c) MontaVista, Software, Inc. This file is licensed under
8 * the terms of the GNU General Public License version 2. This program
9 * is licensed "as is" without any warranty of any kind, whether express
10 * or implied.
11 */
12
13/*
14 * This file contains the defines and macros for the IBM CPC700 host bridge,
15 * memory controller, PIC, UARTs, IIC, and Timers.
16 */
17
18#ifndef __PPC_SYSLIB_CPC700_H__
19#define __PPC_SYSLIB_CPC700_H__
20
21#include <linux/stddef.h>
22#include <linux/types.h>
23#include <linux/init.h>
24
25/* XXX no barriers? not even any volatiles? -- paulus */
26#define CPC700_OUT_32(a,d) (*(u_int *)a = d)
27#define CPC700_IN_32(a) (*(u_int *)a)
28
29/*
30 * PCI Section
31 */
32#define CPC700_PCI_CONFIG_ADDR 0xfec00000
33#define CPC700_PCI_CONFIG_DATA 0xfec00004
34
35/* CPU -> PCI memory window 0 */
36#define CPC700_PMM0_LOCAL 0xff400000 /* CPU physical addr */
37#define CPC700_PMM0_MASK_ATTR 0xff400004 /* size and attrs */
38#define CPC700_PMM0_PCI_LOW 0xff400008 /* PCI addr, low word */
39#define CPC700_PMM0_PCI_HIGH 0xff40000c /* PCI addr, high wd */
40/* CPU -> PCI memory window 1 */
41#define CPC700_PMM1_LOCAL 0xff400010
42#define CPC700_PMM1_MASK_ATTR 0xff400014
43#define CPC700_PMM1_PCI_LOW 0xff400018
44#define CPC700_PMM1_PCI_HIGH 0xff40001c
45/* CPU -> PCI memory window 2 */
46#define CPC700_PMM2_LOCAL 0xff400020
47#define CPC700_PMM2_MASK_ATTR 0xff400024
48#define CPC700_PMM2_PCI_LOW 0xff400028
49#define CPC700_PMM2_PCI_HIGH 0xff40002c
50/* PCI memory -> CPU window 1 */
51#define CPC700_PTM1_MEMSIZE 0xff400030 /* window size */
52#define CPC700_PTM1_LOCAL 0xff400034 /* CPU phys addr */
53/* PCI memory -> CPU window 2 */
54#define CPC700_PTM2_MEMSIZE 0xff400038 /* size and enable */
55#define CPC700_PTM2_LOCAL 0xff40003c
56
57/*
58 * PIC Section
59 *
60 * IBM calls the CPC700's programmable interrupt controller the Universal
61 * Interrupt Controller or UIC.
62 */
63
64/*
65 * UIC Register Addresses.
66 */
67#define CPC700_UIC_UICSR 0xff500880 /* Status Reg (Rd/Clr)*/
68#define CPC700_UIC_UICSRS 0xff500884 /* Status Reg (Set) */
69#define CPC700_UIC_UICER 0xff500888 /* Enable Reg */
70#define CPC700_UIC_UICCR 0xff50088c /* Critical Reg */
71#define CPC700_UIC_UICPR 0xff500890 /* Polarity Reg */
72#define CPC700_UIC_UICTR 0xff500894 /* Trigger Reg */
73#define CPC700_UIC_UICMSR 0xff500898 /* Masked Status Reg */
74#define CPC700_UIC_UICVR 0xff50089c /* Vector Reg */
75#define CPC700_UIC_UICVCR 0xff5008a0 /* Vector Config Reg */
76
77#define CPC700_UIC_UICER_ENABLE 0x00000001 /* Enable an IRQ */
78
79#define CPC700_UIC_UICVCR_31_HI 0x00000000 /* IRQ 31 hi priority */
80#define CPC700_UIC_UICVCR_0_HI 0x00000001 /* IRQ 0 hi priority */
81#define CPC700_UIC_UICVCR_BASE_MASK 0xfffffffc
82#define CPC700_UIC_UICVCR_ORDER_MASK 0x00000001
83
84/* Specify value of a bit for an IRQ. */
85#define CPC700_UIC_IRQ_BIT(i) ((0x00000001) << (31 - (i)))
86
87/*
88 * UIC Exports...
89 */
90extern struct hw_interrupt_type cpc700_pic;
91extern unsigned int cpc700_irq_assigns[32][2];
92
93extern void __init cpc700_init_IRQ(void);
94extern int cpc700_get_irq(void);
95
96#endif /* __PPC_SYSLIB_CPC700_H__ */
diff --git a/arch/ppc/syslib/cpc700_pic.c b/arch/ppc/syslib/cpc700_pic.c
deleted file mode 100644
index d48e8f45c050..000000000000
--- a/arch/ppc/syslib/cpc700_pic.c
+++ /dev/null
@@ -1,181 +0,0 @@
1/*
2 * Interrupt controller support for IBM Spruce
3 *
4 * Authors: Mark Greer, Matt Porter, and Johnnie Peters
5 * mgreer@mvista.com
6 * mporter@mvista.com
7 * jpeters@mvista.com
8 *
9 * 2001-2002 (c) MontaVista, Software, Inc. This file is licensed under
10 * the terms of the GNU General Public License version 2. This program
11 * is licensed "as is" without any warranty of any kind, whether express
12 * or implied.
13 */
14
15#include <linux/stddef.h>
16#include <linux/init.h>
17#include <linux/sched.h>
18#include <linux/signal.h>
19#include <linux/irq.h>
20
21#include <asm/io.h>
22#include <asm/system.h>
23#include <asm/irq.h>
24
25#include "cpc700.h"
26
27static void
28cpc700_unmask_irq(unsigned int irq)
29{
30 unsigned int tr_bits;
31
32 /*
33 * IRQ 31 is largest IRQ supported.
34 * IRQs 17-19 are reserved.
35 */
36 if ((irq <= 31) && ((irq < 17) || (irq > 19))) {
37 tr_bits = CPC700_IN_32(CPC700_UIC_UICTR);
38
39 if ((tr_bits & (1 << (31 - irq))) == 0) {
40 /* level trigger interrupt, clear bit in status
41 * register */
42 CPC700_OUT_32(CPC700_UIC_UICSR, 1 << (31 - irq));
43 }
44
45 /* Know IRQ fits in entry 0 of ppc_cached_irq_mask[] */
46 ppc_cached_irq_mask[0] |= CPC700_UIC_IRQ_BIT(irq);
47
48 CPC700_OUT_32(CPC700_UIC_UICER, ppc_cached_irq_mask[0]);
49 }
50 return;
51}
52
53static void
54cpc700_mask_irq(unsigned int irq)
55{
56 /*
57 * IRQ 31 is largest IRQ supported.
58 * IRQs 17-19 are reserved.
59 */
60 if ((irq <= 31) && ((irq < 17) || (irq > 19))) {
61 /* Know IRQ fits in entry 0 of ppc_cached_irq_mask[] */
62 ppc_cached_irq_mask[0] &=
63 ~CPC700_UIC_IRQ_BIT(irq);
64
65 CPC700_OUT_32(CPC700_UIC_UICER, ppc_cached_irq_mask[0]);
66 }
67 return;
68}
69
70static void
71cpc700_mask_and_ack_irq(unsigned int irq)
72{
73 u_int bit;
74
75 /*
76 * IRQ 31 is largest IRQ supported.
77 * IRQs 17-19 are reserved.
78 */
79 if ((irq <= 31) && ((irq < 17) || (irq > 19))) {
80 /* Know IRQ fits in entry 0 of ppc_cached_irq_mask[] */
81 bit = CPC700_UIC_IRQ_BIT(irq);
82
83 ppc_cached_irq_mask[0] &= ~bit;
84 CPC700_OUT_32(CPC700_UIC_UICER, ppc_cached_irq_mask[0]);
85 CPC700_OUT_32(CPC700_UIC_UICSR, bit); /* Write 1 clears IRQ */
86 }
87 return;
88}
89
90static struct hw_interrupt_type cpc700_pic = {
91 .typename = "CPC700 PIC",
92 .enable = cpc700_unmask_irq,
93 .disable = cpc700_mask_irq,
94 .ack = cpc700_mask_and_ack_irq,
95};
96
97__init static void
98cpc700_pic_init_irq(unsigned int irq)
99{
100 unsigned int tmp;
101
102 /* Set interrupt sense */
103 tmp = CPC700_IN_32(CPC700_UIC_UICTR);
104 if (cpc700_irq_assigns[irq][0] == 0) {
105 tmp &= ~CPC700_UIC_IRQ_BIT(irq);
106 } else {
107 tmp |= CPC700_UIC_IRQ_BIT(irq);
108 }
109 CPC700_OUT_32(CPC700_UIC_UICTR, tmp);
110
111 /* Set interrupt polarity */
112 tmp = CPC700_IN_32(CPC700_UIC_UICPR);
113 if (cpc700_irq_assigns[irq][1]) {
114 tmp |= CPC700_UIC_IRQ_BIT(irq);
115 } else {
116 tmp &= ~CPC700_UIC_IRQ_BIT(irq);
117 }
118 CPC700_OUT_32(CPC700_UIC_UICPR, tmp);
119
120 /* Set interrupt critical */
121 tmp = CPC700_IN_32(CPC700_UIC_UICCR);
122 tmp |= CPC700_UIC_IRQ_BIT(irq);
123 CPC700_OUT_32(CPC700_UIC_UICCR, tmp);
124
125 return;
126}
127
128__init void
129cpc700_init_IRQ(void)
130{
131 int i;
132
133 ppc_cached_irq_mask[0] = 0;
134 CPC700_OUT_32(CPC700_UIC_UICER, 0x00000000); /* Disable all irq's */
135 CPC700_OUT_32(CPC700_UIC_UICSR, 0xffffffff); /* Clear cur intrs */
136 CPC700_OUT_32(CPC700_UIC_UICCR, 0xffffffff); /* Gen INT not MCP */
137 CPC700_OUT_32(CPC700_UIC_UICPR, 0x00000000); /* Active low */
138 CPC700_OUT_32(CPC700_UIC_UICTR, 0x00000000); /* Level Sensitive */
139 CPC700_OUT_32(CPC700_UIC_UICVR, CPC700_UIC_UICVCR_0_HI);
140 /* IRQ 0 is highest */
141
142 for (i = 0; i < 17; i++) {
143 irq_desc[i].chip = &cpc700_pic;
144 cpc700_pic_init_irq(i);
145 }
146
147 for (i = 20; i < 32; i++) {
148 irq_desc[i].chip = &cpc700_pic;
149 cpc700_pic_init_irq(i);
150 }
151
152 return;
153}
154
155
156
157/*
158 * Find the highest IRQ that generating an interrupt, if any.
159 */
160int
161cpc700_get_irq(void)
162{
163 int irq = 0;
164 u_int irq_status, irq_test = 1;
165
166 irq_status = CPC700_IN_32(CPC700_UIC_UICMSR);
167
168 do
169 {
170 if (irq_status & irq_test)
171 break;
172 irq++;
173 irq_test <<= 1;
174 } while (irq < NR_IRQS);
175
176
177 if (irq == NR_IRQS)
178 irq = 33;
179
180 return (31 - irq);
181}
diff --git a/arch/ppc/syslib/cpm2_common.c b/arch/ppc/syslib/cpm2_common.c
deleted file mode 100644
index 6cd859d7721f..000000000000
--- a/arch/ppc/syslib/cpm2_common.c
+++ /dev/null
@@ -1,196 +0,0 @@
1/*
2 * General Purpose functions for the global management of the
3 * 8260 Communication Processor Module.
4 * Copyright (c) 1999 Dan Malek (dmalek@jlc.net)
5 * Copyright (c) 2000 MontaVista Software, Inc (source@mvista.com)
6 * 2.3.99 Updates
7 *
8 * In addition to the individual control of the communication
9 * channels, there are a few functions that globally affect the
10 * communication processor.
11 *
12 * Buffer descriptors must be allocated from the dual ported memory
13 * space. The allocator for that is here. When the communication
14 * process is reset, we reclaim the memory available. There is
15 * currently no deallocator for this memory.
16 */
17#include <linux/errno.h>
18#include <linux/sched.h>
19#include <linux/kernel.h>
20#include <linux/param.h>
21#include <linux/string.h>
22#include <linux/mm.h>
23#include <linux/interrupt.h>
24#include <linux/module.h>
25#include <asm/io.h>
26#include <asm/irq.h>
27#include <asm/mpc8260.h>
28#include <asm/page.h>
29#include <asm/pgtable.h>
30#include <asm/cpm2.h>
31#include <asm/rheap.h>
32
33static void cpm2_dpinit(void);
34cpm_cpm2_t *cpmp; /* Pointer to comm processor space */
35
36/* We allocate this here because it is used almost exclusively for
37 * the communication processor devices.
38 */
39cpm2_map_t *cpm2_immr;
40
41#define CPM_MAP_SIZE (0x40000) /* 256k - the PQ3 reserve this amount
42 of space for CPM as it is larger
43 than on PQ2 */
44
45void
46cpm2_reset(void)
47{
48 cpm2_immr = (cpm2_map_t *)ioremap(CPM_MAP_ADDR, CPM_MAP_SIZE);
49
50 /* Reclaim the DP memory for our use.
51 */
52 cpm2_dpinit();
53
54 /* Tell everyone where the comm processor resides.
55 */
56 cpmp = &cpm2_immr->im_cpm;
57}
58
59/* Set a baud rate generator. This needs lots of work. There are
60 * eight BRGs, which can be connected to the CPM channels or output
61 * as clocks. The BRGs are in two different block of internal
62 * memory mapped space.
63 * The baud rate clock is the system clock divided by something.
64 * It was set up long ago during the initial boot phase and is
65 * is given to us.
66 * Baud rate clocks are zero-based in the driver code (as that maps
67 * to port numbers). Documentation uses 1-based numbering.
68 */
69#define BRG_INT_CLK (((bd_t *)__res)->bi_brgfreq)
70#define BRG_UART_CLK (BRG_INT_CLK/16)
71
72/* This function is used by UARTS, or anything else that uses a 16x
73 * oversampled clock.
74 */
75void
76cpm_setbrg(uint brg, uint rate)
77{
78 volatile uint *bp;
79
80 /* This is good enough to get SMCs running.....
81 */
82 if (brg < 4) {
83 bp = (uint *)&cpm2_immr->im_brgc1;
84 }
85 else {
86 bp = (uint *)&cpm2_immr->im_brgc5;
87 brg -= 4;
88 }
89 bp += brg;
90 *bp = ((BRG_UART_CLK / rate) << 1) | CPM_BRG_EN;
91}
92
93/* This function is used to set high speed synchronous baud rate
94 * clocks.
95 */
96void
97cpm2_fastbrg(uint brg, uint rate, int div16)
98{
99 volatile uint *bp;
100
101 if (brg < 4) {
102 bp = (uint *)&cpm2_immr->im_brgc1;
103 }
104 else {
105 bp = (uint *)&cpm2_immr->im_brgc5;
106 brg -= 4;
107 }
108 bp += brg;
109 *bp = ((BRG_INT_CLK / rate) << 1) | CPM_BRG_EN;
110 if (div16)
111 *bp |= CPM_BRG_DIV16;
112}
113
114/*
115 * dpalloc / dpfree bits.
116 */
117static spinlock_t cpm_dpmem_lock;
118/* 16 blocks should be enough to satisfy all requests
119 * until the memory subsystem goes up... */
120static rh_block_t cpm_boot_dpmem_rh_block[16];
121static rh_info_t cpm_dpmem_info;
122
123static void cpm2_dpinit(void)
124{
125 spin_lock_init(&cpm_dpmem_lock);
126
127 /* initialize the info header */
128 rh_init(&cpm_dpmem_info, 1,
129 sizeof(cpm_boot_dpmem_rh_block) /
130 sizeof(cpm_boot_dpmem_rh_block[0]),
131 cpm_boot_dpmem_rh_block);
132
133 /* Attach the usable dpmem area */
134 /* XXX: This is actually crap. CPM_DATAONLY_BASE and
135 * CPM_DATAONLY_SIZE is only a subset of the available dpram. It
136 * varies with the processor and the microcode patches activated.
137 * But the following should be at least safe.
138 */
139 rh_attach_region(&cpm_dpmem_info, CPM_DATAONLY_BASE, CPM_DATAONLY_SIZE);
140}
141
142/* This function returns an index into the DPRAM area.
143 */
144unsigned long cpm_dpalloc(uint size, uint align)
145{
146 unsigned long start;
147 unsigned long flags;
148
149 spin_lock_irqsave(&cpm_dpmem_lock, flags);
150 cpm_dpmem_info.alignment = align;
151 start = rh_alloc(&cpm_dpmem_info, size, "commproc");
152 spin_unlock_irqrestore(&cpm_dpmem_lock, flags);
153
154 return start;
155}
156EXPORT_SYMBOL(cpm_dpalloc);
157
158int cpm_dpfree(unsigned long offset)
159{
160 int ret;
161 unsigned long flags;
162
163 spin_lock_irqsave(&cpm_dpmem_lock, flags);
164 ret = rh_free(&cpm_dpmem_info, offset);
165 spin_unlock_irqrestore(&cpm_dpmem_lock, flags);
166
167 return ret;
168}
169EXPORT_SYMBOL(cpm_dpfree);
170
171/* not sure if this is ever needed */
172unsigned long cpm_dpalloc_fixed(unsigned long offset, uint size, uint align)
173{
174 unsigned long start;
175 unsigned long flags;
176
177 spin_lock_irqsave(&cpm_dpmem_lock, flags);
178 cpm_dpmem_info.alignment = align;
179 start = rh_alloc_fixed(&cpm_dpmem_info, offset, size, "commproc");
180 spin_unlock_irqrestore(&cpm_dpmem_lock, flags);
181
182 return start;
183}
184EXPORT_SYMBOL(cpm_dpalloc_fixed);
185
186void cpm_dpdump(void)
187{
188 rh_dump(&cpm_dpmem_info);
189}
190EXPORT_SYMBOL(cpm_dpdump);
191
192void *cpm_dpram_addr(unsigned long offset)
193{
194 return (void *)&cpm2_immr->im_dprambase[offset];
195}
196EXPORT_SYMBOL(cpm_dpram_addr);
diff --git a/arch/ppc/syslib/cpm2_pic.c b/arch/ppc/syslib/cpm2_pic.c
deleted file mode 100644
index fb2d5842641a..000000000000
--- a/arch/ppc/syslib/cpm2_pic.c
+++ /dev/null
@@ -1,177 +0,0 @@
1/* The CPM2 internal interrupt controller. It is usually
2 * the only interrupt controller.
3 * There are two 32-bit registers (high/low) for up to 64
4 * possible interrupts.
5 *
6 * Now, the fun starts.....Interrupt Numbers DO NOT MAP
7 * in a simple arithmetic fashion to mask or pending registers.
8 * That is, interrupt 4 does not map to bit position 4.
9 * We create two tables, indexed by vector number, to indicate
10 * which register to use and which bit in the register to use.
11 */
12
13#include <linux/stddef.h>
14#include <linux/init.h>
15#include <linux/sched.h>
16#include <linux/signal.h>
17#include <linux/irq.h>
18
19#include <asm/immap_cpm2.h>
20#include <asm/mpc8260.h>
21
22#include "cpm2_pic.h"
23
24static u_char irq_to_siureg[] = {
25 1, 1, 1, 1, 1, 1, 1, 1,
26 1, 1, 1, 1, 1, 1, 1, 1,
27 0, 0, 0, 0, 0, 0, 0, 0,
28 0, 0, 0, 0, 0, 0, 0, 0,
29 1, 1, 1, 1, 1, 1, 1, 1,
30 1, 1, 1, 1, 1, 1, 1, 1,
31 0, 0, 0, 0, 0, 0, 0, 0,
32 0, 0, 0, 0, 0, 0, 0, 0
33};
34
35/* bit numbers do not match the docs, these are precomputed so the bit for
36 * a given irq is (1 << irq_to_siubit[irq]) */
37static u_char irq_to_siubit[] = {
38 0, 15, 14, 13, 12, 11, 10, 9,
39 8, 7, 6, 5, 4, 3, 2, 1,
40 2, 1, 0, 14, 13, 12, 11, 10,
41 9, 8, 7, 6, 5, 4, 3, 0,
42 31, 30, 29, 28, 27, 26, 25, 24,
43 23, 22, 21, 20, 19, 18, 17, 16,
44 16, 17, 18, 19, 20, 21, 22, 23,
45 24, 25, 26, 27, 28, 29, 30, 31,
46};
47
48static void cpm2_mask_irq(unsigned int irq_nr)
49{
50 int bit, word;
51 volatile uint *simr;
52
53 irq_nr -= CPM_IRQ_OFFSET;
54
55 bit = irq_to_siubit[irq_nr];
56 word = irq_to_siureg[irq_nr];
57
58 simr = &(cpm2_immr->im_intctl.ic_simrh);
59 ppc_cached_irq_mask[word] &= ~(1 << bit);
60 simr[word] = ppc_cached_irq_mask[word];
61}
62
63static void cpm2_unmask_irq(unsigned int irq_nr)
64{
65 int bit, word;
66 volatile uint *simr;
67
68 irq_nr -= CPM_IRQ_OFFSET;
69
70 bit = irq_to_siubit[irq_nr];
71 word = irq_to_siureg[irq_nr];
72
73 simr = &(cpm2_immr->im_intctl.ic_simrh);
74 ppc_cached_irq_mask[word] |= 1 << bit;
75 simr[word] = ppc_cached_irq_mask[word];
76}
77
78static void cpm2_mask_and_ack(unsigned int irq_nr)
79{
80 int bit, word;
81 volatile uint *simr, *sipnr;
82
83 irq_nr -= CPM_IRQ_OFFSET;
84
85 bit = irq_to_siubit[irq_nr];
86 word = irq_to_siureg[irq_nr];
87
88 simr = &(cpm2_immr->im_intctl.ic_simrh);
89 sipnr = &(cpm2_immr->im_intctl.ic_sipnrh);
90 ppc_cached_irq_mask[word] &= ~(1 << bit);
91 simr[word] = ppc_cached_irq_mask[word];
92 sipnr[word] = 1 << bit;
93}
94
95static void cpm2_end_irq(unsigned int irq_nr)
96{
97 int bit, word;
98 volatile uint *simr;
99
100 if (!(irq_desc[irq_nr].status & (IRQ_DISABLED|IRQ_INPROGRESS))
101 && irq_desc[irq_nr].action) {
102
103 irq_nr -= CPM_IRQ_OFFSET;
104 bit = irq_to_siubit[irq_nr];
105 word = irq_to_siureg[irq_nr];
106
107 simr = &(cpm2_immr->im_intctl.ic_simrh);
108 ppc_cached_irq_mask[word] |= 1 << bit;
109 simr[word] = ppc_cached_irq_mask[word];
110 /*
111 * Work around large numbers of spurious IRQs on PowerPC 82xx
112 * systems.
113 */
114 mb();
115 }
116}
117
118static struct hw_interrupt_type cpm2_pic = {
119 .typename = " CPM2 SIU ",
120 .enable = cpm2_unmask_irq,
121 .disable = cpm2_mask_irq,
122 .ack = cpm2_mask_and_ack,
123 .end = cpm2_end_irq,
124};
125
126int cpm2_get_irq(void)
127{
128 int irq;
129 unsigned long bits;
130
131 /* For CPM2, read the SIVEC register and shift the bits down
132 * to get the irq number. */
133 bits = cpm2_immr->im_intctl.ic_sivec;
134 irq = bits >> 26;
135
136 if (irq == 0)
137 return(-1);
138 return irq+CPM_IRQ_OFFSET;
139}
140
141void cpm2_init_IRQ(void)
142{
143 int i;
144
145 /* Clear the CPM IRQ controller, in case it has any bits set
146 * from the bootloader
147 */
148
149 /* Mask out everything */
150 cpm2_immr->im_intctl.ic_simrh = 0x00000000;
151 cpm2_immr->im_intctl.ic_simrl = 0x00000000;
152 wmb();
153
154 /* Ack everything */
155 cpm2_immr->im_intctl.ic_sipnrh = 0xffffffff;
156 cpm2_immr->im_intctl.ic_sipnrl = 0xffffffff;
157 wmb();
158
159 /* Dummy read of the vector */
160 i = cpm2_immr->im_intctl.ic_sivec;
161 rmb();
162
163 /* Initialize the default interrupt mapping priorities,
164 * in case the boot rom changed something on us.
165 */
166 cpm2_immr->im_intctl.ic_sicr = 0;
167 cpm2_immr->im_intctl.ic_scprrh = 0x05309770;
168 cpm2_immr->im_intctl.ic_scprrl = 0x05309770;
169
170
171 /* Enable chaining to OpenPIC, and make everything level
172 */
173 for (i = 0; i < NR_CPM_INTS; i++) {
174 irq_desc[i+CPM_IRQ_OFFSET].chip = &cpm2_pic;
175 irq_desc[i+CPM_IRQ_OFFSET].status |= IRQ_LEVEL;
176 }
177}
diff --git a/arch/ppc/syslib/cpm2_pic.h b/arch/ppc/syslib/cpm2_pic.h
deleted file mode 100644
index 467339337a78..000000000000
--- a/arch/ppc/syslib/cpm2_pic.h
+++ /dev/null
@@ -1,8 +0,0 @@
1#ifndef _PPC_KERNEL_CPM2_H
2#define _PPC_KERNEL_CPM2_H
3
4extern int cpm2_get_irq(void);
5
6extern void cpm2_init_IRQ(void);
7
8#endif /* _PPC_KERNEL_CPM2_H */
diff --git a/arch/ppc/syslib/gen550.h b/arch/ppc/syslib/gen550.h
deleted file mode 100644
index 5254d3cdbca6..000000000000
--- a/arch/ppc/syslib/gen550.h
+++ /dev/null
@@ -1,14 +0,0 @@
1/*
2 * gen550 prototypes
3 *
4 * Matt Porter <mporter@kernel.crashing.org>
5 *
6 * 2004 (c) MontaVista Software, Inc. This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10 */
11
12extern void gen550_progress(char *, unsigned short);
13extern void gen550_init(int, struct uart_port *);
14extern void gen550_kgdb_map_scc(void);
diff --git a/arch/ppc/syslib/gen550_dbg.c b/arch/ppc/syslib/gen550_dbg.c
deleted file mode 100644
index 9293f5c59099..000000000000
--- a/arch/ppc/syslib/gen550_dbg.c
+++ /dev/null
@@ -1,179 +0,0 @@
1/*
2 * A library of polled 16550 serial routines. These are intended to
3 * be used to support progress messages, xmon, kgdb, etc. on a
4 * variety of platforms.
5 *
6 * Adapted from lots of code ripped from the arch/ppc/boot/ polled
7 * 16550 support.
8 *
9 * Author: Matt Porter <mporter@mvista.com>
10 *
11 * 2002-2003 (c) MontaVista Software, Inc. This file is licensed under
12 * the terms of the GNU General Public License version 2. This program
13 * is licensed "as is" without any warranty of any kind, whether express
14 * or implied.
15 */
16
17#include <linux/types.h>
18#include <linux/serial.h>
19#include <linux/tty.h> /* For linux/serial_core.h */
20#include <linux/serial_core.h>
21#include <linux/serialP.h>
22#include <linux/serial_reg.h>
23#include <asm/machdep.h>
24#include <asm/serial.h>
25#include <asm/io.h>
26
27#define SERIAL_BAUD 9600
28
29/* SERIAL_PORT_DFNS is defined in <asm/serial.h> */
30#ifndef SERIAL_PORT_DFNS
31#define SERIAL_PORT_DFNS
32#endif
33
34static struct serial_state rs_table[RS_TABLE_SIZE] = {
35 SERIAL_PORT_DFNS /* defined in <asm/serial.h> */
36};
37
38static void (*serial_outb)(unsigned long, unsigned char);
39static unsigned long (*serial_inb)(unsigned long);
40
41static int shift;
42
43unsigned long direct_inb(unsigned long addr)
44{
45 return readb((void __iomem *)addr);
46}
47
48void direct_outb(unsigned long addr, unsigned char val)
49{
50 writeb(val, (void __iomem *)addr);
51}
52
53unsigned long io_inb(unsigned long port)
54{
55 return inb(port);
56}
57
58void io_outb(unsigned long port, unsigned char val)
59{
60 outb(val, port);
61}
62
63unsigned long serial_init(int chan, void *ignored)
64{
65 unsigned long com_port;
66 unsigned char lcr, dlm;
67
68 /* We need to find out which type io we're expecting. If it's
69 * 'SERIAL_IO_PORT', we get an offset from the isa_io_base.
70 * If it's 'SERIAL_IO_MEM', we can the exact location. -- Tom */
71 switch (rs_table[chan].io_type) {
72 case SERIAL_IO_PORT:
73 com_port = rs_table[chan].port;
74 serial_outb = io_outb;
75 serial_inb = io_inb;
76 break;
77 case SERIAL_IO_MEM:
78 com_port = (unsigned long)rs_table[chan].iomem_base;
79 serial_outb = direct_outb;
80 serial_inb = direct_inb;
81 break;
82 default:
83 /* We can't deal with it. */
84 return -1;
85 }
86
87 /* How far apart the registers are. */
88 shift = rs_table[chan].iomem_reg_shift;
89
90 /* save the LCR */
91 lcr = serial_inb(com_port + (UART_LCR << shift));
92
93 /* Access baud rate */
94 serial_outb(com_port + (UART_LCR << shift), UART_LCR_DLAB);
95 dlm = serial_inb(com_port + (UART_DLM << shift));
96
97 /*
98 * Test if serial port is unconfigured
99 * We assume that no-one uses less than 110 baud or
100 * less than 7 bits per character these days.
101 * -- paulus.
102 */
103 if ((dlm <= 4) && (lcr & 2)) {
104 /* port is configured, put the old LCR back */
105 serial_outb(com_port + (UART_LCR << shift), lcr);
106 }
107 else {
108 /* Input clock. */
109 serial_outb(com_port + (UART_DLL << shift),
110 (rs_table[chan].baud_base / SERIAL_BAUD) & 0xFF);
111 serial_outb(com_port + (UART_DLM << shift),
112 (rs_table[chan].baud_base / SERIAL_BAUD) >> 8);
113 /* 8 data, 1 stop, no parity */
114 serial_outb(com_port + (UART_LCR << shift), 0x03);
115 /* RTS/DTR */
116 serial_outb(com_port + (UART_MCR << shift), 0x03);
117
118 /* Clear & enable FIFOs */
119 serial_outb(com_port + (UART_FCR << shift), 0x07);
120 }
121
122 return (com_port);
123}
124
125void
126serial_putc(unsigned long com_port, unsigned char c)
127{
128 while ((serial_inb(com_port + (UART_LSR << shift)) & UART_LSR_THRE) == 0)
129 ;
130 serial_outb(com_port, c);
131}
132
133unsigned char
134serial_getc(unsigned long com_port)
135{
136 while ((serial_inb(com_port + (UART_LSR << shift)) & UART_LSR_DR) == 0)
137 ;
138 return serial_inb(com_port);
139}
140
141int
142serial_tstc(unsigned long com_port)
143{
144 return ((serial_inb(com_port + (UART_LSR << shift)) & UART_LSR_DR) != 0);
145}
146
147void
148serial_close(unsigned long com_port)
149{
150}
151
152void
153gen550_init(int i, struct uart_port *serial_req)
154{
155 rs_table[i].io_type = serial_req->iotype;
156 rs_table[i].port = serial_req->iobase;
157 rs_table[i].iomem_base = serial_req->membase;
158 rs_table[i].iomem_reg_shift = serial_req->regshift;
159 rs_table[i].baud_base = serial_req->uartclk ? serial_req->uartclk / 16 : BASE_BAUD;
160}
161
162#ifdef CONFIG_SERIAL_TEXT_DEBUG
163void
164gen550_progress(char *s, unsigned short hex)
165{
166 volatile unsigned int progress_debugport;
167 volatile char c;
168
169 progress_debugport = serial_init(0, NULL);
170
171 serial_putc(progress_debugport, '\r');
172
173 while ((c = *s++) != 0)
174 serial_putc(progress_debugport, c);
175
176 serial_putc(progress_debugport, '\n');
177 serial_putc(progress_debugport, '\r');
178}
179#endif /* CONFIG_SERIAL_TEXT_DEBUG */
diff --git a/arch/ppc/syslib/gen550_kgdb.c b/arch/ppc/syslib/gen550_kgdb.c
deleted file mode 100644
index 987cc0414e6e..000000000000
--- a/arch/ppc/syslib/gen550_kgdb.c
+++ /dev/null
@@ -1,83 +0,0 @@
1/*
2 * Generic 16550 kgdb support intended to be useful on a variety
3 * of platforms. To enable this support, it is necessary to set
4 * the CONFIG_GEN550 option. Any virtual mapping of the serial
5 * port(s) to be used can be accomplished by setting
6 * ppc_md.early_serial_map to a platform-specific mapping function.
7 *
8 * Adapted from ppc4xx_kgdb.c.
9 *
10 * Author: Matt Porter <mporter@kernel.crashing.org>
11 *
12 * 2002-2004 (c) MontaVista Software, Inc. This file is licensed under
13 * the terms of the GNU General Public License version 2. This program
14 * is licensed "as is" without any warranty of any kind, whether express
15 * or implied.
16 */
17
18#include <linux/types.h>
19#include <linux/kernel.h>
20
21#include <asm/machdep.h>
22
23extern unsigned long serial_init(int, void *);
24extern unsigned long serial_getc(unsigned long);
25extern unsigned long serial_putc(unsigned long, unsigned char);
26
27#if defined(CONFIG_KGDB_TTYS0)
28#define KGDB_PORT 0
29#elif defined(CONFIG_KGDB_TTYS1)
30#define KGDB_PORT 1
31#elif defined(CONFIG_KGDB_TTYS2)
32#define KGDB_PORT 2
33#elif defined(CONFIG_KGDB_TTYS3)
34#define KGDB_PORT 3
35#else
36#error "invalid kgdb_tty port"
37#endif
38
39static volatile unsigned int kgdb_debugport;
40
41void putDebugChar(unsigned char c)
42{
43 if (kgdb_debugport == 0)
44 kgdb_debugport = serial_init(KGDB_PORT, NULL);
45
46 serial_putc(kgdb_debugport, c);
47}
48
49int getDebugChar(void)
50{
51 if (kgdb_debugport == 0)
52 kgdb_debugport = serial_init(KGDB_PORT, NULL);
53
54 return(serial_getc(kgdb_debugport));
55}
56
57void kgdb_interruptible(int enable)
58{
59 return;
60}
61
62void putDebugString(char* str)
63{
64 while (*str != '\0') {
65 putDebugChar(*str);
66 str++;
67 }
68 putDebugChar('\r');
69 return;
70}
71
72/*
73 * Note: gen550_init() must be called already on the port we are going
74 * to use.
75 */
76void
77gen550_kgdb_map_scc(void)
78{
79 printk(KERN_DEBUG "kgdb init\n");
80 if (ppc_md.early_serial_map)
81 ppc_md.early_serial_map();
82 kgdb_debugport = serial_init(KGDB_PORT, NULL);
83}
diff --git a/arch/ppc/syslib/gt64260_pic.c b/arch/ppc/syslib/gt64260_pic.c
deleted file mode 100644
index 3b4fcca5d1e1..000000000000
--- a/arch/ppc/syslib/gt64260_pic.c
+++ /dev/null
@@ -1,323 +0,0 @@
1/*
2 * Interrupt controller support for Galileo's GT64260.
3 *
4 * Author: Chris Zankel <source@mvista.com>
5 * Modified by: Mark A. Greer <mgreer@mvista.com>
6 *
7 * Based on sources from Rabeeh Khoury / Galileo Technology
8 *
9 * 2001 (c) MontaVista, Software, Inc. This file is licensed under
10 * the terms of the GNU General Public License version 2. This program
11 * is licensed "as is" without any warranty of any kind, whether express
12 * or implied.
13 */
14
15/*
16 * This file contains the specific functions to support the GT64260
17 * interrupt controller.
18 *
19 * The GT64260 has two main interrupt registers (high and low) that
20 * summarizes the interrupts generated by the units of the GT64260.
21 * Each bit is assigned to an interrupt number, where the low register
22 * are assigned from IRQ0 to IRQ31 and the high cause register
23 * from IRQ32 to IRQ63
24 * The GPP (General Purpose Port) interrupts are assigned from IRQ64 (GPP0)
25 * to IRQ95 (GPP31).
26 * get_irq() returns the lowest interrupt number that is currently asserted.
27 *
28 * Note:
29 * - This driver does not initialize the GPP when used as an interrupt
30 * input.
31 */
32
33#include <linux/stddef.h>
34#include <linux/init.h>
35#include <linux/interrupt.h>
36#include <linux/sched.h>
37#include <linux/signal.h>
38#include <linux/delay.h>
39#include <linux/irq.h>
40
41#include <asm/io.h>
42#include <asm/system.h>
43#include <asm/irq.h>
44#include <asm/mv64x60.h>
45#include <asm/machdep.h>
46
47#define CPU_INTR_STR "gt64260 cpu interface error"
48#define PCI0_INTR_STR "gt64260 pci 0 error"
49#define PCI1_INTR_STR "gt64260 pci 1 error"
50
51/* ========================== forward declaration ========================== */
52
53static void gt64260_unmask_irq(unsigned int);
54static void gt64260_mask_irq(unsigned int);
55
56/* ========================== local declarations =========================== */
57
58struct hw_interrupt_type gt64260_pic = {
59 .typename = " gt64260_pic ",
60 .enable = gt64260_unmask_irq,
61 .disable = gt64260_mask_irq,
62 .ack = gt64260_mask_irq,
63 .end = gt64260_unmask_irq,
64};
65
66u32 gt64260_irq_base = 0; /* GT64260 handles the next 96 IRQs from here */
67
68static struct mv64x60_handle bh;
69
70/* gt64260_init_irq()
71 *
72 * This function initializes the interrupt controller. It assigns
73 * all interrupts from IRQ0 to IRQ95 to the gt64260 interrupt controller.
74 *
75 * Note:
76 * We register all GPP inputs as interrupt source, but disable them.
77 */
78void __init
79gt64260_init_irq(void)
80{
81 int i;
82
83 if (ppc_md.progress)
84 ppc_md.progress("gt64260_init_irq: enter", 0x0);
85
86 bh.v_base = mv64x60_get_bridge_vbase();
87
88 ppc_cached_irq_mask[0] = 0;
89 ppc_cached_irq_mask[1] = 0x0f000000; /* Enable GPP intrs */
90 ppc_cached_irq_mask[2] = 0;
91
92 /* disable all interrupts and clear current interrupts */
93 mv64x60_write(&bh, MV64x60_GPP_INTR_MASK, ppc_cached_irq_mask[2]);
94 mv64x60_write(&bh, MV64x60_GPP_INTR_CAUSE, 0);
95 mv64x60_write(&bh, GT64260_IC_CPU_INTR_MASK_LO, ppc_cached_irq_mask[0]);
96 mv64x60_write(&bh, GT64260_IC_CPU_INTR_MASK_HI, ppc_cached_irq_mask[1]);
97
98 /* use the gt64260 for all (possible) interrupt sources */
99 for (i = gt64260_irq_base; i < (gt64260_irq_base + 96); i++)
100 irq_desc[i].chip = &gt64260_pic;
101
102 if (ppc_md.progress)
103 ppc_md.progress("gt64260_init_irq: exit", 0x0);
104}
105
106/*
107 * gt64260_get_irq()
108 *
109 * This function returns the lowest interrupt number of all interrupts that
110 * are currently asserted.
111 *
112 * Output Variable(s):
113 * None.
114 *
115 * Returns:
116 * int <interrupt number> or -2 (bogus interrupt)
117 */
118int
119gt64260_get_irq(void)
120{
121 int irq;
122 int irq_gpp;
123
124 irq = mv64x60_read(&bh, GT64260_IC_MAIN_CAUSE_LO);
125 irq = __ilog2((irq & 0x3dfffffe) & ppc_cached_irq_mask[0]);
126
127 if (irq == -1) {
128 irq = mv64x60_read(&bh, GT64260_IC_MAIN_CAUSE_HI);
129 irq = __ilog2((irq & 0x0f000db7) & ppc_cached_irq_mask[1]);
130
131 if (irq == -1)
132 irq = -2; /* bogus interrupt, should never happen */
133 else {
134 if (irq >= 24) {
135 irq_gpp = mv64x60_read(&bh,
136 MV64x60_GPP_INTR_CAUSE);
137 irq_gpp = __ilog2(irq_gpp &
138 ppc_cached_irq_mask[2]);
139
140 if (irq_gpp == -1)
141 irq = -2;
142 else {
143 irq = irq_gpp + 64;
144 mv64x60_write(&bh,
145 MV64x60_GPP_INTR_CAUSE,
146 ~(1 << (irq - 64)));
147 }
148 } else
149 irq += 32;
150 }
151 }
152
153 (void)mv64x60_read(&bh, MV64x60_GPP_INTR_CAUSE);
154
155 if (irq < 0)
156 return (irq);
157 else
158 return (gt64260_irq_base + irq);
159}
160
161/* gt64260_unmask_irq()
162 *
163 * This function enables an interrupt.
164 *
165 * Input Variable(s):
166 * unsigned int interrupt number (IRQ0...IRQ95).
167 *
168 * Output Variable(s):
169 * None.
170 *
171 * Returns:
172 * void
173 */
174static void
175gt64260_unmask_irq(unsigned int irq)
176{
177 irq -= gt64260_irq_base;
178
179 if (irq > 31)
180 if (irq > 63) /* unmask GPP irq */
181 mv64x60_write(&bh, MV64x60_GPP_INTR_MASK,
182 ppc_cached_irq_mask[2] |= (1 << (irq - 64)));
183 else /* mask high interrupt register */
184 mv64x60_write(&bh, GT64260_IC_CPU_INTR_MASK_HI,
185 ppc_cached_irq_mask[1] |= (1 << (irq - 32)));
186 else /* mask low interrupt register */
187 mv64x60_write(&bh, GT64260_IC_CPU_INTR_MASK_LO,
188 ppc_cached_irq_mask[0] |= (1 << irq));
189
190 (void)mv64x60_read(&bh, MV64x60_GPP_INTR_MASK);
191 return;
192}
193
194/* gt64260_mask_irq()
195 *
196 * This function disables the requested interrupt.
197 *
198 * Input Variable(s):
199 * unsigned int interrupt number (IRQ0...IRQ95).
200 *
201 * Output Variable(s):
202 * None.
203 *
204 * Returns:
205 * void
206 */
207static void
208gt64260_mask_irq(unsigned int irq)
209{
210 irq -= gt64260_irq_base;
211
212 if (irq > 31)
213 if (irq > 63) /* mask GPP irq */
214 mv64x60_write(&bh, MV64x60_GPP_INTR_MASK,
215 ppc_cached_irq_mask[2] &= ~(1 << (irq - 64)));
216 else /* mask high interrupt register */
217 mv64x60_write(&bh, GT64260_IC_CPU_INTR_MASK_HI,
218 ppc_cached_irq_mask[1] &= ~(1 << (irq - 32)));
219 else /* mask low interrupt register */
220 mv64x60_write(&bh, GT64260_IC_CPU_INTR_MASK_LO,
221 ppc_cached_irq_mask[0] &= ~(1 << irq));
222
223 (void)mv64x60_read(&bh, MV64x60_GPP_INTR_MASK);
224 return;
225}
226
227static irqreturn_t
228gt64260_cpu_error_int_handler(int irq, void *dev_id)
229{
230 printk(KERN_ERR "gt64260_cpu_error_int_handler: %s 0x%08x\n",
231 "Error on CPU interface - Cause regiser",
232 mv64x60_read(&bh, MV64x60_CPU_ERR_CAUSE));
233 printk(KERN_ERR "\tCPU error register dump:\n");
234 printk(KERN_ERR "\tAddress low 0x%08x\n",
235 mv64x60_read(&bh, MV64x60_CPU_ERR_ADDR_LO));
236 printk(KERN_ERR "\tAddress high 0x%08x\n",
237 mv64x60_read(&bh, MV64x60_CPU_ERR_ADDR_HI));
238 printk(KERN_ERR "\tData low 0x%08x\n",
239 mv64x60_read(&bh, MV64x60_CPU_ERR_DATA_LO));
240 printk(KERN_ERR "\tData high 0x%08x\n",
241 mv64x60_read(&bh, MV64x60_CPU_ERR_DATA_HI));
242 printk(KERN_ERR "\tParity 0x%08x\n",
243 mv64x60_read(&bh, MV64x60_CPU_ERR_PARITY));
244 mv64x60_write(&bh, MV64x60_CPU_ERR_CAUSE, 0);
245 return IRQ_HANDLED;
246}
247
248static irqreturn_t
249gt64260_pci_error_int_handler(int irq, void *dev_id)
250{
251 u32 val;
252 unsigned int pci_bus = (unsigned int)dev_id;
253
254 if (pci_bus == 0) { /* Error on PCI 0 */
255 val = mv64x60_read(&bh, MV64x60_PCI0_ERR_CAUSE);
256 printk(KERN_ERR "%s: Error in PCI %d Interface\n",
257 "gt64260_pci_error_int_handler", pci_bus);
258 printk(KERN_ERR "\tPCI %d error register dump:\n", pci_bus);
259 printk(KERN_ERR "\tCause register 0x%08x\n", val);
260 printk(KERN_ERR "\tAddress Low 0x%08x\n",
261 mv64x60_read(&bh, MV64x60_PCI0_ERR_ADDR_LO));
262 printk(KERN_ERR "\tAddress High 0x%08x\n",
263 mv64x60_read(&bh, MV64x60_PCI0_ERR_ADDR_HI));
264 printk(KERN_ERR "\tAttribute 0x%08x\n",
265 mv64x60_read(&bh, MV64x60_PCI0_ERR_DATA_LO));
266 printk(KERN_ERR "\tCommand 0x%08x\n",
267 mv64x60_read(&bh, MV64x60_PCI0_ERR_CMD));
268 mv64x60_write(&bh, MV64x60_PCI0_ERR_CAUSE, ~val);
269 }
270 if (pci_bus == 1) { /* Error on PCI 1 */
271 val = mv64x60_read(&bh, MV64x60_PCI1_ERR_CAUSE);
272 printk(KERN_ERR "%s: Error in PCI %d Interface\n",
273 "gt64260_pci_error_int_handler", pci_bus);
274 printk(KERN_ERR "\tPCI %d error register dump:\n", pci_bus);
275 printk(KERN_ERR "\tCause register 0x%08x\n", val);
276 printk(KERN_ERR "\tAddress Low 0x%08x\n",
277 mv64x60_read(&bh, MV64x60_PCI1_ERR_ADDR_LO));
278 printk(KERN_ERR "\tAddress High 0x%08x\n",
279 mv64x60_read(&bh, MV64x60_PCI1_ERR_ADDR_HI));
280 printk(KERN_ERR "\tAttribute 0x%08x\n",
281 mv64x60_read(&bh, MV64x60_PCI1_ERR_DATA_LO));
282 printk(KERN_ERR "\tCommand 0x%08x\n",
283 mv64x60_read(&bh, MV64x60_PCI1_ERR_CMD));
284 mv64x60_write(&bh, MV64x60_PCI1_ERR_CAUSE, ~val);
285 }
286 return IRQ_HANDLED;
287}
288
289static int __init
290gt64260_register_hdlrs(void)
291{
292 int rc;
293
294 /* Register CPU interface error interrupt handler */
295 if ((rc = request_irq(MV64x60_IRQ_CPU_ERR,
296 gt64260_cpu_error_int_handler, IRQF_DISABLED, CPU_INTR_STR, 0)))
297 printk(KERN_WARNING "Can't register cpu error handler: %d", rc);
298
299 mv64x60_write(&bh, MV64x60_CPU_ERR_MASK, 0);
300 mv64x60_write(&bh, MV64x60_CPU_ERR_MASK, 0x000000fe);
301
302 /* Register PCI 0 error interrupt handler */
303 if ((rc = request_irq(MV64360_IRQ_PCI0, gt64260_pci_error_int_handler,
304 IRQF_DISABLED, PCI0_INTR_STR, (void *)0)))
305 printk(KERN_WARNING "Can't register pci 0 error handler: %d",
306 rc);
307
308 mv64x60_write(&bh, MV64x60_PCI0_ERR_MASK, 0);
309 mv64x60_write(&bh, MV64x60_PCI0_ERR_MASK, 0x003c0c24);
310
311 /* Register PCI 1 error interrupt handler */
312 if ((rc = request_irq(MV64360_IRQ_PCI1, gt64260_pci_error_int_handler,
313 IRQF_DISABLED, PCI1_INTR_STR, (void *)1)))
314 printk(KERN_WARNING "Can't register pci 1 error handler: %d",
315 rc);
316
317 mv64x60_write(&bh, MV64x60_PCI1_ERR_MASK, 0);
318 mv64x60_write(&bh, MV64x60_PCI1_ERR_MASK, 0x003c0c24);
319
320 return 0;
321}
322
323arch_initcall(gt64260_register_hdlrs);
diff --git a/arch/ppc/syslib/harrier.c b/arch/ppc/syslib/harrier.c
deleted file mode 100644
index 45b797b3a336..000000000000
--- a/arch/ppc/syslib/harrier.c
+++ /dev/null
@@ -1,300 +0,0 @@
1/*
2 * Motorola MCG Harrier northbridge/memory controller support
3 *
4 * Author: Dale Farnsworth
5 * dale.farnsworth@mvista.com
6 *
7 * 2001 (c) MontaVista, Software, Inc. This file is licensed under
8 * the terms of the GNU General Public License version 2. This program
9 * is licensed "as is" without any warranty of any kind, whether express
10 * or implied.
11 */
12#include <linux/kernel.h>
13#include <linux/init.h>
14#include <linux/pci.h>
15#include <linux/harrier_defs.h>
16
17#include <asm/byteorder.h>
18#include <asm/io.h>
19#include <asm/irq.h>
20#include <asm/pci.h>
21#include <asm/pci-bridge.h>
22#include <asm/open_pic.h>
23#include <asm/harrier.h>
24
25/* define defaults for inbound windows */
26#define HARRIER_ITAT_DEFAULT (HARRIER_ITAT_ENA | \
27 HARRIER_ITAT_MEM | \
28 HARRIER_ITAT_WPE | \
29 HARRIER_ITAT_GBL)
30
31#define HARRIER_MPAT_DEFAULT (HARRIER_ITAT_ENA | \
32 HARRIER_ITAT_MEM | \
33 HARRIER_ITAT_WPE | \
34 HARRIER_ITAT_GBL)
35
36/*
37 * Initialize the inbound window size on a non-monarch harrier.
38 */
39void __init harrier_setup_nonmonarch(uint ppc_reg_base, uint in0_size)
40{
41 u16 temps;
42 u32 temp;
43
44 if (in0_size > HARRIER_ITSZ_2GB) {
45 printk
46 ("harrier_setup_nonmonarch: Invalid window size code %d\n",
47 in0_size);
48 return;
49 }
50
51 /* Clear the PCI memory enable bit. If we don't, then when the
52 * inbound windows are enabled below, the corresponding BARs will be
53 * "live" and start answering to PCI memory reads from their default
54 * addresses (0x0), which overlap with system RAM.
55 */
56 temps = in_le16((u16 *) (ppc_reg_base +
57 HARRIER_XCSR_CONFIG(PCI_COMMAND)));
58 temps &= ~(PCI_COMMAND_MEMORY);
59 out_le16((u16 *) (ppc_reg_base + HARRIER_XCSR_CONFIG(PCI_COMMAND)),
60 temps);
61
62 /* Setup a non-prefetchable inbound window */
63 out_le32((u32 *) (ppc_reg_base +
64 HARRIER_XCSR_CONFIG(HARRIER_ITSZ0_OFF)), in0_size);
65
66 temp = in_le32((u32 *) (ppc_reg_base +
67 HARRIER_XCSR_CONFIG(HARRIER_ITAT0_OFF)));
68 temp &= ~HARRIER_ITAT_PRE;
69 temp |= HARRIER_ITAT_DEFAULT;
70 out_le32((u32 *) (ppc_reg_base +
71 HARRIER_XCSR_CONFIG(HARRIER_ITAT0_OFF)), temp);
72
73 /* Enable the message passing block */
74 temp = in_le32((u32 *) (ppc_reg_base +
75 HARRIER_XCSR_CONFIG(HARRIER_MPAT_OFF)));
76 temp |= HARRIER_MPAT_DEFAULT;
77 out_le32((u32 *) (ppc_reg_base +
78 HARRIER_XCSR_CONFIG(HARRIER_MPAT_OFF)), temp);
79}
80
81void __init harrier_release_eready(uint ppc_reg_base)
82{
83 ulong temp;
84
85 /*
86 * Set EREADY to allow the line to be pulled up after everyone is
87 * ready.
88 */
89 temp = in_be32((uint *) (ppc_reg_base + HARRIER_MISC_CSR_OFF));
90 temp |= HARRIER_EREADY;
91 out_be32((uint *) (ppc_reg_base + HARRIER_MISC_CSR_OFF), temp);
92}
93
94void __init harrier_wait_eready(uint ppc_reg_base)
95{
96 ulong temp;
97
98 /*
99 * Poll the ERDYS line until it goes high to indicate that all
100 * non-monarch PrPMCs are ready for bus enumeration (or that there are
101 * no PrPMCs present).
102 */
103
104 /* FIXME: Add a timeout of some kind to prevent endless waits. */
105 do {
106
107 temp = in_be32((uint *) (ppc_reg_base + HARRIER_MISC_CSR_OFF));
108
109 } while (!(temp & HARRIER_ERDYS));
110}
111
112/*
113 * Initialize the Motorola MCG Harrier host bridge.
114 *
115 * This means setting up the PPC bus to PCI memory and I/O space mappings,
116 * setting the PCI memory space address of the MPIC (mapped straight
117 * through), and ioremap'ing the mpic registers.
118 * 'OpenPIC_Addr' will be set correctly by this routine.
119 * This routine will not change the PCI_CONFIG_ADDR or PCI_CONFIG_DATA
120 * addresses and assumes that the mapping of PCI memory space back to system
121 * memory is set up correctly by PPCBug.
122 */
123int __init
124harrier_init(struct pci_controller *hose,
125 uint ppc_reg_base,
126 ulong processor_pci_mem_start,
127 ulong processor_pci_mem_end,
128 ulong processor_pci_io_start,
129 ulong processor_pci_io_end, ulong processor_mpic_base)
130{
131 uint addr, offset;
132
133 /*
134 * Some sanity checks...
135 */
136 if (((processor_pci_mem_start & 0xffff0000) != processor_pci_mem_start)
137 || ((processor_pci_io_start & 0xffff0000) !=
138 processor_pci_io_start)) {
139 printk("harrier_init: %s\n",
140 "PPC to PCI mappings must start on 64 KB boundaries");
141 return -1;
142 }
143
144 if (((processor_pci_mem_end & 0x0000ffff) != 0x0000ffff) ||
145 ((processor_pci_io_end & 0x0000ffff) != 0x0000ffff)) {
146 printk("harrier_init: PPC to PCI mappings %s\n",
147 "must end just before a 64 KB boundaries");
148 return -1;
149 }
150
151 if (((processor_pci_mem_end - processor_pci_mem_start) !=
152 (hose->mem_space.end - hose->mem_space.start)) ||
153 ((processor_pci_io_end - processor_pci_io_start) !=
154 (hose->io_space.end - hose->io_space.start))) {
155 printk("harrier_init: %s\n",
156 "PPC and PCI memory or I/O space sizes don't match");
157 return -1;
158 }
159
160 if ((processor_mpic_base & 0xfffc0000) != processor_mpic_base) {
161 printk("harrier_init: %s\n",
162 "MPIC address must start on 256 KB boundary");
163 return -1;
164 }
165
166 if ((pci_dram_offset & 0xffff0000) != pci_dram_offset) {
167 printk("harrier_init: %s\n",
168 "pci_dram_offset must be multiple of 64 KB");
169 return -1;
170 }
171
172 /*
173 * Program the OTAD/OTOF registers to set up the PCI Mem & I/O
174 * space mappings. These are the mappings going from the processor to
175 * the PCI bus.
176 *
177 * Note: Don't need to 'AND' start/end addresses with 0xffff0000
178 * because sanity check above ensures that they are properly
179 * aligned.
180 */
181
182 /* Set up PPC->PCI Mem mapping */
183 addr = processor_pci_mem_start | (processor_pci_mem_end >> 16);
184#ifdef CONFIG_HARRIER_STORE_GATHERING
185 offset = (hose->mem_space.start - processor_pci_mem_start) | 0x9a;
186#else
187 offset = (hose->mem_space.start - processor_pci_mem_start) | 0x92;
188#endif
189 out_be32((uint *) (ppc_reg_base + HARRIER_OTAD0_OFF), addr);
190 out_be32((uint *) (ppc_reg_base + HARRIER_OTOF0_OFF), offset);
191
192 /* Set up PPC->PCI I/O mapping -- Contiguous I/O space */
193 addr = processor_pci_io_start | (processor_pci_io_end >> 16);
194 offset = (hose->io_space.start - processor_pci_io_start) | 0x80;
195 out_be32((uint *) (ppc_reg_base + HARRIER_OTAD1_OFF), addr);
196 out_be32((uint *) (ppc_reg_base + HARRIER_OTOF1_OFF), offset);
197
198 /* Enable MPIC */
199 OpenPIC_Addr = (void *)processor_mpic_base;
200 addr = (processor_mpic_base >> 16) | 1;
201 out_be16((ushort *) (ppc_reg_base + HARRIER_MBAR_OFF), addr);
202 out_8((u_char *) (ppc_reg_base + HARRIER_MPIC_CSR_OFF),
203 HARRIER_MPIC_OPI_ENABLE);
204
205 return 0;
206}
207
208/*
209 * Find the amount of RAM present.
210 * This assumes that PPCBug has initialized the memory controller (SMC)
211 * on the Harrier correctly (i.e., it does no sanity checking).
212 * It also assumes that the memory base registers are set to configure the
213 * memory as contiguous starting with "RAM A BASE", "RAM B BASE", etc.
214 * however, RAM base registers can be skipped (e.g. A, B, C are set,
215 * D is skipped but E is set is okay).
216 */
217#define MB (1024*1024UL)
218
219static uint harrier_size_table[] __initdata = {
220 0 * MB, /* 0 ==> 0 MB */
221 32 * MB, /* 1 ==> 32 MB */
222 64 * MB, /* 2 ==> 64 MB */
223 64 * MB, /* 3 ==> 64 MB */
224 128 * MB, /* 4 ==> 128 MB */
225 128 * MB, /* 5 ==> 128 MB */
226 128 * MB, /* 6 ==> 128 MB */
227 256 * MB, /* 7 ==> 256 MB */
228 256 * MB, /* 8 ==> 256 MB */
229 256 * MB, /* 9 ==> 256 MB */
230 512 * MB, /* a ==> 512 MB */
231 512 * MB, /* b ==> 512 MB */
232 512 * MB, /* c ==> 512 MB */
233 1024 * MB, /* d ==> 1024 MB */
234 1024 * MB, /* e ==> 1024 MB */
235 2048 * MB, /* f ==> 2048 MB */
236};
237
238/*
239 * *** WARNING: You MUST have a BAT set up to map in the XCSR regs ***
240 *
241 * Read the memory controller's registers to determine the amount of system
242 * memory. Assumes that the memory controller registers are already mapped
243 * into virtual memory--too early to use ioremap().
244 */
245unsigned long __init harrier_get_mem_size(uint xcsr_base)
246{
247 ulong last_addr;
248 int i;
249 uint vend_dev_id;
250 uint *size_table;
251 uint val;
252 uint *csrp;
253 uint size;
254 int size_table_entries;
255
256 vend_dev_id = in_be32((uint *) xcsr_base + PCI_VENDOR_ID);
257
258 if (((vend_dev_id & 0xffff0000) >> 16) != PCI_VENDOR_ID_MOTOROLA) {
259 printk("harrier_get_mem_size: %s (0x%x)\n",
260 "Not a Motorola Memory Controller", vend_dev_id);
261 return 0;
262 }
263
264 vend_dev_id &= 0x0000ffff;
265
266 if (vend_dev_id == PCI_DEVICE_ID_MOTOROLA_HARRIER) {
267 size_table = harrier_size_table;
268 size_table_entries = sizeof(harrier_size_table) /
269 sizeof(harrier_size_table[0]);
270 } else {
271 printk("harrier_get_mem_size: %s (0x%x)\n",
272 "Not a Harrier", vend_dev_id);
273 return 0;
274 }
275
276 last_addr = 0;
277
278 csrp = (uint *) (xcsr_base + HARRIER_SDBA_OFF);
279 for (i = 0; i < 8; i++) {
280 val = in_be32(csrp++);
281
282 if (val & 0x100) { /* If enabled */
283 size = val >> HARRIER_SDB_SIZE_SHIFT;
284 size &= HARRIER_SDB_SIZE_MASK;
285 if (size >= size_table_entries) {
286 break; /* Register not set correctly */
287 }
288 size = size_table[size];
289
290 val &= ~(size - 1);
291 val += size;
292
293 if (val > last_addr) {
294 last_addr = val;
295 }
296 }
297 }
298
299 return last_addr;
300}
diff --git a/arch/ppc/syslib/hawk_common.c b/arch/ppc/syslib/hawk_common.c
deleted file mode 100644
index 86821d8753ed..000000000000
--- a/arch/ppc/syslib/hawk_common.c
+++ /dev/null
@@ -1,317 +0,0 @@
1/*
2 * Common Motorola PowerPlus Platform--really Falcon/Raven or HAWK.
3 *
4 * Author: Mark A. Greer
5 * mgreer@mvista.com
6 *
7 * 2001 (c) MontaVista, Software, Inc. This file is licensed under
8 * the terms of the GNU General Public License version 2. This program
9 * is licensed "as is" without any warranty of any kind, whether express
10 * or implied.
11 */
12#include <linux/kernel.h>
13#include <linux/init.h>
14#include <linux/pci.h>
15
16#include <asm/byteorder.h>
17#include <asm/io.h>
18#include <asm/irq.h>
19#include <asm/pci.h>
20#include <asm/pci-bridge.h>
21#include <asm/open_pic.h>
22#include <asm/hawk.h>
23
24/*
25 * The Falcon/Raven and HAWK has 4 sets of registers:
26 * 1) PPC Registers which define the mappings from PPC bus to PCI bus,
27 * etc.
28 * 2) PCI Registers which define the mappings from PCI bus to PPC bus and the
29 * MPIC base address.
30 * 3) MPIC registers.
31 * 4) System Memory Controller (SMC) registers.
32 */
33
34/*
35 * Initialize the Motorola MCG Raven or HAWK host bridge.
36 *
37 * This means setting up the PPC bus to PCI memory and I/O space mappings,
38 * setting the PCI memory space address of the MPIC (mapped straight
39 * through), and ioremap'ing the mpic registers.
40 * This routine will set the PCI_CONFIG_ADDR or PCI_CONFIG_DATA
41 * addresses based on the PCI I/O address that is passed in.
42 * 'OpenPIC_Addr' will be set correctly by this routine.
43 */
44int __init
45hawk_init(struct pci_controller *hose,
46 uint ppc_reg_base,
47 ulong processor_pci_mem_start,
48 ulong processor_pci_mem_end,
49 ulong processor_pci_io_start,
50 ulong processor_pci_io_end,
51 ulong processor_mpic_base)
52{
53 uint addr, offset;
54
55 /*
56 * Some sanity checks...
57 */
58 if (((processor_pci_mem_start&0xffff0000) != processor_pci_mem_start) ||
59 ((processor_pci_io_start &0xffff0000) != processor_pci_io_start)) {
60 printk("hawk_init: %s\n",
61 "PPC to PCI mappings must start on 64 KB boundaries");
62 return -1;
63 }
64
65 if (((processor_pci_mem_end &0x0000ffff) != 0x0000ffff) ||
66 ((processor_pci_io_end &0x0000ffff) != 0x0000ffff)) {
67 printk("hawk_init: PPC to PCI mappings %s\n",
68 "must end just before a 64 KB boundaries");
69 return -1;
70 }
71
72 if (((processor_pci_mem_end - processor_pci_mem_start) !=
73 (hose->mem_space.end - hose->mem_space.start)) ||
74 ((processor_pci_io_end - processor_pci_io_start) !=
75 (hose->io_space.end - hose->io_space.start))) {
76 printk("hawk_init: %s\n",
77 "PPC and PCI memory or I/O space sizes don't match");
78 return -1;
79 }
80
81 if ((processor_mpic_base & 0xfffc0000) != processor_mpic_base) {
82 printk("hawk_init: %s\n",
83 "MPIC address must start on 256 MB boundary");
84 return -1;
85 }
86
87 if ((pci_dram_offset & 0xffff0000) != pci_dram_offset) {
88 printk("hawk_init: %s\n",
89 "pci_dram_offset must be multiple of 64 KB");
90 return -1;
91 }
92
93 /*
94 * Disable previous PPC->PCI mappings.
95 */
96 out_be32((uint *)(ppc_reg_base + HAWK_PPC_XSOFF0_OFF), 0x00000000);
97 out_be32((uint *)(ppc_reg_base + HAWK_PPC_XSOFF1_OFF), 0x00000000);
98 out_be32((uint *)(ppc_reg_base + HAWK_PPC_XSOFF2_OFF), 0x00000000);
99 out_be32((uint *)(ppc_reg_base + HAWK_PPC_XSOFF3_OFF), 0x00000000);
100
101 /*
102 * Program the XSADD/XSOFF registers to set up the PCI Mem & I/O
103 * space mappings. These are the mappings going from the processor to
104 * the PCI bus.
105 *
106 * Note: Don't need to 'AND' start/end addresses with 0xffff0000
107 * because sanity check above ensures that they are properly
108 * aligned.
109 */
110
111 /* Set up PPC->PCI Mem mapping */
112 addr = processor_pci_mem_start | (processor_pci_mem_end >> 16);
113 offset = (hose->mem_space.start - processor_pci_mem_start) | 0xd2;
114 out_be32((uint *)(ppc_reg_base + HAWK_PPC_XSADD0_OFF), addr);
115 out_be32((uint *)(ppc_reg_base + HAWK_PPC_XSOFF0_OFF), offset);
116
117 /* Set up PPC->MPIC mapping on the bridge */
118 addr = processor_mpic_base |
119 (((processor_mpic_base + HAWK_MPIC_SIZE) >> 16) - 1);
120 /* No write posting for this PCI Mem space */
121 offset = (hose->mem_space.start - processor_pci_mem_start) | 0xc2;
122
123 out_be32((uint *)(ppc_reg_base + HAWK_PPC_XSADD1_OFF), addr);
124 out_be32((uint *)(ppc_reg_base + HAWK_PPC_XSOFF1_OFF), offset);
125
126 /* Set up PPC->PCI I/O mapping -- Contiguous I/O space */
127 addr = processor_pci_io_start | (processor_pci_io_end >> 16);
128 offset = (hose->io_space.start - processor_pci_io_start) | 0xc0;
129 out_be32((uint *)(ppc_reg_base + HAWK_PPC_XSADD3_OFF), addr);
130 out_be32((uint *)(ppc_reg_base + HAWK_PPC_XSOFF3_OFF), offset);
131
132 hose->io_base_virt = (void *)ioremap(processor_pci_io_start,
133 (processor_pci_io_end - processor_pci_io_start + 1));
134
135 /*
136 * Set up the indirect method of accessing PCI config space.
137 * The PCI config addr/data pair based on start addr of PCI I/O space.
138 */
139 setup_indirect_pci(hose,
140 processor_pci_io_start + HAWK_PCI_CONFIG_ADDR_OFF,
141 processor_pci_io_start + HAWK_PCI_CONFIG_DATA_OFF);
142
143 /*
144 * Disable previous PCI->PPC mappings.
145 */
146
147 /* XXXX Put in mappings from PCI bus to processor bus XXXX */
148
149 /*
150 * Disable MPIC response to PCI I/O space (BAR 0).
151 * Make MPIC respond to PCI Mem space at specified address.
152 * (BAR 1).
153 */
154 early_write_config_dword(hose,
155 0,
156 PCI_DEVFN(0,0),
157 PCI_BASE_ADDRESS_0,
158 0x00000000 | 0x1);
159
160 early_write_config_dword(hose,
161 0,
162 PCI_DEVFN(0,0),
163 PCI_BASE_ADDRESS_1,
164 (processor_mpic_base -
165 processor_pci_mem_start +
166 hose->mem_space.start) | 0x0);
167
168 /* Map MPIC into virtual memory */
169 OpenPIC_Addr = ioremap(processor_mpic_base, HAWK_MPIC_SIZE);
170
171 return 0;
172}
173
174/*
175 * Find the amount of RAM present.
176 * This assumes that PPCBug has initialized the memory controller (SMC)
177 * on the Falcon/HAWK correctly (i.e., it does no sanity checking).
178 * It also assumes that the memory base registers are set to configure the
179 * memory as contiguous starting with "RAM A BASE", "RAM B BASE", etc.
180 * however, RAM base registers can be skipped (e.g. A, B, C are set,
181 * D is skipped but E is set is okay).
182 */
183#define MB (1024*1024)
184
185static uint reg_offset_table[] __initdata = {
186 HAWK_SMC_RAM_A_SIZE_REG_OFF,
187 HAWK_SMC_RAM_B_SIZE_REG_OFF,
188 HAWK_SMC_RAM_C_SIZE_REG_OFF,
189 HAWK_SMC_RAM_D_SIZE_REG_OFF,
190 HAWK_SMC_RAM_E_SIZE_REG_OFF,
191 HAWK_SMC_RAM_F_SIZE_REG_OFF,
192 HAWK_SMC_RAM_G_SIZE_REG_OFF,
193 HAWK_SMC_RAM_H_SIZE_REG_OFF
194};
195
196static uint falcon_size_table[] __initdata = {
197 0 * MB, /* 0 ==> 0 MB */
198 16 * MB, /* 1 ==> 16 MB */
199 32 * MB, /* 2 ==> 32 MB */
200 64 * MB, /* 3 ==> 64 MB */
201 128 * MB, /* 4 ==> 128 MB */
202 256 * MB, /* 5 ==> 256 MB */
203 1024 * MB, /* 6 ==> 1024 MB (1 GB) */
204};
205
206static uint hawk_size_table[] __initdata = {
207 0 * MB, /* 0 ==> 0 MB */
208 32 * MB, /* 1 ==> 32 MB */
209 64 * MB, /* 2 ==> 64 MB */
210 64 * MB, /* 3 ==> 64 MB */
211 128 * MB, /* 4 ==> 128 MB */
212 128 * MB, /* 5 ==> 128 MB */
213 128 * MB, /* 6 ==> 128 MB */
214 256 * MB, /* 7 ==> 256 MB */
215 256 * MB, /* 8 ==> 256 MB */
216 512 * MB, /* 9 ==> 512 MB */
217};
218
219/*
220 * *** WARNING: You MUST have a BAT set up to map in the SMC regs ***
221 *
222 * Read the memory controller's registers to determine the amount of system
223 * memory. Assumes that the memory controller registers are already mapped
224 * into virtual memory--too early to use ioremap().
225 */
226unsigned long __init
227hawk_get_mem_size(uint smc_base)
228{
229 unsigned long total;
230 int i, size_table_entries, reg_limit;
231 uint vend_dev_id;
232 uint *size_table;
233 u_char val;
234
235
236 vend_dev_id = in_be32((uint *)smc_base + PCI_VENDOR_ID);
237
238 if (((vend_dev_id & 0xffff0000) >> 16) != PCI_VENDOR_ID_MOTOROLA) {
239 printk("hawk_get_mem_size: %s (0x%x)\n",
240 "Not a Motorola Memory Controller", vend_dev_id);
241 return 0;
242 }
243
244 vend_dev_id &= 0x0000ffff;
245
246 if (vend_dev_id == PCI_DEVICE_ID_MOTOROLA_FALCON) {
247 size_table = falcon_size_table;
248 size_table_entries = sizeof(falcon_size_table) /
249 sizeof(falcon_size_table[0]);
250
251 reg_limit = FALCON_SMC_REG_COUNT;
252 }
253 else if (vend_dev_id == PCI_DEVICE_ID_MOTOROLA_HAWK) {
254 size_table = hawk_size_table;
255 size_table_entries = sizeof(hawk_size_table) /
256 sizeof(hawk_size_table[0]);
257 reg_limit = HAWK_SMC_REG_COUNT;
258 }
259 else {
260 printk("hawk_get_mem_size: %s (0x%x)\n",
261 "Not a Falcon or HAWK", vend_dev_id);
262 return 0;
263 }
264
265 total = 0;
266
267 /* Check every reg because PPCBug may skip some */
268 for (i=0; i<reg_limit; i++) {
269 val = in_8((u_char *)(smc_base + reg_offset_table[i]));
270
271 if (val & 0x80) { /* If enabled */
272 val &= 0x0f;
273
274 /* Don't go past end of size_table */
275 if (val < size_table_entries) {
276 total += size_table[val];
277 }
278 else { /* Register not set correctly */
279 break;
280 }
281 }
282 }
283
284 return total;
285}
286
287int __init
288hawk_mpic_init(unsigned int pci_mem_offset)
289{
290 unsigned short devid;
291 unsigned int pci_membase;
292
293 /* Check the first PCI device to see if it is a Raven or Hawk. */
294 early_read_config_word(0, 0, 0, PCI_DEVICE_ID, &devid);
295
296 switch (devid) {
297 case PCI_DEVICE_ID_MOTOROLA_RAVEN:
298 case PCI_DEVICE_ID_MOTOROLA_HAWK:
299 break;
300 default:
301 OpenPIC_Addr = NULL;
302 return 1;
303 }
304
305 /* Read the memory base register. */
306 early_read_config_dword(0, 0, 0, PCI_BASE_ADDRESS_1, &pci_membase);
307
308 if (pci_membase == 0) {
309 OpenPIC_Addr = NULL;
310 return 1;
311 }
312
313 /* Map the MPIC registers to virtual memory. */
314 OpenPIC_Addr = ioremap(pci_membase + pci_mem_offset, 0x22000);
315
316 return 0;
317}
diff --git a/arch/ppc/syslib/i8259.c b/arch/ppc/syslib/i8259.c
deleted file mode 100644
index 559f27c6aefe..000000000000
--- a/arch/ppc/syslib/i8259.c
+++ /dev/null
@@ -1,213 +0,0 @@
1/*
2 * i8259 interrupt controller driver.
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/init.h>
10#include <linux/ioport.h>
11#include <linux/interrupt.h>
12#include <asm/io.h>
13#include <asm/i8259.h>
14
15static volatile void __iomem *pci_intack; /* RO, gives us the irq vector */
16
17static unsigned char cached_8259[2] = { 0xff, 0xff };
18#define cached_A1 (cached_8259[0])
19#define cached_21 (cached_8259[1])
20
21static DEFINE_SPINLOCK(i8259_lock);
22
23static int i8259_pic_irq_offset;
24
25/*
26 * Acknowledge the IRQ using either the PCI host bridge's interrupt
27 * acknowledge feature or poll. How i8259_init() is called determines
28 * which is called. It should be noted that polling is broken on some
29 * IBM and Motorola PReP boxes so we must use the int-ack feature on them.
30 */
31int i8259_irq(void)
32{
33 int irq;
34
35 spin_lock(&i8259_lock);
36
37 /* Either int-ack or poll for the IRQ */
38 if (pci_intack)
39 irq = readb(pci_intack);
40 else {
41 /* Perform an interrupt acknowledge cycle on controller 1. */
42 outb(0x0C, 0x20); /* prepare for poll */
43 irq = inb(0x20) & 7;
44 if (irq == 2 ) {
45 /*
46 * Interrupt is cascaded so perform interrupt
47 * acknowledge on controller 2.
48 */
49 outb(0x0C, 0xA0); /* prepare for poll */
50 irq = (inb(0xA0) & 7) + 8;
51 }
52 }
53
54 if (irq == 7) {
55 /*
56 * This may be a spurious interrupt.
57 *
58 * Read the interrupt status register (ISR). If the most
59 * significant bit is not set then there is no valid
60 * interrupt.
61 */
62 if (!pci_intack)
63 outb(0x0B, 0x20); /* ISR register */
64 if(~inb(0x20) & 0x80)
65 irq = -1;
66 }
67
68 spin_unlock(&i8259_lock);
69 return irq + i8259_pic_irq_offset;
70}
71
72static void i8259_mask_and_ack_irq(unsigned int irq_nr)
73{
74 unsigned long flags;
75
76 spin_lock_irqsave(&i8259_lock, flags);
77 irq_nr -= i8259_pic_irq_offset;
78 if (irq_nr > 7) {
79 cached_A1 |= 1 << (irq_nr-8);
80 inb(0xA1); /* DUMMY */
81 outb(cached_A1, 0xA1);
82 outb(0x20, 0xA0); /* Non-specific EOI */
83 outb(0x20, 0x20); /* Non-specific EOI to cascade */
84 } else {
85 cached_21 |= 1 << irq_nr;
86 inb(0x21); /* DUMMY */
87 outb(cached_21, 0x21);
88 outb(0x20, 0x20); /* Non-specific EOI */
89 }
90 spin_unlock_irqrestore(&i8259_lock, flags);
91}
92
93static void i8259_set_irq_mask(int irq_nr)
94{
95 outb(cached_A1,0xA1);
96 outb(cached_21,0x21);
97}
98
99static void i8259_mask_irq(unsigned int irq_nr)
100{
101 unsigned long flags;
102
103 spin_lock_irqsave(&i8259_lock, flags);
104 irq_nr -= i8259_pic_irq_offset;
105 if (irq_nr < 8)
106 cached_21 |= 1 << irq_nr;
107 else
108 cached_A1 |= 1 << (irq_nr-8);
109 i8259_set_irq_mask(irq_nr);
110 spin_unlock_irqrestore(&i8259_lock, flags);
111}
112
113static void i8259_unmask_irq(unsigned int irq_nr)
114{
115 unsigned long flags;
116
117 spin_lock_irqsave(&i8259_lock, flags);
118 irq_nr -= i8259_pic_irq_offset;
119 if (irq_nr < 8)
120 cached_21 &= ~(1 << irq_nr);
121 else
122 cached_A1 &= ~(1 << (irq_nr-8));
123 i8259_set_irq_mask(irq_nr);
124 spin_unlock_irqrestore(&i8259_lock, flags);
125}
126
127static struct irq_chip i8259_pic = {
128 .typename = " i8259 ",
129 .mask = i8259_mask_irq,
130 .disable = i8259_mask_irq,
131 .unmask = i8259_unmask_irq,
132 .mask_ack = i8259_mask_and_ack_irq,
133};
134
135static struct resource pic1_iores = {
136 .name = "8259 (master)",
137 .start = 0x20,
138 .end = 0x21,
139 .flags = IORESOURCE_BUSY,
140};
141
142static struct resource pic2_iores = {
143 .name = "8259 (slave)",
144 .start = 0xa0,
145 .end = 0xa1,
146 .flags = IORESOURCE_BUSY,
147};
148
149static struct resource pic_edgectrl_iores = {
150 .name = "8259 edge control",
151 .start = 0x4d0,
152 .end = 0x4d1,
153 .flags = IORESOURCE_BUSY,
154};
155
156static struct irqaction i8259_irqaction = {
157 .handler = no_action,
158 .flags = IRQF_DISABLED,
159 .mask = CPU_MASK_NONE,
160 .name = "82c59 secondary cascade",
161};
162
163/*
164 * i8259_init()
165 * intack_addr - PCI interrupt acknowledge (real) address which will return
166 * the active irq from the 8259
167 */
168void __init i8259_init(unsigned long intack_addr, int offset)
169{
170 unsigned long flags;
171 int i;
172
173 spin_lock_irqsave(&i8259_lock, flags);
174 i8259_pic_irq_offset = offset;
175
176 /* init master interrupt controller */
177 outb(0x11, 0x20); /* Start init sequence */
178 outb(0x00, 0x21); /* Vector base */
179 outb(0x04, 0x21); /* edge tiggered, Cascade (slave) on IRQ2 */
180 outb(0x01, 0x21); /* Select 8086 mode */
181
182 /* init slave interrupt controller */
183 outb(0x11, 0xA0); /* Start init sequence */
184 outb(0x08, 0xA1); /* Vector base */
185 outb(0x02, 0xA1); /* edge triggered, Cascade (slave) on IRQ2 */
186 outb(0x01, 0xA1); /* Select 8086 mode */
187
188 /* always read ISR */
189 outb(0x0B, 0x20);
190 outb(0x0B, 0xA0);
191
192 /* Mask all interrupts */
193 outb(cached_A1, 0xA1);
194 outb(cached_21, 0x21);
195
196 spin_unlock_irqrestore(&i8259_lock, flags);
197
198 for (i = 0; i < NUM_ISA_INTERRUPTS; ++i) {
199 set_irq_chip_and_handler(offset + i, &i8259_pic,
200 handle_level_irq);
201 irq_desc[offset + i].status |= IRQ_LEVEL;
202 }
203
204 /* reserve our resources */
205 setup_irq(offset + 2, &i8259_irqaction);
206 request_resource(&ioport_resource, &pic1_iores);
207 request_resource(&ioport_resource, &pic2_iores);
208 request_resource(&ioport_resource, &pic_edgectrl_iores);
209
210 if (intack_addr != 0)
211 pci_intack = ioremap(intack_addr, 1);
212
213}
diff --git a/arch/ppc/syslib/ibm440gp_common.c b/arch/ppc/syslib/ibm440gp_common.c
deleted file mode 100644
index a3927ec9b5d7..000000000000
--- a/arch/ppc/syslib/ibm440gp_common.c
+++ /dev/null
@@ -1,73 +0,0 @@
1/*
2 * PPC440GP system library
3 *
4 * Matt Porter <mporter@mvista.com>
5 * Copyright 2002-2003 MontaVista Software Inc.
6 *
7 * Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net>
8 * Copyright (c) 2003 Zultys Technologies
9 *
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the
12 * Free Software Foundation; either version 2 of the License, or (at your
13 * option) any later version.
14 *
15 */
16#include <linux/types.h>
17#include <asm/reg.h>
18#include <asm/ibm44x.h>
19#include <asm/mmu.h>
20
21/*
22 * Calculate 440GP clocks
23 */
24void __init ibm440gp_get_clocks(struct ibm44x_clocks* p,
25 unsigned int sys_clk,
26 unsigned int ser_clk)
27{
28 u32 cpc0_sys0 = mfdcr(DCRN_CPC0_SYS0);
29 u32 cpc0_cr0 = mfdcr(DCRN_CPC0_CR0);
30 u32 opdv = ((cpc0_sys0 >> 10) & 0x3) + 1;
31 u32 epdv = ((cpc0_sys0 >> 8) & 0x3) + 1;
32
33 if (cpc0_sys0 & 0x2){
34 /* Bypass system PLL */
35 p->cpu = p->plb = sys_clk;
36 }
37 else {
38 u32 fbdv, fwdva, fwdvb, m, vco;
39
40 fbdv = (cpc0_sys0 >> 18) & 0x0f;
41 if (!fbdv)
42 fbdv = 16;
43
44 fwdva = 8 - ((cpc0_sys0 >> 15) & 0x7);
45 fwdvb = 8 - ((cpc0_sys0 >> 12) & 0x7);
46
47 /* Feedback path */
48 if (cpc0_sys0 & 0x00000080){
49 /* PerClk */
50 m = fwdvb * opdv * epdv;
51 }
52 else {
53 /* CPU clock */
54 m = fbdv * fwdva;
55 }
56 vco = sys_clk * m;
57 p->cpu = vco / fwdva;
58 p->plb = vco / fwdvb;
59 }
60
61 p->opb = p->plb / opdv;
62 p->ebc = p->opb / epdv;
63
64 if (cpc0_cr0 & 0x00400000){
65 /* External UART clock */
66 p->uart0 = p->uart1 = ser_clk;
67 }
68 else {
69 /* Internal UART clock */
70 u32 uart_div = ((cpc0_cr0 >> 16) & 0x1f) + 1;
71 p->uart0 = p->uart1 = p->plb / uart_div;
72 }
73}
diff --git a/arch/ppc/syslib/ibm440gp_common.h b/arch/ppc/syslib/ibm440gp_common.h
deleted file mode 100644
index 94d7835038ad..000000000000
--- a/arch/ppc/syslib/ibm440gp_common.h
+++ /dev/null
@@ -1,32 +0,0 @@
1/*
2 * PPC440GP system library
3 *
4 * Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net>
5 * Copyright (c) 2003 Zultys Technologies
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 *
12 */
13#ifdef __KERNEL__
14#ifndef __PPC_SYSLIB_IBM440GP_COMMON_H
15#define __PPC_SYSLIB_IBM440GP_COMMON_H
16
17#ifndef __ASSEMBLY__
18
19#include <linux/init.h>
20#include <syslib/ibm44x_common.h>
21
22/*
23 * Please, refer to the Figure 13.1 in 440GP user manual
24 *
25 * if internal UART clock is used, ser_clk is ignored
26 */
27void ibm440gp_get_clocks(struct ibm44x_clocks*, unsigned int sys_clk,
28 unsigned int ser_clk) __init;
29
30#endif /* __ASSEMBLY__ */
31#endif /* __PPC_SYSLIB_IBM440GP_COMMON_H */
32#endif /* __KERNEL__ */
diff --git a/arch/ppc/syslib/ibm440gx_common.c b/arch/ppc/syslib/ibm440gx_common.c
deleted file mode 100644
index 6ad52f4a26e1..000000000000
--- a/arch/ppc/syslib/ibm440gx_common.c
+++ /dev/null
@@ -1,294 +0,0 @@
1/*
2 * PPC440GX system library
3 *
4 * Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net>
5 * Copyright (c) 2003 - 2006 Zultys Technologies
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 *
12 */
13#include <linux/kernel.h>
14#include <linux/interrupt.h>
15#include <asm/ibm44x.h>
16#include <asm/mmu.h>
17#include <asm/processor.h>
18#include <syslib/ibm440gx_common.h>
19
20/*
21 * Calculate 440GX clocks
22 */
23static inline u32 __fix_zero(u32 v, u32 def){
24 return v ? v : def;
25}
26
27void __init ibm440gx_get_clocks(struct ibm44x_clocks* p, unsigned int sys_clk,
28 unsigned int ser_clk)
29{
30 u32 pllc = CPR_READ(DCRN_CPR_PLLC);
31 u32 plld = CPR_READ(DCRN_CPR_PLLD);
32 u32 uart0 = SDR_READ(DCRN_SDR_UART0);
33 u32 uart1 = SDR_READ(DCRN_SDR_UART1);
34#ifdef CONFIG_440EP
35 u32 uart2 = SDR_READ(DCRN_SDR_UART2);
36 u32 uart3 = SDR_READ(DCRN_SDR_UART3);
37#endif
38
39 /* Dividers */
40 u32 fbdv = __fix_zero((plld >> 24) & 0x1f, 32);
41 u32 fwdva = __fix_zero((plld >> 16) & 0xf, 16);
42 u32 fwdvb = __fix_zero((plld >> 8) & 7, 8);
43 u32 lfbdv = __fix_zero(plld & 0x3f, 64);
44 u32 pradv0 = __fix_zero((CPR_READ(DCRN_CPR_PRIMAD) >> 24) & 7, 8);
45 u32 prbdv0 = __fix_zero((CPR_READ(DCRN_CPR_PRIMBD) >> 24) & 7, 8);
46 u32 opbdv0 = __fix_zero((CPR_READ(DCRN_CPR_OPBD) >> 24) & 3, 4);
47 u32 perdv0 = __fix_zero((CPR_READ(DCRN_CPR_PERD) >> 24) & 3, 4);
48
49 /* Input clocks for primary dividers */
50 u32 clk_a, clk_b;
51
52 if (pllc & 0x40000000){
53 u32 m;
54
55 /* Feedback path */
56 switch ((pllc >> 24) & 7){
57 case 0:
58 /* PLLOUTx */
59 m = ((pllc & 0x20000000) ? fwdvb : fwdva) * lfbdv;
60 break;
61 case 1:
62 /* CPU */
63 m = fwdva * pradv0;
64 break;
65 case 5:
66 /* PERClk */
67 m = fwdvb * prbdv0 * opbdv0 * perdv0;
68 break;
69 default:
70 printk(KERN_EMERG "invalid PLL feedback source\n");
71 goto bypass;
72 }
73 m *= fbdv;
74 p->vco = sys_clk * m;
75 clk_a = p->vco / fwdva;
76 clk_b = p->vco / fwdvb;
77 }
78 else {
79bypass:
80 /* Bypass system PLL */
81 p->vco = 0;
82 clk_a = clk_b = sys_clk;
83 }
84
85 p->cpu = clk_a / pradv0;
86 p->plb = clk_b / prbdv0;
87 p->opb = p->plb / opbdv0;
88 p->ebc = p->opb / perdv0;
89
90 /* UARTs clock */
91 if (uart0 & 0x00800000)
92 p->uart0 = ser_clk;
93 else
94 p->uart0 = p->plb / __fix_zero(uart0 & 0xff, 256);
95
96 if (uart1 & 0x00800000)
97 p->uart1 = ser_clk;
98 else
99 p->uart1 = p->plb / __fix_zero(uart1 & 0xff, 256);
100#ifdef CONFIG_440EP
101 if (uart2 & 0x00800000)
102 p->uart2 = ser_clk;
103 else
104 p->uart2 = p->plb / __fix_zero(uart2 & 0xff, 256);
105
106 if (uart3 & 0x00800000)
107 p->uart3 = ser_clk;
108 else
109 p->uart3 = p->plb / __fix_zero(uart3 & 0xff, 256);
110#endif
111}
112
113/* Issue L2C diagnostic command */
114static inline u32 l2c_diag(u32 addr)
115{
116 mtdcr(DCRN_L2C0_ADDR, addr);
117 mtdcr(DCRN_L2C0_CMD, L2C_CMD_DIAG);
118 while (!(mfdcr(DCRN_L2C0_SR) & L2C_SR_CC)) ;
119 return mfdcr(DCRN_L2C0_DATA);
120}
121
122static irqreturn_t l2c_error_handler(int irq, void* dev)
123{
124 u32 sr = mfdcr(DCRN_L2C0_SR);
125 if (sr & L2C_SR_CPE){
126 /* Read cache trapped address */
127 u32 addr = l2c_diag(0x42000000);
128 printk(KERN_EMERG "L2C: Cache Parity Error, addr[16:26] = 0x%08x\n", addr);
129 }
130 if (sr & L2C_SR_TPE){
131 /* Read tag trapped address */
132 u32 addr = l2c_diag(0x82000000) >> 16;
133 printk(KERN_EMERG "L2C: Tag Parity Error, addr[16:26] = 0x%08x\n", addr);
134 }
135
136 /* Clear parity errors */
137 if (sr & (L2C_SR_CPE | L2C_SR_TPE)){
138 mtdcr(DCRN_L2C0_ADDR, 0);
139 mtdcr(DCRN_L2C0_CMD, L2C_CMD_CCP | L2C_CMD_CTE);
140 } else
141 printk(KERN_EMERG "L2C: LRU error\n");
142
143 return IRQ_HANDLED;
144}
145
146/* Enable L2 cache */
147void __init ibm440gx_l2c_enable(void){
148 u32 r;
149 unsigned long flags;
150
151 /* Install error handler */
152 if (request_irq(87, l2c_error_handler, IRQF_DISABLED, "L2C", 0) < 0){
153 printk(KERN_ERR "Cannot install L2C error handler, cache is not enabled\n");
154 return;
155 }
156
157 local_irq_save(flags);
158 asm volatile ("sync" ::: "memory");
159
160 /* Disable SRAM */
161 mtdcr(DCRN_SRAM0_DPC, mfdcr(DCRN_SRAM0_DPC) & ~SRAM_DPC_ENABLE);
162 mtdcr(DCRN_SRAM0_SB0CR, mfdcr(DCRN_SRAM0_SB0CR) & ~SRAM_SBCR_BU_MASK);
163 mtdcr(DCRN_SRAM0_SB1CR, mfdcr(DCRN_SRAM0_SB1CR) & ~SRAM_SBCR_BU_MASK);
164 mtdcr(DCRN_SRAM0_SB2CR, mfdcr(DCRN_SRAM0_SB2CR) & ~SRAM_SBCR_BU_MASK);
165 mtdcr(DCRN_SRAM0_SB3CR, mfdcr(DCRN_SRAM0_SB3CR) & ~SRAM_SBCR_BU_MASK);
166
167 /* Enable L2_MODE without ICU/DCU */
168 r = mfdcr(DCRN_L2C0_CFG) & ~(L2C_CFG_ICU | L2C_CFG_DCU | L2C_CFG_SS_MASK);
169 r |= L2C_CFG_L2M | L2C_CFG_SS_256;
170 mtdcr(DCRN_L2C0_CFG, r);
171
172 mtdcr(DCRN_L2C0_ADDR, 0);
173
174 /* Hardware Clear Command */
175 mtdcr(DCRN_L2C0_CMD, L2C_CMD_HCC);
176 while (!(mfdcr(DCRN_L2C0_SR) & L2C_SR_CC)) ;
177
178 /* Clear Cache Parity and Tag Errors */
179 mtdcr(DCRN_L2C0_CMD, L2C_CMD_CCP | L2C_CMD_CTE);
180
181 /* Enable 64G snoop region starting at 0 */
182 r = mfdcr(DCRN_L2C0_SNP0) & ~(L2C_SNP_BA_MASK | L2C_SNP_SSR_MASK);
183 r |= L2C_SNP_SSR_32G | L2C_SNP_ESR;
184 mtdcr(DCRN_L2C0_SNP0, r);
185
186 r = mfdcr(DCRN_L2C0_SNP1) & ~(L2C_SNP_BA_MASK | L2C_SNP_SSR_MASK);
187 r |= 0x80000000 | L2C_SNP_SSR_32G | L2C_SNP_ESR;
188 mtdcr(DCRN_L2C0_SNP1, r);
189
190 asm volatile ("sync" ::: "memory");
191
192 /* Enable ICU/DCU ports */
193 r = mfdcr(DCRN_L2C0_CFG);
194 r &= ~(L2C_CFG_DCW_MASK | L2C_CFG_PMUX_MASK | L2C_CFG_PMIM | L2C_CFG_TPEI
195 | L2C_CFG_CPEI | L2C_CFG_NAM | L2C_CFG_NBRM);
196 r |= L2C_CFG_ICU | L2C_CFG_DCU | L2C_CFG_TPC | L2C_CFG_CPC | L2C_CFG_FRAN
197 | L2C_CFG_CPIM | L2C_CFG_TPIM | L2C_CFG_LIM | L2C_CFG_SMCM;
198 mtdcr(DCRN_L2C0_CFG, r);
199
200 asm volatile ("sync; isync" ::: "memory");
201 local_irq_restore(flags);
202}
203
204/* Disable L2 cache */
205void __init ibm440gx_l2c_disable(void){
206 u32 r;
207 unsigned long flags;
208
209 local_irq_save(flags);
210 asm volatile ("sync" ::: "memory");
211
212 /* Disable L2C mode */
213 r = mfdcr(DCRN_L2C0_CFG) & ~(L2C_CFG_L2M | L2C_CFG_ICU | L2C_CFG_DCU);
214 mtdcr(DCRN_L2C0_CFG, r);
215
216 /* Enable SRAM */
217 mtdcr(DCRN_SRAM0_DPC, mfdcr(DCRN_SRAM0_DPC) | SRAM_DPC_ENABLE);
218 mtdcr(DCRN_SRAM0_SB0CR,
219 SRAM_SBCR_BAS0 | SRAM_SBCR_BS_64KB | SRAM_SBCR_BU_RW);
220 mtdcr(DCRN_SRAM0_SB1CR,
221 SRAM_SBCR_BAS1 | SRAM_SBCR_BS_64KB | SRAM_SBCR_BU_RW);
222 mtdcr(DCRN_SRAM0_SB2CR,
223 SRAM_SBCR_BAS2 | SRAM_SBCR_BS_64KB | SRAM_SBCR_BU_RW);
224 mtdcr(DCRN_SRAM0_SB3CR,
225 SRAM_SBCR_BAS3 | SRAM_SBCR_BS_64KB | SRAM_SBCR_BU_RW);
226
227 asm volatile ("sync; isync" ::: "memory");
228 local_irq_restore(flags);
229}
230
231void __init ibm440gx_l2c_setup(struct ibm44x_clocks* p)
232{
233 /* Disable L2C on rev.A, rev.B and 800MHz version of rev.C,
234 enable it on all other revisions
235 */
236 if (strcmp(cur_cpu_spec->cpu_name, "440GX Rev. A") == 0 ||
237 strcmp(cur_cpu_spec->cpu_name, "440GX Rev. B") == 0
238 || (strcmp(cur_cpu_spec->cpu_name, "440GX Rev. C")
239 == 0 && p->cpu > 667000000))
240 ibm440gx_l2c_disable();
241 else
242 ibm440gx_l2c_enable();
243}
244
245int __init ibm440gx_get_eth_grp(void)
246{
247 return (SDR_READ(DCRN_SDR_PFC1) & DCRN_SDR_PFC1_EPS) >> DCRN_SDR_PFC1_EPS_SHIFT;
248}
249
250void __init ibm440gx_set_eth_grp(int group)
251{
252 SDR_WRITE(DCRN_SDR_PFC1, (SDR_READ(DCRN_SDR_PFC1) & ~DCRN_SDR_PFC1_EPS) | (group << DCRN_SDR_PFC1_EPS_SHIFT));
253}
254
255void __init ibm440gx_tah_enable(void)
256{
257 /* Enable TAH0 and TAH1 */
258 SDR_WRITE(DCRN_SDR_MFR,SDR_READ(DCRN_SDR_MFR) &
259 ~DCRN_SDR_MFR_TAH0);
260 SDR_WRITE(DCRN_SDR_MFR,SDR_READ(DCRN_SDR_MFR) &
261 ~DCRN_SDR_MFR_TAH1);
262}
263
264int ibm440gx_show_cpuinfo(struct seq_file *m){
265
266 u32 l2c_cfg = mfdcr(DCRN_L2C0_CFG);
267 const char* s;
268 if (l2c_cfg & L2C_CFG_L2M){
269 switch (l2c_cfg & (L2C_CFG_ICU | L2C_CFG_DCU)){
270 case L2C_CFG_ICU: s = "I-Cache only"; break;
271 case L2C_CFG_DCU: s = "D-Cache only"; break;
272 default: s = "I-Cache/D-Cache"; break;
273 }
274 }
275 else
276 s = "disabled";
277
278 seq_printf(m, "L2-Cache\t: %s (0x%08x 0x%08x)\n", s,
279 l2c_cfg, mfdcr(DCRN_L2C0_SR));
280
281 return 0;
282}
283
284void __init ibm440gx_platform_init(unsigned long r3, unsigned long r4,
285 unsigned long r5, unsigned long r6,
286 unsigned long r7)
287{
288 /* Erratum 440_43 workaround, disable L1 cache parity checking */
289 if (!strcmp(cur_cpu_spec->cpu_name, "440GX Rev. C") ||
290 !strcmp(cur_cpu_spec->cpu_name, "440GX Rev. F"))
291 mtspr(SPRN_CCR1, mfspr(SPRN_CCR1) | CCR1_DPC);
292
293 ibm44x_platform_init(r3, r4, r5, r6, r7);
294}
diff --git a/arch/ppc/syslib/ibm440gx_common.h b/arch/ppc/syslib/ibm440gx_common.h
deleted file mode 100644
index 8d6f203e7a1d..000000000000
--- a/arch/ppc/syslib/ibm440gx_common.h
+++ /dev/null
@@ -1,58 +0,0 @@
1/*
2 * PPC440GX system library
3 *
4 * Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net>
5 * Copyright (c) 2003, 2004 Zultys Technologies
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 *
12 */
13#ifdef __KERNEL__
14#ifndef __PPC_SYSLIB_IBM440GX_COMMON_H
15#define __PPC_SYSLIB_IBM440GX_COMMON_H
16
17#ifndef __ASSEMBLY__
18
19#include <linux/init.h>
20#include <linux/seq_file.h>
21#include <syslib/ibm44x_common.h>
22
23/*
24 * Please, refer to the Figure 14.1 in 440GX user manual
25 *
26 * if internal UART clock is used, ser_clk is ignored
27 */
28void ibm440gx_get_clocks(struct ibm44x_clocks*, unsigned int sys_clk,
29 unsigned int ser_clk) __init;
30
31/* common 440GX platform init */
32void ibm440gx_platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
33 unsigned long r6, unsigned long r7) __init;
34
35/* Enable L2 cache */
36void ibm440gx_l2c_enable(void) __init;
37
38/* Disable L2 cache */
39void ibm440gx_l2c_disable(void) __init;
40
41/* Enable/disable L2 cache for a particular chip revision */
42void ibm440gx_l2c_setup(struct ibm44x_clocks*) __init;
43
44/* Get Ethernet Group */
45int ibm440gx_get_eth_grp(void) __init;
46
47/* Set Ethernet Group */
48void ibm440gx_set_eth_grp(int group) __init;
49
50/* Enable TAH devices */
51void ibm440gx_tah_enable(void) __init;
52
53/* Add L2C info to /proc/cpuinfo */
54int ibm440gx_show_cpuinfo(struct seq_file*);
55
56#endif /* __ASSEMBLY__ */
57#endif /* __PPC_SYSLIB_IBM440GX_COMMON_H */
58#endif /* __KERNEL__ */
diff --git a/arch/ppc/syslib/ibm440sp_common.c b/arch/ppc/syslib/ibm440sp_common.c
deleted file mode 100644
index 571f8bcf78e6..000000000000
--- a/arch/ppc/syslib/ibm440sp_common.c
+++ /dev/null
@@ -1,68 +0,0 @@
1/*
2 * PPC440SP/PPC440SPe system library
3 *
4 * Matt Porter <mporter@kernel.crashing.org>
5 * Copyright 2002-2005 MontaVista Software Inc.
6 *
7 * Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net>
8 * Copyright (c) 2003, 2004 Zultys Technologies
9 *
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the
12 * Free Software Foundation; either version 2 of the License, or (at your
13 * option) any later version.
14 *
15 */
16#include <linux/types.h>
17#include <linux/serial.h>
18
19#include <asm/param.h>
20#include <asm/ibm44x.h>
21#include <asm/mmu.h>
22#include <asm/machdep.h>
23#include <asm/time.h>
24#include <asm/ppc4xx_pic.h>
25
26/*
27 * Read the 440SP memory controller to get size of system memory.
28 */
29unsigned long __init ibm440sp_find_end_of_memory(void)
30{
31 u32 i;
32 u32 mem_size = 0;
33
34 /* Read two bank sizes and sum */
35 for (i=0; i< MQ0_NUM_BANKS; i++)
36 switch (mfdcr(DCRN_MQ0_BS0BAS + i) & MQ0_CONFIG_SIZE_MASK) {
37 case MQ0_CONFIG_SIZE_8M:
38 mem_size += PPC44x_MEM_SIZE_8M;
39 break;
40 case MQ0_CONFIG_SIZE_16M:
41 mem_size += PPC44x_MEM_SIZE_16M;
42 break;
43 case MQ0_CONFIG_SIZE_32M:
44 mem_size += PPC44x_MEM_SIZE_32M;
45 break;
46 case MQ0_CONFIG_SIZE_64M:
47 mem_size += PPC44x_MEM_SIZE_64M;
48 break;
49 case MQ0_CONFIG_SIZE_128M:
50 mem_size += PPC44x_MEM_SIZE_128M;
51 break;
52 case MQ0_CONFIG_SIZE_256M:
53 mem_size += PPC44x_MEM_SIZE_256M;
54 break;
55 case MQ0_CONFIG_SIZE_512M:
56 mem_size += PPC44x_MEM_SIZE_512M;
57 break;
58 case MQ0_CONFIG_SIZE_1G:
59 mem_size += PPC44x_MEM_SIZE_1G;
60 break;
61 case MQ0_CONFIG_SIZE_2G:
62 mem_size += PPC44x_MEM_SIZE_2G;
63 break;
64 default:
65 break;
66 }
67 return mem_size;
68}
diff --git a/arch/ppc/syslib/ibm440sp_common.h b/arch/ppc/syslib/ibm440sp_common.h
deleted file mode 100644
index 8077bf8ed118..000000000000
--- a/arch/ppc/syslib/ibm440sp_common.h
+++ /dev/null
@@ -1,23 +0,0 @@
1/*
2 * PPC440SP system library
3 *
4 * Matt Porter <mporter@kernel.crashing.org>
5 * Copyright 2004-2005 MontaVista Software, Inc.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 *
12 */
13#ifdef __KERNEL__
14#ifndef __PPC_SYSLIB_IBM440SP_COMMON_H
15#define __PPC_SYSLIB_IBM440SP_COMMON_H
16
17#ifndef __ASSEMBLY__
18
19extern unsigned long __init ibm440sp_find_end_of_memory(void);
20
21#endif /* __ASSEMBLY__ */
22#endif /* __PPC_SYSLIB_IBM440SP_COMMON_H */
23#endif /* __KERNEL__ */
diff --git a/arch/ppc/syslib/ibm44x_common.c b/arch/ppc/syslib/ibm44x_common.c
deleted file mode 100644
index 01f99b4a6649..000000000000
--- a/arch/ppc/syslib/ibm44x_common.c
+++ /dev/null
@@ -1,235 +0,0 @@
1/*
2 * PPC44x system library
3 *
4 * Matt Porter <mporter@kernel.crashing.org>
5 * Copyright 2002-2005 MontaVista Software Inc.
6 *
7 * Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net>
8 * Copyright (c) 2003, 2004 Zultys Technologies
9 *
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the
12 * Free Software Foundation; either version 2 of the License, or (at your
13 * option) any later version.
14 *
15 */
16#include <linux/time.h>
17#include <linux/types.h>
18#include <linux/serial.h>
19#include <linux/module.h>
20#include <linux/initrd.h>
21
22#include <asm/ibm44x.h>
23#include <asm/mmu.h>
24#include <asm/machdep.h>
25#include <asm/time.h>
26#include <asm/ppc4xx_pic.h>
27#include <asm/param.h>
28#include <asm/bootinfo.h>
29#include <asm/ppcboot.h>
30
31#include <syslib/gen550.h>
32
33/* Global Variables */
34bd_t __res;
35
36phys_addr_t fixup_bigphys_addr(phys_addr_t addr, phys_addr_t size)
37{
38 phys_addr_t page_4gb = 0;
39
40 /*
41 * Trap the least significant 32-bit portions of an
42 * address in the 440's 36-bit address space. Fix
43 * them up with the appropriate ERPN
44 */
45 if ((addr >= PPC44x_IO_LO) && (addr <= PPC44x_IO_HI))
46 page_4gb = PPC44x_IO_PAGE;
47 else if ((addr >= PPC44x_PCI0CFG_LO) && (addr <= PPC44x_PCI0CFG_HI))
48 page_4gb = PPC44x_PCICFG_PAGE;
49#ifdef CONFIG_440SP
50 else if ((addr >= PPC44x_PCI1CFG_LO) && (addr <= PPC44x_PCI1CFG_HI))
51 page_4gb = PPC44x_PCICFG_PAGE;
52 else if ((addr >= PPC44x_PCI2CFG_LO) && (addr <= PPC44x_PCI2CFG_HI))
53 page_4gb = PPC44x_PCICFG_PAGE;
54#endif
55 else if ((addr >= PPC44x_PCIMEM_LO) && (addr <= PPC44x_PCIMEM_HI))
56 page_4gb = PPC44x_PCIMEM_PAGE;
57
58 return (page_4gb | addr);
59};
60EXPORT_SYMBOL(fixup_bigphys_addr);
61
62void __init ibm44x_calibrate_decr(unsigned int freq)
63{
64 tb_ticks_per_jiffy = freq / HZ;
65 tb_to_us = mulhwu_scale_factor(freq, 1000000);
66
67 /* Set the time base to zero */
68 mtspr(SPRN_TBWL, 0);
69 mtspr(SPRN_TBWU, 0);
70
71 /* Clear any pending timer interrupts */
72 mtspr(SPRN_TSR, TSR_ENW | TSR_WIS | TSR_DIS | TSR_FIS);
73
74 /* Enable decrementer interrupt */
75 mtspr(SPRN_TCR, TCR_DIE);
76}
77
78extern void abort(void);
79
80static void ibm44x_restart(char *cmd)
81{
82 local_irq_disable();
83 abort();
84}
85
86static void ibm44x_power_off(void)
87{
88 local_irq_disable();
89 for(;;);
90}
91
92static void ibm44x_halt(void)
93{
94 local_irq_disable();
95 for(;;);
96}
97
98/*
99 * Read the 44x memory controller to get size of system memory.
100 */
101static unsigned long __init ibm44x_find_end_of_memory(void)
102{
103 u32 i, bank_config;
104 u32 mem_size = 0;
105
106 for (i=0; i<4; i++)
107 {
108 switch (i)
109 {
110 case 0:
111 mtdcr(DCRN_SDRAM0_CFGADDR, SDRAM0_B0CR);
112 break;
113 case 1:
114 mtdcr(DCRN_SDRAM0_CFGADDR, SDRAM0_B1CR);
115 break;
116 case 2:
117 mtdcr(DCRN_SDRAM0_CFGADDR, SDRAM0_B2CR);
118 break;
119 case 3:
120 mtdcr(DCRN_SDRAM0_CFGADDR, SDRAM0_B3CR);
121 break;
122 }
123
124 bank_config = mfdcr(DCRN_SDRAM0_CFGDATA);
125
126 if (!(bank_config & SDRAM_CONFIG_BANK_ENABLE))
127 continue;
128 switch (SDRAM_CONFIG_BANK_SIZE(bank_config))
129 {
130 case SDRAM_CONFIG_SIZE_8M:
131 mem_size += PPC44x_MEM_SIZE_8M;
132 break;
133 case SDRAM_CONFIG_SIZE_16M:
134 mem_size += PPC44x_MEM_SIZE_16M;
135 break;
136 case SDRAM_CONFIG_SIZE_32M:
137 mem_size += PPC44x_MEM_SIZE_32M;
138 break;
139 case SDRAM_CONFIG_SIZE_64M:
140 mem_size += PPC44x_MEM_SIZE_64M;
141 break;
142 case SDRAM_CONFIG_SIZE_128M:
143 mem_size += PPC44x_MEM_SIZE_128M;
144 break;
145 case SDRAM_CONFIG_SIZE_256M:
146 mem_size += PPC44x_MEM_SIZE_256M;
147 break;
148 case SDRAM_CONFIG_SIZE_512M:
149 mem_size += PPC44x_MEM_SIZE_512M;
150 break;
151 }
152 }
153 return mem_size;
154}
155
156void __init ibm44x_platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
157 unsigned long r6, unsigned long r7)
158{
159 parse_bootinfo(find_bootinfo());
160
161 /*
162 * If we were passed in a board information, copy it into the
163 * residual data area.
164 */
165 if (r3)
166 __res = *(bd_t *)(r3 + KERNELBASE);
167
168#if defined(CONFIG_BLK_DEV_INITRD)
169 /*
170 * If the init RAM disk has been configured in, and there's a valid
171 * starting address for it, set it up.
172 */
173 if (r4) {
174 initrd_start = r4 + KERNELBASE;
175 initrd_end = r5 + KERNELBASE;
176 }
177#endif /* CONFIG_BLK_DEV_INITRD */
178
179 /* Copy the kernel command line arguments to a safe place. */
180
181 if (r6) {
182 *(char *) (r7 + KERNELBASE) = 0;
183 strcpy(cmd_line, (char *) (r6 + KERNELBASE));
184 }
185
186 ppc_md.init_IRQ = ppc4xx_pic_init;
187 ppc_md.find_end_of_memory = ibm44x_find_end_of_memory;
188 ppc_md.restart = ibm44x_restart;
189 ppc_md.power_off = ibm44x_power_off;
190 ppc_md.halt = ibm44x_halt;
191
192#ifdef CONFIG_SERIAL_TEXT_DEBUG
193 ppc_md.progress = gen550_progress;
194#endif /* CONFIG_SERIAL_TEXT_DEBUG */
195#ifdef CONFIG_KGDB
196 ppc_md.kgdb_map_scc = gen550_kgdb_map_scc;
197#endif
198
199 /*
200 * The Abatron BDI JTAG debugger does not tolerate others
201 * mucking with the debug registers.
202 */
203#if !defined(CONFIG_BDI_SWITCH)
204 /* Enable internal debug mode */
205 mtspr(SPRN_DBCR0, (DBCR0_IDM));
206
207 /* Clear any residual debug events */
208 mtspr(SPRN_DBSR, 0xffffffff);
209#endif
210}
211
212/* Called from machine_check_exception */
213void platform_machine_check(struct pt_regs *regs)
214{
215#if defined(CONFIG_440SP) || defined(CONFIG_440SPE)
216 printk("PLB0: BEAR=0x%08x%08x ACR= 0x%08x BESR= 0x%08x%08x\n",
217 mfdcr(DCRN_PLB0_BEARH), mfdcr(DCRN_PLB0_BEARL),
218 mfdcr(DCRN_PLB0_ACR), mfdcr(DCRN_PLB0_BESRH),
219 mfdcr(DCRN_PLB0_BESRL));
220 printk("PLB1: BEAR=0x%08x%08x ACR= 0x%08x BESR= 0x%08x%08x\n",
221 mfdcr(DCRN_PLB1_BEARH), mfdcr(DCRN_PLB1_BEARL),
222 mfdcr(DCRN_PLB1_ACR), mfdcr(DCRN_PLB1_BESRH),
223 mfdcr(DCRN_PLB1_BESRL));
224#else
225 printk("PLB0: BEAR=0x%08x%08x ACR= 0x%08x BESR= 0x%08x\n",
226 mfdcr(DCRN_PLB0_BEARH), mfdcr(DCRN_PLB0_BEARL),
227 mfdcr(DCRN_PLB0_ACR), mfdcr(DCRN_PLB0_BESR));
228#endif
229 printk("POB0: BEAR=0x%08x%08x BESR0=0x%08x BESR1=0x%08x\n",
230 mfdcr(DCRN_POB0_BEARH), mfdcr(DCRN_POB0_BEARL),
231 mfdcr(DCRN_POB0_BESR0), mfdcr(DCRN_POB0_BESR1));
232 printk("OPB0: BEAR=0x%08x%08x BSTAT=0x%08x\n",
233 mfdcr(DCRN_OPB0_BEARH), mfdcr(DCRN_OPB0_BEARL),
234 mfdcr(DCRN_OPB0_BSTAT));
235}
diff --git a/arch/ppc/syslib/ibm44x_common.h b/arch/ppc/syslib/ibm44x_common.h
deleted file mode 100644
index f179db8634e0..000000000000
--- a/arch/ppc/syslib/ibm44x_common.h
+++ /dev/null
@@ -1,45 +0,0 @@
1/*
2 * PPC44x system library
3 *
4 * Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net>
5 * Copyright (c) 2003, 2004 Zultys Technologies
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 *
12 */
13#ifdef __KERNEL__
14#ifndef __PPC_SYSLIB_IBM44x_COMMON_H
15#define __PPC_SYSLIB_IBM44x_COMMON_H
16
17#ifndef __ASSEMBLY__
18
19/*
20 * All clocks are in Hz
21 */
22struct ibm44x_clocks {
23 unsigned int vco; /* VCO, 0 if system PLL is bypassed */
24 unsigned int cpu; /* CPUCoreClk */
25 unsigned int plb; /* PLBClk */
26 unsigned int opb; /* OPBClk */
27 unsigned int ebc; /* PerClk */
28 unsigned int uart0;
29 unsigned int uart1;
30#ifdef CONFIG_440EP
31 unsigned int uart2;
32 unsigned int uart3;
33#endif
34};
35
36/* common 44x platform init */
37void ibm44x_platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
38 unsigned long r6, unsigned long r7) __init;
39
40/* initialize decrementer and tick-related variables */
41void ibm44x_calibrate_decr(unsigned int freq) __init;
42
43#endif /* __ASSEMBLY__ */
44#endif /* __PPC_SYSLIB_IBM44x_COMMON_H */
45#endif /* __KERNEL__ */
diff --git a/arch/ppc/syslib/ibm_ocp.c b/arch/ppc/syslib/ibm_ocp.c
deleted file mode 100644
index 2ee176610e7c..000000000000
--- a/arch/ppc/syslib/ibm_ocp.c
+++ /dev/null
@@ -1,10 +0,0 @@
1#include <linux/module.h>
2#include <asm/ibm4xx.h>
3#include <asm/ocp.h>
4
5struct ocp_sys_info_data ocp_sys_info = {
6 .opb_bus_freq = 50000000, /* OPB Bus Frequency (Hz) */
7 .ebc_bus_freq = 33333333, /* EBC Bus Frequency (Hz) */
8};
9
10EXPORT_SYMBOL(ocp_sys_info);
diff --git a/arch/ppc/syslib/indirect_pci.c b/arch/ppc/syslib/indirect_pci.c
deleted file mode 100644
index 83b323a7d029..000000000000
--- a/arch/ppc/syslib/indirect_pci.c
+++ /dev/null
@@ -1,134 +0,0 @@
1/*
2 * Support for indirect PCI bridges.
3 *
4 * Copyright (C) 1998 Gabriel Paubert.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 */
11
12#include <linux/kernel.h>
13#include <linux/pci.h>
14#include <linux/delay.h>
15#include <linux/string.h>
16#include <linux/init.h>
17
18#include <asm/io.h>
19#include <asm/prom.h>
20#include <asm/pci-bridge.h>
21#include <asm/machdep.h>
22
23#ifdef CONFIG_PPC_INDIRECT_PCI_BE
24#define PCI_CFG_OUT out_be32
25#else
26#define PCI_CFG_OUT out_le32
27#endif
28
29static int
30indirect_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
31 int len, u32 *val)
32{
33 struct pci_controller *hose = bus->sysdata;
34 volatile void __iomem *cfg_data;
35 u8 cfg_type = 0;
36
37 if (ppc_md.pci_exclude_device)
38 if (ppc_md.pci_exclude_device(bus->number, devfn))
39 return PCIBIOS_DEVICE_NOT_FOUND;
40
41 if (hose->set_cfg_type)
42 if (bus->number != hose->first_busno)
43 cfg_type = 1;
44
45 PCI_CFG_OUT(hose->cfg_addr,
46 (0x80000000 | ((bus->number - hose->bus_offset) << 16)
47 | (devfn << 8) | ((offset & 0xfc) | cfg_type)));
48
49 /*
50 * Note: the caller has already checked that offset is
51 * suitably aligned and that len is 1, 2 or 4.
52 */
53 cfg_data = hose->cfg_data + (offset & 3);
54 switch (len) {
55 case 1:
56 *val = in_8(cfg_data);
57 break;
58 case 2:
59 *val = in_le16(cfg_data);
60 break;
61 default:
62 *val = in_le32(cfg_data);
63 break;
64 }
65 return PCIBIOS_SUCCESSFUL;
66}
67
68static int
69indirect_write_config(struct pci_bus *bus, unsigned int devfn, int offset,
70 int len, u32 val)
71{
72 struct pci_controller *hose = bus->sysdata;
73 volatile void __iomem *cfg_data;
74 u8 cfg_type = 0;
75
76 if (ppc_md.pci_exclude_device)
77 if (ppc_md.pci_exclude_device(bus->number, devfn))
78 return PCIBIOS_DEVICE_NOT_FOUND;
79
80 if (hose->set_cfg_type)
81 if (bus->number != hose->first_busno)
82 cfg_type = 1;
83
84 PCI_CFG_OUT(hose->cfg_addr,
85 (0x80000000 | ((bus->number - hose->bus_offset) << 16)
86 | (devfn << 8) | ((offset & 0xfc) | cfg_type)));
87
88 /*
89 * Note: the caller has already checked that offset is
90 * suitably aligned and that len is 1, 2 or 4.
91 */
92 cfg_data = hose->cfg_data + (offset & 3);
93 switch (len) {
94 case 1:
95 out_8(cfg_data, val);
96 break;
97 case 2:
98 out_le16(cfg_data, val);
99 break;
100 default:
101 out_le32(cfg_data, val);
102 break;
103 }
104 return PCIBIOS_SUCCESSFUL;
105}
106
107static struct pci_ops indirect_pci_ops =
108{
109 indirect_read_config,
110 indirect_write_config
111};
112
113void __init
114setup_indirect_pci_nomap(struct pci_controller* hose, void __iomem * cfg_addr,
115 void __iomem * cfg_data)
116{
117 hose->cfg_addr = cfg_addr;
118 hose->cfg_data = cfg_data;
119 hose->ops = &indirect_pci_ops;
120}
121
122void __init
123setup_indirect_pci(struct pci_controller* hose, u32 cfg_addr, u32 cfg_data)
124{
125 unsigned long base = cfg_addr & PAGE_MASK;
126 void __iomem *mbase, *addr, *data;
127
128 mbase = ioremap(base, PAGE_SIZE);
129 addr = mbase + (cfg_addr & ~PAGE_MASK);
130 if ((cfg_data & PAGE_MASK) != base)
131 mbase = ioremap(cfg_data & PAGE_MASK, PAGE_SIZE);
132 data = mbase + (cfg_data & ~PAGE_MASK);
133 setup_indirect_pci_nomap(hose, addr, data);
134}
diff --git a/arch/ppc/syslib/m8260_pci_erratum9.c b/arch/ppc/syslib/m8260_pci_erratum9.c
deleted file mode 100644
index ebb8c8f8f30c..000000000000
--- a/arch/ppc/syslib/m8260_pci_erratum9.c
+++ /dev/null
@@ -1,455 +0,0 @@
1/*
2 * Workaround for device erratum PCI 9.
3 * See Motorola's "XPC826xA Family Device Errata Reference."
4 * The erratum applies to all 8260 family Hip4 processors. It is scheduled
5 * to be fixed in HiP4 Rev C. Erratum PCI 9 states that a simultaneous PCI
6 * inbound write transaction and PCI outbound read transaction can result in a
7 * bus deadlock. The suggested workaround is to use the IDMA controller to
8 * perform all reads from PCI configuration, memory, and I/O space.
9 *
10 * Author: andy_lowe@mvista.com
11 *
12 * 2003 (c) MontaVista Software, Inc. This file is licensed under
13 * the terms of the GNU General Public License version 2. This program
14 * is licensed "as is" without any warranty of any kind, whether express
15 * or implied.
16 */
17#include <linux/kernel.h>
18#include <linux/module.h>
19#include <linux/pci.h>
20#include <linux/types.h>
21#include <linux/string.h>
22
23#include <asm/io.h>
24#include <asm/pci-bridge.h>
25#include <asm/machdep.h>
26#include <asm/byteorder.h>
27#include <asm/mpc8260.h>
28#include <asm/immap_cpm2.h>
29#include <asm/cpm2.h>
30
31#include "m82xx_pci.h"
32
33#ifdef CONFIG_8260_PCI9
34/*#include <asm/mpc8260_pci9.h>*/ /* included in asm/io.h */
35
36#define IDMA_XFER_BUF_SIZE 64 /* size of the IDMA transfer buffer */
37
38/* define a structure for the IDMA dpram usage */
39typedef struct idma_dpram_s {
40 idma_t pram; /* IDMA parameter RAM */
41 u_char xfer_buf[IDMA_XFER_BUF_SIZE]; /* IDMA transfer buffer */
42 idma_bd_t bd; /* buffer descriptor */
43} idma_dpram_t;
44
45/* define offsets relative to start of IDMA dpram */
46#define IDMA_XFER_BUF_OFFSET (sizeof(idma_t))
47#define IDMA_BD_OFFSET (sizeof(idma_t) + IDMA_XFER_BUF_SIZE)
48
49/* define globals */
50static volatile idma_dpram_t *idma_dpram;
51
52/* Exactly one of CONFIG_8260_PCI9_IDMAn must be defined,
53 * where n is 1, 2, 3, or 4. This selects the IDMA channel used for
54 * the PCI9 workaround.
55 */
56#ifdef CONFIG_8260_PCI9_IDMA1
57#define IDMA_CHAN 0
58#define PROFF_IDMA PROFF_IDMA1_BASE
59#define IDMA_PAGE CPM_CR_IDMA1_PAGE
60#define IDMA_SBLOCK CPM_CR_IDMA1_SBLOCK
61#endif
62#ifdef CONFIG_8260_PCI9_IDMA2
63#define IDMA_CHAN 1
64#define PROFF_IDMA PROFF_IDMA2_BASE
65#define IDMA_PAGE CPM_CR_IDMA2_PAGE
66#define IDMA_SBLOCK CPM_CR_IDMA2_SBLOCK
67#endif
68#ifdef CONFIG_8260_PCI9_IDMA3
69#define IDMA_CHAN 2
70#define PROFF_IDMA PROFF_IDMA3_BASE
71#define IDMA_PAGE CPM_CR_IDMA3_PAGE
72#define IDMA_SBLOCK CPM_CR_IDMA3_SBLOCK
73#endif
74#ifdef CONFIG_8260_PCI9_IDMA4
75#define IDMA_CHAN 3
76#define PROFF_IDMA PROFF_IDMA4_BASE
77#define IDMA_PAGE CPM_CR_IDMA4_PAGE
78#define IDMA_SBLOCK CPM_CR_IDMA4_SBLOCK
79#endif
80
81void idma_pci9_init(void)
82{
83 uint dpram_offset;
84 volatile idma_t *pram;
85 volatile im_idma_t *idma_reg;
86 volatile cpm2_map_t *immap = cpm2_immr;
87
88 /* allocate IDMA dpram */
89 dpram_offset = cpm_dpalloc(sizeof(idma_dpram_t), 64);
90 idma_dpram = cpm_dpram_addr(dpram_offset);
91
92 /* initialize the IDMA parameter RAM */
93 memset((void *)idma_dpram, 0, sizeof(idma_dpram_t));
94 pram = &idma_dpram->pram;
95 pram->ibase = dpram_offset + IDMA_BD_OFFSET;
96 pram->dpr_buf = dpram_offset + IDMA_XFER_BUF_OFFSET;
97 pram->ss_max = 32;
98 pram->dts = 32;
99
100 /* initialize the IDMA_BASE pointer to the IDMA parameter RAM */
101 *((ushort *) &immap->im_dprambase[PROFF_IDMA]) = dpram_offset;
102
103 /* initialize the IDMA registers */
104 idma_reg = (volatile im_idma_t *) &immap->im_sdma.sdma_idsr1;
105 idma_reg[IDMA_CHAN].idmr = 0; /* mask all IDMA interrupts */
106 idma_reg[IDMA_CHAN].idsr = 0xff; /* clear all event flags */
107
108 printk(KERN_WARNING
109 "Using IDMA%d for MPC8260 device erratum PCI 9 workaround\n",
110 IDMA_CHAN + 1);
111
112 return;
113}
114
115/* Use the IDMA controller to transfer data from I/O memory to local RAM.
116 * The src address must be a physical address suitable for use by the DMA
117 * controller with no translation. The dst address must be a kernel virtual
118 * address. The dst address is translated to a physical address via
119 * virt_to_phys().
120 * The sinc argument specifies whether or not the source address is incremented
121 * by the DMA controller. The source address is incremented if and only if sinc
122 * is non-zero. The destination address is always incremented since the
123 * destination is always host RAM.
124 */
125static void
126idma_pci9_read(u8 *dst, u8 *src, int bytes, int unit_size, int sinc)
127{
128 unsigned long flags;
129 volatile idma_t *pram = &idma_dpram->pram;
130 volatile idma_bd_t *bd = &idma_dpram->bd;
131 volatile cpm2_map_t *immap = cpm2_immr;
132
133 local_irq_save(flags);
134
135 /* initialize IDMA parameter RAM for this transfer */
136 if (sinc)
137 pram->dcm = IDMA_DCM_DMA_WRAP_64 | IDMA_DCM_SINC
138 | IDMA_DCM_DINC | IDMA_DCM_SD_MEM2MEM;
139 else
140 pram->dcm = IDMA_DCM_DMA_WRAP_64 | IDMA_DCM_DINC
141 | IDMA_DCM_SD_MEM2MEM;
142 pram->ibdptr = pram->ibase;
143 pram->sts = unit_size;
144 pram->istate = 0;
145
146 /* initialize the buffer descriptor */
147 bd->dst = virt_to_phys(dst);
148 bd->src = (uint) src;
149 bd->len = bytes;
150 bd->flags = IDMA_BD_V | IDMA_BD_W | IDMA_BD_I | IDMA_BD_L | IDMA_BD_DGBL
151 | IDMA_BD_DBO_BE | IDMA_BD_SBO_BE | IDMA_BD_SDTB;
152
153 /* issue the START_IDMA command to the CP */
154 while (immap->im_cpm.cp_cpcr & CPM_CR_FLG);
155 immap->im_cpm.cp_cpcr = mk_cr_cmd(IDMA_PAGE, IDMA_SBLOCK, 0,
156 CPM_CR_START_IDMA) | CPM_CR_FLG;
157 while (immap->im_cpm.cp_cpcr & CPM_CR_FLG);
158
159 /* wait for transfer to complete */
160 while(bd->flags & IDMA_BD_V);
161
162 local_irq_restore(flags);
163
164 return;
165}
166
167/* Use the IDMA controller to transfer data from I/O memory to local RAM.
168 * The dst address must be a physical address suitable for use by the DMA
169 * controller with no translation. The src address must be a kernel virtual
170 * address. The src address is translated to a physical address via
171 * virt_to_phys().
172 * The dinc argument specifies whether or not the dest address is incremented
173 * by the DMA controller. The source address is incremented if and only if sinc
174 * is non-zero. The source address is always incremented since the
175 * source is always host RAM.
176 */
177static void
178idma_pci9_write(u8 *dst, u8 *src, int bytes, int unit_size, int dinc)
179{
180 unsigned long flags;
181 volatile idma_t *pram = &idma_dpram->pram;
182 volatile idma_bd_t *bd = &idma_dpram->bd;
183 volatile cpm2_map_t *immap = cpm2_immr;
184
185 local_irq_save(flags);
186
187 /* initialize IDMA parameter RAM for this transfer */
188 if (dinc)
189 pram->dcm = IDMA_DCM_DMA_WRAP_64 | IDMA_DCM_SINC
190 | IDMA_DCM_DINC | IDMA_DCM_SD_MEM2MEM;
191 else
192 pram->dcm = IDMA_DCM_DMA_WRAP_64 | IDMA_DCM_SINC
193 | IDMA_DCM_SD_MEM2MEM;
194 pram->ibdptr = pram->ibase;
195 pram->sts = unit_size;
196 pram->istate = 0;
197
198 /* initialize the buffer descriptor */
199 bd->dst = (uint) dst;
200 bd->src = virt_to_phys(src);
201 bd->len = bytes;
202 bd->flags = IDMA_BD_V | IDMA_BD_W | IDMA_BD_I | IDMA_BD_L | IDMA_BD_DGBL
203 | IDMA_BD_DBO_BE | IDMA_BD_SBO_BE | IDMA_BD_SDTB;
204
205 /* issue the START_IDMA command to the CP */
206 while (immap->im_cpm.cp_cpcr & CPM_CR_FLG);
207 immap->im_cpm.cp_cpcr = mk_cr_cmd(IDMA_PAGE, IDMA_SBLOCK, 0,
208 CPM_CR_START_IDMA) | CPM_CR_FLG;
209 while (immap->im_cpm.cp_cpcr & CPM_CR_FLG);
210
211 /* wait for transfer to complete */
212 while(bd->flags & IDMA_BD_V);
213
214 local_irq_restore(flags);
215
216 return;
217}
218
219/* Same as idma_pci9_read, but 16-bit little-endian byte swapping is performed
220 * if the unit_size is 2, and 32-bit little-endian byte swapping is performed if
221 * the unit_size is 4.
222 */
223static void
224idma_pci9_read_le(u8 *dst, u8 *src, int bytes, int unit_size, int sinc)
225{
226 int i;
227 u8 *p;
228
229 idma_pci9_read(dst, src, bytes, unit_size, sinc);
230 switch(unit_size) {
231 case 2:
232 for (i = 0, p = dst; i < bytes; i += 2, p += 2)
233 swab16s((u16 *) p);
234 break;
235 case 4:
236 for (i = 0, p = dst; i < bytes; i += 4, p += 4)
237 swab32s((u32 *) p);
238 break;
239 default:
240 break;
241 }
242}
243EXPORT_SYMBOL(idma_pci9_init);
244EXPORT_SYMBOL(idma_pci9_read);
245EXPORT_SYMBOL(idma_pci9_read_le);
246
247static inline int is_pci_mem(unsigned long addr)
248{
249 if (addr >= M82xx_PCI_LOWER_MMIO &&
250 addr <= M82xx_PCI_UPPER_MMIO)
251 return 1;
252 if (addr >= M82xx_PCI_LOWER_MEM &&
253 addr <= M82xx_PCI_UPPER_MEM)
254 return 1;
255 return 0;
256}
257
258#define is_pci_mem(pa) ( (pa > 0x80000000) && (pa < 0xc0000000))
259int readb(volatile unsigned char *addr)
260{
261 u8 val;
262 unsigned long pa = iopa((unsigned long) addr);
263
264 if (!is_pci_mem(pa))
265 return in_8(addr);
266
267 idma_pci9_read((u8 *)&val, (u8 *)pa, sizeof(val), sizeof(val), 0);
268 return val;
269}
270
271int readw(volatile unsigned short *addr)
272{
273 u16 val;
274 unsigned long pa = iopa((unsigned long) addr);
275
276 if (!is_pci_mem(pa))
277 return in_le16(addr);
278
279 idma_pci9_read((u8 *)&val, (u8 *)pa, sizeof(val), sizeof(val), 0);
280 return swab16(val);
281}
282
283unsigned readl(volatile unsigned *addr)
284{
285 u32 val;
286 unsigned long pa = iopa((unsigned long) addr);
287
288 if (!is_pci_mem(pa))
289 return in_le32(addr);
290
291 idma_pci9_read((u8 *)&val, (u8 *)pa, sizeof(val), sizeof(val), 0);
292 return swab32(val);
293}
294
295int inb(unsigned port)
296{
297 u8 val;
298 u8 *addr = (u8 *)(port + _IO_BASE);
299
300 idma_pci9_read((u8 *)&val, (u8 *)addr, sizeof(val), sizeof(val), 0);
301 return val;
302}
303
304int inw(unsigned port)
305{
306 u16 val;
307 u8 *addr = (u8 *)(port + _IO_BASE);
308
309 idma_pci9_read((u8 *)&val, (u8 *)addr, sizeof(val), sizeof(val), 0);
310 return swab16(val);
311}
312
313unsigned inl(unsigned port)
314{
315 u32 val;
316 u8 *addr = (u8 *)(port + _IO_BASE);
317
318 idma_pci9_read((u8 *)&val, (u8 *)addr, sizeof(val), sizeof(val), 0);
319 return swab32(val);
320}
321
322void insb(unsigned port, void *buf, int ns)
323{
324 u8 *addr = (u8 *)(port + _IO_BASE);
325
326 idma_pci9_read((u8 *)buf, (u8 *)addr, ns*sizeof(u8), sizeof(u8), 0);
327}
328
329void insw(unsigned port, void *buf, int ns)
330{
331 u8 *addr = (u8 *)(port + _IO_BASE);
332
333 idma_pci9_read((u8 *)buf, (u8 *)addr, ns*sizeof(u16), sizeof(u16), 0);
334}
335
336void insl(unsigned port, void *buf, int nl)
337{
338 u8 *addr = (u8 *)(port + _IO_BASE);
339
340 idma_pci9_read((u8 *)buf, (u8 *)addr, nl*sizeof(u32), sizeof(u32), 0);
341}
342
343void *memcpy_fromio(void *dest, unsigned long src, size_t count)
344{
345 unsigned long pa = iopa((unsigned long) src);
346
347 if (is_pci_mem(pa))
348 idma_pci9_read((u8 *)dest, (u8 *)pa, count, 32, 1);
349 else
350 memcpy(dest, (void *)src, count);
351 return dest;
352}
353
354EXPORT_SYMBOL(readb);
355EXPORT_SYMBOL(readw);
356EXPORT_SYMBOL(readl);
357EXPORT_SYMBOL(inb);
358EXPORT_SYMBOL(inw);
359EXPORT_SYMBOL(inl);
360EXPORT_SYMBOL(insb);
361EXPORT_SYMBOL(insw);
362EXPORT_SYMBOL(insl);
363EXPORT_SYMBOL(memcpy_fromio);
364
365#endif /* ifdef CONFIG_8260_PCI9 */
366
367/* Indirect PCI routines adapted from arch/ppc/kernel/indirect_pci.c.
368 * Copyright (C) 1998 Gabriel Paubert.
369 */
370#ifndef CONFIG_8260_PCI9
371#define cfg_read(val, addr, type, op) *val = op((type)(addr))
372#else
373#define cfg_read(val, addr, type, op) \
374 idma_pci9_read_le((u8*)(val),(u8*)(addr),sizeof(*(val)),sizeof(*(val)),0)
375#endif
376
377#define cfg_write(val, addr, type, op) op((type *)(addr), (val))
378
379static int indirect_write_config(struct pci_bus *pbus, unsigned int devfn, int where,
380 int size, u32 value)
381{
382 struct pci_controller *hose = pbus->sysdata;
383 u8 cfg_type = 0;
384 if (ppc_md.pci_exclude_device)
385 if (ppc_md.pci_exclude_device(pbus->number, devfn))
386 return PCIBIOS_DEVICE_NOT_FOUND;
387
388 if (hose->set_cfg_type)
389 if (pbus->number != hose->first_busno)
390 cfg_type = 1;
391
392 out_be32(hose->cfg_addr,
393 (((where & 0xfc) | cfg_type) << 24) | (devfn << 16)
394 | ((pbus->number - hose->bus_offset) << 8) | 0x80);
395
396 switch (size)
397 {
398 case 1:
399 cfg_write(value, hose->cfg_data + (where & 3), u8, out_8);
400 break;
401 case 2:
402 cfg_write(value, hose->cfg_data + (where & 2), u16, out_le16);
403 break;
404 case 4:
405 cfg_write(value, hose->cfg_data + (where & 0), u32, out_le32);
406 break;
407 }
408 return PCIBIOS_SUCCESSFUL;
409}
410
411static int indirect_read_config(struct pci_bus *pbus, unsigned int devfn, int where,
412 int size, u32 *value)
413{
414 struct pci_controller *hose = pbus->sysdata;
415 u8 cfg_type = 0;
416 if (ppc_md.pci_exclude_device)
417 if (ppc_md.pci_exclude_device(pbus->number, devfn))
418 return PCIBIOS_DEVICE_NOT_FOUND;
419
420 if (hose->set_cfg_type)
421 if (pbus->number != hose->first_busno)
422 cfg_type = 1;
423
424 out_be32(hose->cfg_addr,
425 (((where & 0xfc) | cfg_type) << 24) | (devfn << 16)
426 | ((pbus->number - hose->bus_offset) << 8) | 0x80);
427
428 switch (size)
429 {
430 case 1:
431 cfg_read(value, hose->cfg_data + (where & 3), u8 *, in_8);
432 break;
433 case 2:
434 cfg_read(value, hose->cfg_data + (where & 2), u16 *, in_le16);
435 break;
436 case 4:
437 cfg_read(value, hose->cfg_data + (where & 0), u32 *, in_le32);
438 break;
439 }
440 return PCIBIOS_SUCCESSFUL;
441}
442
443static struct pci_ops indirect_pci_ops =
444{
445 .read = indirect_read_config,
446 .write = indirect_write_config,
447};
448
449void
450setup_m8260_indirect_pci(struct pci_controller* hose, u32 cfg_addr, u32 cfg_data)
451{
452 hose->ops = &indirect_pci_ops;
453 hose->cfg_addr = (unsigned int *) ioremap(cfg_addr, 4);
454 hose->cfg_data = (unsigned char *) ioremap(cfg_data, 4);
455}
diff --git a/arch/ppc/syslib/m8260_setup.c b/arch/ppc/syslib/m8260_setup.c
deleted file mode 100644
index b40583724de3..000000000000
--- a/arch/ppc/syslib/m8260_setup.c
+++ /dev/null
@@ -1,266 +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 * Modified for MBX using prep/chrp/pmac functions by Dan (dmalek@jlc.net)
6 * Further modified for generic 8xx and 8260 by Dan.
7 */
8
9#include <linux/sched.h>
10#include <linux/kernel.h>
11#include <linux/mm.h>
12#include <linux/stddef.h>
13#include <linux/slab.h>
14#include <linux/init.h>
15#include <linux/initrd.h>
16#include <linux/root_dev.h>
17#include <linux/seq_file.h>
18#include <linux/irq.h>
19
20#include <asm/mmu.h>
21#include <asm/io.h>
22#include <asm/pgtable.h>
23#include <asm/mpc8260.h>
24#include <asm/cpm2.h>
25#include <asm/machdep.h>
26#include <asm/bootinfo.h>
27#include <asm/time.h>
28#include <asm/ppc_sys.h>
29
30#include "cpm2_pic.h"
31
32unsigned char __res[sizeof(bd_t)];
33
34extern void pq2_find_bridges(void);
35extern void pq2pci_init_irq(void);
36extern void idma_pci9_init(void);
37
38/* Place-holder for board-specific init */
39void __attribute__ ((weak)) __init
40m82xx_board_setup(void)
41{
42}
43
44static void __init
45m8260_setup_arch(void)
46{
47 /* Print out Vendor and Machine info. */
48 printk(KERN_INFO "%s %s port\n", CPUINFO_VENDOR, CPUINFO_MACHINE);
49
50 /* Reset the Communication Processor Module. */
51 cpm2_reset();
52#ifdef CONFIG_8260_PCI9
53 /* Initialise IDMA for PCI erratum workaround */
54 idma_pci9_init();
55#endif
56#ifdef CONFIG_PCI_8260
57 pq2_find_bridges();
58#endif
59#ifdef CONFIG_BLK_DEV_INITRD
60 if (initrd_start)
61 ROOT_DEV = Root_RAM0;
62#endif
63
64 identify_ppc_sys_by_name_and_id(BOARD_CHIP_NAME,
65 in_be32((void *)CPM_MAP_ADDR + CPM_IMMR_OFFSET));
66
67 m82xx_board_setup();
68}
69
70/* The decrementer counts at the system (internal) clock frequency
71 * divided by four.
72 */
73static void __init
74m8260_calibrate_decr(void)
75{
76 bd_t *binfo = (bd_t *)__res;
77 int freq, divisor;
78
79 freq = binfo->bi_busfreq;
80 divisor = 4;
81 tb_ticks_per_jiffy = freq / HZ / divisor;
82 tb_to_us = mulhwu_scale_factor(freq / divisor, 1000000);
83}
84
85/* The 8260 has an internal 1-second timer update register that
86 * we should use for this purpose.
87 */
88static uint rtc_time;
89
90static int
91m8260_set_rtc_time(unsigned long time)
92{
93 rtc_time = time;
94
95 return(0);
96}
97
98static unsigned long
99m8260_get_rtc_time(void)
100{
101 /* Get time from the RTC.
102 */
103 return((unsigned long)rtc_time);
104}
105
106#ifndef BOOTROM_RESTART_ADDR
107#warning "Using default BOOTROM_RESTART_ADDR!"
108#define BOOTROM_RESTART_ADDR 0xff000104
109#endif
110
111static void
112m8260_restart(char *cmd)
113{
114 extern void m8260_gorom(bd_t *bi, uint addr);
115 uint startaddr;
116
117 /* Most boot roms have a warmstart as the second instruction
118 * of the reset vector. If that doesn't work for you, change this
119 * or the reboot program to send a proper address.
120 */
121 startaddr = BOOTROM_RESTART_ADDR;
122 if (cmd != NULL) {
123 if (!strncmp(cmd, "startaddr=", 10))
124 startaddr = simple_strtoul(&cmd[10], NULL, 0);
125 }
126
127 m8260_gorom((void*)__pa(__res), startaddr);
128}
129
130static void
131m8260_halt(void)
132{
133 local_irq_disable();
134 while (1);
135}
136
137static void
138m8260_power_off(void)
139{
140 m8260_halt();
141}
142
143static int
144m8260_show_cpuinfo(struct seq_file *m)
145{
146 bd_t *bp = (bd_t *)__res;
147
148 seq_printf(m, "vendor\t\t: %s\n"
149 "machine\t\t: %s\n"
150 "\n"
151 "mem size\t\t: 0x%08lx\n"
152 "console baud\t\t: %ld\n"
153 "\n"
154 "core clock\t: %lu MHz\n"
155 "CPM clock\t: %lu MHz\n"
156 "bus clock\t: %lu MHz\n",
157 CPUINFO_VENDOR, CPUINFO_MACHINE, bp->bi_memsize,
158 bp->bi_baudrate, bp->bi_intfreq / 1000000,
159 bp->bi_cpmfreq / 1000000, bp->bi_busfreq / 1000000);
160 return 0;
161}
162
163/* Initialize the internal interrupt controller. The number of
164 * interrupts supported can vary with the processor type, and the
165 * 8260 family can have up to 64.
166 * External interrupts can be either edge or level triggered, and
167 * need to be initialized by the appropriate driver.
168 */
169static void __init
170m8260_init_IRQ(void)
171{
172 cpm2_init_IRQ();
173
174 /* Initialize the default interrupt mapping priorities,
175 * in case the boot rom changed something on us.
176 */
177 cpm2_immr->im_intctl.ic_siprr = 0x05309770;
178}
179
180/*
181 * Same hack as 8xx
182 */
183static unsigned long __init
184m8260_find_end_of_memory(void)
185{
186 bd_t *binfo = (bd_t *)__res;
187
188 return binfo->bi_memsize;
189}
190
191/* Map the IMMR, plus anything else we can cover
192 * in that upper space according to the memory controller
193 * chip select mapping. Grab another bunch of space
194 * below that for stuff we can't cover in the upper.
195 */
196static void __init
197m8260_map_io(void)
198{
199 uint addr;
200
201 /* Map IMMR region to a 256MB BAT */
202 addr = (cpm2_immr != NULL) ? (uint)cpm2_immr : CPM_MAP_ADDR;
203 io_block_mapping(addr, addr, 0x10000000, _PAGE_IO);
204
205 /* Map I/O region to a 256MB BAT */
206 io_block_mapping(IO_VIRT_ADDR, IO_PHYS_ADDR, 0x10000000, _PAGE_IO);
207}
208
209/* Place-holder for board-specific ppc_md hooking */
210void __attribute__ ((weak)) __init
211m82xx_board_init(void)
212{
213}
214
215/* Inputs:
216 * r3 - Optional pointer to a board information structure.
217 * r4 - Optional pointer to the physical starting address of the init RAM
218 * disk.
219 * r5 - Optional pointer to the physical ending address of the init RAM
220 * disk.
221 * r6 - Optional pointer to the physical starting address of any kernel
222 * command-line parameters.
223 * r7 - Optional pointer to the physical ending address of any kernel
224 * command-line parameters.
225 */
226void __init
227platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
228 unsigned long r6, unsigned long r7)
229{
230 parse_bootinfo(find_bootinfo());
231
232 if ( r3 )
233 memcpy( (void *)__res,(void *)(r3+KERNELBASE), sizeof(bd_t) );
234
235#ifdef CONFIG_BLK_DEV_INITRD
236 /* take care of initrd if we have one */
237 if ( r4 ) {
238 initrd_start = r4 + KERNELBASE;
239 initrd_end = r5 + KERNELBASE;
240 }
241#endif /* CONFIG_BLK_DEV_INITRD */
242 /* take care of cmd line */
243 if ( r6 ) {
244 *(char *)(r7+KERNELBASE) = 0;
245 strcpy(cmd_line, (char *)(r6+KERNELBASE));
246 }
247
248 ppc_md.setup_arch = m8260_setup_arch;
249 ppc_md.show_cpuinfo = m8260_show_cpuinfo;
250 ppc_md.init_IRQ = m8260_init_IRQ;
251 ppc_md.get_irq = cpm2_get_irq;
252
253 ppc_md.restart = m8260_restart;
254 ppc_md.power_off = m8260_power_off;
255 ppc_md.halt = m8260_halt;
256
257 ppc_md.set_rtc_time = m8260_set_rtc_time;
258 ppc_md.get_rtc_time = m8260_get_rtc_time;
259 ppc_md.calibrate_decr = m8260_calibrate_decr;
260
261 ppc_md.find_end_of_memory = m8260_find_end_of_memory;
262 ppc_md.setup_io_mappings = m8260_map_io;
263
264 /* Call back for board-specific settings and overrides. */
265 m82xx_board_init();
266}
diff --git a/arch/ppc/syslib/m82xx_pci.c b/arch/ppc/syslib/m82xx_pci.c
deleted file mode 100644
index 657a1c25a2ab..000000000000
--- a/arch/ppc/syslib/m82xx_pci.c
+++ /dev/null
@@ -1,346 +0,0 @@
1/*
2 *
3 * (C) Copyright 2003
4 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
5 *
6 * (C) Copyright 2004 Red Hat, Inc.
7 *
8 * 2005 (c) MontaVista Software, Inc.
9 * Vitaly Bordug <vbordug@ru.mvista.com>
10 *
11 * See file CREDITS for list of people who contributed to this
12 * project.
13 *
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License as
16 * published by the Free Software Foundation; either version 2 of
17 * the License, or (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
27 * MA 02111-1307 USA
28 */
29
30#include <linux/kernel.h>
31#include <linux/init.h>
32#include <linux/pci.h>
33#include <linux/slab.h>
34#include <linux/delay.h>
35#include <linux/irq.h>
36#include <linux/interrupt.h>
37
38#include <asm/byteorder.h>
39#include <asm/io.h>
40#include <asm/irq.h>
41#include <asm/uaccess.h>
42#include <asm/machdep.h>
43#include <asm/pci-bridge.h>
44#include <asm/immap_cpm2.h>
45#include <asm/mpc8260.h>
46#include <asm/cpm2.h>
47
48#include "m82xx_pci.h"
49
50/*
51 * Interrupt routing
52 */
53
54static inline int
55pq2pci_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
56{
57 static char pci_irq_table[][4] =
58 /*
59 * PCI IDSEL/INTPIN->INTLINE
60 * A B C D
61 */
62 {
63 { PIRQA, PIRQB, PIRQC, PIRQD }, /* IDSEL 22 - PCI slot 0 */
64 { PIRQD, PIRQA, PIRQB, PIRQC }, /* IDSEL 23 - PCI slot 1 */
65 { PIRQC, PIRQD, PIRQA, PIRQB }, /* IDSEL 24 - PCI slot 2 */
66 };
67
68 const long min_idsel = 22, max_idsel = 24, irqs_per_slot = 4;
69 return PCI_IRQ_TABLE_LOOKUP;
70}
71
72static void
73pq2pci_mask_irq(unsigned int irq)
74{
75 int bit = irq - NR_CPM_INTS;
76
77 *(volatile unsigned long *) PCI_INT_MASK_REG |= (1 << (31 - bit));
78 return;
79}
80
81static void
82pq2pci_unmask_irq(unsigned int irq)
83{
84 int bit = irq - NR_CPM_INTS;
85
86 *(volatile unsigned long *) PCI_INT_MASK_REG &= ~(1 << (31 - bit));
87 return;
88}
89
90static void
91pq2pci_mask_and_ack(unsigned int irq)
92{
93 int bit = irq - NR_CPM_INTS;
94
95 *(volatile unsigned long *) PCI_INT_MASK_REG |= (1 << (31 - bit));
96 return;
97}
98
99static void
100pq2pci_end_irq(unsigned int irq)
101{
102 int bit = irq - NR_CPM_INTS;
103
104 *(volatile unsigned long *) PCI_INT_MASK_REG &= ~(1 << (31 - bit));
105 return;
106}
107
108struct hw_interrupt_type pq2pci_ic = {
109 "PQ2 PCI",
110 NULL,
111 NULL,
112 pq2pci_unmask_irq,
113 pq2pci_mask_irq,
114 pq2pci_mask_and_ack,
115 pq2pci_end_irq,
116 0
117};
118
119static irqreturn_t
120pq2pci_irq_demux(int irq, void *dev_id)
121{
122 unsigned long stat, mask, pend;
123 int bit;
124
125 for(;;) {
126 stat = *(volatile unsigned long *) PCI_INT_STAT_REG;
127 mask = *(volatile unsigned long *) PCI_INT_MASK_REG;
128 pend = stat & ~mask & 0xf0000000;
129 if (!pend)
130 break;
131 for (bit = 0; pend != 0; ++bit, pend <<= 1) {
132 if (pend & 0x80000000)
133 __do_IRQ(NR_CPM_INTS + bit);
134 }
135 }
136
137 return IRQ_HANDLED;
138}
139
140static struct irqaction pq2pci_irqaction = {
141 .handler = pq2pci_irq_demux,
142 .flags = IRQF_DISABLED,
143 .mask = CPU_MASK_NONE,
144 .name = "PQ2 PCI cascade",
145};
146
147
148void
149pq2pci_init_irq(void)
150{
151 int irq;
152 volatile cpm2_map_t *immap = cpm2_immr;
153 for (irq = NR_CPM_INTS; irq < NR_CPM_INTS + 4; irq++)
154 irq_desc[irq].chip = &pq2pci_ic;
155
156 /* make PCI IRQ level sensitive */
157 immap->im_intctl.ic_siexr &=
158 ~(1 << (14 - (PCI_INT_TO_SIU - SIU_INT_IRQ1)));
159
160 /* mask all PCI interrupts */
161 *(volatile unsigned long *) PCI_INT_MASK_REG |= 0xfff00000;
162
163 /* install the demultiplexer for the PCI cascade interrupt */
164 setup_irq(PCI_INT_TO_SIU, &pq2pci_irqaction);
165 return;
166}
167
168static int
169pq2pci_exclude_device(u_char bus, u_char devfn)
170{
171 return PCIBIOS_SUCCESSFUL;
172}
173
174/* PCI bus configuration registers.
175 */
176static void
177pq2ads_setup_pci(struct pci_controller *hose)
178{
179 __u32 val;
180 volatile cpm2_map_t *immap = cpm2_immr;
181 bd_t* binfo = (bd_t*) __res;
182 u32 sccr = immap->im_clkrst.car_sccr;
183 uint pci_div,freq,time;
184 /* PCI int lowest prio */
185 /* Each 4 bits is a device bus request and the MS 4bits
186 is highest priority */
187 /* Bus 4bit value
188 --- ----------
189 CPM high 0b0000
190 CPM middle 0b0001
191 CPM low 0b0010
192 PCI request 0b0011
193 Reserved 0b0100
194 Reserved 0b0101
195 Internal Core 0b0110
196 External Master 1 0b0111
197 External Master 2 0b1000
198 External Master 3 0b1001
199 The rest are reserved
200 */
201 immap->im_siu_conf.siu_82xx.sc_ppc_alrh = 0x61207893;
202 /* park bus on core */
203 immap->im_siu_conf.siu_82xx.sc_ppc_acr = PPC_ACR_BUS_PARK_CORE;
204 /*
205 * Set up master windows that allow the CPU to access PCI space. These
206 * windows are set up using the two SIU PCIBR registers.
207 */
208
209 immap->im_memctl.memc_pcimsk0 = M82xx_PCI_PRIM_WND_SIZE;
210 immap->im_memctl.memc_pcibr0 = M82xx_PCI_PRIM_WND_BASE | PCIBR_ENABLE;
211
212#ifdef M82xx_PCI_SEC_WND_SIZE
213 immap->im_memctl.memc_pcimsk1 = M82xx_PCI_SEC_WND_SIZE;
214 immap->im_memctl.memc_pcibr1 = M82xx_PCI_SEC_WND_BASE | PCIBR_ENABLE;
215#endif
216
217 /* Enable PCI */
218 immap->im_pci.pci_gcr = cpu_to_le32(PCIGCR_PCI_BUS_EN);
219
220 pci_div = ( (sccr & SCCR_PCI_MODCK) ? 2 : 1) *
221 ( ( (sccr & SCCR_PCIDF_MSK) >> SCCR_PCIDF_SHIFT) + 1);
222 freq = (uint)((2*binfo->bi_cpmfreq)/(pci_div));
223 time = (int)66666666/freq;
224
225 /* due to PCI Local Bus spec, some devices needs to wait such a long
226 time after RST deassertion. More specifically, 0.508s for 66MHz & twice more for 33 */
227 printk("%s: The PCI bus is %d Mhz.\nWaiting %s after deasserting RST...\n",__FILE__,freq,
228 (time==1) ? "0.5 seconds":"1 second" );
229
230 {
231 int i;
232 for(i=0;i<(500*time);i++)
233 udelay(1000);
234 }
235
236 /* setup ATU registers */
237 immap->im_pci.pci_pocmr0 = cpu_to_le32(POCMR_ENABLE | POCMR_PCI_IO |
238 ((~(M82xx_PCI_IO_SIZE - 1U)) >> POTA_ADDR_SHIFT));
239 immap->im_pci.pci_potar0 = cpu_to_le32(M82xx_PCI_LOWER_IO >> POTA_ADDR_SHIFT);
240 immap->im_pci.pci_pobar0 = cpu_to_le32(M82xx_PCI_IO_BASE >> POTA_ADDR_SHIFT);
241
242 /* Set-up non-prefetchable window */
243 immap->im_pci.pci_pocmr1 = cpu_to_le32(POCMR_ENABLE | ((~(M82xx_PCI_MMIO_SIZE-1U)) >> POTA_ADDR_SHIFT));
244 immap->im_pci.pci_potar1 = cpu_to_le32(M82xx_PCI_LOWER_MMIO >> POTA_ADDR_SHIFT);
245 immap->im_pci.pci_pobar1 = cpu_to_le32((M82xx_PCI_LOWER_MMIO - M82xx_PCI_MMIO_OFFSET) >> POTA_ADDR_SHIFT);
246
247 /* Set-up prefetchable window */
248 immap->im_pci.pci_pocmr2 = cpu_to_le32(POCMR_ENABLE |POCMR_PREFETCH_EN |
249 (~(M82xx_PCI_MEM_SIZE-1U) >> POTA_ADDR_SHIFT));
250 immap->im_pci.pci_potar2 = cpu_to_le32(M82xx_PCI_LOWER_MEM >> POTA_ADDR_SHIFT);
251 immap->im_pci.pci_pobar2 = cpu_to_le32((M82xx_PCI_LOWER_MEM - M82xx_PCI_MEM_OFFSET) >> POTA_ADDR_SHIFT);
252
253 /* Inbound transactions from PCI memory space */
254 immap->im_pci.pci_picmr0 = cpu_to_le32(PICMR_ENABLE | PICMR_PREFETCH_EN |
255 ((~(M82xx_PCI_SLAVE_MEM_SIZE-1U)) >> PITA_ADDR_SHIFT));
256 immap->im_pci.pci_pibar0 = cpu_to_le32(M82xx_PCI_SLAVE_MEM_BUS >> PITA_ADDR_SHIFT);
257 immap->im_pci.pci_pitar0 = cpu_to_le32(M82xx_PCI_SLAVE_MEM_LOCAL>> PITA_ADDR_SHIFT);
258
259 /* park bus on PCI */
260 immap->im_siu_conf.siu_82xx.sc_ppc_acr = PPC_ACR_BUS_PARK_PCI;
261
262 /* Enable bus mastering and inbound memory transactions */
263 early_read_config_dword(hose, hose->first_busno, 0, PCI_COMMAND, &val);
264 val &= 0xffff0000;
265 val |= PCI_COMMAND_MEMORY|PCI_COMMAND_MASTER;
266 early_write_config_dword(hose, hose->first_busno, 0, PCI_COMMAND, val);
267
268}
269
270void __init pq2_find_bridges(void)
271{
272 extern int pci_assign_all_buses;
273 struct pci_controller * hose;
274 int host_bridge;
275
276 pci_assign_all_buses = 1;
277
278 hose = pcibios_alloc_controller();
279
280 if (!hose)
281 return;
282
283 ppc_md.pci_swizzle = common_swizzle;
284
285 hose->first_busno = 0;
286 hose->bus_offset = 0;
287 hose->last_busno = 0xff;
288
289 setup_m8260_indirect_pci(hose,
290 (unsigned long)&cpm2_immr->im_pci.pci_cfg_addr,
291 (unsigned long)&cpm2_immr->im_pci.pci_cfg_data);
292
293 /* Make sure it is a supported bridge */
294 early_read_config_dword(hose,
295 0,
296 PCI_DEVFN(0,0),
297 PCI_VENDOR_ID,
298 &host_bridge);
299 switch (host_bridge) {
300 case PCI_DEVICE_ID_MPC8265:
301 break;
302 case PCI_DEVICE_ID_MPC8272:
303 break;
304 default:
305 printk("Attempting to use unrecognized host bridge ID"
306 " 0x%08x.\n", host_bridge);
307 break;
308 }
309
310 pq2ads_setup_pci(hose);
311
312 hose->io_space.start = M82xx_PCI_LOWER_IO;
313 hose->io_space.end = M82xx_PCI_UPPER_IO;
314 hose->mem_space.start = M82xx_PCI_LOWER_MEM;
315 hose->mem_space.end = M82xx_PCI_UPPER_MMIO;
316 hose->pci_mem_offset = M82xx_PCI_MEM_OFFSET;
317
318 isa_io_base =
319 (unsigned long) ioremap(M82xx_PCI_IO_BASE,
320 M82xx_PCI_IO_SIZE);
321 hose->io_base_virt = (void *) isa_io_base;
322
323 /* setup resources */
324 pci_init_resource(&hose->mem_resources[0],
325 M82xx_PCI_LOWER_MEM,
326 M82xx_PCI_UPPER_MEM,
327 IORESOURCE_MEM|IORESOURCE_PREFETCH, "PCI prefetchable memory");
328
329 pci_init_resource(&hose->mem_resources[1],
330 M82xx_PCI_LOWER_MMIO,
331 M82xx_PCI_UPPER_MMIO,
332 IORESOURCE_MEM, "PCI memory");
333
334 pci_init_resource(&hose->io_resource,
335 M82xx_PCI_LOWER_IO,
336 M82xx_PCI_UPPER_IO,
337 IORESOURCE_IO | 1, "PCI I/O");
338
339 ppc_md.pci_exclude_device = pq2pci_exclude_device;
340 hose->last_busno = pciauto_bus_scan(hose, hose->first_busno);
341
342 ppc_md.pci_map_irq = pq2pci_map_irq;
343 ppc_md.pcibios_fixup = NULL;
344 ppc_md.pcibios_fixup_bus = NULL;
345
346}
diff --git a/arch/ppc/syslib/m82xx_pci.h b/arch/ppc/syslib/m82xx_pci.h
deleted file mode 100644
index 924f73f8e595..000000000000
--- a/arch/ppc/syslib/m82xx_pci.h
+++ /dev/null
@@ -1,92 +0,0 @@
1
2#ifndef _PPC_KERNEL_M82XX_PCI_H
3#define _PPC_KERNEL_M82XX_PCI_H
4
5#include <asm/m8260_pci.h>
6/*
7 * Local->PCI map (from CPU) controlled by
8 * MPC826x master window
9 *
10 * 0xF6000000 - 0xF7FFFFFF IO space
11 * 0x80000000 - 0xBFFFFFFF CPU2PCI memory space PCIBR0
12 *
13 * 0x80000000 - 0x9FFFFFFF PCI Mem with prefetch (Outbound ATU #1)
14 * 0xA0000000 - 0xBFFFFFFF PCI Mem w/o prefetch (Outbound ATU #2)
15 * 0xF6000000 - 0xF7FFFFFF 32-bit PCI IO (Outbound ATU #3)
16 *
17 * PCI->Local map (from PCI)
18 * MPC826x slave window controlled by
19 *
20 * 0x00000000 - 0x07FFFFFF MPC826x local memory (Inbound ATU #1)
21 */
22
23/*
24 * Slave window that allows PCI masters to access MPC826x local memory.
25 * This window is set up using the first set of Inbound ATU registers
26 */
27
28#ifndef M82xx_PCI_SLAVE_MEM_LOCAL
29#define M82xx_PCI_SLAVE_MEM_LOCAL (((struct bd_info *)__res)->bi_memstart)
30#define M82xx_PCI_SLAVE_MEM_BUS (((struct bd_info *)__res)->bi_memstart)
31#define M82xx_PCI_SLAVE_MEM_SIZE (((struct bd_info *)__res)->bi_memsize)
32#endif
33
34/*
35 * This is the window that allows the CPU to access PCI address space.
36 * It will be setup with the SIU PCIBR0 register. All three PCI master
37 * windows, which allow the CPU to access PCI prefetch, non prefetch,
38 * and IO space (see below), must all fit within this window.
39 */
40
41#ifndef M82xx_PCI_LOWER_MEM
42#define M82xx_PCI_LOWER_MEM 0x80000000
43#define M82xx_PCI_UPPER_MEM 0x9fffffff
44#define M82xx_PCI_MEM_OFFSET 0x00000000
45#define M82xx_PCI_MEM_SIZE 0x20000000
46#endif
47
48#ifndef M82xx_PCI_LOWER_MMIO
49#define M82xx_PCI_LOWER_MMIO 0xa0000000
50#define M82xx_PCI_UPPER_MMIO 0xafffffff
51#define M82xx_PCI_MMIO_OFFSET 0x00000000
52#define M82xx_PCI_MMIO_SIZE 0x20000000
53#endif
54
55#ifndef M82xx_PCI_LOWER_IO
56#define M82xx_PCI_LOWER_IO 0x00000000
57#define M82xx_PCI_UPPER_IO 0x01ffffff
58#define M82xx_PCI_IO_BASE 0xf6000000
59#define M82xx_PCI_IO_SIZE 0x02000000
60#endif
61
62#ifndef M82xx_PCI_PRIM_WND_SIZE
63#define M82xx_PCI_PRIM_WND_SIZE ~(M82xx_PCI_IO_SIZE - 1U)
64#define M82xx_PCI_PRIM_WND_BASE (M82xx_PCI_IO_BASE)
65#endif
66
67#ifndef M82xx_PCI_SEC_WND_SIZE
68#define M82xx_PCI_SEC_WND_SIZE ~(M82xx_PCI_MEM_SIZE + M82xx_PCI_MMIO_SIZE - 1U)
69#define M82xx_PCI_SEC_WND_BASE (M82xx_PCI_LOWER_MEM)
70#endif
71
72#ifndef POTA_ADDR_SHIFT
73#define POTA_ADDR_SHIFT 12
74#endif
75
76#ifndef PITA_ADDR_SHIFT
77#define PITA_ADDR_SHIFT 12
78#endif
79
80#ifndef _IO_BASE
81#define _IO_BASE isa_io_base
82#endif
83
84#ifdef CONFIG_8260_PCI9
85struct pci_controller;
86extern void setup_m8260_indirect_pci(struct pci_controller* hose,
87 u32 cfg_addr, u32 cfg_data);
88#else
89#define setup_m8260_indirect_pci setup_indirect_pci
90#endif
91
92#endif /* _PPC_KERNEL_M8260_PCI_H */
diff --git a/arch/ppc/syslib/m8xx_setup.c b/arch/ppc/syslib/m8xx_setup.c
deleted file mode 100644
index 18da720fc1b0..000000000000
--- a/arch/ppc/syslib/m8xx_setup.c
+++ /dev/null
@@ -1,465 +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 * Modified for MBX using prep/chrp/pmac functions by Dan (dmalek@jlc.net)
6 * Further modified for generic 8xx by Dan.
7 */
8
9/*
10 * bootup setup stuff..
11 */
12
13#include <linux/errno.h>
14#include <linux/sched.h>
15#include <linux/kernel.h>
16#include <linux/mm.h>
17#include <linux/stddef.h>
18#include <linux/unistd.h>
19#include <linux/ptrace.h>
20#include <linux/slab.h>
21#include <linux/user.h>
22#include <linux/a.out.h>
23#include <linux/tty.h>
24#include <linux/major.h>
25#include <linux/interrupt.h>
26#include <linux/reboot.h>
27#include <linux/init.h>
28#include <linux/initrd.h>
29#include <linux/ioport.h>
30#include <linux/bootmem.h>
31#include <linux/seq_file.h>
32#include <linux/root_dev.h>
33
34#if defined(CONFIG_MTD) && defined(CONFIG_MTD_PHYSMAP)
35#include <linux/mtd/partitions.h>
36#include <linux/mtd/physmap.h>
37#include <linux/mtd/mtd.h>
38#include <linux/mtd/map.h>
39#endif
40
41#include <asm/mmu.h>
42#include <asm/reg.h>
43#include <asm/residual.h>
44#include <asm/io.h>
45#include <asm/pgtable.h>
46#include <asm/mpc8xx.h>
47#include <asm/8xx_immap.h>
48#include <asm/machdep.h>
49#include <asm/bootinfo.h>
50#include <asm/time.h>
51#include <asm/xmon.h>
52#include <asm/ppc_sys.h>
53
54#include "ppc8xx_pic.h"
55
56#ifdef CONFIG_MTD_PHYSMAP
57#define MPC8xxADS_BANK_WIDTH 4
58#endif
59
60#define MPC8xxADS_U_BOOT_SIZE 0x80000
61#define MPC8xxADS_FREE_AREA_OFFSET MPC8xxADS_U_BOOT_SIZE
62
63#if defined(CONFIG_MTD_PARTITIONS)
64 /*
65 NOTE: bank width and interleave relative to the installed flash
66 should have been chosen within MTD_CFI_GEOMETRY options.
67 */
68static struct mtd_partition mpc8xxads_partitions[] = {
69 {
70 .name = "bootloader",
71 .size = MPC8xxADS_U_BOOT_SIZE,
72 .offset = 0,
73 .mask_flags = MTD_WRITEABLE, /* force read-only */
74 }, {
75 .name = "User FS",
76 .offset = MPC8xxADS_FREE_AREA_OFFSET
77 }
78};
79
80#define mpc8xxads_part_num ARRAY_SIZE(mpc8xxads_partitions)
81
82#endif
83
84static int m8xx_set_rtc_time(unsigned long time);
85static unsigned long m8xx_get_rtc_time(void);
86void m8xx_calibrate_decr(void);
87
88unsigned char __res[sizeof(bd_t)];
89
90extern unsigned long find_available_memory(void);
91extern void m8xx_cpm_reset(void);
92extern void m8xx_wdt_handler_install(bd_t *bp);
93extern void rpxfb_alloc_pages(void);
94extern void cpm_interrupt_init(void);
95
96void __attribute__ ((weak))
97board_init(void)
98{
99}
100
101void __init
102m8xx_setup_arch(void)
103{
104#if defined(CONFIG_MTD) && defined(CONFIG_MTD_PHYSMAP)
105 bd_t *binfo = (bd_t *)__res;
106#endif
107
108 /* Reset the Communication Processor Module.
109 */
110 m8xx_cpm_reset();
111
112#ifdef CONFIG_FB_RPX
113 rpxfb_alloc_pages();
114#endif
115
116#ifdef notdef
117 ROOT_DEV = Root_HDA1; /* hda1 */
118#endif
119
120#ifdef CONFIG_BLK_DEV_INITRD
121#if 0
122 ROOT_DEV = Root_FD0; /* floppy */
123 rd_prompt = 1;
124 rd_doload = 1;
125 rd_image_start = 0;
126#endif
127#if 0 /* XXX this may need to be updated for the new bootmem stuff,
128 or possibly just deleted (see set_phys_avail() in init.c).
129 - paulus. */
130 /* initrd_start and size are setup by boot/head.S and kernel/head.S */
131 if ( initrd_start )
132 {
133 if (initrd_end > *memory_end_p)
134 {
135 printk("initrd extends beyond end of memory "
136 "(0x%08lx > 0x%08lx)\ndisabling initrd\n",
137 initrd_end,*memory_end_p);
138 initrd_start = 0;
139 }
140 }
141#endif
142#endif
143
144 board_init();
145}
146
147void
148abort(void)
149{
150#ifdef CONFIG_XMON
151 xmon(0);
152#endif
153 machine_restart(NULL);
154
155 /* not reached */
156 for (;;);
157}
158
159/* A place holder for time base interrupts, if they are ever enabled. */
160irqreturn_t timebase_interrupt(int irq, void * dev)
161{
162 printk ("timebase_interrupt()\n");
163
164 return IRQ_HANDLED;
165}
166
167static struct irqaction tbint_irqaction = {
168 .handler = timebase_interrupt,
169 .mask = CPU_MASK_NONE,
170 .name = "tbint",
171};
172
173/* per-board overridable init_internal_rtc() function. */
174void __init __attribute__ ((weak))
175init_internal_rtc(void)
176{
177 /* Disable the RTC one second and alarm interrupts. */
178 clrbits16(&((immap_t *)IMAP_ADDR)->im_sit.sit_rtcsc, (RTCSC_SIE | RTCSC_ALE));
179
180 /* Enable the RTC */
181 setbits16(&((immap_t *)IMAP_ADDR)->im_sit.sit_rtcsc, (RTCSC_RTF | RTCSC_RTE));
182
183}
184
185/* The decrementer counts at the system (internal) clock frequency divided by
186 * sixteen, or external oscillator divided by four. We force the processor
187 * to use system clock divided by sixteen.
188 */
189void __init m8xx_calibrate_decr(void)
190{
191 bd_t *binfo = (bd_t *)__res;
192 int freq, fp, divisor;
193
194 /* Unlock the SCCR. */
195 out_be32(&((immap_t *)IMAP_ADDR)->im_clkrstk.cark_sccrk, ~KAPWR_KEY);
196 out_be32(&((immap_t *)IMAP_ADDR)->im_clkrstk.cark_sccrk, KAPWR_KEY);
197
198 /* Force all 8xx processors to use divide by 16 processor clock. */
199 setbits32(&((immap_t *)IMAP_ADDR)->im_clkrst.car_sccr, 0x02000000);
200 /* Processor frequency is MHz.
201 * The value 'fp' is the number of decrementer ticks per second.
202 */
203 fp = binfo->bi_intfreq / 16;
204 freq = fp*60; /* try to make freq/1e6 an integer */
205 divisor = 60;
206 printk("Decrementer Frequency = %d/%d\n", freq, divisor);
207 tb_ticks_per_jiffy = freq / HZ / divisor;
208 tb_to_us = mulhwu_scale_factor(freq / divisor, 1000000);
209
210 /* Perform some more timer/timebase initialization. This used
211 * to be done elsewhere, but other changes caused it to get
212 * called more than once....that is a bad thing.
213 *
214 * First, unlock all of the registers we are going to modify.
215 * To protect them from corruption during power down, registers
216 * that are maintained by keep alive power are "locked". To
217 * modify these registers we have to write the key value to
218 * the key location associated with the register.
219 * Some boards power up with these unlocked, while others
220 * are locked. Writing anything (including the unlock code?)
221 * to the unlocked registers will lock them again. So, here
222 * we guarantee the registers are locked, then we unlock them
223 * for our use.
224 */
225 out_be32(&((immap_t *)IMAP_ADDR)->im_sitk.sitk_tbscrk, ~KAPWR_KEY);
226 out_be32(&((immap_t *)IMAP_ADDR)->im_sitk.sitk_rtcsck, ~KAPWR_KEY);
227 out_be32(&((immap_t *)IMAP_ADDR)->im_sitk.sitk_tbk, ~KAPWR_KEY);
228 out_be32(&((immap_t *)IMAP_ADDR)->im_sitk.sitk_tbscrk, KAPWR_KEY);
229 out_be32(&((immap_t *)IMAP_ADDR)->im_sitk.sitk_rtcsck, KAPWR_KEY);
230 out_be32(&((immap_t *)IMAP_ADDR)->im_sitk.sitk_tbk, KAPWR_KEY);
231
232 init_internal_rtc();
233
234 /* Enabling the decrementer also enables the timebase interrupts
235 * (or from the other point of view, to get decrementer interrupts
236 * we have to enable the timebase). The decrementer interrupt
237 * is wired into the vector table, nothing to do here for that.
238 */
239 out_be16(&((immap_t *)IMAP_ADDR)->im_sit.sit_tbscr, (mk_int_int_mask(DEC_INTERRUPT) << 8) | (TBSCR_TBF | TBSCR_TBE));
240
241 if (setup_irq(DEC_INTERRUPT, &tbint_irqaction))
242 panic("Could not allocate timer IRQ!");
243
244#ifdef CONFIG_8xx_WDT
245 /* Install watchdog timer handler early because it might be
246 * already enabled by the bootloader
247 */
248 m8xx_wdt_handler_install(binfo);
249#endif
250}
251
252/* The RTC on the MPC8xx is an internal register.
253 * We want to protect this during power down, so we need to unlock,
254 * modify, and re-lock.
255 */
256static int
257m8xx_set_rtc_time(unsigned long time)
258{
259 out_be32(&((immap_t *)IMAP_ADDR)->im_sitk.sitk_rtck, KAPWR_KEY);
260 out_be32(&((immap_t *)IMAP_ADDR)->im_sit.sit_rtc, time);
261 out_be32(&((immap_t *)IMAP_ADDR)->im_sitk.sitk_rtck, ~KAPWR_KEY);
262 return(0);
263}
264
265static unsigned long
266m8xx_get_rtc_time(void)
267{
268 /* Get time from the RTC. */
269 return (unsigned long) in_be32(&((immap_t *)IMAP_ADDR)->im_sit.sit_rtc);
270}
271
272static void
273m8xx_restart(char *cmd)
274{
275 __volatile__ unsigned char dummy;
276
277 local_irq_disable();
278
279 setbits32(&((immap_t *)IMAP_ADDR)->im_clkrst.car_plprcr, 0x00000080);
280 /* Clear the ME bit in MSR to cause checkstop on machine check
281 */
282 mtmsr(mfmsr() & ~0x1000);
283
284 dummy = in_8(&((immap_t *)IMAP_ADDR)->im_clkrst.res[0]);
285 printk("Restart failed\n");
286 while(1);
287}
288
289static void
290m8xx_power_off(void)
291{
292 m8xx_restart(NULL);
293}
294
295static void
296m8xx_halt(void)
297{
298 m8xx_restart(NULL);
299}
300
301
302static int
303m8xx_show_percpuinfo(struct seq_file *m, int i)
304{
305 bd_t *bp;
306
307 bp = (bd_t *)__res;
308
309 seq_printf(m, "clock\t\t: %uMHz\n"
310 "bus clock\t: %uMHz\n",
311 bp->bi_intfreq / 1000000,
312 bp->bi_busfreq / 1000000);
313
314 return 0;
315}
316
317#ifdef CONFIG_PCI
318static struct irqaction mbx_i8259_irqaction = {
319 .handler = mbx_i8259_action,
320 .mask = CPU_MASK_NONE,
321 .name = "i8259 cascade",
322};
323#endif
324
325/* Initialize the internal interrupt controller. The number of
326 * interrupts supported can vary with the processor type, and the
327 * 82xx family can have up to 64.
328 * External interrupts can be either edge or level triggered, and
329 * need to be initialized by the appropriate driver.
330 */
331static void __init
332m8xx_init_IRQ(void)
333{
334 int i;
335
336 for (i = SIU_IRQ_OFFSET ; i < SIU_IRQ_OFFSET + NR_SIU_INTS ; i++)
337 irq_desc[i].chip = &ppc8xx_pic;
338
339 cpm_interrupt_init();
340
341#if defined(CONFIG_PCI)
342 for (i = I8259_IRQ_OFFSET ; i < I8259_IRQ_OFFSET + NR_8259_INTS ; i++)
343 irq_desc[i].chip = &i8259_pic;
344
345 i8259_pic_irq_offset = I8259_IRQ_OFFSET;
346 i8259_init(0);
347
348 /* The i8259 cascade interrupt must be level sensitive. */
349
350 clrbits32(&((immap_t *)IMAP_ADDR)->im_siu_conf.sc_siel, (0x80000000 >> ISA_BRIDGE_INT));
351 if (setup_irq(ISA_BRIDGE_INT, &mbx_i8259_irqaction))
352 enable_irq(ISA_BRIDGE_INT);
353#endif /* CONFIG_PCI */
354}
355
356/* -------------------------------------------------------------------- */
357
358/*
359 * This is a big hack right now, but it may turn into something real
360 * someday.
361 *
362 * For the 8xx boards (at this time anyway), there is nothing to initialize
363 * associated the PROM. Rather than include all of the prom.c
364 * functions in the image just to get prom_init, all we really need right
365 * now is the initialization of the physical memory region.
366 */
367static unsigned long __init
368m8xx_find_end_of_memory(void)
369{
370 bd_t *binfo;
371 extern unsigned char __res[];
372
373 binfo = (bd_t *)__res;
374
375 return binfo->bi_memsize;
376}
377
378/*
379 * Now map in some of the I/O space that is generically needed
380 * or shared with multiple devices.
381 * All of this fits into the same 4Mbyte region, so it only
382 * requires one page table page. (or at least it used to -- paulus)
383 */
384static void __init
385m8xx_map_io(void)
386{
387 io_block_mapping(IMAP_ADDR, IMAP_ADDR, IMAP_SIZE, _PAGE_IO);
388#ifdef CONFIG_MBX
389 io_block_mapping(NVRAM_ADDR, NVRAM_ADDR, NVRAM_SIZE, _PAGE_IO);
390 io_block_mapping(MBX_CSR_ADDR, MBX_CSR_ADDR, MBX_CSR_SIZE, _PAGE_IO);
391 io_block_mapping(PCI_CSR_ADDR, PCI_CSR_ADDR, PCI_CSR_SIZE, _PAGE_IO);
392
393 /* Map some of the PCI/ISA I/O space to get the IDE interface.
394 */
395 io_block_mapping(PCI_ISA_IO_ADDR, PCI_ISA_IO_ADDR, 0x4000, _PAGE_IO);
396 io_block_mapping(PCI_IDE_ADDR, PCI_IDE_ADDR, 0x4000, _PAGE_IO);
397#endif
398#if defined(CONFIG_RPXLITE) || defined(CONFIG_RPXCLASSIC)
399 io_block_mapping(RPX_CSR_ADDR, RPX_CSR_ADDR, RPX_CSR_SIZE, _PAGE_IO);
400#if !defined(CONFIG_PCI)
401 io_block_mapping(_IO_BASE,_IO_BASE,_IO_BASE_SIZE, _PAGE_IO);
402#endif
403#endif
404#if defined(CONFIG_RPXTOUCH) || defined(CONFIG_FB_RPX)
405 io_block_mapping(HIOX_CSR_ADDR, HIOX_CSR_ADDR, HIOX_CSR_SIZE, _PAGE_IO);
406#endif
407#ifdef CONFIG_FADS
408 io_block_mapping(BCSR_ADDR, BCSR_ADDR, BCSR_SIZE, _PAGE_IO);
409#endif
410#ifdef CONFIG_PCI
411 io_block_mapping(PCI_CSR_ADDR, PCI_CSR_ADDR, PCI_CSR_SIZE, _PAGE_IO);
412#endif
413#if defined(CONFIG_NETTA)
414 io_block_mapping(_IO_BASE,_IO_BASE,_IO_BASE_SIZE, _PAGE_IO);
415#endif
416}
417
418void __init
419platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
420 unsigned long r6, unsigned long r7)
421{
422 parse_bootinfo(find_bootinfo());
423
424 if ( r3 )
425 memcpy( (void *)__res,(void *)(r3+KERNELBASE), sizeof(bd_t) );
426
427#ifdef CONFIG_PCI
428 m8xx_setup_pci_ptrs();
429#endif
430
431#ifdef CONFIG_BLK_DEV_INITRD
432 /* take care of initrd if we have one */
433 if ( r4 )
434 {
435 initrd_start = r4 + KERNELBASE;
436 initrd_end = r5 + KERNELBASE;
437 }
438#endif /* CONFIG_BLK_DEV_INITRD */
439 /* take care of cmd line */
440 if ( r6 )
441 {
442 *(char *)(r7+KERNELBASE) = 0;
443 strcpy(cmd_line, (char *)(r6+KERNELBASE));
444 }
445
446 identify_ppc_sys_by_name(BOARD_CHIP_NAME);
447
448 ppc_md.setup_arch = m8xx_setup_arch;
449 ppc_md.show_percpuinfo = m8xx_show_percpuinfo;
450 ppc_md.init_IRQ = m8xx_init_IRQ;
451 ppc_md.get_irq = m8xx_get_irq;
452 ppc_md.init = NULL;
453
454 ppc_md.restart = m8xx_restart;
455 ppc_md.power_off = m8xx_power_off;
456 ppc_md.halt = m8xx_halt;
457
458 ppc_md.time_init = NULL;
459 ppc_md.set_rtc_time = m8xx_set_rtc_time;
460 ppc_md.get_rtc_time = m8xx_get_rtc_time;
461 ppc_md.calibrate_decr = m8xx_calibrate_decr;
462
463 ppc_md.find_end_of_memory = m8xx_find_end_of_memory;
464 ppc_md.setup_io_mappings = m8xx_map_io;
465}
diff --git a/arch/ppc/syslib/m8xx_wdt.c b/arch/ppc/syslib/m8xx_wdt.c
deleted file mode 100644
index fffac8cbeb51..000000000000
--- a/arch/ppc/syslib/m8xx_wdt.c
+++ /dev/null
@@ -1,148 +0,0 @@
1/*
2 * m8xx_wdt.c - MPC8xx watchdog driver
3 *
4 * Author: Florian Schirmer <jolt@tuxbox.org>
5 *
6 * 2002 (c) Florian Schirmer <jolt@tuxbox.org> This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10 */
11
12#include <linux/init.h>
13#include <linux/interrupt.h>
14#include <linux/irq.h>
15#include <linux/kernel.h>
16#include <linux/sched.h>
17#include <asm/io.h>
18#include <asm/8xx_immap.h>
19#include <syslib/m8xx_wdt.h>
20
21static int wdt_timeout;
22int m8xx_has_internal_rtc = 0;
23
24static irqreturn_t m8xx_wdt_interrupt(int, void *);
25static struct irqaction m8xx_wdt_irqaction = {
26 .handler = m8xx_wdt_interrupt,
27 .name = "watchdog",
28};
29
30void m8xx_wdt_reset(void)
31{
32 volatile immap_t *imap = (volatile immap_t *)IMAP_ADDR;
33
34 out_be16(&imap->im_siu_conf.sc_swsr, 0x556c); /* write magic1 */
35 out_be16(&imap->im_siu_conf.sc_swsr, 0xaa39); /* write magic2 */
36}
37
38static irqreturn_t m8xx_wdt_interrupt(int irq, void *dev)
39{
40 volatile immap_t *imap = (volatile immap_t *)IMAP_ADDR;
41
42 m8xx_wdt_reset();
43
44 setbits16(&imap->im_sit.sit_piscr, PISCR_PS);
45 return IRQ_HANDLED;
46}
47
48#define SYPCR_SWP 0x1
49#define SYPCR_SWE 0x4
50
51
52void __init m8xx_wdt_install_irq(volatile immap_t *imap, bd_t *binfo)
53{
54 u32 pitc;
55 u32 pitrtclk;
56
57 /*
58 * Fire trigger if half of the wdt ticked down
59 */
60
61 if (imap->im_sit.sit_rtcsc & RTCSC_38K)
62 pitrtclk = 9600;
63 else
64 pitrtclk = 8192;
65
66 if ((wdt_timeout) > (UINT_MAX / pitrtclk))
67 pitc = wdt_timeout / binfo->bi_intfreq * pitrtclk / 2;
68 else
69 pitc = pitrtclk * wdt_timeout / binfo->bi_intfreq / 2;
70
71 out_be32(&imap->im_sit.sit_pitc, pitc << 16);
72
73 out_be16(&imap->im_sit.sit_piscr, (mk_int_int_mask(PIT_INTERRUPT) << 8) | PISCR_PIE | PISCR_PTE);
74
75 if (setup_irq(PIT_INTERRUPT, &m8xx_wdt_irqaction))
76 panic("m8xx_wdt: error setting up the watchdog irq!");
77
78 printk(KERN_NOTICE
79 "m8xx_wdt: keep-alive trigger installed (PITC: 0x%04X)\n", pitc);
80
81}
82
83static void m8xx_wdt_timer_func(unsigned long data);
84
85static struct timer_list m8xx_wdt_timer =
86 TIMER_INITIALIZER(m8xx_wdt_timer_func, 0, 0);
87
88void m8xx_wdt_stop_timer(void)
89{
90 del_timer(&m8xx_wdt_timer);
91}
92
93void m8xx_wdt_install_timer(void)
94{
95 m8xx_wdt_timer.expires = jiffies + (HZ/2);
96 add_timer(&m8xx_wdt_timer);
97}
98
99static void m8xx_wdt_timer_func(unsigned long data)
100{
101 m8xx_wdt_reset();
102 m8xx_wdt_install_timer();
103}
104
105void __init m8xx_wdt_handler_install(bd_t * binfo)
106{
107 volatile immap_t *imap = (volatile immap_t *)IMAP_ADDR;
108 u32 sypcr;
109
110 sypcr = in_be32(&imap->im_siu_conf.sc_sypcr);
111
112 if (!(sypcr & SYPCR_SWE)) {
113 printk(KERN_NOTICE "m8xx_wdt: wdt disabled (SYPCR: 0x%08X)\n",
114 sypcr);
115 return;
116 }
117
118 m8xx_wdt_reset();
119
120 printk(KERN_NOTICE
121 "m8xx_wdt: active wdt found (SWTC: 0x%04X, SWP: 0x%01X)\n",
122 (sypcr >> 16), sypcr & SYPCR_SWP);
123
124 wdt_timeout = (sypcr >> 16) & 0xFFFF;
125
126 if (!wdt_timeout)
127 wdt_timeout = 0xFFFF;
128
129 if (sypcr & SYPCR_SWP)
130 wdt_timeout *= 2048;
131
132 m8xx_has_internal_rtc = in_be16(&imap->im_sit.sit_rtcsc) & RTCSC_RTE;
133
134 /* if the internal RTC is off use a kernel timer */
135 if (!m8xx_has_internal_rtc) {
136 if (wdt_timeout < (binfo->bi_intfreq/HZ))
137 printk(KERN_ERR "m8xx_wdt: timeout too short for ktimer!\n");
138 m8xx_wdt_install_timer();
139 } else
140 m8xx_wdt_install_irq(imap, binfo);
141
142 wdt_timeout /= binfo->bi_intfreq;
143}
144
145int m8xx_wdt_get_timeout(void)
146{
147 return wdt_timeout;
148}
diff --git a/arch/ppc/syslib/m8xx_wdt.h b/arch/ppc/syslib/m8xx_wdt.h
deleted file mode 100644
index e75835f0012b..000000000000
--- a/arch/ppc/syslib/m8xx_wdt.h
+++ /dev/null
@@ -1,20 +0,0 @@
1/*
2 * Author: Florian Schirmer <jolt@tuxbox.org>
3 *
4 * 2002 (c) Florian Schirmer <jolt@tuxbox.org> This file is licensed under
5 * the terms of the GNU General Public License version 2. This program
6 * is licensed "as is" without any warranty of any kind, whether express
7 * or implied.
8 */
9#ifndef _PPC_SYSLIB_M8XX_WDT_H
10#define _PPC_SYSLIB_M8XX_WDT_H
11
12extern int m8xx_has_internal_rtc;
13
14extern void m8xx_wdt_handler_install(bd_t * binfo);
15extern int m8xx_wdt_get_timeout(void);
16extern void m8xx_wdt_reset(void);
17extern void m8xx_wdt_install_timer(void);
18extern void m8xx_wdt_stop_timer(void);
19
20#endif /* _PPC_SYSLIB_M8XX_WDT_H */
diff --git a/arch/ppc/syslib/mpc10x_common.c b/arch/ppc/syslib/mpc10x_common.c
deleted file mode 100644
index 437a294527a9..000000000000
--- a/arch/ppc/syslib/mpc10x_common.c
+++ /dev/null
@@ -1,654 +0,0 @@
1/*
2 * Common routines for the Motorola SPS MPC106, MPC107 and MPC8240 Host bridge,
3 * Mem ctlr, EPIC, etc.
4 *
5 * Author: Mark A. Greer
6 * mgreer@mvista.com
7 *
8 * 2001 (c) MontaVista, Software, Inc. This file is licensed under
9 * the terms of the GNU General Public License version 2. This program
10 * is licensed "as is" without any warranty of any kind, whether express
11 * or implied.
12 */
13
14/*
15 * *** WARNING - A BAT MUST be set to access the PCI config addr/data regs ***
16 */
17
18#include <linux/kernel.h>
19#include <linux/init.h>
20#include <linux/pci.h>
21#include <linux/slab.h>
22#include <linux/serial_8250.h>
23#include <linux/fsl_devices.h>
24#include <linux/device.h>
25
26#include <asm/byteorder.h>
27#include <asm/io.h>
28#include <asm/irq.h>
29#include <asm/uaccess.h>
30#include <asm/machdep.h>
31#include <asm/pci-bridge.h>
32#include <asm/open_pic.h>
33#include <asm/mpc10x.h>
34#include <asm/ppc_sys.h>
35
36#ifdef CONFIG_MPC10X_OPENPIC
37#ifdef CONFIG_EPIC_SERIAL_MODE
38#define EPIC_IRQ_BASE (epic_serial_mode ? 16 : 5)
39#else
40#define EPIC_IRQ_BASE 5
41#endif
42#define MPC10X_I2C_IRQ (EPIC_IRQ_BASE + NUM_8259_INTERRUPTS)
43#define MPC10X_DMA0_IRQ (EPIC_IRQ_BASE + 1 + NUM_8259_INTERRUPTS)
44#define MPC10X_DMA1_IRQ (EPIC_IRQ_BASE + 2 + NUM_8259_INTERRUPTS)
45#define MPC10X_UART0_IRQ (EPIC_IRQ_BASE + 4 + NUM_8259_INTERRUPTS)
46#define MPC10X_UART1_IRQ (EPIC_IRQ_BASE + 5 + NUM_8259_INTERRUPTS)
47#else
48#define MPC10X_I2C_IRQ -1
49#define MPC10X_DMA0_IRQ -1
50#define MPC10X_DMA1_IRQ -1
51#define MPC10X_UART0_IRQ -1
52#define MPC10X_UART1_IRQ -1
53#endif
54
55static struct fsl_i2c_platform_data mpc10x_i2c_pdata = {
56 .device_flags = 0,
57};
58
59static struct plat_serial8250_port serial_plat_uart0[] = {
60 [0] = {
61 .mapbase = 0x4500,
62 .iotype = UPIO_MEM,
63 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
64 },
65 { },
66};
67static struct plat_serial8250_port serial_plat_uart1[] = {
68 [0] = {
69 .mapbase = 0x4600,
70 .iotype = UPIO_MEM,
71 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
72 },
73 { },
74};
75
76struct platform_device ppc_sys_platform_devices[] = {
77 [MPC10X_IIC1] = {
78 .name = "fsl-i2c",
79 .id = 1,
80 .dev.platform_data = &mpc10x_i2c_pdata,
81 .num_resources = 2,
82 .resource = (struct resource[]) {
83 {
84 .start = MPC10X_EUMB_I2C_OFFSET,
85 .end = MPC10X_EUMB_I2C_OFFSET +
86 MPC10X_EUMB_I2C_SIZE - 1,
87 .flags = IORESOURCE_MEM,
88 },
89 {
90 .flags = IORESOURCE_IRQ
91 },
92 },
93 },
94 [MPC10X_DMA0] = {
95 .name = "fsl-dma",
96 .id = 0,
97 .num_resources = 2,
98 .resource = (struct resource[]) {
99 {
100 .start = MPC10X_EUMB_DMA_OFFSET + 0x10,
101 .end = MPC10X_EUMB_DMA_OFFSET + 0x1f,
102 .flags = IORESOURCE_MEM,
103 },
104 {
105 .flags = IORESOURCE_IRQ,
106 },
107 },
108 },
109 [MPC10X_DMA1] = {
110 .name = "fsl-dma",
111 .id = 1,
112 .num_resources = 2,
113 .resource = (struct resource[]) {
114 {
115 .start = MPC10X_EUMB_DMA_OFFSET + 0x20,
116 .end = MPC10X_EUMB_DMA_OFFSET + 0x2f,
117 .flags = IORESOURCE_MEM,
118 },
119 {
120 .flags = IORESOURCE_IRQ,
121 },
122 },
123 },
124 [MPC10X_DMA1] = {
125 .name = "fsl-dma",
126 .id = 1,
127 .num_resources = 2,
128 .resource = (struct resource[]) {
129 {
130 .start = MPC10X_EUMB_DMA_OFFSET + 0x20,
131 .end = MPC10X_EUMB_DMA_OFFSET + 0x2f,
132 .flags = IORESOURCE_MEM,
133 },
134 {
135 .flags = IORESOURCE_IRQ,
136 },
137 },
138 },
139 [MPC10X_UART0] = {
140 .name = "serial8250",
141 .id = PLAT8250_DEV_PLATFORM,
142 .dev.platform_data = serial_plat_uart0,
143 },
144 [MPC10X_UART1] = {
145 .name = "serial8250",
146 .id = PLAT8250_DEV_PLATFORM1,
147 .dev.platform_data = serial_plat_uart1,
148 },
149
150};
151
152/* We use the PCI ID to match on */
153struct ppc_sys_spec *cur_ppc_sys_spec;
154struct ppc_sys_spec ppc_sys_specs[] = {
155 {
156 .ppc_sys_name = "8245",
157 .mask = 0xFFFFFFFF,
158 .value = MPC10X_BRIDGE_8245,
159 .num_devices = 5,
160 .device_list = (enum ppc_sys_devices[])
161 {
162 MPC10X_IIC1, MPC10X_DMA0, MPC10X_DMA1, MPC10X_UART0, MPC10X_UART1,
163 },
164 },
165 {
166 .ppc_sys_name = "8240",
167 .mask = 0xFFFFFFFF,
168 .value = MPC10X_BRIDGE_8240,
169 .num_devices = 3,
170 .device_list = (enum ppc_sys_devices[])
171 {
172 MPC10X_IIC1, MPC10X_DMA0, MPC10X_DMA1,
173 },
174 },
175 {
176 .ppc_sys_name = "107",
177 .mask = 0xFFFFFFFF,
178 .value = MPC10X_BRIDGE_107,
179 .num_devices = 3,
180 .device_list = (enum ppc_sys_devices[])
181 {
182 MPC10X_IIC1, MPC10X_DMA0, MPC10X_DMA1,
183 },
184 },
185 { /* default match */
186 .ppc_sys_name = "",
187 .mask = 0x00000000,
188 .value = 0x00000000,
189 },
190};
191
192/*
193 * mach_mpc10x_fixup: This function enables DUART mode if it detects
194 * if it detects two UARTS in the platform device entries.
195 */
196static int __init mach_mpc10x_fixup(struct platform_device *pdev)
197{
198 if (strncmp (pdev->name, "serial8250", 10) == 0 && pdev->id == 1)
199 writeb(readb(serial_plat_uart1[0].membase + 0x11) | 0x1,
200 serial_plat_uart1[0].membase + 0x11);
201 return 0;
202}
203
204static int __init mach_mpc10x_init(void)
205{
206 ppc_sys_device_fixup = mach_mpc10x_fixup;
207 return 0;
208}
209postcore_initcall(mach_mpc10x_init);
210
211/* Set resources to match bridge memory map */
212void __init
213mpc10x_bridge_set_resources(int map, struct pci_controller *hose)
214{
215
216 switch (map) {
217 case MPC10X_MEM_MAP_A:
218 pci_init_resource(&hose->io_resource,
219 0x00000000,
220 0x3f7fffff,
221 IORESOURCE_IO,
222 "PCI host bridge");
223
224 pci_init_resource (&hose->mem_resources[0],
225 0xc0000000,
226 0xfeffffff,
227 IORESOURCE_MEM,
228 "PCI host bridge");
229 break;
230 case MPC10X_MEM_MAP_B:
231 pci_init_resource(&hose->io_resource,
232 0x00000000,
233 0x00bfffff,
234 IORESOURCE_IO,
235 "PCI host bridge");
236
237 pci_init_resource (&hose->mem_resources[0],
238 0x80000000,
239 0xfcffffff,
240 IORESOURCE_MEM,
241 "PCI host bridge");
242 break;
243 default:
244 printk("mpc10x_bridge_set_resources: "
245 "Invalid map specified\n");
246 if (ppc_md.progress)
247 ppc_md.progress("mpc10x:exit1", 0x100);
248 }
249}
250
251/*
252 * Do some initialization and put the EUMB registers at the specified address
253 * (also map the EPIC registers into virtual space--OpenPIC_Addr will be set).
254 *
255 * The EPIC is not on the 106, only the 8240 and 107.
256 */
257int __init
258mpc10x_bridge_init(struct pci_controller *hose,
259 uint current_map,
260 uint new_map,
261 uint phys_eumb_base)
262{
263 int host_bridge, picr1, picr1_bit, i;
264 ulong pci_config_addr, pci_config_data;
265 u_char pir, byte;
266
267 if (ppc_md.progress) ppc_md.progress("mpc10x:enter", 0x100);
268
269 /* Set up for current map so we can get at config regs */
270 switch (current_map) {
271 case MPC10X_MEM_MAP_A:
272 setup_indirect_pci(hose,
273 MPC10X_MAPA_CNFG_ADDR,
274 MPC10X_MAPA_CNFG_DATA);
275 break;
276 case MPC10X_MEM_MAP_B:
277 setup_indirect_pci(hose,
278 MPC10X_MAPB_CNFG_ADDR,
279 MPC10X_MAPB_CNFG_DATA);
280 break;
281 default:
282 printk("mpc10x_bridge_init: %s\n",
283 "Invalid current map specified");
284 if (ppc_md.progress)
285 ppc_md.progress("mpc10x:exit1", 0x100);
286 return -1;
287 }
288
289 /* Make sure it's a supported bridge */
290 early_read_config_dword(hose,
291 0,
292 PCI_DEVFN(0,0),
293 PCI_VENDOR_ID,
294 &host_bridge);
295
296 switch (host_bridge) {
297 case MPC10X_BRIDGE_106:
298 case MPC10X_BRIDGE_8240:
299 case MPC10X_BRIDGE_107:
300 case MPC10X_BRIDGE_8245:
301 break;
302 default:
303 if (ppc_md.progress)
304 ppc_md.progress("mpc10x:exit2", 0x100);
305 return -1;
306 }
307
308 switch (new_map) {
309 case MPC10X_MEM_MAP_A:
310 MPC10X_SETUP_HOSE(hose, A);
311 pci_config_addr = MPC10X_MAPA_CNFG_ADDR;
312 pci_config_data = MPC10X_MAPA_CNFG_DATA;
313 picr1_bit = MPC10X_CFG_PICR1_ADDR_MAP_A;
314 break;
315 case MPC10X_MEM_MAP_B:
316 MPC10X_SETUP_HOSE(hose, B);
317 pci_config_addr = MPC10X_MAPB_CNFG_ADDR;
318 pci_config_data = MPC10X_MAPB_CNFG_DATA;
319 picr1_bit = MPC10X_CFG_PICR1_ADDR_MAP_B;
320 break;
321 default:
322 printk("mpc10x_bridge_init: %s\n",
323 "Invalid new map specified");
324 if (ppc_md.progress)
325 ppc_md.progress("mpc10x:exit3", 0x100);
326 return -1;
327 }
328
329 /* Make bridge use the 'new_map', if not already usng it */
330 if (current_map != new_map) {
331 early_read_config_dword(hose,
332 0,
333 PCI_DEVFN(0,0),
334 MPC10X_CFG_PICR1_REG,
335 &picr1);
336
337 picr1 = (picr1 & ~MPC10X_CFG_PICR1_ADDR_MAP_MASK) |
338 picr1_bit;
339
340 early_write_config_dword(hose,
341 0,
342 PCI_DEVFN(0,0),
343 MPC10X_CFG_PICR1_REG,
344 picr1);
345
346 asm volatile("sync");
347
348 /* Undo old mappings & map in new cfg data/addr regs */
349 iounmap((void *)hose->cfg_addr);
350 iounmap((void *)hose->cfg_data);
351
352 setup_indirect_pci(hose,
353 pci_config_addr,
354 pci_config_data);
355 }
356
357 /* Setup resources to match map */
358 mpc10x_bridge_set_resources(new_map, hose);
359
360 /*
361 * Want processor accesses of 0xFDxxxxxx to be mapped
362 * to PCI memory space at 0x00000000. Do not want
363 * host bridge to respond to PCI memory accesses of
364 * 0xFDxxxxxx. Do not want host bridge to respond
365 * to PCI memory addresses 0xFD000000-0xFDFFFFFF;
366 * want processor accesses from 0x000A0000-0x000BFFFF
367 * to be forwarded to system memory.
368 *
369 * Only valid if not in agent mode and using MAP B.
370 */
371 if (new_map == MPC10X_MEM_MAP_B) {
372 early_read_config_byte(hose,
373 0,
374 PCI_DEVFN(0,0),
375 MPC10X_CFG_MAPB_OPTIONS_REG,
376 &byte);
377
378 byte &= ~(MPC10X_CFG_MAPB_OPTIONS_PFAE |
379 MPC10X_CFG_MAPB_OPTIONS_PCICH |
380 MPC10X_CFG_MAPB_OPTIONS_PROCCH);
381
382 if (host_bridge != MPC10X_BRIDGE_106) {
383 byte |= MPC10X_CFG_MAPB_OPTIONS_CFAE;
384 }
385
386 early_write_config_byte(hose,
387 0,
388 PCI_DEVFN(0,0),
389 MPC10X_CFG_MAPB_OPTIONS_REG,
390 byte);
391 }
392
393 if (host_bridge != MPC10X_BRIDGE_106) {
394 early_read_config_byte(hose,
395 0,
396 PCI_DEVFN(0,0),
397 MPC10X_CFG_PIR_REG,
398 &pir);
399
400 if (pir != MPC10X_CFG_PIR_HOST_BRIDGE) {
401 printk("Host bridge in Agent mode\n");
402 /* Read or Set LMBAR & PCSRBAR? */
403 }
404
405 /* Set base addr of the 8240/107 EUMB. */
406 early_write_config_dword(hose,
407 0,
408 PCI_DEVFN(0,0),
409 MPC10X_CFG_EUMBBAR,
410 phys_eumb_base);
411#ifdef CONFIG_MPC10X_OPENPIC
412 /* Map EPIC register part of EUMB into vitual memory - PCORE
413 uses an i8259 instead of EPIC. */
414 OpenPIC_Addr =
415 ioremap(phys_eumb_base + MPC10X_EUMB_EPIC_OFFSET,
416 MPC10X_EUMB_EPIC_SIZE);
417#endif
418 }
419
420#ifdef CONFIG_MPC10X_STORE_GATHERING
421 mpc10x_enable_store_gathering(hose);
422#else
423 mpc10x_disable_store_gathering(hose);
424#endif
425
426 /* setup platform devices for MPC10x bridges */
427 identify_ppc_sys_by_id (host_bridge);
428
429 for (i = 0; i < cur_ppc_sys_spec->num_devices; i++) {
430 unsigned int dev_id = cur_ppc_sys_spec->device_list[i];
431 ppc_sys_fixup_mem_resource(&ppc_sys_platform_devices[dev_id],
432 phys_eumb_base);
433 }
434
435 /* IRQs are determined at runtime */
436 ppc_sys_platform_devices[MPC10X_IIC1].resource[1].start = MPC10X_I2C_IRQ;
437 ppc_sys_platform_devices[MPC10X_IIC1].resource[1].end = MPC10X_I2C_IRQ;
438 ppc_sys_platform_devices[MPC10X_DMA0].resource[1].start = MPC10X_DMA0_IRQ;
439 ppc_sys_platform_devices[MPC10X_DMA0].resource[1].end = MPC10X_DMA0_IRQ;
440 ppc_sys_platform_devices[MPC10X_DMA1].resource[1].start = MPC10X_DMA1_IRQ;
441 ppc_sys_platform_devices[MPC10X_DMA1].resource[1].end = MPC10X_DMA1_IRQ;
442
443 serial_plat_uart0[0].mapbase += phys_eumb_base;
444 serial_plat_uart0[0].irq = MPC10X_UART0_IRQ;
445 serial_plat_uart0[0].membase = ioremap(serial_plat_uart0[0].mapbase, 0x100);
446
447 serial_plat_uart1[0].mapbase += phys_eumb_base;
448 serial_plat_uart1[0].irq = MPC10X_UART1_IRQ;
449 serial_plat_uart1[0].membase = ioremap(serial_plat_uart1[0].mapbase, 0x100);
450
451 /*
452 * 8240 erratum 26, 8241/8245 erratum 29, 107 erratum 23: speculative
453 * PCI reads may return stale data so turn off.
454 */
455 if ((host_bridge == MPC10X_BRIDGE_8240)
456 || (host_bridge == MPC10X_BRIDGE_8245)
457 || (host_bridge == MPC10X_BRIDGE_107)) {
458
459 early_read_config_dword(hose, 0, PCI_DEVFN(0,0),
460 MPC10X_CFG_PICR1_REG, &picr1);
461
462 picr1 &= ~MPC10X_CFG_PICR1_SPEC_PCI_RD;
463
464 early_write_config_dword(hose, 0, PCI_DEVFN(0,0),
465 MPC10X_CFG_PICR1_REG, picr1);
466 }
467
468 /*
469 * 8241/8245 erratum 28: PCI reads from local memory may return
470 * stale data. Workaround by setting PICR2[0] to disable copyback
471 * optimization. Oddly, the latest available user manual for the
472 * 8245 (Rev 2., dated 10/2003) says PICR2[0] is reserverd.
473 */
474 if (host_bridge == MPC10X_BRIDGE_8245) {
475 u32 picr2;
476
477 early_read_config_dword(hose, 0, PCI_DEVFN(0,0),
478 MPC10X_CFG_PICR2_REG, &picr2);
479
480 picr2 |= MPC10X_CFG_PICR2_COPYBACK_OPT;
481
482 early_write_config_dword(hose, 0, PCI_DEVFN(0,0),
483 MPC10X_CFG_PICR2_REG, picr2);
484 }
485
486 if (ppc_md.progress) ppc_md.progress("mpc10x:exit", 0x100);
487 return 0;
488}
489
490/*
491 * Need to make our own PCI config space access macros because
492 * mpc10x_get_mem_size() is called before the data structures are set up for
493 * the 'early_xxx' and 'indirect_xxx' routines to work.
494 * Assumes bus 0.
495 */
496#define MPC10X_CFG_read(val, addr, type, op) *val = op((type)(addr))
497#define MPC10X_CFG_write(val, addr, type, op) op((type *)(addr), (val))
498
499#define MPC10X_PCI_OP(rw, size, type, op, mask) \
500static void \
501mpc10x_##rw##_config_##size(uint *cfg_addr, uint *cfg_data, int devfn, int offset, type val) \
502{ \
503 out_be32(cfg_addr, \
504 ((offset & 0xfc) << 24) | (devfn << 16) \
505 | (0 << 8) | 0x80); \
506 MPC10X_CFG_##rw(val, cfg_data + (offset & mask), type, op); \
507 return; \
508}
509
510MPC10X_PCI_OP(read, byte, u8 *, in_8, 3)
511MPC10X_PCI_OP(read, dword, u32 *, in_le32, 0)
512#if 0 /* Not used */
513MPC10X_PCI_OP(write, byte, u8, out_8, 3)
514MPC10X_PCI_OP(read, word, u16 *, in_le16, 2)
515MPC10X_PCI_OP(write, word, u16, out_le16, 2)
516MPC10X_PCI_OP(write, dword, u32, out_le32, 0)
517#endif
518
519/*
520 * Read the memory controller registers to determine the amount of memory in
521 * the system. This assumes that the firmware has correctly set up the memory
522 * controller registers.
523 */
524unsigned long __init
525mpc10x_get_mem_size(uint mem_map)
526{
527 uint *config_addr, *config_data, val;
528 ulong start, end, total, offset;
529 int i;
530 u_char bank_enables;
531
532 switch (mem_map) {
533 case MPC10X_MEM_MAP_A:
534 config_addr = (uint *)MPC10X_MAPA_CNFG_ADDR;
535 config_data = (uint *)MPC10X_MAPA_CNFG_DATA;
536 break;
537 case MPC10X_MEM_MAP_B:
538 config_addr = (uint *)MPC10X_MAPB_CNFG_ADDR;
539 config_data = (uint *)MPC10X_MAPB_CNFG_DATA;
540 break;
541 default:
542 return 0;
543 }
544
545 mpc10x_read_config_byte(config_addr,
546 config_data,
547 PCI_DEVFN(0,0),
548 MPC10X_MCTLR_MEM_BANK_ENABLES,
549 &bank_enables);
550
551 total = 0;
552
553 for (i=0; i<8; i++) {
554 if (bank_enables & (1 << i)) {
555 offset = MPC10X_MCTLR_MEM_START_1 + ((i > 3) ? 4 : 0);
556 mpc10x_read_config_dword(config_addr,
557 config_data,
558 PCI_DEVFN(0,0),
559 offset,
560 &val);
561 start = (val >> ((i & 3) << 3)) & 0xff;
562
563 offset = MPC10X_MCTLR_EXT_MEM_START_1 + ((i>3) ? 4 : 0);
564 mpc10x_read_config_dword(config_addr,
565 config_data,
566 PCI_DEVFN(0,0),
567 offset,
568 &val);
569 val = (val >> ((i & 3) << 3)) & 0x03;
570 start = (val << 28) | (start << 20);
571
572 offset = MPC10X_MCTLR_MEM_END_1 + ((i > 3) ? 4 : 0);
573 mpc10x_read_config_dword(config_addr,
574 config_data,
575 PCI_DEVFN(0,0),
576 offset,
577 &val);
578 end = (val >> ((i & 3) << 3)) & 0xff;
579
580 offset = MPC10X_MCTLR_EXT_MEM_END_1 + ((i > 3) ? 4 : 0);
581 mpc10x_read_config_dword(config_addr,
582 config_data,
583 PCI_DEVFN(0,0),
584 offset,
585 &val);
586 val = (val >> ((i & 3) << 3)) & 0x03;
587 end = (val << 28) | (end << 20) | 0xfffff;
588
589 total += (end - start + 1);
590 }
591 }
592
593 return total;
594}
595
596int __init
597mpc10x_enable_store_gathering(struct pci_controller *hose)
598{
599 uint picr1;
600
601 early_read_config_dword(hose,
602 0,
603 PCI_DEVFN(0,0),
604 MPC10X_CFG_PICR1_REG,
605 &picr1);
606
607 picr1 |= MPC10X_CFG_PICR1_ST_GATH_EN;
608
609 early_write_config_dword(hose,
610 0,
611 PCI_DEVFN(0,0),
612 MPC10X_CFG_PICR1_REG,
613 picr1);
614
615 return 0;
616}
617
618int __init
619mpc10x_disable_store_gathering(struct pci_controller *hose)
620{
621 uint picr1;
622
623 early_read_config_dword(hose,
624 0,
625 PCI_DEVFN(0,0),
626 MPC10X_CFG_PICR1_REG,
627 &picr1);
628
629 picr1 &= ~MPC10X_CFG_PICR1_ST_GATH_EN;
630
631 early_write_config_dword(hose,
632 0,
633 PCI_DEVFN(0,0),
634 MPC10X_CFG_PICR1_REG,
635 picr1);
636
637 return 0;
638}
639
640#ifdef CONFIG_MPC10X_OPENPIC
641void __init mpc10x_set_openpic(void)
642{
643 /* Map external IRQs */
644 openpic_set_sources(0, EPIC_IRQ_BASE, OpenPIC_Addr + 0x10200);
645 /* Skip reserved space and map i2c and DMA Ch[01] */
646 openpic_set_sources(EPIC_IRQ_BASE, 3, OpenPIC_Addr + 0x11020);
647 /* Skip reserved space and map Message Unit Interrupt (I2O) */
648 openpic_set_sources(EPIC_IRQ_BASE + 3, 1, OpenPIC_Addr + 0x110C0);
649 /* Skip reserved space and map Serial Interrupts */
650 openpic_set_sources(EPIC_IRQ_BASE + 4, 2, OpenPIC_Addr + 0x11120);
651
652 openpic_init(NUM_8259_INTERRUPTS);
653}
654#endif
diff --git a/arch/ppc/syslib/mpc52xx_devices.c b/arch/ppc/syslib/mpc52xx_devices.c
deleted file mode 100644
index 7487539a4e92..000000000000
--- a/arch/ppc/syslib/mpc52xx_devices.c
+++ /dev/null
@@ -1,317 +0,0 @@
1/*
2 * Freescale MPC52xx device descriptions
3 *
4 *
5 * Maintainer : Sylvain Munaut <tnt@246tNt.com>
6 *
7 * Copyright (C) 2005 Sylvain Munaut <tnt@246tNt.com>
8 *
9 * This file is licensed under the terms of the GNU General Public License
10 * version 2. This program is licensed "as is" without any warranty of any
11 * kind, whether express or implied.
12 */
13
14#include <linux/fsl_devices.h>
15#include <linux/resource.h>
16#include <linux/platform_device.h>
17#include <asm/mpc52xx.h>
18#include <asm/ppc_sys.h>
19
20
21static u64 mpc52xx_dma_mask = 0xffffffffULL;
22
23static struct fsl_i2c_platform_data mpc52xx_fsl_i2c_pdata = {
24 .device_flags = FSL_I2C_DEV_CLOCK_5200,
25};
26
27
28/* We use relative offsets for IORESOURCE_MEM to be independent from the
29 * MBAR location at compile time
30 */
31
32/* TODO Add the BestComm initiator channel to the device definitions,
33 possibly using IORESOURCE_DMA. But that's when BestComm is ready ... */
34
35struct platform_device ppc_sys_platform_devices[] = {
36 [MPC52xx_MSCAN1] = {
37 .name = "mpc52xx-mscan",
38 .id = 0,
39 .num_resources = 2,
40 .resource = (struct resource[]) {
41 {
42 .start = 0x0900,
43 .end = 0x097f,
44 .flags = IORESOURCE_MEM,
45 },
46 {
47 .start = MPC52xx_MSCAN1_IRQ,
48 .end = MPC52xx_MSCAN1_IRQ,
49 .flags = IORESOURCE_IRQ,
50 },
51 },
52 },
53 [MPC52xx_MSCAN2] = {
54 .name = "mpc52xx-mscan",
55 .id = 1,
56 .num_resources = 2,
57 .resource = (struct resource[]) {
58 {
59 .start = 0x0980,
60 .end = 0x09ff,
61 .flags = IORESOURCE_MEM,
62 },
63 {
64 .start = MPC52xx_MSCAN2_IRQ,
65 .end = MPC52xx_MSCAN2_IRQ,
66 .flags = IORESOURCE_IRQ,
67 },
68 },
69 },
70 [MPC52xx_SPI] = {
71 .name = "mpc52xx-spi",
72 .id = -1,
73 .num_resources = 3,
74 .resource = (struct resource[]) {
75 {
76 .start = 0x0f00,
77 .end = 0x0f1f,
78 .flags = IORESOURCE_MEM,
79 },
80 {
81 .name = "modf",
82 .start = MPC52xx_SPI_MODF_IRQ,
83 .end = MPC52xx_SPI_MODF_IRQ,
84 .flags = IORESOURCE_IRQ,
85 },
86 {
87 .name = "spif",
88 .start = MPC52xx_SPI_SPIF_IRQ,
89 .end = MPC52xx_SPI_SPIF_IRQ,
90 .flags = IORESOURCE_IRQ,
91 },
92 },
93 },
94 [MPC52xx_USB] = {
95 .name = "ppc-soc-ohci",
96 .id = -1,
97 .num_resources = 2,
98 .dev.dma_mask = &mpc52xx_dma_mask,
99 .dev.coherent_dma_mask = 0xffffffffULL,
100 .resource = (struct resource[]) {
101 {
102 .start = 0x1000,
103 .end = 0x10ff,
104 .flags = IORESOURCE_MEM,
105 },
106 {
107 .start = MPC52xx_USB_IRQ,
108 .end = MPC52xx_USB_IRQ,
109 .flags = IORESOURCE_IRQ,
110 },
111 },
112 },
113 [MPC52xx_BDLC] = {
114 .name = "mpc52xx-bdlc",
115 .id = -1,
116 .num_resources = 2,
117 .resource = (struct resource[]) {
118 {
119 .start = 0x1300,
120 .end = 0x130f,
121 .flags = IORESOURCE_MEM,
122 },
123 {
124 .start = MPC52xx_BDLC_IRQ,
125 .end = MPC52xx_BDLC_IRQ,
126 .flags = IORESOURCE_IRQ,
127 },
128 },
129 },
130 [MPC52xx_PSC1] = {
131 .name = "mpc52xx-psc",
132 .id = 0,
133 .num_resources = 2,
134 .resource = (struct resource[]) {
135 {
136 .start = 0x2000,
137 .end = 0x209f,
138 .flags = IORESOURCE_MEM,
139 },
140 {
141 .start = MPC52xx_PSC1_IRQ,
142 .end = MPC52xx_PSC1_IRQ,
143 .flags = IORESOURCE_IRQ,
144 },
145 },
146 },
147 [MPC52xx_PSC2] = {
148 .name = "mpc52xx-psc",
149 .id = 1,
150 .num_resources = 2,
151 .resource = (struct resource[]) {
152 {
153 .start = 0x2200,
154 .end = 0x229f,
155 .flags = IORESOURCE_MEM,
156 },
157 {
158 .start = MPC52xx_PSC2_IRQ,
159 .end = MPC52xx_PSC2_IRQ,
160 .flags = IORESOURCE_IRQ,
161 },
162 },
163 },
164 [MPC52xx_PSC3] = {
165 .name = "mpc52xx-psc",
166 .id = 2,
167 .num_resources = 2,
168 .resource = (struct resource[]) {
169 {
170 .start = 0x2400,
171 .end = 0x249f,
172 .flags = IORESOURCE_MEM,
173 },
174 {
175 .start = MPC52xx_PSC3_IRQ,
176 .end = MPC52xx_PSC3_IRQ,
177 .flags = IORESOURCE_IRQ,
178 },
179 },
180 },
181 [MPC52xx_PSC4] = {
182 .name = "mpc52xx-psc",
183 .id = 3,
184 .num_resources = 2,
185 .resource = (struct resource[]) {
186 {
187 .start = 0x2600,
188 .end = 0x269f,
189 .flags = IORESOURCE_MEM,
190 },
191 {
192 .start = MPC52xx_PSC4_IRQ,
193 .end = MPC52xx_PSC4_IRQ,
194 .flags = IORESOURCE_IRQ,
195 },
196 },
197 },
198 [MPC52xx_PSC5] = {
199 .name = "mpc52xx-psc",
200 .id = 4,
201 .num_resources = 2,
202 .resource = (struct resource[]) {
203 {
204 .start = 0x2800,
205 .end = 0x289f,
206 .flags = IORESOURCE_MEM,
207 },
208 {
209 .start = MPC52xx_PSC5_IRQ,
210 .end = MPC52xx_PSC5_IRQ,
211 .flags = IORESOURCE_IRQ,
212 },
213 },
214 },
215 [MPC52xx_PSC6] = {
216 .name = "mpc52xx-psc",
217 .id = 5,
218 .num_resources = 2,
219 .resource = (struct resource[]) {
220 {
221 .start = 0x2c00,
222 .end = 0x2c9f,
223 .flags = IORESOURCE_MEM,
224 },
225 {
226 .start = MPC52xx_PSC6_IRQ,
227 .end = MPC52xx_PSC6_IRQ,
228 .flags = IORESOURCE_IRQ,
229 },
230 },
231 },
232 [MPC52xx_FEC] = {
233 .name = "mpc52xx-fec",
234 .id = -1,
235 .num_resources = 2,
236 .resource = (struct resource[]) {
237 {
238 .start = 0x3000,
239 .end = 0x33ff,
240 .flags = IORESOURCE_MEM,
241 },
242 {
243 .start = MPC52xx_FEC_IRQ,
244 .end = MPC52xx_FEC_IRQ,
245 .flags = IORESOURCE_IRQ,
246 },
247 },
248 },
249 [MPC52xx_ATA] = {
250 .name = "mpc52xx-ata",
251 .id = -1,
252 .num_resources = 2,
253 .resource = (struct resource[]) {
254 {
255 .start = 0x3a00,
256 .end = 0x3aff,
257 .flags = IORESOURCE_MEM,
258 },
259 {
260 .start = MPC52xx_ATA_IRQ,
261 .end = MPC52xx_ATA_IRQ,
262 .flags = IORESOURCE_IRQ,
263 },
264 },
265 },
266 [MPC52xx_I2C1] = {
267 .name = "fsl-i2c",
268 .id = 0,
269 .dev.platform_data = &mpc52xx_fsl_i2c_pdata,
270 .num_resources = 2,
271 .resource = (struct resource[]) {
272 {
273 .start = 0x3d00,
274 .end = 0x3d1f,
275 .flags = IORESOURCE_MEM,
276 },
277 {
278 .start = MPC52xx_I2C1_IRQ,
279 .end = MPC52xx_I2C1_IRQ,
280 .flags = IORESOURCE_IRQ,
281 },
282 },
283 },
284 [MPC52xx_I2C2] = {
285 .name = "fsl-i2c",
286 .id = 1,
287 .dev.platform_data = &mpc52xx_fsl_i2c_pdata,
288 .num_resources = 2,
289 .resource = (struct resource[]) {
290 {
291 .start = 0x3d40,
292 .end = 0x3d5f,
293 .flags = IORESOURCE_MEM,
294 },
295 {
296 .start = MPC52xx_I2C2_IRQ,
297 .end = MPC52xx_I2C2_IRQ,
298 .flags = IORESOURCE_IRQ,
299 },
300 },
301 },
302};
303
304
305static int __init mach_mpc52xx_fixup(struct platform_device *pdev)
306{
307 ppc_sys_fixup_mem_resource(pdev, MPC52xx_MBAR);
308 return 0;
309}
310
311static int __init mach_mpc52xx_init(void)
312{
313 ppc_sys_device_fixup = mach_mpc52xx_fixup;
314 return 0;
315}
316
317postcore_initcall(mach_mpc52xx_init);
diff --git a/arch/ppc/syslib/mpc52xx_pci.c b/arch/ppc/syslib/mpc52xx_pci.c
deleted file mode 100644
index 20a0eac0dc3a..000000000000
--- a/arch/ppc/syslib/mpc52xx_pci.c
+++ /dev/null
@@ -1,289 +0,0 @@
1/*
2 * PCI code for the Freescale MPC52xx embedded CPU.
3 *
4 *
5 * Maintainer : Sylvain Munaut <tnt@246tNt.com>
6 *
7 * Copyright (C) 2004 Sylvain Munaut <tnt@246tNt.com>
8 *
9 * This file is licensed under the terms of the GNU General Public License
10 * version 2. This program is licensed "as is" without any warranty of any
11 * kind, whether express or implied.
12 */
13
14
15#include <asm/pci.h>
16
17#include <asm/mpc52xx.h>
18#include "mpc52xx_pci.h"
19
20#include <asm/delay.h>
21#include <asm/machdep.h>
22
23
24/* This macro is defined to activate the workaround for the bug
25 435 of the MPC5200 (L25R). With it activated, we don't do any
26 32 bits configuration access during type-1 cycles */
27#define MPC5200_BUG_435_WORKAROUND
28
29
30static int
31mpc52xx_pci_read_config(struct pci_bus *bus, unsigned int devfn,
32 int offset, int len, u32 *val)
33{
34 struct pci_controller *hose = bus->sysdata;
35 u32 value;
36
37 if (ppc_md.pci_exclude_device)
38 if (ppc_md.pci_exclude_device(bus->number, devfn))
39 return PCIBIOS_DEVICE_NOT_FOUND;
40
41 out_be32(hose->cfg_addr,
42 (1 << 31) |
43 ((bus->number - hose->bus_offset) << 16) |
44 (devfn << 8) |
45 (offset & 0xfc));
46 mb();
47
48#ifdef MPC5200_BUG_435_WORKAROUND
49 if (bus->number != hose->bus_offset) {
50 switch (len) {
51 case 1:
52 value = in_8(((u8 __iomem *)hose->cfg_data) + (offset & 3));
53 break;
54 case 2:
55 value = in_le16(((u16 __iomem *)hose->cfg_data) + ((offset>>1) & 1));
56 break;
57
58 default:
59 value = in_le16((u16 __iomem *)hose->cfg_data) |
60 (in_le16(((u16 __iomem *)hose->cfg_data) + 1) << 16);
61 break;
62 }
63 }
64 else
65#endif
66 {
67 value = in_le32(hose->cfg_data);
68
69 if (len != 4) {
70 value >>= ((offset & 0x3) << 3);
71 value &= 0xffffffff >> (32 - (len << 3));
72 }
73 }
74
75 *val = value;
76
77 out_be32(hose->cfg_addr, 0);
78 mb();
79
80 return PCIBIOS_SUCCESSFUL;
81}
82
83static int
84mpc52xx_pci_write_config(struct pci_bus *bus, unsigned int devfn,
85 int offset, int len, u32 val)
86{
87 struct pci_controller *hose = bus->sysdata;
88 u32 value, mask;
89
90 if (ppc_md.pci_exclude_device)
91 if (ppc_md.pci_exclude_device(bus->number, devfn))
92 return PCIBIOS_DEVICE_NOT_FOUND;
93
94 out_be32(hose->cfg_addr,
95 (1 << 31) |
96 ((bus->number - hose->bus_offset) << 16) |
97 (devfn << 8) |
98 (offset & 0xfc));
99 mb();
100
101#ifdef MPC5200_BUG_435_WORKAROUND
102 if (bus->number != hose->bus_offset) {
103 switch (len) {
104 case 1:
105 out_8(((u8 __iomem *)hose->cfg_data) +
106 (offset & 3), val);
107 break;
108 case 2:
109 out_le16(((u16 __iomem *)hose->cfg_data) +
110 ((offset>>1) & 1), val);
111 break;
112
113 default:
114 out_le16((u16 __iomem *)hose->cfg_data,
115 (u16)val);
116 out_le16(((u16 __iomem *)hose->cfg_data) + 1,
117 (u16)(val>>16));
118 break;
119 }
120 }
121 else
122#endif
123 {
124 if (len != 4) {
125 value = in_le32(hose->cfg_data);
126
127 offset = (offset & 0x3) << 3;
128 mask = (0xffffffff >> (32 - (len << 3)));
129 mask <<= offset;
130
131 value &= ~mask;
132 val = value | ((val << offset) & mask);
133 }
134
135 out_le32(hose->cfg_data, val);
136 }
137 mb();
138
139 out_be32(hose->cfg_addr, 0);
140 mb();
141
142 return PCIBIOS_SUCCESSFUL;
143}
144
145static struct pci_ops mpc52xx_pci_ops = {
146 .read = mpc52xx_pci_read_config,
147 .write = mpc52xx_pci_write_config
148};
149
150
151static void __init
152mpc52xx_pci_setup(struct mpc52xx_pci __iomem *pci_regs)
153{
154 u32 tmp;
155
156 /* Setup control regs */
157 tmp = in_be32(&pci_regs->scr);
158 tmp |= PCI_COMMAND_MASTER | PCI_COMMAND_MEMORY;
159 out_be32(&pci_regs->scr, tmp);
160
161 /* Setup windows */
162 out_be32(&pci_regs->iw0btar, MPC52xx_PCI_IWBTAR_TRANSLATION(
163 MPC52xx_PCI_MEM_START + MPC52xx_PCI_MEM_OFFSET,
164 MPC52xx_PCI_MEM_START,
165 MPC52xx_PCI_MEM_SIZE ));
166
167 out_be32(&pci_regs->iw1btar, MPC52xx_PCI_IWBTAR_TRANSLATION(
168 MPC52xx_PCI_MMIO_START + MPC52xx_PCI_MEM_OFFSET,
169 MPC52xx_PCI_MMIO_START,
170 MPC52xx_PCI_MMIO_SIZE ));
171
172 out_be32(&pci_regs->iw2btar, MPC52xx_PCI_IWBTAR_TRANSLATION(
173 MPC52xx_PCI_IO_BASE,
174 MPC52xx_PCI_IO_START,
175 MPC52xx_PCI_IO_SIZE ));
176
177 out_be32(&pci_regs->iwcr, MPC52xx_PCI_IWCR_PACK(
178 ( MPC52xx_PCI_IWCR_ENABLE | /* iw0btar */
179 MPC52xx_PCI_IWCR_READ_MULTI |
180 MPC52xx_PCI_IWCR_MEM ),
181 ( MPC52xx_PCI_IWCR_ENABLE | /* iw1btar */
182 MPC52xx_PCI_IWCR_READ |
183 MPC52xx_PCI_IWCR_MEM ),
184 ( MPC52xx_PCI_IWCR_ENABLE | /* iw2btar */
185 MPC52xx_PCI_IWCR_IO )
186 ));
187
188
189 out_be32(&pci_regs->tbatr0,
190 MPC52xx_PCI_TBATR_ENABLE | MPC52xx_PCI_TARGET_IO );
191 out_be32(&pci_regs->tbatr1,
192 MPC52xx_PCI_TBATR_ENABLE | MPC52xx_PCI_TARGET_MEM );
193
194 out_be32(&pci_regs->tcr, MPC52xx_PCI_TCR_LD);
195
196 /* Reset the exteral bus ( internal PCI controller is NOT resetted ) */
197 /* Not necessary and can be a bad thing if for example the bootloader
198 is displaying a splash screen or ... Just left here for
199 documentation purpose if anyone need it */
200 tmp = in_be32(&pci_regs->gscr);
201#if 0
202 out_be32(&pci_regs->gscr, tmp | MPC52xx_PCI_GSCR_PR);
203 udelay(50);
204#endif
205 out_be32(&pci_regs->gscr, tmp & ~MPC52xx_PCI_GSCR_PR);
206}
207
208static void
209mpc52xx_pci_fixup_resources(struct pci_dev *dev)
210{
211 int i;
212
213 /* We don't rely on boot loader for PCI and resets all
214 devices */
215 for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
216 struct resource *res = &dev->resource[i];
217 if (res->end > res->start) { /* Only valid resources */
218 res->end -= res->start;
219 res->start = 0;
220 res->flags |= IORESOURCE_UNSET;
221 }
222 }
223
224 /* The PCI Host bridge of MPC52xx has a prefetch memory resource
225 fixed to 1Gb. Doesn't fit in the resource system so we remove it */
226 if ( (dev->vendor == PCI_VENDOR_ID_MOTOROLA) &&
227 ( dev->device == PCI_DEVICE_ID_MOTOROLA_MPC5200
228 || dev->device == PCI_DEVICE_ID_MOTOROLA_MPC5200B) ) {
229 struct resource *res = &dev->resource[1];
230 res->start = res->end = res->flags = 0;
231 }
232}
233
234void __init
235mpc52xx_find_bridges(void)
236{
237 struct mpc52xx_pci __iomem *pci_regs;
238 struct pci_controller *hose;
239
240 pci_assign_all_buses = 1;
241
242 pci_regs = ioremap(MPC52xx_PA(MPC52xx_PCI_OFFSET), MPC52xx_PCI_SIZE);
243 if (!pci_regs)
244 return;
245
246 hose = pcibios_alloc_controller();
247 if (!hose) {
248 iounmap(pci_regs);
249 return;
250 }
251
252 ppc_md.pci_swizzle = common_swizzle;
253 ppc_md.pcibios_fixup_resources = mpc52xx_pci_fixup_resources;
254
255 hose->first_busno = 0;
256 hose->last_busno = 0xff;
257 hose->bus_offset = 0;
258 hose->ops = &mpc52xx_pci_ops;
259
260 mpc52xx_pci_setup(pci_regs);
261
262 hose->pci_mem_offset = MPC52xx_PCI_MEM_OFFSET;
263
264 hose->io_base_virt = ioremap(MPC52xx_PCI_IO_BASE, MPC52xx_PCI_IO_SIZE);
265 isa_io_base = (unsigned long) hose->io_base_virt;
266
267 hose->cfg_addr = &pci_regs->car;
268 hose->cfg_data = hose->io_base_virt;
269
270 /* Setup resources */
271 pci_init_resource(&hose->mem_resources[0],
272 MPC52xx_PCI_MEM_START,
273 MPC52xx_PCI_MEM_STOP,
274 IORESOURCE_MEM|IORESOURCE_PREFETCH,
275 "PCI prefetchable memory");
276
277 pci_init_resource(&hose->mem_resources[1],
278 MPC52xx_PCI_MMIO_START,
279 MPC52xx_PCI_MMIO_STOP,
280 IORESOURCE_MEM,
281 "PCI memory");
282
283 pci_init_resource(&hose->io_resource,
284 MPC52xx_PCI_IO_START,
285 MPC52xx_PCI_IO_STOP,
286 IORESOURCE_IO,
287 "PCI I/O");
288
289}
diff --git a/arch/ppc/syslib/mpc52xx_pci.h b/arch/ppc/syslib/mpc52xx_pci.h
deleted file mode 100644
index 77d47dbba85e..000000000000
--- a/arch/ppc/syslib/mpc52xx_pci.h
+++ /dev/null
@@ -1,137 +0,0 @@
1/*
2 * PCI Include file the Freescale MPC52xx embedded cpu chips
3 *
4 *
5 * Maintainer : Sylvain Munaut <tnt@246tNt.com>
6 *
7 * Inspired from code written by Dale Farnsworth <dfarnsworth@mvista.com>
8 * for the 2.4 kernel.
9 *
10 * Copyright (C) 2004 Sylvain Munaut <tnt@246tNt.com>
11 * Copyright (C) 2003 MontaVista, Software, Inc.
12 *
13 * This file is licensed under the terms of the GNU General Public License
14 * version 2. This program is licensed "as is" without any warranty of any
15 * kind, whether express or implied.
16 */
17
18#ifndef __SYSLIB_MPC52xx_PCI_H__
19#define __SYSLIB_MPC52xx_PCI_H__
20
21/* ======================================================================== */
22/* PCI windows config */
23/* ======================================================================== */
24
25/*
26 * Master windows : MPC52xx -> PCI
27 *
28 * 0x80000000 -> 0x9FFFFFFF PCI Mem prefetchable IW0BTAR
29 * 0xA0000000 -> 0xAFFFFFFF PCI Mem IW1BTAR
30 * 0xB0000000 -> 0xB0FFFFFF PCI IO IW2BTAR
31 *
32 * Slave windows : PCI -> MPC52xx
33 *
34 * 0xF0000000 -> 0xF003FFFF MPC52xx MBAR TBATR0
35 * 0x00000000 -> 0x3FFFFFFF MPC52xx local memory TBATR1
36 */
37
38#define MPC52xx_PCI_MEM_OFFSET 0x00000000 /* Offset for MEM MMIO */
39
40#define MPC52xx_PCI_MEM_START 0x80000000
41#define MPC52xx_PCI_MEM_SIZE 0x20000000
42#define MPC52xx_PCI_MEM_STOP (MPC52xx_PCI_MEM_START+MPC52xx_PCI_MEM_SIZE-1)
43
44#define MPC52xx_PCI_MMIO_START 0xa0000000
45#define MPC52xx_PCI_MMIO_SIZE 0x10000000
46#define MPC52xx_PCI_MMIO_STOP (MPC52xx_PCI_MMIO_START+MPC52xx_PCI_MMIO_SIZE-1)
47
48#define MPC52xx_PCI_IO_BASE 0xb0000000
49
50#define MPC52xx_PCI_IO_START 0x00000000
51#define MPC52xx_PCI_IO_SIZE 0x01000000
52#define MPC52xx_PCI_IO_STOP (MPC52xx_PCI_IO_START+MPC52xx_PCI_IO_SIZE-1)
53
54
55#define MPC52xx_PCI_TARGET_IO MPC52xx_MBAR
56#define MPC52xx_PCI_TARGET_MEM 0x00000000
57
58
59/* ======================================================================== */
60/* Structures mapping & Defines for PCI Unit */
61/* ======================================================================== */
62
63#define MPC52xx_PCI_GSCR_BM 0x40000000
64#define MPC52xx_PCI_GSCR_PE 0x20000000
65#define MPC52xx_PCI_GSCR_SE 0x10000000
66#define MPC52xx_PCI_GSCR_XLB2PCI_MASK 0x07000000
67#define MPC52xx_PCI_GSCR_XLB2PCI_SHIFT 24
68#define MPC52xx_PCI_GSCR_IPG2PCI_MASK 0x00070000
69#define MPC52xx_PCI_GSCR_IPG2PCI_SHIFT 16
70#define MPC52xx_PCI_GSCR_BME 0x00004000
71#define MPC52xx_PCI_GSCR_PEE 0x00002000
72#define MPC52xx_PCI_GSCR_SEE 0x00001000
73#define MPC52xx_PCI_GSCR_PR 0x00000001
74
75
76#define MPC52xx_PCI_IWBTAR_TRANSLATION(proc_ad,pci_ad,size) \
77 ( ( (proc_ad) & 0xff000000 ) | \
78 ( (((size) - 1) >> 8) & 0x00ff0000 ) | \
79 ( ((pci_ad) >> 16) & 0x0000ff00 ) )
80
81#define MPC52xx_PCI_IWCR_PACK(win0,win1,win2) (((win0) << 24) | \
82 ((win1) << 16) | \
83 ((win2) << 8))
84
85#define MPC52xx_PCI_IWCR_DISABLE 0x0
86#define MPC52xx_PCI_IWCR_ENABLE 0x1
87#define MPC52xx_PCI_IWCR_READ 0x0
88#define MPC52xx_PCI_IWCR_READ_LINE 0x2
89#define MPC52xx_PCI_IWCR_READ_MULTI 0x4
90#define MPC52xx_PCI_IWCR_MEM 0x0
91#define MPC52xx_PCI_IWCR_IO 0x8
92
93#define MPC52xx_PCI_TCR_P 0x01000000
94#define MPC52xx_PCI_TCR_LD 0x00010000
95
96#define MPC52xx_PCI_TBATR_DISABLE 0x0
97#define MPC52xx_PCI_TBATR_ENABLE 0x1
98
99
100#ifndef __ASSEMBLY__
101
102struct mpc52xx_pci {
103 u32 idr; /* PCI + 0x00 */
104 u32 scr; /* PCI + 0x04 */
105 u32 ccrir; /* PCI + 0x08 */
106 u32 cr1; /* PCI + 0x0C */
107 u32 bar0; /* PCI + 0x10 */
108 u32 bar1; /* PCI + 0x14 */
109 u8 reserved1[16]; /* PCI + 0x18 */
110 u32 ccpr; /* PCI + 0x28 */
111 u32 sid; /* PCI + 0x2C */
112 u32 erbar; /* PCI + 0x30 */
113 u32 cpr; /* PCI + 0x34 */
114 u8 reserved2[4]; /* PCI + 0x38 */
115 u32 cr2; /* PCI + 0x3C */
116 u8 reserved3[32]; /* PCI + 0x40 */
117 u32 gscr; /* PCI + 0x60 */
118 u32 tbatr0; /* PCI + 0x64 */
119 u32 tbatr1; /* PCI + 0x68 */
120 u32 tcr; /* PCI + 0x6C */
121 u32 iw0btar; /* PCI + 0x70 */
122 u32 iw1btar; /* PCI + 0x74 */
123 u32 iw2btar; /* PCI + 0x78 */
124 u8 reserved4[4]; /* PCI + 0x7C */
125 u32 iwcr; /* PCI + 0x80 */
126 u32 icr; /* PCI + 0x84 */
127 u32 isr; /* PCI + 0x88 */
128 u32 arb; /* PCI + 0x8C */
129 u8 reserved5[104]; /* PCI + 0x90 */
130 u32 car; /* PCI + 0xF8 */
131 u8 reserved6[4]; /* PCI + 0xFC */
132};
133
134#endif /* __ASSEMBLY__ */
135
136
137#endif /* __SYSLIB_MPC52xx_PCI_H__ */
diff --git a/arch/ppc/syslib/mpc52xx_pic.c b/arch/ppc/syslib/mpc52xx_pic.c
deleted file mode 100644
index f58149c03b0f..000000000000
--- a/arch/ppc/syslib/mpc52xx_pic.c
+++ /dev/null
@@ -1,254 +0,0 @@
1/*
2 * Programmable Interrupt Controller functions for the Freescale MPC52xx
3 * embedded CPU.
4 *
5 *
6 * Maintainer : Sylvain Munaut <tnt@246tNt.com>
7 *
8 * Based on (well, mostly copied from) the code from the 2.4 kernel by
9 * Dale Farnsworth <dfarnsworth@mvista.com> and Kent Borg.
10 *
11 * Copyright (C) 2004 Sylvain Munaut <tnt@246tNt.com>
12 * Copyright (C) 2003 Montavista Software, Inc
13 *
14 * This file is licensed under the terms of the GNU General Public License
15 * version 2. This program is licensed "as is" without any warranty of any
16 * kind, whether express or implied.
17 */
18
19#include <linux/stddef.h>
20#include <linux/init.h>
21#include <linux/sched.h>
22#include <linux/signal.h>
23#include <linux/delay.h>
24#include <linux/irq.h>
25
26#include <asm/io.h>
27#include <asm/processor.h>
28#include <asm/system.h>
29#include <asm/irq.h>
30#include <asm/mpc52xx.h>
31
32
33static struct mpc52xx_intr __iomem *intr;
34static struct mpc52xx_sdma __iomem *sdma;
35
36static void
37mpc52xx_ic_disable(unsigned int irq)
38{
39 u32 val;
40
41 if (irq == MPC52xx_IRQ0) {
42 val = in_be32(&intr->ctrl);
43 val &= ~(1 << 11);
44 out_be32(&intr->ctrl, val);
45 }
46 else if (irq < MPC52xx_IRQ1) {
47 BUG();
48 }
49 else if (irq <= MPC52xx_IRQ3) {
50 val = in_be32(&intr->ctrl);
51 val &= ~(1 << (10 - (irq - MPC52xx_IRQ1)));
52 out_be32(&intr->ctrl, val);
53 }
54 else if (irq < MPC52xx_SDMA_IRQ_BASE) {
55 val = in_be32(&intr->main_mask);
56 val |= 1 << (16 - (irq - MPC52xx_MAIN_IRQ_BASE));
57 out_be32(&intr->main_mask, val);
58 }
59 else if (irq < MPC52xx_PERP_IRQ_BASE) {
60 val = in_be32(&sdma->IntMask);
61 val |= 1 << (irq - MPC52xx_SDMA_IRQ_BASE);
62 out_be32(&sdma->IntMask, val);
63 }
64 else {
65 val = in_be32(&intr->per_mask);
66 val |= 1 << (31 - (irq - MPC52xx_PERP_IRQ_BASE));
67 out_be32(&intr->per_mask, val);
68 }
69}
70
71static void
72mpc52xx_ic_enable(unsigned int irq)
73{
74 u32 val;
75
76 if (irq == MPC52xx_IRQ0) {
77 val = in_be32(&intr->ctrl);
78 val |= 1 << 11;
79 out_be32(&intr->ctrl, val);
80 }
81 else if (irq < MPC52xx_IRQ1) {
82 BUG();
83 }
84 else if (irq <= MPC52xx_IRQ3) {
85 val = in_be32(&intr->ctrl);
86 val |= 1 << (10 - (irq - MPC52xx_IRQ1));
87 out_be32(&intr->ctrl, val);
88 }
89 else if (irq < MPC52xx_SDMA_IRQ_BASE) {
90 val = in_be32(&intr->main_mask);
91 val &= ~(1 << (16 - (irq - MPC52xx_MAIN_IRQ_BASE)));
92 out_be32(&intr->main_mask, val);
93 }
94 else if (irq < MPC52xx_PERP_IRQ_BASE) {
95 val = in_be32(&sdma->IntMask);
96 val &= ~(1 << (irq - MPC52xx_SDMA_IRQ_BASE));
97 out_be32(&sdma->IntMask, val);
98 }
99 else {
100 val = in_be32(&intr->per_mask);
101 val &= ~(1 << (31 - (irq - MPC52xx_PERP_IRQ_BASE)));
102 out_be32(&intr->per_mask, val);
103 }
104}
105
106static void
107mpc52xx_ic_ack(unsigned int irq)
108{
109 u32 val;
110
111 /*
112 * Only some irqs are reset here, others in interrupting hardware.
113 */
114
115 switch (irq) {
116 case MPC52xx_IRQ0:
117 val = in_be32(&intr->ctrl);
118 val |= 0x08000000;
119 out_be32(&intr->ctrl, val);
120 break;
121 case MPC52xx_CCS_IRQ:
122 val = in_be32(&intr->enc_status);
123 val |= 0x00000400;
124 out_be32(&intr->enc_status, val);
125 break;
126 case MPC52xx_IRQ1:
127 val = in_be32(&intr->ctrl);
128 val |= 0x04000000;
129 out_be32(&intr->ctrl, val);
130 break;
131 case MPC52xx_IRQ2:
132 val = in_be32(&intr->ctrl);
133 val |= 0x02000000;
134 out_be32(&intr->ctrl, val);
135 break;
136 case MPC52xx_IRQ3:
137 val = in_be32(&intr->ctrl);
138 val |= 0x01000000;
139 out_be32(&intr->ctrl, val);
140 break;
141 default:
142 if (irq >= MPC52xx_SDMA_IRQ_BASE
143 && irq < (MPC52xx_SDMA_IRQ_BASE + MPC52xx_SDMA_IRQ_NUM)) {
144 out_be32(&sdma->IntPend,
145 1 << (irq - MPC52xx_SDMA_IRQ_BASE));
146 }
147 break;
148 }
149}
150
151static void
152mpc52xx_ic_disable_and_ack(unsigned int irq)
153{
154 mpc52xx_ic_disable(irq);
155 mpc52xx_ic_ack(irq);
156}
157
158static void
159mpc52xx_ic_end(unsigned int irq)
160{
161 if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS)))
162 mpc52xx_ic_enable(irq);
163}
164
165static struct hw_interrupt_type mpc52xx_ic = {
166 .typename = " MPC52xx ",
167 .enable = mpc52xx_ic_enable,
168 .disable = mpc52xx_ic_disable,
169 .ack = mpc52xx_ic_disable_and_ack,
170 .end = mpc52xx_ic_end,
171};
172
173void __init
174mpc52xx_init_irq(void)
175{
176 int i;
177 u32 intr_ctrl;
178
179 /* Remap the necessary zones */
180 intr = ioremap(MPC52xx_PA(MPC52xx_INTR_OFFSET), MPC52xx_INTR_SIZE);
181 sdma = ioremap(MPC52xx_PA(MPC52xx_SDMA_OFFSET), MPC52xx_SDMA_SIZE);
182
183 if ((intr==NULL) || (sdma==NULL))
184 panic("Can't ioremap PIC/SDMA register for init_irq !");
185
186 /* Disable all interrupt sources. */
187 out_be32(&sdma->IntPend, 0xffffffff); /* 1 means clear pending */
188 out_be32(&sdma->IntMask, 0xffffffff); /* 1 means disabled */
189 out_be32(&intr->per_mask, 0x7ffffc00); /* 1 means disabled */
190 out_be32(&intr->main_mask, 0x00010fff); /* 1 means disabled */
191 intr_ctrl = in_be32(&intr->ctrl);
192 intr_ctrl &= 0x00ff0000; /* Keeps IRQ[0-3] config */
193 intr_ctrl |= 0x0f000000 | /* clear IRQ 0-3 */
194 0x00001000 | /* MEE master external enable */
195 0x00000000 | /* 0 means disable IRQ 0-3 */
196 0x00000001; /* CEb route critical normally */
197 out_be32(&intr->ctrl, intr_ctrl);
198
199 /* Zero a bunch of the priority settings. */
200 out_be32(&intr->per_pri1, 0);
201 out_be32(&intr->per_pri2, 0);
202 out_be32(&intr->per_pri3, 0);
203 out_be32(&intr->main_pri1, 0);
204 out_be32(&intr->main_pri2, 0);
205
206 /* Initialize irq_desc[i].chip's with mpc52xx_ic. */
207 for (i = 0; i < NR_IRQS; i++) {
208 irq_desc[i].chip = &mpc52xx_ic;
209 irq_desc[i].status = IRQ_LEVEL;
210 }
211
212 #define IRQn_MODE(intr_ctrl,irq) (((intr_ctrl) >> (22-(i<<1))) & 0x03)
213 for (i=0 ; i<4 ; i++) {
214 int mode;
215 mode = IRQn_MODE(intr_ctrl,i);
216 if ((mode == 0x1) || (mode == 0x2))
217 irq_desc[i?MPC52xx_IRQ1+i-1:MPC52xx_IRQ0].status = 0;
218 }
219}
220
221int
222mpc52xx_get_irq(void)
223{
224 u32 status;
225 int irq = -1;
226
227 status = in_be32(&intr->enc_status);
228
229 if (status & 0x00000400) { /* critical */
230 irq = (status >> 8) & 0x3;
231 if (irq == 2) /* high priority peripheral */
232 goto peripheral;
233 irq += MPC52xx_CRIT_IRQ_BASE;
234 }
235 else if (status & 0x00200000) { /* main */
236 irq = (status >> 16) & 0x1f;
237 if (irq == 4) /* low priority peripheral */
238 goto peripheral;
239 irq += MPC52xx_MAIN_IRQ_BASE;
240 }
241 else if (status & 0x20000000) { /* peripheral */
242peripheral:
243 irq = (status >> 24) & 0x1f;
244 if (irq == 0) { /* bestcomm */
245 status = in_be32(&sdma->IntPend);
246 irq = ffs(status) + MPC52xx_SDMA_IRQ_BASE-1;
247 }
248 else
249 irq += MPC52xx_PERP_IRQ_BASE;
250 }
251
252 return irq;
253}
254
diff --git a/arch/ppc/syslib/mpc52xx_setup.c b/arch/ppc/syslib/mpc52xx_setup.c
deleted file mode 100644
index ab0cf4ced9e5..000000000000
--- a/arch/ppc/syslib/mpc52xx_setup.c
+++ /dev/null
@@ -1,313 +0,0 @@
1/*
2 * Common code for the boards based on Freescale MPC52xx embedded CPU.
3 *
4 *
5 * Maintainer : Sylvain Munaut <tnt@246tNt.com>
6 *
7 * Support for other bootloaders than UBoot by Dale Farnsworth
8 * <dfarnsworth@mvista.com>
9 *
10 * Copyright (C) 2004 Sylvain Munaut <tnt@246tNt.com>
11 * Copyright (C) 2003 Montavista Software, Inc
12 *
13 * This file is licensed under the terms of the GNU General Public License
14 * version 2. This program is licensed "as is" without any warranty of any
15 * kind, whether express or implied.
16 */
17
18
19#include <linux/spinlock.h>
20#include <asm/io.h>
21#include <asm/time.h>
22#include <asm/mpc52xx.h>
23#include <asm/mpc52xx_psc.h>
24#include <asm/pgtable.h>
25#include <asm/ppcboot.h>
26
27#include <syslib/mpc52xx_pci.h>
28
29extern bd_t __res;
30
31static int core_mult[] = { /* CPU Frequency multiplier, taken */
32 0, 0, 0, 10, 20, 20, 25, 45, /* from the datasheet used to compute */
33 30, 55, 40, 50, 0, 60, 35, 0, /* CPU frequency from XLB freq and */
34 30, 25, 65, 10, 70, 20, 75, 45, /* external jumper config */
35 0, 55, 40, 50, 80, 60, 35, 0
36};
37
38void
39mpc52xx_restart(char *cmd)
40{
41 struct mpc52xx_gpt __iomem *gpt0 = MPC52xx_VA(MPC52xx_GPTx_OFFSET(0));
42
43 local_irq_disable();
44
45 /* Turn on the watchdog and wait for it to expire. It effectively
46 does a reset */
47 out_be32(&gpt0->count, 0x000000ff);
48 out_be32(&gpt0->mode, 0x00009004);
49
50 while (1);
51}
52
53void
54mpc52xx_halt(void)
55{
56 local_irq_disable();
57
58 while (1);
59}
60
61void
62mpc52xx_power_off(void)
63{
64 /* By default we don't have any way of shut down.
65 If a specific board wants to, it can set the power down
66 code to any hardware implementation dependent code */
67 mpc52xx_halt();
68}
69
70
71void __init
72mpc52xx_set_bat(void)
73{
74 /* Set BAT 2 to map the 0xf0000000 area */
75 /* This mapping is used during mpc52xx_progress,
76 * mpc52xx_find_end_of_memory, and UARTs/GPIO access for debug
77 */
78 mb();
79 mtspr(SPRN_DBAT2U, 0xf0001ffe);
80 mtspr(SPRN_DBAT2L, 0xf000002a);
81 mb();
82}
83
84void __init
85mpc52xx_map_io(void)
86{
87 /* Here we map the MBAR and the whole upper zone. MBAR is only
88 64k but we can't map only 64k with BATs. Map the whole
89 0xf0000000 range is ok and helps eventual lpb devices placed there */
90 io_block_mapping(
91 MPC52xx_MBAR_VIRT, MPC52xx_MBAR, 0x10000000, _PAGE_IO);
92}
93
94
95#ifdef CONFIG_SERIAL_TEXT_DEBUG
96#ifndef MPC52xx_PF_CONSOLE_PORT
97#error "mpc52xx PSC for console not selected"
98#endif
99
100static void
101mpc52xx_psc_putc(struct mpc52xx_psc __iomem *psc, unsigned char c)
102{
103 while (!(in_be16(&psc->mpc52xx_psc_status) &
104 MPC52xx_PSC_SR_TXRDY));
105 out_8(&psc->mpc52xx_psc_buffer_8, c);
106}
107
108void
109mpc52xx_progress(char *s, unsigned short hex)
110{
111 char c;
112 struct mpc52xx_psc __iomem *psc;
113
114 psc = MPC52xx_VA(MPC52xx_PSCx_OFFSET(MPC52xx_PF_CONSOLE_PORT));
115
116 while ((c = *s++) != 0) {
117 if (c == '\n')
118 mpc52xx_psc_putc(psc, '\r');
119 mpc52xx_psc_putc(psc, c);
120 }
121
122 mpc52xx_psc_putc(psc, '\r');
123 mpc52xx_psc_putc(psc, '\n');
124}
125
126#endif /* CONFIG_SERIAL_TEXT_DEBUG */
127
128
129unsigned long __init
130mpc52xx_find_end_of_memory(void)
131{
132 u32 ramsize = __res.bi_memsize;
133
134 /*
135 * if bootloader passed a memsize, just use it
136 * else get size from sdram config registers
137 */
138 if (ramsize == 0) {
139 struct mpc52xx_mmap_ctl __iomem *mmap_ctl;
140 u32 sdram_config_0, sdram_config_1;
141
142 /* Temp BAT2 mapping active when this is called ! */
143 mmap_ctl = MPC52xx_VA(MPC52xx_MMAP_CTL_OFFSET);
144
145 sdram_config_0 = in_be32(&mmap_ctl->sdram0);
146 sdram_config_1 = in_be32(&mmap_ctl->sdram1);
147
148 if ((sdram_config_0 & 0x1f) >= 0x13)
149 ramsize = 1 << ((sdram_config_0 & 0xf) + 17);
150
151 if (((sdram_config_1 & 0x1f) >= 0x13) &&
152 ((sdram_config_1 & 0xfff00000) == ramsize))
153 ramsize += 1 << ((sdram_config_1 & 0xf) + 17);
154 }
155
156 return ramsize;
157}
158
159void __init
160mpc52xx_calibrate_decr(void)
161{
162 int current_time, previous_time;
163 int tbl_start, tbl_end;
164 unsigned int xlbfreq, cpufreq, ipbfreq, pcifreq, divisor;
165
166 xlbfreq = __res.bi_busfreq;
167 /* if bootloader didn't pass bus frequencies, calculate them */
168 if (xlbfreq == 0) {
169 /* Get RTC & Clock manager modules */
170 struct mpc52xx_rtc __iomem *rtc;
171 struct mpc52xx_cdm __iomem *cdm;
172
173 rtc = ioremap(MPC52xx_PA(MPC52xx_RTC_OFFSET), MPC52xx_RTC_SIZE);
174 cdm = ioremap(MPC52xx_PA(MPC52xx_CDM_OFFSET), MPC52xx_CDM_SIZE);
175
176 if ((rtc==NULL) || (cdm==NULL))
177 panic("Can't ioremap RTC/CDM while computing bus freq");
178
179 /* Count bus clock during 1/64 sec */
180 out_be32(&rtc->dividers, 0x8f1f0000); /* Set RTC 64x faster */
181 previous_time = in_be32(&rtc->time);
182 while ((current_time = in_be32(&rtc->time)) == previous_time) ;
183 tbl_start = get_tbl();
184 previous_time = current_time;
185 while ((current_time = in_be32(&rtc->time)) == previous_time) ;
186 tbl_end = get_tbl();
187 out_be32(&rtc->dividers, 0xffff0000); /* Restore RTC */
188
189 /* Compute all frequency from that & CDM settings */
190 xlbfreq = (tbl_end - tbl_start) << 8;
191 cpufreq = (xlbfreq * core_mult[in_be32(&cdm->rstcfg)&0x1f])/10;
192 ipbfreq = (in_8(&cdm->ipb_clk_sel) & 1) ?
193 xlbfreq / 2 : xlbfreq;
194 switch (in_8(&cdm->pci_clk_sel) & 3) {
195 case 0:
196 pcifreq = ipbfreq;
197 break;
198 case 1:
199 pcifreq = ipbfreq / 2;
200 break;
201 default:
202 pcifreq = xlbfreq / 4;
203 break;
204 }
205 __res.bi_busfreq = xlbfreq;
206 __res.bi_intfreq = cpufreq;
207 __res.bi_ipbfreq = ipbfreq;
208 __res.bi_pcifreq = pcifreq;
209
210 /* Release mapping */
211 iounmap(rtc);
212 iounmap(cdm);
213 }
214
215 divisor = 4;
216
217 tb_ticks_per_jiffy = xlbfreq / HZ / divisor;
218 tb_to_us = mulhwu_scale_factor(xlbfreq / divisor, 1000000);
219}
220
221
222void __init
223mpc52xx_setup_cpu(void)
224{
225 struct mpc52xx_cdm __iomem *cdm;
226 struct mpc52xx_xlb __iomem *xlb;
227
228 /* Map zones */
229 cdm = ioremap(MPC52xx_PA(MPC52xx_CDM_OFFSET), MPC52xx_CDM_SIZE);
230 xlb = ioremap(MPC52xx_PA(MPC52xx_XLB_OFFSET), MPC52xx_XLB_SIZE);
231
232 if (!cdm || !xlb) {
233 printk(KERN_ERR __FILE__ ": "
234 "Error while mapping CDM/XLB during "
235 "mpc52xx_setup_cpu\n");
236 goto unmap_regs;
237 }
238
239 /* Use internal 48 Mhz */
240 out_8(&cdm->ext_48mhz_en, 0x00);
241 out_8(&cdm->fd_enable, 0x01);
242 if (in_be32(&cdm->rstcfg) & 0x40) /* Assumes 33Mhz clock */
243 out_be16(&cdm->fd_counters, 0x0001);
244 else
245 out_be16(&cdm->fd_counters, 0x5555);
246
247 /* Configure the XLB Arbiter priorities */
248 out_be32(&xlb->master_pri_enable, 0xff);
249 out_be32(&xlb->master_priority, 0x11111111);
250
251 /* Enable ram snooping for 1GB window */
252 out_be32(&xlb->config, in_be32(&xlb->config) | MPC52xx_XLB_CFG_SNOOP);
253 out_be32(&xlb->snoop_window, MPC52xx_PCI_TARGET_MEM | 0x1d);
254
255 /* Disable XLB pipelining */
256 /* (cfr errata 292. We could do this only just before ATA PIO
257 transaction and re-enable it after ...) */
258 out_be32(&xlb->config, in_be32(&xlb->config) | MPC52xx_XLB_CFG_PLDIS);
259
260 /* Unmap reg zone */
261unmap_regs:
262 if (cdm) iounmap(cdm);
263 if (xlb) iounmap(xlb);
264}
265
266
267int mpc52xx_match_psc_function(int psc_idx, const char *func)
268{
269 struct mpc52xx_psc_func *cf = mpc52xx_psc_functions;
270
271 while ((cf->id != -1) && (cf->func != NULL)) {
272 if ((cf->id == psc_idx) && !strcmp(cf->func,func))
273 return 1;
274 cf++;
275 }
276
277 return 0;
278}
279
280int mpc52xx_set_psc_clkdiv(int psc_id, int clkdiv)
281{
282 static DEFINE_SPINLOCK(lock);
283 struct mpc52xx_cdm __iomem *cdm;
284 unsigned long flags;
285 u16 mclken_div;
286 u16 __iomem *reg;
287 u32 mask;
288
289 cdm = ioremap(MPC52xx_PA(MPC52xx_CDM_OFFSET), MPC52xx_CDM_SIZE);
290 if (!cdm) {
291 printk(KERN_ERR __FILE__ ": Error mapping CDM\n");
292 return -ENODEV;
293 }
294
295 mclken_div = 0x8000 | (clkdiv & 0x1FF);
296 switch (psc_id) {
297 case 1: reg = &cdm->mclken_div_psc1; mask = 0x20; break;
298 case 2: reg = &cdm->mclken_div_psc2; mask = 0x40; break;
299 case 3: reg = &cdm->mclken_div_psc3; mask = 0x80; break;
300 case 6: reg = &cdm->mclken_div_psc6; mask = 0x10; break;
301 default:
302 return -ENODEV;
303 }
304
305 /* Set the rate and enable the clock */
306 spin_lock_irqsave(&lock, flags);
307 out_be16(reg, mclken_div);
308 out_be32(&cdm->clk_enables, in_be32(&cdm->clk_enables) | mask);
309 spin_unlock_irqrestore(&lock, flags);
310
311 iounmap(cdm);
312 return 0;
313}
diff --git a/arch/ppc/syslib/mpc52xx_sys.c b/arch/ppc/syslib/mpc52xx_sys.c
deleted file mode 100644
index b4e6f978f057..000000000000
--- a/arch/ppc/syslib/mpc52xx_sys.c
+++ /dev/null
@@ -1,36 +0,0 @@
1/*
2 * Freescale MPC52xx system descriptions
3 *
4 *
5 * Maintainer : Sylvain Munaut <tnt@246tNt.com>
6 *
7 * Copyright (C) 2005 Sylvain Munaut <tnt@246tNt.com>
8 *
9 * This file is licensed under the terms of the GNU General Public License
10 * version 2. This program is licensed "as is" without any warranty of any
11 * kind, whether express or implied.
12 */
13
14#include <asm/ppc_sys.h>
15
16struct ppc_sys_spec *cur_ppc_sys_spec;
17struct ppc_sys_spec ppc_sys_specs[] = {
18 {
19 .ppc_sys_name = "5200",
20 .mask = 0xffff0000,
21 .value = 0x80110000,
22 .num_devices = 15,
23 .device_list = (enum ppc_sys_devices[])
24 {
25 MPC52xx_MSCAN1, MPC52xx_MSCAN2, MPC52xx_SPI,
26 MPC52xx_USB, MPC52xx_BDLC, MPC52xx_PSC1, MPC52xx_PSC2,
27 MPC52xx_PSC3, MPC52xx_PSC4, MPC52xx_PSC5, MPC52xx_PSC6,
28 MPC52xx_FEC, MPC52xx_ATA, MPC52xx_I2C1, MPC52xx_I2C2,
29 },
30 },
31 { /* default match */
32 .ppc_sys_name = "",
33 .mask = 0x00000000,
34 .value = 0x00000000,
35 },
36};
diff --git a/arch/ppc/syslib/mpc8xx_devices.c b/arch/ppc/syslib/mpc8xx_devices.c
deleted file mode 100644
index 80804eee5795..000000000000
--- a/arch/ppc/syslib/mpc8xx_devices.c
+++ /dev/null
@@ -1,243 +0,0 @@
1/*
2 * MPC8xx Device descriptions
3 *
4 * Maintainer: Kumar Gala <galak@kernel.crashing.org>
5 *
6 * Copyright 2005 MontaVista Software, Inc. by Vitaly Bordug<vbordug@ru.mvista.com>
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
12 */
13
14#include <linux/init.h>
15#include <linux/module.h>
16#include <linux/device.h>
17#include <linux/serial_8250.h>
18#include <linux/mii.h>
19#include <asm/cpm1.h>
20#include <asm/mpc8xx.h>
21#include <asm/irq.h>
22#include <asm/ppc_sys.h>
23
24/* We use offsets for IORESOURCE_MEM to do not set dependencies at compile time.
25 * They will get fixed up by mach_mpc8xx_fixup
26 */
27
28struct platform_device ppc_sys_platform_devices[] = {
29 [MPC8xx_CPM_FEC1] = {
30 .name = "fsl-cpm-fec",
31 .id = 1,
32 .num_resources = 2,
33 .resource = (struct resource[]) {
34 {
35 .name = "regs",
36 .start = 0xe00,
37 .end = 0xe88,
38 .flags = IORESOURCE_MEM,
39 },
40 {
41 .name = "interrupt",
42 .start = MPC8xx_INT_FEC1,
43 .end = MPC8xx_INT_FEC1,
44 .flags = IORESOURCE_IRQ,
45 },
46 },
47 },
48 [MPC8xx_CPM_FEC2] = {
49 .name = "fsl-cpm-fec",
50 .id = 2,
51 .num_resources = 2,
52 .resource = (struct resource[]) {
53 {
54 .name = "regs",
55 .start = 0x1e00,
56 .end = 0x1e88,
57 .flags = IORESOURCE_MEM,
58 },
59 {
60 .name = "interrupt",
61 .start = MPC8xx_INT_FEC2,
62 .end = MPC8xx_INT_FEC2,
63 .flags = IORESOURCE_IRQ,
64 },
65 },
66 },
67 [MPC8xx_CPM_SCC1] = {
68 .name = "fsl-cpm-scc",
69 .id = 1,
70 .num_resources = 3,
71 .resource = (struct resource[]) {
72 {
73 .name = "regs",
74 .start = 0xa00,
75 .end = 0xa18,
76 .flags = IORESOURCE_MEM,
77 },
78 {
79 .name = "pram",
80 .start = 0x3c00,
81 .end = 0x3c7f,
82 .flags = IORESOURCE_MEM,
83 },
84 {
85 .name = "interrupt",
86 .start = MPC8xx_INT_SCC1,
87 .end = MPC8xx_INT_SCC1,
88 .flags = IORESOURCE_IRQ,
89 },
90 },
91 },
92 [MPC8xx_CPM_SCC2] = {
93 .name = "fsl-cpm-scc",
94 .id = 2,
95 .num_resources = 3,
96 .resource = (struct resource[]) {
97 {
98 .name = "regs",
99 .start = 0xa20,
100 .end = 0xa38,
101 .flags = IORESOURCE_MEM,
102 },
103 {
104 .name = "pram",
105 .start = 0x3d00,
106 .end = 0x3d7f,
107 .flags = IORESOURCE_MEM,
108 },
109
110 {
111 .name = "interrupt",
112 .start = MPC8xx_INT_SCC2,
113 .end = MPC8xx_INT_SCC2,
114 .flags = IORESOURCE_IRQ,
115 },
116 },
117 },
118 [MPC8xx_CPM_SCC3] = {
119 .name = "fsl-cpm-scc",
120 .id = 3,
121 .num_resources = 3,
122 .resource = (struct resource[]) {
123 {
124 .name = "regs",
125 .start = 0xa40,
126 .end = 0xa58,
127 .flags = IORESOURCE_MEM,
128 },
129 {
130 .name = "pram",
131 .start = 0x3e00,
132 .end = 0x3e7f,
133 .flags = IORESOURCE_MEM,
134 },
135
136 {
137 .name = "interrupt",
138 .start = MPC8xx_INT_SCC3,
139 .end = MPC8xx_INT_SCC3,
140 .flags = IORESOURCE_IRQ,
141 },
142 },
143 },
144 [MPC8xx_CPM_SCC4] = {
145 .name = "fsl-cpm-scc",
146 .id = 4,
147 .num_resources = 3,
148 .resource = (struct resource[]) {
149 {
150 .name = "regs",
151 .start = 0xa60,
152 .end = 0xa78,
153 .flags = IORESOURCE_MEM,
154 },
155 {
156 .name = "pram",
157 .start = 0x3f00,
158 .end = 0x3f7f,
159 .flags = IORESOURCE_MEM,
160 },
161
162 {
163 .name = "interrupt",
164 .start = MPC8xx_INT_SCC4,
165 .end = MPC8xx_INT_SCC4,
166 .flags = IORESOURCE_IRQ,
167 },
168 },
169 },
170 [MPC8xx_CPM_SMC1] = {
171 .name = "fsl-cpm-smc",
172 .id = 1,
173 .num_resources = 3,
174 .resource = (struct resource[]) {
175 {
176 .name = "regs",
177 .start = 0xa80,
178 .end = 0xa8f,
179 .flags = IORESOURCE_MEM,
180 },
181 {
182 .name = "pram",
183 .start = 0x3e80,
184 .end = 0x3ebf,
185 .flags = IORESOURCE_MEM,
186 },
187 {
188 .name = "interrupt",
189 .start = MPC8xx_INT_SMC1,
190 .end = MPC8xx_INT_SMC1,
191 .flags = IORESOURCE_IRQ,
192 },
193 },
194 },
195 [MPC8xx_CPM_SMC2] = {
196 .name = "fsl-cpm-smc",
197 .id = 2,
198 .num_resources = 3,
199 .resource = (struct resource[]) {
200 {
201 .name = "regs",
202 .start = 0xa90,
203 .end = 0xa9f,
204 .flags = IORESOURCE_MEM,
205 },
206 {
207 .name = "pram",
208 .start = 0x3f80,
209 .end = 0x3fbf,
210 .flags = IORESOURCE_MEM,
211
212 },
213 {
214 .name = "interrupt",
215 .start = MPC8xx_INT_SMC2,
216 .end = MPC8xx_INT_SMC2,
217 .flags = IORESOURCE_IRQ,
218 },
219 },
220 },
221
222 [MPC8xx_MDIO_FEC] = {
223 .name = "fsl-cpm-fec-mdio",
224 .id = 0,
225 .num_resources = 0,
226
227 },
228
229};
230
231static int __init mach_mpc8xx_fixup(struct platform_device *pdev)
232{
233 ppc_sys_fixup_mem_resource (pdev, IMAP_ADDR);
234 return 0;
235}
236
237static int __init mach_mpc8xx_init(void)
238{
239 ppc_sys_device_fixup = mach_mpc8xx_fixup;
240 return 0;
241}
242
243postcore_initcall(mach_mpc8xx_init);
diff --git a/arch/ppc/syslib/mpc8xx_sys.c b/arch/ppc/syslib/mpc8xx_sys.c
deleted file mode 100644
index 18ba1d7ff9f1..000000000000
--- a/arch/ppc/syslib/mpc8xx_sys.c
+++ /dev/null
@@ -1,61 +0,0 @@
1/*
2 * MPC8xx System descriptions
3 *
4 * Maintainer: Kumar Gala <galak@kernel.crashing.org>
5 *
6 * Copyright 2005 MontaVista Software, Inc. by Vitaly Bordug <vbordug@ru.mvista.com>
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
12 */
13
14#include <linux/init.h>
15#include <linux/module.h>
16#include <linux/device.h>
17#include <asm/ppc_sys.h>
18
19struct ppc_sys_spec *cur_ppc_sys_spec;
20struct ppc_sys_spec ppc_sys_specs[] = {
21 {
22 .ppc_sys_name = "MPC86X",
23 .mask = 0xFFFFFFFF,
24 .value = 0x00000000,
25 .num_devices = 8,
26 .device_list = (enum ppc_sys_devices[])
27 {
28 MPC8xx_CPM_FEC1,
29 MPC8xx_CPM_SCC1,
30 MPC8xx_CPM_SCC2,
31 MPC8xx_CPM_SCC3,
32 MPC8xx_CPM_SCC4,
33 MPC8xx_CPM_SMC1,
34 MPC8xx_CPM_SMC2,
35 MPC8xx_MDIO_FEC,
36 },
37 },
38 {
39 .ppc_sys_name = "MPC885",
40 .mask = 0xFFFFFFFF,
41 .value = 0x00000000,
42 .num_devices = 9,
43 .device_list = (enum ppc_sys_devices[])
44 {
45 MPC8xx_CPM_FEC1,
46 MPC8xx_CPM_FEC2,
47 MPC8xx_CPM_SCC1,
48 MPC8xx_CPM_SCC2,
49 MPC8xx_CPM_SCC3,
50 MPC8xx_CPM_SCC4,
51 MPC8xx_CPM_SMC1,
52 MPC8xx_CPM_SMC2,
53 MPC8xx_MDIO_FEC,
54 },
55 },
56 { /* default match */
57 .ppc_sys_name = "",
58 .mask = 0x00000000,
59 .value = 0x00000000,
60 },
61};
diff --git a/arch/ppc/syslib/mv64360_pic.c b/arch/ppc/syslib/mv64360_pic.c
deleted file mode 100644
index 2dd2dc5cd404..000000000000
--- a/arch/ppc/syslib/mv64360_pic.c
+++ /dev/null
@@ -1,423 +0,0 @@
1/*
2 * Interrupt controller support for Marvell's MV64360.
3 *
4 * Author: Rabeeh Khoury <rabeeh@galileo.co.il>
5 * Based on MV64360 PIC written by
6 * Chris Zankel <chris@mvista.com>
7 * Mark A. Greer <mgreer@mvista.com>
8 *
9 * Copyright 2004 MontaVista Software, Inc.
10 *
11 * This program is free software; you can redistribute it and/or modify it
12 * under the terms of the GNU General Public License as published by the
13 * Free Software Foundation; either version 2 of the License, or (at your
14 * option) any later version.
15 */
16
17/*
18 * This file contains the specific functions to support the MV64360
19 * interrupt controller.
20 *
21 * The MV64360 has two main interrupt registers (high and low) that
22 * summarizes the interrupts generated by the units of the MV64360.
23 * Each bit is assigned to an interrupt number, where the low register
24 * are assigned from IRQ0 to IRQ31 and the high cause register
25 * from IRQ32 to IRQ63
26 * The GPP (General Purpose Pins) interrupts are assigned from IRQ64 (GPP0)
27 * to IRQ95 (GPP31).
28 * get_irq() returns the lowest interrupt number that is currently asserted.
29 *
30 * Note:
31 * - This driver does not initialize the GPP when used as an interrupt
32 * input.
33 */
34
35#include <linux/stddef.h>
36#include <linux/init.h>
37#include <linux/sched.h>
38#include <linux/signal.h>
39#include <linux/delay.h>
40#include <linux/irq.h>
41#include <linux/interrupt.h>
42
43#include <asm/io.h>
44#include <asm/processor.h>
45#include <asm/system.h>
46#include <asm/irq.h>
47#include <asm/mv64x60.h>
48#include <asm/machdep.h>
49
50#ifdef CONFIG_IRQ_ALL_CPUS
51#error "The mv64360 does not support distribution of IRQs on all CPUs"
52#endif
53/* ========================== forward declaration ========================== */
54
55static void mv64360_unmask_irq(unsigned int);
56static void mv64360_mask_irq(unsigned int);
57static irqreturn_t mv64360_cpu_error_int_handler(int, void *);
58static irqreturn_t mv64360_sram_error_int_handler(int, void *);
59static irqreturn_t mv64360_pci_error_int_handler(int, void *);
60
61/* ========================== local declarations =========================== */
62
63struct hw_interrupt_type mv64360_pic = {
64 .typename = " mv64360 ",
65 .enable = mv64360_unmask_irq,
66 .disable = mv64360_mask_irq,
67 .ack = mv64360_mask_irq,
68 .end = mv64360_unmask_irq,
69};
70
71#define CPU_INTR_STR "mv64360 cpu interface error"
72#define SRAM_INTR_STR "mv64360 internal sram error"
73#define PCI0_INTR_STR "mv64360 pci 0 error"
74#define PCI1_INTR_STR "mv64360 pci 1 error"
75
76static struct mv64x60_handle bh;
77
78u32 mv64360_irq_base = 0; /* MV64360 handles the next 96 IRQs from here */
79
80/* mv64360_init_irq()
81 *
82 * This function initializes the interrupt controller. It assigns
83 * all interrupts from IRQ0 to IRQ95 to the mv64360 interrupt controller.
84 *
85 * Input Variable(s):
86 * None.
87 *
88 * Outpu. Variable(s):
89 * None.
90 *
91 * Returns:
92 * void
93 *
94 * Note:
95 * We register all GPP inputs as interrupt source, but disable them.
96 */
97void __init
98mv64360_init_irq(void)
99{
100 int i;
101
102 if (ppc_md.progress)
103 ppc_md.progress("mv64360_init_irq: enter", 0x0);
104
105 bh.v_base = mv64x60_get_bridge_vbase();
106
107 ppc_cached_irq_mask[0] = 0;
108 ppc_cached_irq_mask[1] = 0x0f000000; /* Enable GPP intrs */
109 ppc_cached_irq_mask[2] = 0;
110
111 /* disable all interrupts and clear current interrupts */
112 mv64x60_write(&bh, MV64x60_GPP_INTR_CAUSE, 0);
113 mv64x60_write(&bh, MV64x60_GPP_INTR_MASK, ppc_cached_irq_mask[2]);
114 mv64x60_write(&bh, MV64360_IC_CPU0_INTR_MASK_LO,ppc_cached_irq_mask[0]);
115 mv64x60_write(&bh, MV64360_IC_CPU0_INTR_MASK_HI,ppc_cached_irq_mask[1]);
116
117 /* All interrupts are level interrupts */
118 for (i = mv64360_irq_base; i < (mv64360_irq_base + 96); i++) {
119 irq_desc[i].status |= IRQ_LEVEL;
120 irq_desc[i].chip = &mv64360_pic;
121 }
122
123 if (ppc_md.progress)
124 ppc_md.progress("mv64360_init_irq: exit", 0x0);
125}
126
127/* mv64360_get_irq()
128 *
129 * This function returns the lowest interrupt number of all interrupts that
130 * are currently asserted.
131 *
132 * Output Variable(s):
133 * None.
134 *
135 * Returns:
136 * int <interrupt number> or -2 (bogus interrupt)
137 *
138 */
139int
140mv64360_get_irq(void)
141{
142 int irq;
143 int irq_gpp;
144
145#ifdef CONFIG_SMP
146 /*
147 * Second CPU gets only doorbell (message) interrupts.
148 * The doorbell interrupt is BIT28 in the main interrupt low cause reg.
149 */
150 int cpu_nr = smp_processor_id();
151 if (cpu_nr == 1) {
152 if (!(mv64x60_read(&bh, MV64360_IC_MAIN_CAUSE_LO) &
153 (1 << MV64x60_IRQ_DOORBELL)))
154 return -1;
155 return mv64360_irq_base + MV64x60_IRQ_DOORBELL;
156 }
157#endif
158
159 irq = mv64x60_read(&bh, MV64360_IC_MAIN_CAUSE_LO);
160 irq = __ilog2((irq & 0x3dfffffe) & ppc_cached_irq_mask[0]);
161
162 if (irq == -1) {
163 irq = mv64x60_read(&bh, MV64360_IC_MAIN_CAUSE_HI);
164 irq = __ilog2((irq & 0x1f0003f7) & ppc_cached_irq_mask[1]);
165
166 if (irq == -1)
167 irq = -2; /* bogus interrupt, should never happen */
168 else {
169 if ((irq >= 24) && (irq < MV64x60_IRQ_DOORBELL)) {
170 irq_gpp = mv64x60_read(&bh,
171 MV64x60_GPP_INTR_CAUSE);
172 irq_gpp = __ilog2(irq_gpp &
173 ppc_cached_irq_mask[2]);
174
175 if (irq_gpp == -1)
176 irq = -2;
177 else {
178 irq = irq_gpp + 64;
179 mv64x60_write(&bh,
180 MV64x60_GPP_INTR_CAUSE,
181 ~(1 << (irq - 64)));
182 }
183 }
184 else
185 irq += 32;
186 }
187 }
188
189 (void)mv64x60_read(&bh, MV64x60_GPP_INTR_CAUSE);
190
191 if (irq < 0)
192 return (irq);
193 else
194 return (mv64360_irq_base + irq);
195}
196
197/* mv64360_unmask_irq()
198 *
199 * This function enables an interrupt.
200 *
201 * Input Variable(s):
202 * unsigned int interrupt number (IRQ0...IRQ95).
203 *
204 * Output Variable(s):
205 * None.
206 *
207 * Returns:
208 * void
209 */
210static void
211mv64360_unmask_irq(unsigned int irq)
212{
213#ifdef CONFIG_SMP
214 /* second CPU gets only doorbell interrupts */
215 if ((irq - mv64360_irq_base) == MV64x60_IRQ_DOORBELL) {
216 mv64x60_set_bits(&bh, MV64360_IC_CPU1_INTR_MASK_LO,
217 (1 << MV64x60_IRQ_DOORBELL));
218 return;
219 }
220#endif
221 irq -= mv64360_irq_base;
222
223 if (irq > 31) {
224 if (irq > 63) /* unmask GPP irq */
225 mv64x60_write(&bh, MV64x60_GPP_INTR_MASK,
226 ppc_cached_irq_mask[2] |= (1 << (irq - 64)));
227 else /* mask high interrupt register */
228 mv64x60_write(&bh, MV64360_IC_CPU0_INTR_MASK_HI,
229 ppc_cached_irq_mask[1] |= (1 << (irq - 32)));
230 }
231 else /* mask low interrupt register */
232 mv64x60_write(&bh, MV64360_IC_CPU0_INTR_MASK_LO,
233 ppc_cached_irq_mask[0] |= (1 << irq));
234
235 (void)mv64x60_read(&bh, MV64x60_GPP_INTR_MASK);
236 return;
237}
238
239/* mv64360_mask_irq()
240 *
241 * This function disables the requested interrupt.
242 *
243 * Input Variable(s):
244 * unsigned int interrupt number (IRQ0...IRQ95).
245 *
246 * Output Variable(s):
247 * None.
248 *
249 * Returns:
250 * void
251 */
252static void
253mv64360_mask_irq(unsigned int irq)
254{
255#ifdef CONFIG_SMP
256 if ((irq - mv64360_irq_base) == MV64x60_IRQ_DOORBELL) {
257 mv64x60_clr_bits(&bh, MV64360_IC_CPU1_INTR_MASK_LO,
258 (1 << MV64x60_IRQ_DOORBELL));
259 return;
260 }
261#endif
262 irq -= mv64360_irq_base;
263
264 if (irq > 31) {
265 if (irq > 63) /* mask GPP irq */
266 mv64x60_write(&bh, MV64x60_GPP_INTR_MASK,
267 ppc_cached_irq_mask[2] &= ~(1 << (irq - 64)));
268 else /* mask high interrupt register */
269 mv64x60_write(&bh, MV64360_IC_CPU0_INTR_MASK_HI,
270 ppc_cached_irq_mask[1] &= ~(1 << (irq - 32)));
271 }
272 else /* mask low interrupt register */
273 mv64x60_write(&bh, MV64360_IC_CPU0_INTR_MASK_LO,
274 ppc_cached_irq_mask[0] &= ~(1 << irq));
275
276 (void)mv64x60_read(&bh, MV64x60_GPP_INTR_MASK);
277 return;
278}
279
280static irqreturn_t
281mv64360_cpu_error_int_handler(int irq, void *dev_id)
282{
283 printk(KERN_ERR "mv64360_cpu_error_int_handler: %s 0x%08x\n",
284 "Error on CPU interface - Cause regiser",
285 mv64x60_read(&bh, MV64x60_CPU_ERR_CAUSE));
286 printk(KERN_ERR "\tCPU error register dump:\n");
287 printk(KERN_ERR "\tAddress low 0x%08x\n",
288 mv64x60_read(&bh, MV64x60_CPU_ERR_ADDR_LO));
289 printk(KERN_ERR "\tAddress high 0x%08x\n",
290 mv64x60_read(&bh, MV64x60_CPU_ERR_ADDR_HI));
291 printk(KERN_ERR "\tData low 0x%08x\n",
292 mv64x60_read(&bh, MV64x60_CPU_ERR_DATA_LO));
293 printk(KERN_ERR "\tData high 0x%08x\n",
294 mv64x60_read(&bh, MV64x60_CPU_ERR_DATA_HI));
295 printk(KERN_ERR "\tParity 0x%08x\n",
296 mv64x60_read(&bh, MV64x60_CPU_ERR_PARITY));
297 mv64x60_write(&bh, MV64x60_CPU_ERR_CAUSE, 0);
298 return IRQ_HANDLED;
299}
300
301static irqreturn_t
302mv64360_sram_error_int_handler(int irq, void *dev_id)
303{
304 printk(KERN_ERR "mv64360_sram_error_int_handler: %s 0x%08x\n",
305 "Error in internal SRAM - Cause register",
306 mv64x60_read(&bh, MV64360_SRAM_ERR_CAUSE));
307 printk(KERN_ERR "\tSRAM error register dump:\n");
308 printk(KERN_ERR "\tAddress Low 0x%08x\n",
309 mv64x60_read(&bh, MV64360_SRAM_ERR_ADDR_LO));
310 printk(KERN_ERR "\tAddress High 0x%08x\n",
311 mv64x60_read(&bh, MV64360_SRAM_ERR_ADDR_HI));
312 printk(KERN_ERR "\tData Low 0x%08x\n",
313 mv64x60_read(&bh, MV64360_SRAM_ERR_DATA_LO));
314 printk(KERN_ERR "\tData High 0x%08x\n",
315 mv64x60_read(&bh, MV64360_SRAM_ERR_DATA_HI));
316 printk(KERN_ERR "\tParity 0x%08x\n",
317 mv64x60_read(&bh, MV64360_SRAM_ERR_PARITY));
318 mv64x60_write(&bh, MV64360_SRAM_ERR_CAUSE, 0);
319 return IRQ_HANDLED;
320}
321
322static irqreturn_t
323mv64360_pci_error_int_handler(int irq, void *dev_id)
324{
325 u32 val;
326 unsigned int pci_bus = (unsigned int)dev_id;
327
328 if (pci_bus == 0) { /* Error on PCI 0 */
329 val = mv64x60_read(&bh, MV64x60_PCI0_ERR_CAUSE);
330 printk(KERN_ERR "%s: Error in PCI %d Interface\n",
331 "mv64360_pci_error_int_handler", pci_bus);
332 printk(KERN_ERR "\tPCI %d error register dump:\n", pci_bus);
333 printk(KERN_ERR "\tCause register 0x%08x\n", val);
334 printk(KERN_ERR "\tAddress Low 0x%08x\n",
335 mv64x60_read(&bh, MV64x60_PCI0_ERR_ADDR_LO));
336 printk(KERN_ERR "\tAddress High 0x%08x\n",
337 mv64x60_read(&bh, MV64x60_PCI0_ERR_ADDR_HI));
338 printk(KERN_ERR "\tAttribute 0x%08x\n",
339 mv64x60_read(&bh, MV64x60_PCI0_ERR_DATA_LO));
340 printk(KERN_ERR "\tCommand 0x%08x\n",
341 mv64x60_read(&bh, MV64x60_PCI0_ERR_CMD));
342 mv64x60_write(&bh, MV64x60_PCI0_ERR_CAUSE, ~val);
343 }
344 if (pci_bus == 1) { /* Error on PCI 1 */
345 val = mv64x60_read(&bh, MV64x60_PCI1_ERR_CAUSE);
346 printk(KERN_ERR "%s: Error in PCI %d Interface\n",
347 "mv64360_pci_error_int_handler", pci_bus);
348 printk(KERN_ERR "\tPCI %d error register dump:\n", pci_bus);
349 printk(KERN_ERR "\tCause register 0x%08x\n", val);
350 printk(KERN_ERR "\tAddress Low 0x%08x\n",
351 mv64x60_read(&bh, MV64x60_PCI1_ERR_ADDR_LO));
352 printk(KERN_ERR "\tAddress High 0x%08x\n",
353 mv64x60_read(&bh, MV64x60_PCI1_ERR_ADDR_HI));
354 printk(KERN_ERR "\tAttribute 0x%08x\n",
355 mv64x60_read(&bh, MV64x60_PCI1_ERR_DATA_LO));
356 printk(KERN_ERR "\tCommand 0x%08x\n",
357 mv64x60_read(&bh, MV64x60_PCI1_ERR_CMD));
358 mv64x60_write(&bh, MV64x60_PCI1_ERR_CAUSE, ~val);
359 }
360 return IRQ_HANDLED;
361}
362
363/*
364 * Bit 0 of MV64x60_PCIx_ERR_MASK does not exist on the 64360 and because of
365 * errata FEr-#11 and FEr-##16 for the 64460, it should be 0 on that chip as
366 * well. IOW, don't set bit 0.
367 */
368#define MV64360_PCI0_ERR_MASK_VAL 0x00a50c24
369
370static int __init
371mv64360_register_hdlrs(void)
372{
373 int rc;
374
375 /* Clear old errors and register CPU interface error intr handler */
376 mv64x60_write(&bh, MV64x60_CPU_ERR_CAUSE, 0);
377 if ((rc = request_irq(MV64x60_IRQ_CPU_ERR + mv64360_irq_base,
378 mv64360_cpu_error_int_handler, IRQF_DISABLED, CPU_INTR_STR, NULL)))
379 printk(KERN_WARNING "Can't register cpu error handler: %d", rc);
380
381 mv64x60_write(&bh, MV64x60_CPU_ERR_MASK, 0);
382 mv64x60_write(&bh, MV64x60_CPU_ERR_MASK, 0x000000ff);
383
384 /* Clear old errors and register internal SRAM error intr handler */
385 mv64x60_write(&bh, MV64360_SRAM_ERR_CAUSE, 0);
386 if ((rc = request_irq(MV64360_IRQ_SRAM_PAR_ERR + mv64360_irq_base,
387 mv64360_sram_error_int_handler,IRQF_DISABLED,SRAM_INTR_STR, NULL)))
388 printk(KERN_WARNING "Can't register SRAM error handler: %d",rc);
389
390 /* Clear old errors and register PCI 0 error intr handler */
391 mv64x60_write(&bh, MV64x60_PCI0_ERR_CAUSE, 0);
392 if ((rc = request_irq(MV64360_IRQ_PCI0 + mv64360_irq_base,
393 mv64360_pci_error_int_handler,
394 IRQF_DISABLED, PCI0_INTR_STR, (void *)0)))
395 printk(KERN_WARNING "Can't register pci 0 error handler: %d",
396 rc);
397
398 mv64x60_write(&bh, MV64x60_PCI0_ERR_MASK, 0);
399 mv64x60_write(&bh, MV64x60_PCI0_ERR_MASK, MV64360_PCI0_ERR_MASK_VAL);
400
401 /* Erratum FEr PCI-#16 says to clear bit 0 of PCI SERRn Mask reg. */
402 mv64x60_write(&bh, MV64x60_PCI0_ERR_SERR_MASK,
403 mv64x60_read(&bh, MV64x60_PCI0_ERR_SERR_MASK) & ~0x1UL);
404
405 /* Clear old errors and register PCI 1 error intr handler */
406 mv64x60_write(&bh, MV64x60_PCI1_ERR_CAUSE, 0);
407 if ((rc = request_irq(MV64360_IRQ_PCI1 + mv64360_irq_base,
408 mv64360_pci_error_int_handler,
409 IRQF_DISABLED, PCI1_INTR_STR, (void *)1)))
410 printk(KERN_WARNING "Can't register pci 1 error handler: %d",
411 rc);
412
413 mv64x60_write(&bh, MV64x60_PCI1_ERR_MASK, 0);
414 mv64x60_write(&bh, MV64x60_PCI1_ERR_MASK, MV64360_PCI0_ERR_MASK_VAL);
415
416 /* Erratum FEr PCI-#16 says to clear bit 0 of PCI Intr Mask reg. */
417 mv64x60_write(&bh, MV64x60_PCI1_ERR_SERR_MASK,
418 mv64x60_read(&bh, MV64x60_PCI1_ERR_SERR_MASK) & ~0x1UL);
419
420 return 0;
421}
422
423arch_initcall(mv64360_register_hdlrs);
diff --git a/arch/ppc/syslib/mv64x60.c b/arch/ppc/syslib/mv64x60.c
deleted file mode 100644
index 418f3053de52..000000000000
--- a/arch/ppc/syslib/mv64x60.c
+++ /dev/null
@@ -1,2485 +0,0 @@
1/*
2 * Common routines for the Marvell/Galileo Discovery line of host bridges
3 * (gt64260, mv64360, mv64460, ...).
4 *
5 * Author: Mark A. Greer <mgreer@mvista.com>
6 *
7 * 2004 (c) MontaVista, Software, Inc. This file is licensed under
8 * the terms of the GNU General Public License version 2. This program
9 * is licensed "as is" without any warranty of any kind, whether express
10 * or implied.
11 */
12#include <linux/kernel.h>
13#include <linux/init.h>
14#include <linux/pci.h>
15#include <linux/slab.h>
16#include <linux/module.h>
17#include <linux/mutex.h>
18#include <linux/string.h>
19#include <linux/spinlock.h>
20#include <linux/mv643xx.h>
21#include <linux/platform_device.h>
22
23#include <asm/byteorder.h>
24#include <asm/io.h>
25#include <asm/irq.h>
26#include <asm/uaccess.h>
27#include <asm/machdep.h>
28#include <asm/pci-bridge.h>
29#include <asm/delay.h>
30#include <asm/mv64x60.h>
31
32
33u8 mv64x60_pci_exclude_bridge = 1;
34DEFINE_SPINLOCK(mv64x60_lock);
35
36static phys_addr_t mv64x60_bridge_pbase;
37static void __iomem *mv64x60_bridge_vbase;
38static u32 mv64x60_bridge_type = MV64x60_TYPE_INVALID;
39static u32 mv64x60_bridge_rev;
40#if defined(CONFIG_SYSFS) && !defined(CONFIG_GT64260)
41static struct pci_controller sysfs_hose_a;
42#endif
43
44static u32 gt64260_translate_size(u32 base, u32 size, u32 num_bits);
45static u32 gt64260_untranslate_size(u32 base, u32 size, u32 num_bits);
46static void gt64260_set_pci2mem_window(struct pci_controller *hose, u32 bus,
47 u32 window, u32 base);
48static void gt64260_set_pci2regs_window(struct mv64x60_handle *bh,
49 struct pci_controller *hose, u32 bus, u32 base);
50static u32 gt64260_is_enabled_32bit(struct mv64x60_handle *bh, u32 window);
51static void gt64260_enable_window_32bit(struct mv64x60_handle *bh, u32 window);
52static void gt64260_disable_window_32bit(struct mv64x60_handle *bh, u32 window);
53static void gt64260_enable_window_64bit(struct mv64x60_handle *bh, u32 window);
54static void gt64260_disable_window_64bit(struct mv64x60_handle *bh, u32 window);
55static void gt64260_disable_all_windows(struct mv64x60_handle *bh,
56 struct mv64x60_setup_info *si);
57static void gt64260a_chip_specific_init(struct mv64x60_handle *bh,
58 struct mv64x60_setup_info *si);
59static void gt64260b_chip_specific_init(struct mv64x60_handle *bh,
60 struct mv64x60_setup_info *si);
61
62static u32 mv64360_translate_size(u32 base, u32 size, u32 num_bits);
63static u32 mv64360_untranslate_size(u32 base, u32 size, u32 num_bits);
64static void mv64360_set_pci2mem_window(struct pci_controller *hose, u32 bus,
65 u32 window, u32 base);
66static void mv64360_set_pci2regs_window(struct mv64x60_handle *bh,
67 struct pci_controller *hose, u32 bus, u32 base);
68static u32 mv64360_is_enabled_32bit(struct mv64x60_handle *bh, u32 window);
69static void mv64360_enable_window_32bit(struct mv64x60_handle *bh, u32 window);
70static void mv64360_disable_window_32bit(struct mv64x60_handle *bh, u32 window);
71static void mv64360_enable_window_64bit(struct mv64x60_handle *bh, u32 window);
72static void mv64360_disable_window_64bit(struct mv64x60_handle *bh, u32 window);
73static void mv64360_disable_all_windows(struct mv64x60_handle *bh,
74 struct mv64x60_setup_info *si);
75static void mv64360_config_io2mem_windows(struct mv64x60_handle *bh,
76 struct mv64x60_setup_info *si,
77 u32 mem_windows[MV64x60_CPU2MEM_WINDOWS][2]);
78static void mv64360_set_mpsc2regs_window(struct mv64x60_handle *bh, u32 base);
79static void mv64360_chip_specific_init(struct mv64x60_handle *bh,
80 struct mv64x60_setup_info *si);
81static void mv64460_chip_specific_init(struct mv64x60_handle *bh,
82 struct mv64x60_setup_info *si);
83
84
85/*
86 * Define tables that have the chip-specific info for each type of
87 * Marvell bridge chip.
88 */
89static struct mv64x60_chip_info gt64260a_ci __initdata = { /* GT64260A */
90 .translate_size = gt64260_translate_size,
91 .untranslate_size = gt64260_untranslate_size,
92 .set_pci2mem_window = gt64260_set_pci2mem_window,
93 .set_pci2regs_window = gt64260_set_pci2regs_window,
94 .is_enabled_32bit = gt64260_is_enabled_32bit,
95 .enable_window_32bit = gt64260_enable_window_32bit,
96 .disable_window_32bit = gt64260_disable_window_32bit,
97 .enable_window_64bit = gt64260_enable_window_64bit,
98 .disable_window_64bit = gt64260_disable_window_64bit,
99 .disable_all_windows = gt64260_disable_all_windows,
100 .chip_specific_init = gt64260a_chip_specific_init,
101 .window_tab_32bit = gt64260_32bit_windows,
102 .window_tab_64bit = gt64260_64bit_windows,
103};
104
105static struct mv64x60_chip_info gt64260b_ci __initdata = { /* GT64260B */
106 .translate_size = gt64260_translate_size,
107 .untranslate_size = gt64260_untranslate_size,
108 .set_pci2mem_window = gt64260_set_pci2mem_window,
109 .set_pci2regs_window = gt64260_set_pci2regs_window,
110 .is_enabled_32bit = gt64260_is_enabled_32bit,
111 .enable_window_32bit = gt64260_enable_window_32bit,
112 .disable_window_32bit = gt64260_disable_window_32bit,
113 .enable_window_64bit = gt64260_enable_window_64bit,
114 .disable_window_64bit = gt64260_disable_window_64bit,
115 .disable_all_windows = gt64260_disable_all_windows,
116 .chip_specific_init = gt64260b_chip_specific_init,
117 .window_tab_32bit = gt64260_32bit_windows,
118 .window_tab_64bit = gt64260_64bit_windows,
119};
120
121static struct mv64x60_chip_info mv64360_ci __initdata = { /* MV64360 */
122 .translate_size = mv64360_translate_size,
123 .untranslate_size = mv64360_untranslate_size,
124 .set_pci2mem_window = mv64360_set_pci2mem_window,
125 .set_pci2regs_window = mv64360_set_pci2regs_window,
126 .is_enabled_32bit = mv64360_is_enabled_32bit,
127 .enable_window_32bit = mv64360_enable_window_32bit,
128 .disable_window_32bit = mv64360_disable_window_32bit,
129 .enable_window_64bit = mv64360_enable_window_64bit,
130 .disable_window_64bit = mv64360_disable_window_64bit,
131 .disable_all_windows = mv64360_disable_all_windows,
132 .config_io2mem_windows = mv64360_config_io2mem_windows,
133 .set_mpsc2regs_window = mv64360_set_mpsc2regs_window,
134 .chip_specific_init = mv64360_chip_specific_init,
135 .window_tab_32bit = mv64360_32bit_windows,
136 .window_tab_64bit = mv64360_64bit_windows,
137};
138
139static struct mv64x60_chip_info mv64460_ci __initdata = { /* MV64460 */
140 .translate_size = mv64360_translate_size,
141 .untranslate_size = mv64360_untranslate_size,
142 .set_pci2mem_window = mv64360_set_pci2mem_window,
143 .set_pci2regs_window = mv64360_set_pci2regs_window,
144 .is_enabled_32bit = mv64360_is_enabled_32bit,
145 .enable_window_32bit = mv64360_enable_window_32bit,
146 .disable_window_32bit = mv64360_disable_window_32bit,
147 .enable_window_64bit = mv64360_enable_window_64bit,
148 .disable_window_64bit = mv64360_disable_window_64bit,
149 .disable_all_windows = mv64360_disable_all_windows,
150 .config_io2mem_windows = mv64360_config_io2mem_windows,
151 .set_mpsc2regs_window = mv64360_set_mpsc2regs_window,
152 .chip_specific_init = mv64460_chip_specific_init,
153 .window_tab_32bit = mv64360_32bit_windows,
154 .window_tab_64bit = mv64360_64bit_windows,
155};
156
157/*
158 *****************************************************************************
159 *
160 * Platform Device Definitions
161 *
162 *****************************************************************************
163 */
164#ifdef CONFIG_SERIAL_MPSC
165static struct mpsc_shared_pdata mv64x60_mpsc_shared_pdata = {
166 .mrr_val = 0x3ffffe38,
167 .rcrr_val = 0,
168 .tcrr_val = 0,
169 .intr_cause_val = 0,
170 .intr_mask_val = 0,
171};
172
173static struct resource mv64x60_mpsc_shared_resources[] = {
174 /* Do not change the order of the IORESOURCE_MEM resources */
175 [0] = {
176 .name = "mpsc routing base",
177 .start = MV64x60_MPSC_ROUTING_OFFSET,
178 .end = MV64x60_MPSC_ROUTING_OFFSET +
179 MPSC_ROUTING_REG_BLOCK_SIZE - 1,
180 .flags = IORESOURCE_MEM,
181 },
182 [1] = {
183 .name = "sdma intr base",
184 .start = MV64x60_SDMA_INTR_OFFSET,
185 .end = MV64x60_SDMA_INTR_OFFSET +
186 MPSC_SDMA_INTR_REG_BLOCK_SIZE - 1,
187 .flags = IORESOURCE_MEM,
188 },
189};
190
191static struct platform_device mpsc_shared_device = { /* Shared device */
192 .name = MPSC_SHARED_NAME,
193 .id = 0,
194 .num_resources = ARRAY_SIZE(mv64x60_mpsc_shared_resources),
195 .resource = mv64x60_mpsc_shared_resources,
196 .dev = {
197 .platform_data = &mv64x60_mpsc_shared_pdata,
198 },
199};
200
201static struct mpsc_pdata mv64x60_mpsc0_pdata = {
202 .mirror_regs = 0,
203 .cache_mgmt = 0,
204 .max_idle = 0,
205 .default_baud = 9600,
206 .default_bits = 8,
207 .default_parity = 'n',
208 .default_flow = 'n',
209 .chr_1_val = 0x00000000,
210 .chr_2_val = 0x00000000,
211 .chr_10_val = 0x00000003,
212 .mpcr_val = 0,
213 .bcr_val = 0,
214 .brg_can_tune = 0,
215 .brg_clk_src = 8, /* Default to TCLK */
216 .brg_clk_freq = 100000000, /* Default to 100 MHz */
217};
218
219static struct resource mv64x60_mpsc0_resources[] = {
220 /* Do not change the order of the IORESOURCE_MEM resources */
221 [0] = {
222 .name = "mpsc 0 base",
223 .start = MV64x60_MPSC_0_OFFSET,
224 .end = MV64x60_MPSC_0_OFFSET + MPSC_REG_BLOCK_SIZE - 1,
225 .flags = IORESOURCE_MEM,
226 },
227 [1] = {
228 .name = "sdma 0 base",
229 .start = MV64x60_SDMA_0_OFFSET,
230 .end = MV64x60_SDMA_0_OFFSET + MPSC_SDMA_REG_BLOCK_SIZE - 1,
231 .flags = IORESOURCE_MEM,
232 },
233 [2] = {
234 .name = "brg 0 base",
235 .start = MV64x60_BRG_0_OFFSET,
236 .end = MV64x60_BRG_0_OFFSET + MPSC_BRG_REG_BLOCK_SIZE - 1,
237 .flags = IORESOURCE_MEM,
238 },
239 [3] = {
240 .name = "sdma 0 irq",
241 .start = MV64x60_IRQ_SDMA_0,
242 .end = MV64x60_IRQ_SDMA_0,
243 .flags = IORESOURCE_IRQ,
244 },
245};
246
247static struct platform_device mpsc0_device = {
248 .name = MPSC_CTLR_NAME,
249 .id = 0,
250 .num_resources = ARRAY_SIZE(mv64x60_mpsc0_resources),
251 .resource = mv64x60_mpsc0_resources,
252 .dev = {
253 .platform_data = &mv64x60_mpsc0_pdata,
254 },
255};
256
257static struct mpsc_pdata mv64x60_mpsc1_pdata = {
258 .mirror_regs = 0,
259 .cache_mgmt = 0,
260 .max_idle = 0,
261 .default_baud = 9600,
262 .default_bits = 8,
263 .default_parity = 'n',
264 .default_flow = 'n',
265 .chr_1_val = 0x00000000,
266 .chr_1_val = 0x00000000,
267 .chr_2_val = 0x00000000,
268 .chr_10_val = 0x00000003,
269 .mpcr_val = 0,
270 .bcr_val = 0,
271 .brg_can_tune = 0,
272 .brg_clk_src = 8, /* Default to TCLK */
273 .brg_clk_freq = 100000000, /* Default to 100 MHz */
274};
275
276static struct resource mv64x60_mpsc1_resources[] = {
277 /* Do not change the order of the IORESOURCE_MEM resources */
278 [0] = {
279 .name = "mpsc 1 base",
280 .start = MV64x60_MPSC_1_OFFSET,
281 .end = MV64x60_MPSC_1_OFFSET + MPSC_REG_BLOCK_SIZE - 1,
282 .flags = IORESOURCE_MEM,
283 },
284 [1] = {
285 .name = "sdma 1 base",
286 .start = MV64x60_SDMA_1_OFFSET,
287 .end = MV64x60_SDMA_1_OFFSET + MPSC_SDMA_REG_BLOCK_SIZE - 1,
288 .flags = IORESOURCE_MEM,
289 },
290 [2] = {
291 .name = "brg 1 base",
292 .start = MV64x60_BRG_1_OFFSET,
293 .end = MV64x60_BRG_1_OFFSET + MPSC_BRG_REG_BLOCK_SIZE - 1,
294 .flags = IORESOURCE_MEM,
295 },
296 [3] = {
297 .name = "sdma 1 irq",
298 .start = MV64360_IRQ_SDMA_1,
299 .end = MV64360_IRQ_SDMA_1,
300 .flags = IORESOURCE_IRQ,
301 },
302};
303
304static struct platform_device mpsc1_device = {
305 .name = MPSC_CTLR_NAME,
306 .id = 1,
307 .num_resources = ARRAY_SIZE(mv64x60_mpsc1_resources),
308 .resource = mv64x60_mpsc1_resources,
309 .dev = {
310 .platform_data = &mv64x60_mpsc1_pdata,
311 },
312};
313#endif
314
315#if defined(CONFIG_MV643XX_ETH) || defined(CONFIG_MV643XX_ETH_MODULE)
316static struct resource mv64x60_eth_shared_resources[] = {
317 [0] = {
318 .name = "ethernet shared base",
319 .start = MV643XX_ETH_SHARED_REGS,
320 .end = MV643XX_ETH_SHARED_REGS +
321 MV643XX_ETH_SHARED_REGS_SIZE - 1,
322 .flags = IORESOURCE_MEM,
323 },
324};
325
326static struct platform_device mv64x60_eth_shared_device = {
327 .name = MV643XX_ETH_SHARED_NAME,
328 .id = 0,
329 .num_resources = ARRAY_SIZE(mv64x60_eth_shared_resources),
330 .resource = mv64x60_eth_shared_resources,
331};
332
333#ifdef CONFIG_MV643XX_ETH_0
334static struct resource mv64x60_eth0_resources[] = {
335 [0] = {
336 .name = "eth0 irq",
337 .start = MV64x60_IRQ_ETH_0,
338 .end = MV64x60_IRQ_ETH_0,
339 .flags = IORESOURCE_IRQ,
340 },
341};
342
343static struct mv643xx_eth_platform_data eth0_pd = {
344 .shared = &mv64x60_eth_shared_device;
345 .port_number = 0,
346};
347
348static struct platform_device eth0_device = {
349 .name = MV643XX_ETH_NAME,
350 .id = 0,
351 .num_resources = ARRAY_SIZE(mv64x60_eth0_resources),
352 .resource = mv64x60_eth0_resources,
353 .dev = {
354 .platform_data = &eth0_pd,
355 },
356};
357#endif
358
359#ifdef CONFIG_MV643XX_ETH_1
360static struct resource mv64x60_eth1_resources[] = {
361 [0] = {
362 .name = "eth1 irq",
363 .start = MV64x60_IRQ_ETH_1,
364 .end = MV64x60_IRQ_ETH_1,
365 .flags = IORESOURCE_IRQ,
366 },
367};
368
369static struct mv643xx_eth_platform_data eth1_pd = {
370 .shared = &mv64x60_eth_shared_device;
371 .port_number = 1,
372};
373
374static struct platform_device eth1_device = {
375 .name = MV643XX_ETH_NAME,
376 .id = 1,
377 .num_resources = ARRAY_SIZE(mv64x60_eth1_resources),
378 .resource = mv64x60_eth1_resources,
379 .dev = {
380 .platform_data = &eth1_pd,
381 },
382};
383#endif
384
385#ifdef CONFIG_MV643XX_ETH_2
386static struct resource mv64x60_eth2_resources[] = {
387 [0] = {
388 .name = "eth2 irq",
389 .start = MV64x60_IRQ_ETH_2,
390 .end = MV64x60_IRQ_ETH_2,
391 .flags = IORESOURCE_IRQ,
392 },
393};
394
395static struct mv643xx_eth_platform_data eth2_pd = {
396 .shared = &mv64x60_eth_shared_device;
397 .port_number = 2,
398};
399
400static struct platform_device eth2_device = {
401 .name = MV643XX_ETH_NAME,
402 .id = 2,
403 .num_resources = ARRAY_SIZE(mv64x60_eth2_resources),
404 .resource = mv64x60_eth2_resources,
405 .dev = {
406 .platform_data = &eth2_pd,
407 },
408};
409#endif
410#endif
411
412#ifdef CONFIG_I2C_MV64XXX
413static struct mv64xxx_i2c_pdata mv64xxx_i2c_pdata = {
414 .freq_m = 8,
415 .freq_n = 3,
416 .timeout = 1000, /* Default timeout of 1 second */
417};
418
419static struct resource mv64xxx_i2c_resources[] = {
420 /* Do not change the order of the IORESOURCE_MEM resources */
421 [0] = {
422 .name = "mv64xxx i2c base",
423 .start = MV64XXX_I2C_OFFSET,
424 .end = MV64XXX_I2C_OFFSET + MV64XXX_I2C_REG_BLOCK_SIZE - 1,
425 .flags = IORESOURCE_MEM,
426 },
427 [1] = {
428 .name = "mv64xxx i2c irq",
429 .start = MV64x60_IRQ_I2C,
430 .end = MV64x60_IRQ_I2C,
431 .flags = IORESOURCE_IRQ,
432 },
433};
434
435static struct platform_device i2c_device = {
436 .name = MV64XXX_I2C_CTLR_NAME,
437 .id = 0,
438 .num_resources = ARRAY_SIZE(mv64xxx_i2c_resources),
439 .resource = mv64xxx_i2c_resources,
440 .dev = {
441 .platform_data = &mv64xxx_i2c_pdata,
442 },
443};
444#endif
445
446#ifdef CONFIG_WATCHDOG
447static struct mv64x60_wdt_pdata mv64x60_wdt_pdata = {
448 .timeout = 10, /* default watchdog expiry in seconds */
449 .bus_clk = 133, /* default bus clock in MHz */
450};
451
452static struct resource mv64x60_wdt_resources[] = {
453 [0] = {
454 .name = "mv64x60 wdt base",
455 .start = MV64x60_WDT_WDC,
456 .end = MV64x60_WDT_WDC + 8 - 1, /* two 32-bit registers */
457 .flags = IORESOURCE_MEM,
458 },
459};
460
461static struct platform_device wdt_device = {
462 .name = MV64x60_WDT_NAME,
463 .id = 0,
464 .num_resources = ARRAY_SIZE(mv64x60_wdt_resources),
465 .resource = mv64x60_wdt_resources,
466 .dev = {
467 .platform_data = &mv64x60_wdt_pdata,
468 },
469};
470#endif
471
472#if defined(CONFIG_SYSFS) && !defined(CONFIG_GT64260)
473static struct mv64xxx_pdata mv64xxx_pdata = {
474 .hs_reg_valid = 0,
475};
476
477static struct platform_device mv64xxx_device = { /* general mv64x60 stuff */
478 .name = MV64XXX_DEV_NAME,
479 .id = 0,
480 .dev = {
481 .platform_data = &mv64xxx_pdata,
482 },
483};
484#endif
485
486static struct platform_device *mv64x60_pd_devs[] __initdata = {
487#ifdef CONFIG_SERIAL_MPSC
488 &mpsc_shared_device,
489 &mpsc0_device,
490 &mpsc1_device,
491#endif
492#if defined(CONFIG_MV643XX_ETH) || defined(CONFIG_MV643XX_ETH_MODULE)
493 &mv64x60_eth_shared_device,
494#endif
495#ifdef CONFIG_MV643XX_ETH_0
496 &eth0_device,
497#endif
498#ifdef CONFIG_MV643XX_ETH_1
499 &eth1_device,
500#endif
501#ifdef CONFIG_MV643XX_ETH_2
502 &eth2_device,
503#endif
504#ifdef CONFIG_I2C_MV64XXX
505 &i2c_device,
506#endif
507#ifdef CONFIG_MV64X60_WDT
508 &wdt_device,
509#endif
510#if defined(CONFIG_SYSFS) && !defined(CONFIG_GT64260)
511 &mv64xxx_device,
512#endif
513};
514
515/*
516 *****************************************************************************
517 *
518 * Bridge Initialization Routines
519 *
520 *****************************************************************************
521 */
522/*
523 * mv64x60_init()
524 *
525 * Initialize the bridge based on setting passed in via 'si'. The bridge
526 * handle, 'bh', will be set so that it can be used to make subsequent
527 * calls to routines in this file.
528 */
529int __init
530mv64x60_init(struct mv64x60_handle *bh, struct mv64x60_setup_info *si)
531{
532 u32 mem_windows[MV64x60_CPU2MEM_WINDOWS][2];
533
534 if (ppc_md.progress)
535 ppc_md.progress("mv64x60 initialization", 0x0);
536
537 spin_lock_init(&mv64x60_lock);
538 mv64x60_early_init(bh, si);
539
540 if (mv64x60_get_type(bh) || mv64x60_setup_for_chip(bh)) {
541 iounmap(bh->v_base);
542 bh->v_base = 0;
543 if (ppc_md.progress)
544 ppc_md.progress("mv64x60_init: Can't determine chip",0);
545 return -1;
546 }
547
548 bh->ci->disable_all_windows(bh, si);
549 mv64x60_get_mem_windows(bh, mem_windows);
550 mv64x60_config_cpu2mem_windows(bh, si, mem_windows);
551
552 if (bh->ci->config_io2mem_windows)
553 bh->ci->config_io2mem_windows(bh, si, mem_windows);
554 if (bh->ci->set_mpsc2regs_window)
555 bh->ci->set_mpsc2regs_window(bh, si->phys_reg_base);
556
557 if (si->pci_1.enable_bus) {
558 bh->io_base_b = (u32)ioremap(si->pci_1.pci_io.cpu_base,
559 si->pci_1.pci_io.size);
560 isa_io_base = bh->io_base_b;
561 }
562
563 if (si->pci_0.enable_bus) {
564 bh->io_base_a = (u32)ioremap(si->pci_0.pci_io.cpu_base,
565 si->pci_0.pci_io.size);
566 isa_io_base = bh->io_base_a;
567
568 mv64x60_alloc_hose(bh, MV64x60_PCI0_CONFIG_ADDR,
569 MV64x60_PCI0_CONFIG_DATA, &bh->hose_a);
570 mv64x60_config_resources(bh->hose_a, &si->pci_0, bh->io_base_a);
571 mv64x60_config_pci_params(bh->hose_a, &si->pci_0);
572
573 mv64x60_config_cpu2pci_windows(bh, &si->pci_0, 0);
574 mv64x60_config_pci2mem_windows(bh, bh->hose_a, &si->pci_0, 0,
575 mem_windows);
576 bh->ci->set_pci2regs_window(bh, bh->hose_a, 0,
577 si->phys_reg_base);
578 }
579
580 if (si->pci_1.enable_bus) {
581 mv64x60_alloc_hose(bh, MV64x60_PCI1_CONFIG_ADDR,
582 MV64x60_PCI1_CONFIG_DATA, &bh->hose_b);
583 mv64x60_config_resources(bh->hose_b, &si->pci_1, bh->io_base_b);
584 mv64x60_config_pci_params(bh->hose_b, &si->pci_1);
585
586 mv64x60_config_cpu2pci_windows(bh, &si->pci_1, 1);
587 mv64x60_config_pci2mem_windows(bh, bh->hose_b, &si->pci_1, 1,
588 mem_windows);
589 bh->ci->set_pci2regs_window(bh, bh->hose_b, 1,
590 si->phys_reg_base);
591 }
592
593 bh->ci->chip_specific_init(bh, si);
594 mv64x60_pd_fixup(bh, mv64x60_pd_devs, ARRAY_SIZE(mv64x60_pd_devs));
595
596 return 0;
597}
598
599/*
600 * mv64x60_early_init()
601 *
602 * Do some bridge work that must take place before we start messing with
603 * the bridge for real.
604 */
605void __init
606mv64x60_early_init(struct mv64x60_handle *bh, struct mv64x60_setup_info *si)
607{
608 struct pci_controller hose_a, hose_b;
609
610 memset(bh, 0, sizeof(*bh));
611
612 bh->p_base = si->phys_reg_base;
613 bh->v_base = ioremap(bh->p_base, MV64x60_INTERNAL_SPACE_SIZE);
614
615 mv64x60_bridge_pbase = bh->p_base;
616 mv64x60_bridge_vbase = bh->v_base;
617
618 /* Assuming pci mode [reserved] bits 4:5 on 64260 are 0 */
619 bh->pci_mode_a = mv64x60_read(bh, MV64x60_PCI0_MODE) &
620 MV64x60_PCIMODE_MASK;
621 bh->pci_mode_b = mv64x60_read(bh, MV64x60_PCI1_MODE) &
622 MV64x60_PCIMODE_MASK;
623
624 /* Need temporary hose structs to call mv64x60_set_bus() */
625 memset(&hose_a, 0, sizeof(hose_a));
626 memset(&hose_b, 0, sizeof(hose_b));
627 setup_indirect_pci_nomap(&hose_a, bh->v_base + MV64x60_PCI0_CONFIG_ADDR,
628 bh->v_base + MV64x60_PCI0_CONFIG_DATA);
629 setup_indirect_pci_nomap(&hose_b, bh->v_base + MV64x60_PCI1_CONFIG_ADDR,
630 bh->v_base + MV64x60_PCI1_CONFIG_DATA);
631 bh->hose_a = &hose_a;
632 bh->hose_b = &hose_b;
633
634#if defined(CONFIG_SYSFS) && !defined(CONFIG_GT64260)
635 /* Save a copy of hose_a for sysfs functions -- hack */
636 memcpy(&sysfs_hose_a, &hose_a, sizeof(hose_a));
637#endif
638
639 mv64x60_set_bus(bh, 0, 0);
640 mv64x60_set_bus(bh, 1, 0);
641
642 bh->hose_a = NULL;
643 bh->hose_b = NULL;
644
645 /* Clear bit 0 of PCI addr decode control so PCI->CPU remap 1:1 */
646 mv64x60_clr_bits(bh, MV64x60_PCI0_PCI_DECODE_CNTL, 0x00000001);
647 mv64x60_clr_bits(bh, MV64x60_PCI1_PCI_DECODE_CNTL, 0x00000001);
648
649 /* Bit 12 MUST be 0; set bit 27--don't auto-update cpu remap regs */
650 mv64x60_clr_bits(bh, MV64x60_CPU_CONFIG, (1<<12));
651 mv64x60_set_bits(bh, MV64x60_CPU_CONFIG, (1<<27));
652
653 mv64x60_set_bits(bh, MV64x60_PCI0_TO_RETRY, 0xffff);
654 mv64x60_set_bits(bh, MV64x60_PCI1_TO_RETRY, 0xffff);
655}
656
657/*
658 *****************************************************************************
659 *
660 * Window Config Routines
661 *
662 *****************************************************************************
663 */
664/*
665 * mv64x60_get_32bit_window()
666 *
667 * Determine the base address and size of a 32-bit window on the bridge.
668 */
669void __init
670mv64x60_get_32bit_window(struct mv64x60_handle *bh, u32 window,
671 u32 *base, u32 *size)
672{
673 u32 val, base_reg, size_reg, base_bits, size_bits;
674 u32 (*get_from_field)(u32 val, u32 num_bits);
675
676 base_reg = bh->ci->window_tab_32bit[window].base_reg;
677
678 if (base_reg != 0) {
679 size_reg = bh->ci->window_tab_32bit[window].size_reg;
680 base_bits = bh->ci->window_tab_32bit[window].base_bits;
681 size_bits = bh->ci->window_tab_32bit[window].size_bits;
682 get_from_field= bh->ci->window_tab_32bit[window].get_from_field;
683
684 val = mv64x60_read(bh, base_reg);
685 *base = get_from_field(val, base_bits);
686
687 if (size_reg != 0) {
688 val = mv64x60_read(bh, size_reg);
689 val = get_from_field(val, size_bits);
690 *size = bh->ci->untranslate_size(*base, val, size_bits);
691 } else
692 *size = 0;
693 } else {
694 *base = 0;
695 *size = 0;
696 }
697
698 pr_debug("get 32bit window: %d, base: 0x%x, size: 0x%x\n",
699 window, *base, *size);
700}
701
702/*
703 * mv64x60_set_32bit_window()
704 *
705 * Set the base address and size of a 32-bit window on the bridge.
706 */
707void __init
708mv64x60_set_32bit_window(struct mv64x60_handle *bh, u32 window,
709 u32 base, u32 size, u32 other_bits)
710{
711 u32 val, base_reg, size_reg, base_bits, size_bits;
712 u32 (*map_to_field)(u32 val, u32 num_bits);
713
714 pr_debug("set 32bit window: %d, base: 0x%x, size: 0x%x, other: 0x%x\n",
715 window, base, size, other_bits);
716
717 base_reg = bh->ci->window_tab_32bit[window].base_reg;
718
719 if (base_reg != 0) {
720 size_reg = bh->ci->window_tab_32bit[window].size_reg;
721 base_bits = bh->ci->window_tab_32bit[window].base_bits;
722 size_bits = bh->ci->window_tab_32bit[window].size_bits;
723 map_to_field = bh->ci->window_tab_32bit[window].map_to_field;
724
725 val = map_to_field(base, base_bits) | other_bits;
726 mv64x60_write(bh, base_reg, val);
727
728 if (size_reg != 0) {
729 val = bh->ci->translate_size(base, size, size_bits);
730 val = map_to_field(val, size_bits);
731 mv64x60_write(bh, size_reg, val);
732 }
733
734 (void)mv64x60_read(bh, base_reg); /* Flush FIFO */
735 }
736}
737
738/*
739 * mv64x60_get_64bit_window()
740 *
741 * Determine the base address and size of a 64-bit window on the bridge.
742 */
743void __init
744mv64x60_get_64bit_window(struct mv64x60_handle *bh, u32 window,
745 u32 *base_hi, u32 *base_lo, u32 *size)
746{
747 u32 val, base_lo_reg, size_reg, base_lo_bits, size_bits;
748 u32 (*get_from_field)(u32 val, u32 num_bits);
749
750 base_lo_reg = bh->ci->window_tab_64bit[window].base_lo_reg;
751
752 if (base_lo_reg != 0) {
753 size_reg = bh->ci->window_tab_64bit[window].size_reg;
754 base_lo_bits = bh->ci->window_tab_64bit[window].base_lo_bits;
755 size_bits = bh->ci->window_tab_64bit[window].size_bits;
756 get_from_field= bh->ci->window_tab_64bit[window].get_from_field;
757
758 *base_hi = mv64x60_read(bh,
759 bh->ci->window_tab_64bit[window].base_hi_reg);
760
761 val = mv64x60_read(bh, base_lo_reg);
762 *base_lo = get_from_field(val, base_lo_bits);
763
764 if (size_reg != 0) {
765 val = mv64x60_read(bh, size_reg);
766 val = get_from_field(val, size_bits);
767 *size = bh->ci->untranslate_size(*base_lo, val,
768 size_bits);
769 } else
770 *size = 0;
771 } else {
772 *base_hi = 0;
773 *base_lo = 0;
774 *size = 0;
775 }
776
777 pr_debug("get 64bit window: %d, base hi: 0x%x, base lo: 0x%x, "
778 "size: 0x%x\n", window, *base_hi, *base_lo, *size);
779}
780
781/*
782 * mv64x60_set_64bit_window()
783 *
784 * Set the base address and size of a 64-bit window on the bridge.
785 */
786void __init
787mv64x60_set_64bit_window(struct mv64x60_handle *bh, u32 window,
788 u32 base_hi, u32 base_lo, u32 size, u32 other_bits)
789{
790 u32 val, base_lo_reg, size_reg, base_lo_bits, size_bits;
791 u32 (*map_to_field)(u32 val, u32 num_bits);
792
793 pr_debug("set 64bit window: %d, base hi: 0x%x, base lo: 0x%x, "
794 "size: 0x%x, other: 0x%x\n",
795 window, base_hi, base_lo, size, other_bits);
796
797 base_lo_reg = bh->ci->window_tab_64bit[window].base_lo_reg;
798
799 if (base_lo_reg != 0) {
800 size_reg = bh->ci->window_tab_64bit[window].size_reg;
801 base_lo_bits = bh->ci->window_tab_64bit[window].base_lo_bits;
802 size_bits = bh->ci->window_tab_64bit[window].size_bits;
803 map_to_field = bh->ci->window_tab_64bit[window].map_to_field;
804
805 mv64x60_write(bh, bh->ci->window_tab_64bit[window].base_hi_reg,
806 base_hi);
807
808 val = map_to_field(base_lo, base_lo_bits) | other_bits;
809 mv64x60_write(bh, base_lo_reg, val);
810
811 if (size_reg != 0) {
812 val = bh->ci->translate_size(base_lo, size, size_bits);
813 val = map_to_field(val, size_bits);
814 mv64x60_write(bh, size_reg, val);
815 }
816
817 (void)mv64x60_read(bh, base_lo_reg); /* Flush FIFO */
818 }
819}
820
821/*
822 * mv64x60_mask()
823 *
824 * Take the high-order 'num_bits' of 'val' & mask off low bits.
825 */
826u32 __init
827mv64x60_mask(u32 val, u32 num_bits)
828{
829 return val & (0xffffffff << (32 - num_bits));
830}
831
832/*
833 * mv64x60_shift_left()
834 *
835 * Take the low-order 'num_bits' of 'val', shift left to align at bit 31 (MSB).
836 */
837u32 __init
838mv64x60_shift_left(u32 val, u32 num_bits)
839{
840 return val << (32 - num_bits);
841}
842
843/*
844 * mv64x60_shift_right()
845 *
846 * Take the high-order 'num_bits' of 'val', shift right to align at bit 0 (LSB).
847 */
848u32 __init
849mv64x60_shift_right(u32 val, u32 num_bits)
850{
851 return val >> (32 - num_bits);
852}
853
854/*
855 *****************************************************************************
856 *
857 * Chip Identification Routines
858 *
859 *****************************************************************************
860 */
861/*
862 * mv64x60_get_type()
863 *
864 * Determine the type of bridge chip we have.
865 */
866int __init
867mv64x60_get_type(struct mv64x60_handle *bh)
868{
869 struct pci_controller hose;
870 u16 val;
871 u8 save_exclude;
872
873 memset(&hose, 0, sizeof(hose));
874 setup_indirect_pci_nomap(&hose, bh->v_base + MV64x60_PCI0_CONFIG_ADDR,
875 bh->v_base + MV64x60_PCI0_CONFIG_DATA);
876
877 save_exclude = mv64x60_pci_exclude_bridge;
878 mv64x60_pci_exclude_bridge = 0;
879 /* Sanity check of bridge's Vendor ID */
880 early_read_config_word(&hose, 0, PCI_DEVFN(0, 0), PCI_VENDOR_ID, &val);
881
882 if (val != PCI_VENDOR_ID_MARVELL) {
883 mv64x60_pci_exclude_bridge = save_exclude;
884 return -1;
885 }
886
887 /* Get the revision of the chip */
888 early_read_config_word(&hose, 0, PCI_DEVFN(0, 0), PCI_CLASS_REVISION,
889 &val);
890 bh->rev = (u32)(val & 0xff);
891
892 /* Figure out the type of Marvell bridge it is */
893 early_read_config_word(&hose, 0, PCI_DEVFN(0, 0), PCI_DEVICE_ID, &val);
894 mv64x60_pci_exclude_bridge = save_exclude;
895
896 switch (val) {
897 case PCI_DEVICE_ID_MARVELL_GT64260:
898 switch (bh->rev) {
899 case GT64260_REV_A:
900 bh->type = MV64x60_TYPE_GT64260A;
901 break;
902
903 default:
904 printk(KERN_WARNING "Unsupported GT64260 rev %04x\n",
905 bh->rev);
906 /* Assume its similar to a 'B' rev and fallthru */
907 case GT64260_REV_B:
908 bh->type = MV64x60_TYPE_GT64260B;
909 break;
910 }
911 break;
912
913 case PCI_DEVICE_ID_MARVELL_MV64360:
914 /* Marvell won't tell me how to distinguish a 64361 & 64362 */
915 bh->type = MV64x60_TYPE_MV64360;
916 break;
917
918 case PCI_DEVICE_ID_MARVELL_MV64460:
919 bh->type = MV64x60_TYPE_MV64460;
920 break;
921
922 default:
923 printk(KERN_ERR "Unknown Marvell bridge type %04x\n", val);
924 return -1;
925 }
926
927 /* Hang onto bridge type & rev for PIC code */
928 mv64x60_bridge_type = bh->type;
929 mv64x60_bridge_rev = bh->rev;
930
931 return 0;
932}
933
934/*
935 * mv64x60_setup_for_chip()
936 *
937 * Set 'bh' to use the proper set of routine for the bridge chip that we have.
938 */
939int __init
940mv64x60_setup_for_chip(struct mv64x60_handle *bh)
941{
942 int rc = 0;
943
944 /* Set up chip-specific info based on the chip/bridge type */
945 switch(bh->type) {
946 case MV64x60_TYPE_GT64260A:
947 bh->ci = &gt64260a_ci;
948 break;
949
950 case MV64x60_TYPE_GT64260B:
951 bh->ci = &gt64260b_ci;
952 break;
953
954 case MV64x60_TYPE_MV64360:
955 bh->ci = &mv64360_ci;
956 break;
957
958 case MV64x60_TYPE_MV64460:
959 bh->ci = &mv64460_ci;
960 break;
961
962 case MV64x60_TYPE_INVALID:
963 default:
964 if (ppc_md.progress)
965 ppc_md.progress("mv64x60: Unsupported bridge", 0x0);
966 printk(KERN_ERR "mv64x60: Unsupported bridge\n");
967 rc = -1;
968 }
969
970 return rc;
971}
972
973/*
974 * mv64x60_get_bridge_vbase()
975 *
976 * Return the virtual address of the bridge's registers.
977 */
978void __iomem *
979mv64x60_get_bridge_vbase(void)
980{
981 return mv64x60_bridge_vbase;
982}
983
984/*
985 * mv64x60_get_bridge_type()
986 *
987 * Return the type of bridge on the platform.
988 */
989u32
990mv64x60_get_bridge_type(void)
991{
992 return mv64x60_bridge_type;
993}
994
995/*
996 * mv64x60_get_bridge_rev()
997 *
998 * Return the revision of the bridge on the platform.
999 */
1000u32
1001mv64x60_get_bridge_rev(void)
1002{
1003 return mv64x60_bridge_rev;
1004}
1005
1006/*
1007 *****************************************************************************
1008 *
1009 * System Memory Window Related Routines
1010 *
1011 *****************************************************************************
1012 */
1013/*
1014 * mv64x60_get_mem_size()
1015 *
1016 * Calculate the amount of memory that the memory controller is set up for.
1017 * This should only be used by board-specific code if there is no other
1018 * way to determine the amount of memory in the system.
1019 */
1020u32 __init
1021mv64x60_get_mem_size(u32 bridge_base, u32 chip_type)
1022{
1023 struct mv64x60_handle bh;
1024 u32 mem_windows[MV64x60_CPU2MEM_WINDOWS][2];
1025 u32 rc = 0;
1026
1027 memset(&bh, 0, sizeof(bh));
1028
1029 bh.type = chip_type;
1030 bh.v_base = (void *)bridge_base;
1031
1032 if (!mv64x60_setup_for_chip(&bh)) {
1033 mv64x60_get_mem_windows(&bh, mem_windows);
1034 rc = mv64x60_calc_mem_size(&bh, mem_windows);
1035 }
1036
1037 return rc;
1038}
1039
1040/*
1041 * mv64x60_get_mem_windows()
1042 *
1043 * Get the values in the memory controller & return in the 'mem_windows' array.
1044 */
1045void __init
1046mv64x60_get_mem_windows(struct mv64x60_handle *bh,
1047 u32 mem_windows[MV64x60_CPU2MEM_WINDOWS][2])
1048{
1049 u32 i, win;
1050
1051 for (win=MV64x60_CPU2MEM_0_WIN,i=0;win<=MV64x60_CPU2MEM_3_WIN;win++,i++)
1052 if (bh->ci->is_enabled_32bit(bh, win))
1053 mv64x60_get_32bit_window(bh, win,
1054 &mem_windows[i][0], &mem_windows[i][1]);
1055 else {
1056 mem_windows[i][0] = 0;
1057 mem_windows[i][1] = 0;
1058 }
1059}
1060
1061/*
1062 * mv64x60_calc_mem_size()
1063 *
1064 * Using the memory controller register values in 'mem_windows', determine
1065 * how much memory it is set up for.
1066 */
1067u32 __init
1068mv64x60_calc_mem_size(struct mv64x60_handle *bh,
1069 u32 mem_windows[MV64x60_CPU2MEM_WINDOWS][2])
1070{
1071 u32 i, total = 0;
1072
1073 for (i=0; i<MV64x60_CPU2MEM_WINDOWS; i++)
1074 total += mem_windows[i][1];
1075
1076 return total;
1077}
1078
1079/*
1080 *****************************************************************************
1081 *
1082 * CPU->System MEM, PCI Config Routines
1083 *
1084 *****************************************************************************
1085 */
1086/*
1087 * mv64x60_config_cpu2mem_windows()
1088 *
1089 * Configure CPU->Memory windows on the bridge.
1090 */
1091static u32 prot_tab[] __initdata = {
1092 MV64x60_CPU_PROT_0_WIN, MV64x60_CPU_PROT_1_WIN,
1093 MV64x60_CPU_PROT_2_WIN, MV64x60_CPU_PROT_3_WIN
1094};
1095
1096static u32 cpu_snoop_tab[] __initdata = {
1097 MV64x60_CPU_SNOOP_0_WIN, MV64x60_CPU_SNOOP_1_WIN,
1098 MV64x60_CPU_SNOOP_2_WIN, MV64x60_CPU_SNOOP_3_WIN
1099};
1100
1101void __init
1102mv64x60_config_cpu2mem_windows(struct mv64x60_handle *bh,
1103 struct mv64x60_setup_info *si,
1104 u32 mem_windows[MV64x60_CPU2MEM_WINDOWS][2])
1105{
1106 u32 i, win;
1107
1108 /* Set CPU protection & snoop windows */
1109 for (win=MV64x60_CPU2MEM_0_WIN,i=0;win<=MV64x60_CPU2MEM_3_WIN;win++,i++)
1110 if (bh->ci->is_enabled_32bit(bh, win)) {
1111 mv64x60_set_32bit_window(bh, prot_tab[i],
1112 mem_windows[i][0], mem_windows[i][1],
1113 si->cpu_prot_options[i]);
1114 bh->ci->enable_window_32bit(bh, prot_tab[i]);
1115
1116 if (bh->ci->window_tab_32bit[cpu_snoop_tab[i]].
1117 base_reg != 0) {
1118 mv64x60_set_32bit_window(bh, cpu_snoop_tab[i],
1119 mem_windows[i][0], mem_windows[i][1],
1120 si->cpu_snoop_options[i]);
1121 bh->ci->enable_window_32bit(bh,
1122 cpu_snoop_tab[i]);
1123 }
1124
1125 }
1126}
1127
1128/*
1129 * mv64x60_config_cpu2pci_windows()
1130 *
1131 * Configure the CPU->PCI windows for one of the PCI buses.
1132 */
1133static u32 win_tab[2][4] __initdata = {
1134 { MV64x60_CPU2PCI0_IO_WIN, MV64x60_CPU2PCI0_MEM_0_WIN,
1135 MV64x60_CPU2PCI0_MEM_1_WIN, MV64x60_CPU2PCI0_MEM_2_WIN },
1136 { MV64x60_CPU2PCI1_IO_WIN, MV64x60_CPU2PCI1_MEM_0_WIN,
1137 MV64x60_CPU2PCI1_MEM_1_WIN, MV64x60_CPU2PCI1_MEM_2_WIN },
1138};
1139
1140static u32 remap_tab[2][4] __initdata = {
1141 { MV64x60_CPU2PCI0_IO_REMAP_WIN, MV64x60_CPU2PCI0_MEM_0_REMAP_WIN,
1142 MV64x60_CPU2PCI0_MEM_1_REMAP_WIN, MV64x60_CPU2PCI0_MEM_2_REMAP_WIN },
1143 { MV64x60_CPU2PCI1_IO_REMAP_WIN, MV64x60_CPU2PCI1_MEM_0_REMAP_WIN,
1144 MV64x60_CPU2PCI1_MEM_1_REMAP_WIN, MV64x60_CPU2PCI1_MEM_2_REMAP_WIN }
1145};
1146
1147void __init
1148mv64x60_config_cpu2pci_windows(struct mv64x60_handle *bh,
1149 struct mv64x60_pci_info *pi, u32 bus)
1150{
1151 int i;
1152
1153 if (pi->pci_io.size > 0) {
1154 mv64x60_set_32bit_window(bh, win_tab[bus][0],
1155 pi->pci_io.cpu_base, pi->pci_io.size, pi->pci_io.swap);
1156 mv64x60_set_32bit_window(bh, remap_tab[bus][0],
1157 pi->pci_io.pci_base_lo, 0, 0);
1158 bh->ci->enable_window_32bit(bh, win_tab[bus][0]);
1159 } else /* Actually, the window should already be disabled */
1160 bh->ci->disable_window_32bit(bh, win_tab[bus][0]);
1161
1162 for (i=0; i<3; i++)
1163 if (pi->pci_mem[i].size > 0) {
1164 mv64x60_set_32bit_window(bh, win_tab[bus][i+1],
1165 pi->pci_mem[i].cpu_base, pi->pci_mem[i].size,
1166 pi->pci_mem[i].swap);
1167 mv64x60_set_64bit_window(bh, remap_tab[bus][i+1],
1168 pi->pci_mem[i].pci_base_hi,
1169 pi->pci_mem[i].pci_base_lo, 0, 0);
1170 bh->ci->enable_window_32bit(bh, win_tab[bus][i+1]);
1171 } else /* Actually, the window should already be disabled */
1172 bh->ci->disable_window_32bit(bh, win_tab[bus][i+1]);
1173}
1174
1175/*
1176 *****************************************************************************
1177 *
1178 * PCI->System MEM Config Routines
1179 *
1180 *****************************************************************************
1181 */
1182/*
1183 * mv64x60_config_pci2mem_windows()
1184 *
1185 * Configure the PCI->Memory windows on the bridge.
1186 */
1187static u32 pci_acc_tab[2][4] __initdata = {
1188 { MV64x60_PCI02MEM_ACC_CNTL_0_WIN, MV64x60_PCI02MEM_ACC_CNTL_1_WIN,
1189 MV64x60_PCI02MEM_ACC_CNTL_2_WIN, MV64x60_PCI02MEM_ACC_CNTL_3_WIN },
1190 { MV64x60_PCI12MEM_ACC_CNTL_0_WIN, MV64x60_PCI12MEM_ACC_CNTL_1_WIN,
1191 MV64x60_PCI12MEM_ACC_CNTL_2_WIN, MV64x60_PCI12MEM_ACC_CNTL_3_WIN }
1192};
1193
1194static u32 pci_snoop_tab[2][4] __initdata = {
1195 { MV64x60_PCI02MEM_SNOOP_0_WIN, MV64x60_PCI02MEM_SNOOP_1_WIN,
1196 MV64x60_PCI02MEM_SNOOP_2_WIN, MV64x60_PCI02MEM_SNOOP_3_WIN },
1197 { MV64x60_PCI12MEM_SNOOP_0_WIN, MV64x60_PCI12MEM_SNOOP_1_WIN,
1198 MV64x60_PCI12MEM_SNOOP_2_WIN, MV64x60_PCI12MEM_SNOOP_3_WIN }
1199};
1200
1201static u32 pci_size_tab[2][4] __initdata = {
1202 { MV64x60_PCI0_MEM_0_SIZE, MV64x60_PCI0_MEM_1_SIZE,
1203 MV64x60_PCI0_MEM_2_SIZE, MV64x60_PCI0_MEM_3_SIZE },
1204 { MV64x60_PCI1_MEM_0_SIZE, MV64x60_PCI1_MEM_1_SIZE,
1205 MV64x60_PCI1_MEM_2_SIZE, MV64x60_PCI1_MEM_3_SIZE }
1206};
1207
1208void __init
1209mv64x60_config_pci2mem_windows(struct mv64x60_handle *bh,
1210 struct pci_controller *hose, struct mv64x60_pci_info *pi,
1211 u32 bus, u32 mem_windows[MV64x60_CPU2MEM_WINDOWS][2])
1212{
1213 u32 i, win;
1214
1215 /*
1216 * Set the access control, snoop, BAR size, and window base addresses.
1217 * PCI->MEM windows base addresses will match exactly what the
1218 * CPU->MEM windows are.
1219 */
1220 for (win=MV64x60_CPU2MEM_0_WIN,i=0;win<=MV64x60_CPU2MEM_3_WIN;win++,i++)
1221 if (bh->ci->is_enabled_32bit(bh, win)) {
1222 mv64x60_set_64bit_window(bh,
1223 pci_acc_tab[bus][i], 0,
1224 mem_windows[i][0], mem_windows[i][1],
1225 pi->acc_cntl_options[i]);
1226 bh->ci->enable_window_64bit(bh, pci_acc_tab[bus][i]);
1227
1228 if (bh->ci->window_tab_64bit[
1229 pci_snoop_tab[bus][i]].base_lo_reg != 0) {
1230
1231 mv64x60_set_64bit_window(bh,
1232 pci_snoop_tab[bus][i], 0,
1233 mem_windows[i][0], mem_windows[i][1],
1234 pi->snoop_options[i]);
1235 bh->ci->enable_window_64bit(bh,
1236 pci_snoop_tab[bus][i]);
1237 }
1238
1239 bh->ci->set_pci2mem_window(hose, bus, i,
1240 mem_windows[i][0]);
1241 mv64x60_write(bh, pci_size_tab[bus][i],
1242 mv64x60_mask(mem_windows[i][1] - 1, 20));
1243
1244 /* Enable the window */
1245 mv64x60_clr_bits(bh, ((bus == 0) ?
1246 MV64x60_PCI0_BAR_ENABLE :
1247 MV64x60_PCI1_BAR_ENABLE), (1 << i));
1248 }
1249}
1250
1251/*
1252 *****************************************************************************
1253 *
1254 * Hose & Resource Alloc/Init Routines
1255 *
1256 *****************************************************************************
1257 */
1258/*
1259 * mv64x60_alloc_hoses()
1260 *
1261 * Allocate the PCI hose structures for the bridge's PCI buses.
1262 */
1263void __init
1264mv64x60_alloc_hose(struct mv64x60_handle *bh, u32 cfg_addr, u32 cfg_data,
1265 struct pci_controller **hose)
1266{
1267 *hose = pcibios_alloc_controller();
1268 setup_indirect_pci_nomap(*hose, bh->v_base + cfg_addr,
1269 bh->v_base + cfg_data);
1270}
1271
1272/*
1273 * mv64x60_config_resources()
1274 *
1275 * Calculate the offsets, etc. for the hose structures to reflect all of
1276 * the address remapping that happens as you go from CPU->PCI and PCI->MEM.
1277 */
1278void __init
1279mv64x60_config_resources(struct pci_controller *hose,
1280 struct mv64x60_pci_info *pi, u32 io_base)
1281{
1282 int i;
1283 /* 2 hoses; 4 resources/hose; string <= 64 bytes */
1284 static char s[2][4][64];
1285
1286 if (pi->pci_io.size != 0) {
1287 sprintf(s[hose->index][0], "PCI hose %d I/O Space",
1288 hose->index);
1289 pci_init_resource(&hose->io_resource, io_base - isa_io_base,
1290 io_base - isa_io_base + pi->pci_io.size - 1,
1291 IORESOURCE_IO, s[hose->index][0]);
1292 hose->io_space.start = pi->pci_io.pci_base_lo;
1293 hose->io_space.end = pi->pci_io.pci_base_lo + pi->pci_io.size-1;
1294 hose->io_base_phys = pi->pci_io.cpu_base;
1295 hose->io_base_virt = (void *)isa_io_base;
1296 }
1297
1298 for (i=0; i<3; i++)
1299 if (pi->pci_mem[i].size != 0) {
1300 sprintf(s[hose->index][i+1], "PCI hose %d MEM Space %d",
1301 hose->index, i);
1302 pci_init_resource(&hose->mem_resources[i],
1303 pi->pci_mem[i].cpu_base,
1304 pi->pci_mem[i].cpu_base + pi->pci_mem[i].size-1,
1305 IORESOURCE_MEM, s[hose->index][i+1]);
1306 }
1307
1308 hose->mem_space.end = pi->pci_mem[0].pci_base_lo +
1309 pi->pci_mem[0].size - 1;
1310 hose->pci_mem_offset = pi->pci_mem[0].cpu_base -
1311 pi->pci_mem[0].pci_base_lo;
1312}
1313
1314/*
1315 * mv64x60_config_pci_params()
1316 *
1317 * Configure a hose's PCI config space parameters.
1318 */
1319void __init
1320mv64x60_config_pci_params(struct pci_controller *hose,
1321 struct mv64x60_pci_info *pi)
1322{
1323 u32 devfn;
1324 u16 u16_val;
1325 u8 save_exclude;
1326
1327 devfn = PCI_DEVFN(0,0);
1328
1329 save_exclude = mv64x60_pci_exclude_bridge;
1330 mv64x60_pci_exclude_bridge = 0;
1331
1332 /* Set class code to indicate host bridge */
1333 u16_val = PCI_CLASS_BRIDGE_HOST; /* 0x0600 (host bridge) */
1334 early_write_config_word(hose, 0, devfn, PCI_CLASS_DEVICE, u16_val);
1335
1336 /* Enable bridge to be PCI master & respond to PCI MEM cycles */
1337 early_read_config_word(hose, 0, devfn, PCI_COMMAND, &u16_val);
1338 u16_val &= ~(PCI_COMMAND_IO | PCI_COMMAND_INVALIDATE |
1339 PCI_COMMAND_PARITY | PCI_COMMAND_SERR | PCI_COMMAND_FAST_BACK);
1340 u16_val |= pi->pci_cmd_bits | PCI_COMMAND_MASTER | PCI_COMMAND_MEMORY;
1341 early_write_config_word(hose, 0, devfn, PCI_COMMAND, u16_val);
1342
1343 /* Set latency timer, cache line size, clear BIST */
1344 u16_val = (pi->latency_timer << 8) | (L1_CACHE_BYTES >> 2);
1345 early_write_config_word(hose, 0, devfn, PCI_CACHE_LINE_SIZE, u16_val);
1346
1347 mv64x60_pci_exclude_bridge = save_exclude;
1348}
1349
1350/*
1351 *****************************************************************************
1352 *
1353 * PCI Related Routine
1354 *
1355 *****************************************************************************
1356 */
1357/*
1358 * mv64x60_set_bus()
1359 *
1360 * Set the bus number for the hose directly under the bridge.
1361 */
1362void __init
1363mv64x60_set_bus(struct mv64x60_handle *bh, u32 bus, u32 child_bus)
1364{
1365 struct pci_controller *hose;
1366 u32 pci_mode, p2p_cfg, pci_cfg_offset, val;
1367 u8 save_exclude;
1368
1369 if (bus == 0) {
1370 pci_mode = bh->pci_mode_a;
1371 p2p_cfg = MV64x60_PCI0_P2P_CONFIG;
1372 pci_cfg_offset = 0x64;
1373 hose = bh->hose_a;
1374 } else {
1375 pci_mode = bh->pci_mode_b;
1376 p2p_cfg = MV64x60_PCI1_P2P_CONFIG;
1377 pci_cfg_offset = 0xe4;
1378 hose = bh->hose_b;
1379 }
1380
1381 child_bus &= 0xff;
1382 val = mv64x60_read(bh, p2p_cfg);
1383
1384 if (pci_mode == MV64x60_PCIMODE_CONVENTIONAL) {
1385 val &= 0xe0000000; /* Force dev num to 0, turn off P2P bridge */
1386 val |= (child_bus << 16) | 0xff;
1387 mv64x60_write(bh, p2p_cfg, val);
1388 (void)mv64x60_read(bh, p2p_cfg); /* Flush FIFO */
1389 } else { /* PCI-X */
1390 /*
1391 * Need to use the current bus/dev number (that's in the
1392 * P2P CONFIG reg) to access the bridge's pci config space.
1393 */
1394 save_exclude = mv64x60_pci_exclude_bridge;
1395 mv64x60_pci_exclude_bridge = 0;
1396 early_write_config_dword(hose, (val & 0x00ff0000) >> 16,
1397 PCI_DEVFN(((val & 0x1f000000) >> 24), 0),
1398 pci_cfg_offset, child_bus << 8);
1399 mv64x60_pci_exclude_bridge = save_exclude;
1400 }
1401}
1402
1403/*
1404 * mv64x60_pci_exclude_device()
1405 *
1406 * This routine is used to make the bridge not appear when the
1407 * PCI subsystem is accessing PCI devices (in PCI config space).
1408 */
1409int
1410mv64x60_pci_exclude_device(u8 bus, u8 devfn)
1411{
1412 struct pci_controller *hose;
1413
1414 hose = pci_bus_to_hose(bus);
1415
1416 /* Skip slot 0 on both hoses */
1417 if ((mv64x60_pci_exclude_bridge == 1) && (PCI_SLOT(devfn) == 0) &&
1418 (hose->first_busno == bus))
1419
1420 return PCIBIOS_DEVICE_NOT_FOUND;
1421 else
1422 return PCIBIOS_SUCCESSFUL;
1423} /* mv64x60_pci_exclude_device() */
1424
1425/*
1426 *****************************************************************************
1427 *
1428 * Platform Device Routines
1429 *
1430 *****************************************************************************
1431 */
1432
1433/*
1434 * mv64x60_pd_fixup()
1435 *
1436 * Need to add the base addr of where the bridge's regs are mapped in the
1437 * physical addr space so drivers can ioremap() them.
1438 */
1439void __init
1440mv64x60_pd_fixup(struct mv64x60_handle *bh, struct platform_device *pd_devs[],
1441 u32 entries)
1442{
1443 struct resource *r;
1444 u32 i, j;
1445
1446 for (i=0; i<entries; i++) {
1447 j = 0;
1448
1449 while ((r = platform_get_resource(pd_devs[i],IORESOURCE_MEM,j))
1450 != NULL) {
1451
1452 r->start += bh->p_base;
1453 r->end += bh->p_base;
1454 j++;
1455 }
1456 }
1457}
1458
1459/*
1460 * mv64x60_add_pds()
1461 *
1462 * Add the mv64x60 platform devices to the list of platform devices.
1463 */
1464static int __init
1465mv64x60_add_pds(void)
1466{
1467 return platform_add_devices(mv64x60_pd_devs,
1468 ARRAY_SIZE(mv64x60_pd_devs));
1469}
1470arch_initcall(mv64x60_add_pds);
1471
1472/*
1473 *****************************************************************************
1474 *
1475 * GT64260-Specific Routines
1476 *
1477 *****************************************************************************
1478 */
1479/*
1480 * gt64260_translate_size()
1481 *
1482 * On the GT64260, the size register is really the "top" address of the window.
1483 */
1484static u32 __init
1485gt64260_translate_size(u32 base, u32 size, u32 num_bits)
1486{
1487 return base + mv64x60_mask(size - 1, num_bits);
1488}
1489
1490/*
1491 * gt64260_untranslate_size()
1492 *
1493 * Translate the top address of a window into a window size.
1494 */
1495static u32 __init
1496gt64260_untranslate_size(u32 base, u32 size, u32 num_bits)
1497{
1498 if (size >= base)
1499 size = size - base + (1 << (32 - num_bits));
1500 else
1501 size = 0;
1502
1503 return size;
1504}
1505
1506/*
1507 * gt64260_set_pci2mem_window()
1508 *
1509 * The PCI->MEM window registers are actually in PCI config space so need
1510 * to set them by setting the correct config space BARs.
1511 */
1512static u32 gt64260_reg_addrs[2][4] __initdata = {
1513 { 0x10, 0x14, 0x18, 0x1c }, { 0x90, 0x94, 0x98, 0x9c }
1514};
1515
1516static void __init
1517gt64260_set_pci2mem_window(struct pci_controller *hose, u32 bus, u32 window,
1518 u32 base)
1519{
1520 u8 save_exclude;
1521
1522 pr_debug("set pci->mem window: %d, hose: %d, base: 0x%x\n", window,
1523 hose->index, base);
1524
1525 save_exclude = mv64x60_pci_exclude_bridge;
1526 mv64x60_pci_exclude_bridge = 0;
1527 early_write_config_dword(hose, 0, PCI_DEVFN(0, 0),
1528 gt64260_reg_addrs[bus][window], mv64x60_mask(base, 20) | 0x8);
1529 mv64x60_pci_exclude_bridge = save_exclude;
1530}
1531
1532/*
1533 * gt64260_set_pci2regs_window()
1534 *
1535 * Set where the bridge's registers appear in PCI MEM space.
1536 */
1537static u32 gt64260_offset[2] __initdata = {0x20, 0xa0};
1538
1539static void __init
1540gt64260_set_pci2regs_window(struct mv64x60_handle *bh,
1541 struct pci_controller *hose, u32 bus, u32 base)
1542{
1543 u8 save_exclude;
1544
1545 pr_debug("set pci->internal regs hose: %d, base: 0x%x\n", hose->index,
1546 base);
1547
1548 save_exclude = mv64x60_pci_exclude_bridge;
1549 mv64x60_pci_exclude_bridge = 0;
1550 early_write_config_dword(hose, 0, PCI_DEVFN(0,0), gt64260_offset[bus],
1551 (base << 16));
1552 mv64x60_pci_exclude_bridge = save_exclude;
1553}
1554
1555/*
1556 * gt64260_is_enabled_32bit()
1557 *
1558 * On a GT64260, a window is enabled iff its top address is >= to its base
1559 * address.
1560 */
1561static u32 __init
1562gt64260_is_enabled_32bit(struct mv64x60_handle *bh, u32 window)
1563{
1564 u32 rc = 0;
1565
1566 if ((gt64260_32bit_windows[window].base_reg != 0) &&
1567 (gt64260_32bit_windows[window].size_reg != 0) &&
1568 ((mv64x60_read(bh, gt64260_32bit_windows[window].size_reg) &
1569 ((1 << gt64260_32bit_windows[window].size_bits) - 1)) >=
1570 (mv64x60_read(bh, gt64260_32bit_windows[window].base_reg) &
1571 ((1 << gt64260_32bit_windows[window].base_bits) - 1))))
1572
1573 rc = 1;
1574
1575 return rc;
1576}
1577
1578/*
1579 * gt64260_enable_window_32bit()
1580 *
1581 * On the GT64260, a window is enabled iff the top address is >= to the base
1582 * address of the window. Since the window has already been configured by
1583 * the time this routine is called, we have nothing to do here.
1584 */
1585static void __init
1586gt64260_enable_window_32bit(struct mv64x60_handle *bh, u32 window)
1587{
1588 pr_debug("enable 32bit window: %d\n", window);
1589}
1590
1591/*
1592 * gt64260_disable_window_32bit()
1593 *
1594 * On a GT64260, you disable a window by setting its top address to be less
1595 * than its base address.
1596 */
1597static void __init
1598gt64260_disable_window_32bit(struct mv64x60_handle *bh, u32 window)
1599{
1600 pr_debug("disable 32bit window: %d, base_reg: 0x%x, size_reg: 0x%x\n",
1601 window, gt64260_32bit_windows[window].base_reg,
1602 gt64260_32bit_windows[window].size_reg);
1603
1604 if ((gt64260_32bit_windows[window].base_reg != 0) &&
1605 (gt64260_32bit_windows[window].size_reg != 0)) {
1606
1607 /* To disable, make bottom reg higher than top reg */
1608 mv64x60_write(bh, gt64260_32bit_windows[window].base_reg,0xfff);
1609 mv64x60_write(bh, gt64260_32bit_windows[window].size_reg, 0);
1610 }
1611}
1612
1613/*
1614 * gt64260_enable_window_64bit()
1615 *
1616 * On the GT64260, a window is enabled iff the top address is >= to the base
1617 * address of the window. Since the window has already been configured by
1618 * the time this routine is called, we have nothing to do here.
1619 */
1620static void __init
1621gt64260_enable_window_64bit(struct mv64x60_handle *bh, u32 window)
1622{
1623 pr_debug("enable 64bit window: %d\n", window);
1624}
1625
1626/*
1627 * gt64260_disable_window_64bit()
1628 *
1629 * On a GT64260, you disable a window by setting its top address to be less
1630 * than its base address.
1631 */
1632static void __init
1633gt64260_disable_window_64bit(struct mv64x60_handle *bh, u32 window)
1634{
1635 pr_debug("disable 64bit window: %d, base_reg: 0x%x, size_reg: 0x%x\n",
1636 window, gt64260_64bit_windows[window].base_lo_reg,
1637 gt64260_64bit_windows[window].size_reg);
1638
1639 if ((gt64260_64bit_windows[window].base_lo_reg != 0) &&
1640 (gt64260_64bit_windows[window].size_reg != 0)) {
1641
1642 /* To disable, make bottom reg higher than top reg */
1643 mv64x60_write(bh, gt64260_64bit_windows[window].base_lo_reg,
1644 0xfff);
1645 mv64x60_write(bh, gt64260_64bit_windows[window].base_hi_reg, 0);
1646 mv64x60_write(bh, gt64260_64bit_windows[window].size_reg, 0);
1647 }
1648}
1649
1650/*
1651 * gt64260_disable_all_windows()
1652 *
1653 * The GT64260 has several windows that aren't represented in the table of
1654 * windows at the top of this file. This routine turns all of them off
1655 * except for the memory controller windows, of course.
1656 */
1657static void __init
1658gt64260_disable_all_windows(struct mv64x60_handle *bh,
1659 struct mv64x60_setup_info *si)
1660{
1661 u32 i, preserve;
1662
1663 /* Disable 32bit windows (don't disable cpu->mem windows) */
1664 for (i=MV64x60_CPU2DEV_0_WIN; i<MV64x60_32BIT_WIN_COUNT; i++) {
1665 if (i < 32)
1666 preserve = si->window_preserve_mask_32_lo & (1 << i);
1667 else
1668 preserve = si->window_preserve_mask_32_hi & (1<<(i-32));
1669
1670 if (!preserve)
1671 gt64260_disable_window_32bit(bh, i);
1672 }
1673
1674 /* Disable 64bit windows */
1675 for (i=0; i<MV64x60_64BIT_WIN_COUNT; i++)
1676 if (!(si->window_preserve_mask_64 & (1<<i)))
1677 gt64260_disable_window_64bit(bh, i);
1678
1679 /* Turn off cpu protection windows not in gt64260_32bit_windows[] */
1680 mv64x60_write(bh, GT64260_CPU_PROT_BASE_4, 0xfff);
1681 mv64x60_write(bh, GT64260_CPU_PROT_SIZE_4, 0);
1682 mv64x60_write(bh, GT64260_CPU_PROT_BASE_5, 0xfff);
1683 mv64x60_write(bh, GT64260_CPU_PROT_SIZE_5, 0);
1684 mv64x60_write(bh, GT64260_CPU_PROT_BASE_6, 0xfff);
1685 mv64x60_write(bh, GT64260_CPU_PROT_SIZE_6, 0);
1686 mv64x60_write(bh, GT64260_CPU_PROT_BASE_7, 0xfff);
1687 mv64x60_write(bh, GT64260_CPU_PROT_SIZE_7, 0);
1688
1689 /* Turn off PCI->MEM access cntl wins not in gt64260_64bit_windows[] */
1690 mv64x60_write(bh, MV64x60_PCI0_ACC_CNTL_4_BASE_LO, 0xfff);
1691 mv64x60_write(bh, MV64x60_PCI0_ACC_CNTL_4_BASE_HI, 0);
1692 mv64x60_write(bh, MV64x60_PCI0_ACC_CNTL_4_SIZE, 0);
1693 mv64x60_write(bh, MV64x60_PCI0_ACC_CNTL_5_BASE_LO, 0xfff);
1694 mv64x60_write(bh, MV64x60_PCI0_ACC_CNTL_5_BASE_HI, 0);
1695 mv64x60_write(bh, MV64x60_PCI0_ACC_CNTL_5_SIZE, 0);
1696 mv64x60_write(bh, GT64260_PCI0_ACC_CNTL_6_BASE_LO, 0xfff);
1697 mv64x60_write(bh, GT64260_PCI0_ACC_CNTL_6_BASE_HI, 0);
1698 mv64x60_write(bh, GT64260_PCI0_ACC_CNTL_6_SIZE, 0);
1699 mv64x60_write(bh, GT64260_PCI0_ACC_CNTL_7_BASE_LO, 0xfff);
1700 mv64x60_write(bh, GT64260_PCI0_ACC_CNTL_7_BASE_HI, 0);
1701 mv64x60_write(bh, GT64260_PCI0_ACC_CNTL_7_SIZE, 0);
1702
1703 mv64x60_write(bh, MV64x60_PCI1_ACC_CNTL_4_BASE_LO, 0xfff);
1704 mv64x60_write(bh, MV64x60_PCI1_ACC_CNTL_4_BASE_HI, 0);
1705 mv64x60_write(bh, MV64x60_PCI1_ACC_CNTL_4_SIZE, 0);
1706 mv64x60_write(bh, MV64x60_PCI1_ACC_CNTL_5_BASE_LO, 0xfff);
1707 mv64x60_write(bh, MV64x60_PCI1_ACC_CNTL_5_BASE_HI, 0);
1708 mv64x60_write(bh, MV64x60_PCI1_ACC_CNTL_5_SIZE, 0);
1709 mv64x60_write(bh, GT64260_PCI1_ACC_CNTL_6_BASE_LO, 0xfff);
1710 mv64x60_write(bh, GT64260_PCI1_ACC_CNTL_6_BASE_HI, 0);
1711 mv64x60_write(bh, GT64260_PCI1_ACC_CNTL_6_SIZE, 0);
1712 mv64x60_write(bh, GT64260_PCI1_ACC_CNTL_7_BASE_LO, 0xfff);
1713 mv64x60_write(bh, GT64260_PCI1_ACC_CNTL_7_BASE_HI, 0);
1714 mv64x60_write(bh, GT64260_PCI1_ACC_CNTL_7_SIZE, 0);
1715
1716 /* Disable all PCI-><whatever> windows */
1717 mv64x60_set_bits(bh, MV64x60_PCI0_BAR_ENABLE, 0x07fffdff);
1718 mv64x60_set_bits(bh, MV64x60_PCI1_BAR_ENABLE, 0x07fffdff);
1719
1720 /*
1721 * Some firmwares enable a bunch of intr sources
1722 * for the PCI INT output pins.
1723 */
1724 mv64x60_write(bh, GT64260_IC_CPU_INTR_MASK_LO, 0);
1725 mv64x60_write(bh, GT64260_IC_CPU_INTR_MASK_HI, 0);
1726 mv64x60_write(bh, GT64260_IC_PCI0_INTR_MASK_LO, 0);
1727 mv64x60_write(bh, GT64260_IC_PCI0_INTR_MASK_HI, 0);
1728 mv64x60_write(bh, GT64260_IC_PCI1_INTR_MASK_LO, 0);
1729 mv64x60_write(bh, GT64260_IC_PCI1_INTR_MASK_HI, 0);
1730 mv64x60_write(bh, GT64260_IC_CPU_INT_0_MASK, 0);
1731 mv64x60_write(bh, GT64260_IC_CPU_INT_1_MASK, 0);
1732 mv64x60_write(bh, GT64260_IC_CPU_INT_2_MASK, 0);
1733 mv64x60_write(bh, GT64260_IC_CPU_INT_3_MASK, 0);
1734}
1735
1736/*
1737 * gt64260a_chip_specific_init()
1738 *
1739 * Implement errata workarounds for the GT64260A.
1740 */
1741static void __init
1742gt64260a_chip_specific_init(struct mv64x60_handle *bh,
1743 struct mv64x60_setup_info *si)
1744{
1745#ifdef CONFIG_SERIAL_MPSC
1746 struct resource *r;
1747#endif
1748#if !defined(CONFIG_NOT_COHERENT_CACHE)
1749 u32 val;
1750 u8 save_exclude;
1751#endif
1752
1753 if (si->pci_0.enable_bus)
1754 mv64x60_set_bits(bh, MV64x60_PCI0_CMD,
1755 ((1<<4) | (1<<5) | (1<<9) | (1<<13)));
1756
1757 if (si->pci_1.enable_bus)
1758 mv64x60_set_bits(bh, MV64x60_PCI1_CMD,
1759 ((1<<4) | (1<<5) | (1<<9) | (1<<13)));
1760
1761 /*
1762 * Dave Wilhardt found that bit 4 in the PCI Command registers must
1763 * be set if you are using cache coherency.
1764 */
1765#if !defined(CONFIG_NOT_COHERENT_CACHE)
1766 /* Res #MEM-4 -- cpu read buffer to buffer 1 */
1767 if ((mv64x60_read(bh, MV64x60_CPU_MODE) & 0xf0) == 0x40)
1768 mv64x60_set_bits(bh, GT64260_SDRAM_CONFIG, (1<<26));
1769
1770 save_exclude = mv64x60_pci_exclude_bridge;
1771 mv64x60_pci_exclude_bridge = 0;
1772 if (si->pci_0.enable_bus) {
1773 early_read_config_dword(bh->hose_a, 0, PCI_DEVFN(0,0),
1774 PCI_COMMAND, &val);
1775 val |= PCI_COMMAND_INVALIDATE;
1776 early_write_config_dword(bh->hose_a, 0, PCI_DEVFN(0,0),
1777 PCI_COMMAND, val);
1778 }
1779
1780 if (si->pci_1.enable_bus) {
1781 early_read_config_dword(bh->hose_b, 0, PCI_DEVFN(0,0),
1782 PCI_COMMAND, &val);
1783 val |= PCI_COMMAND_INVALIDATE;
1784 early_write_config_dword(bh->hose_b, 0, PCI_DEVFN(0,0),
1785 PCI_COMMAND, val);
1786 }
1787 mv64x60_pci_exclude_bridge = save_exclude;
1788#endif
1789
1790 /* Disable buffer/descriptor snooping */
1791 mv64x60_clr_bits(bh, 0xf280, (1<< 6) | (1<<14) | (1<<22) | (1<<30));
1792 mv64x60_clr_bits(bh, 0xf2c0, (1<< 6) | (1<<14) | (1<<22) | (1<<30));
1793
1794#ifdef CONFIG_SERIAL_MPSC
1795 mv64x60_mpsc0_pdata.mirror_regs = 1;
1796 mv64x60_mpsc0_pdata.cache_mgmt = 1;
1797 mv64x60_mpsc1_pdata.mirror_regs = 1;
1798 mv64x60_mpsc1_pdata.cache_mgmt = 1;
1799
1800 if ((r = platform_get_resource(&mpsc1_device, IORESOURCE_IRQ, 0))
1801 != NULL) {
1802 r->start = MV64x60_IRQ_SDMA_0;
1803 r->end = MV64x60_IRQ_SDMA_0;
1804 }
1805#endif
1806}
1807
1808/*
1809 * gt64260b_chip_specific_init()
1810 *
1811 * Implement errata workarounds for the GT64260B.
1812 */
1813static void __init
1814gt64260b_chip_specific_init(struct mv64x60_handle *bh,
1815 struct mv64x60_setup_info *si)
1816{
1817#ifdef CONFIG_SERIAL_MPSC
1818 struct resource *r;
1819#endif
1820#if !defined(CONFIG_NOT_COHERENT_CACHE)
1821 u32 val;
1822 u8 save_exclude;
1823#endif
1824
1825 if (si->pci_0.enable_bus)
1826 mv64x60_set_bits(bh, MV64x60_PCI0_CMD,
1827 ((1<<4) | (1<<5) | (1<<9) | (1<<13)));
1828
1829 if (si->pci_1.enable_bus)
1830 mv64x60_set_bits(bh, MV64x60_PCI1_CMD,
1831 ((1<<4) | (1<<5) | (1<<9) | (1<<13)));
1832
1833 /*
1834 * Dave Wilhardt found that bit 4 in the PCI Command registers must
1835 * be set if you are using cache coherency.
1836 */
1837#if !defined(CONFIG_NOT_COHERENT_CACHE)
1838 mv64x60_set_bits(bh, GT64260_CPU_WB_PRIORITY_BUFFER_DEPTH, 0xf);
1839
1840 /* Res #MEM-4 -- cpu read buffer to buffer 1 */
1841 if ((mv64x60_read(bh, MV64x60_CPU_MODE) & 0xf0) == 0x40)
1842 mv64x60_set_bits(bh, GT64260_SDRAM_CONFIG, (1<<26));
1843
1844 save_exclude = mv64x60_pci_exclude_bridge;
1845 mv64x60_pci_exclude_bridge = 0;
1846 if (si->pci_0.enable_bus) {
1847 early_read_config_dword(bh->hose_a, 0, PCI_DEVFN(0,0),
1848 PCI_COMMAND, &val);
1849 val |= PCI_COMMAND_INVALIDATE;
1850 early_write_config_dword(bh->hose_a, 0, PCI_DEVFN(0,0),
1851 PCI_COMMAND, val);
1852 }
1853
1854 if (si->pci_1.enable_bus) {
1855 early_read_config_dword(bh->hose_b, 0, PCI_DEVFN(0,0),
1856 PCI_COMMAND, &val);
1857 val |= PCI_COMMAND_INVALIDATE;
1858 early_write_config_dword(bh->hose_b, 0, PCI_DEVFN(0,0),
1859 PCI_COMMAND, val);
1860 }
1861 mv64x60_pci_exclude_bridge = save_exclude;
1862#endif
1863
1864 /* Disable buffer/descriptor snooping */
1865 mv64x60_clr_bits(bh, 0xf280, (1<< 6) | (1<<14) | (1<<22) | (1<<30));
1866 mv64x60_clr_bits(bh, 0xf2c0, (1<< 6) | (1<<14) | (1<<22) | (1<<30));
1867
1868#ifdef CONFIG_SERIAL_MPSC
1869 /*
1870 * The 64260B is not supposed to have the bug where the MPSC & ENET
1871 * can't access cache coherent regions. However, testing has shown
1872 * that the MPSC, at least, still has this bug.
1873 */
1874 mv64x60_mpsc0_pdata.cache_mgmt = 1;
1875 mv64x60_mpsc1_pdata.cache_mgmt = 1;
1876
1877 if ((r = platform_get_resource(&mpsc1_device, IORESOURCE_IRQ, 0))
1878 != NULL) {
1879 r->start = MV64x60_IRQ_SDMA_0;
1880 r->end = MV64x60_IRQ_SDMA_0;
1881 }
1882#endif
1883}
1884
1885/*
1886 *****************************************************************************
1887 *
1888 * MV64360-Specific Routines
1889 *
1890 *****************************************************************************
1891 */
1892/*
1893 * mv64360_translate_size()
1894 *
1895 * On the MV64360, the size register is set similar to the size you get
1896 * from a pci config space BAR register. That is, programmed from LSB to MSB
1897 * as a sequence of 1's followed by a sequence of 0's. IOW, "size -1" with the
1898 * assumption that the size is a power of 2.
1899 */
1900static u32 __init
1901mv64360_translate_size(u32 base_addr, u32 size, u32 num_bits)
1902{
1903 return mv64x60_mask(size - 1, num_bits);
1904}
1905
1906/*
1907 * mv64360_untranslate_size()
1908 *
1909 * Translate the size register value of a window into a window size.
1910 */
1911static u32 __init
1912mv64360_untranslate_size(u32 base_addr, u32 size, u32 num_bits)
1913{
1914 if (size > 0) {
1915 size >>= (32 - num_bits);
1916 size++;
1917 size <<= (32 - num_bits);
1918 }
1919
1920 return size;
1921}
1922
1923/*
1924 * mv64360_set_pci2mem_window()
1925 *
1926 * The PCI->MEM window registers are actually in PCI config space so need
1927 * to set them by setting the correct config space BARs.
1928 */
1929struct {
1930 u32 fcn;
1931 u32 base_hi_bar;
1932 u32 base_lo_bar;
1933} static mv64360_reg_addrs[2][4] __initdata = {
1934 {{ 0, 0x14, 0x10 }, { 0, 0x1c, 0x18 },
1935 { 1, 0x14, 0x10 }, { 1, 0x1c, 0x18 }},
1936 {{ 0, 0x94, 0x90 }, { 0, 0x9c, 0x98 },
1937 { 1, 0x94, 0x90 }, { 1, 0x9c, 0x98 }}
1938};
1939
1940static void __init
1941mv64360_set_pci2mem_window(struct pci_controller *hose, u32 bus, u32 window,
1942 u32 base)
1943{
1944 u8 save_exclude;
1945
1946 pr_debug("set pci->mem window: %d, hose: %d, base: 0x%x\n", window,
1947 hose->index, base);
1948
1949 save_exclude = mv64x60_pci_exclude_bridge;
1950 mv64x60_pci_exclude_bridge = 0;
1951 early_write_config_dword(hose, 0,
1952 PCI_DEVFN(0, mv64360_reg_addrs[bus][window].fcn),
1953 mv64360_reg_addrs[bus][window].base_hi_bar, 0);
1954 early_write_config_dword(hose, 0,
1955 PCI_DEVFN(0, mv64360_reg_addrs[bus][window].fcn),
1956 mv64360_reg_addrs[bus][window].base_lo_bar,
1957 mv64x60_mask(base,20) | 0xc);
1958 mv64x60_pci_exclude_bridge = save_exclude;
1959}
1960
1961/*
1962 * mv64360_set_pci2regs_window()
1963 *
1964 * Set where the bridge's registers appear in PCI MEM space.
1965 */
1966static u32 mv64360_offset[2][2] __initdata = {{0x20, 0x24}, {0xa0, 0xa4}};
1967
1968static void __init
1969mv64360_set_pci2regs_window(struct mv64x60_handle *bh,
1970 struct pci_controller *hose, u32 bus, u32 base)
1971{
1972 u8 save_exclude;
1973
1974 pr_debug("set pci->internal regs hose: %d, base: 0x%x\n", hose->index,
1975 base);
1976
1977 save_exclude = mv64x60_pci_exclude_bridge;
1978 mv64x60_pci_exclude_bridge = 0;
1979 early_write_config_dword(hose, 0, PCI_DEVFN(0,0),
1980 mv64360_offset[bus][0], (base << 16));
1981 early_write_config_dword(hose, 0, PCI_DEVFN(0,0),
1982 mv64360_offset[bus][1], 0);
1983 mv64x60_pci_exclude_bridge = save_exclude;
1984}
1985
1986/*
1987 * mv64360_is_enabled_32bit()
1988 *
1989 * On a MV64360, a window is enabled by either clearing a bit in the
1990 * CPU BAR Enable reg or setting a bit in the window's base reg.
1991 * Note that this doesn't work for windows on the PCI slave side but we don't
1992 * check those so its okay.
1993 */
1994static u32 __init
1995mv64360_is_enabled_32bit(struct mv64x60_handle *bh, u32 window)
1996{
1997 u32 extra, rc = 0;
1998
1999 if (((mv64360_32bit_windows[window].base_reg != 0) &&
2000 (mv64360_32bit_windows[window].size_reg != 0)) ||
2001 (window == MV64x60_CPU2SRAM_WIN)) {
2002
2003 extra = mv64360_32bit_windows[window].extra;
2004
2005 switch (extra & MV64x60_EXTRA_MASK) {
2006 case MV64x60_EXTRA_CPUWIN_ENAB:
2007 rc = (mv64x60_read(bh, MV64360_CPU_BAR_ENABLE) &
2008 (1 << (extra & 0x1f))) == 0;
2009 break;
2010
2011 case MV64x60_EXTRA_CPUPROT_ENAB:
2012 rc = (mv64x60_read(bh,
2013 mv64360_32bit_windows[window].base_reg) &
2014 (1 << (extra & 0x1f))) != 0;
2015 break;
2016
2017 case MV64x60_EXTRA_ENET_ENAB:
2018 rc = (mv64x60_read(bh, MV64360_ENET2MEM_BAR_ENABLE) &
2019 (1 << (extra & 0x7))) == 0;
2020 break;
2021
2022 case MV64x60_EXTRA_MPSC_ENAB:
2023 rc = (mv64x60_read(bh, MV64360_MPSC2MEM_BAR_ENABLE) &
2024 (1 << (extra & 0x3))) == 0;
2025 break;
2026
2027 case MV64x60_EXTRA_IDMA_ENAB:
2028 rc = (mv64x60_read(bh, MV64360_IDMA2MEM_BAR_ENABLE) &
2029 (1 << (extra & 0x7))) == 0;
2030 break;
2031
2032 default:
2033 printk(KERN_ERR "mv64360_is_enabled: %s\n",
2034 "32bit table corrupted");
2035 }
2036 }
2037
2038 return rc;
2039}
2040
2041/*
2042 * mv64360_enable_window_32bit()
2043 *
2044 * On a MV64360, a window is enabled by either clearing a bit in the
2045 * CPU BAR Enable reg or setting a bit in the window's base reg.
2046 */
2047static void __init
2048mv64360_enable_window_32bit(struct mv64x60_handle *bh, u32 window)
2049{
2050 u32 extra;
2051
2052 pr_debug("enable 32bit window: %d\n", window);
2053
2054 if (((mv64360_32bit_windows[window].base_reg != 0) &&
2055 (mv64360_32bit_windows[window].size_reg != 0)) ||
2056 (window == MV64x60_CPU2SRAM_WIN)) {
2057
2058 extra = mv64360_32bit_windows[window].extra;
2059
2060 switch (extra & MV64x60_EXTRA_MASK) {
2061 case MV64x60_EXTRA_CPUWIN_ENAB:
2062 mv64x60_clr_bits(bh, MV64360_CPU_BAR_ENABLE,
2063 (1 << (extra & 0x1f)));
2064 break;
2065
2066 case MV64x60_EXTRA_CPUPROT_ENAB:
2067 mv64x60_set_bits(bh,
2068 mv64360_32bit_windows[window].base_reg,
2069 (1 << (extra & 0x1f)));
2070 break;
2071
2072 case MV64x60_EXTRA_ENET_ENAB:
2073 mv64x60_clr_bits(bh, MV64360_ENET2MEM_BAR_ENABLE,
2074 (1 << (extra & 0x7)));
2075 break;
2076
2077 case MV64x60_EXTRA_MPSC_ENAB:
2078 mv64x60_clr_bits(bh, MV64360_MPSC2MEM_BAR_ENABLE,
2079 (1 << (extra & 0x3)));
2080 break;
2081
2082 case MV64x60_EXTRA_IDMA_ENAB:
2083 mv64x60_clr_bits(bh, MV64360_IDMA2MEM_BAR_ENABLE,
2084 (1 << (extra & 0x7)));
2085 break;
2086
2087 default:
2088 printk(KERN_ERR "mv64360_enable: %s\n",
2089 "32bit table corrupted");
2090 }
2091 }
2092}
2093
2094/*
2095 * mv64360_disable_window_32bit()
2096 *
2097 * On a MV64360, a window is disabled by either setting a bit in the
2098 * CPU BAR Enable reg or clearing a bit in the window's base reg.
2099 */
2100static void __init
2101mv64360_disable_window_32bit(struct mv64x60_handle *bh, u32 window)
2102{
2103 u32 extra;
2104
2105 pr_debug("disable 32bit window: %d, base_reg: 0x%x, size_reg: 0x%x\n",
2106 window, mv64360_32bit_windows[window].base_reg,
2107 mv64360_32bit_windows[window].size_reg);
2108
2109 if (((mv64360_32bit_windows[window].base_reg != 0) &&
2110 (mv64360_32bit_windows[window].size_reg != 0)) ||
2111 (window == MV64x60_CPU2SRAM_WIN)) {
2112
2113 extra = mv64360_32bit_windows[window].extra;
2114
2115 switch (extra & MV64x60_EXTRA_MASK) {
2116 case MV64x60_EXTRA_CPUWIN_ENAB:
2117 mv64x60_set_bits(bh, MV64360_CPU_BAR_ENABLE,
2118 (1 << (extra & 0x1f)));
2119 break;
2120
2121 case MV64x60_EXTRA_CPUPROT_ENAB:
2122 mv64x60_clr_bits(bh,
2123 mv64360_32bit_windows[window].base_reg,
2124 (1 << (extra & 0x1f)));
2125 break;
2126
2127 case MV64x60_EXTRA_ENET_ENAB:
2128 mv64x60_set_bits(bh, MV64360_ENET2MEM_BAR_ENABLE,
2129 (1 << (extra & 0x7)));
2130 break;
2131
2132 case MV64x60_EXTRA_MPSC_ENAB:
2133 mv64x60_set_bits(bh, MV64360_MPSC2MEM_BAR_ENABLE,
2134 (1 << (extra & 0x3)));
2135 break;
2136
2137 case MV64x60_EXTRA_IDMA_ENAB:
2138 mv64x60_set_bits(bh, MV64360_IDMA2MEM_BAR_ENABLE,
2139 (1 << (extra & 0x7)));
2140 break;
2141
2142 default:
2143 printk(KERN_ERR "mv64360_disable: %s\n",
2144 "32bit table corrupted");
2145 }
2146 }
2147}
2148
2149/*
2150 * mv64360_enable_window_64bit()
2151 *
2152 * On the MV64360, a 64-bit window is enabled by setting a bit in the window's
2153 * base reg.
2154 */
2155static void __init
2156mv64360_enable_window_64bit(struct mv64x60_handle *bh, u32 window)
2157{
2158 pr_debug("enable 64bit window: %d\n", window);
2159
2160 if ((mv64360_64bit_windows[window].base_lo_reg!= 0) &&
2161 (mv64360_64bit_windows[window].size_reg != 0)) {
2162
2163 if ((mv64360_64bit_windows[window].extra & MV64x60_EXTRA_MASK)
2164 == MV64x60_EXTRA_PCIACC_ENAB)
2165 mv64x60_set_bits(bh,
2166 mv64360_64bit_windows[window].base_lo_reg,
2167 (1 << (mv64360_64bit_windows[window].extra &
2168 0x1f)));
2169 else
2170 printk(KERN_ERR "mv64360_enable: %s\n",
2171 "64bit table corrupted");
2172 }
2173}
2174
2175/*
2176 * mv64360_disable_window_64bit()
2177 *
2178 * On a MV64360, a 64-bit window is disabled by clearing a bit in the window's
2179 * base reg.
2180 */
2181static void __init
2182mv64360_disable_window_64bit(struct mv64x60_handle *bh, u32 window)
2183{
2184 pr_debug("disable 64bit window: %d, base_reg: 0x%x, size_reg: 0x%x\n",
2185 window, mv64360_64bit_windows[window].base_lo_reg,
2186 mv64360_64bit_windows[window].size_reg);
2187
2188 if ((mv64360_64bit_windows[window].base_lo_reg != 0) &&
2189 (mv64360_64bit_windows[window].size_reg != 0)) {
2190 if ((mv64360_64bit_windows[window].extra & MV64x60_EXTRA_MASK)
2191 == MV64x60_EXTRA_PCIACC_ENAB)
2192 mv64x60_clr_bits(bh,
2193 mv64360_64bit_windows[window].base_lo_reg,
2194 (1 << (mv64360_64bit_windows[window].extra &
2195 0x1f)));
2196 else
2197 printk(KERN_ERR "mv64360_disable: %s\n",
2198 "64bit table corrupted");
2199 }
2200}
2201
2202/*
2203 * mv64360_disable_all_windows()
2204 *
2205 * The MV64360 has a few windows that aren't represented in the table of
2206 * windows at the top of this file. This routine turns all of them off
2207 * except for the memory controller windows, of course.
2208 */
2209static void __init
2210mv64360_disable_all_windows(struct mv64x60_handle *bh,
2211 struct mv64x60_setup_info *si)
2212{
2213 u32 preserve, i;
2214
2215 /* Disable 32bit windows (don't disable cpu->mem windows) */
2216 for (i=MV64x60_CPU2DEV_0_WIN; i<MV64x60_32BIT_WIN_COUNT; i++) {
2217 if (i < 32)
2218 preserve = si->window_preserve_mask_32_lo & (1 << i);
2219 else
2220 preserve = si->window_preserve_mask_32_hi & (1<<(i-32));
2221
2222 if (!preserve)
2223 mv64360_disable_window_32bit(bh, i);
2224 }
2225
2226 /* Disable 64bit windows */
2227 for (i=0; i<MV64x60_64BIT_WIN_COUNT; i++)
2228 if (!(si->window_preserve_mask_64 & (1<<i)))
2229 mv64360_disable_window_64bit(bh, i);
2230
2231 /* Turn off PCI->MEM access cntl wins not in mv64360_64bit_windows[] */
2232 mv64x60_clr_bits(bh, MV64x60_PCI0_ACC_CNTL_4_BASE_LO, 0);
2233 mv64x60_clr_bits(bh, MV64x60_PCI0_ACC_CNTL_5_BASE_LO, 0);
2234 mv64x60_clr_bits(bh, MV64x60_PCI1_ACC_CNTL_4_BASE_LO, 0);
2235 mv64x60_clr_bits(bh, MV64x60_PCI1_ACC_CNTL_5_BASE_LO, 0);
2236
2237 /* Disable all PCI-><whatever> windows */
2238 mv64x60_set_bits(bh, MV64x60_PCI0_BAR_ENABLE, 0x0000f9ff);
2239 mv64x60_set_bits(bh, MV64x60_PCI1_BAR_ENABLE, 0x0000f9ff);
2240}
2241
2242/*
2243 * mv64360_config_io2mem_windows()
2244 *
2245 * ENET, MPSC, and IDMA ctlrs on the MV64[34]60 have separate windows that
2246 * must be set up so that the respective ctlr can access system memory.
2247 */
2248static u32 enet_tab[MV64x60_CPU2MEM_WINDOWS] __initdata = {
2249 MV64x60_ENET2MEM_0_WIN, MV64x60_ENET2MEM_1_WIN,
2250 MV64x60_ENET2MEM_2_WIN, MV64x60_ENET2MEM_3_WIN,
2251};
2252
2253static u32 mpsc_tab[MV64x60_CPU2MEM_WINDOWS] __initdata = {
2254 MV64x60_MPSC2MEM_0_WIN, MV64x60_MPSC2MEM_1_WIN,
2255 MV64x60_MPSC2MEM_2_WIN, MV64x60_MPSC2MEM_3_WIN,
2256};
2257
2258static u32 idma_tab[MV64x60_CPU2MEM_WINDOWS] __initdata = {
2259 MV64x60_IDMA2MEM_0_WIN, MV64x60_IDMA2MEM_1_WIN,
2260 MV64x60_IDMA2MEM_2_WIN, MV64x60_IDMA2MEM_3_WIN,
2261};
2262
2263static u32 dram_selects[MV64x60_CPU2MEM_WINDOWS] __initdata =
2264 { 0xe, 0xd, 0xb, 0x7 };
2265
2266static void __init
2267mv64360_config_io2mem_windows(struct mv64x60_handle *bh,
2268 struct mv64x60_setup_info *si,
2269 u32 mem_windows[MV64x60_CPU2MEM_WINDOWS][2])
2270{
2271 u32 i, win;
2272
2273 pr_debug("config_io2regs_windows: enet, mpsc, idma -> bridge regs\n");
2274
2275 mv64x60_write(bh, MV64360_ENET2MEM_ACC_PROT_0, 0);
2276 mv64x60_write(bh, MV64360_ENET2MEM_ACC_PROT_1, 0);
2277 mv64x60_write(bh, MV64360_ENET2MEM_ACC_PROT_2, 0);
2278
2279 mv64x60_write(bh, MV64360_MPSC2MEM_ACC_PROT_0, 0);
2280 mv64x60_write(bh, MV64360_MPSC2MEM_ACC_PROT_1, 0);
2281
2282 mv64x60_write(bh, MV64360_IDMA2MEM_ACC_PROT_0, 0);
2283 mv64x60_write(bh, MV64360_IDMA2MEM_ACC_PROT_1, 0);
2284 mv64x60_write(bh, MV64360_IDMA2MEM_ACC_PROT_2, 0);
2285 mv64x60_write(bh, MV64360_IDMA2MEM_ACC_PROT_3, 0);
2286
2287 /* Assume that mem ctlr has no more windows than embedded I/O ctlr */
2288 for (win=MV64x60_CPU2MEM_0_WIN,i=0;win<=MV64x60_CPU2MEM_3_WIN;win++,i++)
2289 if (bh->ci->is_enabled_32bit(bh, win)) {
2290 mv64x60_set_32bit_window(bh, enet_tab[i],
2291 mem_windows[i][0], mem_windows[i][1],
2292 (dram_selects[i] << 8) |
2293 (si->enet_options[i] & 0x3000));
2294 bh->ci->enable_window_32bit(bh, enet_tab[i]);
2295
2296 /* Give enet r/w access to memory region */
2297 mv64x60_set_bits(bh, MV64360_ENET2MEM_ACC_PROT_0,
2298 (0x3 << (i << 1)));
2299 mv64x60_set_bits(bh, MV64360_ENET2MEM_ACC_PROT_1,
2300 (0x3 << (i << 1)));
2301 mv64x60_set_bits(bh, MV64360_ENET2MEM_ACC_PROT_2,
2302 (0x3 << (i << 1)));
2303
2304 mv64x60_set_32bit_window(bh, mpsc_tab[i],
2305 mem_windows[i][0], mem_windows[i][1],
2306 (dram_selects[i] << 8) |
2307 (si->mpsc_options[i] & 0x3000));
2308 bh->ci->enable_window_32bit(bh, mpsc_tab[i]);
2309
2310 /* Give mpsc r/w access to memory region */
2311 mv64x60_set_bits(bh, MV64360_MPSC2MEM_ACC_PROT_0,
2312 (0x3 << (i << 1)));
2313 mv64x60_set_bits(bh, MV64360_MPSC2MEM_ACC_PROT_1,
2314 (0x3 << (i << 1)));
2315
2316 mv64x60_set_32bit_window(bh, idma_tab[i],
2317 mem_windows[i][0], mem_windows[i][1],
2318 (dram_selects[i] << 8) |
2319 (si->idma_options[i] & 0x3000));
2320 bh->ci->enable_window_32bit(bh, idma_tab[i]);
2321
2322 /* Give idma r/w access to memory region */
2323 mv64x60_set_bits(bh, MV64360_IDMA2MEM_ACC_PROT_0,
2324 (0x3 << (i << 1)));
2325 mv64x60_set_bits(bh, MV64360_IDMA2MEM_ACC_PROT_1,
2326 (0x3 << (i << 1)));
2327 mv64x60_set_bits(bh, MV64360_IDMA2MEM_ACC_PROT_2,
2328 (0x3 << (i << 1)));
2329 mv64x60_set_bits(bh, MV64360_IDMA2MEM_ACC_PROT_3,
2330 (0x3 << (i << 1)));
2331 }
2332}
2333
2334/*
2335 * mv64360_set_mpsc2regs_window()
2336 *
2337 * MPSC has a window to the bridge's internal registers. Call this routine
2338 * to change that window so it doesn't conflict with the windows mapping the
2339 * mpsc to system memory.
2340 */
2341static void __init
2342mv64360_set_mpsc2regs_window(struct mv64x60_handle *bh, u32 base)
2343{
2344 pr_debug("set mpsc->internal regs, base: 0x%x\n", base);
2345 mv64x60_write(bh, MV64360_MPSC2REGS_BASE, base & 0xffff0000);
2346}
2347
2348/*
2349 * mv64360_chip_specific_init()
2350 *
2351 * Implement errata workarounds for the MV64360.
2352 */
2353static void __init
2354mv64360_chip_specific_init(struct mv64x60_handle *bh,
2355 struct mv64x60_setup_info *si)
2356{
2357#if !defined(CONFIG_NOT_COHERENT_CACHE)
2358 mv64x60_set_bits(bh, MV64360_D_UNIT_CONTROL_HIGH, (1<<24));
2359#endif
2360#ifdef CONFIG_SERIAL_MPSC
2361 mv64x60_mpsc0_pdata.brg_can_tune = 1;
2362 mv64x60_mpsc0_pdata.cache_mgmt = 1;
2363 mv64x60_mpsc1_pdata.brg_can_tune = 1;
2364 mv64x60_mpsc1_pdata.cache_mgmt = 1;
2365#endif
2366}
2367
2368/*
2369 * mv64460_chip_specific_init()
2370 *
2371 * Implement errata workarounds for the MV64460.
2372 */
2373static void __init
2374mv64460_chip_specific_init(struct mv64x60_handle *bh,
2375 struct mv64x60_setup_info *si)
2376{
2377#if !defined(CONFIG_NOT_COHERENT_CACHE)
2378 mv64x60_set_bits(bh, MV64360_D_UNIT_CONTROL_HIGH, (1<<24) | (1<<25));
2379 mv64x60_set_bits(bh, MV64460_D_UNIT_MMASK, (1<<1) | (1<<4));
2380#endif
2381#ifdef CONFIG_SERIAL_MPSC
2382 mv64x60_mpsc0_pdata.brg_can_tune = 1;
2383 mv64x60_mpsc0_pdata.cache_mgmt = 1;
2384 mv64x60_mpsc1_pdata.brg_can_tune = 1;
2385 mv64x60_mpsc1_pdata.cache_mgmt = 1;
2386#endif
2387}
2388
2389
2390#if defined(CONFIG_SYSFS) && !defined(CONFIG_GT64260)
2391/* Export the hotswap register via sysfs for enum event monitoring */
2392#define VAL_LEN_MAX 11 /* 32-bit hex or dec stringified number + '\n' */
2393
2394static DEFINE_MUTEX(mv64xxx_hs_lock);
2395
2396static ssize_t
2397mv64xxx_hs_reg_read(struct kobject *kobj, char *buf, loff_t off, size_t count)
2398{
2399 u32 v;
2400 u8 save_exclude;
2401
2402 if (off > 0)
2403 return 0;
2404 if (count < VAL_LEN_MAX)
2405 return -EINVAL;
2406
2407 if (mutex_lock_interruptible(&mv64xxx_hs_lock))
2408 return -ERESTARTSYS;
2409 save_exclude = mv64x60_pci_exclude_bridge;
2410 mv64x60_pci_exclude_bridge = 0;
2411 early_read_config_dword(&sysfs_hose_a, 0, PCI_DEVFN(0, 0),
2412 MV64360_PCICFG_CPCI_HOTSWAP, &v);
2413 mv64x60_pci_exclude_bridge = save_exclude;
2414 mutex_unlock(&mv64xxx_hs_lock);
2415
2416 return sprintf(buf, "0x%08x\n", v);
2417}
2418
2419static ssize_t
2420mv64xxx_hs_reg_write(struct kobject *kobj, char *buf, loff_t off, size_t count)
2421{
2422 u32 v;
2423 u8 save_exclude;
2424
2425 if (off > 0)
2426 return 0;
2427 if (count <= 0)
2428 return -EINVAL;
2429
2430 if (sscanf(buf, "%i", &v) == 1) {
2431 if (mutex_lock_interruptible(&mv64xxx_hs_lock))
2432 return -ERESTARTSYS;
2433 save_exclude = mv64x60_pci_exclude_bridge;
2434 mv64x60_pci_exclude_bridge = 0;
2435 early_write_config_dword(&sysfs_hose_a, 0, PCI_DEVFN(0, 0),
2436 MV64360_PCICFG_CPCI_HOTSWAP, v);
2437 mv64x60_pci_exclude_bridge = save_exclude;
2438 mutex_unlock(&mv64xxx_hs_lock);
2439 }
2440 else
2441 count = -EINVAL;
2442
2443 return count;
2444}
2445
2446static struct bin_attribute mv64xxx_hs_reg_attr = { /* Hotswap register */
2447 .attr = {
2448 .name = "hs_reg",
2449 .mode = S_IRUGO | S_IWUSR,
2450 },
2451 .size = VAL_LEN_MAX,
2452 .read = mv64xxx_hs_reg_read,
2453 .write = mv64xxx_hs_reg_write,
2454};
2455
2456/* Provide sysfs file indicating if this platform supports the hs_reg */
2457static ssize_t
2458mv64xxx_hs_reg_valid_show(struct device *dev, struct device_attribute *attr,
2459 char *buf)
2460{
2461 struct platform_device *pdev;
2462 struct mv64xxx_pdata *pdp;
2463 u32 v;
2464
2465 pdev = container_of(dev, struct platform_device, dev);
2466 pdp = (struct mv64xxx_pdata *)pdev->dev.platform_data;
2467
2468 if (mutex_lock_interruptible(&mv64xxx_hs_lock))
2469 return -ERESTARTSYS;
2470 v = pdp->hs_reg_valid;
2471 mutex_unlock(&mv64xxx_hs_lock);
2472
2473 return sprintf(buf, "%i\n", v);
2474}
2475static DEVICE_ATTR(hs_reg_valid, S_IRUGO, mv64xxx_hs_reg_valid_show, NULL);
2476
2477static int __init
2478mv64xxx_sysfs_init(void)
2479{
2480 sysfs_create_bin_file(&mv64xxx_device.dev.kobj, &mv64xxx_hs_reg_attr);
2481 sysfs_create_file(&mv64xxx_device.dev.kobj,&dev_attr_hs_reg_valid.attr);
2482 return 0;
2483}
2484subsys_initcall(mv64xxx_sysfs_init);
2485#endif
diff --git a/arch/ppc/syslib/mv64x60_dbg.c b/arch/ppc/syslib/mv64x60_dbg.c
deleted file mode 100644
index e1876261e5dc..000000000000
--- a/arch/ppc/syslib/mv64x60_dbg.c
+++ /dev/null
@@ -1,121 +0,0 @@
1/*
2 * KGDB and progress routines for the Marvell/Galileo MV64x60 (Discovery).
3 *
4 * Author: Mark A. Greer <mgreer@mvista.com>
5 *
6 * 2003 (c) MontaVista Software, Inc. This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10 */
11
12/*
13 *****************************************************************************
14 *
15 * Low-level MPSC/UART I/O routines
16 *
17 *****************************************************************************
18 */
19
20
21#include <linux/irq.h>
22#include <asm/delay.h>
23#include <asm/mv64x60.h>
24#include <asm/machdep.h>
25
26
27#if defined(CONFIG_SERIAL_TEXT_DEBUG)
28
29#define MPSC_CHR_1 0x000c
30#define MPSC_CHR_2 0x0010
31
32static struct mv64x60_handle mv64x60_dbg_bh;
33
34void
35mv64x60_progress_init(u32 base)
36{
37 mv64x60_dbg_bh.v_base = base;
38 return;
39}
40
41static void
42mv64x60_polled_putc(int chan, char c)
43{
44 u32 offset;
45
46 if (chan == 0)
47 offset = 0x8000;
48 else
49 offset = 0x9000;
50
51 mv64x60_write(&mv64x60_dbg_bh, offset + MPSC_CHR_1, (u32)c);
52 mv64x60_write(&mv64x60_dbg_bh, offset + MPSC_CHR_2, 0x200);
53 udelay(2000);
54}
55
56void
57mv64x60_mpsc_progress(char *s, unsigned short hex)
58{
59 volatile char c;
60
61 mv64x60_polled_putc(0, '\r');
62
63 while ((c = *s++) != 0)
64 mv64x60_polled_putc(0, c);
65
66 mv64x60_polled_putc(0, '\n');
67 mv64x60_polled_putc(0, '\r');
68
69 return;
70}
71#endif /* CONFIG_SERIAL_TEXT_DEBUG */
72
73
74#if defined(CONFIG_KGDB)
75
76#if defined(CONFIG_KGDB_TTYS0)
77#define KGDB_PORT 0
78#elif defined(CONFIG_KGDB_TTYS1)
79#define KGDB_PORT 1
80#else
81#error "Invalid kgdb_tty port"
82#endif
83
84void
85putDebugChar(unsigned char c)
86{
87 mv64x60_polled_putc(KGDB_PORT, (char)c);
88}
89
90int
91getDebugChar(void)
92{
93 unsigned char c;
94
95 while (!mv64x60_polled_getc(KGDB_PORT, &c));
96 return (int)c;
97}
98
99void
100putDebugString(char* str)
101{
102 while (*str != '\0') {
103 putDebugChar(*str);
104 str++;
105 }
106 putDebugChar('\r');
107 return;
108}
109
110void
111kgdb_interruptible(int enable)
112{
113}
114
115void
116kgdb_map_scc(void)
117{
118 if (ppc_md.early_serial_map)
119 ppc_md.early_serial_map();
120}
121#endif /* CONFIG_KGDB */
diff --git a/arch/ppc/syslib/mv64x60_win.c b/arch/ppc/syslib/mv64x60_win.c
deleted file mode 100644
index 4bf1ad17bf1a..000000000000
--- a/arch/ppc/syslib/mv64x60_win.c
+++ /dev/null
@@ -1,1165 +0,0 @@
1/*
2 * Tables with info on how to manipulate the 32 & 64 bit windows on the
3 * various types of Marvell bridge chips.
4 *
5 * Author: Mark A. Greer <mgreer@mvista.com>
6 *
7 * 2004 (c) MontaVista, Software, Inc. This file is licensed under
8 * the terms of the GNU General Public License version 2. This program
9 * is licensed "as is" without any warranty of any kind, whether express
10 * or implied.
11 */
12#include <linux/kernel.h>
13#include <linux/init.h>
14#include <linux/pci.h>
15#include <linux/slab.h>
16#include <linux/module.h>
17#include <linux/string.h>
18#include <linux/mv643xx.h>
19
20#include <asm/byteorder.h>
21#include <asm/io.h>
22#include <asm/irq.h>
23#include <asm/uaccess.h>
24#include <asm/machdep.h>
25#include <asm/pci-bridge.h>
26#include <asm/delay.h>
27#include <asm/mv64x60.h>
28
29
30/*
31 *****************************************************************************
32 *
33 * Tables describing how to set up windows on each type of bridge
34 *
35 *****************************************************************************
36 */
37struct mv64x60_32bit_window
38 gt64260_32bit_windows[MV64x60_32BIT_WIN_COUNT] __initdata = {
39 /* CPU->MEM Windows */
40 [MV64x60_CPU2MEM_0_WIN] = {
41 .base_reg = MV64x60_CPU2MEM_0_BASE,
42 .size_reg = MV64x60_CPU2MEM_0_SIZE,
43 .base_bits = 12,
44 .size_bits = 12,
45 .get_from_field = mv64x60_shift_left,
46 .map_to_field = mv64x60_shift_right,
47 .extra = 0 },
48 [MV64x60_CPU2MEM_1_WIN] = {
49 .base_reg = MV64x60_CPU2MEM_1_BASE,
50 .size_reg = MV64x60_CPU2MEM_1_SIZE,
51 .base_bits = 12,
52 .size_bits = 12,
53 .get_from_field = mv64x60_shift_left,
54 .map_to_field = mv64x60_shift_right,
55 .extra = 0 },
56 [MV64x60_CPU2MEM_2_WIN] = {
57 .base_reg = MV64x60_CPU2MEM_2_BASE,
58 .size_reg = MV64x60_CPU2MEM_2_SIZE,
59 .base_bits = 12,
60 .size_bits = 12,
61 .get_from_field = mv64x60_shift_left,
62 .map_to_field = mv64x60_shift_right,
63 .extra = 0 },
64 [MV64x60_CPU2MEM_3_WIN] = {
65 .base_reg = MV64x60_CPU2MEM_3_BASE,
66 .size_reg = MV64x60_CPU2MEM_3_SIZE,
67 .base_bits = 12,
68 .size_bits = 12,
69 .get_from_field = mv64x60_shift_left,
70 .map_to_field = mv64x60_shift_right,
71 .extra = 0 },
72 /* CPU->Device Windows */
73 [MV64x60_CPU2DEV_0_WIN] = {
74 .base_reg = MV64x60_CPU2DEV_0_BASE,
75 .size_reg = MV64x60_CPU2DEV_0_SIZE,
76 .base_bits = 12,
77 .size_bits = 12,
78 .get_from_field = mv64x60_shift_left,
79 .map_to_field = mv64x60_shift_right,
80 .extra = 0 },
81 [MV64x60_CPU2DEV_1_WIN] = {
82 .base_reg = MV64x60_CPU2DEV_1_BASE,
83 .size_reg = MV64x60_CPU2DEV_1_SIZE,
84 .base_bits = 12,
85 .size_bits = 12,
86 .get_from_field = mv64x60_shift_left,
87 .map_to_field = mv64x60_shift_right,
88 .extra = 0 },
89 [MV64x60_CPU2DEV_2_WIN] = {
90 .base_reg = MV64x60_CPU2DEV_2_BASE,
91 .size_reg = MV64x60_CPU2DEV_2_SIZE,
92 .base_bits = 12,
93 .size_bits = 12,
94 .get_from_field = mv64x60_shift_left,
95 .map_to_field = mv64x60_shift_right,
96 .extra = 0 },
97 [MV64x60_CPU2DEV_3_WIN] = {
98 .base_reg = MV64x60_CPU2DEV_3_BASE,
99 .size_reg = MV64x60_CPU2DEV_3_SIZE,
100 .base_bits = 12,
101 .size_bits = 12,
102 .get_from_field = mv64x60_shift_left,
103 .map_to_field = mv64x60_shift_right,
104 .extra = 0 },
105 /* CPU->Boot Window */
106 [MV64x60_CPU2BOOT_WIN] = {
107 .base_reg = MV64x60_CPU2BOOT_0_BASE,
108 .size_reg = MV64x60_CPU2BOOT_0_SIZE,
109 .base_bits = 12,
110 .size_bits = 12,
111 .get_from_field = mv64x60_shift_left,
112 .map_to_field = mv64x60_shift_right,
113 .extra = 0 },
114 /* CPU->PCI 0 Windows */
115 [MV64x60_CPU2PCI0_IO_WIN] = {
116 .base_reg = MV64x60_CPU2PCI0_IO_BASE,
117 .size_reg = MV64x60_CPU2PCI0_IO_SIZE,
118 .base_bits = 12,
119 .size_bits = 12,
120 .get_from_field = mv64x60_shift_left,
121 .map_to_field = mv64x60_shift_right,
122 .extra = 0 },
123 [MV64x60_CPU2PCI0_MEM_0_WIN] = {
124 .base_reg = MV64x60_CPU2PCI0_MEM_0_BASE,
125 .size_reg = MV64x60_CPU2PCI0_MEM_0_SIZE,
126 .base_bits = 12,
127 .size_bits = 12,
128 .get_from_field = mv64x60_shift_left,
129 .map_to_field = mv64x60_shift_right,
130 .extra = 0 },
131 [MV64x60_CPU2PCI0_MEM_1_WIN] = {
132 .base_reg = MV64x60_CPU2PCI0_MEM_1_BASE,
133 .size_reg = MV64x60_CPU2PCI0_MEM_1_SIZE,
134 .base_bits = 12,
135 .size_bits = 12,
136 .get_from_field = mv64x60_shift_left,
137 .map_to_field = mv64x60_shift_right,
138 .extra = 0 },
139 [MV64x60_CPU2PCI0_MEM_2_WIN] = {
140 .base_reg = MV64x60_CPU2PCI0_MEM_2_BASE,
141 .size_reg = MV64x60_CPU2PCI0_MEM_2_SIZE,
142 .base_bits = 12,
143 .size_bits = 12,
144 .get_from_field = mv64x60_shift_left,
145 .map_to_field = mv64x60_shift_right,
146 .extra = 0 },
147 [MV64x60_CPU2PCI0_MEM_3_WIN] = {
148 .base_reg = MV64x60_CPU2PCI0_MEM_3_BASE,
149 .size_reg = MV64x60_CPU2PCI0_MEM_3_SIZE,
150 .base_bits = 12,
151 .size_bits = 12,
152 .get_from_field = mv64x60_shift_left,
153 .map_to_field = mv64x60_shift_right,
154 .extra = 0 },
155 /* CPU->PCI 1 Windows */
156 [MV64x60_CPU2PCI1_IO_WIN] = {
157 .base_reg = MV64x60_CPU2PCI1_IO_BASE,
158 .size_reg = MV64x60_CPU2PCI1_IO_SIZE,
159 .base_bits = 12,
160 .size_bits = 12,
161 .get_from_field = mv64x60_shift_left,
162 .map_to_field = mv64x60_shift_right,
163 .extra = 0 },
164 [MV64x60_CPU2PCI1_MEM_0_WIN] = {
165 .base_reg = MV64x60_CPU2PCI1_MEM_0_BASE,
166 .size_reg = MV64x60_CPU2PCI1_MEM_0_SIZE,
167 .base_bits = 12,
168 .size_bits = 12,
169 .get_from_field = mv64x60_shift_left,
170 .map_to_field = mv64x60_shift_right,
171 .extra = 0 },
172 [MV64x60_CPU2PCI1_MEM_1_WIN] = {
173 .base_reg = MV64x60_CPU2PCI1_MEM_1_BASE,
174 .size_reg = MV64x60_CPU2PCI1_MEM_1_SIZE,
175 .base_bits = 12,
176 .size_bits = 12,
177 .get_from_field = mv64x60_shift_left,
178 .map_to_field = mv64x60_shift_right,
179 .extra = 0 },
180 [MV64x60_CPU2PCI1_MEM_2_WIN] = {
181 .base_reg = MV64x60_CPU2PCI1_MEM_2_BASE,
182 .size_reg = MV64x60_CPU2PCI1_MEM_2_SIZE,
183 .base_bits = 12,
184 .size_bits = 12,
185 .get_from_field = mv64x60_shift_left,
186 .map_to_field = mv64x60_shift_right,
187 .extra = 0 },
188 [MV64x60_CPU2PCI1_MEM_3_WIN] = {
189 .base_reg = MV64x60_CPU2PCI1_MEM_3_BASE,
190 .size_reg = MV64x60_CPU2PCI1_MEM_3_SIZE,
191 .base_bits = 12,
192 .size_bits = 12,
193 .get_from_field = mv64x60_shift_left,
194 .map_to_field = mv64x60_shift_right,
195 .extra = 0 },
196 /* CPU->SRAM Window (64260 has no integrated SRAM) */
197 /* CPU->PCI 0 Remap I/O Window */
198 [MV64x60_CPU2PCI0_IO_REMAP_WIN] = {
199 .base_reg = MV64x60_CPU2PCI0_IO_REMAP,
200 .size_reg = 0,
201 .base_bits = 12,
202 .size_bits = 0,
203 .get_from_field = mv64x60_shift_left,
204 .map_to_field = mv64x60_shift_right,
205 .extra = 0 },
206 /* CPU->PCI 1 Remap I/O Window */
207 [MV64x60_CPU2PCI1_IO_REMAP_WIN] = {
208 .base_reg = MV64x60_CPU2PCI1_IO_REMAP,
209 .size_reg = 0,
210 .base_bits = 12,
211 .size_bits = 0,
212 .get_from_field = mv64x60_shift_left,
213 .map_to_field = mv64x60_shift_right,
214 .extra = 0 },
215 /* CPU Memory Protection Windows */
216 [MV64x60_CPU_PROT_0_WIN] = {
217 .base_reg = MV64x60_CPU_PROT_BASE_0,
218 .size_reg = MV64x60_CPU_PROT_SIZE_0,
219 .base_bits = 12,
220 .size_bits = 12,
221 .get_from_field = mv64x60_shift_left,
222 .map_to_field = mv64x60_shift_right,
223 .extra = 0 },
224 [MV64x60_CPU_PROT_1_WIN] = {
225 .base_reg = MV64x60_CPU_PROT_BASE_1,
226 .size_reg = MV64x60_CPU_PROT_SIZE_1,
227 .base_bits = 12,
228 .size_bits = 12,
229 .get_from_field = mv64x60_shift_left,
230 .map_to_field = mv64x60_shift_right,
231 .extra = 0 },
232 [MV64x60_CPU_PROT_2_WIN] = {
233 .base_reg = MV64x60_CPU_PROT_BASE_2,
234 .size_reg = MV64x60_CPU_PROT_SIZE_2,
235 .base_bits = 12,
236 .size_bits = 12,
237 .get_from_field = mv64x60_shift_left,
238 .map_to_field = mv64x60_shift_right,
239 .extra = 0 },
240 [MV64x60_CPU_PROT_3_WIN] = {
241 .base_reg = MV64x60_CPU_PROT_BASE_3,
242 .size_reg = MV64x60_CPU_PROT_SIZE_3,
243 .base_bits = 12,
244 .size_bits = 12,
245 .get_from_field = mv64x60_shift_left,
246 .map_to_field = mv64x60_shift_right,
247 .extra = 0 },
248 /* CPU Snoop Windows */
249 [MV64x60_CPU_SNOOP_0_WIN] = {
250 .base_reg = GT64260_CPU_SNOOP_BASE_0,
251 .size_reg = GT64260_CPU_SNOOP_SIZE_0,
252 .base_bits = 12,
253 .size_bits = 12,
254 .get_from_field = mv64x60_shift_left,
255 .map_to_field = mv64x60_shift_right,
256 .extra = 0 },
257 [MV64x60_CPU_SNOOP_1_WIN] = {
258 .base_reg = GT64260_CPU_SNOOP_BASE_1,
259 .size_reg = GT64260_CPU_SNOOP_SIZE_1,
260 .base_bits = 12,
261 .size_bits = 12,
262 .get_from_field = mv64x60_shift_left,
263 .map_to_field = mv64x60_shift_right,
264 .extra = 0 },
265 [MV64x60_CPU_SNOOP_2_WIN] = {
266 .base_reg = GT64260_CPU_SNOOP_BASE_2,
267 .size_reg = GT64260_CPU_SNOOP_SIZE_2,
268 .base_bits = 12,
269 .size_bits = 12,
270 .get_from_field = mv64x60_shift_left,
271 .map_to_field = mv64x60_shift_right,
272 .extra = 0 },
273 [MV64x60_CPU_SNOOP_3_WIN] = {
274 .base_reg = GT64260_CPU_SNOOP_BASE_3,
275 .size_reg = GT64260_CPU_SNOOP_SIZE_3,
276 .base_bits = 12,
277 .size_bits = 12,
278 .get_from_field = mv64x60_shift_left,
279 .map_to_field = mv64x60_shift_right,
280 .extra = 0 },
281 /* PCI 0->System Memory Remap Windows */
282 [MV64x60_PCI02MEM_REMAP_0_WIN] = {
283 .base_reg = MV64x60_PCI0_SLAVE_MEM_0_REMAP,
284 .size_reg = 0,
285 .base_bits = 20,
286 .size_bits = 0,
287 .get_from_field = mv64x60_mask,
288 .map_to_field = mv64x60_mask,
289 .extra = 0 },
290 [MV64x60_PCI02MEM_REMAP_1_WIN] = {
291 .base_reg = MV64x60_PCI0_SLAVE_MEM_1_REMAP,
292 .size_reg = 0,
293 .base_bits = 20,
294 .size_bits = 0,
295 .get_from_field = mv64x60_mask,
296 .map_to_field = mv64x60_mask,
297 .extra = 0 },
298 [MV64x60_PCI02MEM_REMAP_2_WIN] = {
299 .base_reg = MV64x60_PCI0_SLAVE_MEM_1_REMAP,
300 .size_reg = 0,
301 .base_bits = 20,
302 .size_bits = 0,
303 .get_from_field = mv64x60_mask,
304 .map_to_field = mv64x60_mask,
305 .extra = 0 },
306 [MV64x60_PCI02MEM_REMAP_3_WIN] = {
307 .base_reg = MV64x60_PCI0_SLAVE_MEM_1_REMAP,
308 .size_reg = 0,
309 .base_bits = 20,
310 .size_bits = 0,
311 .get_from_field = mv64x60_mask,
312 .map_to_field = mv64x60_mask,
313 .extra = 0 },
314 /* PCI 1->System Memory Remap Windows */
315 [MV64x60_PCI12MEM_REMAP_0_WIN] = {
316 .base_reg = MV64x60_PCI1_SLAVE_MEM_0_REMAP,
317 .size_reg = 0,
318 .base_bits = 20,
319 .size_bits = 0,
320 .get_from_field = mv64x60_mask,
321 .map_to_field = mv64x60_mask,
322 .extra = 0 },
323 [MV64x60_PCI12MEM_REMAP_1_WIN] = {
324 .base_reg = MV64x60_PCI1_SLAVE_MEM_1_REMAP,
325 .size_reg = 0,
326 .base_bits = 20,
327 .size_bits = 0,
328 .get_from_field = mv64x60_mask,
329 .map_to_field = mv64x60_mask,
330 .extra = 0 },
331 [MV64x60_PCI12MEM_REMAP_2_WIN] = {
332 .base_reg = MV64x60_PCI1_SLAVE_MEM_1_REMAP,
333 .size_reg = 0,
334 .base_bits = 20,
335 .size_bits = 0,
336 .get_from_field = mv64x60_mask,
337 .map_to_field = mv64x60_mask,
338 .extra = 0 },
339 [MV64x60_PCI12MEM_REMAP_3_WIN] = {
340 .base_reg = MV64x60_PCI1_SLAVE_MEM_1_REMAP,
341 .size_reg = 0,
342 .base_bits = 20,
343 .size_bits = 0,
344 .get_from_field = mv64x60_mask,
345 .map_to_field = mv64x60_mask,
346 .extra = 0 },
347 /* ENET->SRAM Window (64260 doesn't have separate windows) */
348 /* MPSC->SRAM Window (64260 doesn't have separate windows) */
349 /* IDMA->SRAM Window (64260 doesn't have separate windows) */
350};
351
352struct mv64x60_64bit_window
353 gt64260_64bit_windows[MV64x60_64BIT_WIN_COUNT] __initdata = {
354 /* CPU->PCI 0 MEM Remap Windows */
355 [MV64x60_CPU2PCI0_MEM_0_REMAP_WIN] = {
356 .base_hi_reg = MV64x60_CPU2PCI0_MEM_0_REMAP_HI,
357 .base_lo_reg = MV64x60_CPU2PCI0_MEM_0_REMAP_LO,
358 .size_reg = 0,
359 .base_lo_bits = 12,
360 .size_bits = 0,
361 .get_from_field = mv64x60_shift_left,
362 .map_to_field = mv64x60_shift_right,
363 .extra = 0 },
364 [MV64x60_CPU2PCI0_MEM_1_REMAP_WIN] = {
365 .base_hi_reg = MV64x60_CPU2PCI0_MEM_1_REMAP_HI,
366 .base_lo_reg = MV64x60_CPU2PCI0_MEM_1_REMAP_LO,
367 .size_reg = 0,
368 .base_lo_bits = 12,
369 .size_bits = 0,
370 .get_from_field = mv64x60_shift_left,
371 .map_to_field = mv64x60_shift_right,
372 .extra = 0 },
373 [MV64x60_CPU2PCI0_MEM_2_REMAP_WIN] = {
374 .base_hi_reg = MV64x60_CPU2PCI0_MEM_2_REMAP_HI,
375 .base_lo_reg = MV64x60_CPU2PCI0_MEM_2_REMAP_LO,
376 .size_reg = 0,
377 .base_lo_bits = 12,
378 .size_bits = 0,
379 .get_from_field = mv64x60_shift_left,
380 .map_to_field = mv64x60_shift_right,
381 .extra = 0 },
382 [MV64x60_CPU2PCI0_MEM_3_REMAP_WIN] = {
383 .base_hi_reg = MV64x60_CPU2PCI0_MEM_3_REMAP_HI,
384 .base_lo_reg = MV64x60_CPU2PCI0_MEM_3_REMAP_LO,
385 .size_reg = 0,
386 .base_lo_bits = 12,
387 .size_bits = 0,
388 .get_from_field = mv64x60_shift_left,
389 .map_to_field = mv64x60_shift_right,
390 .extra = 0 },
391 /* CPU->PCI 1 MEM Remap Windows */
392 [MV64x60_CPU2PCI1_MEM_0_REMAP_WIN] = {
393 .base_hi_reg = MV64x60_CPU2PCI1_MEM_0_REMAP_HI,
394 .base_lo_reg = MV64x60_CPU2PCI1_MEM_0_REMAP_LO,
395 .size_reg = 0,
396 .base_lo_bits = 12,
397 .size_bits = 0,
398 .get_from_field = mv64x60_shift_left,
399 .map_to_field = mv64x60_shift_right,
400 .extra = 0 },
401 [MV64x60_CPU2PCI1_MEM_1_REMAP_WIN] = {
402 .base_hi_reg = MV64x60_CPU2PCI1_MEM_1_REMAP_HI,
403 .base_lo_reg = MV64x60_CPU2PCI1_MEM_1_REMAP_LO,
404 .size_reg = 0,
405 .base_lo_bits = 12,
406 .size_bits = 0,
407 .get_from_field = mv64x60_shift_left,
408 .map_to_field = mv64x60_shift_right,
409 .extra = 0 },
410 [MV64x60_CPU2PCI1_MEM_2_REMAP_WIN] = {
411 .base_hi_reg = MV64x60_CPU2PCI1_MEM_2_REMAP_HI,
412 .base_lo_reg = MV64x60_CPU2PCI1_MEM_2_REMAP_LO,
413 .size_reg = 0,
414 .base_lo_bits = 12,
415 .size_bits = 0,
416 .get_from_field = mv64x60_shift_left,
417 .map_to_field = mv64x60_shift_right,
418 .extra = 0 },
419 [MV64x60_CPU2PCI1_MEM_3_REMAP_WIN] = {
420 .base_hi_reg = MV64x60_CPU2PCI1_MEM_3_REMAP_HI,
421 .base_lo_reg = MV64x60_CPU2PCI1_MEM_3_REMAP_LO,
422 .size_reg = 0,
423 .base_lo_bits = 12,
424 .size_bits = 0,
425 .get_from_field = mv64x60_shift_left,
426 .map_to_field = mv64x60_shift_right,
427 .extra = 0 },
428 /* PCI 0->MEM Access Control Windows */
429 [MV64x60_PCI02MEM_ACC_CNTL_0_WIN] = {
430 .base_hi_reg = MV64x60_PCI0_ACC_CNTL_0_BASE_HI,
431 .base_lo_reg = MV64x60_PCI0_ACC_CNTL_0_BASE_LO,
432 .size_reg = MV64x60_PCI0_ACC_CNTL_0_SIZE,
433 .base_lo_bits = 12,
434 .size_bits = 12,
435 .get_from_field = mv64x60_shift_left,
436 .map_to_field = mv64x60_shift_right,
437 .extra = 0 },
438 [MV64x60_PCI02MEM_ACC_CNTL_1_WIN] = {
439 .base_hi_reg = MV64x60_PCI0_ACC_CNTL_1_BASE_HI,
440 .base_lo_reg = MV64x60_PCI0_ACC_CNTL_1_BASE_LO,
441 .size_reg = MV64x60_PCI0_ACC_CNTL_1_SIZE,
442 .base_lo_bits = 12,
443 .size_bits = 12,
444 .get_from_field = mv64x60_shift_left,
445 .map_to_field = mv64x60_shift_right,
446 .extra = 0 },
447 [MV64x60_PCI02MEM_ACC_CNTL_2_WIN] = {
448 .base_hi_reg = MV64x60_PCI0_ACC_CNTL_2_BASE_HI,
449 .base_lo_reg = MV64x60_PCI0_ACC_CNTL_2_BASE_LO,
450 .size_reg = MV64x60_PCI0_ACC_CNTL_2_SIZE,
451 .base_lo_bits = 12,
452 .size_bits = 12,
453 .get_from_field = mv64x60_shift_left,
454 .map_to_field = mv64x60_shift_right,
455 .extra = 0 },
456 [MV64x60_PCI02MEM_ACC_CNTL_3_WIN] = {
457 .base_hi_reg = MV64x60_PCI0_ACC_CNTL_3_BASE_HI,
458 .base_lo_reg = MV64x60_PCI0_ACC_CNTL_3_BASE_LO,
459 .size_reg = MV64x60_PCI0_ACC_CNTL_3_SIZE,
460 .base_lo_bits = 12,
461 .size_bits = 12,
462 .get_from_field = mv64x60_shift_left,
463 .map_to_field = mv64x60_shift_right,
464 .extra = 0 },
465 /* PCI 1->MEM Access Control Windows */
466 [MV64x60_PCI12MEM_ACC_CNTL_0_WIN] = {
467 .base_hi_reg = MV64x60_PCI1_ACC_CNTL_0_BASE_HI,
468 .base_lo_reg = MV64x60_PCI1_ACC_CNTL_0_BASE_LO,
469 .size_reg = MV64x60_PCI1_ACC_CNTL_0_SIZE,
470 .base_lo_bits = 12,
471 .size_bits = 12,
472 .get_from_field = mv64x60_shift_left,
473 .map_to_field = mv64x60_shift_right,
474 .extra = 0 },
475 [MV64x60_PCI12MEM_ACC_CNTL_1_WIN] = {
476 .base_hi_reg = MV64x60_PCI1_ACC_CNTL_1_BASE_HI,
477 .base_lo_reg = MV64x60_PCI1_ACC_CNTL_1_BASE_LO,
478 .size_reg = MV64x60_PCI1_ACC_CNTL_1_SIZE,
479 .base_lo_bits = 12,
480 .size_bits = 12,
481 .get_from_field = mv64x60_shift_left,
482 .map_to_field = mv64x60_shift_right,
483 .extra = 0 },
484 [MV64x60_PCI12MEM_ACC_CNTL_2_WIN] = {
485 .base_hi_reg = MV64x60_PCI1_ACC_CNTL_2_BASE_HI,
486 .base_lo_reg = MV64x60_PCI1_ACC_CNTL_2_BASE_LO,
487 .size_reg = MV64x60_PCI1_ACC_CNTL_2_SIZE,
488 .base_lo_bits = 12,
489 .size_bits = 12,
490 .get_from_field = mv64x60_shift_left,
491 .map_to_field = mv64x60_shift_right,
492 .extra = 0 },
493 [MV64x60_PCI12MEM_ACC_CNTL_3_WIN] = {
494 .base_hi_reg = MV64x60_PCI1_ACC_CNTL_3_BASE_HI,
495 .base_lo_reg = MV64x60_PCI1_ACC_CNTL_3_BASE_LO,
496 .size_reg = MV64x60_PCI1_ACC_CNTL_3_SIZE,
497 .base_lo_bits = 12,
498 .size_bits = 12,
499 .get_from_field = mv64x60_shift_left,
500 .map_to_field = mv64x60_shift_right,
501 .extra = 0 },
502 /* PCI 0->MEM Snoop Windows */
503 [MV64x60_PCI02MEM_SNOOP_0_WIN] = {
504 .base_hi_reg = GT64260_PCI0_SNOOP_0_BASE_HI,
505 .base_lo_reg = GT64260_PCI0_SNOOP_0_BASE_LO,
506 .size_reg = GT64260_PCI0_SNOOP_0_SIZE,
507 .base_lo_bits = 12,
508 .size_bits = 12,
509 .get_from_field = mv64x60_shift_left,
510 .map_to_field = mv64x60_shift_right,
511 .extra = 0 },
512 [MV64x60_PCI02MEM_SNOOP_1_WIN] = {
513 .base_hi_reg = GT64260_PCI0_SNOOP_1_BASE_HI,
514 .base_lo_reg = GT64260_PCI0_SNOOP_1_BASE_LO,
515 .size_reg = GT64260_PCI0_SNOOP_1_SIZE,
516 .base_lo_bits = 12,
517 .size_bits = 12,
518 .get_from_field = mv64x60_shift_left,
519 .map_to_field = mv64x60_shift_right,
520 .extra = 0 },
521 [MV64x60_PCI02MEM_SNOOP_2_WIN] = {
522 .base_hi_reg = GT64260_PCI0_SNOOP_2_BASE_HI,
523 .base_lo_reg = GT64260_PCI0_SNOOP_2_BASE_LO,
524 .size_reg = GT64260_PCI0_SNOOP_2_SIZE,
525 .base_lo_bits = 12,
526 .size_bits = 12,
527 .get_from_field = mv64x60_shift_left,
528 .map_to_field = mv64x60_shift_right,
529 .extra = 0 },
530 [MV64x60_PCI02MEM_SNOOP_3_WIN] = {
531 .base_hi_reg = GT64260_PCI0_SNOOP_3_BASE_HI,
532 .base_lo_reg = GT64260_PCI0_SNOOP_3_BASE_LO,
533 .size_reg = GT64260_PCI0_SNOOP_3_SIZE,
534 .base_lo_bits = 12,
535 .size_bits = 12,
536 .get_from_field = mv64x60_shift_left,
537 .map_to_field = mv64x60_shift_right,
538 .extra = 0 },
539 /* PCI 1->MEM Snoop Windows */
540 [MV64x60_PCI12MEM_SNOOP_0_WIN] = {
541 .base_hi_reg = GT64260_PCI1_SNOOP_0_BASE_HI,
542 .base_lo_reg = GT64260_PCI1_SNOOP_0_BASE_LO,
543 .size_reg = GT64260_PCI1_SNOOP_0_SIZE,
544 .base_lo_bits = 12,
545 .size_bits = 12,
546 .get_from_field = mv64x60_shift_left,
547 .map_to_field = mv64x60_shift_right,
548 .extra = 0 },
549 [MV64x60_PCI12MEM_SNOOP_1_WIN] = {
550 .base_hi_reg = GT64260_PCI1_SNOOP_1_BASE_HI,
551 .base_lo_reg = GT64260_PCI1_SNOOP_1_BASE_LO,
552 .size_reg = GT64260_PCI1_SNOOP_1_SIZE,
553 .base_lo_bits = 12,
554 .size_bits = 12,
555 .get_from_field = mv64x60_shift_left,
556 .map_to_field = mv64x60_shift_right,
557 .extra = 0 },
558 [MV64x60_PCI12MEM_SNOOP_2_WIN] = {
559 .base_hi_reg = GT64260_PCI1_SNOOP_2_BASE_HI,
560 .base_lo_reg = GT64260_PCI1_SNOOP_2_BASE_LO,
561 .size_reg = GT64260_PCI1_SNOOP_2_SIZE,
562 .base_lo_bits = 12,
563 .size_bits = 12,
564 .get_from_field = mv64x60_shift_left,
565 .map_to_field = mv64x60_shift_right,
566 .extra = 0 },
567 [MV64x60_PCI12MEM_SNOOP_3_WIN] = {
568 .base_hi_reg = GT64260_PCI1_SNOOP_3_BASE_HI,
569 .base_lo_reg = GT64260_PCI1_SNOOP_3_BASE_LO,
570 .size_reg = GT64260_PCI1_SNOOP_3_SIZE,
571 .base_lo_bits = 12,
572 .size_bits = 12,
573 .get_from_field = mv64x60_shift_left,
574 .map_to_field = mv64x60_shift_right,
575 .extra = 0 },
576};
577
578struct mv64x60_32bit_window
579 mv64360_32bit_windows[MV64x60_32BIT_WIN_COUNT] __initdata = {
580 /* CPU->MEM Windows */
581 [MV64x60_CPU2MEM_0_WIN] = {
582 .base_reg = MV64x60_CPU2MEM_0_BASE,
583 .size_reg = MV64x60_CPU2MEM_0_SIZE,
584 .base_bits = 16,
585 .size_bits = 16,
586 .get_from_field = mv64x60_shift_left,
587 .map_to_field = mv64x60_shift_right,
588 .extra = MV64x60_EXTRA_CPUWIN_ENAB | 0 },
589 [MV64x60_CPU2MEM_1_WIN] = {
590 .base_reg = MV64x60_CPU2MEM_1_BASE,
591 .size_reg = MV64x60_CPU2MEM_1_SIZE,
592 .base_bits = 16,
593 .size_bits = 16,
594 .get_from_field = mv64x60_shift_left,
595 .map_to_field = mv64x60_shift_right,
596 .extra = MV64x60_EXTRA_CPUWIN_ENAB | 1 },
597 [MV64x60_CPU2MEM_2_WIN] = {
598 .base_reg = MV64x60_CPU2MEM_2_BASE,
599 .size_reg = MV64x60_CPU2MEM_2_SIZE,
600 .base_bits = 16,
601 .size_bits = 16,
602 .get_from_field = mv64x60_shift_left,
603 .map_to_field = mv64x60_shift_right,
604 .extra = MV64x60_EXTRA_CPUWIN_ENAB | 2 },
605 [MV64x60_CPU2MEM_3_WIN] = {
606 .base_reg = MV64x60_CPU2MEM_3_BASE,
607 .size_reg = MV64x60_CPU2MEM_3_SIZE,
608 .base_bits = 16,
609 .size_bits = 16,
610 .get_from_field = mv64x60_shift_left,
611 .map_to_field = mv64x60_shift_right,
612 .extra = MV64x60_EXTRA_CPUWIN_ENAB | 3 },
613 /* CPU->Device Windows */
614 [MV64x60_CPU2DEV_0_WIN] = {
615 .base_reg = MV64x60_CPU2DEV_0_BASE,
616 .size_reg = MV64x60_CPU2DEV_0_SIZE,
617 .base_bits = 16,
618 .size_bits = 16,
619 .get_from_field = mv64x60_shift_left,
620 .map_to_field = mv64x60_shift_right,
621 .extra = MV64x60_EXTRA_CPUWIN_ENAB | 4 },
622 [MV64x60_CPU2DEV_1_WIN] = {
623 .base_reg = MV64x60_CPU2DEV_1_BASE,
624 .size_reg = MV64x60_CPU2DEV_1_SIZE,
625 .base_bits = 16,
626 .size_bits = 16,
627 .get_from_field = mv64x60_shift_left,
628 .map_to_field = mv64x60_shift_right,
629 .extra = MV64x60_EXTRA_CPUWIN_ENAB | 5 },
630 [MV64x60_CPU2DEV_2_WIN] = {
631 .base_reg = MV64x60_CPU2DEV_2_BASE,
632 .size_reg = MV64x60_CPU2DEV_2_SIZE,
633 .base_bits = 16,
634 .size_bits = 16,
635 .get_from_field = mv64x60_shift_left,
636 .map_to_field = mv64x60_shift_right,
637 .extra = MV64x60_EXTRA_CPUWIN_ENAB | 6 },
638 [MV64x60_CPU2DEV_3_WIN] = {
639 .base_reg = MV64x60_CPU2DEV_3_BASE,
640 .size_reg = MV64x60_CPU2DEV_3_SIZE,
641 .base_bits = 16,
642 .size_bits = 16,
643 .get_from_field = mv64x60_shift_left,
644 .map_to_field = mv64x60_shift_right,
645 .extra = MV64x60_EXTRA_CPUWIN_ENAB | 7 },
646 /* CPU->Boot Window */
647 [MV64x60_CPU2BOOT_WIN] = {
648 .base_reg = MV64x60_CPU2BOOT_0_BASE,
649 .size_reg = MV64x60_CPU2BOOT_0_SIZE,
650 .base_bits = 16,
651 .size_bits = 16,
652 .get_from_field = mv64x60_shift_left,
653 .map_to_field = mv64x60_shift_right,
654 .extra = MV64x60_EXTRA_CPUWIN_ENAB | 8 },
655 /* CPU->PCI 0 Windows */
656 [MV64x60_CPU2PCI0_IO_WIN] = {
657 .base_reg = MV64x60_CPU2PCI0_IO_BASE,
658 .size_reg = MV64x60_CPU2PCI0_IO_SIZE,
659 .base_bits = 16,
660 .size_bits = 16,
661 .get_from_field = mv64x60_shift_left,
662 .map_to_field = mv64x60_shift_right,
663 .extra = MV64x60_EXTRA_CPUWIN_ENAB | 9 },
664 [MV64x60_CPU2PCI0_MEM_0_WIN] = {
665 .base_reg = MV64x60_CPU2PCI0_MEM_0_BASE,
666 .size_reg = MV64x60_CPU2PCI0_MEM_0_SIZE,
667 .base_bits = 16,
668 .size_bits = 16,
669 .get_from_field = mv64x60_shift_left,
670 .map_to_field = mv64x60_shift_right,
671 .extra = MV64x60_EXTRA_CPUWIN_ENAB | 10 },
672 [MV64x60_CPU2PCI0_MEM_1_WIN] = {
673 .base_reg = MV64x60_CPU2PCI0_MEM_1_BASE,
674 .size_reg = MV64x60_CPU2PCI0_MEM_1_SIZE,
675 .base_bits = 16,
676 .size_bits = 16,
677 .get_from_field = mv64x60_shift_left,
678 .map_to_field = mv64x60_shift_right,
679 .extra = MV64x60_EXTRA_CPUWIN_ENAB | 11 },
680 [MV64x60_CPU2PCI0_MEM_2_WIN] = {
681 .base_reg = MV64x60_CPU2PCI0_MEM_2_BASE,
682 .size_reg = MV64x60_CPU2PCI0_MEM_2_SIZE,
683 .base_bits = 16,
684 .size_bits = 16,
685 .get_from_field = mv64x60_shift_left,
686 .map_to_field = mv64x60_shift_right,
687 .extra = MV64x60_EXTRA_CPUWIN_ENAB | 12 },
688 [MV64x60_CPU2PCI0_MEM_3_WIN] = {
689 .base_reg = MV64x60_CPU2PCI0_MEM_3_BASE,
690 .size_reg = MV64x60_CPU2PCI0_MEM_3_SIZE,
691 .base_bits = 16,
692 .size_bits = 16,
693 .get_from_field = mv64x60_shift_left,
694 .map_to_field = mv64x60_shift_right,
695 .extra = MV64x60_EXTRA_CPUWIN_ENAB | 13 },
696 /* CPU->PCI 1 Windows */
697 [MV64x60_CPU2PCI1_IO_WIN] = {
698 .base_reg = MV64x60_CPU2PCI1_IO_BASE,
699 .size_reg = MV64x60_CPU2PCI1_IO_SIZE,
700 .base_bits = 16,
701 .size_bits = 16,
702 .get_from_field = mv64x60_shift_left,
703 .map_to_field = mv64x60_shift_right,
704 .extra = MV64x60_EXTRA_CPUWIN_ENAB | 14 },
705 [MV64x60_CPU2PCI1_MEM_0_WIN] = {
706 .base_reg = MV64x60_CPU2PCI1_MEM_0_BASE,
707 .size_reg = MV64x60_CPU2PCI1_MEM_0_SIZE,
708 .base_bits = 16,
709 .size_bits = 16,
710 .get_from_field = mv64x60_shift_left,
711 .map_to_field = mv64x60_shift_right,
712 .extra = MV64x60_EXTRA_CPUWIN_ENAB | 15 },
713 [MV64x60_CPU2PCI1_MEM_1_WIN] = {
714 .base_reg = MV64x60_CPU2PCI1_MEM_1_BASE,
715 .size_reg = MV64x60_CPU2PCI1_MEM_1_SIZE,
716 .base_bits = 16,
717 .size_bits = 16,
718 .get_from_field = mv64x60_shift_left,
719 .map_to_field = mv64x60_shift_right,
720 .extra = MV64x60_EXTRA_CPUWIN_ENAB | 16 },
721 [MV64x60_CPU2PCI1_MEM_2_WIN] = {
722 .base_reg = MV64x60_CPU2PCI1_MEM_2_BASE,
723 .size_reg = MV64x60_CPU2PCI1_MEM_2_SIZE,
724 .base_bits = 16,
725 .size_bits = 16,
726 .get_from_field = mv64x60_shift_left,
727 .map_to_field = mv64x60_shift_right,
728 .extra = MV64x60_EXTRA_CPUWIN_ENAB | 17 },
729 [MV64x60_CPU2PCI1_MEM_3_WIN] = {
730 .base_reg = MV64x60_CPU2PCI1_MEM_3_BASE,
731 .size_reg = MV64x60_CPU2PCI1_MEM_3_SIZE,
732 .base_bits = 16,
733 .size_bits = 16,
734 .get_from_field = mv64x60_shift_left,
735 .map_to_field = mv64x60_shift_right,
736 .extra = MV64x60_EXTRA_CPUWIN_ENAB | 18 },
737 /* CPU->SRAM Window */
738 [MV64x60_CPU2SRAM_WIN] = {
739 .base_reg = MV64360_CPU2SRAM_BASE,
740 .size_reg = 0,
741 .base_bits = 16,
742 .size_bits = 0,
743 .get_from_field = mv64x60_shift_left,
744 .map_to_field = mv64x60_shift_right,
745 .extra = MV64x60_EXTRA_CPUWIN_ENAB | 19 },
746 /* CPU->PCI 0 Remap I/O Window */
747 [MV64x60_CPU2PCI0_IO_REMAP_WIN] = {
748 .base_reg = MV64x60_CPU2PCI0_IO_REMAP,
749 .size_reg = 0,
750 .base_bits = 16,
751 .size_bits = 0,
752 .get_from_field = mv64x60_shift_left,
753 .map_to_field = mv64x60_shift_right,
754 .extra = 0 },
755 /* CPU->PCI 1 Remap I/O Window */
756 [MV64x60_CPU2PCI1_IO_REMAP_WIN] = {
757 .base_reg = MV64x60_CPU2PCI1_IO_REMAP,
758 .size_reg = 0,
759 .base_bits = 16,
760 .size_bits = 0,
761 .get_from_field = mv64x60_shift_left,
762 .map_to_field = mv64x60_shift_right,
763 .extra = 0 },
764 /* CPU Memory Protection Windows */
765 [MV64x60_CPU_PROT_0_WIN] = {
766 .base_reg = MV64x60_CPU_PROT_BASE_0,
767 .size_reg = MV64x60_CPU_PROT_SIZE_0,
768 .base_bits = 16,
769 .size_bits = 16,
770 .get_from_field = mv64x60_shift_left,
771 .map_to_field = mv64x60_shift_right,
772 .extra = MV64x60_EXTRA_CPUPROT_ENAB | 31 },
773 [MV64x60_CPU_PROT_1_WIN] = {
774 .base_reg = MV64x60_CPU_PROT_BASE_1,
775 .size_reg = MV64x60_CPU_PROT_SIZE_1,
776 .base_bits = 16,
777 .size_bits = 16,
778 .get_from_field = mv64x60_shift_left,
779 .map_to_field = mv64x60_shift_right,
780 .extra = MV64x60_EXTRA_CPUPROT_ENAB | 31 },
781 [MV64x60_CPU_PROT_2_WIN] = {
782 .base_reg = MV64x60_CPU_PROT_BASE_2,
783 .size_reg = MV64x60_CPU_PROT_SIZE_2,
784 .base_bits = 16,
785 .size_bits = 16,
786 .get_from_field = mv64x60_shift_left,
787 .map_to_field = mv64x60_shift_right,
788 .extra = MV64x60_EXTRA_CPUPROT_ENAB | 31 },
789 [MV64x60_CPU_PROT_3_WIN] = {
790 .base_reg = MV64x60_CPU_PROT_BASE_3,
791 .size_reg = MV64x60_CPU_PROT_SIZE_3,
792 .base_bits = 16,
793 .size_bits = 16,
794 .get_from_field = mv64x60_shift_left,
795 .map_to_field = mv64x60_shift_right,
796 .extra = MV64x60_EXTRA_CPUPROT_ENAB | 31 },
797 /* CPU Snoop Windows -- don't exist on 64360 */
798 /* PCI 0->System Memory Remap Windows */
799 [MV64x60_PCI02MEM_REMAP_0_WIN] = {
800 .base_reg = MV64x60_PCI0_SLAVE_MEM_0_REMAP,
801 .size_reg = 0,
802 .base_bits = 20,
803 .size_bits = 0,
804 .get_from_field = mv64x60_mask,
805 .map_to_field = mv64x60_mask,
806 .extra = 0 },
807 [MV64x60_PCI02MEM_REMAP_1_WIN] = {
808 .base_reg = MV64x60_PCI0_SLAVE_MEM_1_REMAP,
809 .size_reg = 0,
810 .base_bits = 20,
811 .size_bits = 0,
812 .get_from_field = mv64x60_mask,
813 .map_to_field = mv64x60_mask,
814 .extra = 0 },
815 [MV64x60_PCI02MEM_REMAP_2_WIN] = {
816 .base_reg = MV64x60_PCI0_SLAVE_MEM_1_REMAP,
817 .size_reg = 0,
818 .base_bits = 20,
819 .size_bits = 0,
820 .get_from_field = mv64x60_mask,
821 .map_to_field = mv64x60_mask,
822 .extra = 0 },
823 [MV64x60_PCI02MEM_REMAP_3_WIN] = {
824 .base_reg = MV64x60_PCI0_SLAVE_MEM_1_REMAP,
825 .size_reg = 0,
826 .base_bits = 20,
827 .size_bits = 0,
828 .get_from_field = mv64x60_mask,
829 .map_to_field = mv64x60_mask,
830 .extra = 0 },
831 /* PCI 1->System Memory Remap Windows */
832 [MV64x60_PCI12MEM_REMAP_0_WIN] = {
833 .base_reg = MV64x60_PCI1_SLAVE_MEM_0_REMAP,
834 .size_reg = 0,
835 .base_bits = 20,
836 .size_bits = 0,
837 .get_from_field = mv64x60_mask,
838 .map_to_field = mv64x60_mask,
839 .extra = 0 },
840 [MV64x60_PCI12MEM_REMAP_1_WIN] = {
841 .base_reg = MV64x60_PCI1_SLAVE_MEM_1_REMAP,
842 .size_reg = 0,
843 .base_bits = 20,
844 .size_bits = 0,
845 .get_from_field = mv64x60_mask,
846 .map_to_field = mv64x60_mask,
847 .extra = 0 },
848 [MV64x60_PCI12MEM_REMAP_2_WIN] = {
849 .base_reg = MV64x60_PCI1_SLAVE_MEM_1_REMAP,
850 .size_reg = 0,
851 .base_bits = 20,
852 .size_bits = 0,
853 .get_from_field = mv64x60_mask,
854 .map_to_field = mv64x60_mask,
855 .extra = 0 },
856 [MV64x60_PCI12MEM_REMAP_3_WIN] = {
857 .base_reg = MV64x60_PCI1_SLAVE_MEM_1_REMAP,
858 .size_reg = 0,
859 .base_bits = 20,
860 .size_bits = 0,
861 .get_from_field = mv64x60_mask,
862 .map_to_field = mv64x60_mask,
863 .extra = 0 },
864 /* ENET->System Memory Windows */
865 [MV64x60_ENET2MEM_0_WIN] = {
866 .base_reg = MV64360_ENET2MEM_0_BASE,
867 .size_reg = MV64360_ENET2MEM_0_SIZE,
868 .base_bits = 16,
869 .size_bits = 16,
870 .get_from_field = mv64x60_mask,
871 .map_to_field = mv64x60_mask,
872 .extra = MV64x60_EXTRA_ENET_ENAB | 0 },
873 [MV64x60_ENET2MEM_1_WIN] = {
874 .base_reg = MV64360_ENET2MEM_1_BASE,
875 .size_reg = MV64360_ENET2MEM_1_SIZE,
876 .base_bits = 16,
877 .size_bits = 16,
878 .get_from_field = mv64x60_mask,
879 .map_to_field = mv64x60_mask,
880 .extra = MV64x60_EXTRA_ENET_ENAB | 1 },
881 [MV64x60_ENET2MEM_2_WIN] = {
882 .base_reg = MV64360_ENET2MEM_2_BASE,
883 .size_reg = MV64360_ENET2MEM_2_SIZE,
884 .base_bits = 16,
885 .size_bits = 16,
886 .get_from_field = mv64x60_mask,
887 .map_to_field = mv64x60_mask,
888 .extra = MV64x60_EXTRA_ENET_ENAB | 2 },
889 [MV64x60_ENET2MEM_3_WIN] = {
890 .base_reg = MV64360_ENET2MEM_3_BASE,
891 .size_reg = MV64360_ENET2MEM_3_SIZE,
892 .base_bits = 16,
893 .size_bits = 16,
894 .get_from_field = mv64x60_mask,
895 .map_to_field = mv64x60_mask,
896 .extra = MV64x60_EXTRA_ENET_ENAB | 3 },
897 [MV64x60_ENET2MEM_4_WIN] = {
898 .base_reg = MV64360_ENET2MEM_4_BASE,
899 .size_reg = MV64360_ENET2MEM_4_SIZE,
900 .base_bits = 16,
901 .size_bits = 16,
902 .get_from_field = mv64x60_mask,
903 .map_to_field = mv64x60_mask,
904 .extra = MV64x60_EXTRA_ENET_ENAB | 4 },
905 [MV64x60_ENET2MEM_5_WIN] = {
906 .base_reg = MV64360_ENET2MEM_5_BASE,
907 .size_reg = MV64360_ENET2MEM_5_SIZE,
908 .base_bits = 16,
909 .size_bits = 16,
910 .get_from_field = mv64x60_mask,
911 .map_to_field = mv64x60_mask,
912 .extra = MV64x60_EXTRA_ENET_ENAB | 5 },
913 /* MPSC->System Memory Windows */
914 [MV64x60_MPSC2MEM_0_WIN] = {
915 .base_reg = MV64360_MPSC2MEM_0_BASE,
916 .size_reg = MV64360_MPSC2MEM_0_SIZE,
917 .base_bits = 16,
918 .size_bits = 16,
919 .get_from_field = mv64x60_mask,
920 .map_to_field = mv64x60_mask,
921 .extra = MV64x60_EXTRA_MPSC_ENAB | 0 },
922 [MV64x60_MPSC2MEM_1_WIN] = {
923 .base_reg = MV64360_MPSC2MEM_1_BASE,
924 .size_reg = MV64360_MPSC2MEM_1_SIZE,
925 .base_bits = 16,
926 .size_bits = 16,
927 .get_from_field = mv64x60_mask,
928 .map_to_field = mv64x60_mask,
929 .extra = MV64x60_EXTRA_MPSC_ENAB | 1 },
930 [MV64x60_MPSC2MEM_2_WIN] = {
931 .base_reg = MV64360_MPSC2MEM_2_BASE,
932 .size_reg = MV64360_MPSC2MEM_2_SIZE,
933 .base_bits = 16,
934 .size_bits = 16,
935 .get_from_field = mv64x60_mask,
936 .map_to_field = mv64x60_mask,
937 .extra = MV64x60_EXTRA_MPSC_ENAB | 2 },
938 [MV64x60_MPSC2MEM_3_WIN] = {
939 .base_reg = MV64360_MPSC2MEM_3_BASE,
940 .size_reg = MV64360_MPSC2MEM_3_SIZE,
941 .base_bits = 16,
942 .size_bits = 16,
943 .get_from_field = mv64x60_mask,
944 .map_to_field = mv64x60_mask,
945 .extra = MV64x60_EXTRA_MPSC_ENAB | 3 },
946 /* IDMA->System Memory Windows */
947 [MV64x60_IDMA2MEM_0_WIN] = {
948 .base_reg = MV64360_IDMA2MEM_0_BASE,
949 .size_reg = MV64360_IDMA2MEM_0_SIZE,
950 .base_bits = 16,
951 .size_bits = 16,
952 .get_from_field = mv64x60_mask,
953 .map_to_field = mv64x60_mask,
954 .extra = MV64x60_EXTRA_IDMA_ENAB | 0 },
955 [MV64x60_IDMA2MEM_1_WIN] = {
956 .base_reg = MV64360_IDMA2MEM_1_BASE,
957 .size_reg = MV64360_IDMA2MEM_1_SIZE,
958 .base_bits = 16,
959 .size_bits = 16,
960 .get_from_field = mv64x60_mask,
961 .map_to_field = mv64x60_mask,
962 .extra = MV64x60_EXTRA_IDMA_ENAB | 1 },
963 [MV64x60_IDMA2MEM_2_WIN] = {
964 .base_reg = MV64360_IDMA2MEM_2_BASE,
965 .size_reg = MV64360_IDMA2MEM_2_SIZE,
966 .base_bits = 16,
967 .size_bits = 16,
968 .get_from_field = mv64x60_mask,
969 .map_to_field = mv64x60_mask,
970 .extra = MV64x60_EXTRA_IDMA_ENAB | 2 },
971 [MV64x60_IDMA2MEM_3_WIN] = {
972 .base_reg = MV64360_IDMA2MEM_3_BASE,
973 .size_reg = MV64360_IDMA2MEM_3_SIZE,
974 .base_bits = 16,
975 .size_bits = 16,
976 .get_from_field = mv64x60_mask,
977 .map_to_field = mv64x60_mask,
978 .extra = MV64x60_EXTRA_IDMA_ENAB | 3 },
979 [MV64x60_IDMA2MEM_4_WIN] = {
980 .base_reg = MV64360_IDMA2MEM_4_BASE,
981 .size_reg = MV64360_IDMA2MEM_4_SIZE,
982 .base_bits = 16,
983 .size_bits = 16,
984 .get_from_field = mv64x60_mask,
985 .map_to_field = mv64x60_mask,
986 .extra = MV64x60_EXTRA_IDMA_ENAB | 4 },
987 [MV64x60_IDMA2MEM_5_WIN] = {
988 .base_reg = MV64360_IDMA2MEM_5_BASE,
989 .size_reg = MV64360_IDMA2MEM_5_SIZE,
990 .base_bits = 16,
991 .size_bits = 16,
992 .get_from_field = mv64x60_mask,
993 .map_to_field = mv64x60_mask,
994 .extra = MV64x60_EXTRA_IDMA_ENAB | 5 },
995 [MV64x60_IDMA2MEM_6_WIN] = {
996 .base_reg = MV64360_IDMA2MEM_6_BASE,
997 .size_reg = MV64360_IDMA2MEM_6_SIZE,
998 .base_bits = 16,
999 .size_bits = 16,
1000 .get_from_field = mv64x60_mask,
1001 .map_to_field = mv64x60_mask,
1002 .extra = MV64x60_EXTRA_IDMA_ENAB | 6 },
1003 [MV64x60_IDMA2MEM_7_WIN] = {
1004 .base_reg = MV64360_IDMA2MEM_7_BASE,
1005 .size_reg = MV64360_IDMA2MEM_7_SIZE,
1006 .base_bits = 16,
1007 .size_bits = 16,
1008 .get_from_field = mv64x60_mask,
1009 .map_to_field = mv64x60_mask,
1010 .extra = MV64x60_EXTRA_IDMA_ENAB | 7 },
1011};
1012
1013struct mv64x60_64bit_window
1014 mv64360_64bit_windows[MV64x60_64BIT_WIN_COUNT] __initdata = {
1015 /* CPU->PCI 0 MEM Remap Windows */
1016 [MV64x60_CPU2PCI0_MEM_0_REMAP_WIN] = {
1017 .base_hi_reg = MV64x60_CPU2PCI0_MEM_0_REMAP_HI,
1018 .base_lo_reg = MV64x60_CPU2PCI0_MEM_0_REMAP_LO,
1019 .size_reg = 0,
1020 .base_lo_bits = 16,
1021 .size_bits = 0,
1022 .get_from_field = mv64x60_shift_left,
1023 .map_to_field = mv64x60_shift_right,
1024 .extra = 0 },
1025 [MV64x60_CPU2PCI0_MEM_1_REMAP_WIN] = {
1026 .base_hi_reg = MV64x60_CPU2PCI0_MEM_1_REMAP_HI,
1027 .base_lo_reg = MV64x60_CPU2PCI0_MEM_1_REMAP_LO,
1028 .size_reg = 0,
1029 .base_lo_bits = 16,
1030 .size_bits = 0,
1031 .get_from_field = mv64x60_shift_left,
1032 .map_to_field = mv64x60_shift_right,
1033 .extra = 0 },
1034 [MV64x60_CPU2PCI0_MEM_2_REMAP_WIN] = {
1035 .base_hi_reg = MV64x60_CPU2PCI0_MEM_2_REMAP_HI,
1036 .base_lo_reg = MV64x60_CPU2PCI0_MEM_2_REMAP_LO,
1037 .size_reg = 0,
1038 .base_lo_bits = 16,
1039 .size_bits = 0,
1040 .get_from_field = mv64x60_shift_left,
1041 .map_to_field = mv64x60_shift_right,
1042 .extra = 0 },
1043 [MV64x60_CPU2PCI0_MEM_3_REMAP_WIN] = {
1044 .base_hi_reg = MV64x60_CPU2PCI0_MEM_3_REMAP_HI,
1045 .base_lo_reg = MV64x60_CPU2PCI0_MEM_3_REMAP_LO,
1046 .size_reg = 0,
1047 .base_lo_bits = 16,
1048 .size_bits = 0,
1049 .get_from_field = mv64x60_shift_left,
1050 .map_to_field = mv64x60_shift_right,
1051 .extra = 0 },
1052 /* CPU->PCI 1 MEM Remap Windows */
1053 [MV64x60_CPU2PCI1_MEM_0_REMAP_WIN] = {
1054 .base_hi_reg = MV64x60_CPU2PCI1_MEM_0_REMAP_HI,
1055 .base_lo_reg = MV64x60_CPU2PCI1_MEM_0_REMAP_LO,
1056 .size_reg = 0,
1057 .base_lo_bits = 16,
1058 .size_bits = 0,
1059 .get_from_field = mv64x60_shift_left,
1060 .map_to_field = mv64x60_shift_right,
1061 .extra = 0 },
1062 [MV64x60_CPU2PCI1_MEM_1_REMAP_WIN] = {
1063 .base_hi_reg = MV64x60_CPU2PCI1_MEM_1_REMAP_HI,
1064 .base_lo_reg = MV64x60_CPU2PCI1_MEM_1_REMAP_LO,
1065 .size_reg = 0,
1066 .base_lo_bits = 16,
1067 .size_bits = 0,
1068 .get_from_field = mv64x60_shift_left,
1069 .map_to_field = mv64x60_shift_right,
1070 .extra = 0 },
1071 [MV64x60_CPU2PCI1_MEM_2_REMAP_WIN] = {
1072 .base_hi_reg = MV64x60_CPU2PCI1_MEM_2_REMAP_HI,
1073 .base_lo_reg = MV64x60_CPU2PCI1_MEM_2_REMAP_LO,
1074 .size_reg = 0,
1075 .base_lo_bits = 16,
1076 .size_bits = 0,
1077 .get_from_field = mv64x60_shift_left,
1078 .map_to_field = mv64x60_shift_right,
1079 .extra = 0 },
1080 [MV64x60_CPU2PCI1_MEM_3_REMAP_WIN] = {
1081 .base_hi_reg = MV64x60_CPU2PCI1_MEM_3_REMAP_HI,
1082 .base_lo_reg = MV64x60_CPU2PCI1_MEM_3_REMAP_LO,
1083 .size_reg = 0,
1084 .base_lo_bits = 16,
1085 .size_bits = 0,
1086 .get_from_field = mv64x60_shift_left,
1087 .map_to_field = mv64x60_shift_right,
1088 .extra = 0 },
1089 /* PCI 0->MEM Access Control Windows */
1090 [MV64x60_PCI02MEM_ACC_CNTL_0_WIN] = {
1091 .base_hi_reg = MV64x60_PCI0_ACC_CNTL_0_BASE_HI,
1092 .base_lo_reg = MV64x60_PCI0_ACC_CNTL_0_BASE_LO,
1093 .size_reg = MV64x60_PCI0_ACC_CNTL_0_SIZE,
1094 .base_lo_bits = 20,
1095 .size_bits = 20,
1096 .get_from_field = mv64x60_mask,
1097 .map_to_field = mv64x60_mask,
1098 .extra = MV64x60_EXTRA_PCIACC_ENAB | 0 },
1099 [MV64x60_PCI02MEM_ACC_CNTL_1_WIN] = {
1100 .base_hi_reg = MV64x60_PCI0_ACC_CNTL_1_BASE_HI,
1101 .base_lo_reg = MV64x60_PCI0_ACC_CNTL_1_BASE_LO,
1102 .size_reg = MV64x60_PCI0_ACC_CNTL_1_SIZE,
1103 .base_lo_bits = 20,
1104 .size_bits = 20,
1105 .get_from_field = mv64x60_mask,
1106 .map_to_field = mv64x60_mask,
1107 .extra = MV64x60_EXTRA_PCIACC_ENAB | 0 },
1108 [MV64x60_PCI02MEM_ACC_CNTL_2_WIN] = {
1109 .base_hi_reg = MV64x60_PCI0_ACC_CNTL_2_BASE_HI,
1110 .base_lo_reg = MV64x60_PCI0_ACC_CNTL_2_BASE_LO,
1111 .size_reg = MV64x60_PCI0_ACC_CNTL_2_SIZE,
1112 .base_lo_bits = 20,
1113 .size_bits = 20,
1114 .get_from_field = mv64x60_mask,
1115 .map_to_field = mv64x60_mask,
1116 .extra = MV64x60_EXTRA_PCIACC_ENAB | 0 },
1117 [MV64x60_PCI02MEM_ACC_CNTL_3_WIN] = {
1118 .base_hi_reg = MV64x60_PCI0_ACC_CNTL_3_BASE_HI,
1119 .base_lo_reg = MV64x60_PCI0_ACC_CNTL_3_BASE_LO,
1120 .size_reg = MV64x60_PCI0_ACC_CNTL_3_SIZE,
1121 .base_lo_bits = 20,
1122 .size_bits = 20,
1123 .get_from_field = mv64x60_mask,
1124 .map_to_field = mv64x60_mask,
1125 .extra = MV64x60_EXTRA_PCIACC_ENAB | 0 },
1126 /* PCI 1->MEM Access Control Windows */
1127 [MV64x60_PCI12MEM_ACC_CNTL_0_WIN] = {
1128 .base_hi_reg = MV64x60_PCI1_ACC_CNTL_0_BASE_HI,
1129 .base_lo_reg = MV64x60_PCI1_ACC_CNTL_0_BASE_LO,
1130 .size_reg = MV64x60_PCI1_ACC_CNTL_0_SIZE,
1131 .base_lo_bits = 20,
1132 .size_bits = 20,
1133 .get_from_field = mv64x60_mask,
1134 .map_to_field = mv64x60_mask,
1135 .extra = MV64x60_EXTRA_PCIACC_ENAB | 0 },
1136 [MV64x60_PCI12MEM_ACC_CNTL_1_WIN] = {
1137 .base_hi_reg = MV64x60_PCI1_ACC_CNTL_1_BASE_HI,
1138 .base_lo_reg = MV64x60_PCI1_ACC_CNTL_1_BASE_LO,
1139 .size_reg = MV64x60_PCI1_ACC_CNTL_1_SIZE,
1140 .base_lo_bits = 20,
1141 .size_bits = 20,
1142 .get_from_field = mv64x60_mask,
1143 .map_to_field = mv64x60_mask,
1144 .extra = MV64x60_EXTRA_PCIACC_ENAB | 0 },
1145 [MV64x60_PCI12MEM_ACC_CNTL_2_WIN] = {
1146 .base_hi_reg = MV64x60_PCI1_ACC_CNTL_2_BASE_HI,
1147 .base_lo_reg = MV64x60_PCI1_ACC_CNTL_2_BASE_LO,
1148 .size_reg = MV64x60_PCI1_ACC_CNTL_2_SIZE,
1149 .base_lo_bits = 20,
1150 .size_bits = 20,
1151 .get_from_field = mv64x60_mask,
1152 .map_to_field = mv64x60_mask,
1153 .extra = MV64x60_EXTRA_PCIACC_ENAB | 0 },
1154 [MV64x60_PCI12MEM_ACC_CNTL_3_WIN] = {
1155 .base_hi_reg = MV64x60_PCI1_ACC_CNTL_3_BASE_HI,
1156 .base_lo_reg = MV64x60_PCI1_ACC_CNTL_3_BASE_LO,
1157 .size_reg = MV64x60_PCI1_ACC_CNTL_3_SIZE,
1158 .base_lo_bits = 20,
1159 .size_bits = 20,
1160 .get_from_field = mv64x60_mask,
1161 .map_to_field = mv64x60_mask,
1162 .extra = MV64x60_EXTRA_PCIACC_ENAB | 0 },
1163 /* PCI 0->MEM Snoop Windows -- don't exist on 64360 */
1164 /* PCI 1->MEM Snoop Windows -- don't exist on 64360 */
1165};
diff --git a/arch/ppc/syslib/ocp.c b/arch/ppc/syslib/ocp.c
deleted file mode 100644
index a6fb7dcfa738..000000000000
--- a/arch/ppc/syslib/ocp.c
+++ /dev/null
@@ -1,482 +0,0 @@
1/*
2 * ocp.c
3 *
4 * (c) Benjamin Herrenschmidt (benh@kernel.crashing.org)
5 * Mipsys - France
6 *
7 * Derived from work (c) Armin Kuster akuster@pacbell.net
8 *
9 * Additional support and port to 2.6 LDM/sysfs by
10 * Matt Porter <mporter@kernel.crashing.org>
11 * Copyright 2004 MontaVista Software, Inc.
12 *
13 * This program is free software; you can redistribute it and/or modify it
14 * under the terms of the GNU General Public License as published by the
15 * Free Software Foundation; either version 2 of the License, or (at your
16 * option) any later version.
17 *
18 * OCP (On Chip Peripheral) is a software emulated "bus" with a
19 * pseudo discovery method for dumb peripherals. Usually these type
20 * of peripherals are found on embedded SoC (System On a Chip)
21 * processors or highly integrated system controllers that have
22 * a host bridge and many peripherals. Common examples where
23 * this is already used include the PPC4xx, MPC52xx,
24 * and MV64xxx parts.
25 *
26 * This subsystem creates a standard OCP bus type within the
27 * device model. The devices on the OCP bus are seeded by an
28 * an initial OCP device array created by the arch-specific
29 * Device entries can be added/removed/modified through OCP
30 * helper functions to accommodate system and board-specific
31 * parameters commonly found in embedded systems. OCP also
32 * provides a standard method for devices to describe extended
33 * attributes about themselves to the system. A standard access
34 * method allows OCP drivers to obtain the information, both
35 * SoC-specific and system/board-specific, needed for operation.
36 */
37
38#include <linux/module.h>
39#include <linux/list.h>
40#include <linux/miscdevice.h>
41#include <linux/slab.h>
42#include <linux/types.h>
43#include <linux/init.h>
44#include <linux/pm.h>
45#include <linux/bootmem.h>
46#include <linux/device.h>
47#include <linux/rwsem.h>
48
49#include <asm/io.h>
50#include <asm/ocp.h>
51#include <asm/errno.h>
52
53//#define DBG(x) printk x
54#define DBG(x)
55
56extern int mem_init_done;
57
58extern struct ocp_def core_ocp[]; /* Static list of devices, provided by
59 CPU core */
60
61LIST_HEAD(ocp_devices); /* List of all OCP devices */
62DECLARE_RWSEM(ocp_devices_sem); /* Global semaphores for those lists */
63
64static int ocp_inited;
65
66/* Sysfs support */
67#define OCP_DEF_ATTR(field, format_string) \
68static ssize_t \
69show_##field(struct device *dev, struct device_attribute *attr, char *buf) \
70{ \
71 struct ocp_device *odev = to_ocp_dev(dev); \
72 \
73 return sprintf(buf, format_string, odev->def->field); \
74} \
75static DEVICE_ATTR(field, S_IRUGO, show_##field, NULL);
76
77OCP_DEF_ATTR(vendor, "0x%04x\n");
78OCP_DEF_ATTR(function, "0x%04x\n");
79OCP_DEF_ATTR(index, "0x%04x\n");
80#ifdef CONFIG_PTE_64BIT
81OCP_DEF_ATTR(paddr, "0x%016Lx\n");
82#else
83OCP_DEF_ATTR(paddr, "0x%08lx\n");
84#endif
85OCP_DEF_ATTR(irq, "%d\n");
86OCP_DEF_ATTR(pm, "%lu\n");
87
88void ocp_create_sysfs_dev_files(struct ocp_device *odev)
89{
90 struct device *dev = &odev->dev;
91
92 /* Current OCP device def attributes */
93 device_create_file(dev, &dev_attr_vendor);
94 device_create_file(dev, &dev_attr_function);
95 device_create_file(dev, &dev_attr_index);
96 device_create_file(dev, &dev_attr_paddr);
97 device_create_file(dev, &dev_attr_irq);
98 device_create_file(dev, &dev_attr_pm);
99 /* Current OCP device additions attributes */
100 if (odev->def->additions && odev->def->show)
101 odev->def->show(dev);
102}
103
104/**
105 * ocp_device_match - Match one driver to one device
106 * @drv: driver to match
107 * @dev: device to match
108 *
109 * This function returns 0 if the driver and device don't match
110 */
111static int
112ocp_device_match(struct device *dev, struct device_driver *drv)
113{
114 struct ocp_device *ocp_dev = to_ocp_dev(dev);
115 struct ocp_driver *ocp_drv = to_ocp_drv(drv);
116 const struct ocp_device_id *ids = ocp_drv->id_table;
117
118 if (!ids)
119 return 0;
120
121 while (ids->vendor || ids->function) {
122 if ((ids->vendor == OCP_ANY_ID
123 || ids->vendor == ocp_dev->def->vendor)
124 && (ids->function == OCP_ANY_ID
125 || ids->function == ocp_dev->def->function))
126 return 1;
127 ids++;
128 }
129 return 0;
130}
131
132static int
133ocp_device_probe(struct device *dev)
134{
135 int error = 0;
136 struct ocp_driver *drv;
137 struct ocp_device *ocp_dev;
138
139 drv = to_ocp_drv(dev->driver);
140 ocp_dev = to_ocp_dev(dev);
141
142 if (drv->probe) {
143 error = drv->probe(ocp_dev);
144 if (error >= 0) {
145 ocp_dev->driver = drv;
146 error = 0;
147 }
148 }
149 return error;
150}
151
152static int
153ocp_device_remove(struct device *dev)
154{
155 struct ocp_device *ocp_dev = to_ocp_dev(dev);
156
157 if (ocp_dev->driver) {
158 if (ocp_dev->driver->remove)
159 ocp_dev->driver->remove(ocp_dev);
160 ocp_dev->driver = NULL;
161 }
162 return 0;
163}
164
165static int
166ocp_device_suspend(struct device *dev, pm_message_t state)
167{
168 struct ocp_device *ocp_dev = to_ocp_dev(dev);
169 struct ocp_driver *ocp_drv = to_ocp_drv(dev->driver);
170
171 if (dev->driver && ocp_drv->suspend)
172 return ocp_drv->suspend(ocp_dev, state);
173 return 0;
174}
175
176static int
177ocp_device_resume(struct device *dev)
178{
179 struct ocp_device *ocp_dev = to_ocp_dev(dev);
180 struct ocp_driver *ocp_drv = to_ocp_drv(dev->driver);
181
182 if (dev->driver && ocp_drv->resume)
183 return ocp_drv->resume(ocp_dev);
184 return 0;
185}
186
187struct bus_type ocp_bus_type = {
188 .name = "ocp",
189 .match = ocp_device_match,
190 .probe = ocp_device_probe,
191 .remove = ocp_device_remove,
192 .suspend = ocp_device_suspend,
193 .resume = ocp_device_resume,
194};
195
196/**
197 * ocp_register_driver - Register an OCP driver
198 * @drv: pointer to statically defined ocp_driver structure
199 *
200 * The driver's probe() callback is called either recursively
201 * by this function or upon later call of ocp_driver_init
202 *
203 * NOTE: Detection of devices is a 2 pass step on this implementation,
204 * hotswap isn't supported. First, all OCP devices are put in the device
205 * list, _then_ all drivers are probed on each match.
206 */
207int
208ocp_register_driver(struct ocp_driver *drv)
209{
210 /* initialize common driver fields */
211 drv->driver.name = drv->name;
212 drv->driver.bus = &ocp_bus_type;
213
214 /* register with core */
215 return driver_register(&drv->driver);
216}
217
218/**
219 * ocp_unregister_driver - Unregister an OCP driver
220 * @drv: pointer to statically defined ocp_driver structure
221 *
222 * The driver's remove() callback is called recursively
223 * by this function for any device already registered
224 */
225void
226ocp_unregister_driver(struct ocp_driver *drv)
227{
228 DBG(("ocp: ocp_unregister_driver(%s)...\n", drv->name));
229
230 driver_unregister(&drv->driver);
231
232 DBG(("ocp: ocp_unregister_driver(%s)... done.\n", drv->name));
233}
234
235/* Core of ocp_find_device(). Caller must hold ocp_devices_sem */
236static struct ocp_device *
237__ocp_find_device(unsigned int vendor, unsigned int function, int index)
238{
239 struct list_head *entry;
240 struct ocp_device *dev, *found = NULL;
241
242 DBG(("ocp: __ocp_find_device(vendor: %x, function: %x, index: %d)...\n", vendor, function, index));
243
244 list_for_each(entry, &ocp_devices) {
245 dev = list_entry(entry, struct ocp_device, link);
246 if (vendor != OCP_ANY_ID && vendor != dev->def->vendor)
247 continue;
248 if (function != OCP_ANY_ID && function != dev->def->function)
249 continue;
250 if (index != OCP_ANY_INDEX && index != dev->def->index)
251 continue;
252 found = dev;
253 break;
254 }
255
256 DBG(("ocp: __ocp_find_device(vendor: %x, function: %x, index: %d)... done\n", vendor, function, index));
257
258 return found;
259}
260
261/**
262 * ocp_find_device - Find a device by function & index
263 * @vendor: vendor ID of the device (or OCP_ANY_ID)
264 * @function: function code of the device (or OCP_ANY_ID)
265 * @idx: index of the device (or OCP_ANY_INDEX)
266 *
267 * This function allows a lookup of a given function by it's
268 * index, it's typically used to find the MAL or ZMII associated
269 * with an EMAC or similar horrors.
270 * You can pass vendor, though you usually want OCP_ANY_ID there...
271 */
272struct ocp_device *
273ocp_find_device(unsigned int vendor, unsigned int function, int index)
274{
275 struct ocp_device *dev;
276
277 down_read(&ocp_devices_sem);
278 dev = __ocp_find_device(vendor, function, index);
279 up_read(&ocp_devices_sem);
280
281 return dev;
282}
283
284/**
285 * ocp_get_one_device - Find a def by function & index
286 * @vendor: vendor ID of the device (or OCP_ANY_ID)
287 * @function: function code of the device (or OCP_ANY_ID)
288 * @idx: index of the device (or OCP_ANY_INDEX)
289 *
290 * This function allows a lookup of a given ocp_def by it's
291 * vendor, function, and index. The main purpose for is to
292 * allow modification of the def before binding to the driver
293 */
294struct ocp_def *
295ocp_get_one_device(unsigned int vendor, unsigned int function, int index)
296{
297 struct ocp_device *dev;
298 struct ocp_def *found = NULL;
299
300 DBG(("ocp: ocp_get_one_device(vendor: %x, function: %x, index: %d)...\n",
301 vendor, function, index));
302
303 dev = ocp_find_device(vendor, function, index);
304
305 if (dev)
306 found = dev->def;
307
308 DBG(("ocp: ocp_get_one_device(vendor: %x, function: %x, index: %d)... done.\n",
309 vendor, function, index));
310
311 return found;
312}
313
314/**
315 * ocp_add_one_device - Add a device
316 * @def: static device definition structure
317 *
318 * This function adds a device definition to the
319 * device list. It may only be called before
320 * ocp_driver_init() and will return an error
321 * otherwise.
322 */
323int
324ocp_add_one_device(struct ocp_def *def)
325{
326 struct ocp_device *dev;
327
328 DBG(("ocp: ocp_add_one_device()...\n"));
329
330 /* Can't be called after ocp driver init */
331 if (ocp_inited)
332 return 1;
333
334 if (mem_init_done)
335 dev = kmalloc(sizeof(*dev), GFP_KERNEL);
336 else
337 dev = alloc_bootmem(sizeof(*dev));
338
339 if (dev == NULL)
340 return 1;
341 memset(dev, 0, sizeof(*dev));
342 dev->def = def;
343 dev->current_state = 4;
344 sprintf(dev->name, "OCP device %04x:%04x:%04x",
345 dev->def->vendor, dev->def->function, dev->def->index);
346 down_write(&ocp_devices_sem);
347 list_add_tail(&dev->link, &ocp_devices);
348 up_write(&ocp_devices_sem);
349
350 DBG(("ocp: ocp_add_one_device()...done\n"));
351
352 return 0;
353}
354
355/**
356 * ocp_remove_one_device - Remove a device by function & index
357 * @vendor: vendor ID of the device (or OCP_ANY_ID)
358 * @function: function code of the device (or OCP_ANY_ID)
359 * @idx: index of the device (or OCP_ANY_INDEX)
360 *
361 * This function allows removal of a given function by its
362 * index. It may only be called before ocp_driver_init()
363 * and will return an error otherwise.
364 */
365int
366ocp_remove_one_device(unsigned int vendor, unsigned int function, int index)
367{
368 struct ocp_device *dev;
369
370 DBG(("ocp: ocp_remove_one_device(vendor: %x, function: %x, index: %d)...\n", vendor, function, index));
371
372 /* Can't be called after ocp driver init */
373 if (ocp_inited)
374 return 1;
375
376 down_write(&ocp_devices_sem);
377 dev = __ocp_find_device(vendor, function, index);
378 list_del(&dev->link);
379 up_write(&ocp_devices_sem);
380
381 DBG(("ocp: ocp_remove_one_device(vendor: %x, function: %x, index: %d)... done.\n", vendor, function, index));
382
383 return 0;
384}
385
386/**
387 * ocp_for_each_device - Iterate over OCP devices
388 * @callback: routine to execute for each ocp device.
389 * @arg: user data to be passed to callback routine.
390 *
391 * This routine holds the ocp_device semaphore, so the
392 * callback routine cannot modify the ocp_device list.
393 */
394void
395ocp_for_each_device(void(*callback)(struct ocp_device *, void *arg), void *arg)
396{
397 struct list_head *entry;
398
399 if (callback) {
400 down_read(&ocp_devices_sem);
401 list_for_each(entry, &ocp_devices)
402 callback(list_entry(entry, struct ocp_device, link),
403 arg);
404 up_read(&ocp_devices_sem);
405 }
406}
407
408/**
409 * ocp_early_init - Init OCP device management
410 *
411 * This function builds the list of devices before setup_arch.
412 * This allows platform code to modify the device lists before
413 * they are bound to drivers (changes to paddr, removing devices
414 * etc)
415 */
416int __init
417ocp_early_init(void)
418{
419 struct ocp_def *def;
420
421 DBG(("ocp: ocp_early_init()...\n"));
422
423 /* Fill the devices list */
424 for (def = core_ocp; def->vendor != OCP_VENDOR_INVALID; def++)
425 ocp_add_one_device(def);
426
427 DBG(("ocp: ocp_early_init()... done.\n"));
428
429 return 0;
430}
431
432/**
433 * ocp_driver_init - Init OCP device management
434 *
435 * This function is meant to be called via OCP bus registration.
436 */
437static int __init
438ocp_driver_init(void)
439{
440 int ret = 0, index = 0;
441 struct device *ocp_bus;
442 struct list_head *entry;
443 struct ocp_device *dev;
444
445 if (ocp_inited)
446 return ret;
447 ocp_inited = 1;
448
449 DBG(("ocp: ocp_driver_init()...\n"));
450
451 /* Allocate/register primary OCP bus */
452 ocp_bus = kzalloc(sizeof(struct device), GFP_KERNEL);
453 if (ocp_bus == NULL)
454 return 1;
455 strcpy(ocp_bus->bus_id, "ocp");
456
457 bus_register(&ocp_bus_type);
458
459 device_register(ocp_bus);
460
461 /* Put each OCP device into global device list */
462 list_for_each(entry, &ocp_devices) {
463 dev = list_entry(entry, struct ocp_device, link);
464 sprintf(dev->dev.bus_id, "%2.2x", index);
465 dev->dev.parent = ocp_bus;
466 dev->dev.bus = &ocp_bus_type;
467 device_register(&dev->dev);
468 ocp_create_sysfs_dev_files(dev);
469 index++;
470 }
471
472 DBG(("ocp: ocp_driver_init()... done.\n"));
473
474 return 0;
475}
476
477postcore_initcall(ocp_driver_init);
478
479EXPORT_SYMBOL(ocp_bus_type);
480EXPORT_SYMBOL(ocp_find_device);
481EXPORT_SYMBOL(ocp_register_driver);
482EXPORT_SYMBOL(ocp_unregister_driver);
diff --git a/arch/ppc/syslib/open_pic.c b/arch/ppc/syslib/open_pic.c
deleted file mode 100644
index 67dffe27b5c3..000000000000
--- a/arch/ppc/syslib/open_pic.c
+++ /dev/null
@@ -1,1087 +0,0 @@
1/*
2 * Copyright (C) 1997 Geert Uytterhoeven
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file COPYING in the main directory of this archive
6 * for more details.
7 */
8
9#include <linux/types.h>
10#include <linux/kernel.h>
11#include <linux/sched.h>
12#include <linux/init.h>
13#include <linux/interrupt.h>
14#include <linux/sysdev.h>
15#include <linux/errno.h>
16#include <asm/ptrace.h>
17#include <asm/signal.h>
18#include <asm/io.h>
19#include <asm/irq.h>
20#include <asm/sections.h>
21#include <asm/open_pic.h>
22#include <asm/i8259.h>
23#include <asm/machdep.h>
24
25#include "open_pic_defs.h"
26
27#if defined(CONFIG_PRPMC800)
28#define OPENPIC_BIG_ENDIAN
29#endif
30
31void __iomem *OpenPIC_Addr;
32static volatile struct OpenPIC __iomem *OpenPIC = NULL;
33
34/*
35 * We define OpenPIC_InitSenses table thusly:
36 * bit 0x1: sense, 0 for edge and 1 for level.
37 * bit 0x2: polarity, 0 for negative, 1 for positive.
38 */
39u_int OpenPIC_NumInitSenses __initdata = 0;
40u_char *OpenPIC_InitSenses __initdata = NULL;
41extern int use_of_interrupt_tree;
42
43static u_int NumProcessors;
44static u_int NumSources;
45static int open_pic_irq_offset;
46static volatile OpenPIC_Source __iomem *ISR[NR_IRQS];
47static int openpic_cascade_irq = -1;
48static int (*openpic_cascade_fn)(void);
49
50/* Global Operations */
51static void openpic_disable_8259_pass_through(void);
52static void openpic_set_spurious(u_int vector);
53
54#ifdef CONFIG_SMP
55/* Interprocessor Interrupts */
56static void openpic_initipi(u_int ipi, u_int pri, u_int vector);
57static irqreturn_t openpic_ipi_action(int cpl, void *dev_id);
58#endif
59
60/* Timer Interrupts */
61static void openpic_inittimer(u_int timer, u_int pri, u_int vector);
62static void openpic_maptimer(u_int timer, cpumask_t cpumask);
63
64/* Interrupt Sources */
65static void openpic_enable_irq(u_int irq);
66static void openpic_disable_irq(u_int irq);
67static void openpic_initirq(u_int irq, u_int pri, u_int vector, int polarity,
68 int is_level);
69static void openpic_mapirq(u_int irq, cpumask_t cpumask, cpumask_t keepmask);
70
71/*
72 * These functions are not used but the code is kept here
73 * for completeness and future reference.
74 */
75#ifdef notused
76static void openpic_enable_8259_pass_through(void);
77static u_int openpic_get_spurious(void);
78static void openpic_set_sense(u_int irq, int sense);
79#endif /* notused */
80
81/*
82 * Description of the openpic for the higher-level irq code
83 */
84static void openpic_end_irq(unsigned int irq_nr);
85static void openpic_ack_irq(unsigned int irq_nr);
86static void openpic_set_affinity(unsigned int irq_nr, cpumask_t cpumask);
87
88struct hw_interrupt_type open_pic = {
89 .typename = " OpenPIC ",
90 .enable = openpic_enable_irq,
91 .disable = openpic_disable_irq,
92 .ack = openpic_ack_irq,
93 .end = openpic_end_irq,
94 .set_affinity = openpic_set_affinity,
95};
96
97#ifdef CONFIG_SMP
98static void openpic_end_ipi(unsigned int irq_nr);
99static void openpic_ack_ipi(unsigned int irq_nr);
100static void openpic_enable_ipi(unsigned int irq_nr);
101static void openpic_disable_ipi(unsigned int irq_nr);
102
103struct hw_interrupt_type open_pic_ipi = {
104 .typename = " OpenPIC ",
105 .enable = openpic_enable_ipi,
106 .disable = openpic_disable_ipi,
107 .ack = openpic_ack_ipi,
108 .end = openpic_end_ipi,
109};
110#endif /* CONFIG_SMP */
111
112/*
113 * Accesses to the current processor's openpic registers
114 */
115#ifdef CONFIG_SMP
116#define THIS_CPU Processor[cpu]
117#define DECL_THIS_CPU int cpu = smp_hw_index[smp_processor_id()]
118#define CHECK_THIS_CPU check_arg_cpu(cpu)
119#else
120#define THIS_CPU Processor[0]
121#define DECL_THIS_CPU
122#define CHECK_THIS_CPU
123#endif /* CONFIG_SMP */
124
125#if 1
126#define check_arg_ipi(ipi) \
127 if (ipi < 0 || ipi >= OPENPIC_NUM_IPI) \
128 printk("open_pic.c:%d: invalid ipi %d\n", __LINE__, ipi);
129#define check_arg_timer(timer) \
130 if (timer < 0 || timer >= OPENPIC_NUM_TIMERS) \
131 printk("open_pic.c:%d: invalid timer %d\n", __LINE__, timer);
132#define check_arg_vec(vec) \
133 if (vec < 0 || vec >= OPENPIC_NUM_VECTORS) \
134 printk("open_pic.c:%d: invalid vector %d\n", __LINE__, vec);
135#define check_arg_pri(pri) \
136 if (pri < 0 || pri >= OPENPIC_NUM_PRI) \
137 printk("open_pic.c:%d: invalid priority %d\n", __LINE__, pri);
138/*
139 * Print out a backtrace if it's out of range, since if it's larger than NR_IRQ's
140 * data has probably been corrupted and we're going to panic or deadlock later
141 * anyway --Troy
142 */
143#define check_arg_irq(irq) \
144 if (irq < open_pic_irq_offset || irq >= NumSources+open_pic_irq_offset \
145 || ISR[irq - open_pic_irq_offset] == 0) { \
146 printk("open_pic.c:%d: invalid irq %d\n", __LINE__, irq); \
147 dump_stack(); }
148#define check_arg_cpu(cpu) \
149 if (cpu < 0 || cpu >= NumProcessors){ \
150 printk("open_pic.c:%d: invalid cpu %d\n", __LINE__, cpu); \
151 dump_stack(); }
152#else
153#define check_arg_ipi(ipi) do {} while (0)
154#define check_arg_timer(timer) do {} while (0)
155#define check_arg_vec(vec) do {} while (0)
156#define check_arg_pri(pri) do {} while (0)
157#define check_arg_irq(irq) do {} while (0)
158#define check_arg_cpu(cpu) do {} while (0)
159#endif
160
161u_int openpic_read(volatile u_int __iomem *addr)
162{
163 u_int val;
164
165#ifdef OPENPIC_BIG_ENDIAN
166 val = in_be32(addr);
167#else
168 val = in_le32(addr);
169#endif
170 return val;
171}
172
173static inline void openpic_write(volatile u_int __iomem *addr, u_int val)
174{
175#ifdef OPENPIC_BIG_ENDIAN
176 out_be32(addr, val);
177#else
178 out_le32(addr, val);
179#endif
180}
181
182static inline u_int openpic_readfield(volatile u_int __iomem *addr, u_int mask)
183{
184 u_int val = openpic_read(addr);
185 return val & mask;
186}
187
188inline void openpic_writefield(volatile u_int __iomem *addr, u_int mask,
189 u_int field)
190{
191 u_int val = openpic_read(addr);
192 openpic_write(addr, (val & ~mask) | (field & mask));
193}
194
195static inline void openpic_clearfield(volatile u_int __iomem *addr, u_int mask)
196{
197 openpic_writefield(addr, mask, 0);
198}
199
200static inline void openpic_setfield(volatile u_int __iomem *addr, u_int mask)
201{
202 openpic_writefield(addr, mask, mask);
203}
204
205static void openpic_safe_writefield(volatile u_int __iomem *addr, u_int mask,
206 u_int field)
207{
208 openpic_setfield(addr, OPENPIC_MASK);
209 while (openpic_read(addr) & OPENPIC_ACTIVITY);
210 openpic_writefield(addr, mask | OPENPIC_MASK, field | OPENPIC_MASK);
211}
212
213#ifdef CONFIG_SMP
214/* yes this is right ... bug, feature, you decide! -- tgall */
215u_int openpic_read_IPI(volatile u_int __iomem * addr)
216{
217 u_int val = 0;
218#if defined(OPENPIC_BIG_ENDIAN)
219 val = in_be32(addr);
220#else
221 val = in_le32(addr);
222#endif
223 return val;
224}
225
226/* because of the power3 be / le above, this is needed */
227inline void openpic_writefield_IPI(volatile u_int __iomem * addr, u_int mask, u_int field)
228{
229 u_int val = openpic_read_IPI(addr);
230 openpic_write(addr, (val & ~mask) | (field & mask));
231}
232
233static inline void openpic_clearfield_IPI(volatile u_int __iomem *addr, u_int mask)
234{
235 openpic_writefield_IPI(addr, mask, 0);
236}
237
238static inline void openpic_setfield_IPI(volatile u_int __iomem *addr, u_int mask)
239{
240 openpic_writefield_IPI(addr, mask, mask);
241}
242
243static void openpic_safe_writefield_IPI(volatile u_int __iomem *addr, u_int mask, u_int field)
244{
245 openpic_setfield_IPI(addr, OPENPIC_MASK);
246
247 /* wait until it's not in use */
248 /* BenH: Is this code really enough ? I would rather check the result
249 * and eventually retry ...
250 */
251 while(openpic_read_IPI(addr) & OPENPIC_ACTIVITY);
252
253 openpic_writefield_IPI(addr, mask | OPENPIC_MASK, field | OPENPIC_MASK);
254}
255#endif /* CONFIG_SMP */
256
257#ifdef CONFIG_EPIC_SERIAL_MODE
258/* On platforms that may use EPIC serial mode, the default is enabled. */
259int epic_serial_mode = 1;
260
261static void __init openpic_eicr_set_clk(u_int clkval)
262{
263 openpic_writefield(&OpenPIC->Global.Global_Configuration1,
264 OPENPIC_EICR_S_CLK_MASK, (clkval << 28));
265}
266
267static void __init openpic_enable_sie(void)
268{
269 openpic_setfield(&OpenPIC->Global.Global_Configuration1,
270 OPENPIC_EICR_SIE);
271}
272#endif
273
274#if defined(CONFIG_EPIC_SERIAL_MODE)
275static void openpic_reset(void)
276{
277 openpic_setfield(&OpenPIC->Global.Global_Configuration0,
278 OPENPIC_CONFIG_RESET);
279 while (openpic_readfield(&OpenPIC->Global.Global_Configuration0,
280 OPENPIC_CONFIG_RESET))
281 mb();
282}
283#endif
284
285void __init openpic_set_sources(int first_irq, int num_irqs, void __iomem *first_ISR)
286{
287 volatile OpenPIC_Source __iomem *src = first_ISR;
288 int i, last_irq;
289
290 last_irq = first_irq + num_irqs;
291 if (last_irq > NumSources)
292 NumSources = last_irq;
293 if (src == 0)
294 src = &((struct OpenPIC __iomem *)OpenPIC_Addr)->Source[first_irq];
295 for (i = first_irq; i < last_irq; ++i, ++src)
296 ISR[i] = src;
297}
298
299/*
300 * The `offset' parameter defines where the interrupts handled by the
301 * OpenPIC start in the space of interrupt numbers that the kernel knows
302 * about. In other words, the OpenPIC's IRQ0 is numbered `offset' in the
303 * kernel's interrupt numbering scheme.
304 * We assume there is only one OpenPIC.
305 */
306void __init openpic_init(int offset)
307{
308 u_int t, i;
309 u_int timerfreq;
310 const char *version;
311
312 if (!OpenPIC_Addr) {
313 printk("No OpenPIC found !\n");
314 return;
315 }
316 OpenPIC = (volatile struct OpenPIC __iomem *)OpenPIC_Addr;
317
318#ifdef CONFIG_EPIC_SERIAL_MODE
319 /* Have to start from ground zero.
320 */
321 openpic_reset();
322#endif
323
324 if (ppc_md.progress) ppc_md.progress("openpic: enter", 0x122);
325
326 t = openpic_read(&OpenPIC->Global.Feature_Reporting0);
327 switch (t & OPENPIC_FEATURE_VERSION_MASK) {
328 case 1:
329 version = "1.0";
330 break;
331 case 2:
332 version = "1.2";
333 break;
334 case 3:
335 version = "1.3";
336 break;
337 default:
338 version = "?";
339 break;
340 }
341 NumProcessors = ((t & OPENPIC_FEATURE_LAST_PROCESSOR_MASK) >>
342 OPENPIC_FEATURE_LAST_PROCESSOR_SHIFT) + 1;
343 if (NumSources == 0)
344 openpic_set_sources(0,
345 ((t & OPENPIC_FEATURE_LAST_SOURCE_MASK) >>
346 OPENPIC_FEATURE_LAST_SOURCE_SHIFT) + 1,
347 NULL);
348 printk("OpenPIC Version %s (%d CPUs and %d IRQ sources) at %p\n",
349 version, NumProcessors, NumSources, OpenPIC);
350 timerfreq = openpic_read(&OpenPIC->Global.Timer_Frequency);
351 if (timerfreq)
352 printk("OpenPIC timer frequency is %d.%06d MHz\n",
353 timerfreq / 1000000, timerfreq % 1000000);
354
355 open_pic_irq_offset = offset;
356
357 /* Initialize timer interrupts */
358 if ( ppc_md.progress ) ppc_md.progress("openpic: timer",0x3ba);
359 for (i = 0; i < OPENPIC_NUM_TIMERS; i++) {
360 /* Disabled, Priority 0 */
361 openpic_inittimer(i, 0, OPENPIC_VEC_TIMER+i+offset);
362 /* No processor */
363 openpic_maptimer(i, CPU_MASK_NONE);
364 }
365
366#ifdef CONFIG_SMP
367 /* Initialize IPI interrupts */
368 if ( ppc_md.progress ) ppc_md.progress("openpic: ipi",0x3bb);
369 for (i = 0; i < OPENPIC_NUM_IPI; i++) {
370 /* Disabled, increased priorities 10..13 */
371 openpic_initipi(i, OPENPIC_PRIORITY_IPI_BASE+i,
372 OPENPIC_VEC_IPI+i+offset);
373 /* IPIs are per-CPU */
374 irq_desc[OPENPIC_VEC_IPI+i+offset].status |= IRQ_PER_CPU;
375 irq_desc[OPENPIC_VEC_IPI+i+offset].chip = &open_pic_ipi;
376 }
377#endif
378
379 /* Initialize external interrupts */
380 if (ppc_md.progress) ppc_md.progress("openpic: external",0x3bc);
381
382 openpic_set_priority(0xf);
383
384 /* Init all external sources, including possibly the cascade. */
385 for (i = 0; i < NumSources; i++) {
386 int sense;
387
388 if (ISR[i] == 0)
389 continue;
390
391 /* the bootloader may have left it enabled (bad !) */
392 openpic_disable_irq(i+offset);
393
394 sense = (i < OpenPIC_NumInitSenses)? OpenPIC_InitSenses[i]: \
395 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE);
396
397 if (sense & IRQ_SENSE_MASK)
398 irq_desc[i+offset].status = IRQ_LEVEL;
399
400 /* Enabled, Default priority */
401 openpic_initirq(i, OPENPIC_PRIORITY_DEFAULT, i+offset,
402 (sense & IRQ_POLARITY_MASK),
403 (sense & IRQ_SENSE_MASK));
404 /* Processor 0 */
405 openpic_mapirq(i, CPU_MASK_CPU0, CPU_MASK_NONE);
406 }
407
408 /* Init descriptors */
409 for (i = offset; i < NumSources + offset; i++)
410 irq_desc[i].chip = &open_pic;
411
412 /* Initialize the spurious interrupt */
413 if (ppc_md.progress) ppc_md.progress("openpic: spurious",0x3bd);
414 openpic_set_spurious(OPENPIC_VEC_SPURIOUS);
415 openpic_disable_8259_pass_through();
416#ifdef CONFIG_EPIC_SERIAL_MODE
417 if (epic_serial_mode) {
418 openpic_eicr_set_clk(7); /* Slowest value until we know better */
419 openpic_enable_sie();
420 }
421#endif
422 openpic_set_priority(0);
423
424 if (ppc_md.progress) ppc_md.progress("openpic: exit",0x222);
425}
426
427#ifdef notused
428static void openpic_enable_8259_pass_through(void)
429{
430 openpic_clearfield(&OpenPIC->Global.Global_Configuration0,
431 OPENPIC_CONFIG_8259_PASSTHROUGH_DISABLE);
432}
433#endif /* notused */
434
435static void openpic_disable_8259_pass_through(void)
436{
437 openpic_setfield(&OpenPIC->Global.Global_Configuration0,
438 OPENPIC_CONFIG_8259_PASSTHROUGH_DISABLE);
439}
440
441/*
442 * Find out the current interrupt
443 */
444u_int openpic_irq(void)
445{
446 u_int vec;
447 DECL_THIS_CPU;
448
449 CHECK_THIS_CPU;
450 vec = openpic_readfield(&OpenPIC->THIS_CPU.Interrupt_Acknowledge,
451 OPENPIC_VECTOR_MASK);
452 return vec;
453}
454
455void openpic_eoi(void)
456{
457 DECL_THIS_CPU;
458
459 CHECK_THIS_CPU;
460 openpic_write(&OpenPIC->THIS_CPU.EOI, 0);
461 /* Handle PCI write posting */
462 (void)openpic_read(&OpenPIC->THIS_CPU.EOI);
463}
464
465u_int openpic_get_priority(void)
466{
467 DECL_THIS_CPU;
468
469 CHECK_THIS_CPU;
470 return openpic_readfield(&OpenPIC->THIS_CPU.Current_Task_Priority,
471 OPENPIC_CURRENT_TASK_PRIORITY_MASK);
472}
473
474void openpic_set_priority(u_int pri)
475{
476 DECL_THIS_CPU;
477
478 CHECK_THIS_CPU;
479 check_arg_pri(pri);
480 openpic_writefield(&OpenPIC->THIS_CPU.Current_Task_Priority,
481 OPENPIC_CURRENT_TASK_PRIORITY_MASK, pri);
482}
483
484/*
485 * Get/set the spurious vector
486 */
487#ifdef notused
488static u_int openpic_get_spurious(void)
489{
490 return openpic_readfield(&OpenPIC->Global.Spurious_Vector,
491 OPENPIC_VECTOR_MASK);
492}
493#endif /* notused */
494
495static void openpic_set_spurious(u_int vec)
496{
497 check_arg_vec(vec);
498 openpic_writefield(&OpenPIC->Global.Spurious_Vector, OPENPIC_VECTOR_MASK,
499 vec);
500}
501
502#ifdef CONFIG_SMP
503/*
504 * Convert a cpu mask from logical to physical cpu numbers.
505 */
506static inline cpumask_t physmask(cpumask_t cpumask)
507{
508 int i;
509 cpumask_t mask = CPU_MASK_NONE;
510
511 cpus_and(cpumask, cpu_online_map, cpumask);
512
513 for (i = 0; i < NR_CPUS; i++)
514 if (cpu_isset(i, cpumask))
515 cpu_set(smp_hw_index[i], mask);
516
517 return mask;
518}
519#else
520#define physmask(cpumask) (cpumask)
521#endif
522
523void openpic_reset_processor_phys(u_int mask)
524{
525 openpic_write(&OpenPIC->Global.Processor_Initialization, mask);
526}
527
528#if defined(CONFIG_SMP) || defined(CONFIG_PM)
529static DEFINE_SPINLOCK(openpic_setup_lock);
530#endif
531
532#ifdef CONFIG_SMP
533/*
534 * Initialize an interprocessor interrupt (and disable it)
535 *
536 * ipi: OpenPIC interprocessor interrupt number
537 * pri: interrupt source priority
538 * vec: the vector it will produce
539 */
540static void __init openpic_initipi(u_int ipi, u_int pri, u_int vec)
541{
542 check_arg_ipi(ipi);
543 check_arg_pri(pri);
544 check_arg_vec(vec);
545 openpic_safe_writefield_IPI(&OpenPIC->Global.IPI_Vector_Priority(ipi),
546 OPENPIC_PRIORITY_MASK | OPENPIC_VECTOR_MASK,
547 (pri << OPENPIC_PRIORITY_SHIFT) | vec);
548}
549
550/*
551 * Send an IPI to one or more CPUs
552 *
553 * Externally called, however, it takes an IPI number (0...OPENPIC_NUM_IPI)
554 * and not a system-wide interrupt number
555 */
556void openpic_cause_IPI(u_int ipi, cpumask_t cpumask)
557{
558 DECL_THIS_CPU;
559
560 CHECK_THIS_CPU;
561 check_arg_ipi(ipi);
562 openpic_write(&OpenPIC->THIS_CPU.IPI_Dispatch(ipi),
563 cpus_addr(physmask(cpumask))[0]);
564}
565
566void openpic_request_IPIs(void)
567{
568 int i;
569
570 /*
571 * Make sure this matches what is defined in smp.c for
572 * smp_message_{pass|recv}() or what shows up in
573 * /proc/interrupts will be wrong!!! --Troy */
574
575 if (OpenPIC == NULL)
576 return;
577
578 /*
579 * IPIs are marked IRQF_DISABLED as they must run with irqs
580 * disabled
581 */
582 request_irq(OPENPIC_VEC_IPI+open_pic_irq_offset,
583 openpic_ipi_action, IRQF_DISABLED,
584 "IPI0 (call function)", NULL);
585 request_irq(OPENPIC_VEC_IPI+open_pic_irq_offset+1,
586 openpic_ipi_action, IRQF_DISABLED,
587 "IPI1 (reschedule)", NULL);
588 request_irq(OPENPIC_VEC_IPI+open_pic_irq_offset+2,
589 openpic_ipi_action, IRQF_DISABLED,
590 "IPI2 (invalidate tlb)", NULL);
591 request_irq(OPENPIC_VEC_IPI+open_pic_irq_offset+3,
592 openpic_ipi_action, IRQF_DISABLED,
593 "IPI3 (xmon break)", NULL);
594
595 for ( i = 0; i < OPENPIC_NUM_IPI ; i++ )
596 openpic_enable_ipi(OPENPIC_VEC_IPI+open_pic_irq_offset+i);
597}
598
599/*
600 * Do per-cpu setup for SMP systems.
601 *
602 * Get IPI's working and start taking interrupts.
603 * -- Cort
604 */
605
606void __devinit do_openpic_setup_cpu(void)
607{
608#ifdef CONFIG_IRQ_ALL_CPUS
609 int i;
610 cpumask_t msk = CPU_MASK_NONE;
611#endif
612 spin_lock(&openpic_setup_lock);
613
614#ifdef CONFIG_IRQ_ALL_CPUS
615 cpu_set(smp_hw_index[smp_processor_id()], msk);
616
617 /* let the openpic know we want intrs. default affinity
618 * is 0xffffffff until changed via /proc
619 * That's how it's done on x86. If we want it differently, then
620 * we should make sure we also change the default values of
621 * irq_desc[].affinity in irq.c.
622 */
623 for (i = 0; i < NumSources; i++)
624 openpic_mapirq(i, msk, CPU_MASK_ALL);
625#endif /* CONFIG_IRQ_ALL_CPUS */
626 openpic_set_priority(0);
627
628 spin_unlock(&openpic_setup_lock);
629}
630#endif /* CONFIG_SMP */
631
632/*
633 * Initialize a timer interrupt (and disable it)
634 *
635 * timer: OpenPIC timer number
636 * pri: interrupt source priority
637 * vec: the vector it will produce
638 */
639static void __init openpic_inittimer(u_int timer, u_int pri, u_int vec)
640{
641 check_arg_timer(timer);
642 check_arg_pri(pri);
643 check_arg_vec(vec);
644 openpic_safe_writefield(&OpenPIC->Global.Timer[timer].Vector_Priority,
645 OPENPIC_PRIORITY_MASK | OPENPIC_VECTOR_MASK,
646 (pri << OPENPIC_PRIORITY_SHIFT) | vec);
647}
648
649/*
650 * Map a timer interrupt to one or more CPUs
651 */
652static void __init openpic_maptimer(u_int timer, cpumask_t cpumask)
653{
654 cpumask_t phys = physmask(cpumask);
655 check_arg_timer(timer);
656 openpic_write(&OpenPIC->Global.Timer[timer].Destination,
657 cpus_addr(phys)[0]);
658}
659
660/*
661 * Change the priority of an interrupt
662 */
663void __init
664openpic_set_irq_priority(u_int irq, u_int pri)
665{
666 check_arg_irq(irq);
667 openpic_safe_writefield(&ISR[irq - open_pic_irq_offset]->Vector_Priority,
668 OPENPIC_PRIORITY_MASK,
669 pri << OPENPIC_PRIORITY_SHIFT);
670}
671
672/*
673 * Initalize the interrupt source which will generate an NMI.
674 * This raises the interrupt's priority from 8 to 9.
675 *
676 * irq: The logical IRQ which generates an NMI.
677 */
678void __init
679openpic_init_nmi_irq(u_int irq)
680{
681 check_arg_irq(irq);
682 openpic_set_irq_priority(irq, OPENPIC_PRIORITY_NMI);
683}
684
685/*
686 *
687 * All functions below take an offset'ed irq argument
688 *
689 */
690
691/*
692 * Hookup a cascade to the OpenPIC.
693 */
694
695static struct irqaction openpic_cascade_irqaction = {
696 .handler = no_action,
697 .flags = IRQF_DISABLED,
698 .mask = CPU_MASK_NONE,
699};
700
701void __init
702openpic_hookup_cascade(u_int irq, char *name,
703 int (*cascade_fn)(void))
704{
705 openpic_cascade_irq = irq;
706 openpic_cascade_fn = cascade_fn;
707
708 if (setup_irq(irq, &openpic_cascade_irqaction))
709 printk("Unable to get OpenPIC IRQ %d for cascade\n",
710 irq - open_pic_irq_offset);
711}
712
713/*
714 * Enable/disable an external interrupt source
715 *
716 * Externally called, irq is an offseted system-wide interrupt number
717 */
718static void openpic_enable_irq(u_int irq)
719{
720 volatile u_int __iomem *vpp;
721
722 check_arg_irq(irq);
723 vpp = &ISR[irq - open_pic_irq_offset]->Vector_Priority;
724 openpic_clearfield(vpp, OPENPIC_MASK);
725 /* make sure mask gets to controller before we return to user */
726 do {
727 mb(); /* sync is probably useless here */
728 } while (openpic_readfield(vpp, OPENPIC_MASK));
729}
730
731static void openpic_disable_irq(u_int irq)
732{
733 volatile u_int __iomem *vpp;
734 u32 vp;
735
736 check_arg_irq(irq);
737 vpp = &ISR[irq - open_pic_irq_offset]->Vector_Priority;
738 openpic_setfield(vpp, OPENPIC_MASK);
739 /* make sure mask gets to controller before we return to user */
740 do {
741 mb(); /* sync is probably useless here */
742 vp = openpic_readfield(vpp, OPENPIC_MASK | OPENPIC_ACTIVITY);
743 } while((vp & OPENPIC_ACTIVITY) && !(vp & OPENPIC_MASK));
744}
745
746#ifdef CONFIG_SMP
747/*
748 * Enable/disable an IPI interrupt source
749 *
750 * Externally called, irq is an offseted system-wide interrupt number
751 */
752void openpic_enable_ipi(u_int irq)
753{
754 irq -= (OPENPIC_VEC_IPI+open_pic_irq_offset);
755 check_arg_ipi(irq);
756 openpic_clearfield_IPI(&OpenPIC->Global.IPI_Vector_Priority(irq), OPENPIC_MASK);
757
758}
759
760void openpic_disable_ipi(u_int irq)
761{
762 irq -= (OPENPIC_VEC_IPI+open_pic_irq_offset);
763 check_arg_ipi(irq);
764 openpic_setfield_IPI(&OpenPIC->Global.IPI_Vector_Priority(irq), OPENPIC_MASK);
765}
766#endif
767
768/*
769 * Initialize an interrupt source (and disable it!)
770 *
771 * irq: OpenPIC interrupt number
772 * pri: interrupt source priority
773 * vec: the vector it will produce
774 * pol: polarity (1 for positive, 0 for negative)
775 * sense: 1 for level, 0 for edge
776 */
777static void __init
778openpic_initirq(u_int irq, u_int pri, u_int vec, int pol, int sense)
779{
780 openpic_safe_writefield(&ISR[irq]->Vector_Priority,
781 OPENPIC_PRIORITY_MASK | OPENPIC_VECTOR_MASK |
782 OPENPIC_SENSE_MASK | OPENPIC_POLARITY_MASK,
783 (pri << OPENPIC_PRIORITY_SHIFT) | vec |
784 (pol ? OPENPIC_POLARITY_POSITIVE :
785 OPENPIC_POLARITY_NEGATIVE) |
786 (sense ? OPENPIC_SENSE_LEVEL : OPENPIC_SENSE_EDGE));
787}
788
789/*
790 * Map an interrupt source to one or more CPUs
791 */
792static void openpic_mapirq(u_int irq, cpumask_t physmask, cpumask_t keepmask)
793{
794 if (ISR[irq] == 0)
795 return;
796 if (!cpus_empty(keepmask)) {
797 cpumask_t irqdest = { .bits[0] = openpic_read(&ISR[irq]->Destination) };
798 cpus_and(irqdest, irqdest, keepmask);
799 cpus_or(physmask, physmask, irqdest);
800 }
801 openpic_write(&ISR[irq]->Destination, cpus_addr(physmask)[0]);
802}
803
804#ifdef notused
805/*
806 * Set the sense for an interrupt source (and disable it!)
807 *
808 * sense: 1 for level, 0 for edge
809 */
810static void openpic_set_sense(u_int irq, int sense)
811{
812 if (ISR[irq] != 0)
813 openpic_safe_writefield(&ISR[irq]->Vector_Priority,
814 OPENPIC_SENSE_LEVEL,
815 (sense ? OPENPIC_SENSE_LEVEL : 0));
816}
817#endif /* notused */
818
819/* No spinlocks, should not be necessary with the OpenPIC
820 * (1 register = 1 interrupt and we have the desc lock).
821 */
822static void openpic_ack_irq(unsigned int irq_nr)
823{
824#ifdef __SLOW_VERSION__
825 openpic_disable_irq(irq_nr);
826 openpic_eoi();
827#else
828 if ((irq_desc[irq_nr].status & IRQ_LEVEL) == 0)
829 openpic_eoi();
830#endif
831}
832
833static void openpic_end_irq(unsigned int irq_nr)
834{
835#ifdef __SLOW_VERSION__
836 if (!(irq_desc[irq_nr].status & (IRQ_DISABLED|IRQ_INPROGRESS))
837 && irq_desc[irq_nr].action)
838 openpic_enable_irq(irq_nr);
839#else
840 if ((irq_desc[irq_nr].status & IRQ_LEVEL) != 0)
841 openpic_eoi();
842#endif
843}
844
845static void openpic_set_affinity(unsigned int irq_nr, cpumask_t cpumask)
846{
847 openpic_mapirq(irq_nr - open_pic_irq_offset, physmask(cpumask), CPU_MASK_NONE);
848}
849
850#ifdef CONFIG_SMP
851static void openpic_ack_ipi(unsigned int irq_nr)
852{
853 openpic_eoi();
854}
855
856static void openpic_end_ipi(unsigned int irq_nr)
857{
858}
859
860static irqreturn_t openpic_ipi_action(int cpl, void *dev_id)
861{
862 smp_message_recv(cpl-OPENPIC_VEC_IPI-open_pic_irq_offset);
863 return IRQ_HANDLED;
864}
865
866#endif /* CONFIG_SMP */
867
868int
869openpic_get_irq(void)
870{
871 int irq = openpic_irq();
872
873 /*
874 * Check for the cascade interrupt and call the cascaded
875 * interrupt controller function (usually i8259_irq) if so.
876 * This should move to irq.c eventually. -- paulus
877 */
878 if (irq == openpic_cascade_irq && openpic_cascade_fn != NULL) {
879 int cirq = openpic_cascade_fn();
880
881 /* Allow for the cascade being shared with other devices */
882 if (cirq != -1) {
883 irq = cirq;
884 openpic_eoi();
885 }
886 } else if (irq == OPENPIC_VEC_SPURIOUS)
887 irq = -1;
888 return irq;
889}
890
891#ifdef CONFIG_SMP
892void
893smp_openpic_message_pass(int target, int msg)
894{
895 cpumask_t mask = CPU_MASK_ALL;
896 /* make sure we're sending something that translates to an IPI */
897 if (msg > 0x3) {
898 printk("SMP %d: smp_message_pass: unknown msg %d\n",
899 smp_processor_id(), msg);
900 return;
901 }
902 switch (target) {
903 case MSG_ALL:
904 openpic_cause_IPI(msg, mask);
905 break;
906 case MSG_ALL_BUT_SELF:
907 cpu_clear(smp_processor_id(), mask);
908 openpic_cause_IPI(msg, mask);
909 break;
910 default:
911 openpic_cause_IPI(msg, cpumask_of_cpu(target));
912 break;
913 }
914}
915#endif /* CONFIG_SMP */
916
917#ifdef CONFIG_PM
918
919/*
920 * We implement the IRQ controller as a sysdev and put it
921 * to sleep at powerdown stage (the callback is named suspend,
922 * but it's old semantics, for the Device Model, it's really
923 * powerdown). The possible problem is that another sysdev that
924 * happens to be suspend after this one will have interrupts off,
925 * that may be an issue... For now, this isn't an issue on pmac
926 * though...
927 */
928
929static u32 save_ipi_vp[OPENPIC_NUM_IPI];
930static u32 save_irq_src_vp[OPENPIC_MAX_SOURCES];
931static u32 save_irq_src_dest[OPENPIC_MAX_SOURCES];
932static u32 save_cpu_task_pri[OPENPIC_MAX_PROCESSORS];
933static int openpic_suspend_count;
934
935static void openpic_cached_enable_irq(u_int irq)
936{
937 check_arg_irq(irq);
938 save_irq_src_vp[irq - open_pic_irq_offset] &= ~OPENPIC_MASK;
939}
940
941static void openpic_cached_disable_irq(u_int irq)
942{
943 check_arg_irq(irq);
944 save_irq_src_vp[irq - open_pic_irq_offset] |= OPENPIC_MASK;
945}
946
947/* WARNING: Can be called directly by the cpufreq code with NULL parameter,
948 * we need something better to deal with that... Maybe switch to S1 for
949 * cpufreq changes
950 */
951int openpic_suspend(struct sys_device *sysdev, pm_message_t state)
952{
953 int i;
954 unsigned long flags;
955
956 spin_lock_irqsave(&openpic_setup_lock, flags);
957
958 if (openpic_suspend_count++ > 0) {
959 spin_unlock_irqrestore(&openpic_setup_lock, flags);
960 return 0;
961 }
962
963 openpic_set_priority(0xf);
964
965 open_pic.enable = openpic_cached_enable_irq;
966 open_pic.disable = openpic_cached_disable_irq;
967
968 for (i=0; i<NumProcessors; i++) {
969 save_cpu_task_pri[i] = openpic_read(&OpenPIC->Processor[i].Current_Task_Priority);
970 openpic_writefield(&OpenPIC->Processor[i].Current_Task_Priority,
971 OPENPIC_CURRENT_TASK_PRIORITY_MASK, 0xf);
972 }
973
974 for (i=0; i<OPENPIC_NUM_IPI; i++)
975 save_ipi_vp[i] = openpic_read(&OpenPIC->Global.IPI_Vector_Priority(i));
976 for (i=0; i<NumSources; i++) {
977 if (ISR[i] == 0)
978 continue;
979 save_irq_src_vp[i] = openpic_read(&ISR[i]->Vector_Priority) & ~OPENPIC_ACTIVITY;
980 save_irq_src_dest[i] = openpic_read(&ISR[i]->Destination);
981 }
982
983 spin_unlock_irqrestore(&openpic_setup_lock, flags);
984
985 return 0;
986}
987
988/* WARNING: Can be called directly by the cpufreq code with NULL parameter,
989 * we need something better to deal with that... Maybe switch to S1 for
990 * cpufreq changes
991 */
992int openpic_resume(struct sys_device *sysdev)
993{
994 int i;
995 unsigned long flags;
996 u32 vppmask = OPENPIC_PRIORITY_MASK | OPENPIC_VECTOR_MASK |
997 OPENPIC_SENSE_MASK | OPENPIC_POLARITY_MASK |
998 OPENPIC_MASK;
999
1000 spin_lock_irqsave(&openpic_setup_lock, flags);
1001
1002 if ((--openpic_suspend_count) > 0) {
1003 spin_unlock_irqrestore(&openpic_setup_lock, flags);
1004 return 0;
1005 }
1006
1007 /* OpenPIC sometimes seem to need some time to be fully back up... */
1008 do {
1009 openpic_set_spurious(OPENPIC_VEC_SPURIOUS);
1010 } while(openpic_readfield(&OpenPIC->Global.Spurious_Vector, OPENPIC_VECTOR_MASK)
1011 != OPENPIC_VEC_SPURIOUS);
1012
1013 openpic_disable_8259_pass_through();
1014
1015 for (i=0; i<OPENPIC_NUM_IPI; i++)
1016 openpic_write(&OpenPIC->Global.IPI_Vector_Priority(i),
1017 save_ipi_vp[i]);
1018 for (i=0; i<NumSources; i++) {
1019 if (ISR[i] == 0)
1020 continue;
1021 openpic_write(&ISR[i]->Destination, save_irq_src_dest[i]);
1022 openpic_write(&ISR[i]->Vector_Priority, save_irq_src_vp[i]);
1023 /* make sure mask gets to controller before we return to user */
1024 do {
1025 openpic_write(&ISR[i]->Vector_Priority, save_irq_src_vp[i]);
1026 } while (openpic_readfield(&ISR[i]->Vector_Priority, vppmask)
1027 != (save_irq_src_vp[i] & vppmask));
1028 }
1029 for (i=0; i<NumProcessors; i++)
1030 openpic_write(&OpenPIC->Processor[i].Current_Task_Priority,
1031 save_cpu_task_pri[i]);
1032
1033 open_pic.enable = openpic_enable_irq;
1034 open_pic.disable = openpic_disable_irq;
1035
1036 openpic_set_priority(0);
1037
1038 spin_unlock_irqrestore(&openpic_setup_lock, flags);
1039
1040 return 0;
1041}
1042
1043#endif /* CONFIG_PM */
1044
1045static struct sysdev_class openpic_sysclass = {
1046 .name = "openpic",
1047};
1048
1049static struct sys_device device_openpic = {
1050 .id = 0,
1051 .cls = &openpic_sysclass,
1052};
1053
1054static struct sysdev_driver driver_openpic = {
1055#ifdef CONFIG_PM
1056 .suspend = &openpic_suspend,
1057 .resume = &openpic_resume,
1058#endif /* CONFIG_PM */
1059};
1060
1061static int __init init_openpic_sysfs(void)
1062{
1063 int rc;
1064
1065 if (!OpenPIC_Addr)
1066 return -ENODEV;
1067 printk(KERN_DEBUG "Registering openpic with sysfs...\n");
1068 rc = sysdev_class_register(&openpic_sysclass);
1069 if (rc) {
1070 printk(KERN_ERR "Failed registering openpic sys class\n");
1071 return -ENODEV;
1072 }
1073 rc = sysdev_register(&device_openpic);
1074 if (rc) {
1075 printk(KERN_ERR "Failed registering openpic sys device\n");
1076 return -ENODEV;
1077 }
1078 rc = sysdev_driver_register(&openpic_sysclass, &driver_openpic);
1079 if (rc) {
1080 printk(KERN_ERR "Failed registering openpic sys driver\n");
1081 return -ENODEV;
1082 }
1083 return 0;
1084}
1085
1086subsys_initcall(init_openpic_sysfs);
1087
diff --git a/arch/ppc/syslib/open_pic2.c b/arch/ppc/syslib/open_pic2.c
deleted file mode 100644
index 449075a04798..000000000000
--- a/arch/ppc/syslib/open_pic2.c
+++ /dev/null
@@ -1,710 +0,0 @@
1/*
2 * Copyright (C) 1997 Geert Uytterhoeven
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file COPYING in the main directory of this archive
6 * for more details.
7 *
8 * This is a duplicate of open_pic.c that deals with U3s MPIC on
9 * G5 PowerMacs. It's the same file except it's using big endian
10 * register accesses
11 */
12
13#include <linux/types.h>
14#include <linux/kernel.h>
15#include <linux/sched.h>
16#include <linux/init.h>
17#include <linux/interrupt.h>
18#include <linux/sysdev.h>
19#include <linux/errno.h>
20#include <asm/ptrace.h>
21#include <asm/signal.h>
22#include <asm/io.h>
23#include <asm/irq.h>
24#include <asm/sections.h>
25#include <asm/open_pic.h>
26#include <asm/i8259.h>
27#include <asm/machdep.h>
28
29#include "open_pic_defs.h"
30
31void *OpenPIC2_Addr;
32static volatile struct OpenPIC *OpenPIC2 = NULL;
33/*
34 * We define OpenPIC_InitSenses table thusly:
35 * bit 0x1: sense, 0 for edge and 1 for level.
36 * bit 0x2: polarity, 0 for negative, 1 for positive.
37 */
38extern u_int OpenPIC_NumInitSenses;
39extern u_char *OpenPIC_InitSenses;
40extern int use_of_interrupt_tree;
41
42static u_int NumProcessors;
43static u_int NumSources;
44static int open_pic2_irq_offset;
45static volatile OpenPIC_Source *ISR[NR_IRQS];
46
47/* Global Operations */
48static void openpic2_disable_8259_pass_through(void);
49static void openpic2_set_priority(u_int pri);
50static void openpic2_set_spurious(u_int vector);
51
52/* Timer Interrupts */
53static void openpic2_inittimer(u_int timer, u_int pri, u_int vector);
54static void openpic2_maptimer(u_int timer, u_int cpumask);
55
56/* Interrupt Sources */
57static void openpic2_enable_irq(u_int irq);
58static void openpic2_disable_irq(u_int irq);
59static void openpic2_initirq(u_int irq, u_int pri, u_int vector, int polarity,
60 int is_level);
61static void openpic2_mapirq(u_int irq, u_int cpumask, u_int keepmask);
62
63/*
64 * These functions are not used but the code is kept here
65 * for completeness and future reference.
66 */
67static void openpic2_reset(void);
68#ifdef notused
69static void openpic2_enable_8259_pass_through(void);
70static u_int openpic2_get_priority(void);
71static u_int openpic2_get_spurious(void);
72static void openpic2_set_sense(u_int irq, int sense);
73#endif /* notused */
74
75/*
76 * Description of the openpic for the higher-level irq code
77 */
78static void openpic2_end_irq(unsigned int irq_nr);
79static void openpic2_ack_irq(unsigned int irq_nr);
80
81struct hw_interrupt_type open_pic2 = {
82 .typename = " OpenPIC2 ",
83 .enable = openpic2_enable_irq,
84 .disable = openpic2_disable_irq,
85 .ack = openpic2_ack_irq,
86 .end = openpic2_end_irq,
87};
88
89/*
90 * Accesses to the current processor's openpic registers
91 * On cascaded controller, this is only CPU 0
92 */
93#define THIS_CPU Processor[0]
94#define DECL_THIS_CPU
95#define CHECK_THIS_CPU
96
97#if 1
98#define check_arg_ipi(ipi) \
99 if (ipi < 0 || ipi >= OPENPIC_NUM_IPI) \
100 printk("open_pic.c:%d: illegal ipi %d\n", __LINE__, ipi);
101#define check_arg_timer(timer) \
102 if (timer < 0 || timer >= OPENPIC_NUM_TIMERS) \
103 printk("open_pic.c:%d: illegal timer %d\n", __LINE__, timer);
104#define check_arg_vec(vec) \
105 if (vec < 0 || vec >= OPENPIC_NUM_VECTORS) \
106 printk("open_pic.c:%d: illegal vector %d\n", __LINE__, vec);
107#define check_arg_pri(pri) \
108 if (pri < 0 || pri >= OPENPIC_NUM_PRI) \
109 printk("open_pic.c:%d: illegal priority %d\n", __LINE__, pri);
110/*
111 * Print out a backtrace if it's out of range, since if it's larger than NR_IRQ's
112 * data has probably been corrupted and we're going to panic or deadlock later
113 * anyway --Troy
114 */
115extern unsigned long* _get_SP(void);
116#define check_arg_irq(irq) \
117 if (irq < open_pic2_irq_offset || irq >= NumSources+open_pic2_irq_offset \
118 || ISR[irq - open_pic2_irq_offset] == 0) { \
119 printk("open_pic.c:%d: illegal irq %d\n", __LINE__, irq); \
120 /*print_backtrace(_get_SP());*/ }
121#define check_arg_cpu(cpu) \
122 if (cpu < 0 || cpu >= NumProcessors){ \
123 printk("open_pic2.c:%d: illegal cpu %d\n", __LINE__, cpu); \
124 /*print_backtrace(_get_SP());*/ }
125#else
126#define check_arg_ipi(ipi) do {} while (0)
127#define check_arg_timer(timer) do {} while (0)
128#define check_arg_vec(vec) do {} while (0)
129#define check_arg_pri(pri) do {} while (0)
130#define check_arg_irq(irq) do {} while (0)
131#define check_arg_cpu(cpu) do {} while (0)
132#endif
133
134static u_int openpic2_read(volatile u_int *addr)
135{
136 u_int val;
137
138 val = in_be32(addr);
139 return val;
140}
141
142static inline void openpic2_write(volatile u_int *addr, u_int val)
143{
144 out_be32(addr, val);
145}
146
147static inline u_int openpic2_readfield(volatile u_int *addr, u_int mask)
148{
149 u_int val = openpic2_read(addr);
150 return val & mask;
151}
152
153inline void openpic2_writefield(volatile u_int *addr, u_int mask,
154 u_int field)
155{
156 u_int val = openpic2_read(addr);
157 openpic2_write(addr, (val & ~mask) | (field & mask));
158}
159
160static inline void openpic2_clearfield(volatile u_int *addr, u_int mask)
161{
162 openpic2_writefield(addr, mask, 0);
163}
164
165static inline void openpic2_setfield(volatile u_int *addr, u_int mask)
166{
167 openpic2_writefield(addr, mask, mask);
168}
169
170static void openpic2_safe_writefield(volatile u_int *addr, u_int mask,
171 u_int field)
172{
173 openpic2_setfield(addr, OPENPIC_MASK);
174 while (openpic2_read(addr) & OPENPIC_ACTIVITY);
175 openpic2_writefield(addr, mask | OPENPIC_MASK, field | OPENPIC_MASK);
176}
177
178static void openpic2_reset(void)
179{
180 openpic2_setfield(&OpenPIC2->Global.Global_Configuration0,
181 OPENPIC_CONFIG_RESET);
182 while (openpic2_readfield(&OpenPIC2->Global.Global_Configuration0,
183 OPENPIC_CONFIG_RESET))
184 mb();
185}
186
187void __init openpic2_set_sources(int first_irq, int num_irqs, void *first_ISR)
188{
189 volatile OpenPIC_Source *src = first_ISR;
190 int i, last_irq;
191
192 last_irq = first_irq + num_irqs;
193 if (last_irq > NumSources)
194 NumSources = last_irq;
195 if (src == 0)
196 src = &((struct OpenPIC *)OpenPIC2_Addr)->Source[first_irq];
197 for (i = first_irq; i < last_irq; ++i, ++src)
198 ISR[i] = src;
199}
200
201/*
202 * The `offset' parameter defines where the interrupts handled by the
203 * OpenPIC start in the space of interrupt numbers that the kernel knows
204 * about. In other words, the OpenPIC's IRQ0 is numbered `offset' in the
205 * kernel's interrupt numbering scheme.
206 * We assume there is only one OpenPIC.
207 */
208void __init openpic2_init(int offset)
209{
210 u_int t, i;
211 u_int timerfreq;
212 const char *version;
213
214 if (!OpenPIC2_Addr) {
215 printk("No OpenPIC2 found !\n");
216 return;
217 }
218 OpenPIC2 = (volatile struct OpenPIC *)OpenPIC2_Addr;
219
220 if (ppc_md.progress) ppc_md.progress("openpic: enter", 0x122);
221
222 t = openpic2_read(&OpenPIC2->Global.Feature_Reporting0);
223 switch (t & OPENPIC_FEATURE_VERSION_MASK) {
224 case 1:
225 version = "1.0";
226 break;
227 case 2:
228 version = "1.2";
229 break;
230 case 3:
231 version = "1.3";
232 break;
233 default:
234 version = "?";
235 break;
236 }
237 NumProcessors = ((t & OPENPIC_FEATURE_LAST_PROCESSOR_MASK) >>
238 OPENPIC_FEATURE_LAST_PROCESSOR_SHIFT) + 1;
239 if (NumSources == 0)
240 openpic2_set_sources(0,
241 ((t & OPENPIC_FEATURE_LAST_SOURCE_MASK) >>
242 OPENPIC_FEATURE_LAST_SOURCE_SHIFT) + 1,
243 NULL);
244 printk("OpenPIC (2) Version %s (%d CPUs and %d IRQ sources) at %p\n",
245 version, NumProcessors, NumSources, OpenPIC2);
246 timerfreq = openpic2_read(&OpenPIC2->Global.Timer_Frequency);
247 if (timerfreq)
248 printk("OpenPIC timer frequency is %d.%06d MHz\n",
249 timerfreq / 1000000, timerfreq % 1000000);
250
251 open_pic2_irq_offset = offset;
252
253 /* Initialize timer interrupts */
254 if ( ppc_md.progress ) ppc_md.progress("openpic2: timer",0x3ba);
255 for (i = 0; i < OPENPIC_NUM_TIMERS; i++) {
256 /* Disabled, Priority 0 */
257 openpic2_inittimer(i, 0, OPENPIC2_VEC_TIMER+i+offset);
258 /* No processor */
259 openpic2_maptimer(i, 0);
260 }
261
262 /* Initialize external interrupts */
263 if (ppc_md.progress) ppc_md.progress("openpic2: external",0x3bc);
264
265 openpic2_set_priority(0xf);
266
267 /* Init all external sources, including possibly the cascade. */
268 for (i = 0; i < NumSources; i++) {
269 int sense;
270
271 if (ISR[i] == 0)
272 continue;
273
274 /* the bootloader may have left it enabled (bad !) */
275 openpic2_disable_irq(i+offset);
276
277 sense = (i < OpenPIC_NumInitSenses)? OpenPIC_InitSenses[i]: \
278 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE);
279
280 if (sense & IRQ_SENSE_MASK)
281 irq_desc[i+offset].status = IRQ_LEVEL;
282
283 /* Enabled, Priority 8 */
284 openpic2_initirq(i, 8, i+offset, (sense & IRQ_POLARITY_MASK),
285 (sense & IRQ_SENSE_MASK));
286 /* Processor 0 */
287 openpic2_mapirq(i, 1<<0, 0);
288 }
289
290 /* Init descriptors */
291 for (i = offset; i < NumSources + offset; i++)
292 irq_desc[i].chip = &open_pic2;
293
294 /* Initialize the spurious interrupt */
295 if (ppc_md.progress) ppc_md.progress("openpic2: spurious",0x3bd);
296 openpic2_set_spurious(OPENPIC2_VEC_SPURIOUS+offset);
297
298 openpic2_disable_8259_pass_through();
299 openpic2_set_priority(0);
300
301 if (ppc_md.progress) ppc_md.progress("openpic2: exit",0x222);
302}
303
304#ifdef notused
305static void openpic2_enable_8259_pass_through(void)
306{
307 openpic2_clearfield(&OpenPIC2->Global.Global_Configuration0,
308 OPENPIC_CONFIG_8259_PASSTHROUGH_DISABLE);
309}
310#endif /* notused */
311
312/* This can't be __init, it is used in openpic_sleep_restore_intrs */
313static void openpic2_disable_8259_pass_through(void)
314{
315 openpic2_setfield(&OpenPIC2->Global.Global_Configuration0,
316 OPENPIC_CONFIG_8259_PASSTHROUGH_DISABLE);
317}
318
319/*
320 * Find out the current interrupt
321 */
322u_int openpic2_irq(void)
323{
324 u_int vec;
325 DECL_THIS_CPU;
326
327 CHECK_THIS_CPU;
328 vec = openpic2_readfield(&OpenPIC2->THIS_CPU.Interrupt_Acknowledge,
329 OPENPIC_VECTOR_MASK);
330 return vec;
331}
332
333void openpic2_eoi(void)
334{
335 DECL_THIS_CPU;
336
337 CHECK_THIS_CPU;
338 openpic2_write(&OpenPIC2->THIS_CPU.EOI, 0);
339 /* Handle PCI write posting */
340 (void)openpic2_read(&OpenPIC2->THIS_CPU.EOI);
341}
342
343#ifdef notused
344static u_int openpic2_get_priority(void)
345{
346 DECL_THIS_CPU;
347
348 CHECK_THIS_CPU;
349 return openpic2_readfield(&OpenPIC2->THIS_CPU.Current_Task_Priority,
350 OPENPIC_CURRENT_TASK_PRIORITY_MASK);
351}
352#endif /* notused */
353
354static void __init openpic2_set_priority(u_int pri)
355{
356 DECL_THIS_CPU;
357
358 CHECK_THIS_CPU;
359 check_arg_pri(pri);
360 openpic2_writefield(&OpenPIC2->THIS_CPU.Current_Task_Priority,
361 OPENPIC_CURRENT_TASK_PRIORITY_MASK, pri);
362}
363
364/*
365 * Get/set the spurious vector
366 */
367#ifdef notused
368static u_int openpic2_get_spurious(void)
369{
370 return openpic2_readfield(&OpenPIC2->Global.Spurious_Vector,
371 OPENPIC_VECTOR_MASK);
372}
373#endif /* notused */
374
375/* This can't be __init, it is used in openpic_sleep_restore_intrs */
376static void openpic2_set_spurious(u_int vec)
377{
378 check_arg_vec(vec);
379 openpic2_writefield(&OpenPIC2->Global.Spurious_Vector, OPENPIC_VECTOR_MASK,
380 vec);
381}
382
383static DEFINE_SPINLOCK(openpic2_setup_lock);
384
385/*
386 * Initialize a timer interrupt (and disable it)
387 *
388 * timer: OpenPIC timer number
389 * pri: interrupt source priority
390 * vec: the vector it will produce
391 */
392static void __init openpic2_inittimer(u_int timer, u_int pri, u_int vec)
393{
394 check_arg_timer(timer);
395 check_arg_pri(pri);
396 check_arg_vec(vec);
397 openpic2_safe_writefield(&OpenPIC2->Global.Timer[timer].Vector_Priority,
398 OPENPIC_PRIORITY_MASK | OPENPIC_VECTOR_MASK,
399 (pri << OPENPIC_PRIORITY_SHIFT) | vec);
400}
401
402/*
403 * Map a timer interrupt to one or more CPUs
404 */
405static void __init openpic2_maptimer(u_int timer, u_int cpumask)
406{
407 check_arg_timer(timer);
408 openpic2_write(&OpenPIC2->Global.Timer[timer].Destination,
409 cpumask);
410}
411
412/*
413 * Initalize the interrupt source which will generate an NMI.
414 * This raises the interrupt's priority from 8 to 9.
415 *
416 * irq: The logical IRQ which generates an NMI.
417 */
418void __init
419openpic2_init_nmi_irq(u_int irq)
420{
421 check_arg_irq(irq);
422 openpic2_safe_writefield(&ISR[irq - open_pic2_irq_offset]->Vector_Priority,
423 OPENPIC_PRIORITY_MASK,
424 9 << OPENPIC_PRIORITY_SHIFT);
425}
426
427/*
428 *
429 * All functions below take an offset'ed irq argument
430 *
431 */
432
433
434/*
435 * Enable/disable an external interrupt source
436 *
437 * Externally called, irq is an offseted system-wide interrupt number
438 */
439static void openpic2_enable_irq(u_int irq)
440{
441 volatile u_int *vpp;
442
443 check_arg_irq(irq);
444 vpp = &ISR[irq - open_pic2_irq_offset]->Vector_Priority;
445 openpic2_clearfield(vpp, OPENPIC_MASK);
446 /* make sure mask gets to controller before we return to user */
447 do {
448 mb(); /* sync is probably useless here */
449 } while (openpic2_readfield(vpp, OPENPIC_MASK));
450}
451
452static void openpic2_disable_irq(u_int irq)
453{
454 volatile u_int *vpp;
455 u32 vp;
456
457 check_arg_irq(irq);
458 vpp = &ISR[irq - open_pic2_irq_offset]->Vector_Priority;
459 openpic2_setfield(vpp, OPENPIC_MASK);
460 /* make sure mask gets to controller before we return to user */
461 do {
462 mb(); /* sync is probably useless here */
463 vp = openpic2_readfield(vpp, OPENPIC_MASK | OPENPIC_ACTIVITY);
464 } while((vp & OPENPIC_ACTIVITY) && !(vp & OPENPIC_MASK));
465}
466
467
468/*
469 * Initialize an interrupt source (and disable it!)
470 *
471 * irq: OpenPIC interrupt number
472 * pri: interrupt source priority
473 * vec: the vector it will produce
474 * pol: polarity (1 for positive, 0 for negative)
475 * sense: 1 for level, 0 for edge
476 */
477static void __init
478openpic2_initirq(u_int irq, u_int pri, u_int vec, int pol, int sense)
479{
480 openpic2_safe_writefield(&ISR[irq]->Vector_Priority,
481 OPENPIC_PRIORITY_MASK | OPENPIC_VECTOR_MASK |
482 OPENPIC_SENSE_MASK | OPENPIC_POLARITY_MASK,
483 (pri << OPENPIC_PRIORITY_SHIFT) | vec |
484 (pol ? OPENPIC_POLARITY_POSITIVE :
485 OPENPIC_POLARITY_NEGATIVE) |
486 (sense ? OPENPIC_SENSE_LEVEL : OPENPIC_SENSE_EDGE));
487}
488
489/*
490 * Map an interrupt source to one or more CPUs
491 */
492static void openpic2_mapirq(u_int irq, u_int physmask, u_int keepmask)
493{
494 if (ISR[irq] == 0)
495 return;
496 if (keepmask != 0)
497 physmask |= openpic2_read(&ISR[irq]->Destination) & keepmask;
498 openpic2_write(&ISR[irq]->Destination, physmask);
499}
500
501#ifdef notused
502/*
503 * Set the sense for an interrupt source (and disable it!)
504 *
505 * sense: 1 for level, 0 for edge
506 */
507static void openpic2_set_sense(u_int irq, int sense)
508{
509 if (ISR[irq] != 0)
510 openpic2_safe_writefield(&ISR[irq]->Vector_Priority,
511 OPENPIC_SENSE_LEVEL,
512 (sense ? OPENPIC_SENSE_LEVEL : 0));
513}
514#endif /* notused */
515
516/* No spinlocks, should not be necessary with the OpenPIC
517 * (1 register = 1 interrupt and we have the desc lock).
518 */
519static void openpic2_ack_irq(unsigned int irq_nr)
520{
521 openpic2_disable_irq(irq_nr);
522 openpic2_eoi();
523}
524
525static void openpic2_end_irq(unsigned int irq_nr)
526{
527 if (!(irq_desc[irq_nr].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
528 openpic2_enable_irq(irq_nr);
529}
530
531int
532openpic2_get_irq(void)
533{
534 int irq = openpic2_irq();
535
536 if (irq == (OPENPIC2_VEC_SPURIOUS + open_pic2_irq_offset))
537 irq = -1;
538 return irq;
539}
540
541#ifdef CONFIG_PM
542
543/*
544 * We implement the IRQ controller as a sysdev and put it
545 * to sleep at powerdown stage (the callback is named suspend,
546 * but it's old semantics, for the Device Model, it's really
547 * powerdown). The possible problem is that another sysdev that
548 * happens to be suspend after this one will have interrupts off,
549 * that may be an issue... For now, this isn't an issue on pmac
550 * though...
551 */
552
553static u32 save_ipi_vp[OPENPIC_NUM_IPI];
554static u32 save_irq_src_vp[OPENPIC_MAX_SOURCES];
555static u32 save_irq_src_dest[OPENPIC_MAX_SOURCES];
556static u32 save_cpu_task_pri[OPENPIC_MAX_PROCESSORS];
557static int openpic_suspend_count;
558
559static void openpic2_cached_enable_irq(u_int irq)
560{
561 check_arg_irq(irq);
562 save_irq_src_vp[irq - open_pic2_irq_offset] &= ~OPENPIC_MASK;
563}
564
565static void openpic2_cached_disable_irq(u_int irq)
566{
567 check_arg_irq(irq);
568 save_irq_src_vp[irq - open_pic2_irq_offset] |= OPENPIC_MASK;
569}
570
571/* WARNING: Can be called directly by the cpufreq code with NULL parameter,
572 * we need something better to deal with that... Maybe switch to S1 for
573 * cpufreq changes
574 */
575int openpic2_suspend(struct sys_device *sysdev, pm_message_t state)
576{
577 int i;
578 unsigned long flags;
579
580 spin_lock_irqsave(&openpic2_setup_lock, flags);
581
582 if (openpic_suspend_count++ > 0) {
583 spin_unlock_irqrestore(&openpic2_setup_lock, flags);
584 return 0;
585 }
586
587 open_pic2.enable = openpic2_cached_enable_irq;
588 open_pic2.disable = openpic2_cached_disable_irq;
589
590 for (i=0; i<NumProcessors; i++) {
591 save_cpu_task_pri[i] = openpic2_read(&OpenPIC2->Processor[i].Current_Task_Priority);
592 openpic2_writefield(&OpenPIC2->Processor[i].Current_Task_Priority,
593 OPENPIC_CURRENT_TASK_PRIORITY_MASK, 0xf);
594 }
595
596 for (i=0; i<OPENPIC_NUM_IPI; i++)
597 save_ipi_vp[i] = openpic2_read(&OpenPIC2->Global.IPI_Vector_Priority(i));
598 for (i=0; i<NumSources; i++) {
599 if (ISR[i] == 0)
600 continue;
601 save_irq_src_vp[i] = openpic2_read(&ISR[i]->Vector_Priority) & ~OPENPIC_ACTIVITY;
602 save_irq_src_dest[i] = openpic2_read(&ISR[i]->Destination);
603 }
604
605 spin_unlock_irqrestore(&openpic2_setup_lock, flags);
606
607 return 0;
608}
609
610/* WARNING: Can be called directly by the cpufreq code with NULL parameter,
611 * we need something better to deal with that... Maybe switch to S1 for
612 * cpufreq changes
613 */
614int openpic2_resume(struct sys_device *sysdev)
615{
616 int i;
617 unsigned long flags;
618 u32 vppmask = OPENPIC_PRIORITY_MASK | OPENPIC_VECTOR_MASK |
619 OPENPIC_SENSE_MASK | OPENPIC_POLARITY_MASK |
620 OPENPIC_MASK;
621
622 spin_lock_irqsave(&openpic2_setup_lock, flags);
623
624 if ((--openpic_suspend_count) > 0) {
625 spin_unlock_irqrestore(&openpic2_setup_lock, flags);
626 return 0;
627 }
628
629 openpic2_reset();
630
631 /* OpenPIC sometimes seem to need some time to be fully back up... */
632 do {
633 openpic2_set_spurious(OPENPIC2_VEC_SPURIOUS+open_pic2_irq_offset);
634 } while(openpic2_readfield(&OpenPIC2->Global.Spurious_Vector, OPENPIC_VECTOR_MASK)
635 != (OPENPIC2_VEC_SPURIOUS + open_pic2_irq_offset));
636
637 openpic2_disable_8259_pass_through();
638
639 for (i=0; i<OPENPIC_NUM_IPI; i++)
640 openpic2_write(&OpenPIC2->Global.IPI_Vector_Priority(i),
641 save_ipi_vp[i]);
642 for (i=0; i<NumSources; i++) {
643 if (ISR[i] == 0)
644 continue;
645 openpic2_write(&ISR[i]->Destination, save_irq_src_dest[i]);
646 openpic2_write(&ISR[i]->Vector_Priority, save_irq_src_vp[i]);
647 /* make sure mask gets to controller before we return to user */
648 do {
649 openpic2_write(&ISR[i]->Vector_Priority, save_irq_src_vp[i]);
650 } while (openpic2_readfield(&ISR[i]->Vector_Priority, vppmask)
651 != (save_irq_src_vp[i] & vppmask));
652 }
653 for (i=0; i<NumProcessors; i++)
654 openpic2_write(&OpenPIC2->Processor[i].Current_Task_Priority,
655 save_cpu_task_pri[i]);
656
657 open_pic2.enable = openpic2_enable_irq;
658 open_pic2.disable = openpic2_disable_irq;
659
660 spin_unlock_irqrestore(&openpic2_setup_lock, flags);
661
662 return 0;
663}
664
665#endif /* CONFIG_PM */
666
667/* HACK ALERT */
668static struct sysdev_class openpic2_sysclass = {
669 .name = "openpic2",
670};
671
672static struct sys_device device_openpic2 = {
673 .id = 0,
674 .cls = &openpic2_sysclass,
675};
676
677static struct sysdev_driver driver_openpic2 = {
678#ifdef CONFIG_PM
679 .suspend = &openpic2_suspend,
680 .resume = &openpic2_resume,
681#endif /* CONFIG_PM */
682};
683
684static int __init init_openpic2_sysfs(void)
685{
686 int rc;
687
688 if (!OpenPIC2_Addr)
689 return -ENODEV;
690 printk(KERN_DEBUG "Registering openpic2 with sysfs...\n");
691 rc = sysdev_class_register(&openpic2_sysclass);
692 if (rc) {
693 printk(KERN_ERR "Failed registering openpic sys class\n");
694 return -ENODEV;
695 }
696 rc = sysdev_register(&device_openpic2);
697 if (rc) {
698 printk(KERN_ERR "Failed registering openpic sys device\n");
699 return -ENODEV;
700 }
701 rc = sysdev_driver_register(&openpic2_sysclass, &driver_openpic2);
702 if (rc) {
703 printk(KERN_ERR "Failed registering openpic sys driver\n");
704 return -ENODEV;
705 }
706 return 0;
707}
708
709subsys_initcall(init_openpic2_sysfs);
710
diff --git a/arch/ppc/syslib/open_pic_defs.h b/arch/ppc/syslib/open_pic_defs.h
deleted file mode 100644
index 3a25de7cb572..000000000000
--- a/arch/ppc/syslib/open_pic_defs.h
+++ /dev/null
@@ -1,287 +0,0 @@
1/*
2 * Copyright (C) 1997 Geert Uytterhoeven
3 *
4 * This file is based on the following documentation:
5 *
6 * The Open Programmable Interrupt Controller (PIC)
7 * Register Interface Specification Revision 1.2
8 *
9 * Issue Date: October 1995
10 *
11 * Issued jointly by Advanced Micro Devices and Cyrix Corporation
12 *
13 * AMD is a registered trademark of Advanced Micro Devices, Inc.
14 * Copyright (C) 1995, Advanced Micro Devices, Inc. and Cyrix, Inc.
15 * All Rights Reserved.
16 *
17 * To receive a copy of this documentation, send an email to openpic@amd.com.
18 *
19 * This file is subject to the terms and conditions of the GNU General Public
20 * License. See the file COPYING in the main directory of this archive
21 * for more details.
22 */
23
24#ifndef _LINUX_OPENPIC_H
25#define _LINUX_OPENPIC_H
26
27#ifdef __KERNEL__
28
29 /*
30 * OpenPIC supports up to 2048 interrupt sources and up to 32 processors
31 */
32
33#define OPENPIC_MAX_SOURCES 2048
34#define OPENPIC_MAX_PROCESSORS 32
35#define OPENPIC_MAX_ISU 16
36
37#define OPENPIC_NUM_TIMERS 4
38#define OPENPIC_NUM_IPI 4
39#define OPENPIC_NUM_PRI 16
40#define OPENPIC_NUM_VECTORS 256
41
42
43
44 /*
45 * OpenPIC Registers are 32 bits and aligned on 128 bit boundaries
46 */
47
48typedef struct _OpenPIC_Reg {
49 u_int Reg; /* Little endian! */
50 char Pad[0xc];
51} OpenPIC_Reg;
52
53
54 /*
55 * Per Processor Registers
56 */
57
58typedef struct _OpenPIC_Processor {
59 /*
60 * Private Shadow Registers (for SLiC backwards compatibility)
61 */
62 u_int IPI0_Dispatch_Shadow; /* Write Only */
63 char Pad1[0x4];
64 u_int IPI0_Vector_Priority_Shadow; /* Read/Write */
65 char Pad2[0x34];
66 /*
67 * Interprocessor Interrupt Command Ports
68 */
69 OpenPIC_Reg _IPI_Dispatch[OPENPIC_NUM_IPI]; /* Write Only */
70 /*
71 * Current Task Priority Register
72 */
73 OpenPIC_Reg _Current_Task_Priority; /* Read/Write */
74 char Pad3[0x10];
75 /*
76 * Interrupt Acknowledge Register
77 */
78 OpenPIC_Reg _Interrupt_Acknowledge; /* Read Only */
79 /*
80 * End of Interrupt (EOI) Register
81 */
82 OpenPIC_Reg _EOI; /* Read/Write */
83 char Pad5[0xf40];
84} OpenPIC_Processor;
85
86
87 /*
88 * Timer Registers
89 */
90
91typedef struct _OpenPIC_Timer {
92 OpenPIC_Reg _Current_Count; /* Read Only */
93 OpenPIC_Reg _Base_Count; /* Read/Write */
94 OpenPIC_Reg _Vector_Priority; /* Read/Write */
95 OpenPIC_Reg _Destination; /* Read/Write */
96} OpenPIC_Timer;
97
98
99 /*
100 * Global Registers
101 */
102
103typedef struct _OpenPIC_Global {
104 /*
105 * Feature Reporting Registers
106 */
107 OpenPIC_Reg _Feature_Reporting0; /* Read Only */
108 OpenPIC_Reg _Feature_Reporting1; /* Future Expansion */
109 /*
110 * Global Configuration Registers
111 */
112 OpenPIC_Reg _Global_Configuration0; /* Read/Write */
113 OpenPIC_Reg _Global_Configuration1; /* Future Expansion */
114 /*
115 * Vendor Specific Registers
116 */
117 OpenPIC_Reg _Vendor_Specific[4];
118 /*
119 * Vendor Identification Register
120 */
121 OpenPIC_Reg _Vendor_Identification; /* Read Only */
122 /*
123 * Processor Initialization Register
124 */
125 OpenPIC_Reg _Processor_Initialization; /* Read/Write */
126 /*
127 * IPI Vector/Priority Registers
128 */
129 OpenPIC_Reg _IPI_Vector_Priority[OPENPIC_NUM_IPI]; /* Read/Write */
130 /*
131 * Spurious Vector Register
132 */
133 OpenPIC_Reg _Spurious_Vector; /* Read/Write */
134 /*
135 * Global Timer Registers
136 */
137 OpenPIC_Reg _Timer_Frequency; /* Read/Write */
138 OpenPIC_Timer Timer[OPENPIC_NUM_TIMERS];
139 char Pad1[0xee00];
140} OpenPIC_Global;
141
142
143 /*
144 * Interrupt Source Registers
145 */
146
147typedef struct _OpenPIC_Source {
148 OpenPIC_Reg _Vector_Priority; /* Read/Write */
149 OpenPIC_Reg _Destination; /* Read/Write */
150} OpenPIC_Source, *OpenPIC_SourcePtr;
151
152
153 /*
154 * OpenPIC Register Map
155 */
156
157struct OpenPIC {
158 char Pad1[0x1000];
159 /*
160 * Global Registers
161 */
162 OpenPIC_Global Global;
163 /*
164 * Interrupt Source Configuration Registers
165 */
166 OpenPIC_Source Source[OPENPIC_MAX_SOURCES];
167 /*
168 * Per Processor Registers
169 */
170 OpenPIC_Processor Processor[OPENPIC_MAX_PROCESSORS];
171};
172
173 /*
174 * Current Task Priority Register
175 */
176
177#define OPENPIC_CURRENT_TASK_PRIORITY_MASK 0x0000000f
178
179 /*
180 * Who Am I Register
181 */
182
183#define OPENPIC_WHO_AM_I_ID_MASK 0x0000001f
184
185 /*
186 * Feature Reporting Register 0
187 */
188
189#define OPENPIC_FEATURE_LAST_SOURCE_MASK 0x07ff0000
190#define OPENPIC_FEATURE_LAST_SOURCE_SHIFT 16
191#define OPENPIC_FEATURE_LAST_PROCESSOR_MASK 0x00001f00
192#define OPENPIC_FEATURE_LAST_PROCESSOR_SHIFT 8
193#define OPENPIC_FEATURE_VERSION_MASK 0x000000ff
194
195 /*
196 * Global Configuration Register 0
197 */
198
199#define OPENPIC_CONFIG_RESET 0x80000000
200#define OPENPIC_CONFIG_8259_PASSTHROUGH_DISABLE 0x20000000
201#define OPENPIC_CONFIG_BASE_MASK 0x000fffff
202
203 /*
204 * Global Configuration Register 1
205 * This is the EICR on EPICs.
206 */
207
208#define OPENPIC_EICR_S_CLK_MASK 0x70000000
209#define OPENPIC_EICR_SIE 0x08000000
210
211 /*
212 * Vendor Identification Register
213 */
214
215#define OPENPIC_VENDOR_ID_STEPPING_MASK 0x00ff0000
216#define OPENPIC_VENDOR_ID_STEPPING_SHIFT 16
217#define OPENPIC_VENDOR_ID_DEVICE_ID_MASK 0x0000ff00
218#define OPENPIC_VENDOR_ID_DEVICE_ID_SHIFT 8
219#define OPENPIC_VENDOR_ID_VENDOR_ID_MASK 0x000000ff
220
221 /*
222 * Vector/Priority Registers
223 */
224
225#define OPENPIC_MASK 0x80000000
226#define OPENPIC_ACTIVITY 0x40000000 /* Read Only */
227#define OPENPIC_PRIORITY_MASK 0x000f0000
228#define OPENPIC_PRIORITY_SHIFT 16
229#define OPENPIC_VECTOR_MASK 0x000000ff
230
231
232 /*
233 * Interrupt Source Registers
234 */
235
236#define OPENPIC_POLARITY_POSITIVE 0x00800000
237#define OPENPIC_POLARITY_NEGATIVE 0x00000000
238#define OPENPIC_POLARITY_MASK 0x00800000
239#define OPENPIC_SENSE_LEVEL 0x00400000
240#define OPENPIC_SENSE_EDGE 0x00000000
241#define OPENPIC_SENSE_MASK 0x00400000
242
243
244 /*
245 * Timer Registers
246 */
247
248#define OPENPIC_COUNT_MASK 0x7fffffff
249#define OPENPIC_TIMER_TOGGLE 0x80000000
250#define OPENPIC_TIMER_COUNT_INHIBIT 0x80000000
251
252
253 /*
254 * Aliases to make life simpler
255 */
256
257/* Per Processor Registers */
258#define IPI_Dispatch(i) _IPI_Dispatch[i].Reg
259#define Current_Task_Priority _Current_Task_Priority.Reg
260#define Interrupt_Acknowledge _Interrupt_Acknowledge.Reg
261#define EOI _EOI.Reg
262
263/* Global Registers */
264#define Feature_Reporting0 _Feature_Reporting0.Reg
265#define Feature_Reporting1 _Feature_Reporting1.Reg
266#define Global_Configuration0 _Global_Configuration0.Reg
267#define Global_Configuration1 _Global_Configuration1.Reg
268#define Vendor_Specific(i) _Vendor_Specific[i].Reg
269#define Vendor_Identification _Vendor_Identification.Reg
270#define Processor_Initialization _Processor_Initialization.Reg
271#define IPI_Vector_Priority(i) _IPI_Vector_Priority[i].Reg
272#define Spurious_Vector _Spurious_Vector.Reg
273#define Timer_Frequency _Timer_Frequency.Reg
274
275/* Timer Registers */
276#define Current_Count _Current_Count.Reg
277#define Base_Count _Base_Count.Reg
278#define Vector_Priority _Vector_Priority.Reg
279#define Destination _Destination.Reg
280
281/* Interrupt Source Registers */
282#define Vector_Priority _Vector_Priority.Reg
283#define Destination _Destination.Reg
284
285#endif /* __KERNEL__ */
286
287#endif /* _LINUX_OPENPIC_H */
diff --git a/arch/ppc/syslib/pci_auto.c b/arch/ppc/syslib/pci_auto.c
deleted file mode 100644
index ee20a86fcc4b..000000000000
--- a/arch/ppc/syslib/pci_auto.c
+++ /dev/null
@@ -1,515 +0,0 @@
1/*
2 * PCI autoconfiguration library
3 *
4 * Author: Matt Porter <mporter@mvista.com>
5 *
6 * 2001 (c) MontaVista, Software, Inc. This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10 */
11
12/*
13 * The CardBus support is very preliminary. Preallocating space is
14 * the way to go but will require some change in card services to
15 * make it useful. Eventually this will ensure that we can put
16 * multiple CB bridges behind multiple P2P bridges. For now, at
17 * least it ensures that we place the CB bridge BAR and assigned
18 * initial bus numbers. I definitely need to do something about
19 * the lack of 16-bit I/O support. -MDP
20 */
21
22#include <linux/kernel.h>
23#include <linux/init.h>
24#include <linux/pci.h>
25
26#include <asm/pci-bridge.h>
27
28#define PCIAUTO_IDE_MODE_MASK 0x05
29
30#undef DEBUG
31
32#ifdef DEBUG
33#define DBG(x...) printk(x)
34#else
35#define DBG(x...)
36#endif /* DEBUG */
37
38static int pciauto_upper_iospc;
39static int pciauto_upper_memspc;
40
41void __init pciauto_setup_bars(struct pci_controller *hose,
42 int current_bus,
43 int pci_devfn,
44 int bar_limit)
45{
46 int bar_response, bar_size, bar_value;
47 int bar, addr_mask;
48 int * upper_limit;
49 int found_mem64 = 0;
50
51 DBG("PCI Autoconfig: Found Bus %d, Device %d, Function %d\n",
52 current_bus, PCI_SLOT(pci_devfn), PCI_FUNC(pci_devfn) );
53
54 for (bar = PCI_BASE_ADDRESS_0; bar <= bar_limit; bar+=4) {
55 /* Tickle the BAR and get the response */
56 early_write_config_dword(hose,
57 current_bus,
58 pci_devfn,
59 bar,
60 0xffffffff);
61 early_read_config_dword(hose,
62 current_bus,
63 pci_devfn,
64 bar,
65 &bar_response);
66
67 /* If BAR is not implemented go to the next BAR */
68 if (!bar_response)
69 continue;
70
71 /* Check the BAR type and set our address mask */
72 if (bar_response & PCI_BASE_ADDRESS_SPACE) {
73 addr_mask = PCI_BASE_ADDRESS_IO_MASK;
74 upper_limit = &pciauto_upper_iospc;
75 DBG("PCI Autoconfig: BAR 0x%x, I/O, ", bar);
76 } else {
77 if ( (bar_response & PCI_BASE_ADDRESS_MEM_TYPE_MASK) ==
78 PCI_BASE_ADDRESS_MEM_TYPE_64)
79 found_mem64 = 1;
80
81 addr_mask = PCI_BASE_ADDRESS_MEM_MASK;
82 upper_limit = &pciauto_upper_memspc;
83 DBG("PCI Autoconfig: BAR 0x%x, Mem ", bar);
84 }
85
86 /* Calculate requested size */
87 bar_size = ~(bar_response & addr_mask) + 1;
88
89 /* Allocate a base address */
90 bar_value = (*upper_limit - bar_size) & ~(bar_size - 1);
91
92 /* Write it out and update our limit */
93 early_write_config_dword(hose,
94 current_bus,
95 pci_devfn,
96 bar,
97 bar_value);
98
99 *upper_limit = bar_value;
100
101 /*
102 * If we are a 64-bit decoder then increment to the
103 * upper 32 bits of the bar and force it to locate
104 * in the lower 4GB of memory.
105 */
106 if (found_mem64) {
107 bar += 4;
108 early_write_config_dword(hose,
109 current_bus,
110 pci_devfn,
111 bar,
112 0x00000000);
113 found_mem64 = 0;
114 }
115
116 DBG("size=0x%x, address=0x%x\n",
117 bar_size, bar_value);
118 }
119
120}
121
122void __init pciauto_prescan_setup_bridge(struct pci_controller *hose,
123 int current_bus,
124 int pci_devfn,
125 int sub_bus,
126 int *iosave,
127 int *memsave)
128{
129 /* Configure bus number registers */
130 early_write_config_byte(hose,
131 current_bus,
132 pci_devfn,
133 PCI_PRIMARY_BUS,
134 current_bus);
135 early_write_config_byte(hose,
136 current_bus,
137 pci_devfn,
138 PCI_SECONDARY_BUS,
139 sub_bus + 1);
140 early_write_config_byte(hose,
141 current_bus,
142 pci_devfn,
143 PCI_SUBORDINATE_BUS,
144 0xff);
145
146 /* Round memory allocator to 1MB boundary */
147 pciauto_upper_memspc &= ~(0x100000 - 1);
148 *memsave = pciauto_upper_memspc;
149
150 /* Round I/O allocator to 4KB boundary */
151 pciauto_upper_iospc &= ~(0x1000 - 1);
152 *iosave = pciauto_upper_iospc;
153
154 /* Set up memory and I/O filter limits, assume 32-bit I/O space */
155 early_write_config_word(hose,
156 current_bus,
157 pci_devfn,
158 PCI_MEMORY_LIMIT,
159 ((pciauto_upper_memspc - 1) & 0xfff00000) >> 16);
160 early_write_config_byte(hose,
161 current_bus,
162 pci_devfn,
163 PCI_IO_LIMIT,
164 ((pciauto_upper_iospc - 1) & 0x0000f000) >> 8);
165 early_write_config_word(hose,
166 current_bus,
167 pci_devfn,
168 PCI_IO_LIMIT_UPPER16,
169 ((pciauto_upper_iospc - 1) & 0xffff0000) >> 16);
170
171 /* Zero upper 32 bits of prefetchable base/limit */
172 early_write_config_dword(hose,
173 current_bus,
174 pci_devfn,
175 PCI_PREF_BASE_UPPER32,
176 0);
177 early_write_config_dword(hose,
178 current_bus,
179 pci_devfn,
180 PCI_PREF_LIMIT_UPPER32,
181 0);
182}
183
184void __init pciauto_postscan_setup_bridge(struct pci_controller *hose,
185 int current_bus,
186 int pci_devfn,
187 int sub_bus,
188 int *iosave,
189 int *memsave)
190{
191 int cmdstat;
192
193 /* Configure bus number registers */
194 early_write_config_byte(hose,
195 current_bus,
196 pci_devfn,
197 PCI_SUBORDINATE_BUS,
198 sub_bus);
199
200 /*
201 * Round memory allocator to 1MB boundary.
202 * If no space used, allocate minimum.
203 */
204 pciauto_upper_memspc &= ~(0x100000 - 1);
205 if (*memsave == pciauto_upper_memspc)
206 pciauto_upper_memspc -= 0x00100000;
207
208 early_write_config_word(hose,
209 current_bus,
210 pci_devfn,
211 PCI_MEMORY_BASE,
212 pciauto_upper_memspc >> 16);
213
214 /* Allocate 1MB for pre-fretch */
215 early_write_config_word(hose,
216 current_bus,
217 pci_devfn,
218 PCI_PREF_MEMORY_LIMIT,
219 ((pciauto_upper_memspc - 1) & 0xfff00000) >> 16);
220
221 pciauto_upper_memspc -= 0x100000;
222
223 early_write_config_word(hose,
224 current_bus,
225 pci_devfn,
226 PCI_PREF_MEMORY_BASE,
227 pciauto_upper_memspc >> 16);
228
229 /* Round I/O allocator to 4KB boundary */
230 pciauto_upper_iospc &= ~(0x1000 - 1);
231 if (*iosave == pciauto_upper_iospc)
232 pciauto_upper_iospc -= 0x1000;
233
234 early_write_config_byte(hose,
235 current_bus,
236 pci_devfn,
237 PCI_IO_BASE,
238 (pciauto_upper_iospc & 0x0000f000) >> 8);
239 early_write_config_word(hose,
240 current_bus,
241 pci_devfn,
242 PCI_IO_BASE_UPPER16,
243 pciauto_upper_iospc >> 16);
244
245 /* Enable memory and I/O accesses, enable bus master */
246 early_read_config_dword(hose,
247 current_bus,
248 pci_devfn,
249 PCI_COMMAND,
250 &cmdstat);
251 early_write_config_dword(hose,
252 current_bus,
253 pci_devfn,
254 PCI_COMMAND,
255 cmdstat |
256 PCI_COMMAND_IO |
257 PCI_COMMAND_MEMORY |
258 PCI_COMMAND_MASTER);
259}
260
261void __init pciauto_prescan_setup_cardbus_bridge(struct pci_controller *hose,
262 int current_bus,
263 int pci_devfn,
264 int sub_bus,
265 int *iosave,
266 int *memsave)
267{
268 /* Configure bus number registers */
269 early_write_config_byte(hose,
270 current_bus,
271 pci_devfn,
272 PCI_PRIMARY_BUS,
273 current_bus);
274 early_write_config_byte(hose,
275 current_bus,
276 pci_devfn,
277 PCI_SECONDARY_BUS,
278 sub_bus + 1);
279 early_write_config_byte(hose,
280 current_bus,
281 pci_devfn,
282 PCI_SUBORDINATE_BUS,
283 0xff);
284
285 /* Round memory allocator to 4KB boundary */
286 pciauto_upper_memspc &= ~(0x1000 - 1);
287 *memsave = pciauto_upper_memspc;
288
289 /* Round I/O allocator to 4 byte boundary */
290 pciauto_upper_iospc &= ~(0x4 - 1);
291 *iosave = pciauto_upper_iospc;
292
293 /* Set up memory and I/O filter limits, assume 32-bit I/O space */
294 early_write_config_dword(hose,
295 current_bus,
296 pci_devfn,
297 0x20,
298 pciauto_upper_memspc - 1);
299 early_write_config_dword(hose,
300 current_bus,
301 pci_devfn,
302 0x30,
303 pciauto_upper_iospc - 1);
304}
305
306void __init pciauto_postscan_setup_cardbus_bridge(struct pci_controller *hose,
307 int current_bus,
308 int pci_devfn,
309 int sub_bus,
310 int *iosave,
311 int *memsave)
312{
313 int cmdstat;
314
315 /*
316 * Configure subordinate bus number. The PCI subsystem
317 * bus scan will renumber buses (reserving three additional
318 * for this PCI<->CardBus bridge for the case where a CardBus
319 * adapter contains a P2P or CB2CB bridge.
320 */
321 early_write_config_byte(hose,
322 current_bus,
323 pci_devfn,
324 PCI_SUBORDINATE_BUS,
325 sub_bus);
326
327 /*
328 * Reserve an additional 4MB for mem space and 16KB for
329 * I/O space. This should cover any additional space
330 * requirement of unusual CardBus devices with
331 * additional bridges that can consume more address space.
332 *
333 * Although pcmcia-cs currently will reprogram bridge
334 * windows, the goal is to add an option to leave them
335 * alone and use the bridge window ranges as the regions
336 * that are searched for free resources upon hot-insertion
337 * of a device. This will allow a PCI<->CardBus bridge
338 * configured by this routine to happily live behind a
339 * P2P bridge in a system.
340 */
341 pciauto_upper_memspc -= 0x00400000;
342 pciauto_upper_iospc -= 0x00004000;
343
344 /* Round memory allocator to 4KB boundary */
345 pciauto_upper_memspc &= ~(0x1000 - 1);
346
347 early_write_config_dword(hose,
348 current_bus,
349 pci_devfn,
350 0x1c,
351 pciauto_upper_memspc);
352
353 /* Round I/O allocator to 4 byte boundary */
354 pciauto_upper_iospc &= ~(0x4 - 1);
355 early_write_config_dword(hose,
356 current_bus,
357 pci_devfn,
358 0x2c,
359 pciauto_upper_iospc);
360
361 /* Enable memory and I/O accesses, enable bus master */
362 early_read_config_dword(hose,
363 current_bus,
364 pci_devfn,
365 PCI_COMMAND,
366 &cmdstat);
367 early_write_config_dword(hose,
368 current_bus,
369 pci_devfn,
370 PCI_COMMAND,
371 cmdstat |
372 PCI_COMMAND_IO |
373 PCI_COMMAND_MEMORY |
374 PCI_COMMAND_MASTER);
375}
376
377int __init pciauto_bus_scan(struct pci_controller *hose, int current_bus)
378{
379 int sub_bus, pci_devfn, pci_class, cmdstat, found_multi = 0;
380 unsigned short vid;
381 unsigned char header_type;
382
383 /*
384 * Fetch our I/O and memory space upper boundaries used
385 * to allocated base addresses on this hose.
386 */
387 if (current_bus == hose->first_busno) {
388 pciauto_upper_iospc = hose->io_space.end + 1;
389 pciauto_upper_memspc = hose->mem_space.end + 1;
390 }
391
392 sub_bus = current_bus;
393
394 for (pci_devfn = 0; pci_devfn < 0xff; pci_devfn++) {
395 /* Skip our host bridge */
396 if ( (current_bus == hose->first_busno) && (pci_devfn == 0) )
397 continue;
398
399 if (PCI_FUNC(pci_devfn) && !found_multi)
400 continue;
401
402 /* If config space read fails from this device, move on */
403 if (early_read_config_byte(hose,
404 current_bus,
405 pci_devfn,
406 PCI_HEADER_TYPE,
407 &header_type))
408 continue;
409
410 if (!PCI_FUNC(pci_devfn))
411 found_multi = header_type & 0x80;
412
413 early_read_config_word(hose,
414 current_bus,
415 pci_devfn,
416 PCI_VENDOR_ID,
417 &vid);
418
419 if (vid != 0xffff) {
420 early_read_config_dword(hose,
421 current_bus,
422 pci_devfn,
423 PCI_CLASS_REVISION, &pci_class);
424 if ( (pci_class >> 16) == PCI_CLASS_BRIDGE_PCI ) {
425 int iosave, memsave;
426
427 DBG("PCI Autoconfig: Found P2P bridge, device %d\n", PCI_SLOT(pci_devfn));
428 /* Allocate PCI I/O and/or memory space */
429 pciauto_setup_bars(hose,
430 current_bus,
431 pci_devfn,
432 PCI_BASE_ADDRESS_1);
433
434 pciauto_prescan_setup_bridge(hose,
435 current_bus,
436 pci_devfn,
437 sub_bus,
438 &iosave,
439 &memsave);
440 sub_bus = pciauto_bus_scan(hose, sub_bus+1);
441 pciauto_postscan_setup_bridge(hose,
442 current_bus,
443 pci_devfn,
444 sub_bus,
445 &iosave,
446 &memsave);
447 } else if ((pci_class >> 16) == PCI_CLASS_BRIDGE_CARDBUS) {
448 int iosave, memsave;
449
450 DBG("PCI Autoconfig: Found CardBus bridge, device %d function %d\n", PCI_SLOT(pci_devfn), PCI_FUNC(pci_devfn));
451 /* Place CardBus Socket/ExCA registers */
452 pciauto_setup_bars(hose,
453 current_bus,
454 pci_devfn,
455 PCI_BASE_ADDRESS_0);
456
457 pciauto_prescan_setup_cardbus_bridge(hose,
458 current_bus,
459 pci_devfn,
460 sub_bus,
461 &iosave,
462 &memsave);
463 sub_bus = pciauto_bus_scan(hose, sub_bus+1);
464 pciauto_postscan_setup_cardbus_bridge(hose,
465 current_bus,
466 pci_devfn,
467 sub_bus,
468 &iosave,
469 &memsave);
470 } else {
471 if ((pci_class >> 16) == PCI_CLASS_STORAGE_IDE) {
472 unsigned char prg_iface;
473
474 early_read_config_byte(hose,
475 current_bus,
476 pci_devfn,
477 PCI_CLASS_PROG,
478 &prg_iface);
479 if (!(prg_iface & PCIAUTO_IDE_MODE_MASK)) {
480 DBG("PCI Autoconfig: Skipping legacy mode IDE controller\n");
481 continue;
482 }
483 }
484 /* Allocate PCI I/O and/or memory space */
485 pciauto_setup_bars(hose,
486 current_bus,
487 pci_devfn,
488 PCI_BASE_ADDRESS_5);
489
490 /*
491 * Enable some standard settings
492 */
493 early_read_config_dword(hose,
494 current_bus,
495 pci_devfn,
496 PCI_COMMAND,
497 &cmdstat);
498 early_write_config_dword(hose,
499 current_bus,
500 pci_devfn,
501 PCI_COMMAND,
502 cmdstat |
503 PCI_COMMAND_IO |
504 PCI_COMMAND_MEMORY |
505 PCI_COMMAND_MASTER);
506 early_write_config_byte(hose,
507 current_bus,
508 pci_devfn,
509 PCI_LATENCY_TIMER,
510 0x80);
511 }
512 }
513 }
514 return sub_bus;
515}
diff --git a/arch/ppc/syslib/ppc403_pic.c b/arch/ppc/syslib/ppc403_pic.c
deleted file mode 100644
index c3b7b8bfbcfe..000000000000
--- a/arch/ppc/syslib/ppc403_pic.c
+++ /dev/null
@@ -1,125 +0,0 @@
1/*
2 *
3 * Copyright (c) 1999 Grant Erickson <grant@lcse.umn.edu>
4 *
5 * Module name: ppc403_pic.c
6 *
7 * Description:
8 * Interrupt controller driver for PowerPC 403-based processors.
9 */
10
11/*
12 * The PowerPC 403 cores' Asynchronous Interrupt Controller (AIC) has
13 * 32 possible interrupts, a majority of which are not implemented on
14 * all cores. There are six configurable, external interrupt pins and
15 * there are eight internal interrupts for the on-chip serial port
16 * (SPU), DMA controller, and JTAG controller.
17 *
18 */
19
20#include <linux/init.h>
21#include <linux/sched.h>
22#include <linux/signal.h>
23#include <linux/stddef.h>
24
25#include <asm/processor.h>
26#include <asm/system.h>
27#include <asm/irq.h>
28#include <asm/ppc4xx_pic.h>
29#include <asm/machdep.h>
30
31/* Function Prototypes */
32
33static void ppc403_aic_enable(unsigned int irq);
34static void ppc403_aic_disable(unsigned int irq);
35static void ppc403_aic_disable_and_ack(unsigned int irq);
36
37static struct hw_interrupt_type ppc403_aic = {
38 .typename = "403GC AIC",
39 .enable = ppc403_aic_enable,
40 .disable = ppc403_aic_disable,
41 .ack = ppc403_aic_disable_and_ack,
42};
43
44int
45ppc403_pic_get_irq(void)
46{
47 int irq;
48 unsigned long bits;
49
50 /*
51 * Only report the status of those interrupts that are actually
52 * enabled.
53 */
54
55 bits = mfdcr(DCRN_EXISR) & mfdcr(DCRN_EXIER);
56
57 /*
58 * Walk through the interrupts from highest priority to lowest, and
59 * report the first pending interrupt found.
60 * We want PPC, not C bit numbering, so just subtract the ffs()
61 * result from 32.
62 */
63 irq = 32 - ffs(bits);
64
65 if (irq == NR_AIC_IRQS)
66 irq = -1;
67
68 return (irq);
69}
70
71static void
72ppc403_aic_enable(unsigned int irq)
73{
74 int bit, word;
75
76 bit = irq & 0x1f;
77 word = irq >> 5;
78
79 ppc_cached_irq_mask[word] |= (1 << (31 - bit));
80 mtdcr(DCRN_EXIER, ppc_cached_irq_mask[word]);
81}
82
83static void
84ppc403_aic_disable(unsigned int irq)
85{
86 int bit, word;
87
88 bit = irq & 0x1f;
89 word = irq >> 5;
90
91 ppc_cached_irq_mask[word] &= ~(1 << (31 - bit));
92 mtdcr(DCRN_EXIER, ppc_cached_irq_mask[word]);
93}
94
95static void
96ppc403_aic_disable_and_ack(unsigned int irq)
97{
98 int bit, word;
99
100 bit = irq & 0x1f;
101 word = irq >> 5;
102
103 ppc_cached_irq_mask[word] &= ~(1 << (31 - bit));
104 mtdcr(DCRN_EXIER, ppc_cached_irq_mask[word]);
105 mtdcr(DCRN_EXISR, (1 << (31 - bit)));
106}
107
108void __init
109ppc4xx_pic_init(void)
110{
111 int i;
112
113 /*
114 * Disable all external interrupts until they are
115 * explicitly requested.
116 */
117 ppc_cached_irq_mask[0] = 0;
118
119 mtdcr(DCRN_EXIER, ppc_cached_irq_mask[0]);
120
121 ppc_md.get_irq = ppc403_pic_get_irq;
122
123 for (i = 0; i < NR_IRQS; i++)
124 irq_desc[i].chip = &ppc403_aic;
125}
diff --git a/arch/ppc/syslib/ppc405_pci.c b/arch/ppc/syslib/ppc405_pci.c
deleted file mode 100644
index 9e9035693bfa..000000000000
--- a/arch/ppc/syslib/ppc405_pci.c
+++ /dev/null
@@ -1,170 +0,0 @@
1/*
2 * Authors: Frank Rowand <frank_rowand@mvista.com>,
3 * Debbie Chu <debbie_chu@mvista.com>, or source@mvista.com
4 * Further modifications by Armin Kuster <akuster@mvista.com>
5 *
6 * 2000 (c) MontaVista, Software, Inc. This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10 *
11 * Based on arch/ppc/kernel/indirect.c, Copyright (C) 1998 Gabriel Paubert.
12 */
13
14#include <linux/pci.h>
15#include <asm/io.h>
16#include <asm/system.h>
17#include <asm/machdep.h>
18#include <linux/init.h>
19#include <linux/errno.h>
20#include <asm/ocp.h>
21#include <asm/ibm4xx.h>
22#include <asm/pci-bridge.h>
23#include <asm/ibm_ocp_pci.h>
24
25
26extern void bios_fixup(struct pci_controller *, struct pcil0_regs *);
27extern int ppc405_map_irq(struct pci_dev *dev, unsigned char idsel,
28 unsigned char pin);
29
30void
31ppc405_pcibios_fixup_resources(struct pci_dev *dev)
32{
33 int i;
34 unsigned long max_host_addr;
35 unsigned long min_host_addr;
36 struct resource *res;
37
38 /*
39 * openbios puts some graphics cards in the same range as the host
40 * controller uses to map to SDRAM. Fix it.
41 */
42
43 min_host_addr = 0;
44 max_host_addr = PPC405_PCI_MEM_BASE - 1;
45
46 for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
47 res = dev->resource + i;
48 if (!res->start)
49 continue;
50 if ((res->flags & IORESOURCE_MEM) &&
51 (((res->start >= min_host_addr)
52 && (res->start <= max_host_addr))
53 || ((res->end >= min_host_addr)
54 && (res->end <= max_host_addr))
55 || ((res->start < min_host_addr)
56 && (res->end > max_host_addr))
57 )
58 ) {
59
60 /* force pcibios_assign_resources() to assign a new address */
61 res->end -= res->start;
62 res->start = 0;
63 }
64 }
65}
66
67static int
68ppc4xx_exclude_device(unsigned char bus, unsigned char devfn)
69{
70 /* We prevent us from seeing ourselves to avoid having
71 * the kernel try to remap our BAR #1 and fuck up bus
72 * master from external PCI devices
73 */
74 return (bus == 0 && devfn == 0);
75}
76
77void
78ppc4xx_find_bridges(void)
79{
80 struct pci_controller *hose_a;
81 struct pcil0_regs *pcip;
82 unsigned int tmp_addr;
83 unsigned int tmp_size;
84 unsigned int reg_index;
85 unsigned int new_pmm_max = 0;
86 unsigned int new_pmm_min = 0;
87
88 isa_io_base = 0;
89 isa_mem_base = 0;
90 pci_dram_offset = 0;
91
92 /* Setup PCI32 hose */
93 hose_a = pcibios_alloc_controller();
94 if (!hose_a)
95 return;
96 setup_indirect_pci(hose_a, PPC405_PCI_CONFIG_ADDR,
97 PPC405_PCI_CONFIG_DATA);
98
99 pcip = ioremap(PPC4xx_PCI_LCFG_PADDR, PAGE_SIZE);
100 if (pcip != NULL) {
101
102#if defined(CONFIG_BIOS_FIXUP)
103 bios_fixup(hose_a, pcip);
104#endif
105 new_pmm_min = 0xffffffff;
106 for (reg_index = 0; reg_index < 3; reg_index++) {
107 tmp_size = in_le32(&pcip->pmm[reg_index].ma); // mask & attrs
108 /* test the enable bit */
109 if ((tmp_size & 0x1) == 0)
110 continue;
111 tmp_addr = in_le32(&pcip->pmm[reg_index].pcila); // PCI addr
112 if (tmp_addr < PPC405_PCI_PHY_MEM_BASE) {
113 printk(KERN_DEBUG
114 "Disabling mapping to PCI mem addr 0x%8.8x\n",
115 tmp_addr);
116 out_le32(&pcip->pmm[reg_index].ma, tmp_size & ~1); // *_PMMOMA
117 continue;
118 }
119 tmp_addr = in_le32(&pcip->pmm[reg_index].la); // *_PMMOLA
120 if (tmp_addr < new_pmm_min)
121 new_pmm_min = tmp_addr;
122 tmp_addr = tmp_addr +
123 (0xffffffff - (tmp_size & 0xffffc000));
124 if (tmp_addr > PPC405_PCI_UPPER_MEM) {
125 new_pmm_max = tmp_addr; // PPC405_PCI_UPPER_MEM
126 } else {
127 new_pmm_max = PPC405_PCI_UPPER_MEM;
128 }
129
130 } // for
131
132 iounmap(pcip);
133 }
134
135 hose_a->first_busno = 0;
136 hose_a->last_busno = 0xff;
137 hose_a->pci_mem_offset = 0;
138
139 /* Setup bridge memory/IO ranges & resources
140 * TODO: Handle firmware setting up a legacy ISA mem base
141 */
142 hose_a->io_space.start = PPC405_PCI_LOWER_IO;
143 hose_a->io_space.end = PPC405_PCI_UPPER_IO;
144 hose_a->mem_space.start = new_pmm_min;
145 hose_a->mem_space.end = new_pmm_max;
146 hose_a->io_base_phys = PPC405_PCI_PHY_IO_BASE;
147 hose_a->io_base_virt = ioremap(hose_a->io_base_phys, 0x10000);
148 hose_a->io_resource.start = 0;
149 hose_a->io_resource.end = PPC405_PCI_UPPER_IO - PPC405_PCI_LOWER_IO;
150 hose_a->io_resource.flags = IORESOURCE_IO;
151 hose_a->io_resource.name = "PCI I/O";
152 hose_a->mem_resources[0].start = new_pmm_min;
153 hose_a->mem_resources[0].end = new_pmm_max;
154 hose_a->mem_resources[0].flags = IORESOURCE_MEM;
155 hose_a->mem_resources[0].name = "PCI Memory";
156 isa_io_base = (int) hose_a->io_base_virt;
157 isa_mem_base = 0; /* ISA not implemented */
158 ISA_DMA_THRESHOLD = 0x00ffffff; /* ??? ISA not implemented */
159
160 /* Scan busses & initial setup by pci_auto */
161 hose_a->last_busno = pciauto_bus_scan(hose_a, hose_a->first_busno);
162 hose_a->last_busno = 0;
163
164 /* Setup ppc_md */
165 ppc_md.pcibios_fixup = NULL;
166 ppc_md.pci_exclude_device = ppc4xx_exclude_device;
167 ppc_md.pcibios_fixup_resources = ppc405_pcibios_fixup_resources;
168 ppc_md.pci_swizzle = common_swizzle;
169 ppc_md.pci_map_irq = ppc405_map_irq;
170}
diff --git a/arch/ppc/syslib/ppc440spe_pcie.c b/arch/ppc/syslib/ppc440spe_pcie.c
deleted file mode 100644
index dd5d4b958c31..000000000000
--- a/arch/ppc/syslib/ppc440spe_pcie.c
+++ /dev/null
@@ -1,441 +0,0 @@
1/*
2 * Copyright (c) 2005 Cisco Systems. All rights reserved.
3 * Roland Dreier <rolandd@cisco.com>
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version.
9 */
10
11#include <linux/kernel.h>
12#include <linux/delay.h>
13#include <linux/pci.h>
14#include <linux/init.h>
15
16#include <asm/reg.h>
17#include <asm/io.h>
18#include <asm/ibm44x.h>
19
20#include "ppc440spe_pcie.h"
21
22static int
23pcie_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
24 int len, u32 *val)
25{
26 struct pci_controller *hose = bus->sysdata;
27
28 if (PCI_SLOT(devfn) != 1)
29 return PCIBIOS_DEVICE_NOT_FOUND;
30
31 offset += devfn << 12;
32
33 /*
34 * Note: the caller has already checked that offset is
35 * suitably aligned and that len is 1, 2 or 4.
36 */
37 switch (len) {
38 case 1:
39 *val = in_8(hose->cfg_data + offset);
40 break;
41 case 2:
42 *val = in_le16(hose->cfg_data + offset);
43 break;
44 default:
45 *val = in_le32(hose->cfg_data + offset);
46 break;
47 }
48
49 if (0) printk("%s: read %x(%d) @ %x\n", __func__, *val, len, offset);
50
51 return PCIBIOS_SUCCESSFUL;
52}
53
54static int
55pcie_write_config(struct pci_bus *bus, unsigned int devfn, int offset,
56 int len, u32 val)
57{
58 struct pci_controller *hose = bus->sysdata;
59
60 if (PCI_SLOT(devfn) != 1)
61 return PCIBIOS_DEVICE_NOT_FOUND;
62
63 offset += devfn << 12;
64
65 switch (len) {
66 case 1:
67 out_8(hose->cfg_data + offset, val);
68 break;
69 case 2:
70 out_le16(hose->cfg_data + offset, val);
71 break;
72 default:
73 out_le32(hose->cfg_data + offset, val);
74 break;
75 }
76 return PCIBIOS_SUCCESSFUL;
77}
78
79static struct pci_ops pcie_pci_ops =
80{
81 .read = pcie_read_config,
82 .write = pcie_write_config
83};
84
85enum {
86 PTYPE_ENDPOINT = 0x0,
87 PTYPE_LEGACY_ENDPOINT = 0x1,
88 PTYPE_ROOT_PORT = 0x4,
89
90 LNKW_X1 = 0x1,
91 LNKW_X4 = 0x4,
92 LNKW_X8 = 0x8
93};
94
95static void check_error(void)
96{
97 u32 valPE0, valPE1, valPE2;
98
99 /* SDR0_PEGPLLLCT1 reset */
100 if (!(valPE0 = SDR_READ(PESDR0_PLLLCT1) & 0x01000000)) {
101 printk(KERN_INFO "PCIE: SDR0_PEGPLLLCT1 reset error 0x%8x\n", valPE0);
102 }
103
104 valPE0 = SDR_READ(PESDR0_RCSSET);
105 valPE1 = SDR_READ(PESDR1_RCSSET);
106 valPE2 = SDR_READ(PESDR2_RCSSET);
107
108 /* SDR0_PExRCSSET rstgu */
109 if ( !(valPE0 & 0x01000000) ||
110 !(valPE1 & 0x01000000) ||
111 !(valPE2 & 0x01000000)) {
112 printk(KERN_INFO "PCIE: SDR0_PExRCSSET rstgu error\n");
113 }
114
115 /* SDR0_PExRCSSET rstdl */
116 if ( !(valPE0 & 0x00010000) ||
117 !(valPE1 & 0x00010000) ||
118 !(valPE2 & 0x00010000)) {
119 printk(KERN_INFO "PCIE: SDR0_PExRCSSET rstdl error\n");
120 }
121
122 /* SDR0_PExRCSSET rstpyn */
123 if ( (valPE0 & 0x00001000) ||
124 (valPE1 & 0x00001000) ||
125 (valPE2 & 0x00001000)) {
126 printk(KERN_INFO "PCIE: SDR0_PExRCSSET rstpyn error\n");
127 }
128
129 /* SDR0_PExRCSSET hldplb */
130 if ( (valPE0 & 0x10000000) ||
131 (valPE1 & 0x10000000) ||
132 (valPE2 & 0x10000000)) {
133 printk(KERN_INFO "PCIE: SDR0_PExRCSSET hldplb error\n");
134 }
135
136 /* SDR0_PExRCSSET rdy */
137 if ( (valPE0 & 0x00100000) ||
138 (valPE1 & 0x00100000) ||
139 (valPE2 & 0x00100000)) {
140 printk(KERN_INFO "PCIE: SDR0_PExRCSSET rdy error\n");
141 }
142
143 /* SDR0_PExRCSSET shutdown */
144 if ( (valPE0 & 0x00000100) ||
145 (valPE1 & 0x00000100) ||
146 (valPE2 & 0x00000100)) {
147 printk(KERN_INFO "PCIE: SDR0_PExRCSSET shutdown error\n");
148 }
149}
150
151/*
152 * Initialize PCI Express core as described in User Manual section 27.12.1
153 */
154int ppc440spe_init_pcie(void)
155{
156 /* Set PLL clock receiver to LVPECL */
157 SDR_WRITE(PESDR0_PLLLCT1, SDR_READ(PESDR0_PLLLCT1) | 1 << 28);
158
159 check_error();
160
161 printk(KERN_INFO "PCIE initialization OK\n");
162
163 if (!(SDR_READ(PESDR0_PLLLCT2) & 0x10000))
164 printk(KERN_INFO "PESDR_PLLCT2 resistance calibration failed (0x%08x)\n",
165 SDR_READ(PESDR0_PLLLCT2));
166
167 /* De-assert reset of PCIe PLL, wait for lock */
168 SDR_WRITE(PESDR0_PLLLCT1, SDR_READ(PESDR0_PLLLCT1) & ~(1 << 24));
169 udelay(3);
170
171 return 0;
172}
173
174int ppc440spe_init_pcie_rootport(int port)
175{
176 static int core_init;
177 void __iomem *utl_base;
178 u32 val = 0;
179 int i;
180
181 if (!core_init) {
182 ++core_init;
183 i = ppc440spe_init_pcie();
184 if (i)
185 return i;
186 }
187
188 /*
189 * Initialize various parts of the PCI Express core for our port:
190 *
191 * - Set as a root port and enable max width
192 * (PXIE0 -> X8, PCIE1 and PCIE2 -> X4).
193 * - Set up UTL configuration.
194 * - Increase SERDES drive strength to levels suggested by AMCC.
195 * - De-assert RSTPYN, RSTDL and RSTGU.
196 */
197 switch (port) {
198 case 0:
199 SDR_WRITE(PESDR0_DLPSET, PTYPE_ROOT_PORT << 20 | LNKW_X8 << 12);
200
201 SDR_WRITE(PESDR0_UTLSET1, 0x21222222);
202 SDR_WRITE(PESDR0_UTLSET2, 0x11000000);
203
204 SDR_WRITE(PESDR0_HSSL0SET1, 0x35000000);
205 SDR_WRITE(PESDR0_HSSL1SET1, 0x35000000);
206 SDR_WRITE(PESDR0_HSSL2SET1, 0x35000000);
207 SDR_WRITE(PESDR0_HSSL3SET1, 0x35000000);
208 SDR_WRITE(PESDR0_HSSL4SET1, 0x35000000);
209 SDR_WRITE(PESDR0_HSSL5SET1, 0x35000000);
210 SDR_WRITE(PESDR0_HSSL6SET1, 0x35000000);
211 SDR_WRITE(PESDR0_HSSL7SET1, 0x35000000);
212
213 SDR_WRITE(PESDR0_RCSSET,
214 (SDR_READ(PESDR0_RCSSET) & ~(1 << 24 | 1 << 16)) | 1 << 12);
215 break;
216
217 case 1:
218 SDR_WRITE(PESDR1_DLPSET, PTYPE_ROOT_PORT << 20 | LNKW_X4 << 12);
219
220 SDR_WRITE(PESDR1_UTLSET1, 0x21222222);
221 SDR_WRITE(PESDR1_UTLSET2, 0x11000000);
222
223 SDR_WRITE(PESDR1_HSSL0SET1, 0x35000000);
224 SDR_WRITE(PESDR1_HSSL1SET1, 0x35000000);
225 SDR_WRITE(PESDR1_HSSL2SET1, 0x35000000);
226 SDR_WRITE(PESDR1_HSSL3SET1, 0x35000000);
227
228 SDR_WRITE(PESDR1_RCSSET,
229 (SDR_READ(PESDR1_RCSSET) & ~(1 << 24 | 1 << 16)) | 1 << 12);
230 break;
231
232 case 2:
233 SDR_WRITE(PESDR2_DLPSET, PTYPE_ROOT_PORT << 20 | LNKW_X4 << 12);
234
235 SDR_WRITE(PESDR2_UTLSET1, 0x21222222);
236 SDR_WRITE(PESDR2_UTLSET2, 0x11000000);
237
238 SDR_WRITE(PESDR2_HSSL0SET1, 0x35000000);
239 SDR_WRITE(PESDR2_HSSL1SET1, 0x35000000);
240 SDR_WRITE(PESDR2_HSSL2SET1, 0x35000000);
241 SDR_WRITE(PESDR2_HSSL3SET1, 0x35000000);
242
243 SDR_WRITE(PESDR2_RCSSET,
244 (SDR_READ(PESDR2_RCSSET) & ~(1 << 24 | 1 << 16)) | 1 << 12);
245 break;
246 }
247
248 mdelay(1000);
249
250 switch (port) {
251 case 0: val = SDR_READ(PESDR0_RCSSTS); break;
252 case 1: val = SDR_READ(PESDR1_RCSSTS); break;
253 case 2: val = SDR_READ(PESDR2_RCSSTS); break;
254 }
255
256 if (!(val & (1 << 20)))
257 printk(KERN_INFO "PCIE%d: PGRST inactive\n", port);
258 else
259 printk(KERN_WARNING "PGRST for PCIE%d failed %08x\n", port, val);
260
261 switch (port) {
262 case 0: printk(KERN_INFO "PCIE0: LOOP %08x\n", SDR_READ(PESDR0_LOOP)); break;
263 case 1: printk(KERN_INFO "PCIE1: LOOP %08x\n", SDR_READ(PESDR1_LOOP)); break;
264 case 2: printk(KERN_INFO "PCIE2: LOOP %08x\n", SDR_READ(PESDR2_LOOP)); break;
265 }
266
267 /*
268 * Map UTL registers at 0xc_1000_0n00
269 */
270 switch (port) {
271 case 0:
272 mtdcr(DCRN_PEGPL_REGBAH(PCIE0), 0x0000000c);
273 mtdcr(DCRN_PEGPL_REGBAL(PCIE0), 0x10000000);
274 mtdcr(DCRN_PEGPL_REGMSK(PCIE0), 0x00007001);
275 mtdcr(DCRN_PEGPL_SPECIAL(PCIE0), 0x68782800);
276 break;
277
278 case 1:
279 mtdcr(DCRN_PEGPL_REGBAH(PCIE1), 0x0000000c);
280 mtdcr(DCRN_PEGPL_REGBAL(PCIE1), 0x10001000);
281 mtdcr(DCRN_PEGPL_REGMSK(PCIE1), 0x00007001);
282 mtdcr(DCRN_PEGPL_SPECIAL(PCIE1), 0x68782800);
283 break;
284
285 case 2:
286 mtdcr(DCRN_PEGPL_REGBAH(PCIE2), 0x0000000c);
287 mtdcr(DCRN_PEGPL_REGBAL(PCIE2), 0x10002000);
288 mtdcr(DCRN_PEGPL_REGMSK(PCIE2), 0x00007001);
289 mtdcr(DCRN_PEGPL_SPECIAL(PCIE2), 0x68782800);
290 }
291
292 utl_base = ioremap64(0xc10000000ull + 0x1000 * port, 0x100);
293
294 /*
295 * Set buffer allocations and then assert VRB and TXE.
296 */
297 out_be32(utl_base + PEUTL_OUTTR, 0x08000000);
298 out_be32(utl_base + PEUTL_INTR, 0x02000000);
299 out_be32(utl_base + PEUTL_OPDBSZ, 0x10000000);
300 out_be32(utl_base + PEUTL_PBBSZ, 0x53000000);
301 out_be32(utl_base + PEUTL_IPHBSZ, 0x08000000);
302 out_be32(utl_base + PEUTL_IPDBSZ, 0x10000000);
303 out_be32(utl_base + PEUTL_RCIRQEN, 0x00f00000);
304 out_be32(utl_base + PEUTL_PCTL, 0x80800066);
305
306 iounmap(utl_base);
307
308 /*
309 * We map PCI Express configuration access into the 512MB regions
310 * PCIE0: 0xc_4000_0000
311 * PCIE1: 0xc_8000_0000
312 * PCIE2: 0xc_c000_0000
313 */
314 switch (port) {
315 case 0:
316 mtdcr(DCRN_PEGPL_CFGBAH(PCIE0), 0x0000000c);
317 mtdcr(DCRN_PEGPL_CFGBAL(PCIE0), 0x40000000);
318 mtdcr(DCRN_PEGPL_CFGMSK(PCIE0), 0xe0000001); /* 512MB region, valid */
319 break;
320
321 case 1:
322 mtdcr(DCRN_PEGPL_CFGBAH(PCIE1), 0x0000000c);
323 mtdcr(DCRN_PEGPL_CFGBAL(PCIE1), 0x80000000);
324 mtdcr(DCRN_PEGPL_CFGMSK(PCIE1), 0xe0000001); /* 512MB region, valid */
325 break;
326
327 case 2:
328 mtdcr(DCRN_PEGPL_CFGBAH(PCIE2), 0x0000000c);
329 mtdcr(DCRN_PEGPL_CFGBAL(PCIE2), 0xc0000000);
330 mtdcr(DCRN_PEGPL_CFGMSK(PCIE2), 0xe0000001); /* 512MB region, valid */
331 break;
332 }
333
334 /*
335 * Check for VC0 active and assert RDY.
336 */
337 switch (port) {
338 case 0:
339 if (!(SDR_READ(PESDR0_RCSSTS) & (1 << 16)))
340 printk(KERN_WARNING "PCIE0: VC0 not active\n");
341 SDR_WRITE(PESDR0_RCSSET, SDR_READ(PESDR0_RCSSET) | 1 << 20);
342 break;
343 case 1:
344 if (!(SDR_READ(PESDR1_RCSSTS) & (1 << 16)))
345 printk(KERN_WARNING "PCIE0: VC0 not active\n");
346 SDR_WRITE(PESDR1_RCSSET, SDR_READ(PESDR1_RCSSET) | 1 << 20);
347 break;
348 case 2:
349 if (!(SDR_READ(PESDR2_RCSSTS) & (1 << 16)))
350 printk(KERN_WARNING "PCIE0: VC0 not active\n");
351 SDR_WRITE(PESDR2_RCSSET, SDR_READ(PESDR2_RCSSET) | 1 << 20);
352 break;
353 }
354
355#if 0
356 /* Dump all config regs */
357 for (i = 0x300; i <= 0x320; ++i)
358 printk("[%04x] 0x%08x\n", i, SDR_READ(i));
359 for (i = 0x340; i <= 0x353; ++i)
360 printk("[%04x] 0x%08x\n", i, SDR_READ(i));
361 for (i = 0x370; i <= 0x383; ++i)
362 printk("[%04x] 0x%08x\n", i, SDR_READ(i));
363 for (i = 0x3a0; i <= 0x3a2; ++i)
364 printk("[%04x] 0x%08x\n", i, SDR_READ(i));
365 for (i = 0x3c0; i <= 0x3c3; ++i)
366 printk("[%04x] 0x%08x\n", i, SDR_READ(i));
367#endif
368
369 mdelay(100);
370
371 return 0;
372}
373
374void ppc440spe_setup_pcie(struct pci_controller *hose, int port)
375{
376 void __iomem *mbase;
377
378 /*
379 * Map 16MB, which is enough for 4 bits of bus #
380 */
381 hose->cfg_data = ioremap64(0xc40000000ull + port * 0x40000000,
382 1 << 24);
383 hose->ops = &pcie_pci_ops;
384
385 /*
386 * Set bus numbers on our root port
387 */
388 mbase = ioremap64(0xc50000000ull + port * 0x40000000, 4096);
389 out_8(mbase + PCI_PRIMARY_BUS, 0);
390 out_8(mbase + PCI_SECONDARY_BUS, 0);
391
392 /*
393 * Set up outbound translation to hose->mem_space from PLB
394 * addresses at an offset of 0xd_0000_0000. We set the low
395 * bits of the mask to 11 to turn off splitting into 8
396 * subregions and to enable the outbound translation.
397 */
398 out_le32(mbase + PECFG_POM0LAH, 0);
399 out_le32(mbase + PECFG_POM0LAL, hose->mem_space.start);
400
401 switch (port) {
402 case 0:
403 mtdcr(DCRN_PEGPL_OMR1BAH(PCIE0), 0x0000000d);
404 mtdcr(DCRN_PEGPL_OMR1BAL(PCIE0), hose->mem_space.start);
405 mtdcr(DCRN_PEGPL_OMR1MSKH(PCIE0), 0x7fffffff);
406 mtdcr(DCRN_PEGPL_OMR1MSKL(PCIE0),
407 ~(hose->mem_space.end - hose->mem_space.start) | 3);
408 break;
409 case 1:
410 mtdcr(DCRN_PEGPL_OMR1BAH(PCIE1), 0x0000000d);
411 mtdcr(DCRN_PEGPL_OMR1BAL(PCIE1), hose->mem_space.start);
412 mtdcr(DCRN_PEGPL_OMR1MSKH(PCIE1), 0x7fffffff);
413 mtdcr(DCRN_PEGPL_OMR1MSKL(PCIE1),
414 ~(hose->mem_space.end - hose->mem_space.start) | 3);
415
416 break;
417 case 2:
418 mtdcr(DCRN_PEGPL_OMR1BAH(PCIE2), 0x0000000d);
419 mtdcr(DCRN_PEGPL_OMR1BAL(PCIE2), hose->mem_space.start);
420 mtdcr(DCRN_PEGPL_OMR1MSKH(PCIE2), 0x7fffffff);
421 mtdcr(DCRN_PEGPL_OMR1MSKL(PCIE2),
422 ~(hose->mem_space.end - hose->mem_space.start) | 3);
423 break;
424 }
425
426 /* Set up 16GB inbound memory window at 0 */
427 out_le32(mbase + PCI_BASE_ADDRESS_0, 0);
428 out_le32(mbase + PCI_BASE_ADDRESS_1, 0);
429 out_le32(mbase + PECFG_BAR0HMPA, 0x7fffffc);
430 out_le32(mbase + PECFG_BAR0LMPA, 0);
431 out_le32(mbase + PECFG_PIM0LAL, 0);
432 out_le32(mbase + PECFG_PIM0LAH, 0);
433 out_le32(mbase + PECFG_PIMEN, 0x1);
434
435 /* Enable I/O, Mem, and Busmaster cycles */
436 out_le16(mbase + PCI_COMMAND,
437 in_le16(mbase + PCI_COMMAND) |
438 PCI_COMMAND_IO | PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER);
439
440 iounmap(mbase);
441}
diff --git a/arch/ppc/syslib/ppc440spe_pcie.h b/arch/ppc/syslib/ppc440spe_pcie.h
deleted file mode 100644
index 55b765ad3272..000000000000
--- a/arch/ppc/syslib/ppc440spe_pcie.h
+++ /dev/null
@@ -1,149 +0,0 @@
1/*
2 * Copyright (c) 2005 Cisco Systems. All rights reserved.
3 * Roland Dreier <rolandd@cisco.com>
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version.
9 */
10
11#ifndef __PPC_SYSLIB_PPC440SPE_PCIE_H
12#define __PPC_SYSLIB_PPC440SPE_PCIE_H
13
14#define DCRN_SDR0_CFGADDR 0x00e
15#define DCRN_SDR0_CFGDATA 0x00f
16
17#define DCRN_PCIE0_BASE 0x100
18#define DCRN_PCIE1_BASE 0x120
19#define DCRN_PCIE2_BASE 0x140
20#define PCIE0 DCRN_PCIE0_BASE
21#define PCIE1 DCRN_PCIE1_BASE
22#define PCIE2 DCRN_PCIE2_BASE
23
24#define DCRN_PEGPL_CFGBAH(base) (base + 0x00)
25#define DCRN_PEGPL_CFGBAL(base) (base + 0x01)
26#define DCRN_PEGPL_CFGMSK(base) (base + 0x02)
27#define DCRN_PEGPL_MSGBAH(base) (base + 0x03)
28#define DCRN_PEGPL_MSGBAL(base) (base + 0x04)
29#define DCRN_PEGPL_MSGMSK(base) (base + 0x05)
30#define DCRN_PEGPL_OMR1BAH(base) (base + 0x06)
31#define DCRN_PEGPL_OMR1BAL(base) (base + 0x07)
32#define DCRN_PEGPL_OMR1MSKH(base) (base + 0x08)
33#define DCRN_PEGPL_OMR1MSKL(base) (base + 0x09)
34#define DCRN_PEGPL_REGBAH(base) (base + 0x12)
35#define DCRN_PEGPL_REGBAL(base) (base + 0x13)
36#define DCRN_PEGPL_REGMSK(base) (base + 0x14)
37#define DCRN_PEGPL_SPECIAL(base) (base + 0x15)
38
39/*
40 * System DCRs (SDRs)
41 */
42#define PESDR0_PLLLCT1 0x03a0
43#define PESDR0_PLLLCT2 0x03a1
44#define PESDR0_PLLLCT3 0x03a2
45
46#define PESDR0_UTLSET1 0x0300
47#define PESDR0_UTLSET2 0x0301
48#define PESDR0_DLPSET 0x0302
49#define PESDR0_LOOP 0x0303
50#define PESDR0_RCSSET 0x0304
51#define PESDR0_RCSSTS 0x0305
52#define PESDR0_HSSL0SET1 0x0306
53#define PESDR0_HSSL0SET2 0x0307
54#define PESDR0_HSSL0STS 0x0308
55#define PESDR0_HSSL1SET1 0x0309
56#define PESDR0_HSSL1SET2 0x030a
57#define PESDR0_HSSL1STS 0x030b
58#define PESDR0_HSSL2SET1 0x030c
59#define PESDR0_HSSL2SET2 0x030d
60#define PESDR0_HSSL2STS 0x030e
61#define PESDR0_HSSL3SET1 0x030f
62#define PESDR0_HSSL3SET2 0x0310
63#define PESDR0_HSSL3STS 0x0311
64#define PESDR0_HSSL4SET1 0x0312
65#define PESDR0_HSSL4SET2 0x0313
66#define PESDR0_HSSL4STS 0x0314
67#define PESDR0_HSSL5SET1 0x0315
68#define PESDR0_HSSL5SET2 0x0316
69#define PESDR0_HSSL5STS 0x0317
70#define PESDR0_HSSL6SET1 0x0318
71#define PESDR0_HSSL6SET2 0x0319
72#define PESDR0_HSSL6STS 0x031a
73#define PESDR0_HSSL7SET1 0x031b
74#define PESDR0_HSSL7SET2 0x031c
75#define PESDR0_HSSL7STS 0x031d
76#define PESDR0_HSSCTLSET 0x031e
77#define PESDR0_LANE_ABCD 0x031f
78#define PESDR0_LANE_EFGH 0x0320
79
80#define PESDR1_UTLSET1 0x0340
81#define PESDR1_UTLSET2 0x0341
82#define PESDR1_DLPSET 0x0342
83#define PESDR1_LOOP 0x0343
84#define PESDR1_RCSSET 0x0344
85#define PESDR1_RCSSTS 0x0345
86#define PESDR1_HSSL0SET1 0x0346
87#define PESDR1_HSSL0SET2 0x0347
88#define PESDR1_HSSL0STS 0x0348
89#define PESDR1_HSSL1SET1 0x0349
90#define PESDR1_HSSL1SET2 0x034a
91#define PESDR1_HSSL1STS 0x034b
92#define PESDR1_HSSL2SET1 0x034c
93#define PESDR1_HSSL2SET2 0x034d
94#define PESDR1_HSSL2STS 0x034e
95#define PESDR1_HSSL3SET1 0x034f
96#define PESDR1_HSSL3SET2 0x0350
97#define PESDR1_HSSL3STS 0x0351
98#define PESDR1_HSSCTLSET 0x0352
99#define PESDR1_LANE_ABCD 0x0353
100
101#define PESDR2_UTLSET1 0x0370
102#define PESDR2_UTLSET2 0x0371
103#define PESDR2_DLPSET 0x0372
104#define PESDR2_LOOP 0x0373
105#define PESDR2_RCSSET 0x0374
106#define PESDR2_RCSSTS 0x0375
107#define PESDR2_HSSL0SET1 0x0376
108#define PESDR2_HSSL0SET2 0x0377
109#define PESDR2_HSSL0STS 0x0378
110#define PESDR2_HSSL1SET1 0x0379
111#define PESDR2_HSSL1SET2 0x037a
112#define PESDR2_HSSL1STS 0x037b
113#define PESDR2_HSSL2SET1 0x037c
114#define PESDR2_HSSL2SET2 0x037d
115#define PESDR2_HSSL2STS 0x037e
116#define PESDR2_HSSL3SET1 0x037f
117#define PESDR2_HSSL3SET2 0x0380
118#define PESDR2_HSSL3STS 0x0381
119#define PESDR2_HSSCTLSET 0x0382
120#define PESDR2_LANE_ABCD 0x0383
121
122/*
123 * UTL register offsets
124 */
125#define PEUTL_PBBSZ 0x20
126#define PEUTL_OPDBSZ 0x68
127#define PEUTL_IPHBSZ 0x70
128#define PEUTL_IPDBSZ 0x78
129#define PEUTL_OUTTR 0x90
130#define PEUTL_INTR 0x98
131#define PEUTL_PCTL 0xa0
132#define PEUTL_RCIRQEN 0xb8
133
134/*
135 * Config space register offsets
136 */
137#define PECFG_BAR0LMPA 0x210
138#define PECFG_BAR0HMPA 0x214
139#define PECFG_PIMEN 0x33c
140#define PECFG_PIM0LAL 0x340
141#define PECFG_PIM0LAH 0x344
142#define PECFG_POM0LAL 0x380
143#define PECFG_POM0LAH 0x384
144
145int ppc440spe_init_pcie(void);
146int ppc440spe_init_pcie_rootport(int port);
147void ppc440spe_setup_pcie(struct pci_controller *hose, int port);
148
149#endif /* __PPC_SYSLIB_PPC440SPE_PCIE_H */
diff --git a/arch/ppc/syslib/ppc4xx_dma.c b/arch/ppc/syslib/ppc4xx_dma.c
deleted file mode 100644
index bd301868996b..000000000000
--- a/arch/ppc/syslib/ppc4xx_dma.c
+++ /dev/null
@@ -1,710 +0,0 @@
1/*
2 * IBM PPC4xx DMA engine core library
3 *
4 * Copyright 2000-2004 MontaVista Software Inc.
5 *
6 * Cleaned up and converted to new DCR access
7 * Matt Porter <mporter@kernel.crashing.org>
8 *
9 * Original code by Armin Kuster <akuster@mvista.com>
10 * and Pete Popov <ppopov@mvista.com>
11 *
12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by the
14 * Free Software Foundation; either version 2 of the License, or (at your
15 * option) any later version.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 675 Mass Ave, Cambridge, MA 02139, USA.
20 */
21
22#include <linux/kernel.h>
23#include <linux/mm.h>
24#include <linux/miscdevice.h>
25#include <linux/init.h>
26#include <linux/module.h>
27
28#include <asm/system.h>
29#include <asm/io.h>
30#include <asm/dma.h>
31#include <asm/ppc4xx_dma.h>
32
33ppc_dma_ch_t dma_channels[MAX_PPC4xx_DMA_CHANNELS];
34
35int
36ppc4xx_get_dma_status(void)
37{
38 return (mfdcr(DCRN_DMASR));
39}
40
41void
42ppc4xx_set_src_addr(int dmanr, phys_addr_t src_addr)
43{
44 if (dmanr >= MAX_PPC4xx_DMA_CHANNELS) {
45 printk("set_src_addr: bad channel: %d\n", dmanr);
46 return;
47 }
48
49#ifdef PPC4xx_DMA_64BIT
50 mtdcr(DCRN_DMASAH0 + dmanr*2, (u32)(src_addr >> 32));
51#else
52 mtdcr(DCRN_DMASA0 + dmanr*2, (u32)src_addr);
53#endif
54}
55
56void
57ppc4xx_set_dst_addr(int dmanr, phys_addr_t dst_addr)
58{
59 if (dmanr >= MAX_PPC4xx_DMA_CHANNELS) {
60 printk("set_dst_addr: bad channel: %d\n", dmanr);
61 return;
62 }
63
64#ifdef PPC4xx_DMA_64BIT
65 mtdcr(DCRN_DMADAH0 + dmanr*2, (u32)(dst_addr >> 32));
66#else
67 mtdcr(DCRN_DMADA0 + dmanr*2, (u32)dst_addr);
68#endif
69}
70
71void
72ppc4xx_enable_dma(unsigned int dmanr)
73{
74 unsigned int control;
75 ppc_dma_ch_t *p_dma_ch = &dma_channels[dmanr];
76 unsigned int status_bits[] = { DMA_CS0 | DMA_TS0 | DMA_CH0_ERR,
77 DMA_CS1 | DMA_TS1 | DMA_CH1_ERR,
78 DMA_CS2 | DMA_TS2 | DMA_CH2_ERR,
79 DMA_CS3 | DMA_TS3 | DMA_CH3_ERR};
80
81 if (p_dma_ch->in_use) {
82 printk("enable_dma: channel %d in use\n", dmanr);
83 return;
84 }
85
86 if (dmanr >= MAX_PPC4xx_DMA_CHANNELS) {
87 printk("enable_dma: bad channel: %d\n", dmanr);
88 return;
89 }
90
91 if (p_dma_ch->mode == DMA_MODE_READ) {
92 /* peripheral to memory */
93 ppc4xx_set_src_addr(dmanr, 0);
94 ppc4xx_set_dst_addr(dmanr, p_dma_ch->addr);
95 } else if (p_dma_ch->mode == DMA_MODE_WRITE) {
96 /* memory to peripheral */
97 ppc4xx_set_src_addr(dmanr, p_dma_ch->addr);
98 ppc4xx_set_dst_addr(dmanr, 0);
99 }
100
101 /* for other xfer modes, the addresses are already set */
102 control = mfdcr(DCRN_DMACR0 + (dmanr * 0x8));
103
104 control &= ~(DMA_TM_MASK | DMA_TD); /* clear all mode bits */
105 if (p_dma_ch->mode == DMA_MODE_MM) {
106 /* software initiated memory to memory */
107 control |= DMA_ETD_OUTPUT | DMA_TCE_ENABLE;
108 }
109
110 mtdcr(DCRN_DMACR0 + (dmanr * 0x8), control);
111
112 /*
113 * Clear the CS, TS, RI bits for the channel from DMASR. This
114 * has been observed to happen correctly only after the mode and
115 * ETD/DCE bits in DMACRx are set above. Must do this before
116 * enabling the channel.
117 */
118
119 mtdcr(DCRN_DMASR, status_bits[dmanr]);
120
121 /*
122 * For device-paced transfers, Terminal Count Enable apparently
123 * must be on, and this must be turned on after the mode, etc.
124 * bits are cleared above (at least on Redwood-6).
125 */
126
127 if ((p_dma_ch->mode == DMA_MODE_MM_DEVATDST) ||
128 (p_dma_ch->mode == DMA_MODE_MM_DEVATSRC))
129 control |= DMA_TCE_ENABLE;
130
131 /*
132 * Now enable the channel.
133 */
134
135 control |= (p_dma_ch->mode | DMA_CE_ENABLE);
136
137 mtdcr(DCRN_DMACR0 + (dmanr * 0x8), control);
138
139 p_dma_ch->in_use = 1;
140}
141
142void
143ppc4xx_disable_dma(unsigned int dmanr)
144{
145 unsigned int control;
146 ppc_dma_ch_t *p_dma_ch = &dma_channels[dmanr];
147
148 if (!p_dma_ch->in_use) {
149 printk("disable_dma: channel %d not in use\n", dmanr);
150 return;
151 }
152
153 if (dmanr >= MAX_PPC4xx_DMA_CHANNELS) {
154 printk("disable_dma: bad channel: %d\n", dmanr);
155 return;
156 }
157
158 control = mfdcr(DCRN_DMACR0 + (dmanr * 0x8));
159 control &= ~DMA_CE_ENABLE;
160 mtdcr(DCRN_DMACR0 + (dmanr * 0x8), control);
161
162 p_dma_ch->in_use = 0;
163}
164
165/*
166 * Sets the dma mode for single DMA transfers only.
167 * For scatter/gather transfers, the mode is passed to the
168 * alloc_dma_handle() function as one of the parameters.
169 *
170 * The mode is simply saved and used later. This allows
171 * the driver to call set_dma_mode() and set_dma_addr() in
172 * any order.
173 *
174 * Valid mode values are:
175 *
176 * DMA_MODE_READ peripheral to memory
177 * DMA_MODE_WRITE memory to peripheral
178 * DMA_MODE_MM memory to memory
179 * DMA_MODE_MM_DEVATSRC device-paced memory to memory, device at src
180 * DMA_MODE_MM_DEVATDST device-paced memory to memory, device at dst
181 */
182int
183ppc4xx_set_dma_mode(unsigned int dmanr, unsigned int mode)
184{
185 ppc_dma_ch_t *p_dma_ch = &dma_channels[dmanr];
186
187 if (dmanr >= MAX_PPC4xx_DMA_CHANNELS) {
188 printk("set_dma_mode: bad channel 0x%x\n", dmanr);
189 return DMA_STATUS_BAD_CHANNEL;
190 }
191
192 p_dma_ch->mode = mode;
193
194 return DMA_STATUS_GOOD;
195}
196
197/*
198 * Sets the DMA Count register. Note that 'count' is in bytes.
199 * However, the DMA Count register counts the number of "transfers",
200 * where each transfer is equal to the bus width. Thus, count
201 * MUST be a multiple of the bus width.
202 */
203void
204ppc4xx_set_dma_count(unsigned int dmanr, unsigned int count)
205{
206 ppc_dma_ch_t *p_dma_ch = &dma_channels[dmanr];
207
208#ifdef DEBUG_4xxDMA
209 {
210 int error = 0;
211 switch (p_dma_ch->pwidth) {
212 case PW_8:
213 break;
214 case PW_16:
215 if (count & 0x1)
216 error = 1;
217 break;
218 case PW_32:
219 if (count & 0x3)
220 error = 1;
221 break;
222 case PW_64:
223 if (count & 0x7)
224 error = 1;
225 break;
226 default:
227 printk("set_dma_count: invalid bus width: 0x%x\n",
228 p_dma_ch->pwidth);
229 return;
230 }
231 if (error)
232 printk
233 ("Warning: set_dma_count count 0x%x bus width %d\n",
234 count, p_dma_ch->pwidth);
235 }
236#endif
237
238 count = count >> p_dma_ch->shift;
239
240 mtdcr(DCRN_DMACT0 + (dmanr * 0x8), count);
241}
242
243/*
244 * Returns the number of bytes left to be transferred.
245 * After a DMA transfer, this should return zero.
246 * Reading this while a DMA transfer is still in progress will return
247 * unpredictable results.
248 */
249int
250ppc4xx_get_dma_residue(unsigned int dmanr)
251{
252 unsigned int count;
253 ppc_dma_ch_t *p_dma_ch = &dma_channels[dmanr];
254
255 if (dmanr >= MAX_PPC4xx_DMA_CHANNELS) {
256 printk("ppc4xx_get_dma_residue: bad channel 0x%x\n", dmanr);
257 return DMA_STATUS_BAD_CHANNEL;
258 }
259
260 count = mfdcr(DCRN_DMACT0 + (dmanr * 0x8));
261
262 return (count << p_dma_ch->shift);
263}
264
265/*
266 * Sets the DMA address for a memory to peripheral or peripheral
267 * to memory transfer. The address is just saved in the channel
268 * structure for now and used later in enable_dma().
269 */
270void
271ppc4xx_set_dma_addr(unsigned int dmanr, phys_addr_t addr)
272{
273 ppc_dma_ch_t *p_dma_ch = &dma_channels[dmanr];
274
275 if (dmanr >= MAX_PPC4xx_DMA_CHANNELS) {
276 printk("ppc4xx_set_dma_addr: bad channel: %d\n", dmanr);
277 return;
278 }
279
280#ifdef DEBUG_4xxDMA
281 {
282 int error = 0;
283 switch (p_dma_ch->pwidth) {
284 case PW_8:
285 break;
286 case PW_16:
287 if ((unsigned) addr & 0x1)
288 error = 1;
289 break;
290 case PW_32:
291 if ((unsigned) addr & 0x3)
292 error = 1;
293 break;
294 case PW_64:
295 if ((unsigned) addr & 0x7)
296 error = 1;
297 break;
298 default:
299 printk("ppc4xx_set_dma_addr: invalid bus width: 0x%x\n",
300 p_dma_ch->pwidth);
301 return;
302 }
303 if (error)
304 printk("Warning: ppc4xx_set_dma_addr addr 0x%x bus width %d\n",
305 addr, p_dma_ch->pwidth);
306 }
307#endif
308
309 /* save dma address and program it later after we know the xfer mode */
310 p_dma_ch->addr = addr;
311}
312
313/*
314 * Sets both DMA addresses for a memory to memory transfer.
315 * For memory to peripheral or peripheral to memory transfers
316 * the function set_dma_addr() should be used instead.
317 */
318void
319ppc4xx_set_dma_addr2(unsigned int dmanr, phys_addr_t src_dma_addr,
320 phys_addr_t dst_dma_addr)
321{
322 if (dmanr >= MAX_PPC4xx_DMA_CHANNELS) {
323 printk("ppc4xx_set_dma_addr2: bad channel: %d\n", dmanr);
324 return;
325 }
326
327#ifdef DEBUG_4xxDMA
328 {
329 ppc_dma_ch_t *p_dma_ch = &dma_channels[dmanr];
330 int error = 0;
331 switch (p_dma_ch->pwidth) {
332 case PW_8:
333 break;
334 case PW_16:
335 if (((unsigned) src_dma_addr & 0x1) ||
336 ((unsigned) dst_dma_addr & 0x1)
337 )
338 error = 1;
339 break;
340 case PW_32:
341 if (((unsigned) src_dma_addr & 0x3) ||
342 ((unsigned) dst_dma_addr & 0x3)
343 )
344 error = 1;
345 break;
346 case PW_64:
347 if (((unsigned) src_dma_addr & 0x7) ||
348 ((unsigned) dst_dma_addr & 0x7)
349 )
350 error = 1;
351 break;
352 default:
353 printk("ppc4xx_set_dma_addr2: invalid bus width: 0x%x\n",
354 p_dma_ch->pwidth);
355 return;
356 }
357 if (error)
358 printk
359 ("Warning: ppc4xx_set_dma_addr2 src 0x%x dst 0x%x bus width %d\n",
360 src_dma_addr, dst_dma_addr, p_dma_ch->pwidth);
361 }
362#endif
363
364 ppc4xx_set_src_addr(dmanr, src_dma_addr);
365 ppc4xx_set_dst_addr(dmanr, dst_dma_addr);
366}
367
368/*
369 * Enables the channel interrupt.
370 *
371 * If performing a scatter/gatter transfer, this function
372 * MUST be called before calling alloc_dma_handle() and building
373 * the sgl list. Otherwise, interrupts will not be enabled, if
374 * they were previously disabled.
375 */
376int
377ppc4xx_enable_dma_interrupt(unsigned int dmanr)
378{
379 unsigned int control;
380 ppc_dma_ch_t *p_dma_ch = &dma_channels[dmanr];
381
382 if (dmanr >= MAX_PPC4xx_DMA_CHANNELS) {
383 printk("ppc4xx_enable_dma_interrupt: bad channel: %d\n", dmanr);
384 return DMA_STATUS_BAD_CHANNEL;
385 }
386
387 p_dma_ch->int_enable = 1;
388
389 control = mfdcr(DCRN_DMACR0 + (dmanr * 0x8));
390 control |= DMA_CIE_ENABLE; /* Channel Interrupt Enable */
391 mtdcr(DCRN_DMACR0 + (dmanr * 0x8), control);
392
393 return DMA_STATUS_GOOD;
394}
395
396/*
397 * Disables the channel interrupt.
398 *
399 * If performing a scatter/gatter transfer, this function
400 * MUST be called before calling alloc_dma_handle() and building
401 * the sgl list. Otherwise, interrupts will not be disabled, if
402 * they were previously enabled.
403 */
404int
405ppc4xx_disable_dma_interrupt(unsigned int dmanr)
406{
407 unsigned int control;
408 ppc_dma_ch_t *p_dma_ch = &dma_channels[dmanr];
409
410 if (dmanr >= MAX_PPC4xx_DMA_CHANNELS) {
411 printk("ppc4xx_disable_dma_interrupt: bad channel: %d\n", dmanr);
412 return DMA_STATUS_BAD_CHANNEL;
413 }
414
415 p_dma_ch->int_enable = 0;
416
417 control = mfdcr(DCRN_DMACR0 + (dmanr * 0x8));
418 control &= ~DMA_CIE_ENABLE; /* Channel Interrupt Enable */
419 mtdcr(DCRN_DMACR0 + (dmanr * 0x8), control);
420
421 return DMA_STATUS_GOOD;
422}
423
424/*
425 * Configures a DMA channel, including the peripheral bus width, if a
426 * peripheral is attached to the channel, the polarity of the DMAReq and
427 * DMAAck signals, etc. This information should really be setup by the boot
428 * code, since most likely the configuration won't change dynamically.
429 * If the kernel has to call this function, it's recommended that it's
430 * called from platform specific init code. The driver should not need to
431 * call this function.
432 */
433int
434ppc4xx_init_dma_channel(unsigned int dmanr, ppc_dma_ch_t * p_init)
435{
436 unsigned int polarity;
437 uint32_t control = 0;
438 ppc_dma_ch_t *p_dma_ch = &dma_channels[dmanr];
439
440 DMA_MODE_READ = (unsigned long) DMA_TD; /* Peripheral to Memory */
441 DMA_MODE_WRITE = 0; /* Memory to Peripheral */
442
443 if (!p_init) {
444 printk("ppc4xx_init_dma_channel: NULL p_init\n");
445 return DMA_STATUS_NULL_POINTER;
446 }
447
448 if (dmanr >= MAX_PPC4xx_DMA_CHANNELS) {
449 printk("ppc4xx_init_dma_channel: bad channel %d\n", dmanr);
450 return DMA_STATUS_BAD_CHANNEL;
451 }
452
453#if DCRN_POL > 0
454 polarity = mfdcr(DCRN_POL);
455#else
456 polarity = 0;
457#endif
458
459 /* Setup the control register based on the values passed to
460 * us in p_init. Then, over-write the control register with this
461 * new value.
462 */
463 control |= SET_DMA_CONTROL;
464
465 /* clear all polarity signals and then "or" in new signal levels */
466 polarity &= ~GET_DMA_POLARITY(dmanr);
467 polarity |= p_init->polarity;
468#if DCRN_POL > 0
469 mtdcr(DCRN_POL, polarity);
470#endif
471 mtdcr(DCRN_DMACR0 + (dmanr * 0x8), control);
472
473 /* save these values in our dma channel structure */
474 memcpy(p_dma_ch, p_init, sizeof (ppc_dma_ch_t));
475
476 /*
477 * The peripheral width values written in the control register are:
478 * PW_8 0
479 * PW_16 1
480 * PW_32 2
481 * PW_64 3
482 *
483 * Since the DMA count register takes the number of "transfers",
484 * we need to divide the count sent to us in certain
485 * functions by the appropriate number. It so happens that our
486 * right shift value is equal to the peripheral width value.
487 */
488 p_dma_ch->shift = p_init->pwidth;
489
490 /*
491 * Save the control word for easy access.
492 */
493 p_dma_ch->control = control;
494
495 mtdcr(DCRN_DMASR, 0xffffffff); /* clear status register */
496 return DMA_STATUS_GOOD;
497}
498
499/*
500 * This function returns the channel configuration.
501 */
502int
503ppc4xx_get_channel_config(unsigned int dmanr, ppc_dma_ch_t * p_dma_ch)
504{
505 unsigned int polarity;
506 unsigned int control;
507
508 if (dmanr >= MAX_PPC4xx_DMA_CHANNELS) {
509 printk("ppc4xx_get_channel_config: bad channel %d\n", dmanr);
510 return DMA_STATUS_BAD_CHANNEL;
511 }
512
513 memcpy(p_dma_ch, &dma_channels[dmanr], sizeof (ppc_dma_ch_t));
514
515#if DCRN_POL > 0
516 polarity = mfdcr(DCRN_POL);
517#else
518 polarity = 0;
519#endif
520
521 p_dma_ch->polarity = polarity & GET_DMA_POLARITY(dmanr);
522 control = mfdcr(DCRN_DMACR0 + (dmanr * 0x8));
523
524 p_dma_ch->cp = GET_DMA_PRIORITY(control);
525 p_dma_ch->pwidth = GET_DMA_PW(control);
526 p_dma_ch->psc = GET_DMA_PSC(control);
527 p_dma_ch->pwc = GET_DMA_PWC(control);
528 p_dma_ch->phc = GET_DMA_PHC(control);
529 p_dma_ch->ce = GET_DMA_CE_ENABLE(control);
530 p_dma_ch->int_enable = GET_DMA_CIE_ENABLE(control);
531 p_dma_ch->shift = GET_DMA_PW(control);
532
533#ifdef CONFIG_PPC4xx_EDMA
534 p_dma_ch->pf = GET_DMA_PREFETCH(control);
535#else
536 p_dma_ch->ch_enable = GET_DMA_CH(control);
537 p_dma_ch->ece_enable = GET_DMA_ECE(control);
538 p_dma_ch->tcd_disable = GET_DMA_TCD(control);
539#endif
540 return DMA_STATUS_GOOD;
541}
542
543/*
544 * Sets the priority for the DMA channel dmanr.
545 * Since this is setup by the hardware init function, this function
546 * can be used to dynamically change the priority of a channel.
547 *
548 * Acceptable priorities:
549 *
550 * PRIORITY_LOW
551 * PRIORITY_MID_LOW
552 * PRIORITY_MID_HIGH
553 * PRIORITY_HIGH
554 *
555 */
556int
557ppc4xx_set_channel_priority(unsigned int dmanr, unsigned int priority)
558{
559 unsigned int control;
560
561 if (dmanr >= MAX_PPC4xx_DMA_CHANNELS) {
562 printk("ppc4xx_set_channel_priority: bad channel %d\n", dmanr);
563 return DMA_STATUS_BAD_CHANNEL;
564 }
565
566 if ((priority != PRIORITY_LOW) &&
567 (priority != PRIORITY_MID_LOW) &&
568 (priority != PRIORITY_MID_HIGH) && (priority != PRIORITY_HIGH)) {
569 printk("ppc4xx_set_channel_priority: bad priority: 0x%x\n", priority);
570 }
571
572 control = mfdcr(DCRN_DMACR0 + (dmanr * 0x8));
573 control |= SET_DMA_PRIORITY(priority);
574 mtdcr(DCRN_DMACR0 + (dmanr * 0x8), control);
575
576 return DMA_STATUS_GOOD;
577}
578
579/*
580 * Returns the width of the peripheral attached to this channel. This assumes
581 * that someone who knows the hardware configuration, boot code or some other
582 * init code, already set the width.
583 *
584 * The return value is one of:
585 * PW_8
586 * PW_16
587 * PW_32
588 * PW_64
589 *
590 * The function returns 0 on error.
591 */
592unsigned int
593ppc4xx_get_peripheral_width(unsigned int dmanr)
594{
595 unsigned int control;
596
597 if (dmanr >= MAX_PPC4xx_DMA_CHANNELS) {
598 printk("ppc4xx_get_peripheral_width: bad channel %d\n", dmanr);
599 return DMA_STATUS_BAD_CHANNEL;
600 }
601
602 control = mfdcr(DCRN_DMACR0 + (dmanr * 0x8));
603
604 return (GET_DMA_PW(control));
605}
606
607/*
608 * Clears the channel status bits
609 */
610int
611ppc4xx_clr_dma_status(unsigned int dmanr)
612{
613 if (dmanr >= MAX_PPC4xx_DMA_CHANNELS) {
614 printk(KERN_ERR "ppc4xx_clr_dma_status: bad channel: %d\n", dmanr);
615 return DMA_STATUS_BAD_CHANNEL;
616 }
617 mtdcr(DCRN_DMASR, ((u32)DMA_CH0_ERR | (u32)DMA_CS0 | (u32)DMA_TS0) >> dmanr);
618 return DMA_STATUS_GOOD;
619}
620
621#ifdef CONFIG_PPC4xx_EDMA
622/*
623 * Enables the burst on the channel (BTEN bit in the control/count register)
624 * Note:
625 * For scatter/gather dma, this function MUST be called before the
626 * ppc4xx_alloc_dma_handle() func as the chan count register is copied into the
627 * sgl list and used as each sgl element is added.
628 */
629int
630ppc4xx_enable_burst(unsigned int dmanr)
631{
632 unsigned int ctc;
633 if (dmanr >= MAX_PPC4xx_DMA_CHANNELS) {
634 printk(KERN_ERR "ppc4xx_enable_burst: bad channel: %d\n", dmanr);
635 return DMA_STATUS_BAD_CHANNEL;
636 }
637 ctc = mfdcr(DCRN_DMACT0 + (dmanr * 0x8)) | DMA_CTC_BTEN;
638 mtdcr(DCRN_DMACT0 + (dmanr * 0x8), ctc);
639 return DMA_STATUS_GOOD;
640}
641/*
642 * Disables the burst on the channel (BTEN bit in the control/count register)
643 * Note:
644 * For scatter/gather dma, this function MUST be called before the
645 * ppc4xx_alloc_dma_handle() func as the chan count register is copied into the
646 * sgl list and used as each sgl element is added.
647 */
648int
649ppc4xx_disable_burst(unsigned int dmanr)
650{
651 unsigned int ctc;
652 if (dmanr >= MAX_PPC4xx_DMA_CHANNELS) {
653 printk(KERN_ERR "ppc4xx_disable_burst: bad channel: %d\n", dmanr);
654 return DMA_STATUS_BAD_CHANNEL;
655 }
656 ctc = mfdcr(DCRN_DMACT0 + (dmanr * 0x8)) &~ DMA_CTC_BTEN;
657 mtdcr(DCRN_DMACT0 + (dmanr * 0x8), ctc);
658 return DMA_STATUS_GOOD;
659}
660/*
661 * Sets the burst size (number of peripheral widths) for the channel
662 * (BSIZ bits in the control/count register))
663 * must be one of:
664 * DMA_CTC_BSIZ_2
665 * DMA_CTC_BSIZ_4
666 * DMA_CTC_BSIZ_8
667 * DMA_CTC_BSIZ_16
668 * Note:
669 * For scatter/gather dma, this function MUST be called before the
670 * ppc4xx_alloc_dma_handle() func as the chan count register is copied into the
671 * sgl list and used as each sgl element is added.
672 */
673int
674ppc4xx_set_burst_size(unsigned int dmanr, unsigned int bsize)
675{
676 unsigned int ctc;
677 if (dmanr >= MAX_PPC4xx_DMA_CHANNELS) {
678 printk(KERN_ERR "ppc4xx_set_burst_size: bad channel: %d\n", dmanr);
679 return DMA_STATUS_BAD_CHANNEL;
680 }
681 ctc = mfdcr(DCRN_DMACT0 + (dmanr * 0x8)) &~ DMA_CTC_BSIZ_MSK;
682 ctc |= (bsize & DMA_CTC_BSIZ_MSK);
683 mtdcr(DCRN_DMACT0 + (dmanr * 0x8), ctc);
684 return DMA_STATUS_GOOD;
685}
686
687EXPORT_SYMBOL(ppc4xx_enable_burst);
688EXPORT_SYMBOL(ppc4xx_disable_burst);
689EXPORT_SYMBOL(ppc4xx_set_burst_size);
690#endif /* CONFIG_PPC4xx_EDMA */
691
692EXPORT_SYMBOL(ppc4xx_init_dma_channel);
693EXPORT_SYMBOL(ppc4xx_get_channel_config);
694EXPORT_SYMBOL(ppc4xx_set_channel_priority);
695EXPORT_SYMBOL(ppc4xx_get_peripheral_width);
696EXPORT_SYMBOL(dma_channels);
697EXPORT_SYMBOL(ppc4xx_set_src_addr);
698EXPORT_SYMBOL(ppc4xx_set_dst_addr);
699EXPORT_SYMBOL(ppc4xx_set_dma_addr);
700EXPORT_SYMBOL(ppc4xx_set_dma_addr2);
701EXPORT_SYMBOL(ppc4xx_enable_dma);
702EXPORT_SYMBOL(ppc4xx_disable_dma);
703EXPORT_SYMBOL(ppc4xx_set_dma_mode);
704EXPORT_SYMBOL(ppc4xx_set_dma_count);
705EXPORT_SYMBOL(ppc4xx_get_dma_residue);
706EXPORT_SYMBOL(ppc4xx_enable_dma_interrupt);
707EXPORT_SYMBOL(ppc4xx_disable_dma_interrupt);
708EXPORT_SYMBOL(ppc4xx_get_dma_status);
709EXPORT_SYMBOL(ppc4xx_clr_dma_status);
710
diff --git a/arch/ppc/syslib/ppc4xx_pic.c b/arch/ppc/syslib/ppc4xx_pic.c
deleted file mode 100644
index ee0da4b4b993..000000000000
--- a/arch/ppc/syslib/ppc4xx_pic.c
+++ /dev/null
@@ -1,284 +0,0 @@
1/*
2 * Interrupt controller driver for PowerPC 4xx-based processors.
3 *
4 * Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net>
5 * Copyright (c) 2004, 2005 Zultys Technologies
6 *
7 * Based on original code by
8 * Copyright (c) 1999 Grant Erickson <grant@lcse.umn.edu>
9 * Armin Custer <akuster@mvista.com>
10 *
11 * This program is free software; you can redistribute it and/or modify it
12 * under the terms of the GNU General Public License as published by the
13 * Free Software Foundation; either version 2 of the License, or (at your
14 * option) any later version.
15*/
16#include <linux/init.h>
17#include <linux/sched.h>
18#include <linux/signal.h>
19#include <linux/stddef.h>
20
21#include <asm/processor.h>
22#include <asm/system.h>
23#include <asm/irq.h>
24#include <asm/ppc4xx_pic.h>
25#include <asm/machdep.h>
26
27/* See comment in include/arch-ppc/ppc4xx_pic.h
28 * for more info about these two variables
29 */
30extern struct ppc4xx_uic_settings ppc4xx_core_uic_cfg[NR_UICS]
31 __attribute__ ((weak));
32extern unsigned char ppc4xx_uic_ext_irq_cfg[] __attribute__ ((weak));
33
34#define IRQ_MASK_UIC0(irq) (1 << (31 - (irq)))
35#define IRQ_MASK_UICx(irq) (1 << (31 - ((irq) & 0x1f)))
36#define IRQ_MASK_UIC1(irq) IRQ_MASK_UICx(irq)
37#define IRQ_MASK_UIC2(irq) IRQ_MASK_UICx(irq)
38#define IRQ_MASK_UIC3(irq) IRQ_MASK_UICx(irq)
39
40#define UIC_HANDLERS(n) \
41static void ppc4xx_uic##n##_enable(unsigned int irq) \
42{ \
43 u32 mask = IRQ_MASK_UIC##n(irq); \
44 if (irq_desc[irq].status & IRQ_LEVEL) \
45 mtdcr(DCRN_UIC_SR(UIC##n), mask); \
46 ppc_cached_irq_mask[n] |= mask; \
47 mtdcr(DCRN_UIC_ER(UIC##n), ppc_cached_irq_mask[n]); \
48} \
49 \
50static void ppc4xx_uic##n##_disable(unsigned int irq) \
51{ \
52 ppc_cached_irq_mask[n] &= ~IRQ_MASK_UIC##n(irq); \
53 mtdcr(DCRN_UIC_ER(UIC##n), ppc_cached_irq_mask[n]); \
54 ACK_UIC##n##_PARENT \
55} \
56 \
57static void ppc4xx_uic##n##_ack(unsigned int irq) \
58{ \
59 u32 mask = IRQ_MASK_UIC##n(irq); \
60 ppc_cached_irq_mask[n] &= ~mask; \
61 mtdcr(DCRN_UIC_ER(UIC##n), ppc_cached_irq_mask[n]); \
62 mtdcr(DCRN_UIC_SR(UIC##n), mask); \
63 ACK_UIC##n##_PARENT \
64} \
65 \
66static void ppc4xx_uic##n##_end(unsigned int irq) \
67{ \
68 unsigned int status = irq_desc[irq].status; \
69 u32 mask = IRQ_MASK_UIC##n(irq); \
70 if (status & IRQ_LEVEL) { \
71 mtdcr(DCRN_UIC_SR(UIC##n), mask); \
72 ACK_UIC##n##_PARENT \
73 } \
74 if (!(status & (IRQ_DISABLED | IRQ_INPROGRESS))) { \
75 ppc_cached_irq_mask[n] |= mask; \
76 mtdcr(DCRN_UIC_ER(UIC##n), ppc_cached_irq_mask[n]); \
77 } \
78}
79
80#define DECLARE_UIC(n) \
81{ \
82 .typename = "UIC"#n, \
83 .enable = ppc4xx_uic##n##_enable, \
84 .disable = ppc4xx_uic##n##_disable, \
85 .ack = ppc4xx_uic##n##_ack, \
86 .end = ppc4xx_uic##n##_end, \
87} \
88
89#if NR_UICS == 4
90#define ACK_UIC0_PARENT
91#define ACK_UIC1_PARENT mtdcr(DCRN_UIC_SR(UIC0), UIC0_UIC1NC);
92#define ACK_UIC2_PARENT mtdcr(DCRN_UIC_SR(UIC0), UIC0_UIC2NC);
93#define ACK_UIC3_PARENT mtdcr(DCRN_UIC_SR(UIC0), UIC0_UIC3NC);
94UIC_HANDLERS(0);
95UIC_HANDLERS(1);
96UIC_HANDLERS(2);
97UIC_HANDLERS(3);
98
99static int ppc4xx_pic_get_irq(void)
100{
101 u32 uic0 = mfdcr(DCRN_UIC_MSR(UIC0));
102 if (uic0 & UIC0_UIC1NC)
103 return 64 - ffs(mfdcr(DCRN_UIC_MSR(UIC1)));
104 else if (uic0 & UIC0_UIC2NC)
105 return 96 - ffs(mfdcr(DCRN_UIC_MSR(UIC2)));
106 else if (uic0 & UIC0_UIC3NC)
107 return 128 - ffs(mfdcr(DCRN_UIC_MSR(UIC3)));
108 else
109 return uic0 ? 32 - ffs(uic0) : -1;
110}
111
112static void __init ppc4xx_pic_impl_init(void)
113{
114 /* Enable cascade interrupts in UIC0 */
115 ppc_cached_irq_mask[0] |= UIC0_UIC1NC | UIC0_UIC2NC | UIC0_UIC3NC;
116 mtdcr(DCRN_UIC_SR(UIC0), UIC0_UIC1NC | UIC0_UIC2NC | UIC0_UIC3NC);
117 mtdcr(DCRN_UIC_ER(UIC0), ppc_cached_irq_mask[0]);
118}
119
120#elif NR_UICS == 3
121#define ACK_UIC0_PARENT mtdcr(DCRN_UIC_SR(UICB), UICB_UIC0NC);
122#define ACK_UIC1_PARENT mtdcr(DCRN_UIC_SR(UICB), UICB_UIC1NC);
123#define ACK_UIC2_PARENT mtdcr(DCRN_UIC_SR(UICB), UICB_UIC2NC);
124UIC_HANDLERS(0);
125UIC_HANDLERS(1);
126UIC_HANDLERS(2);
127
128static int ppc4xx_pic_get_irq(void)
129{
130 u32 uicb = mfdcr(DCRN_UIC_MSR(UICB));
131 if (uicb & UICB_UIC0NC)
132 return 32 - ffs(mfdcr(DCRN_UIC_MSR(UIC0)));
133 else if (uicb & UICB_UIC1NC)
134 return 64 - ffs(mfdcr(DCRN_UIC_MSR(UIC1)));
135 else if (uicb & UICB_UIC2NC)
136 return 96 - ffs(mfdcr(DCRN_UIC_MSR(UIC2)));
137 else
138 return -1;
139}
140
141static void __init ppc4xx_pic_impl_init(void)
142{
143#if defined(CONFIG_440GX)
144 /* Disable 440GP compatibility mode if it was enabled in firmware */
145 SDR_WRITE(DCRN_SDR_MFR, SDR_READ(DCRN_SDR_MFR) & ~DCRN_SDR_MFR_PCM);
146#endif
147 /* Configure Base UIC */
148 mtdcr(DCRN_UIC_CR(UICB), 0);
149 mtdcr(DCRN_UIC_TR(UICB), 0);
150 mtdcr(DCRN_UIC_PR(UICB), 0xffffffff);
151 mtdcr(DCRN_UIC_SR(UICB), 0xffffffff);
152 mtdcr(DCRN_UIC_ER(UICB), UICB_UIC0NC | UICB_UIC1NC | UICB_UIC2NC);
153}
154
155#elif NR_UICS == 2
156#define ACK_UIC0_PARENT
157#define ACK_UIC1_PARENT mtdcr(DCRN_UIC_SR(UIC0), UIC0_UIC1NC);
158UIC_HANDLERS(0);
159UIC_HANDLERS(1);
160
161static int ppc4xx_pic_get_irq(void)
162{
163 u32 uic0 = mfdcr(DCRN_UIC_MSR(UIC0));
164 if (uic0 & UIC0_UIC1NC)
165 return 64 - ffs(mfdcr(DCRN_UIC_MSR(UIC1)));
166 else
167 return uic0 ? 32 - ffs(uic0) : -1;
168}
169
170static void __init ppc4xx_pic_impl_init(void)
171{
172 /* Enable cascade interrupt in UIC0 */
173 ppc_cached_irq_mask[0] |= UIC0_UIC1NC;
174 mtdcr(DCRN_UIC_SR(UIC0), UIC0_UIC1NC);
175 mtdcr(DCRN_UIC_ER(UIC0), ppc_cached_irq_mask[0]);
176}
177
178#elif NR_UICS == 1
179#define ACK_UIC0_PARENT
180UIC_HANDLERS(0);
181
182static int ppc4xx_pic_get_irq(void)
183{
184 u32 uic0 = mfdcr(DCRN_UIC_MSR(UIC0));
185 return uic0 ? 32 - ffs(uic0) : -1;
186}
187
188static inline void ppc4xx_pic_impl_init(void)
189{
190}
191#endif
192
193static struct ppc4xx_uic_impl {
194 struct hw_interrupt_type decl;
195 int base; /* Base DCR number */
196} __uic[] = {
197 { .decl = DECLARE_UIC(0), .base = UIC0 },
198#if NR_UICS > 1
199 { .decl = DECLARE_UIC(1), .base = UIC1 },
200#if NR_UICS > 2
201 { .decl = DECLARE_UIC(2), .base = UIC2 },
202#if NR_UICS > 3
203 { .decl = DECLARE_UIC(3), .base = UIC3 },
204#endif
205#endif
206#endif
207};
208
209static inline int is_level_sensitive(int irq)
210{
211 u32 tr = mfdcr(DCRN_UIC_TR(__uic[irq >> 5].base));
212 return (tr & IRQ_MASK_UICx(irq)) == 0;
213}
214
215void __init ppc4xx_pic_init(void)
216{
217 int i;
218 unsigned char *eirqs = ppc4xx_uic_ext_irq_cfg;
219
220 for (i = 0; i < NR_UICS; ++i) {
221 int base = __uic[i].base;
222
223 /* Disable everything by default */
224 ppc_cached_irq_mask[i] = 0;
225 mtdcr(DCRN_UIC_ER(base), 0);
226
227 /* We don't use critical interrupts */
228 mtdcr(DCRN_UIC_CR(base), 0);
229
230 /* Configure polarity and triggering */
231 if (ppc4xx_core_uic_cfg) {
232 struct ppc4xx_uic_settings *p = ppc4xx_core_uic_cfg + i;
233 u32 mask = p->ext_irq_mask;
234 u32 pr = mfdcr(DCRN_UIC_PR(base)) & mask;
235 u32 tr = mfdcr(DCRN_UIC_TR(base)) & mask;
236
237 /* "Fixed" interrupts (on-chip devices) */
238 pr |= p->polarity & ~mask;
239 tr |= p->triggering & ~mask;
240
241 /* Merge external IRQs settings if board port
242 * provided them
243 */
244 if (eirqs && mask) {
245 pr &= ~mask;
246 tr &= ~mask;
247 while (mask) {
248 /* Extract current external IRQ mask */
249 u32 eirq_mask = 1 << __ilog2(mask);
250
251 if (!(*eirqs & IRQ_SENSE_LEVEL))
252 tr |= eirq_mask;
253
254 if (*eirqs & IRQ_POLARITY_POSITIVE)
255 pr |= eirq_mask;
256
257 mask &= ~eirq_mask;
258 ++eirqs;
259 }
260 }
261 mtdcr(DCRN_UIC_PR(base), pr);
262 mtdcr(DCRN_UIC_TR(base), tr);
263 }
264
265 /* ACK any pending interrupts to prevent false
266 * triggering after first enable
267 */
268 mtdcr(DCRN_UIC_SR(base), 0xffffffff);
269 }
270
271 /* Perform optional implementation specific setup
272 * (e.g. enable cascade interrupts for multi-UIC configurations)
273 */
274 ppc4xx_pic_impl_init();
275
276 /* Attach low-level handlers */
277 for (i = 0; i < (NR_UICS << 5); ++i) {
278 irq_desc[i].chip = &__uic[i >> 5].decl;
279 if (is_level_sensitive(i))
280 irq_desc[i].status |= IRQ_LEVEL;
281 }
282
283 ppc_md.get_irq = ppc4xx_pic_get_irq;
284}
diff --git a/arch/ppc/syslib/ppc4xx_setup.c b/arch/ppc/syslib/ppc4xx_setup.c
deleted file mode 100644
index 353d746b47e1..000000000000
--- a/arch/ppc/syslib/ppc4xx_setup.c
+++ /dev/null
@@ -1,271 +0,0 @@
1/*
2 *
3 * Copyright (c) 1999-2000 Grant Erickson <grant@lcse.umn.edu>
4 *
5 * Copyright 2000-2001 MontaVista Software Inc.
6 * Completed implementation.
7 * Author: MontaVista Software, Inc. <source@mvista.com>
8 * Frank Rowand <frank_rowand@mvista.com>
9 * Debbie Chu <debbie_chu@mvista.com>
10 * Further modifications by Armin Kuster
11 *
12 * Module name: ppc4xx_setup.c
13 *
14 */
15
16#include <linux/init.h>
17#include <linux/smp.h>
18#include <linux/threads.h>
19#include <linux/spinlock.h>
20#include <linux/reboot.h>
21#include <linux/param.h>
22#include <linux/string.h>
23#include <linux/initrd.h>
24#include <linux/pci.h>
25#include <linux/rtc.h>
26#include <linux/console.h>
27#include <linux/serial_reg.h>
28#include <linux/seq_file.h>
29
30#include <asm/system.h>
31#include <asm/processor.h>
32#include <asm/machdep.h>
33#include <asm/page.h>
34#include <asm/kgdb.h>
35#include <asm/ibm4xx.h>
36#include <asm/time.h>
37#include <asm/todc.h>
38#include <asm/ppc4xx_pic.h>
39#include <asm/pci-bridge.h>
40#include <asm/bootinfo.h>
41
42#include <syslib/gen550.h>
43
44/* Function Prototypes */
45extern void abort(void);
46extern void ppc4xx_find_bridges(void);
47
48/* Global Variables */
49bd_t __res;
50
51void __init
52ppc4xx_setup_arch(void)
53{
54#if !defined(CONFIG_BDI_SWITCH)
55 /*
56 * The Abatron BDI JTAG debugger does not tolerate others
57 * mucking with the debug registers.
58 */
59 mtspr(SPRN_DBCR0, (DBCR0_IDM));
60 mtspr(SPRN_DBSR, 0xffffffff);
61#endif
62
63 /* Setup PCI host bridges */
64#ifdef CONFIG_PCI
65 ppc4xx_find_bridges();
66#endif
67}
68
69/*
70 * This routine pretty-prints the platform's internal CPU clock
71 * frequencies into the buffer for usage in /proc/cpuinfo.
72 */
73
74static int
75ppc4xx_show_percpuinfo(struct seq_file *m, int i)
76{
77 seq_printf(m, "clock\t\t: %ldMHz\n", (long)__res.bi_intfreq / 1000000);
78
79 return 0;
80}
81
82/*
83 * This routine pretty-prints the platform's internal bus clock
84 * frequencies into the buffer for usage in /proc/cpuinfo.
85 */
86static int
87ppc4xx_show_cpuinfo(struct seq_file *m)
88{
89 bd_t *bip = &__res;
90
91 seq_printf(m, "machine\t\t: %s\n", PPC4xx_MACHINE_NAME);
92 seq_printf(m, "plb bus clock\t: %ldMHz\n",
93 (long) bip->bi_busfreq / 1000000);
94#ifdef CONFIG_PCI
95 seq_printf(m, "pci bus clock\t: %dMHz\n",
96 bip->bi_pci_busfreq / 1000000);
97#endif
98
99 return 0;
100}
101
102/*
103 * Return the virtual address representing the top of physical RAM.
104 */
105static unsigned long __init
106ppc4xx_find_end_of_memory(void)
107{
108 return ((unsigned long) __res.bi_memsize);
109}
110
111void __init
112ppc4xx_map_io(void)
113{
114 io_block_mapping(PPC4xx_ONB_IO_VADDR,
115 PPC4xx_ONB_IO_PADDR, PPC4xx_ONB_IO_SIZE, _PAGE_IO);
116#ifdef CONFIG_PCI
117 io_block_mapping(PPC4xx_PCI_IO_VADDR,
118 PPC4xx_PCI_IO_PADDR, PPC4xx_PCI_IO_SIZE, _PAGE_IO);
119 io_block_mapping(PPC4xx_PCI_CFG_VADDR,
120 PPC4xx_PCI_CFG_PADDR, PPC4xx_PCI_CFG_SIZE, _PAGE_IO);
121 io_block_mapping(PPC4xx_PCI_LCFG_VADDR,
122 PPC4xx_PCI_LCFG_PADDR, PPC4xx_PCI_LCFG_SIZE, _PAGE_IO);
123#endif
124}
125
126void __init
127ppc4xx_init_IRQ(void)
128{
129 ppc4xx_pic_init();
130}
131
132static void
133ppc4xx_restart(char *cmd)
134{
135 printk("%s\n", cmd);
136 abort();
137}
138
139static void
140ppc4xx_power_off(void)
141{
142 printk("System Halted\n");
143 local_irq_disable();
144 while (1) ;
145}
146
147static void
148ppc4xx_halt(void)
149{
150 printk("System Halted\n");
151 local_irq_disable();
152 while (1) ;
153}
154
155/*
156 * This routine retrieves the internal processor frequency from the board
157 * information structure, sets up the kernel timer decrementer based on
158 * that value, enables the 4xx programmable interval timer (PIT) and sets
159 * it up for auto-reload.
160 */
161static void __init
162ppc4xx_calibrate_decr(void)
163{
164 unsigned int freq;
165 bd_t *bip = &__res;
166
167#if defined(CONFIG_WALNUT) || defined(CONFIG_SYCAMORE)
168 /* Walnut boot rom sets DCR CHCR1 (aka CPC0_CR1) bit CETE to 1 */
169 mtdcr(DCRN_CHCR1, mfdcr(DCRN_CHCR1) & ~CHR1_CETE);
170#endif
171 freq = bip->bi_tbfreq;
172 tb_ticks_per_jiffy = freq / HZ;
173 tb_to_us = mulhwu_scale_factor(freq, 1000000);
174
175 /* Set the time base to zero.
176 ** At 200 Mhz, time base will rollover in ~2925 years.
177 */
178
179 mtspr(SPRN_TBWL, 0);
180 mtspr(SPRN_TBWU, 0);
181
182 /* Clear any pending timer interrupts */
183
184 mtspr(SPRN_TSR, TSR_ENW | TSR_WIS | TSR_PIS | TSR_FIS);
185 mtspr(SPRN_TCR, TCR_PIE | TCR_ARE);
186
187 /* Set the PIT reload value and just let it run. */
188 mtspr(SPRN_PIT, tb_ticks_per_jiffy);
189}
190
191TODC_ALLOC();
192
193/*
194 * Input(s):
195 * r3 - Optional pointer to a board information structure.
196 * r4 - Optional pointer to the physical starting address of the init RAM
197 * disk.
198 * r5 - Optional pointer to the physical ending address of the init RAM
199 * disk.
200 * r6 - Optional pointer to the physical starting address of any kernel
201 * command-line parameters.
202 * r7 - Optional pointer to the physical ending address of any kernel
203 * command-line parameters.
204 */
205void __init
206ppc4xx_init(unsigned long r3, unsigned long r4, unsigned long r5,
207 unsigned long r6, unsigned long r7)
208{
209 parse_bootinfo(find_bootinfo());
210
211 /*
212 * If we were passed in a board information, copy it into the
213 * residual data area.
214 */
215 if (r3)
216 __res = *(bd_t *)(r3 + KERNELBASE);
217
218#if defined(CONFIG_BLK_DEV_INITRD)
219 /*
220 * If the init RAM disk has been configured in, and there's a valid
221 * starting address for it, set it up.
222 */
223 if (r4) {
224 initrd_start = r4 + KERNELBASE;
225 initrd_end = r5 + KERNELBASE;
226 }
227#endif /* CONFIG_BLK_DEV_INITRD */
228
229 /* Copy the kernel command line arguments to a safe place. */
230
231 if (r6) {
232 *(char *) (r7 + KERNELBASE) = 0;
233 strcpy(cmd_line, (char *) (r6 + KERNELBASE));
234 }
235
236 /* Initialize machine-dependent vectors */
237
238 ppc_md.setup_arch = ppc4xx_setup_arch;
239 ppc_md.show_percpuinfo = ppc4xx_show_percpuinfo;
240 ppc_md.show_cpuinfo = ppc4xx_show_cpuinfo;
241 ppc_md.init_IRQ = ppc4xx_init_IRQ;
242
243 ppc_md.restart = ppc4xx_restart;
244 ppc_md.power_off = ppc4xx_power_off;
245 ppc_md.halt = ppc4xx_halt;
246
247 ppc_md.calibrate_decr = ppc4xx_calibrate_decr;
248
249 ppc_md.find_end_of_memory = ppc4xx_find_end_of_memory;
250 ppc_md.setup_io_mappings = ppc4xx_map_io;
251
252#ifdef CONFIG_SERIAL_TEXT_DEBUG
253 ppc_md.progress = gen550_progress;
254#endif
255}
256
257/* Called from machine_check_exception */
258void platform_machine_check(struct pt_regs *regs)
259{
260#if defined(DCRN_PLB0_BEAR)
261 printk("PLB0: BEAR= 0x%08x ACR= 0x%08x BESR= 0x%08x\n",
262 mfdcr(DCRN_PLB0_BEAR), mfdcr(DCRN_PLB0_ACR),
263 mfdcr(DCRN_PLB0_BESR));
264#endif
265#if defined(DCRN_POB0_BEAR)
266 printk("PLB0 to OPB: BEAR= 0x%08x BESR0= 0x%08x BESR1= 0x%08x\n",
267 mfdcr(DCRN_POB0_BEAR), mfdcr(DCRN_POB0_BESR0),
268 mfdcr(DCRN_POB0_BESR1));
269#endif
270
271}
diff --git a/arch/ppc/syslib/ppc4xx_sgdma.c b/arch/ppc/syslib/ppc4xx_sgdma.c
deleted file mode 100644
index c4b369b50f9c..000000000000
--- a/arch/ppc/syslib/ppc4xx_sgdma.c
+++ /dev/null
@@ -1,464 +0,0 @@
1/*
2 * IBM PPC4xx DMA engine scatter/gather library
3 *
4 * Copyright 2002-2003 MontaVista Software Inc.
5 *
6 * Cleaned up and converted to new DCR access
7 * Matt Porter <mporter@kernel.crashing.org>
8 *
9 * Original code by Armin Kuster <akuster@mvista.com>
10 * and Pete Popov <ppopov@mvista.com>
11 *
12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by the
14 * Free Software Foundation; either version 2 of the License, or (at your
15 * option) any later version.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 675 Mass Ave, Cambridge, MA 02139, USA.
20 */
21
22#include <linux/kernel.h>
23#include <linux/mm.h>
24#include <linux/init.h>
25#include <linux/module.h>
26#include <linux/dma-mapping.h>
27
28#include <asm/system.h>
29#include <asm/io.h>
30#include <asm/ppc4xx_dma.h>
31
32void
33ppc4xx_set_sg_addr(int dmanr, phys_addr_t sg_addr)
34{
35 if (dmanr >= MAX_PPC4xx_DMA_CHANNELS) {
36 printk("ppc4xx_set_sg_addr: bad channel: %d\n", dmanr);
37 return;
38 }
39
40#ifdef PPC4xx_DMA_64BIT
41 mtdcr(DCRN_ASGH0 + (dmanr * 0x8), (u32)(sg_addr >> 32));
42#endif
43 mtdcr(DCRN_ASG0 + (dmanr * 0x8), (u32)sg_addr);
44}
45
46/*
47 * Add a new sgl descriptor to the end of a scatter/gather list
48 * which was created by alloc_dma_handle().
49 *
50 * For a memory to memory transfer, both dma addresses must be
51 * valid. For a peripheral to memory transfer, one of the addresses
52 * must be set to NULL, depending on the direction of the transfer:
53 * memory to peripheral: set dst_addr to NULL,
54 * peripheral to memory: set src_addr to NULL.
55 */
56int
57ppc4xx_add_dma_sgl(sgl_handle_t handle, phys_addr_t src_addr, phys_addr_t dst_addr,
58 unsigned int count)
59{
60 sgl_list_info_t *psgl = (sgl_list_info_t *) handle;
61 ppc_dma_ch_t *p_dma_ch;
62
63 if (!handle) {
64 printk("ppc4xx_add_dma_sgl: null handle\n");
65 return DMA_STATUS_BAD_HANDLE;
66 }
67
68 if (psgl->dmanr >= MAX_PPC4xx_DMA_CHANNELS) {
69 printk("ppc4xx_add_dma_sgl: bad channel: %d\n", psgl->dmanr);
70 return DMA_STATUS_BAD_CHANNEL;
71 }
72
73 p_dma_ch = &dma_channels[psgl->dmanr];
74
75#ifdef DEBUG_4xxDMA
76 {
77 int error = 0;
78 unsigned int aligned =
79 (unsigned) src_addr | (unsigned) dst_addr | count;
80 switch (p_dma_ch->pwidth) {
81 case PW_8:
82 break;
83 case PW_16:
84 if (aligned & 0x1)
85 error = 1;
86 break;
87 case PW_32:
88 if (aligned & 0x3)
89 error = 1;
90 break;
91 case PW_64:
92 if (aligned & 0x7)
93 error = 1;
94 break;
95 default:
96 printk("ppc4xx_add_dma_sgl: invalid bus width: 0x%x\n",
97 p_dma_ch->pwidth);
98 return DMA_STATUS_GENERAL_ERROR;
99 }
100 if (error)
101 printk
102 ("Alignment warning: ppc4xx_add_dma_sgl src 0x%x dst 0x%x count 0x%x bus width var %d\n",
103 src_addr, dst_addr, count, p_dma_ch->pwidth);
104
105 }
106#endif
107
108 if ((unsigned) (psgl->ptail + 1) >= ((unsigned) psgl + SGL_LIST_SIZE)) {
109 printk("sgl handle out of memory \n");
110 return DMA_STATUS_OUT_OF_MEMORY;
111 }
112
113 if (!psgl->ptail) {
114 psgl->phead = (ppc_sgl_t *)
115 ((unsigned) psgl + sizeof (sgl_list_info_t));
116 psgl->phead_dma = psgl->dma_addr + sizeof(sgl_list_info_t);
117 psgl->ptail = psgl->phead;
118 psgl->ptail_dma = psgl->phead_dma;
119 } else {
120 if(p_dma_ch->int_on_final_sg) {
121 /* mask out all dma interrupts, except error, on tail
122 before adding new tail. */
123 psgl->ptail->control_count &=
124 ~(SG_TCI_ENABLE | SG_ETI_ENABLE);
125 }
126 psgl->ptail->next = psgl->ptail_dma + sizeof(ppc_sgl_t);
127 psgl->ptail++;
128 psgl->ptail_dma += sizeof(ppc_sgl_t);
129 }
130
131 psgl->ptail->control = psgl->control;
132 psgl->ptail->src_addr = src_addr;
133 psgl->ptail->dst_addr = dst_addr;
134 psgl->ptail->control_count = (count >> p_dma_ch->shift) |
135 psgl->sgl_control;
136 psgl->ptail->next = (uint32_t) NULL;
137
138 return DMA_STATUS_GOOD;
139}
140
141/*
142 * Enable (start) the DMA described by the sgl handle.
143 */
144void
145ppc4xx_enable_dma_sgl(sgl_handle_t handle)
146{
147 sgl_list_info_t *psgl = (sgl_list_info_t *) handle;
148 ppc_dma_ch_t *p_dma_ch;
149 uint32_t sg_command;
150
151 if (!handle) {
152 printk("ppc4xx_enable_dma_sgl: null handle\n");
153 return;
154 } else if (psgl->dmanr > (MAX_PPC4xx_DMA_CHANNELS - 1)) {
155 printk("ppc4xx_enable_dma_sgl: bad channel in handle %d\n",
156 psgl->dmanr);
157 return;
158 } else if (!psgl->phead) {
159 printk("ppc4xx_enable_dma_sgl: sg list empty\n");
160 return;
161 }
162
163 p_dma_ch = &dma_channels[psgl->dmanr];
164 psgl->ptail->control_count &= ~SG_LINK; /* make this the last dscrptr */
165 sg_command = mfdcr(DCRN_ASGC);
166
167 ppc4xx_set_sg_addr(psgl->dmanr, psgl->phead_dma);
168
169 sg_command |= SSG_ENABLE(psgl->dmanr);
170
171 mtdcr(DCRN_ASGC, sg_command); /* start transfer */
172}
173
174/*
175 * Halt an active scatter/gather DMA operation.
176 */
177void
178ppc4xx_disable_dma_sgl(sgl_handle_t handle)
179{
180 sgl_list_info_t *psgl = (sgl_list_info_t *) handle;
181 uint32_t sg_command;
182
183 if (!handle) {
184 printk("ppc4xx_enable_dma_sgl: null handle\n");
185 return;
186 } else if (psgl->dmanr > (MAX_PPC4xx_DMA_CHANNELS - 1)) {
187 printk("ppc4xx_enable_dma_sgl: bad channel in handle %d\n",
188 psgl->dmanr);
189 return;
190 }
191
192 sg_command = mfdcr(DCRN_ASGC);
193 sg_command &= ~SSG_ENABLE(psgl->dmanr);
194 mtdcr(DCRN_ASGC, sg_command); /* stop transfer */
195}
196
197/*
198 * Returns number of bytes left to be transferred from the entire sgl list.
199 * *src_addr and *dst_addr get set to the source/destination address of
200 * the sgl descriptor where the DMA stopped.
201 *
202 * An sgl transfer must NOT be active when this function is called.
203 */
204int
205ppc4xx_get_dma_sgl_residue(sgl_handle_t handle, phys_addr_t * src_addr,
206 phys_addr_t * dst_addr)
207{
208 sgl_list_info_t *psgl = (sgl_list_info_t *) handle;
209 ppc_dma_ch_t *p_dma_ch;
210 ppc_sgl_t *pnext, *sgl_addr;
211 uint32_t count_left;
212
213 if (!handle) {
214 printk("ppc4xx_get_dma_sgl_residue: null handle\n");
215 return DMA_STATUS_BAD_HANDLE;
216 } else if (psgl->dmanr > (MAX_PPC4xx_DMA_CHANNELS - 1)) {
217 printk("ppc4xx_get_dma_sgl_residue: bad channel in handle %d\n",
218 psgl->dmanr);
219 return DMA_STATUS_BAD_CHANNEL;
220 }
221
222 sgl_addr = (ppc_sgl_t *) __va(mfdcr(DCRN_ASG0 + (psgl->dmanr * 0x8)));
223 count_left = mfdcr(DCRN_DMACT0 + (psgl->dmanr * 0x8)) & SG_COUNT_MASK;
224
225 if (!sgl_addr) {
226 printk("ppc4xx_get_dma_sgl_residue: sgl addr register is null\n");
227 goto error;
228 }
229
230 pnext = psgl->phead;
231 while (pnext &&
232 ((unsigned) pnext < ((unsigned) psgl + SGL_LIST_SIZE) &&
233 (pnext != sgl_addr))
234 ) {
235 pnext++;
236 }
237
238 if (pnext == sgl_addr) { /* found the sgl descriptor */
239
240 *src_addr = pnext->src_addr;
241 *dst_addr = pnext->dst_addr;
242
243 /*
244 * Now search the remaining descriptors and add their count.
245 * We already have the remaining count from this descriptor in
246 * count_left.
247 */
248 pnext++;
249
250 while ((pnext != psgl->ptail) &&
251 ((unsigned) pnext < ((unsigned) psgl + SGL_LIST_SIZE))
252 ) {
253 count_left += pnext->control_count & SG_COUNT_MASK;
254 }
255
256 if (pnext != psgl->ptail) { /* should never happen */
257 printk
258 ("ppc4xx_get_dma_sgl_residue error (1) psgl->ptail 0x%x handle 0x%x\n",
259 (unsigned int) psgl->ptail, (unsigned int) handle);
260 goto error;
261 }
262
263 /* success */
264 p_dma_ch = &dma_channels[psgl->dmanr];
265 return (count_left << p_dma_ch->shift); /* count in bytes */
266
267 } else {
268 /* this shouldn't happen */
269 printk
270 ("get_dma_sgl_residue, unable to match current address 0x%x, handle 0x%x\n",
271 (unsigned int) sgl_addr, (unsigned int) handle);
272
273 }
274
275 error:
276 *src_addr = (phys_addr_t) NULL;
277 *dst_addr = (phys_addr_t) NULL;
278 return 0;
279}
280
281/*
282 * Returns the address(es) of the buffer(s) contained in the head element of
283 * the scatter/gather list. The element is removed from the scatter/gather
284 * list and the next element becomes the head.
285 *
286 * This function should only be called when the DMA is not active.
287 */
288int
289ppc4xx_delete_dma_sgl_element(sgl_handle_t handle, phys_addr_t * src_dma_addr,
290 phys_addr_t * dst_dma_addr)
291{
292 sgl_list_info_t *psgl = (sgl_list_info_t *) handle;
293
294 if (!handle) {
295 printk("ppc4xx_delete_sgl_element: null handle\n");
296 return DMA_STATUS_BAD_HANDLE;
297 } else if (psgl->dmanr > (MAX_PPC4xx_DMA_CHANNELS - 1)) {
298 printk("ppc4xx_delete_sgl_element: bad channel in handle %d\n",
299 psgl->dmanr);
300 return DMA_STATUS_BAD_CHANNEL;
301 }
302
303 if (!psgl->phead) {
304 printk("ppc4xx_delete_sgl_element: sgl list empty\n");
305 *src_dma_addr = (phys_addr_t) NULL;
306 *dst_dma_addr = (phys_addr_t) NULL;
307 return DMA_STATUS_SGL_LIST_EMPTY;
308 }
309
310 *src_dma_addr = (phys_addr_t) psgl->phead->src_addr;
311 *dst_dma_addr = (phys_addr_t) psgl->phead->dst_addr;
312
313 if (psgl->phead == psgl->ptail) {
314 /* last descriptor on the list */
315 psgl->phead = NULL;
316 psgl->ptail = NULL;
317 } else {
318 psgl->phead++;
319 psgl->phead_dma += sizeof(ppc_sgl_t);
320 }
321
322 return DMA_STATUS_GOOD;
323}
324
325
326/*
327 * Create a scatter/gather list handle. This is simply a structure which
328 * describes a scatter/gather list.
329 *
330 * A handle is returned in "handle" which the driver should save in order to
331 * be able to access this list later. A chunk of memory will be allocated
332 * to be used by the API for internal management purposes, including managing
333 * the sg list and allocating memory for the sgl descriptors. One page should
334 * be more than enough for that purpose. Perhaps it's a bit wasteful to use
335 * a whole page for a single sg list, but most likely there will be only one
336 * sg list per channel.
337 *
338 * Interrupt notes:
339 * Each sgl descriptor has a copy of the DMA control word which the DMA engine
340 * loads in the control register. The control word has a "global" interrupt
341 * enable bit for that channel. Interrupts are further qualified by a few bits
342 * in the sgl descriptor count register. In order to setup an sgl, we have to
343 * know ahead of time whether or not interrupts will be enabled at the completion
344 * of the transfers. Thus, enable_dma_interrupt()/disable_dma_interrupt() MUST
345 * be called before calling alloc_dma_handle(). If the interrupt mode will never
346 * change after powerup, then enable_dma_interrupt()/disable_dma_interrupt()
347 * do not have to be called -- interrupts will be enabled or disabled based
348 * on how the channel was configured after powerup by the hw_init_dma_channel()
349 * function. Each sgl descriptor will be setup to interrupt if an error occurs;
350 * however, only the last descriptor will be setup to interrupt. Thus, an
351 * interrupt will occur (if interrupts are enabled) only after the complete
352 * sgl transfer is done.
353 */
354int
355ppc4xx_alloc_dma_handle(sgl_handle_t * phandle, unsigned int mode, unsigned int dmanr)
356{
357 sgl_list_info_t *psgl=NULL;
358 dma_addr_t dma_addr;
359 ppc_dma_ch_t *p_dma_ch = &dma_channels[dmanr];
360 uint32_t sg_command;
361 uint32_t ctc_settings;
362 void *ret;
363
364 if (dmanr >= MAX_PPC4xx_DMA_CHANNELS) {
365 printk("ppc4xx_alloc_dma_handle: invalid channel 0x%x\n", dmanr);
366 return DMA_STATUS_BAD_CHANNEL;
367 }
368
369 if (!phandle) {
370 printk("ppc4xx_alloc_dma_handle: null handle pointer\n");
371 return DMA_STATUS_NULL_POINTER;
372 }
373
374 /* Get a page of memory, which is zeroed out by consistent_alloc() */
375 ret = dma_alloc_coherent(NULL, DMA_PPC4xx_SIZE, &dma_addr, GFP_KERNEL);
376 if (ret != NULL) {
377 memset(ret, 0, DMA_PPC4xx_SIZE);
378 psgl = (sgl_list_info_t *) ret;
379 }
380
381 if (psgl == NULL) {
382 *phandle = (sgl_handle_t) NULL;
383 return DMA_STATUS_OUT_OF_MEMORY;
384 }
385
386 psgl->dma_addr = dma_addr;
387 psgl->dmanr = dmanr;
388
389 /*
390 * Modify and save the control word. These words will be
391 * written to each sgl descriptor. The DMA engine then
392 * loads this control word into the control register
393 * every time it reads a new descriptor.
394 */
395 psgl->control = p_dma_ch->control;
396 /* Clear all mode bits */
397 psgl->control &= ~(DMA_TM_MASK | DMA_TD);
398 /* Save control word and mode */
399 psgl->control |= (mode | DMA_CE_ENABLE);
400
401 /* In MM mode, we must set ETD/TCE */
402 if (mode == DMA_MODE_MM)
403 psgl->control |= DMA_ETD_OUTPUT | DMA_TCE_ENABLE;
404
405 if (p_dma_ch->int_enable) {
406 /* Enable channel interrupt */
407 psgl->control |= DMA_CIE_ENABLE;
408 } else {
409 psgl->control &= ~DMA_CIE_ENABLE;
410 }
411
412 sg_command = mfdcr(DCRN_ASGC);
413 sg_command |= SSG_MASK_ENABLE(dmanr);
414
415 /* Enable SGL control access */
416 mtdcr(DCRN_ASGC, sg_command);
417 psgl->sgl_control = SG_ERI_ENABLE | SG_LINK;
418
419 /* keep control count register settings */
420 ctc_settings = mfdcr(DCRN_DMACT0 + (dmanr * 0x8))
421 & (DMA_CTC_BSIZ_MSK | DMA_CTC_BTEN); /*burst mode settings*/
422 psgl->sgl_control |= ctc_settings;
423
424 if (p_dma_ch->int_enable) {
425 if (p_dma_ch->tce_enable)
426 psgl->sgl_control |= SG_TCI_ENABLE;
427 else
428 psgl->sgl_control |= SG_ETI_ENABLE;
429 }
430
431 *phandle = (sgl_handle_t) psgl;
432 return DMA_STATUS_GOOD;
433}
434
435/*
436 * Destroy a scatter/gather list handle that was created by alloc_dma_handle().
437 * The list must be empty (contain no elements).
438 */
439void
440ppc4xx_free_dma_handle(sgl_handle_t handle)
441{
442 sgl_list_info_t *psgl = (sgl_list_info_t *) handle;
443
444 if (!handle) {
445 printk("ppc4xx_free_dma_handle: got NULL\n");
446 return;
447 } else if (psgl->phead) {
448 printk("ppc4xx_free_dma_handle: list not empty\n");
449 return;
450 } else if (!psgl->dma_addr) { /* should never happen */
451 printk("ppc4xx_free_dma_handle: no dma address\n");
452 return;
453 }
454
455 dma_free_coherent(NULL, DMA_PPC4xx_SIZE, (void *) psgl, 0);
456}
457
458EXPORT_SYMBOL(ppc4xx_alloc_dma_handle);
459EXPORT_SYMBOL(ppc4xx_free_dma_handle);
460EXPORT_SYMBOL(ppc4xx_add_dma_sgl);
461EXPORT_SYMBOL(ppc4xx_delete_dma_sgl_element);
462EXPORT_SYMBOL(ppc4xx_enable_dma_sgl);
463EXPORT_SYMBOL(ppc4xx_disable_dma_sgl);
464EXPORT_SYMBOL(ppc4xx_get_dma_sgl_residue);
diff --git a/arch/ppc/syslib/ppc8xx_pic.c b/arch/ppc/syslib/ppc8xx_pic.c
deleted file mode 100644
index bce9a75c80e3..000000000000
--- a/arch/ppc/syslib/ppc8xx_pic.c
+++ /dev/null
@@ -1,126 +0,0 @@
1#include <linux/module.h>
2#include <linux/stddef.h>
3#include <linux/init.h>
4#include <linux/sched.h>
5#include <linux/signal.h>
6#include <linux/interrupt.h>
7#include <asm/irq.h>
8#include <asm/io.h>
9#include <asm/8xx_immap.h>
10#include <asm/mpc8xx.h>
11#include "ppc8xx_pic.h"
12
13extern int cpm_get_irq(void);
14
15/* The 8xx internal interrupt controller. It is usually
16 * the only interrupt controller. Some boards, like the MBX and
17 * Sandpoint have the 8259 as a secondary controller. Depending
18 * upon the processor type, the internal controller can have as
19 * few as 16 interrupts or as many as 64. We could use the
20 * "clear_bit()" and "set_bit()" functions like other platforms,
21 * but they are overkill for us.
22 */
23
24static void m8xx_mask_irq(unsigned int irq_nr)
25{
26 int bit, word;
27
28 bit = irq_nr & 0x1f;
29 word = irq_nr >> 5;
30
31 ppc_cached_irq_mask[word] &= ~(1 << (31-bit));
32 out_be32(&((immap_t *)IMAP_ADDR)->im_siu_conf.sc_simask, ppc_cached_irq_mask[word]);
33}
34
35static void m8xx_unmask_irq(unsigned int irq_nr)
36{
37 int bit, word;
38
39 bit = irq_nr & 0x1f;
40 word = irq_nr >> 5;
41
42 ppc_cached_irq_mask[word] |= (1 << (31-bit));
43 out_be32(&((immap_t *)IMAP_ADDR)->im_siu_conf.sc_simask, ppc_cached_irq_mask[word]);
44}
45
46static void m8xx_end_irq(unsigned int irq_nr)
47{
48 if (!(irq_desc[irq_nr].status & (IRQ_DISABLED|IRQ_INPROGRESS))
49 && irq_desc[irq_nr].action) {
50 int bit, word;
51
52 bit = irq_nr & 0x1f;
53 word = irq_nr >> 5;
54
55 ppc_cached_irq_mask[word] |= (1 << (31-bit));
56 out_be32(&((immap_t *)IMAP_ADDR)->im_siu_conf.sc_simask, ppc_cached_irq_mask[word]);
57 }
58}
59
60
61static void m8xx_mask_and_ack(unsigned int irq_nr)
62{
63 int bit, word;
64
65 bit = irq_nr & 0x1f;
66 word = irq_nr >> 5;
67
68 ppc_cached_irq_mask[word] &= ~(1 << (31-bit));
69 out_be32(&((immap_t *)IMAP_ADDR)->im_siu_conf.sc_simask, ppc_cached_irq_mask[word]);
70 out_be32(&((immap_t *)IMAP_ADDR)->im_siu_conf.sc_sipend, 1 << (31-bit));
71}
72
73struct hw_interrupt_type ppc8xx_pic = {
74 .typename = " 8xx SIU ",
75 .enable = m8xx_unmask_irq,
76 .disable = m8xx_mask_irq,
77 .ack = m8xx_mask_and_ack,
78 .end = m8xx_end_irq,
79};
80
81/*
82 * We either return a valid interrupt or -1 if there is nothing pending
83 */
84int
85m8xx_get_irq(struct pt_regs *regs)
86{
87 int irq;
88
89 /* For MPC8xx, read the SIVEC register and shift the bits down
90 * to get the irq number.
91 */
92 irq = in_be32(&((immap_t *)IMAP_ADDR)->im_siu_conf.sc_sivec) >> 26;
93
94 /*
95 * When we read the sivec without an interrupt to process, we will
96 * get back SIU_LEVEL7. In this case, return -1
97 */
98 if (irq == CPM_INTERRUPT)
99 irq = CPM_IRQ_OFFSET + cpm_get_irq();
100#if defined(CONFIG_PCI)
101 else if (irq == ISA_BRIDGE_INT) {
102 int isa_irq;
103
104 if ((isa_irq = i8259_poll(regs)) >= 0)
105 irq = I8259_IRQ_OFFSET + isa_irq;
106 }
107#endif /* CONFIG_PCI */
108 else if (irq == SIU_LEVEL7)
109 irq = -1;
110
111 return irq;
112}
113
114#if defined(CONFIG_MBX) && defined(CONFIG_PCI)
115/* Only the MBX uses the external 8259. This allows us to catch standard
116 * drivers that may mess up the internal interrupt controllers, and also
117 * allow them to run without modification on the MBX.
118 */
119void mbx_i8259_action(int irq, void *dev_id, struct pt_regs *regs)
120{
121 /* This interrupt handler never actually gets called. It is
122 * installed only to unmask the 8259 cascade interrupt in the SIU
123 * and to make the 8259 cascade interrupt visible in /proc/interrupts.
124 */
125}
126#endif /* CONFIG_PCI */
diff --git a/arch/ppc/syslib/ppc8xx_pic.h b/arch/ppc/syslib/ppc8xx_pic.h
deleted file mode 100644
index 53bcd97ef7f5..000000000000
--- a/arch/ppc/syslib/ppc8xx_pic.h
+++ /dev/null
@@ -1,19 +0,0 @@
1#ifndef _PPC_KERNEL_PPC8xx_H
2#define _PPC_KERNEL_PPC8xx_H
3
4#include <linux/irq.h>
5#include <linux/interrupt.h>
6
7extern struct hw_interrupt_type ppc8xx_pic;
8
9void m8xx_do_IRQ(struct pt_regs *regs,
10 int cpu);
11int m8xx_get_irq(struct pt_regs *regs);
12
13#ifdef CONFIG_MBX
14#include <asm/i8259.h>
15#include <asm/io.h>
16void mbx_i8259_action(int cpl, void *dev_id, struct pt_regs *regs);
17#endif
18
19#endif /* _PPC_KERNEL_PPC8xx_H */
diff --git a/arch/ppc/syslib/ppc_sys.c b/arch/ppc/syslib/ppc_sys.c
deleted file mode 100644
index 837183c24dfc..000000000000
--- a/arch/ppc/syslib/ppc_sys.c
+++ /dev/null
@@ -1,329 +0,0 @@
1/*
2 * PPC System library functions
3 *
4 * Maintainer: Kumar Gala <galak@kernel.crashing.org>
5 *
6 * Copyright 2005 Freescale Semiconductor Inc.
7 * Copyright 2005 MontaVista, Inc. by Vitaly Bordug <vbordug@ru.mvista.com>
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation; either version 2 of the License, or (at your
12 * option) any later version.
13 */
14
15#include <linux/string.h>
16#include <linux/bootmem.h>
17#include <asm/ppc_sys.h>
18
19int (*ppc_sys_device_fixup) (struct platform_device * pdev);
20
21static int ppc_sys_inited;
22static int ppc_sys_func_inited;
23
24static const char *ppc_sys_func_names[] = {
25 [PPC_SYS_FUNC_DUMMY] = "dummy",
26 [PPC_SYS_FUNC_ETH] = "eth",
27 [PPC_SYS_FUNC_UART] = "uart",
28 [PPC_SYS_FUNC_HLDC] = "hldc",
29 [PPC_SYS_FUNC_USB] = "usb",
30 [PPC_SYS_FUNC_IRDA] = "irda",
31};
32
33void __init identify_ppc_sys_by_id(u32 id)
34{
35 unsigned int i = 0;
36 while (1) {
37 if ((ppc_sys_specs[i].mask & id) == ppc_sys_specs[i].value)
38 break;
39 i++;
40 }
41
42 cur_ppc_sys_spec = &ppc_sys_specs[i];
43
44 return;
45}
46
47void __init identify_ppc_sys_by_name(char *name)
48{
49 unsigned int i = 0;
50 while (ppc_sys_specs[i].ppc_sys_name[0]) {
51 if (!strcmp(ppc_sys_specs[i].ppc_sys_name, name))
52 break;
53 i++;
54 }
55 cur_ppc_sys_spec = &ppc_sys_specs[i];
56
57 return;
58}
59
60static int __init count_sys_specs(void)
61{
62 int i = 0;
63 while (ppc_sys_specs[i].ppc_sys_name[0])
64 i++;
65 return i;
66}
67
68static int __init find_chip_by_name_and_id(char *name, u32 id)
69{
70 int ret = -1;
71 unsigned int i = 0;
72 unsigned int j = 0;
73 unsigned int dups = 0;
74
75 unsigned char matched[count_sys_specs()];
76
77 while (ppc_sys_specs[i].ppc_sys_name[0]) {
78 if (!strcmp(ppc_sys_specs[i].ppc_sys_name, name))
79 matched[j++] = i;
80 i++;
81 }
82
83 ret = i;
84
85 if (j != 0) {
86 for (i = 0; i < j; i++) {
87 if ((ppc_sys_specs[matched[i]].mask & id) ==
88 ppc_sys_specs[matched[i]].value) {
89 ret = matched[i];
90 dups++;
91 }
92 }
93 ret = (dups == 1) ? ret : (-1 * dups);
94 }
95 return ret;
96}
97
98void __init identify_ppc_sys_by_name_and_id(char *name, u32 id)
99{
100 int i = find_chip_by_name_and_id(name, id);
101 BUG_ON(i < 0);
102 cur_ppc_sys_spec = &ppc_sys_specs[i];
103}
104
105/* Update all memory resources by paddr, call before platform_device_register */
106void __init
107ppc_sys_fixup_mem_resource(struct platform_device *pdev, phys_addr_t paddr)
108{
109 int i;
110 for (i = 0; i < pdev->num_resources; i++) {
111 struct resource *r = &pdev->resource[i];
112 if (((r->flags & IORESOURCE_MEM) == IORESOURCE_MEM) &&
113 ((r->flags & PPC_SYS_IORESOURCE_FIXUPPED) != PPC_SYS_IORESOURCE_FIXUPPED)) {
114 r->start += paddr;
115 r->end += paddr;
116 r->flags |= PPC_SYS_IORESOURCE_FIXUPPED;
117 }
118 }
119}
120
121/* Get platform_data pointer out of platform device, call before platform_device_register */
122void *__init ppc_sys_get_pdata(enum ppc_sys_devices dev)
123{
124 return ppc_sys_platform_devices[dev].dev.platform_data;
125}
126
127void ppc_sys_device_remove(enum ppc_sys_devices dev)
128{
129 unsigned int i;
130
131 if (ppc_sys_inited) {
132 platform_device_unregister(&ppc_sys_platform_devices[dev]);
133 } else {
134 if (cur_ppc_sys_spec == NULL)
135 return;
136 for (i = 0; i < cur_ppc_sys_spec->num_devices; i++)
137 if (cur_ppc_sys_spec->device_list[i] == dev)
138 cur_ppc_sys_spec->device_list[i] = -1;
139 }
140}
141
142/* Platform-notify mapping
143 * Helper function for BSP code to assign board-specific platfom-divice bits
144 */
145
146void platform_notify_map(const struct platform_notify_dev_map *map,
147 struct device *dev)
148{
149 struct platform_device *pdev;
150 int len, idx;
151 const char *s;
152
153 /* do nothing if no device or no bus_id */
154 if (!dev || !dev->bus_id)
155 return;
156
157 /* call per device map */
158 while (map->bus_id != NULL) {
159 idx = -1;
160 s = strrchr(dev->bus_id, '.');
161 if (s != NULL) {
162 idx = (int)simple_strtol(s + 1, NULL, 10);
163 len = s - dev->bus_id;
164 } else {
165 s = dev->bus_id;
166 len = strlen(dev->bus_id);
167 }
168
169 if (!strncmp(dev->bus_id, map->bus_id, len)) {
170 pdev = container_of(dev, struct platform_device, dev);
171 map->rtn(pdev, idx);
172 }
173 map++;
174 }
175}
176
177/*
178 Function assignment stuff.
179 Intended to work as follows:
180 the device name defined in foo_devices.c will be concatenated with :"func",
181 where func is string map of respective function from platfom_device_func enum
182
183 The PPC_SYS_FUNC_DUMMY function is intended to remove all assignments, making the device to appear
184 in platform bus with unmodified name.
185 */
186
187/*
188 Here we'll replace .name pointers with fixed-length strings
189 Hereby, this should be called *before* any func stuff triggeded.
190 */
191void ppc_sys_device_initfunc(void)
192{
193 int i;
194 const char *name;
195 static char new_names[NUM_PPC_SYS_DEVS][BUS_ID_SIZE];
196 enum ppc_sys_devices cur_dev;
197
198 /* If inited yet, do nothing */
199 if (ppc_sys_func_inited)
200 return;
201
202 for (i = 0; i < cur_ppc_sys_spec->num_devices; i++) {
203 if ((cur_dev = cur_ppc_sys_spec->device_list[i]) < 0)
204 continue;
205
206 if (ppc_sys_platform_devices[cur_dev].name) {
207 /*backup name */
208 name = ppc_sys_platform_devices[cur_dev].name;
209 strlcpy(new_names[i], name, BUS_ID_SIZE);
210 ppc_sys_platform_devices[cur_dev].name = new_names[i];
211 }
212 }
213
214 ppc_sys_func_inited = 1;
215}
216
217/*The "engine" of the func stuff. Here we either concat specified function string description
218 to the name, or remove it if PPC_SYS_FUNC_DUMMY parameter is passed here*/
219void ppc_sys_device_setfunc(enum ppc_sys_devices dev,
220 enum platform_device_func func)
221{
222 char *s;
223 char *name = (char *)ppc_sys_platform_devices[dev].name;
224 char tmp[BUS_ID_SIZE];
225
226 if (!ppc_sys_func_inited) {
227 printk(KERN_ERR "Unable to alter function - not inited!\n");
228 return;
229 }
230
231 if (ppc_sys_inited) {
232 platform_device_unregister(&ppc_sys_platform_devices[dev]);
233 }
234
235 if ((s = (char *)strchr(name, ':')) != NULL) { /* reassign */
236 /* Either change the name after ':' or remove func modifications */
237 if (func != PPC_SYS_FUNC_DUMMY)
238 strlcpy(s + 1, ppc_sys_func_names[func], BUS_ID_SIZE);
239 else
240 *s = 0;
241 } else if (func != PPC_SYS_FUNC_DUMMY) {
242 /* do assignment if it is not just "clear" request */
243 sprintf(tmp, "%s:%s", name, ppc_sys_func_names[func]);
244 strlcpy(name, tmp, BUS_ID_SIZE);
245 }
246
247 if (ppc_sys_inited) {
248 platform_device_register(&ppc_sys_platform_devices[dev]);
249 }
250}
251
252void ppc_sys_device_disable(enum ppc_sys_devices dev)
253{
254 BUG_ON(cur_ppc_sys_spec == NULL);
255
256 /*Check if it is enabled*/
257 if(!(cur_ppc_sys_spec->config[dev] & PPC_SYS_CONFIG_DISABLED)) {
258 if (ppc_sys_inited) {
259 platform_device_unregister(&ppc_sys_platform_devices[dev]);
260 }
261 cur_ppc_sys_spec->config[dev] |= PPC_SYS_CONFIG_DISABLED;
262 }
263}
264
265void ppc_sys_device_enable(enum ppc_sys_devices dev)
266{
267 BUG_ON(cur_ppc_sys_spec == NULL);
268
269 /*Check if it is disabled*/
270 if(cur_ppc_sys_spec->config[dev] & PPC_SYS_CONFIG_DISABLED) {
271 if (ppc_sys_inited) {
272 platform_device_register(&ppc_sys_platform_devices[dev]);
273 }
274 cur_ppc_sys_spec->config[dev] &= ~PPC_SYS_CONFIG_DISABLED;
275 }
276
277}
278
279void ppc_sys_device_enable_all(void)
280{
281 enum ppc_sys_devices cur_dev;
282 int i;
283
284 for (i = 0; i < cur_ppc_sys_spec->num_devices; i++) {
285 cur_dev = cur_ppc_sys_spec->device_list[i];
286 ppc_sys_device_enable(cur_dev);
287 }
288}
289
290void ppc_sys_device_disable_all(void)
291{
292 enum ppc_sys_devices cur_dev;
293 int i;
294
295 for (i = 0; i < cur_ppc_sys_spec->num_devices; i++) {
296 cur_dev = cur_ppc_sys_spec->device_list[i];
297 ppc_sys_device_disable(cur_dev);
298 }
299}
300
301
302static int __init ppc_sys_init(void)
303{
304 unsigned int i, dev_id, ret = 0;
305
306 BUG_ON(cur_ppc_sys_spec == NULL);
307
308 for (i = 0; i < cur_ppc_sys_spec->num_devices; i++) {
309 dev_id = cur_ppc_sys_spec->device_list[i];
310 if ((dev_id != -1) &&
311 !(cur_ppc_sys_spec->config[dev_id] & PPC_SYS_CONFIG_DISABLED)) {
312 if (ppc_sys_device_fixup != NULL)
313 ppc_sys_device_fixup(&ppc_sys_platform_devices
314 [dev_id]);
315 if (platform_device_register
316 (&ppc_sys_platform_devices[dev_id])) {
317 ret = 1;
318 printk(KERN_ERR
319 "unable to register device %d\n",
320 dev_id);
321 }
322 }
323 }
324
325 ppc_sys_inited = 1;
326 return ret;
327}
328
329subsys_initcall(ppc_sys_init);
diff --git a/arch/ppc/syslib/pq2_devices.c b/arch/ppc/syslib/pq2_devices.c
deleted file mode 100644
index fefbc217a56d..000000000000
--- a/arch/ppc/syslib/pq2_devices.c
+++ /dev/null
@@ -1,393 +0,0 @@
1/*
2 * PQ2 Device descriptions
3 *
4 * Maintainer: Kumar Gala <galak@kernel.crashing.org>
5 *
6 * This file is licensed under the terms of the GNU General Public License
7 * version 2. This program is licensed "as is" without any warranty of any
8 * kind, whether express or implied.
9 */
10
11
12#include <linux/init.h>
13#include <linux/module.h>
14#include <linux/platform_device.h>
15#include <linux/ioport.h>
16#include <asm/cpm2.h>
17#include <asm/irq.h>
18#include <asm/ppc_sys.h>
19#include <asm/machdep.h>
20
21struct platform_device ppc_sys_platform_devices[] = {
22 [MPC82xx_CPM_FCC1] = {
23 .name = "fsl-cpm-fcc",
24 .id = 1,
25 .num_resources = 3,
26 .resource = (struct resource[]) {
27 {
28 .name = "fcc_regs",
29 .start = 0x11300,
30 .end = 0x1131f,
31 .flags = IORESOURCE_MEM,
32 },
33 {
34 .name = "fcc_pram",
35 .start = 0x8400,
36 .end = 0x84ff,
37 .flags = IORESOURCE_MEM,
38 },
39 {
40 .start = SIU_INT_FCC1,
41 .end = SIU_INT_FCC1,
42 .flags = IORESOURCE_IRQ,
43 },
44 },
45 },
46 [MPC82xx_CPM_FCC2] = {
47 .name = "fsl-cpm-fcc",
48 .id = 2,
49 .num_resources = 3,
50 .resource = (struct resource[]) {
51 {
52 .name = "fcc_regs",
53 .start = 0x11320,
54 .end = 0x1133f,
55 .flags = IORESOURCE_MEM,
56 },
57 {
58 .name = "fcc_pram",
59 .start = 0x8500,
60 .end = 0x85ff,
61 .flags = IORESOURCE_MEM,
62 },
63 {
64 .start = SIU_INT_FCC2,
65 .end = SIU_INT_FCC2,
66 .flags = IORESOURCE_IRQ,
67 },
68 },
69 },
70 [MPC82xx_CPM_FCC3] = {
71 .name = "fsl-cpm-fcc",
72 .id = 3,
73 .num_resources = 3,
74 .resource = (struct resource[]) {
75 {
76 .name = "fcc_regs",
77 .start = 0x11340,
78 .end = 0x1135f,
79 .flags = IORESOURCE_MEM,
80 },
81 {
82 .name = "fcc_pram",
83 .start = 0x8600,
84 .end = 0x86ff,
85 .flags = IORESOURCE_MEM,
86 },
87 {
88 .start = SIU_INT_FCC3,
89 .end = SIU_INT_FCC3,
90 .flags = IORESOURCE_IRQ,
91 },
92 },
93 },
94 [MPC82xx_CPM_I2C] = {
95 .name = "fsl-cpm-i2c",
96 .id = 1,
97 .num_resources = 3,
98 .resource = (struct resource[]) {
99 {
100 .name = "i2c_mem",
101 .start = 0x11860,
102 .end = 0x118BF,
103 .flags = IORESOURCE_MEM,
104 },
105 {
106 .name = "i2c_pram",
107 .start = 0x8afc,
108 .end = 0x8afd,
109 .flags = IORESOURCE_MEM,
110 },
111 {
112 .start = SIU_INT_I2C,
113 .end = SIU_INT_I2C,
114 .flags = IORESOURCE_IRQ,
115 },
116 },
117 },
118 [MPC82xx_CPM_SCC1] = {
119 .name = "fsl-cpm-scc",
120 .id = 1,
121 .num_resources = 3,
122 .resource = (struct resource[]) {
123 {
124 .name = "regs",
125 .start = 0x11A00,
126 .end = 0x11A1F,
127 .flags = IORESOURCE_MEM,
128 },
129 {
130 .name = "pram",
131 .start = 0x8000,
132 .end = 0x80ff,
133 .flags = IORESOURCE_MEM,
134 },
135 {
136 .start = SIU_INT_SCC1,
137 .end = SIU_INT_SCC1,
138 .flags = IORESOURCE_IRQ,
139 },
140 },
141 },
142 [MPC82xx_CPM_SCC2] = {
143 .name = "fsl-cpm-scc",
144 .id = 2,
145 .num_resources = 3,
146 .resource = (struct resource[]) {
147 {
148 .name = "regs",
149 .start = 0x11A20,
150 .end = 0x11A3F,
151 .flags = IORESOURCE_MEM,
152 },
153 {
154 .name = "pram",
155 .start = 0x8100,
156 .end = 0x81ff,
157 .flags = IORESOURCE_MEM,
158 },
159 {
160 .start = SIU_INT_SCC2,
161 .end = SIU_INT_SCC2,
162 .flags = IORESOURCE_IRQ,
163 },
164 },
165 },
166 [MPC82xx_CPM_SCC3] = {
167 .name = "fsl-cpm-scc",
168 .id = 3,
169 .num_resources = 3,
170 .resource = (struct resource[]) {
171 {
172 .name = "regs",
173 .start = 0x11A40,
174 .end = 0x11A5F,
175 .flags = IORESOURCE_MEM,
176 },
177 {
178 .name = "pram",
179 .start = 0x8200,
180 .end = 0x82ff,
181 .flags = IORESOURCE_MEM,
182 },
183 {
184 .start = SIU_INT_SCC3,
185 .end = SIU_INT_SCC3,
186 .flags = IORESOURCE_IRQ,
187 },
188 },
189 },
190 [MPC82xx_CPM_SCC4] = {
191 .name = "fsl-cpm-scc",
192 .id = 4,
193 .num_resources = 3,
194 .resource = (struct resource[]) {
195 {
196 .name = "regs",
197 .start = 0x11A60,
198 .end = 0x11A7F,
199 .flags = IORESOURCE_MEM,
200 },
201 {
202 .name = "pram",
203 .start = 0x8300,
204 .end = 0x83ff,
205 .flags = IORESOURCE_MEM,
206 },
207 {
208 .start = SIU_INT_SCC4,
209 .end = SIU_INT_SCC4,
210 .flags = IORESOURCE_IRQ,
211 },
212 },
213 },
214 [MPC82xx_CPM_SPI] = {
215 .name = "fsl-cpm-spi",
216 .id = 1,
217 .num_resources = 3,
218 .resource = (struct resource[]) {
219 {
220 .name = "spi_mem",
221 .start = 0x11AA0,
222 .end = 0x11AFF,
223 .flags = IORESOURCE_MEM,
224 },
225 {
226 .name = "spi_pram",
227 .start = 0x89fc,
228 .end = 0x89fd,
229 .flags = IORESOURCE_MEM,
230 },
231 {
232 .start = SIU_INT_SPI,
233 .end = SIU_INT_SPI,
234 .flags = IORESOURCE_IRQ,
235 },
236 },
237 },
238 [MPC82xx_CPM_MCC1] = {
239 .name = "fsl-cpm-mcc",
240 .id = 1,
241 .num_resources = 3,
242 .resource = (struct resource[]) {
243 {
244 .name = "mcc_mem",
245 .start = 0x11B30,
246 .end = 0x11B3F,
247 .flags = IORESOURCE_MEM,
248 },
249 {
250 .name = "mcc_pram",
251 .start = 0x8700,
252 .end = 0x877f,
253 .flags = IORESOURCE_MEM,
254 },
255 {
256 .start = SIU_INT_MCC1,
257 .end = SIU_INT_MCC1,
258 .flags = IORESOURCE_IRQ,
259 },
260 },
261 },
262 [MPC82xx_CPM_MCC2] = {
263 .name = "fsl-cpm-mcc",
264 .id = 2,
265 .num_resources = 3,
266 .resource = (struct resource[]) {
267 {
268 .name = "mcc_mem",
269 .start = 0x11B50,
270 .end = 0x11B5F,
271 .flags = IORESOURCE_MEM,
272 },
273 {
274 .name = "mcc_pram",
275 .start = 0x8800,
276 .end = 0x887f,
277 .flags = IORESOURCE_MEM,
278 },
279 {
280 .start = SIU_INT_MCC2,
281 .end = SIU_INT_MCC2,
282 .flags = IORESOURCE_IRQ,
283 },
284 },
285 },
286 [MPC82xx_CPM_SMC1] = {
287 .name = "fsl-cpm-smc",
288 .id = 1,
289 .num_resources = 3,
290 .resource = (struct resource[]) {
291 {
292 .name = "smc_mem",
293 .start = 0x11A80,
294 .end = 0x11A8F,
295 .flags = IORESOURCE_MEM,
296 },
297 {
298 .name = "smc_pram",
299 .start = 0x87fc,
300 .end = 0x87fd,
301 .flags = IORESOURCE_MEM,
302 },
303 {
304 .start = SIU_INT_SMC1,
305 .end = SIU_INT_SMC1,
306 .flags = IORESOURCE_IRQ,
307 },
308 },
309 },
310 [MPC82xx_CPM_SMC2] = {
311 .name = "fsl-cpm-smc",
312 .id = 2,
313 .num_resources = 3,
314 .resource = (struct resource[]) {
315 {
316 .name = "smc_mem",
317 .start = 0x11A90,
318 .end = 0x11A9F,
319 .flags = IORESOURCE_MEM,
320 },
321 {
322 .name = "smc_pram",
323 .start = 0x88fc,
324 .end = 0x88fd,
325 .flags = IORESOURCE_MEM,
326 },
327 {
328 .start = SIU_INT_SMC2,
329 .end = SIU_INT_SMC2,
330 .flags = IORESOURCE_IRQ,
331 },
332 },
333 },
334 [MPC82xx_CPM_USB] = {
335 .name = "fsl-cpm-usb",
336 .id = 1,
337 .num_resources = 3,
338 .resource = (struct resource[]) {
339 {
340 .name = "usb_mem",
341 .start = 0x11b60,
342 .end = 0x11b78,
343 .flags = IORESOURCE_MEM,
344 },
345 {
346 .name = "usb_pram",
347 .start = 0x8b00,
348 .end = 0x8bff,
349 .flags = IORESOURCE_MEM,
350 },
351 {
352 .start = SIU_INT_USB,
353 .end = SIU_INT_USB,
354 .flags = IORESOURCE_IRQ,
355 },
356
357 },
358 },
359 [MPC82xx_SEC1] = {
360 .name = "fsl-sec",
361 .id = 1,
362 .num_resources = 1,
363 .resource = (struct resource[]) {
364 {
365 .name = "sec_mem",
366 .start = 0x40000,
367 .end = 0x52fff,
368 .flags = IORESOURCE_MEM,
369 },
370 },
371 },
372 [MPC82xx_MDIO_BB] = {
373 .name = "fsl-bb-mdio",
374 .id = 0,
375 .num_resources = 0,
376 },
377};
378
379static int __init mach_mpc82xx_fixup(struct platform_device *pdev)
380{
381 ppc_sys_fixup_mem_resource(pdev, CPM_MAP_ADDR);
382 return 0;
383}
384
385static int __init mach_mpc82xx_init(void)
386{
387 if (ppc_md.progress)
388 ppc_md.progress("mach_mpc82xx_init:enter", 0);
389 ppc_sys_device_fixup = mach_mpc82xx_fixup;
390 return 0;
391}
392
393postcore_initcall(mach_mpc82xx_init);
diff --git a/arch/ppc/syslib/pq2_sys.c b/arch/ppc/syslib/pq2_sys.c
deleted file mode 100644
index 9c85300846c7..000000000000
--- a/arch/ppc/syslib/pq2_sys.c
+++ /dev/null
@@ -1,203 +0,0 @@
1/*
2 * PQ2 System descriptions
3 *
4 * Maintainer: Kumar Gala <galak@kernel.crashing.org>
5 *
6 * This file is licensed under the terms of the GNU General Public License
7 * version 2. This program is licensed "as is" without any warranty of any
8 * kind, whether express or implied.
9 */
10
11#include <linux/init.h>
12#include <linux/module.h>
13#include <linux/device.h>
14
15#include <asm/ppc_sys.h>
16
17struct ppc_sys_spec *cur_ppc_sys_spec;
18struct ppc_sys_spec ppc_sys_specs[] = {
19 /* below is a list of the 8260 family of processors */
20 {
21 .ppc_sys_name = "8250",
22 .mask = 0x0000ff00,
23 .value = 0x00000000,
24 .num_devices = 12,
25 .device_list = (enum ppc_sys_devices[])
26 {
27 MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_FCC3,
28 MPC82xx_CPM_SCC1, MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3,
29 MPC82xx_CPM_SCC4, MPC82xx_CPM_MCC2, MPC82xx_CPM_SMC1,
30 MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI, MPC82xx_CPM_I2C,
31 }
32 },
33 {
34 .ppc_sys_name = "8255",
35 .mask = 0x0000ff00,
36 .value = 0x00000000,
37 .num_devices = 11,
38 .device_list = (enum ppc_sys_devices[])
39 {
40 MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_SCC1,
41 MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3, MPC82xx_CPM_SCC4,
42 MPC82xx_CPM_MCC2, MPC82xx_CPM_SMC1, MPC82xx_CPM_SMC2,
43 MPC82xx_CPM_SPI, MPC82xx_CPM_I2C,
44 }
45 },
46 {
47 .ppc_sys_name = "8260",
48 .mask = 0x0000ff00,
49 .value = 0x00000000,
50 .num_devices = 13,
51 .device_list = (enum ppc_sys_devices[])
52 {
53 MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_FCC3,
54 MPC82xx_CPM_SCC1, MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3,
55 MPC82xx_CPM_SCC4, MPC82xx_CPM_MCC1, MPC82xx_CPM_MCC2,
56 MPC82xx_CPM_SMC1, MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI,
57 MPC82xx_CPM_I2C,
58 }
59 },
60 {
61 .ppc_sys_name = "8264",
62 .mask = 0x0000ff00,
63 .value = 0x00000000,
64 .num_devices = 13,
65 .device_list = (enum ppc_sys_devices[])
66 {
67 MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_FCC3,
68 MPC82xx_CPM_SCC1, MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3,
69 MPC82xx_CPM_SCC4, MPC82xx_CPM_MCC1, MPC82xx_CPM_MCC2,
70 MPC82xx_CPM_SMC1, MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI,
71 MPC82xx_CPM_I2C,
72 }
73 },
74 {
75 .ppc_sys_name = "8265",
76 .mask = 0x0000ff00,
77 .value = 0x00000000,
78 .num_devices = 13,
79 .device_list = (enum ppc_sys_devices[])
80 {
81 MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_FCC3,
82 MPC82xx_CPM_SCC1, MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3,
83 MPC82xx_CPM_SCC4, MPC82xx_CPM_MCC1, MPC82xx_CPM_MCC2,
84 MPC82xx_CPM_SMC1, MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI,
85 MPC82xx_CPM_I2C,
86 }
87 },
88 {
89 .ppc_sys_name = "8266",
90 .mask = 0x0000ff00,
91 .value = 0x00000000,
92 .num_devices = 13,
93 .device_list = (enum ppc_sys_devices[])
94 {
95 MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_FCC3,
96 MPC82xx_CPM_SCC1, MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3,
97 MPC82xx_CPM_SCC4, MPC82xx_CPM_MCC1, MPC82xx_CPM_MCC2,
98 MPC82xx_CPM_SMC1, MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI,
99 MPC82xx_CPM_I2C,
100 }
101 },
102 /* below is a list of the 8272 family of processors */
103 {
104 .ppc_sys_name = "8247",
105 .mask = 0x0000ff00,
106 .value = 0x00000d00,
107 .num_devices = 10,
108 .device_list = (enum ppc_sys_devices[])
109 {
110 MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_SCC1,
111 MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3, MPC82xx_CPM_SMC1,
112 MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI, MPC82xx_CPM_I2C,
113 MPC82xx_CPM_USB,
114 },
115 },
116 {
117 .ppc_sys_name = "8248",
118 .mask = 0x0000ff00,
119 .value = 0x00000c00,
120 .num_devices = 12,
121 .device_list = (enum ppc_sys_devices[])
122 {
123 MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_SCC1,
124 MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3, MPC82xx_CPM_SCC4,
125 MPC82xx_CPM_SMC1, MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI,
126 MPC82xx_CPM_I2C, MPC82xx_CPM_USB, MPC82xx_SEC1,
127 },
128 },
129 {
130 .ppc_sys_name = "8271",
131 .mask = 0x0000ff00,
132 .value = 0x00000d00,
133 .num_devices = 10,
134 .device_list = (enum ppc_sys_devices[])
135 {
136 MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_SCC1,
137 MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3, MPC82xx_CPM_SMC1,
138 MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI, MPC82xx_CPM_I2C,
139 MPC82xx_CPM_USB,
140 },
141 },
142 {
143 .ppc_sys_name = "8272",
144 .mask = 0x0000ff00,
145 .value = 0x00000c00,
146 .num_devices = 13,
147 .device_list = (enum ppc_sys_devices[])
148 {
149 MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_SCC1,
150 MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3, MPC82xx_CPM_SCC4,
151 MPC82xx_CPM_SMC1, MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI,
152 MPC82xx_CPM_I2C, MPC82xx_CPM_USB, MPC82xx_SEC1,
153 MPC82xx_MDIO_BB,
154 },
155 },
156 /* below is a list of the 8280 family of processors */
157 {
158 .ppc_sys_name = "8270",
159 .mask = 0x0000ff00,
160 .value = 0x00000a00,
161 .num_devices = 12,
162 .device_list = (enum ppc_sys_devices[])
163 {
164 MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_FCC3,
165 MPC82xx_CPM_SCC1, MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3,
166 MPC82xx_CPM_SCC4, MPC82xx_CPM_MCC2, MPC82xx_CPM_SMC1,
167 MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI, MPC82xx_CPM_I2C,
168 },
169 },
170 {
171 .ppc_sys_name = "8275",
172 .mask = 0x0000ff00,
173 .value = 0x00000a00,
174 .num_devices = 12,
175 .device_list = (enum ppc_sys_devices[])
176 {
177 MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_FCC3,
178 MPC82xx_CPM_SCC1, MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3,
179 MPC82xx_CPM_SCC4, MPC82xx_CPM_MCC2, MPC82xx_CPM_SMC1,
180 MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI, MPC82xx_CPM_I2C,
181 },
182 },
183 {
184 .ppc_sys_name = "8280",
185 .mask = 0x0000ff00,
186 .value = 0x00000a00,
187 .num_devices = 13,
188 .device_list = (enum ppc_sys_devices[])
189 {
190 MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_FCC3,
191 MPC82xx_CPM_SCC1, MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3,
192 MPC82xx_CPM_SCC4, MPC82xx_CPM_MCC1, MPC82xx_CPM_MCC2,
193 MPC82xx_CPM_SMC1, MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI,
194 MPC82xx_CPM_I2C,
195 },
196 },
197 {
198 /* default match */
199 .ppc_sys_name = "",
200 .mask = 0x00000000,
201 .value = 0x00000000,
202 },
203};
diff --git a/arch/ppc/syslib/prep_nvram.c b/arch/ppc/syslib/prep_nvram.c
deleted file mode 100644
index 474dccbc4a8a..000000000000
--- a/arch/ppc/syslib/prep_nvram.c
+++ /dev/null
@@ -1,135 +0,0 @@
1/*
2 * Copyright (C) 1998 Corey Minyard
3 *
4 * This reads the NvRAM on PReP compliant machines (generally from IBM or
5 * Motorola). Motorola kept the format of NvRAM in their ROM, PPCBUG, the
6 * same, long after they had stopped producing PReP compliant machines. So
7 * this code is useful in those cases as well.
8 *
9 */
10#include <linux/init.h>
11#include <linux/delay.h>
12#include <linux/slab.h>
13#include <linux/ioport.h>
14
15#include <asm/sections.h>
16#include <asm/io.h>
17#include <asm/machdep.h>
18#include <asm/prep_nvram.h>
19
20static char nvramData[MAX_PREP_NVRAM];
21static NVRAM_MAP *nvram=(NVRAM_MAP *)&nvramData[0];
22
23unsigned char prep_nvram_read_val(int addr)
24{
25 outb(addr, PREP_NVRAM_AS0);
26 outb(addr>>8, PREP_NVRAM_AS1);
27 return inb(PREP_NVRAM_DATA);
28}
29
30void prep_nvram_write_val(int addr,
31 unsigned char val)
32{
33 outb(addr, PREP_NVRAM_AS0);
34 outb(addr>>8, PREP_NVRAM_AS1);
35 outb(val, PREP_NVRAM_DATA);
36}
37
38void __init init_prep_nvram(void)
39{
40 unsigned char *nvp;
41 int i;
42 int nvramSize;
43
44 /*
45 * The following could fail if the NvRAM were corrupt but
46 * we expect the boot firmware to have checked its checksum
47 * before boot
48 */
49 nvp = (char *) &nvram->Header;
50 for (i=0; i<sizeof(HEADER); i++)
51 {
52 *nvp = ppc_md.nvram_read_val(i);
53 nvp++;
54 }
55
56 /*
57 * The PReP NvRAM may be any size so read in the header to
58 * determine how much we must read in order to get the complete
59 * GE area
60 */
61 nvramSize=(int)nvram->Header.GEAddress+nvram->Header.GELength;
62 if(nvramSize>MAX_PREP_NVRAM)
63 {
64 /*
65 * NvRAM is too large
66 */
67 nvram->Header.GELength=0;
68 return;
69 }
70
71 /*
72 * Read the remainder of the PReP NvRAM
73 */
74 nvp = (char *) &nvram->GEArea[0];
75 for (i=sizeof(HEADER); i<nvramSize; i++)
76 {
77 *nvp = ppc_md.nvram_read_val(i);
78 nvp++;
79 }
80}
81
82char *prep_nvram_get_var(const char *name)
83{
84 char *cp;
85 int namelen;
86
87 namelen = strlen(name);
88 cp = prep_nvram_first_var();
89 while (cp != NULL) {
90 if ((strncmp(name, cp, namelen) == 0)
91 && (cp[namelen] == '='))
92 {
93 return cp+namelen+1;
94 }
95 cp = prep_nvram_next_var(cp);
96 }
97
98 return NULL;
99}
100
101char *prep_nvram_first_var(void)
102{
103 if (nvram->Header.GELength == 0) {
104 return NULL;
105 } else {
106 return (((char *)nvram)
107 + ((unsigned int) nvram->Header.GEAddress));
108 }
109}
110
111char *prep_nvram_next_var(char *name)
112{
113 char *cp;
114
115
116 cp = name;
117 while (((cp - ((char *) nvram->GEArea)) < nvram->Header.GELength)
118 && (*cp != '\0'))
119 {
120 cp++;
121 }
122
123 /* Skip over any null characters. */
124 while (((cp - ((char *) nvram->GEArea)) < nvram->Header.GELength)
125 && (*cp == '\0'))
126 {
127 cp++;
128 }
129
130 if ((cp - ((char *) nvram->GEArea)) < nvram->Header.GELength) {
131 return cp;
132 } else {
133 return NULL;
134 }
135}
diff --git a/arch/ppc/syslib/qspan_pci.c b/arch/ppc/syslib/qspan_pci.c
deleted file mode 100644
index 7a97c7440b30..000000000000
--- a/arch/ppc/syslib/qspan_pci.c
+++ /dev/null
@@ -1,380 +0,0 @@
1/*
2 * QSpan pci routines.
3 * Most 8xx boards use the QSpan PCI bridge. The config address register
4 * is located 0x500 from the base of the bridge control/status registers.
5 * The data register is located at 0x504.
6 * This is a two step operation. First, the address register is written,
7 * then the data register is read/written as required.
8 * I don't know what to do about interrupts (yet).
9 *
10 * The RPX Classic implementation shares a chip select for normal
11 * PCI access and QSpan control register addresses. The selection is
12 * further selected by a bit setting in a board control register.
13 * Although it should happen, we disable interrupts during this operation
14 * to make sure some driver doesn't accidentally access the PCI while
15 * we have switched the chip select.
16 */
17
18#include <linux/kernel.h>
19#include <linux/pci.h>
20#include <linux/delay.h>
21#include <linux/string.h>
22#include <linux/init.h>
23
24#include <asm/io.h>
25#include <asm/mpc8xx.h>
26#include <asm/system.h>
27#include <asm/machdep.h>
28#include <asm/pci-bridge.h>
29
30
31/*
32 * This blows......
33 * When reading the configuration space, if something does not respond
34 * the bus times out and we get a machine check interrupt. So, the
35 * good ol' exception tables come to mind to trap it and return some
36 * value.
37 *
38 * On an error we just return a -1, since that is what the caller wants
39 * returned if nothing is present. I copied this from __get_user_asm,
40 * with the only difference of returning -1 instead of EFAULT.
41 * There is an associated hack in the machine check trap code.
42 *
43 * The QSPAN is also a big endian device, that is it makes the PCI
44 * look big endian to us. This presents a problem for the Linux PCI
45 * functions, which assume little endian. For example, we see the
46 * first 32-bit word like this:
47 * ------------------------
48 * | Device ID | Vendor ID |
49 * ------------------------
50 * If we read/write as a double word, that's OK. But in our world,
51 * when read as a word, device ID is at location 0, not location 2 as
52 * the little endian PCI would believe. We have to switch bits in
53 * the PCI addresses given to us to get the data to/from the correct
54 * byte lanes.
55 *
56 * The QSPAN only supports 4 bits of "slot" in the dev_fn instead of 5.
57 * It always forces the MS bit to zero. Therefore, dev_fn values
58 * greater than 128 are returned as "no device found" errors.
59 *
60 * The QSPAN can only perform long word (32-bit) configuration cycles.
61 * The "offset" must have the two LS bits set to zero. Read operations
62 * require we read the entire word and then sort out what should be
63 * returned. Write operations other than long word require that we
64 * read the long word, update the proper word or byte, then write the
65 * entire long word back.
66 *
67 * PCI Bridge hack. We assume (correctly) that bus 0 is the primary
68 * PCI bus from the QSPAN. If we are called with a bus number other
69 * than zero, we create a Type 1 configuration access that a downstream
70 * PCI bridge will interpret.
71 */
72
73#define __get_qspan_pci_config(x, addr, op) \
74 __asm__ __volatile__( \
75 "1: "op" %0,0(%1)\n" \
76 " eieio\n" \
77 "2:\n" \
78 ".section .fixup,\"ax\"\n" \
79 "3: li %0,-1\n" \
80 " b 2b\n" \
81 ".section __ex_table,\"a\"\n" \
82 " .align 2\n" \
83 " .long 1b,3b\n" \
84 ".text" \
85 : "=r"(x) : "r"(addr) : " %0")
86
87#define QS_CONFIG_ADDR ((volatile uint *)(PCI_CSR_ADDR + 0x500))
88#define QS_CONFIG_DATA ((volatile uint *)(PCI_CSR_ADDR + 0x504))
89
90#define mk_config_addr(bus, dev, offset) \
91 (((bus)<<16) | ((dev)<<8) | (offset & 0xfc))
92
93#define mk_config_type1(bus, dev, offset) \
94 mk_config_addr(bus, dev, offset) | 1;
95
96static DEFINE_SPINLOCK(pcibios_lock);
97
98int qspan_pcibios_read_config_byte(unsigned char bus, unsigned char dev_fn,
99 unsigned char offset, unsigned char *val)
100{
101 uint temp;
102 u_char *cp;
103#ifdef CONFIG_RPXCLASSIC
104 unsigned long flags;
105#endif
106
107 if ((bus > 7) || (dev_fn > 127)) {
108 *val = 0xff;
109 return PCIBIOS_DEVICE_NOT_FOUND;
110 }
111
112#ifdef CONFIG_RPXCLASSIC
113 /* disable interrupts */
114 spin_lock_irqsave(&pcibios_lock, flags);
115 *((uint *)RPX_CSR_ADDR) &= ~BCSR2_QSPACESEL;
116 eieio();
117#endif
118
119 if (bus == 0)
120 *QS_CONFIG_ADDR = mk_config_addr(bus, dev_fn, offset);
121 else
122 *QS_CONFIG_ADDR = mk_config_type1(bus, dev_fn, offset);
123 __get_qspan_pci_config(temp, QS_CONFIG_DATA, "lwz");
124
125#ifdef CONFIG_RPXCLASSIC
126 *((uint *)RPX_CSR_ADDR) |= BCSR2_QSPACESEL;
127 eieio();
128 spin_unlock_irqrestore(&pcibios_lock, flags);
129#endif
130
131 offset ^= 0x03;
132 cp = ((u_char *)&temp) + (offset & 0x03);
133 *val = *cp;
134 return PCIBIOS_SUCCESSFUL;
135}
136
137int qspan_pcibios_read_config_word(unsigned char bus, unsigned char dev_fn,
138 unsigned char offset, unsigned short *val)
139{
140 uint temp;
141 ushort *sp;
142#ifdef CONFIG_RPXCLASSIC
143 unsigned long flags;
144#endif
145
146 if ((bus > 7) || (dev_fn > 127)) {
147 *val = 0xffff;
148 return PCIBIOS_DEVICE_NOT_FOUND;
149 }
150
151#ifdef CONFIG_RPXCLASSIC
152 /* disable interrupts */
153 spin_lock_irqsave(&pcibios_lock, flags);
154 *((uint *)RPX_CSR_ADDR) &= ~BCSR2_QSPACESEL;
155 eieio();
156#endif
157
158 if (bus == 0)
159 *QS_CONFIG_ADDR = mk_config_addr(bus, dev_fn, offset);
160 else
161 *QS_CONFIG_ADDR = mk_config_type1(bus, dev_fn, offset);
162 __get_qspan_pci_config(temp, QS_CONFIG_DATA, "lwz");
163 offset ^= 0x02;
164
165#ifdef CONFIG_RPXCLASSIC
166 *((uint *)RPX_CSR_ADDR) |= BCSR2_QSPACESEL;
167 eieio();
168 spin_unlock_irqrestore(&pcibios_lock, flags);
169#endif
170
171 sp = ((ushort *)&temp) + ((offset >> 1) & 1);
172 *val = *sp;
173 return PCIBIOS_SUCCESSFUL;
174}
175
176int qspan_pcibios_read_config_dword(unsigned char bus, unsigned char dev_fn,
177 unsigned char offset, unsigned int *val)
178{
179#ifdef CONFIG_RPXCLASSIC
180 unsigned long flags;
181#endif
182
183 if ((bus > 7) || (dev_fn > 127)) {
184 *val = 0xffffffff;
185 return PCIBIOS_DEVICE_NOT_FOUND;
186 }
187
188#ifdef CONFIG_RPXCLASSIC
189 /* disable interrupts */
190 spin_lock_irqsave(&pcibios_lock, flags);
191 *((uint *)RPX_CSR_ADDR) &= ~BCSR2_QSPACESEL;
192 eieio();
193#endif
194
195 if (bus == 0)
196 *QS_CONFIG_ADDR = mk_config_addr(bus, dev_fn, offset);
197 else
198 *QS_CONFIG_ADDR = mk_config_type1(bus, dev_fn, offset);
199 __get_qspan_pci_config(*val, QS_CONFIG_DATA, "lwz");
200
201#ifdef CONFIG_RPXCLASSIC
202 *((uint *)RPX_CSR_ADDR) |= BCSR2_QSPACESEL;
203 eieio();
204 spin_unlock_irqrestore(&pcibios_lock, flags);
205#endif
206
207 return PCIBIOS_SUCCESSFUL;
208}
209
210int qspan_pcibios_write_config_byte(unsigned char bus, unsigned char dev_fn,
211 unsigned char offset, unsigned char val)
212{
213 uint temp;
214 u_char *cp;
215#ifdef CONFIG_RPXCLASSIC
216 unsigned long flags;
217#endif
218
219 if ((bus > 7) || (dev_fn > 127))
220 return PCIBIOS_DEVICE_NOT_FOUND;
221
222 qspan_pcibios_read_config_dword(bus, dev_fn, offset, &temp);
223
224 offset ^= 0x03;
225 cp = ((u_char *)&temp) + (offset & 0x03);
226 *cp = val;
227
228#ifdef CONFIG_RPXCLASSIC
229 /* disable interrupts */
230 spin_lock_irqsave(&pcibios_lock, flags);
231 *((uint *)RPX_CSR_ADDR) &= ~BCSR2_QSPACESEL;
232 eieio();
233#endif
234
235 if (bus == 0)
236 *QS_CONFIG_ADDR = mk_config_addr(bus, dev_fn, offset);
237 else
238 *QS_CONFIG_ADDR = mk_config_type1(bus, dev_fn, offset);
239 *QS_CONFIG_DATA = temp;
240
241#ifdef CONFIG_RPXCLASSIC
242 *((uint *)RPX_CSR_ADDR) |= BCSR2_QSPACESEL;
243 eieio();
244 spin_unlock_irqrestore(&pcibios_lock, flags);
245#endif
246
247 return PCIBIOS_SUCCESSFUL;
248}
249
250int qspan_pcibios_write_config_word(unsigned char bus, unsigned char dev_fn,
251 unsigned char offset, unsigned short val)
252{
253 uint temp;
254 ushort *sp;
255#ifdef CONFIG_RPXCLASSIC
256 unsigned long flags;
257#endif
258
259 if ((bus > 7) || (dev_fn > 127))
260 return PCIBIOS_DEVICE_NOT_FOUND;
261
262 qspan_pcibios_read_config_dword(bus, dev_fn, offset, &temp);
263
264 offset ^= 0x02;
265 sp = ((ushort *)&temp) + ((offset >> 1) & 1);
266 *sp = val;
267
268#ifdef CONFIG_RPXCLASSIC
269 /* disable interrupts */
270 spin_lock_irqsave(&pcibios_lock, flags);
271 *((uint *)RPX_CSR_ADDR) &= ~BCSR2_QSPACESEL;
272 eieio();
273#endif
274
275 if (bus == 0)
276 *QS_CONFIG_ADDR = mk_config_addr(bus, dev_fn, offset);
277 else
278 *QS_CONFIG_ADDR = mk_config_type1(bus, dev_fn, offset);
279 *QS_CONFIG_DATA = temp;
280
281#ifdef CONFIG_RPXCLASSIC
282 *((uint *)RPX_CSR_ADDR) |= BCSR2_QSPACESEL;
283 eieio();
284 spin_unlock_irqrestore(&pcibios_lock, flags);
285#endif
286
287 return PCIBIOS_SUCCESSFUL;
288}
289
290int qspan_pcibios_write_config_dword(unsigned char bus, unsigned char dev_fn,
291 unsigned char offset, unsigned int val)
292{
293#ifdef CONFIG_RPXCLASSIC
294 unsigned long flags;
295#endif
296
297 if ((bus > 7) || (dev_fn > 127))
298 return PCIBIOS_DEVICE_NOT_FOUND;
299
300#ifdef CONFIG_RPXCLASSIC
301 /* disable interrupts */
302 spin_lock_irqsave(&pcibios_lock, flags);
303 *((uint *)RPX_CSR_ADDR) &= ~BCSR2_QSPACESEL;
304 eieio();
305#endif
306
307 if (bus == 0)
308 *QS_CONFIG_ADDR = mk_config_addr(bus, dev_fn, offset);
309 else
310 *QS_CONFIG_ADDR = mk_config_type1(bus, dev_fn, offset);
311 *(unsigned int *)QS_CONFIG_DATA = val;
312
313#ifdef CONFIG_RPXCLASSIC
314 *((uint *)RPX_CSR_ADDR) |= BCSR2_QSPACESEL;
315 eieio();
316 spin_unlock_irqrestore(&pcibios_lock, flags);
317#endif
318
319 return PCIBIOS_SUCCESSFUL;
320}
321
322int qspan_pcibios_find_device(unsigned short vendor, unsigned short dev_id,
323 unsigned short index, unsigned char *bus_ptr,
324 unsigned char *dev_fn_ptr)
325{
326 int num, devfn;
327 unsigned int x, vendev;
328
329 if (vendor == 0xffff)
330 return PCIBIOS_BAD_VENDOR_ID;
331 vendev = (dev_id << 16) + vendor;
332 num = 0;
333 for (devfn = 0; devfn < 32; devfn++) {
334 qspan_pcibios_read_config_dword(0, devfn<<3, PCI_VENDOR_ID, &x);
335 if (x == vendev) {
336 if (index == num) {
337 *bus_ptr = 0;
338 *dev_fn_ptr = devfn<<3;
339 return PCIBIOS_SUCCESSFUL;
340 }
341 ++num;
342 }
343 }
344 return PCIBIOS_DEVICE_NOT_FOUND;
345}
346
347int qspan_pcibios_find_class(unsigned int class_code, unsigned short index,
348 unsigned char *bus_ptr, unsigned char *dev_fn_ptr)
349{
350 int devnr, x, num;
351
352 num = 0;
353 for (devnr = 0; devnr < 32; devnr++) {
354 qspan_pcibios_read_config_dword(0, devnr<<3, PCI_CLASS_REVISION, &x);
355 if ((x>>8) == class_code) {
356 if (index == num) {
357 *bus_ptr = 0;
358 *dev_fn_ptr = devnr<<3;
359 return PCIBIOS_SUCCESSFUL;
360 }
361 ++num;
362 }
363 }
364 return PCIBIOS_DEVICE_NOT_FOUND;
365}
366
367void __init
368m8xx_pcibios_fixup(void)
369{
370 /* Lots to do here, all board and configuration specific. */
371}
372
373void __init
374m8xx_setup_pci_ptrs(void)
375{
376 set_config_access_method(qspan);
377
378 ppc_md.pcibios_fixup = m8xx_pcibios_fixup;
379}
380
diff --git a/arch/ppc/syslib/todc_time.c b/arch/ppc/syslib/todc_time.c
deleted file mode 100644
index a8168b8e5683..000000000000
--- a/arch/ppc/syslib/todc_time.c
+++ /dev/null
@@ -1,511 +0,0 @@
1/*
2 * Time of Day Clock support for the M48T35, M48T37, M48T59, and MC146818
3 * Real Time Clocks/Timekeepers.
4 *
5 * Author: Mark A. Greer
6 * mgreer@mvista.com
7 *
8 * 2001-2004 (c) MontaVista, Software, Inc. This file is licensed under
9 * the terms of the GNU General Public License version 2. This program
10 * is licensed "as is" without any warranty of any kind, whether express
11 * or implied.
12 */
13#include <linux/errno.h>
14#include <linux/init.h>
15#include <linux/kernel.h>
16#include <linux/time.h>
17#include <linux/timex.h>
18#include <linux/bcd.h>
19#include <linux/mc146818rtc.h>
20
21#include <asm/machdep.h>
22#include <asm/io.h>
23#include <asm/time.h>
24#include <asm/todc.h>
25
26/*
27 * Depending on the hardware on your board and your board design, the
28 * RTC/NVRAM may be accessed either directly (like normal memory) or via
29 * address/data registers. If your board uses the direct method, set
30 * 'nvram_data' to the base address of your nvram and leave 'nvram_as0' and
31 * 'nvram_as1' NULL. If your board uses address/data regs to access nvram,
32 * set 'nvram_as0' to the address of the lower byte, set 'nvram_as1' to the
33 * address of the upper byte (leave NULL if using mc146818), and set
34 * 'nvram_data' to the address of the 8-bit data register.
35 *
36 * In order to break the assumption that the RTC and NVRAM are accessed by
37 * the same mechanism, you need to explicitly set 'ppc_md.rtc_read_val' and
38 * 'ppc_md.rtc_write_val', otherwise the values of 'ppc_md.rtc_read_val'
39 * and 'ppc_md.rtc_write_val' will be used.
40 *
41 * Note: Even though the documentation for the various RTC chips say that it
42 * take up to a second before it starts updating once the 'R' bit is
43 * cleared, they always seem to update even though we bang on it many
44 * times a second. This is true, except for the Dallas Semi 1746/1747
45 * (possibly others). Those chips seem to have a real problem whenever
46 * we set the 'R' bit before reading them, they basically stop counting.
47 * --MAG
48 */
49
50/*
51 * 'todc_info' should be initialized in your *_setup.c file to
52 * point to a fully initialized 'todc_info_t' structure.
53 * This structure holds all the register offsets for your particular
54 * TODC/RTC chip.
55 * TODC_ALLOC()/TODC_INIT() will allocate and initialize this table for you.
56 */
57
58#ifdef RTC_FREQ_SELECT
59#undef RTC_FREQ_SELECT
60#define RTC_FREQ_SELECT control_b /* Register A */
61#endif
62
63#ifdef RTC_CONTROL
64#undef RTC_CONTROL
65#define RTC_CONTROL control_a /* Register B */
66#endif
67
68#ifdef RTC_INTR_FLAGS
69#undef RTC_INTR_FLAGS
70#define RTC_INTR_FLAGS watchdog /* Register C */
71#endif
72
73#ifdef RTC_VALID
74#undef RTC_VALID
75#define RTC_VALID interrupts /* Register D */
76#endif
77
78/* Access routines when RTC accessed directly (like normal memory) */
79u_char
80todc_direct_read_val(int addr)
81{
82 return readb((void __iomem *)(todc_info->nvram_data + addr));
83}
84
85void
86todc_direct_write_val(int addr, unsigned char val)
87{
88 writeb(val, (void __iomem *)(todc_info->nvram_data + addr));
89 return;
90}
91
92/* Access routines for accessing m48txx type chips via addr/data regs */
93u_char
94todc_m48txx_read_val(int addr)
95{
96 outb(addr, todc_info->nvram_as0);
97 outb(addr>>todc_info->as0_bits, todc_info->nvram_as1);
98 return inb(todc_info->nvram_data);
99}
100
101void
102todc_m48txx_write_val(int addr, unsigned char val)
103{
104 outb(addr, todc_info->nvram_as0);
105 outb(addr>>todc_info->as0_bits, todc_info->nvram_as1);
106 outb(val, todc_info->nvram_data);
107 return;
108}
109
110/* Access routines for accessing mc146818 type chips via addr/data regs */
111u_char
112todc_mc146818_read_val(int addr)
113{
114 outb_p(addr, todc_info->nvram_as0);
115 return inb_p(todc_info->nvram_data);
116}
117
118void
119todc_mc146818_write_val(int addr, unsigned char val)
120{
121 outb_p(addr, todc_info->nvram_as0);
122 outb_p(val, todc_info->nvram_data);
123}
124
125
126/*
127 * Routines to make RTC chips with NVRAM buried behind an addr/data pair
128 * have the NVRAM and clock regs appear at the same level.
129 * The NVRAM will appear to start at addr 0 and the clock regs will appear
130 * to start immediately after the NVRAM (actually, start at offset
131 * todc_info->nvram_size).
132 */
133static inline u_char
134todc_read_val(int addr)
135{
136 u_char val;
137
138 if (todc_info->sw_flags & TODC_FLAG_2_LEVEL_NVRAM) {
139 if (addr < todc_info->nvram_size) { /* NVRAM */
140 ppc_md.rtc_write_val(todc_info->nvram_addr_reg, addr);
141 val = ppc_md.rtc_read_val(todc_info->nvram_data_reg);
142 }
143 else { /* Clock Reg */
144 addr -= todc_info->nvram_size;
145 val = ppc_md.rtc_read_val(addr);
146 }
147 }
148 else {
149 val = ppc_md.rtc_read_val(addr);
150 }
151
152 return val;
153}
154
155static inline void
156todc_write_val(int addr, u_char val)
157{
158 if (todc_info->sw_flags & TODC_FLAG_2_LEVEL_NVRAM) {
159 if (addr < todc_info->nvram_size) { /* NVRAM */
160 ppc_md.rtc_write_val(todc_info->nvram_addr_reg, addr);
161 ppc_md.rtc_write_val(todc_info->nvram_data_reg, val);
162 }
163 else { /* Clock Reg */
164 addr -= todc_info->nvram_size;
165 ppc_md.rtc_write_val(addr, val);
166 }
167 }
168 else {
169 ppc_md.rtc_write_val(addr, val);
170 }
171}
172
173/*
174 * TODC routines
175 *
176 * There is some ugly stuff in that there are assumptions for the mc146818.
177 *
178 * Assumptions:
179 * - todc_info->control_a has the offset as mc146818 Register B reg
180 * - todc_info->control_b has the offset as mc146818 Register A reg
181 * - m48txx control reg's write enable or 'W' bit is same as
182 * mc146818 Register B 'SET' bit (i.e., 0x80)
183 *
184 * These assumptions were made to make the code simpler.
185 */
186long __init
187todc_time_init(void)
188{
189 u_char cntl_b;
190
191 if (!ppc_md.rtc_read_val)
192 ppc_md.rtc_read_val = ppc_md.nvram_read_val;
193 if (!ppc_md.rtc_write_val)
194 ppc_md.rtc_write_val = ppc_md.nvram_write_val;
195
196 cntl_b = todc_read_val(todc_info->control_b);
197
198 if (todc_info->rtc_type == TODC_TYPE_MC146818) {
199 if ((cntl_b & 0x70) != 0x20) {
200 printk(KERN_INFO "TODC %s %s\n",
201 "real-time-clock was stopped.",
202 "Now starting...");
203 cntl_b &= ~0x70;
204 cntl_b |= 0x20;
205 }
206
207 todc_write_val(todc_info->control_b, cntl_b);
208 } else if (todc_info->rtc_type == TODC_TYPE_DS17285) {
209 u_char mode;
210
211 mode = todc_read_val(TODC_TYPE_DS17285_CNTL_A);
212 /* Make sure countdown clear is not set */
213 mode &= ~0x40;
214 /* Enable oscillator, extended register set */
215 mode |= 0x30;
216 todc_write_val(TODC_TYPE_DS17285_CNTL_A, mode);
217
218 } else if (todc_info->rtc_type == TODC_TYPE_DS1501) {
219 u_char month;
220
221 todc_info->enable_read = TODC_DS1501_CNTL_B_TE;
222 todc_info->enable_write = TODC_DS1501_CNTL_B_TE;
223
224 month = todc_read_val(todc_info->month);
225
226 if ((month & 0x80) == 0x80) {
227 printk(KERN_INFO "TODC %s %s\n",
228 "real-time-clock was stopped.",
229 "Now starting...");
230 month &= ~0x80;
231 todc_write_val(todc_info->month, month);
232 }
233
234 cntl_b &= ~TODC_DS1501_CNTL_B_TE;
235 todc_write_val(todc_info->control_b, cntl_b);
236 } else { /* must be a m48txx type */
237 u_char cntl_a;
238
239 todc_info->enable_read = TODC_MK48TXX_CNTL_A_R;
240 todc_info->enable_write = TODC_MK48TXX_CNTL_A_W;
241
242 cntl_a = todc_read_val(todc_info->control_a);
243
244 /* Check & clear STOP bit in control B register */
245 if (cntl_b & TODC_MK48TXX_DAY_CB) {
246 printk(KERN_INFO "TODC %s %s\n",
247 "real-time-clock was stopped.",
248 "Now starting...");
249
250 cntl_a |= todc_info->enable_write;
251 cntl_b &= ~TODC_MK48TXX_DAY_CB;/* Start Oscil */
252
253 todc_write_val(todc_info->control_a, cntl_a);
254 todc_write_val(todc_info->control_b, cntl_b);
255 }
256
257 /* Make sure READ & WRITE bits are cleared. */
258 cntl_a &= ~(todc_info->enable_write |
259 todc_info->enable_read);
260 todc_write_val(todc_info->control_a, cntl_a);
261 }
262
263 return 0;
264}
265
266/*
267 * There is some ugly stuff in that there are assumptions that for a mc146818,
268 * the todc_info->control_a has the offset of the mc146818 Register B reg and
269 * that the register'ss 'SET' bit is the same as the m48txx's write enable
270 * bit in the control register of the m48txx (i.e., 0x80).
271 *
272 * It was done to make the code look simpler.
273 */
274ulong
275todc_get_rtc_time(void)
276{
277 uint year = 0, mon = 0, day = 0, hour = 0, min = 0, sec = 0;
278 uint limit, i;
279 u_char save_control, uip = 0;
280
281 spin_lock(&rtc_lock);
282 save_control = todc_read_val(todc_info->control_a);
283
284 if (todc_info->rtc_type != TODC_TYPE_MC146818) {
285 limit = 1;
286
287 switch (todc_info->rtc_type) {
288 case TODC_TYPE_DS1553:
289 case TODC_TYPE_DS1557:
290 case TODC_TYPE_DS1743:
291 case TODC_TYPE_DS1746: /* XXXX BAD HACK -> FIX */
292 case TODC_TYPE_DS1747:
293 case TODC_TYPE_DS17285:
294 break;
295 default:
296 todc_write_val(todc_info->control_a,
297 (save_control | todc_info->enable_read));
298 }
299 }
300 else {
301 limit = 100000000;
302 }
303
304 for (i=0; i<limit; i++) {
305 if (todc_info->rtc_type == TODC_TYPE_MC146818) {
306 uip = todc_read_val(todc_info->RTC_FREQ_SELECT);
307 }
308
309 sec = todc_read_val(todc_info->seconds) & 0x7f;
310 min = todc_read_val(todc_info->minutes) & 0x7f;
311 hour = todc_read_val(todc_info->hours) & 0x3f;
312 day = todc_read_val(todc_info->day_of_month) & 0x3f;
313 mon = todc_read_val(todc_info->month) & 0x1f;
314 year = todc_read_val(todc_info->year) & 0xff;
315
316 if (todc_info->rtc_type == TODC_TYPE_MC146818) {
317 uip |= todc_read_val(todc_info->RTC_FREQ_SELECT);
318 if ((uip & RTC_UIP) == 0) break;
319 }
320 }
321
322 if (todc_info->rtc_type != TODC_TYPE_MC146818) {
323 switch (todc_info->rtc_type) {
324 case TODC_TYPE_DS1553:
325 case TODC_TYPE_DS1557:
326 case TODC_TYPE_DS1743:
327 case TODC_TYPE_DS1746: /* XXXX BAD HACK -> FIX */
328 case TODC_TYPE_DS1747:
329 case TODC_TYPE_DS17285:
330 break;
331 default:
332 save_control &= ~(todc_info->enable_read);
333 todc_write_val(todc_info->control_a,
334 save_control);
335 }
336 }
337 spin_unlock(&rtc_lock);
338
339 if ((todc_info->rtc_type != TODC_TYPE_MC146818) ||
340 ((save_control & RTC_DM_BINARY) == 0) ||
341 RTC_ALWAYS_BCD) {
342
343 BCD_TO_BIN(sec);
344 BCD_TO_BIN(min);
345 BCD_TO_BIN(hour);
346 BCD_TO_BIN(day);
347 BCD_TO_BIN(mon);
348 BCD_TO_BIN(year);
349 }
350
351 year = year + 1900;
352 if (year < 1970) {
353 year += 100;
354 }
355
356 return mktime(year, mon, day, hour, min, sec);
357}
358
359int
360todc_set_rtc_time(unsigned long nowtime)
361{
362 struct rtc_time tm;
363 u_char save_control, save_freq_select = 0;
364
365 spin_lock(&rtc_lock);
366 to_tm(nowtime, &tm);
367
368 save_control = todc_read_val(todc_info->control_a);
369
370 /* Assuming MK48T59_RTC_CA_WRITE & RTC_SET are equal */
371 todc_write_val(todc_info->control_a,
372 (save_control | todc_info->enable_write));
373 save_control &= ~(todc_info->enable_write); /* in case it was set */
374
375 if (todc_info->rtc_type == TODC_TYPE_MC146818) {
376 save_freq_select = todc_read_val(todc_info->RTC_FREQ_SELECT);
377 todc_write_val(todc_info->RTC_FREQ_SELECT,
378 save_freq_select | RTC_DIV_RESET2);
379 }
380
381
382 tm.tm_year = (tm.tm_year - 1900) % 100;
383
384 if ((todc_info->rtc_type != TODC_TYPE_MC146818) ||
385 ((save_control & RTC_DM_BINARY) == 0) ||
386 RTC_ALWAYS_BCD) {
387
388 BIN_TO_BCD(tm.tm_sec);
389 BIN_TO_BCD(tm.tm_min);
390 BIN_TO_BCD(tm.tm_hour);
391 BIN_TO_BCD(tm.tm_mon);
392 BIN_TO_BCD(tm.tm_mday);
393 BIN_TO_BCD(tm.tm_year);
394 }
395
396 todc_write_val(todc_info->seconds, tm.tm_sec);
397 todc_write_val(todc_info->minutes, tm.tm_min);
398 todc_write_val(todc_info->hours, tm.tm_hour);
399 todc_write_val(todc_info->month, tm.tm_mon);
400 todc_write_val(todc_info->day_of_month, tm.tm_mday);
401 todc_write_val(todc_info->year, tm.tm_year);
402
403 todc_write_val(todc_info->control_a, save_control);
404
405 if (todc_info->rtc_type == TODC_TYPE_MC146818) {
406 todc_write_val(todc_info->RTC_FREQ_SELECT, save_freq_select);
407 }
408 spin_unlock(&rtc_lock);
409
410 return 0;
411}
412
413/*
414 * Manipulates read bit to reliably read seconds at a high rate.
415 */
416static unsigned char __init todc_read_timereg(int addr)
417{
418 unsigned char save_control = 0, val;
419
420 switch (todc_info->rtc_type) {
421 case TODC_TYPE_DS1553:
422 case TODC_TYPE_DS1557:
423 case TODC_TYPE_DS1746: /* XXXX BAD HACK -> FIX */
424 case TODC_TYPE_DS1747:
425 case TODC_TYPE_DS17285:
426 case TODC_TYPE_MC146818:
427 break;
428 default:
429 save_control = todc_read_val(todc_info->control_a);
430 todc_write_val(todc_info->control_a,
431 (save_control | todc_info->enable_read));
432 }
433 val = todc_read_val(addr);
434
435 switch (todc_info->rtc_type) {
436 case TODC_TYPE_DS1553:
437 case TODC_TYPE_DS1557:
438 case TODC_TYPE_DS1746: /* XXXX BAD HACK -> FIX */
439 case TODC_TYPE_DS1747:
440 case TODC_TYPE_DS17285:
441 case TODC_TYPE_MC146818:
442 break;
443 default:
444 save_control &= ~(todc_info->enable_read);
445 todc_write_val(todc_info->control_a, save_control);
446 }
447
448 return val;
449}
450
451/*
452 * This was taken from prep_setup.c
453 * Use the NVRAM RTC to time a second to calibrate the decrementer.
454 */
455void __init
456todc_calibrate_decr(void)
457{
458 ulong freq;
459 ulong tbl, tbu;
460 long i, loop_count;
461 u_char sec;
462
463 todc_time_init();
464
465 /*
466 * Actually this is bad for precision, we should have a loop in
467 * which we only read the seconds counter. todc_read_val writes
468 * the address bytes on every call and this takes a lot of time.
469 * Perhaps an nvram_wait_change method returning a time
470 * stamp with a loop count as parameter would be the solution.
471 */
472 /*
473 * Need to make sure the tbl doesn't roll over so if tbu increments
474 * during this test, we need to do it again.
475 */
476 loop_count = 0;
477
478 sec = todc_read_timereg(todc_info->seconds) & 0x7f;
479
480 do {
481 tbu = get_tbu();
482
483 for (i = 0 ; i < 10000000 ; i++) {/* may take up to 1 second */
484 tbl = get_tbl();
485
486 if ((todc_read_timereg(todc_info->seconds) & 0x7f) != sec) {
487 break;
488 }
489 }
490
491 sec = todc_read_timereg(todc_info->seconds) & 0x7f;
492
493 for (i = 0 ; i < 10000000 ; i++) { /* Should take 1 second */
494 freq = get_tbl();
495
496 if ((todc_read_timereg(todc_info->seconds) & 0x7f) != sec) {
497 break;
498 }
499 }
500
501 freq -= tbl;
502 } while ((get_tbu() != tbu) && (++loop_count < 2));
503
504 printk("time_init: decrementer frequency = %lu.%.6lu MHz\n",
505 freq/1000000, freq%1000000);
506
507 tb_ticks_per_jiffy = freq / HZ;
508 tb_to_us = mulhwu_scale_factor(freq, 1000000);
509
510 return;
511}
diff --git a/arch/ppc/syslib/virtex_devices.c b/arch/ppc/syslib/virtex_devices.c
deleted file mode 100644
index 7322781be1c6..000000000000
--- a/arch/ppc/syslib/virtex_devices.c
+++ /dev/null
@@ -1,276 +0,0 @@
1/*
2 * Virtex hard ppc405 core common device listing
3 *
4 * Copyright 2005-2007 Secret Lab Technologies Ltd.
5 * Copyright 2005 Freescale Semiconductor Inc.
6 * Copyright 2002-2004 MontaVista Software, Inc.
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
12 */
13
14#include <linux/init.h>
15#include <linux/module.h>
16#include <linux/device.h>
17#include <linux/serial_8250.h>
18#include <syslib/virtex_devices.h>
19#include <platforms/4xx/xparameters/xparameters.h>
20#include <asm/io.h>
21
22/*
23 * UARTLITE: shortcut macro for single instance
24 */
25#define XPAR_UARTLITE(num) { \
26 .name = "uartlite", \
27 .id = num, \
28 .num_resources = 2, \
29 .resource = (struct resource[]) { \
30 { \
31 .start = XPAR_UARTLITE_##num##_BASEADDR + 3, \
32 .end = XPAR_UARTLITE_##num##_HIGHADDR, \
33 .flags = IORESOURCE_MEM, \
34 }, \
35 { \
36 .start = XPAR_INTC_0_UARTLITE_##num##_VEC_ID, \
37 .flags = IORESOURCE_IRQ, \
38 }, \
39 }, \
40}
41
42/*
43 * Full UART: shortcut macro for single instance + platform data structure
44 */
45#define XPAR_UART(num) { \
46 .mapbase = XPAR_UARTNS550_##num##_BASEADDR + 3, \
47 .irq = XPAR_INTC_0_UARTNS550_##num##_VEC_ID, \
48 .iotype = UPIO_MEM, \
49 .uartclk = XPAR_UARTNS550_##num##_CLOCK_FREQ_HZ, \
50 .flags = UPF_BOOT_AUTOCONF, \
51 .regshift = 2, \
52}
53
54/*
55 * SystemACE: shortcut macro for single instance
56 */
57#define XPAR_SYSACE(num) { \
58 .name = "xsysace", \
59 .id = XPAR_SYSACE_##num##_DEVICE_ID, \
60 .num_resources = 2, \
61 .resource = (struct resource[]) { \
62 { \
63 .start = XPAR_SYSACE_##num##_BASEADDR, \
64 .end = XPAR_SYSACE_##num##_HIGHADDR, \
65 .flags = IORESOURCE_MEM, \
66 }, \
67 { \
68 .start = XPAR_INTC_0_SYSACE_##num##_VEC_ID, \
69 .flags = IORESOURCE_IRQ, \
70 }, \
71 }, \
72}
73
74/*
75 * ML300/ML403 Video Device: shortcut macro for single instance
76 */
77#define XPAR_TFT(num) { \
78 .name = "xilinxfb", \
79 .id = num, \
80 .num_resources = 1, \
81 .resource = (struct resource[]) { \
82 { \
83 .start = XPAR_TFT_##num##_BASEADDR, \
84 .end = XPAR_TFT_##num##_BASEADDR+7, \
85 .flags = IORESOURCE_IO, \
86 }, \
87 }, \
88}
89
90#define XPAR_AC97_CONTROLLER_REFERENCE(num) { \
91 .name = "ml403_ac97cr", \
92 .id = num, \
93 .num_resources = 3, \
94 .resource = (struct resource[]) { \
95 { \
96 .start = XPAR_OPB_AC97_CONTROLLER_REF_##num##_BASEADDR, \
97 .end = XPAR_OPB_AC97_CONTROLLER_REF_##num##_HIGHADDR, \
98 .flags = IORESOURCE_MEM, \
99 }, \
100 { \
101 .start = XPAR_INTC_0_AC97_CONTROLLER_REF_##num##_PLAYBACK_VEC_ID, \
102 .end = XPAR_INTC_0_AC97_CONTROLLER_REF_##num##_PLAYBACK_VEC_ID, \
103 .flags = IORESOURCE_IRQ, \
104 }, \
105 { \
106 .start = XPAR_INTC_0_AC97_CONTROLLER_REF_##num##_RECORD_VEC_ID, \
107 .end = XPAR_INTC_0_AC97_CONTROLLER_REF_##num##_RECORD_VEC_ID, \
108 .flags = IORESOURCE_IRQ, \
109 }, \
110 }, \
111}
112
113/* UART 8250 driver platform data table */
114struct plat_serial8250_port virtex_serial_platform_data[] = {
115#if defined(XPAR_UARTNS550_0_BASEADDR)
116 XPAR_UART(0),
117#endif
118#if defined(XPAR_UARTNS550_1_BASEADDR)
119 XPAR_UART(1),
120#endif
121#if defined(XPAR_UARTNS550_2_BASEADDR)
122 XPAR_UART(2),
123#endif
124#if defined(XPAR_UARTNS550_3_BASEADDR)
125 XPAR_UART(3),
126#endif
127#if defined(XPAR_UARTNS550_4_BASEADDR)
128 XPAR_UART(4),
129#endif
130#if defined(XPAR_UARTNS550_5_BASEADDR)
131 XPAR_UART(5),
132#endif
133#if defined(XPAR_UARTNS550_6_BASEADDR)
134 XPAR_UART(6),
135#endif
136#if defined(XPAR_UARTNS550_7_BASEADDR)
137 XPAR_UART(7),
138#endif
139 { }, /* terminated by empty record */
140};
141
142
143struct platform_device virtex_platform_devices[] = {
144 /* UARTLITE instances */
145#if defined(XPAR_UARTLITE_0_BASEADDR)
146 XPAR_UARTLITE(0),
147#endif
148#if defined(XPAR_UARTLITE_1_BASEADDR)
149 XPAR_UARTLITE(1),
150#endif
151#if defined(XPAR_UARTLITE_2_BASEADDR)
152 XPAR_UARTLITE(2),
153#endif
154#if defined(XPAR_UARTLITE_3_BASEADDR)
155 XPAR_UARTLITE(3),
156#endif
157#if defined(XPAR_UARTLITE_4_BASEADDR)
158 XPAR_UARTLITE(4),
159#endif
160#if defined(XPAR_UARTLITE_5_BASEADDR)
161 XPAR_UARTLITE(5),
162#endif
163#if defined(XPAR_UARTLITE_6_BASEADDR)
164 XPAR_UARTLITE(6),
165#endif
166#if defined(XPAR_UARTLITE_7_BASEADDR)
167 XPAR_UARTLITE(7),
168#endif
169
170 /* Full UART instances */
171#if defined(XPAR_UARTNS550_0_BASEADDR)
172 {
173 .name = "serial8250",
174 .id = 0,
175 .dev.platform_data = virtex_serial_platform_data,
176 },
177#endif
178
179 /* SystemACE instances */
180#if defined(XPAR_SYSACE_0_BASEADDR)
181 XPAR_SYSACE(0),
182#endif
183#if defined(XPAR_SYSACE_1_BASEADDR)
184 XPAR_SYSACE(1),
185#endif
186
187#if defined(XPAR_TFT_0_BASEADDR)
188 XPAR_TFT(0),
189#endif
190#if defined(XPAR_TFT_1_BASEADDR)
191 XPAR_TFT(1),
192#endif
193#if defined(XPAR_TFT_2_BASEADDR)
194 XPAR_TFT(2),
195#endif
196#if defined(XPAR_TFT_3_BASEADDR)
197 XPAR_TFT(3),
198#endif
199
200 /* AC97 Controller Reference instances */
201#if defined(XPAR_OPB_AC97_CONTROLLER_REF_0_BASEADDR)
202 XPAR_AC97_CONTROLLER_REFERENCE(0),
203#endif
204#if defined(XPAR_OPB_AC97_CONTROLLER_REF_1_BASEADDR)
205 XPAR_AC97_CONTROLLER_REFERENCE(1),
206#endif
207};
208
209/* Early serial support functions */
210static void __init
211virtex_early_serial_init(int num, struct plat_serial8250_port *pdata)
212{
213#if defined(CONFIG_SERIAL_TEXT_DEBUG) || defined(CONFIG_KGDB)
214 struct uart_port serial_req;
215
216 memset(&serial_req, 0, sizeof(serial_req));
217 serial_req.mapbase = pdata->mapbase;
218 serial_req.membase = pdata->membase;
219 serial_req.irq = pdata->irq;
220 serial_req.uartclk = pdata->uartclk;
221 serial_req.regshift = pdata->regshift;
222 serial_req.iotype = pdata->iotype;
223 serial_req.flags = pdata->flags;
224 gen550_init(num, &serial_req);
225#endif
226}
227
228void __init
229virtex_early_serial_map(void)
230{
231#ifdef CONFIG_SERIAL_8250
232 struct plat_serial8250_port *pdata;
233 int i = 0;
234
235 pdata = virtex_serial_platform_data;
236 while(pdata && pdata->flags) {
237 pdata->membase = ioremap(pdata->mapbase, 0x100);
238 virtex_early_serial_init(i, pdata);
239 pdata++;
240 i++;
241 }
242#endif /* CONFIG_SERIAL_8250 */
243}
244
245/*
246 * default fixup routine; do nothing and return success.
247 *
248 * Reimplement this routine in your custom board support file to
249 * override the default behaviour
250 */
251int __attribute__ ((weak))
252virtex_device_fixup(struct platform_device *dev)
253{
254 return 0;
255}
256
257static int __init virtex_init(void)
258{
259 struct platform_device *index = virtex_platform_devices;
260 unsigned int ret = 0;
261 int i;
262
263 for (i = 0; i < ARRAY_SIZE(virtex_platform_devices); i++, index++) {
264 if (virtex_device_fixup(index) != 0)
265 continue;
266
267 if (platform_device_register(index)) {
268 ret = 1;
269 printk(KERN_ERR "cannot register dev %s:%d\n",
270 index->name, index->id);
271 }
272 }
273 return ret;
274}
275
276subsys_initcall(virtex_init);
diff --git a/arch/ppc/syslib/virtex_devices.h b/arch/ppc/syslib/virtex_devices.h
deleted file mode 100644
index 6ebd9b4b8f1c..000000000000
--- a/arch/ppc/syslib/virtex_devices.h
+++ /dev/null
@@ -1,35 +0,0 @@
1/*
2 * Common support header for virtex ppc405 platforms
3 *
4 * Copyright 2007 Secret Lab Technologies Ltd.
5 *
6 * This file is licensed under the terms of the GNU General Public License
7 * version 2. This program is licensed "as is" without any warranty of any
8 * kind, whether express or implied.
9 */
10
11#ifndef __ASM_VIRTEX_DEVICES_H__
12#define __ASM_VIRTEX_DEVICES_H__
13
14#include <linux/platform_device.h>
15#include <linux/xilinxfb.h>
16
17void __init virtex_early_serial_map(void);
18
19/* Prototype for device fixup routine. Implement this routine in the
20 * board specific fixup code and the generic setup code will call it for
21 * each device is the platform device list.
22 *
23 * If the hook returns a non-zero value, then the device will not get
24 * registered with the platform bus
25 */
26int virtex_device_fixup(struct platform_device *dev);
27
28/* SPI Controller IP */
29struct xspi_platform_data {
30 s16 bus_num;
31 u16 num_chipselect;
32 u32 speed_hz;
33};
34
35#endif /* __ASM_VIRTEX_DEVICES_H__ */
diff --git a/arch/ppc/syslib/xilinx_pic.c b/arch/ppc/syslib/xilinx_pic.c
deleted file mode 100644
index 3b82333e96d8..000000000000
--- a/arch/ppc/syslib/xilinx_pic.c
+++ /dev/null
@@ -1,153 +0,0 @@
1/*
2 * Interrupt controller driver for Xilinx Virtex-II Pro.
3 *
4 * Author: MontaVista Software, Inc.
5 * source@mvista.com
6 *
7 * 2002-2004 (c) MontaVista Software, Inc. This file is licensed under
8 * the terms of the GNU General Public License version 2. This program
9 * is licensed "as is" without any warranty of any kind, whether express
10 * or implied.
11 */
12
13#include <linux/init.h>
14#include <linux/irq.h>
15#include <asm/io.h>
16#include <platforms/4xx/xparameters/xparameters.h>
17#include <asm/ibm4xx.h>
18#include <asm/machdep.h>
19
20/* No one else should require these constants, so define them locally here. */
21#define ISR 0 /* Interrupt Status Register */
22#define IPR 1 /* Interrupt Pending Register */
23#define IER 2 /* Interrupt Enable Register */
24#define IAR 3 /* Interrupt Acknowledge Register */
25#define SIE 4 /* Set Interrupt Enable bits */
26#define CIE 5 /* Clear Interrupt Enable bits */
27#define IVR 6 /* Interrupt Vector Register */
28#define MER 7 /* Master Enable Register */
29
30#if XPAR_XINTC_USE_DCR == 0
31static volatile u32 *intc;
32#define intc_out_be32(addr, mask) out_be32((addr), (mask))
33#define intc_in_be32(addr) in_be32((addr))
34#else
35#define intc XPAR_INTC_0_BASEADDR
36#define intc_out_be32(addr, mask) mtdcr((addr), (mask))
37#define intc_in_be32(addr) mfdcr((addr))
38#endif
39
40static void
41xilinx_intc_enable(unsigned int irq)
42{
43 unsigned long mask = (0x00000001 << (irq & 31));
44 pr_debug("enable: %d\n", irq);
45 intc_out_be32(intc + SIE, mask);
46}
47
48static void
49xilinx_intc_disable(unsigned int irq)
50{
51 unsigned long mask = (0x00000001 << (irq & 31));
52 pr_debug("disable: %d\n", irq);
53 intc_out_be32(intc + CIE, mask);
54}
55
56static void
57xilinx_intc_disable_and_ack(unsigned int irq)
58{
59 unsigned long mask = (0x00000001 << (irq & 31));
60 pr_debug("disable_and_ack: %d\n", irq);
61 intc_out_be32(intc + CIE, mask);
62 if (!(irq_desc[irq].status & IRQ_LEVEL))
63 intc_out_be32(intc + IAR, mask); /* ack edge triggered intr */
64}
65
66static void
67xilinx_intc_end(unsigned int irq)
68{
69 unsigned long mask = (0x00000001 << (irq & 31));
70
71 pr_debug("end: %d\n", irq);
72 if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS))) {
73 intc_out_be32(intc + SIE, mask);
74 /* ack level sensitive intr */
75 if (irq_desc[irq].status & IRQ_LEVEL)
76 intc_out_be32(intc + IAR, mask);
77 }
78}
79
80static struct hw_interrupt_type xilinx_intc = {
81 .typename = "Xilinx Interrupt Controller",
82 .enable = xilinx_intc_enable,
83 .disable = xilinx_intc_disable,
84 .ack = xilinx_intc_disable_and_ack,
85 .end = xilinx_intc_end,
86};
87
88int
89xilinx_pic_get_irq(void)
90{
91 int irq;
92
93 /*
94 * NOTE: This function is the one that needs to be improved in
95 * order to handle multiple interrupt controllers. It currently
96 * is hardcoded to check for interrupts only on the first INTC.
97 */
98
99 irq = intc_in_be32(intc + IVR);
100 if (irq != -1)
101 irq = irq;
102
103 pr_debug("get_irq: %d\n", irq);
104
105 return (irq);
106}
107
108void __init
109ppc4xx_pic_init(void)
110{
111 int i;
112
113 /*
114 * NOTE: The assumption here is that NR_IRQS is 32 or less
115 * (NR_IRQS is 32 for PowerPC 405 cores by default).
116 */
117#if (NR_IRQS > 32)
118#error NR_IRQS > 32 not supported
119#endif
120
121#if XPAR_XINTC_USE_DCR == 0
122 intc = ioremap(XPAR_INTC_0_BASEADDR, 32);
123
124 printk(KERN_INFO "Xilinx INTC #0 at 0x%08lX mapped to 0x%08lX\n",
125 (unsigned long) XPAR_INTC_0_BASEADDR, (unsigned long) intc);
126#else
127 printk(KERN_INFO "Xilinx INTC #0 at 0x%08lX (DCR)\n",
128 (unsigned long) XPAR_INTC_0_BASEADDR);
129#endif
130
131 /*
132 * Disable all external interrupts until they are
133 * explicitly requested.
134 */
135 intc_out_be32(intc + IER, 0);
136
137 /* Acknowledge any pending interrupts just in case. */
138 intc_out_be32(intc + IAR, ~(u32) 0);
139
140 /* Turn on the Master Enable. */
141 intc_out_be32(intc + MER, 0x3UL);
142
143 ppc_md.get_irq = xilinx_pic_get_irq;
144
145 for (i = 0; i < NR_IRQS; ++i) {
146 irq_desc[i].chip = &xilinx_intc;
147
148 if (XPAR_INTC_0_KIND_OF_INTR & (0x00000001 << i))
149 irq_desc[i].status &= ~IRQ_LEVEL;
150 else
151 irq_desc[i].status |= IRQ_LEVEL;
152 }
153}
diff --git a/arch/ppc/xmon/Makefile b/arch/ppc/xmon/Makefile
deleted file mode 100644
index 9aa260b926f5..000000000000
--- a/arch/ppc/xmon/Makefile
+++ /dev/null
@@ -1,8 +0,0 @@
1# Makefile for xmon
2
3ifdef CONFIG_8xx
4obj-y := start_8xx.o
5else
6obj-y := start.o
7endif
8obj-y += xmon.o ppc-dis.o ppc-opc.o subr_prf.o setjmp.o
diff --git a/arch/ppc/xmon/ansidecl.h b/arch/ppc/xmon/ansidecl.h
deleted file mode 100644
index c9b9f0929e9e..000000000000
--- a/arch/ppc/xmon/ansidecl.h
+++ /dev/null
@@ -1,141 +0,0 @@
1/* ANSI and traditional C compatibility macros
2 Copyright 1991, 1992 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4
5This program is free software; you can redistribute it and/or modify
6it under the terms of the GNU General Public License as published by
7the Free Software Foundation; either version 2 of the License, or
8(at your option) any later version.
9
10This program is distributed in the hope that it will be useful,
11but WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with this program; if not, write to the Free Software
17Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
18
19/* ANSI and traditional C compatibility macros
20
21 ANSI C is assumed if __STDC__ is #defined.
22
23 Macro ANSI C definition Traditional C definition
24 ----- ---- - ---------- ----------- - ----------
25 PTR `void *' `char *'
26 LONG_DOUBLE `long double' `double'
27 VOLATILE `volatile' `'
28 SIGNED `signed' `'
29 PTRCONST `void *const' `char *'
30 ANSI_PROTOTYPES 1 not defined
31
32 CONST is also defined, but is obsolete. Just use const.
33
34 DEFUN (name, arglist, args)
35
36 Defines function NAME.
37
38 ARGLIST lists the arguments, separated by commas and enclosed in
39 parentheses. ARGLIST becomes the argument list in traditional C.
40
41 ARGS list the arguments with their types. It becomes a prototype in
42 ANSI C, and the type declarations in traditional C. Arguments should
43 be separated with `AND'. For functions with a variable number of
44 arguments, the last thing listed should be `DOTS'.
45
46 DEFUN_VOID (name)
47
48 Defines a function NAME, which takes no arguments.
49
50 obsolete -- EXFUN (name, (prototype)) -- obsolete.
51
52 Replaced by PARAMS. Do not use; will disappear someday soon.
53 Was used in external function declarations.
54 In ANSI C it is `NAME PROTOTYPE' (so PROTOTYPE should be enclosed in
55 parentheses). In traditional C it is `NAME()'.
56 For a function that takes no arguments, PROTOTYPE should be `(void)'.
57
58 PARAMS ((args))
59
60 We could use the EXFUN macro to handle prototype declarations, but
61 the name is misleading and the result is ugly. So we just define a
62 simple macro to handle the parameter lists, as in:
63
64 static int foo PARAMS ((int, char));
65
66 This produces: `static int foo();' or `static int foo (int, char);'
67
68 EXFUN would have done it like this:
69
70 static int EXFUN (foo, (int, char));
71
72 but the function is not external...and it's hard to visually parse
73 the function name out of the mess. EXFUN should be considered
74 obsolete; new code should be written to use PARAMS.
75
76 For example:
77 extern int printf PARAMS ((CONST char *format DOTS));
78 int DEFUN(fprintf, (stream, format),
79 FILE *stream AND CONST char *format DOTS) { ... }
80 void DEFUN_VOID(abort) { ... }
81*/
82
83#ifndef _ANSIDECL_H
84
85#define _ANSIDECL_H 1
86
87
88/* Every source file includes this file,
89 so they will all get the switch for lint. */
90/* LINTLIBRARY */
91
92
93#if defined (__STDC__) || defined (_AIX) || (defined (__mips) && defined (_SYSTYPE_SVR4)) || defined(WIN32)
94/* All known AIX compilers implement these things (but don't always
95 define __STDC__). The RISC/OS MIPS compiler defines these things
96 in SVR4 mode, but does not define __STDC__. */
97
98#define PTR void *
99#define PTRCONST void *CONST
100#define LONG_DOUBLE long double
101
102#define AND ,
103#define NOARGS void
104#define CONST const
105#define VOLATILE volatile
106#define SIGNED signed
107#define DOTS , ...
108
109#define EXFUN(name, proto) name proto
110#define DEFUN(name, arglist, args) name(args)
111#define DEFUN_VOID(name) name(void)
112
113#define PROTO(type, name, arglist) type name arglist
114#define PARAMS(paramlist) paramlist
115#define ANSI_PROTOTYPES 1
116
117#else /* Not ANSI C. */
118
119#define PTR char *
120#define PTRCONST PTR
121#define LONG_DOUBLE double
122
123#define AND ;
124#define NOARGS
125#define CONST
126#ifndef const /* some systems define it in header files for non-ansi mode */
127#define const
128#endif
129#define VOLATILE
130#define SIGNED
131#define DOTS
132
133#define EXFUN(name, proto) name()
134#define DEFUN(name, arglist, args) name arglist args;
135#define DEFUN_VOID(name) name()
136#define PROTO(type, name, arglist) type name ()
137#define PARAMS(paramlist) ()
138
139#endif /* ANSI C. */
140
141#endif /* ansidecl.h */
diff --git a/arch/ppc/xmon/nonstdio.h b/arch/ppc/xmon/nonstdio.h
deleted file mode 100644
index 0240bc573c96..000000000000
--- a/arch/ppc/xmon/nonstdio.h
+++ /dev/null
@@ -1,22 +0,0 @@
1typedef int FILE;
2extern FILE *xmon_stdin, *xmon_stdout;
3#define EOF (-1)
4#define stdin xmon_stdin
5#define stdout xmon_stdout
6#define printf xmon_printf
7#define fprintf xmon_fprintf
8#define fputs xmon_fputs
9#define fgets xmon_fgets
10#define putchar xmon_putchar
11#define getchar xmon_getchar
12#define putc xmon_putc
13#define getc xmon_getc
14#define fopen(n, m) NULL
15#define fflush(f) do {} while (0)
16#define fclose(f) do {} while (0)
17extern char *fgets(char *, int, void *);
18extern void xmon_fprintf(void *, const char *, ...);
19extern void xmon_sprintf(char *, const char *, ...);
20extern void xmon_puts(char*);
21
22#define perror(s) printf("%s: no files!\n", (s))
diff --git a/arch/ppc/xmon/ppc-dis.c b/arch/ppc/xmon/ppc-dis.c
deleted file mode 100644
index 798ac1a677f6..000000000000
--- a/arch/ppc/xmon/ppc-dis.c
+++ /dev/null
@@ -1,190 +0,0 @@
1/* ppc-dis.c -- Disassemble PowerPC instructions
2 Copyright 1994 Free Software Foundation, Inc.
3 Written by Ian Lance Taylor, Cygnus Support
4
5This file is part of GDB, GAS, and the GNU binutils.
6
7GDB, GAS, and the GNU binutils are free software; you can redistribute
8them and/or modify them under the terms of the GNU General Public
9License as published by the Free Software Foundation; either version
102, or (at your option) any later version.
11
12GDB, GAS, and the GNU binutils are distributed in the hope that they
13will be useful, but WITHOUT ANY WARRANTY; without even the implied
14warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
15the GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with this file; see the file COPYING. If not, write to the Free
19Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
20
21#include "nonstdio.h"
22#include "ansidecl.h"
23#include "ppc.h"
24
25static int print_insn_powerpc PARAMS ((FILE *, unsigned long insn,
26 unsigned memaddr, int dialect));
27
28extern void print_address PARAMS((unsigned memaddr));
29
30/* Print a big endian PowerPC instruction. For convenience, also
31 disassemble instructions supported by the Motorola PowerPC 601. */
32
33int
34print_insn_big_powerpc (FILE *out, unsigned long insn, unsigned memaddr)
35{
36 return print_insn_powerpc (out, insn, memaddr,
37 PPC_OPCODE_PPC | PPC_OPCODE_601);
38}
39
40/* Print a PowerPC or POWER instruction. */
41
42static int
43print_insn_powerpc (FILE *out, unsigned long insn, unsigned memaddr,
44 int dialect)
45{
46 const struct powerpc_opcode *opcode;
47 const struct powerpc_opcode *opcode_end;
48 unsigned long op;
49
50 /* Get the major opcode of the instruction. */
51 op = PPC_OP (insn);
52
53 /* Find the first match in the opcode table. We could speed this up
54 a bit by doing a binary search on the major opcode. */
55 opcode_end = powerpc_opcodes + powerpc_num_opcodes;
56 for (opcode = powerpc_opcodes; opcode < opcode_end; opcode++)
57 {
58 unsigned long table_op;
59 const unsigned char *opindex;
60 const struct powerpc_operand *operand;
61 int invalid;
62 int need_comma;
63 int need_paren;
64
65 table_op = PPC_OP (opcode->opcode);
66 if (op < table_op)
67 break;
68 if (op > table_op)
69 continue;
70
71 if ((insn & opcode->mask) != opcode->opcode
72 || (opcode->flags & dialect) == 0)
73 continue;
74
75 /* Make two passes over the operands. First see if any of them
76 have extraction functions, and, if they do, make sure the
77 instruction is valid. */
78 invalid = 0;
79 for (opindex = opcode->operands; *opindex != 0; opindex++)
80 {
81 operand = powerpc_operands + *opindex;
82 if (operand->extract)
83 (*operand->extract) (insn, &invalid);
84 }
85 if (invalid)
86 continue;
87
88 /* The instruction is valid. */
89 fprintf(out, "%s", opcode->name);
90 if (opcode->operands[0] != 0)
91 fprintf(out, "\t");
92
93 /* Now extract and print the operands. */
94 need_comma = 0;
95 need_paren = 0;
96 for (opindex = opcode->operands; *opindex != 0; opindex++)
97 {
98 long value;
99
100 operand = powerpc_operands + *opindex;
101
102 /* Operands that are marked FAKE are simply ignored. We
103 already made sure that the extract function considered
104 the instruction to be valid. */
105 if ((operand->flags & PPC_OPERAND_FAKE) != 0)
106 continue;
107
108 /* Extract the value from the instruction. */
109 if (operand->extract)
110 value = (*operand->extract) (insn, (int *) 0);
111 else
112 {
113 value = (insn >> operand->shift) & ((1 << operand->bits) - 1);
114 if ((operand->flags & PPC_OPERAND_SIGNED) != 0
115 && (value & (1 << (operand->bits - 1))) != 0)
116 value -= 1 << operand->bits;
117 }
118
119 /* If the operand is optional, and the value is zero, don't
120 print anything. */
121 if ((operand->flags & PPC_OPERAND_OPTIONAL) != 0
122 && (operand->flags & PPC_OPERAND_NEXT) == 0
123 && value == 0)
124 continue;
125
126 if (need_comma)
127 {
128 fprintf(out, ",");
129 need_comma = 0;
130 }
131
132 /* Print the operand as directed by the flags. */
133 if ((operand->flags & PPC_OPERAND_GPR) != 0)
134 fprintf(out, "r%ld", value);
135 else if ((operand->flags & PPC_OPERAND_FPR) != 0)
136 fprintf(out, "f%ld", value);
137 else if ((operand->flags & PPC_OPERAND_RELATIVE) != 0)
138 print_address (memaddr + value);
139 else if ((operand->flags & PPC_OPERAND_ABSOLUTE) != 0)
140 print_address (value & 0xffffffff);
141 else if ((operand->flags & PPC_OPERAND_CR) == 0
142 || (dialect & PPC_OPCODE_PPC) == 0)
143 fprintf(out, "%ld", value);
144 else
145 {
146 if (operand->bits == 3)
147 fprintf(out, "cr%d", value);
148 else
149 {
150 static const char *cbnames[4] = { "lt", "gt", "eq", "so" };
151 int cr;
152 int cc;
153
154 cr = value >> 2;
155 if (cr != 0)
156 fprintf(out, "4*cr%d", cr);
157 cc = value & 3;
158 if (cc != 0)
159 {
160 if (cr != 0)
161 fprintf(out, "+");
162 fprintf(out, "%s", cbnames[cc]);
163 }
164 }
165 }
166
167 if (need_paren)
168 {
169 fprintf(out, ")");
170 need_paren = 0;
171 }
172
173 if ((operand->flags & PPC_OPERAND_PARENS) == 0)
174 need_comma = 1;
175 else
176 {
177 fprintf(out, "(");
178 need_paren = 1;
179 }
180 }
181
182 /* We have found and printed an instruction; return. */
183 return 4;
184 }
185
186 /* We could not find a match. */
187 fprintf(out, ".long 0x%lx", insn);
188
189 return 4;
190}
diff --git a/arch/ppc/xmon/ppc-opc.c b/arch/ppc/xmon/ppc-opc.c
deleted file mode 100644
index 034313cef6e7..000000000000
--- a/arch/ppc/xmon/ppc-opc.c
+++ /dev/null
@@ -1,2720 +0,0 @@
1/* ppc-opc.c -- PowerPC opcode list
2 Copyright 1994 Free Software Foundation, Inc.
3 Written by Ian Lance Taylor, Cygnus Support
4
5This file is part of GDB, GAS, and the GNU binutils.
6
7GDB, GAS, and the GNU binutils are free software; you can redistribute
8them and/or modify them under the terms of the GNU General Public
9License as published by the Free Software Foundation; either version
102, or (at your option) any later version.
11
12GDB, GAS, and the GNU binutils are distributed in the hope that they
13will be useful, but WITHOUT ANY WARRANTY; without even the implied
14warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
15the GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with this file; see the file COPYING. If not, write to the Free
19Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
20
21#include <linux/posix_types.h>
22#include <linux/kernel.h>
23#include "ansidecl.h"
24#include "ppc.h"
25
26/* This file holds the PowerPC opcode table. The opcode table
27 includes almost all of the extended instruction mnemonics. This
28 permits the disassembler to use them, and simplifies the assembler
29 logic, at the cost of increasing the table size. The table is
30 strictly constant data, so the compiler should be able to put it in
31 the .text section.
32
33 This file also holds the operand table. All knowledge about
34 inserting operands into instructions and vice-versa is kept in this
35 file. */
36
37/* Local insertion and extraction functions. */
38
39static unsigned long insert_bat PARAMS ((unsigned long, long, const char **));
40static long extract_bat PARAMS ((unsigned long, int *));
41static unsigned long insert_bba PARAMS ((unsigned long, long, const char **));
42static long extract_bba PARAMS ((unsigned long, int *));
43static unsigned long insert_bd PARAMS ((unsigned long, long, const char **));
44static long extract_bd PARAMS ((unsigned long, int *));
45static unsigned long insert_bdm PARAMS ((unsigned long, long, const char **));
46static long extract_bdm PARAMS ((unsigned long, int *));
47static unsigned long insert_bdp PARAMS ((unsigned long, long, const char **));
48static long extract_bdp PARAMS ((unsigned long, int *));
49static unsigned long insert_bo PARAMS ((unsigned long, long, const char **));
50static long extract_bo PARAMS ((unsigned long, int *));
51static unsigned long insert_boe PARAMS ((unsigned long, long, const char **));
52static long extract_boe PARAMS ((unsigned long, int *));
53static unsigned long insert_ds PARAMS ((unsigned long, long, const char **));
54static long extract_ds PARAMS ((unsigned long, int *));
55static unsigned long insert_li PARAMS ((unsigned long, long, const char **));
56static long extract_li PARAMS ((unsigned long, int *));
57static unsigned long insert_mbe PARAMS ((unsigned long, long, const char **));
58static long extract_mbe PARAMS ((unsigned long, int *));
59static unsigned long insert_mb6 PARAMS ((unsigned long, long, const char **));
60static long extract_mb6 PARAMS ((unsigned long, int *));
61static unsigned long insert_nb PARAMS ((unsigned long, long, const char **));
62static long extract_nb PARAMS ((unsigned long, int *));
63static unsigned long insert_nsi PARAMS ((unsigned long, long, const char **));
64static long extract_nsi PARAMS ((unsigned long, int *));
65static unsigned long insert_ral PARAMS ((unsigned long, long, const char **));
66static unsigned long insert_ram PARAMS ((unsigned long, long, const char **));
67static unsigned long insert_ras PARAMS ((unsigned long, long, const char **));
68static unsigned long insert_rbs PARAMS ((unsigned long, long, const char **));
69static long extract_rbs PARAMS ((unsigned long, int *));
70static unsigned long insert_sh6 PARAMS ((unsigned long, long, const char **));
71static long extract_sh6 PARAMS ((unsigned long, int *));
72static unsigned long insert_spr PARAMS ((unsigned long, long, const char **));
73static long extract_spr PARAMS ((unsigned long, int *));
74static unsigned long insert_tbr PARAMS ((unsigned long, long, const char **));
75static long extract_tbr PARAMS ((unsigned long, int *));
76
77/* The operands table.
78
79 The fields are bits, shift, signed, insert, extract, flags. */
80
81const struct powerpc_operand powerpc_operands[] =
82{
83 /* The zero index is used to indicate the end of the list of
84 operands. */
85#define UNUSED (0)
86 { 0, 0, NULL, NULL, 0 },
87
88 /* The BA field in an XL form instruction. */
89#define BA (1)
90#define BA_MASK (0x1f << 16)
91 { 5, 16, NULL, NULL, PPC_OPERAND_CR },
92
93 /* The BA field in an XL form instruction when it must be the same
94 as the BT field in the same instruction. */
95#define BAT (2)
96 { 5, 16, insert_bat, extract_bat, PPC_OPERAND_FAKE },
97
98 /* The BB field in an XL form instruction. */
99#define BB (3)
100#define BB_MASK (0x1f << 11)
101 { 5, 11, NULL, NULL, PPC_OPERAND_CR },
102
103 /* The BB field in an XL form instruction when it must be the same
104 as the BA field in the same instruction. */
105#define BBA (4)
106 { 5, 11, insert_bba, extract_bba, PPC_OPERAND_FAKE },
107
108 /* The BD field in a B form instruction. The lower two bits are
109 forced to zero. */
110#define BD (5)
111 { 16, 0, insert_bd, extract_bd, PPC_OPERAND_RELATIVE | PPC_OPERAND_SIGNED },
112
113 /* The BD field in a B form instruction when absolute addressing is
114 used. */
115#define BDA (6)
116 { 16, 0, insert_bd, extract_bd, PPC_OPERAND_ABSOLUTE | PPC_OPERAND_SIGNED },
117
118 /* The BD field in a B form instruction when the - modifier is used.
119 This sets the y bit of the BO field appropriately. */
120#define BDM (7)
121 { 16, 0, insert_bdm, extract_bdm,
122 PPC_OPERAND_RELATIVE | PPC_OPERAND_SIGNED },
123
124 /* The BD field in a B form instruction when the - modifier is used
125 and absolute address is used. */
126#define BDMA (8)
127 { 16, 0, insert_bdm, extract_bdm,
128 PPC_OPERAND_ABSOLUTE | PPC_OPERAND_SIGNED },
129
130 /* The BD field in a B form instruction when the + modifier is used.
131 This sets the y bit of the BO field appropriately. */
132#define BDP (9)
133 { 16, 0, insert_bdp, extract_bdp,
134 PPC_OPERAND_RELATIVE | PPC_OPERAND_SIGNED },
135
136 /* The BD field in a B form instruction when the + modifier is used
137 and absolute addressing is used. */
138#define BDPA (10)
139 { 16, 0, insert_bdp, extract_bdp,
140 PPC_OPERAND_ABSOLUTE | PPC_OPERAND_SIGNED },
141
142 /* The BF field in an X or XL form instruction. */
143#define BF (11)
144 { 3, 23, NULL, NULL, PPC_OPERAND_CR },
145
146 /* An optional BF field. This is used for comparison instructions,
147 in which an omitted BF field is taken as zero. */
148#define OBF (12)
149 { 3, 23, NULL, NULL, PPC_OPERAND_CR | PPC_OPERAND_OPTIONAL },
150
151 /* The BFA field in an X or XL form instruction. */
152#define BFA (13)
153 { 3, 18, NULL, NULL, PPC_OPERAND_CR },
154
155 /* The BI field in a B form or XL form instruction. */
156#define BI (14)
157#define BI_MASK (0x1f << 16)
158 { 5, 16, NULL, NULL, PPC_OPERAND_CR },
159
160 /* The BO field in a B form instruction. Certain values are
161 illegal. */
162#define BO (15)
163#define BO_MASK (0x1f << 21)
164 { 5, 21, insert_bo, extract_bo, 0 },
165
166 /* The BO field in a B form instruction when the + or - modifier is
167 used. This is like the BO field, but it must be even. */
168#define BOE (16)
169 { 5, 21, insert_boe, extract_boe, 0 },
170
171 /* The BT field in an X or XL form instruction. */
172#define BT (17)
173 { 5, 21, NULL, NULL, PPC_OPERAND_CR },
174
175 /* The condition register number portion of the BI field in a B form
176 or XL form instruction. This is used for the extended
177 conditional branch mnemonics, which set the lower two bits of the
178 BI field. This field is optional. */
179#define CR (18)
180 { 3, 18, NULL, NULL, PPC_OPERAND_CR | PPC_OPERAND_OPTIONAL },
181
182 /* The D field in a D form instruction. This is a displacement off
183 a register, and implies that the next operand is a register in
184 parentheses. */
185#define D (19)
186 { 16, 0, NULL, NULL, PPC_OPERAND_PARENS | PPC_OPERAND_SIGNED },
187
188 /* The DS field in a DS form instruction. This is like D, but the
189 lower two bits are forced to zero. */
190#define DS (20)
191 { 16, 0, insert_ds, extract_ds, PPC_OPERAND_PARENS | PPC_OPERAND_SIGNED },
192
193 /* The FL1 field in a POWER SC form instruction. */
194#define FL1 (21)
195 { 4, 12, NULL, NULL, 0 },
196
197 /* The FL2 field in a POWER SC form instruction. */
198#define FL2 (22)
199 { 3, 2, NULL, NULL, 0 },
200
201 /* The FLM field in an XFL form instruction. */
202#define FLM (23)
203 { 8, 17, NULL, NULL, 0 },
204
205 /* The FRA field in an X or A form instruction. */
206#define FRA (24)
207#define FRA_MASK (0x1f << 16)
208 { 5, 16, NULL, NULL, PPC_OPERAND_FPR },
209
210 /* The FRB field in an X or A form instruction. */
211#define FRB (25)
212#define FRB_MASK (0x1f << 11)
213 { 5, 11, NULL, NULL, PPC_OPERAND_FPR },
214
215 /* The FRC field in an A form instruction. */
216#define FRC (26)
217#define FRC_MASK (0x1f << 6)
218 { 5, 6, NULL, NULL, PPC_OPERAND_FPR },
219
220 /* The FRS field in an X form instruction or the FRT field in a D, X
221 or A form instruction. */
222#define FRS (27)
223#define FRT (FRS)
224 { 5, 21, NULL, NULL, PPC_OPERAND_FPR },
225
226 /* The FXM field in an XFX instruction. */
227#define FXM (28)
228#define FXM_MASK (0xff << 12)
229 { 8, 12, NULL, NULL, 0 },
230
231 /* The L field in a D or X form instruction. */
232#define L (29)
233 { 1, 21, NULL, NULL, PPC_OPERAND_OPTIONAL },
234
235 /* The LEV field in a POWER SC form instruction. */
236#define LEV (30)
237 { 7, 5, NULL, NULL, 0 },
238
239 /* The LI field in an I form instruction. The lower two bits are
240 forced to zero. */
241#define LI (31)
242 { 26, 0, insert_li, extract_li, PPC_OPERAND_RELATIVE | PPC_OPERAND_SIGNED },
243
244 /* The LI field in an I form instruction when used as an absolute
245 address. */
246#define LIA (32)
247 { 26, 0, insert_li, extract_li, PPC_OPERAND_ABSOLUTE | PPC_OPERAND_SIGNED },
248
249 /* The MB field in an M form instruction. */
250#define MB (33)
251#define MB_MASK (0x1f << 6)
252 { 5, 6, NULL, NULL, 0 },
253
254 /* The ME field in an M form instruction. */
255#define ME (34)
256#define ME_MASK (0x1f << 1)
257 { 5, 1, NULL, NULL, 0 },
258
259 /* The MB and ME fields in an M form instruction expressed a single
260 operand which is a bitmask indicating which bits to select. This
261 is a two operand form using PPC_OPERAND_NEXT. See the
262 description in opcode/ppc.h for what this means. */
263#define MBE (35)
264 { 5, 6, NULL, NULL, PPC_OPERAND_OPTIONAL | PPC_OPERAND_NEXT },
265 { 32, 0, insert_mbe, extract_mbe, 0 },
266
267 /* The MB or ME field in an MD or MDS form instruction. The high
268 bit is wrapped to the low end. */
269#define MB6 (37)
270#define ME6 (MB6)
271#define MB6_MASK (0x3f << 5)
272 { 6, 5, insert_mb6, extract_mb6, 0 },
273
274 /* The NB field in an X form instruction. The value 32 is stored as
275 0. */
276#define NB (38)
277 { 6, 11, insert_nb, extract_nb, 0 },
278
279 /* The NSI field in a D form instruction. This is the same as the
280 SI field, only negated. */
281#define NSI (39)
282 { 16, 0, insert_nsi, extract_nsi,
283 PPC_OPERAND_NEGATIVE | PPC_OPERAND_SIGNED },
284
285 /* The RA field in an D, DS, X, XO, M, or MDS form instruction. */
286#define RA (40)
287#define RA_MASK (0x1f << 16)
288 { 5, 16, NULL, NULL, PPC_OPERAND_GPR },
289
290 /* The RA field in a D or X form instruction which is an updating
291 load, which means that the RA field may not be zero and may not
292 equal the RT field. */
293#define RAL (41)
294 { 5, 16, insert_ral, NULL, PPC_OPERAND_GPR },
295
296 /* The RA field in an lmw instruction, which has special value
297 restrictions. */
298#define RAM (42)
299 { 5, 16, insert_ram, NULL, PPC_OPERAND_GPR },
300
301 /* The RA field in a D or X form instruction which is an updating
302 store or an updating floating point load, which means that the RA
303 field may not be zero. */
304#define RAS (43)
305 { 5, 16, insert_ras, NULL, PPC_OPERAND_GPR },
306
307 /* The RB field in an X, XO, M, or MDS form instruction. */
308#define RB (44)
309#define RB_MASK (0x1f << 11)
310 { 5, 11, NULL, NULL, PPC_OPERAND_GPR },
311
312 /* The RB field in an X form instruction when it must be the same as
313 the RS field in the instruction. This is used for extended
314 mnemonics like mr. */
315#define RBS (45)
316 { 5, 1, insert_rbs, extract_rbs, PPC_OPERAND_FAKE },
317
318 /* The RS field in a D, DS, X, XFX, XS, M, MD or MDS form
319 instruction or the RT field in a D, DS, X, XFX or XO form
320 instruction. */
321#define RS (46)
322#define RT (RS)
323#define RT_MASK (0x1f << 21)
324 { 5, 21, NULL, NULL, PPC_OPERAND_GPR },
325
326 /* The SH field in an X or M form instruction. */
327#define SH (47)
328#define SH_MASK (0x1f << 11)
329 { 5, 11, NULL, NULL, 0 },
330
331 /* The SH field in an MD form instruction. This is split. */
332#define SH6 (48)
333#define SH6_MASK ((0x1f << 11) | (1 << 1))
334 { 6, 1, insert_sh6, extract_sh6, 0 },
335
336 /* The SI field in a D form instruction. */
337#define SI (49)
338 { 16, 0, NULL, NULL, PPC_OPERAND_SIGNED },
339
340 /* The SI field in a D form instruction when we accept a wide range
341 of positive values. */
342#define SISIGNOPT (50)
343 { 16, 0, NULL, NULL, PPC_OPERAND_SIGNED | PPC_OPERAND_SIGNOPT },
344
345 /* The SPR field in an XFX form instruction. This is flipped--the
346 lower 5 bits are stored in the upper 5 and vice- versa. */
347#define SPR (51)
348#define SPR_MASK (0x3ff << 11)
349 { 10, 11, insert_spr, extract_spr, 0 },
350
351 /* The BAT index number in an XFX form m[ft]ibat[lu] instruction. */
352#define SPRBAT (52)
353#define SPRBAT_MASK (0x3 << 17)
354 { 2, 17, NULL, NULL, 0 },
355
356 /* The SPRG register number in an XFX form m[ft]sprg instruction. */
357#define SPRG (53)
358#define SPRG_MASK (0x3 << 16)
359 { 2, 16, NULL, NULL, 0 },
360
361 /* The SR field in an X form instruction. */
362#define SR (54)
363 { 4, 16, NULL, NULL, 0 },
364
365 /* The SV field in a POWER SC form instruction. */
366#define SV (55)
367 { 14, 2, NULL, NULL, 0 },
368
369 /* The TBR field in an XFX form instruction. This is like the SPR
370 field, but it is optional. */
371#define TBR (56)
372 { 10, 11, insert_tbr, extract_tbr, PPC_OPERAND_OPTIONAL },
373
374 /* The TO field in a D or X form instruction. */
375#define TO (57)
376#define TO_MASK (0x1f << 21)
377 { 5, 21, NULL, NULL, 0 },
378
379 /* The U field in an X form instruction. */
380#define U (58)
381 { 4, 12, NULL, NULL, 0 },
382
383 /* The UI field in a D form instruction. */
384#define UI (59)
385 { 16, 0, NULL, NULL, 0 },
386};
387
388/* The functions used to insert and extract complicated operands. */
389
390/* The BA field in an XL form instruction when it must be the same as
391 the BT field in the same instruction. This operand is marked FAKE.
392 The insertion function just copies the BT field into the BA field,
393 and the extraction function just checks that the fields are the
394 same. */
395
396/*ARGSUSED*/
397static unsigned long
398insert_bat(unsigned long insn, long value, const char **errmsg)
399{
400 return insn | (((insn >> 21) & 0x1f) << 16);
401}
402
403static long
404extract_bat(unsigned long insn, int *invalid)
405{
406 if (invalid != (int *) NULL
407 && ((insn >> 21) & 0x1f) != ((insn >> 16) & 0x1f))
408 *invalid = 1;
409 return 0;
410}
411
412/* The BB field in an XL form instruction when it must be the same as
413 the BA field in the same instruction. This operand is marked FAKE.
414 The insertion function just copies the BA field into the BB field,
415 and the extraction function just checks that the fields are the
416 same. */
417
418/*ARGSUSED*/
419static unsigned long
420insert_bba(unsigned long insn, long value, const char **errmsg)
421{
422 return insn | (((insn >> 16) & 0x1f) << 11);
423}
424
425static long
426extract_bba(unsigned long insn, int *invalid)
427{
428 if (invalid != (int *) NULL
429 && ((insn >> 16) & 0x1f) != ((insn >> 11) & 0x1f))
430 *invalid = 1;
431 return 0;
432}
433
434/* The BD field in a B form instruction. The lower two bits are
435 forced to zero. */
436
437/*ARGSUSED*/
438static unsigned long
439insert_bd(unsigned long insn, long value, const char **errmsg)
440{
441 return insn | (value & 0xfffc);
442}
443
444/*ARGSUSED*/
445static long
446extract_bd(unsigned long insn, int *invalid)
447{
448 if ((insn & 0x8000) != 0)
449 return (insn & 0xfffc) - 0x10000;
450 else
451 return insn & 0xfffc;
452}
453
454/* The BD field in a B form instruction when the - modifier is used.
455 This modifier means that the branch is not expected to be taken.
456 We must set the y bit of the BO field to 1 if the offset is
457 negative. When extracting, we require that the y bit be 1 and that
458 the offset be positive, since if the y bit is 0 we just want to
459 print the normal form of the instruction. */
460
461/*ARGSUSED*/
462static unsigned long
463insert_bdm(unsigned long insn, long value, const char **errmsg)
464{
465 if ((value & 0x8000) != 0)
466 insn |= 1 << 21;
467 return insn | (value & 0xfffc);
468}
469
470static long
471extract_bdm(unsigned long insn, int *invalid)
472{
473 if (invalid != (int *) NULL
474 && ((insn & (1 << 21)) == 0
475 || (insn & (1 << 15)) == 0))
476 *invalid = 1;
477 if ((insn & 0x8000) != 0)
478 return (insn & 0xfffc) - 0x10000;
479 else
480 return insn & 0xfffc;
481}
482
483/* The BD field in a B form instruction when the + modifier is used.
484 This is like BDM, above, except that the branch is expected to be
485 taken. */
486
487/*ARGSUSED*/
488static unsigned long
489insert_bdp(unsigned long insn, long value, const char **errmsg)
490{
491 if ((value & 0x8000) == 0)
492 insn |= 1 << 21;
493 return insn | (value & 0xfffc);
494}
495
496static long
497extract_bdp(unsigned long insn, int *invalid)
498{
499 if (invalid != (int *) NULL
500 && ((insn & (1 << 21)) == 0
501 || (insn & (1 << 15)) != 0))
502 *invalid = 1;
503 if ((insn & 0x8000) != 0)
504 return (insn & 0xfffc) - 0x10000;
505 else
506 return insn & 0xfffc;
507}
508
509/* Check for legal values of a BO field. */
510
511static int
512valid_bo (long value)
513{
514 /* Certain encodings have bits that are required to be zero. These
515 are (z must be zero, y may be anything):
516 001zy
517 011zy
518 1z00y
519 1z01y
520 1z1zz
521 */
522 switch (value & 0x14)
523 {
524 default:
525 case 0:
526 return 1;
527 case 0x4:
528 return (value & 0x2) == 0;
529 case 0x10:
530 return (value & 0x8) == 0;
531 case 0x14:
532 return value == 0x14;
533 }
534}
535
536/* The BO field in a B form instruction. Warn about attempts to set
537 the field to an illegal value. */
538
539static unsigned long
540insert_bo(unsigned long insn, long value, const char **errmsg)
541{
542 if (errmsg != (const char **) NULL
543 && ! valid_bo (value))
544 *errmsg = "invalid conditional option";
545 return insn | ((value & 0x1f) << 21);
546}
547
548static long
549extract_bo(unsigned long insn, int *invalid)
550{
551 long value;
552
553 value = (insn >> 21) & 0x1f;
554 if (invalid != (int *) NULL
555 && ! valid_bo (value))
556 *invalid = 1;
557 return value;
558}
559
560/* The BO field in a B form instruction when the + or - modifier is
561 used. This is like the BO field, but it must be even. When
562 extracting it, we force it to be even. */
563
564static unsigned long
565insert_boe(unsigned long insn, long value, const char **errmsg)
566{
567 if (errmsg != (const char **) NULL)
568 {
569 if (! valid_bo (value))
570 *errmsg = "invalid conditional option";
571 else if ((value & 1) != 0)
572 *errmsg = "attempt to set y bit when using + or - modifier";
573 }
574 return insn | ((value & 0x1f) << 21);
575}
576
577static long
578extract_boe(unsigned long insn, int *invalid)
579{
580 long value;
581
582 value = (insn >> 21) & 0x1f;
583 if (invalid != (int *) NULL
584 && ! valid_bo (value))
585 *invalid = 1;
586 return value & 0x1e;
587}
588
589/* The DS field in a DS form instruction. This is like D, but the
590 lower two bits are forced to zero. */
591
592/*ARGSUSED*/
593static unsigned long
594insert_ds(unsigned long insn, long value, const char **errmsg)
595{
596 return insn | (value & 0xfffc);
597}
598
599/*ARGSUSED*/
600static long
601extract_ds(unsigned long insn, int *invalid)
602{
603 if ((insn & 0x8000) != 0)
604 return (insn & 0xfffc) - 0x10000;
605 else
606 return insn & 0xfffc;
607}
608
609/* The LI field in an I form instruction. The lower two bits are
610 forced to zero. */
611
612/*ARGSUSED*/
613static unsigned long
614insert_li(unsigned long insn, long value, const char **errmsg)
615{
616 return insn | (value & 0x3fffffc);
617}
618
619/*ARGSUSED*/
620static long
621extract_li(unsigned long insn, int *invalid)
622{
623 if ((insn & 0x2000000) != 0)
624 return (insn & 0x3fffffc) - 0x4000000;
625 else
626 return insn & 0x3fffffc;
627}
628
629/* The MB and ME fields in an M form instruction expressed as a single
630 operand which is itself a bitmask. The extraction function always
631 marks it as invalid, since we never want to recognize an
632 instruction which uses a field of this type. */
633
634static unsigned long
635insert_mbe(unsigned long insn, long value, const char **errmsg)
636{
637 unsigned long uval;
638 int mb, me;
639
640 uval = value;
641
642 if (uval == 0)
643 {
644 if (errmsg != (const char **) NULL)
645 *errmsg = "illegal bitmask";
646 return insn;
647 }
648
649 me = 31;
650 while ((uval & 1) == 0)
651 {
652 uval >>= 1;
653 --me;
654 }
655
656 mb = me;
657 uval >>= 1;
658 while ((uval & 1) != 0)
659 {
660 uval >>= 1;
661 --mb;
662 }
663
664 if (uval != 0)
665 {
666 if (errmsg != (const char **) NULL)
667 *errmsg = "illegal bitmask";
668 }
669
670 return insn | (mb << 6) | (me << 1);
671}
672
673static long
674extract_mbe(unsigned long insn, int *invalid)
675{
676 long ret;
677 int mb, me;
678 int i;
679
680 if (invalid != (int *) NULL)
681 *invalid = 1;
682
683 ret = 0;
684 mb = (insn >> 6) & 0x1f;
685 me = (insn >> 1) & 0x1f;
686 for (i = mb; i < me; i++)
687 ret |= 1 << (31 - i);
688 return ret;
689}
690
691/* The MB or ME field in an MD or MDS form instruction. The high bit
692 is wrapped to the low end. */
693
694/*ARGSUSED*/
695static unsigned long
696insert_mb6(unsigned long insn, long value, const char **errmsg)
697{
698 return insn | ((value & 0x1f) << 6) | (value & 0x20);
699}
700
701/*ARGSUSED*/
702static long
703extract_mb6(unsigned long insn, int *invalid)
704{
705 return ((insn >> 6) & 0x1f) | (insn & 0x20);
706}
707
708/* The NB field in an X form instruction. The value 32 is stored as
709 0. */
710
711static unsigned long
712insert_nb(unsigned long insn, long value, const char **errmsg)
713{
714 if (value < 0 || value > 32)
715 *errmsg = "value out of range";
716 if (value == 32)
717 value = 0;
718 return insn | ((value & 0x1f) << 11);
719}
720
721/*ARGSUSED*/
722static long
723extract_nb(unsigned long insn, int *invalid)
724{
725 long ret;
726
727 ret = (insn >> 11) & 0x1f;
728 if (ret == 0)
729 ret = 32;
730 return ret;
731}
732
733/* The NSI field in a D form instruction. This is the same as the SI
734 field, only negated. The extraction function always marks it as
735 invalid, since we never want to recognize an instruction which uses
736 a field of this type. */
737
738/*ARGSUSED*/
739static unsigned long
740insert_nsi(unsigned long insn, long value, const char **errmsg)
741{
742 return insn | ((- value) & 0xffff);
743}
744
745static long
746extract_nsi(unsigned long insn, int *invalid)
747{
748 if (invalid != (int *) NULL)
749 *invalid = 1;
750 if ((insn & 0x8000) != 0)
751 return - ((insn & 0xffff) - 0x10000);
752 else
753 return - (insn & 0xffff);
754}
755
756/* The RA field in a D or X form instruction which is an updating
757 load, which means that the RA field may not be zero and may not
758 equal the RT field. */
759
760static unsigned long
761insert_ral(unsigned long insn, long value, const char **errmsg)
762{
763 if (value == 0
764 || value == ((insn >> 21) & 0x1f))
765 *errmsg = "invalid register operand when updating";
766 return insn | ((value & 0x1f) << 16);
767}
768
769/* The RA field in an lmw instruction, which has special value
770 restrictions. */
771
772static unsigned long
773insert_ram(unsigned long insn, long value, const char **errmsg)
774{
775 if (value >= ((insn >> 21) & 0x1f))
776 *errmsg = "index register in load range";
777 return insn | ((value & 0x1f) << 16);
778}
779
780/* The RA field in a D or X form instruction which is an updating
781 store or an updating floating point load, which means that the RA
782 field may not be zero. */
783
784static unsigned long
785insert_ras(unsigned long insn, long value, const char **errmsg)
786{
787 if (value == 0)
788 *errmsg = "invalid register operand when updating";
789 return insn | ((value & 0x1f) << 16);
790}
791
792/* The RB field in an X form instruction when it must be the same as
793 the RS field in the instruction. This is used for extended
794 mnemonics like mr. This operand is marked FAKE. The insertion
795 function just copies the BT field into the BA field, and the
796 extraction function just checks that the fields are the same. */
797
798/*ARGSUSED*/
799static unsigned long
800insert_rbs(unsigned long insn, long value, const char **errmsg)
801{
802 return insn | (((insn >> 21) & 0x1f) << 11);
803}
804
805static long
806extract_rbs(unsigned long insn, int *invalid)
807{
808 if (invalid != (int *) NULL
809 && ((insn >> 21) & 0x1f) != ((insn >> 11) & 0x1f))
810 *invalid = 1;
811 return 0;
812}
813
814/* The SH field in an MD form instruction. This is split. */
815
816/*ARGSUSED*/
817static unsigned long
818insert_sh6(unsigned long insn, long value, const char **errmsg)
819{
820 return insn | ((value & 0x1f) << 11) | ((value & 0x20) >> 4);
821}
822
823/*ARGSUSED*/
824static long
825extract_sh6(unsigned long insn, int *invalid)
826{
827 return ((insn >> 11) & 0x1f) | ((insn << 4) & 0x20);
828}
829
830/* The SPR field in an XFX form instruction. This is flipped--the
831 lower 5 bits are stored in the upper 5 and vice- versa. */
832
833static unsigned long
834insert_spr(unsigned long insn, long value, const char **errmsg)
835{
836 return insn | ((value & 0x1f) << 16) | ((value & 0x3e0) << 6);
837}
838
839static long
840extract_spr(unsigned long insn, int *invalid)
841{
842 return ((insn >> 16) & 0x1f) | ((insn >> 6) & 0x3e0);
843}
844
845/* The TBR field in an XFX instruction. This is just like SPR, but it
846 is optional. When TBR is omitted, it must be inserted as 268 (the
847 magic number of the TB register). These functions treat 0
848 (indicating an omitted optional operand) as 268. This means that
849 ``mftb 4,0'' is not handled correctly. This does not matter very
850 much, since the architecture manual does not define mftb as
851 accepting any values other than 268 or 269. */
852
853#define TB (268)
854
855static unsigned long
856insert_tbr(unsigned long insn, long value, const char **errmsg)
857{
858 if (value == 0)
859 value = TB;
860 return insn | ((value & 0x1f) << 16) | ((value & 0x3e0) << 6);
861}
862
863static long
864extract_tbr(unsigned long insn, int *invalid)
865{
866 long ret;
867
868 ret = ((insn >> 16) & 0x1f) | ((insn >> 6) & 0x3e0);
869 if (ret == TB)
870 ret = 0;
871 return ret;
872}
873
874/* Macros used to form opcodes. */
875
876/* The main opcode. */
877#define OP(x) (((x) & 0x3f) << 26)
878#define OP_MASK OP (0x3f)
879
880/* The main opcode combined with a trap code in the TO field of a D
881 form instruction. Used for extended mnemonics for the trap
882 instructions. */
883#define OPTO(x,to) (OP (x) | (((to) & 0x1f) << 21))
884#define OPTO_MASK (OP_MASK | TO_MASK)
885
886/* The main opcode combined with a comparison size bit in the L field
887 of a D form or X form instruction. Used for extended mnemonics for
888 the comparison instructions. */
889#define OPL(x,l) (OP (x) | (((l) & 1) << 21))
890#define OPL_MASK OPL (0x3f,1)
891
892/* An A form instruction. */
893#define A(op, xop, rc) (OP (op) | (((xop) & 0x1f) << 1) | ((rc) & 1))
894#define A_MASK A (0x3f, 0x1f, 1)
895
896/* An A_MASK with the FRB field fixed. */
897#define AFRB_MASK (A_MASK | FRB_MASK)
898
899/* An A_MASK with the FRC field fixed. */
900#define AFRC_MASK (A_MASK | FRC_MASK)
901
902/* An A_MASK with the FRA and FRC fields fixed. */
903#define AFRAFRC_MASK (A_MASK | FRA_MASK | FRC_MASK)
904
905/* A B form instruction. */
906#define B(op, aa, lk) (OP (op) | (((aa) & 1) << 1) | ((lk) & 1))
907#define B_MASK B (0x3f, 1, 1)
908
909/* A B form instruction setting the BO field. */
910#define BBO(op, bo, aa, lk) (B ((op), (aa), (lk)) | (((bo) & 0x1f) << 21))
911#define BBO_MASK BBO (0x3f, 0x1f, 1, 1)
912
913/* A BBO_MASK with the y bit of the BO field removed. This permits
914 matching a conditional branch regardless of the setting of the y
915 bit. */
916#define Y_MASK (1 << 21)
917#define BBOY_MASK (BBO_MASK &~ Y_MASK)
918
919/* A B form instruction setting the BO field and the condition bits of
920 the BI field. */
921#define BBOCB(op, bo, cb, aa, lk) \
922 (BBO ((op), (bo), (aa), (lk)) | (((cb) & 0x3) << 16))
923#define BBOCB_MASK BBOCB (0x3f, 0x1f, 0x3, 1, 1)
924
925/* A BBOCB_MASK with the y bit of the BO field removed. */
926#define BBOYCB_MASK (BBOCB_MASK &~ Y_MASK)
927
928/* A BBOYCB_MASK in which the BI field is fixed. */
929#define BBOYBI_MASK (BBOYCB_MASK | BI_MASK)
930
931/* The main opcode mask with the RA field clear. */
932#define DRA_MASK (OP_MASK | RA_MASK)
933
934/* A DS form instruction. */
935#define DSO(op, xop) (OP (op) | ((xop) & 0x3))
936#define DS_MASK DSO (0x3f, 3)
937
938/* An M form instruction. */
939#define M(op, rc) (OP (op) | ((rc) & 1))
940#define M_MASK M (0x3f, 1)
941
942/* An M form instruction with the ME field specified. */
943#define MME(op, me, rc) (M ((op), (rc)) | (((me) & 0x1f) << 1))
944
945/* An M_MASK with the MB and ME fields fixed. */
946#define MMBME_MASK (M_MASK | MB_MASK | ME_MASK)
947
948/* An M_MASK with the SH and ME fields fixed. */
949#define MSHME_MASK (M_MASK | SH_MASK | ME_MASK)
950
951/* An MD form instruction. */
952#define MD(op, xop, rc) (OP (op) | (((xop) & 0x7) << 2) | ((rc) & 1))
953#define MD_MASK MD (0x3f, 0x7, 1)
954
955/* An MD_MASK with the MB field fixed. */
956#define MDMB_MASK (MD_MASK | MB6_MASK)
957
958/* An MD_MASK with the SH field fixed. */
959#define MDSH_MASK (MD_MASK | SH6_MASK)
960
961/* An MDS form instruction. */
962#define MDS(op, xop, rc) (OP (op) | (((xop) & 0xf) << 1) | ((rc) & 1))
963#define MDS_MASK MDS (0x3f, 0xf, 1)
964
965/* An MDS_MASK with the MB field fixed. */
966#define MDSMB_MASK (MDS_MASK | MB6_MASK)
967
968/* An SC form instruction. */
969#define SC(op, sa, lk) (OP (op) | (((sa) & 1) << 1) | ((lk) & 1))
970#define SC_MASK (OP_MASK | (0x3ff << 16) | (1 << 1) | 1)
971
972/* An X form instruction. */
973#define X(op, xop) (OP (op) | (((xop) & 0x3ff) << 1))
974
975/* An X form instruction with the RC bit specified. */
976#define XRC(op, xop, rc) (X ((op), (xop)) | ((rc) & 1))
977
978/* The mask for an X form instruction. */
979#define X_MASK XRC (0x3f, 0x3ff, 1)
980
981/* An X_MASK with the RA field fixed. */
982#define XRA_MASK (X_MASK | RA_MASK)
983
984/* An X_MASK with the RB field fixed. */
985#define XRB_MASK (X_MASK | RB_MASK)
986
987/* An X_MASK with the RT field fixed. */
988#define XRT_MASK (X_MASK | RT_MASK)
989
990/* An X_MASK with the RA and RB fields fixed. */
991#define XRARB_MASK (X_MASK | RA_MASK | RB_MASK)
992
993/* An X_MASK with the RT and RA fields fixed. */
994#define XRTRA_MASK (X_MASK | RT_MASK | RA_MASK)
995
996/* An X form comparison instruction. */
997#define XCMPL(op, xop, l) (X ((op), (xop)) | (((l) & 1) << 21))
998
999/* The mask for an X form comparison instruction. */
1000#define XCMP_MASK (X_MASK | (1 << 22))
1001
1002/* The mask for an X form comparison instruction with the L field
1003 fixed. */
1004#define XCMPL_MASK (XCMP_MASK | (1 << 21))
1005
1006/* An X form trap instruction with the TO field specified. */
1007#define XTO(op, xop, to) (X ((op), (xop)) | (((to) & 0x1f) << 21))
1008#define XTO_MASK (X_MASK | TO_MASK)
1009
1010/* An XFL form instruction. */
1011#define XFL(op, xop, rc) (OP (op) | (((xop) & 0x3ff) << 1) | ((rc) & 1))
1012#define XFL_MASK (XFL (0x3f, 0x3ff, 1) | (1 << 25) | (1 << 16))
1013
1014/* An XL form instruction with the LK field set to 0. */
1015#define XL(op, xop) (OP (op) | (((xop) & 0x3ff) << 1))
1016
1017/* An XL form instruction which uses the LK field. */
1018#define XLLK(op, xop, lk) (XL ((op), (xop)) | ((lk) & 1))
1019
1020/* The mask for an XL form instruction. */
1021#define XL_MASK XLLK (0x3f, 0x3ff, 1)
1022
1023/* An XL form instruction which explicitly sets the BO field. */
1024#define XLO(op, bo, xop, lk) \
1025 (XLLK ((op), (xop), (lk)) | (((bo) & 0x1f) << 21))
1026#define XLO_MASK (XL_MASK | BO_MASK)
1027
1028/* An XL form instruction which explicitly sets the y bit of the BO
1029 field. */
1030#define XLYLK(op, xop, y, lk) (XLLK ((op), (xop), (lk)) | (((y) & 1) << 21))
1031#define XLYLK_MASK (XL_MASK | Y_MASK)
1032
1033/* An XL form instruction which sets the BO field and the condition
1034 bits of the BI field. */
1035#define XLOCB(op, bo, cb, xop, lk) \
1036 (XLO ((op), (bo), (xop), (lk)) | (((cb) & 3) << 16))
1037#define XLOCB_MASK XLOCB (0x3f, 0x1f, 0x3, 0x3ff, 1)
1038
1039/* An XL_MASK or XLYLK_MASK or XLOCB_MASK with the BB field fixed. */
1040#define XLBB_MASK (XL_MASK | BB_MASK)
1041#define XLYBB_MASK (XLYLK_MASK | BB_MASK)
1042#define XLBOCBBB_MASK (XLOCB_MASK | BB_MASK)
1043
1044/* An XL_MASK with the BO and BB fields fixed. */
1045#define XLBOBB_MASK (XL_MASK | BO_MASK | BB_MASK)
1046
1047/* An XL_MASK with the BO, BI and BB fields fixed. */
1048#define XLBOBIBB_MASK (XL_MASK | BO_MASK | BI_MASK | BB_MASK)
1049
1050/* An XO form instruction. */
1051#define XO(op, xop, oe, rc) \
1052 (OP (op) | (((xop) & 0x1ff) << 1) | (((oe) & 1) << 10) | ((rc) & 1))
1053#define XO_MASK XO (0x3f, 0x1ff, 1, 1)
1054
1055/* An XO_MASK with the RB field fixed. */
1056#define XORB_MASK (XO_MASK | RB_MASK)
1057
1058/* An XS form instruction. */
1059#define XS(op, xop, rc) (OP (op) | (((xop) & 0x1ff) << 2) | ((rc) & 1))
1060#define XS_MASK XS (0x3f, 0x1ff, 1)
1061
1062/* A mask for the FXM version of an XFX form instruction. */
1063#define XFXFXM_MASK (X_MASK | (1 << 20) | (1 << 11))
1064
1065/* An XFX form instruction with the FXM field filled in. */
1066#define XFXM(op, xop, fxm) \
1067 (X ((op), (xop)) | (((fxm) & 0xff) << 12))
1068
1069/* An XFX form instruction with the SPR field filled in. */
1070#define XSPR(op, xop, spr) \
1071 (X ((op), (xop)) | (((spr) & 0x1f) << 16) | (((spr) & 0x3e0) << 6))
1072#define XSPR_MASK (X_MASK | SPR_MASK)
1073
1074/* An XFX form instruction with the SPR field filled in except for the
1075 SPRBAT field. */
1076#define XSPRBAT_MASK (XSPR_MASK &~ SPRBAT_MASK)
1077
1078/* An XFX form instruction with the SPR field filled in except for the
1079 SPRG field. */
1080#define XSPRG_MASK (XSPR_MASK &~ SPRG_MASK)
1081
1082/* The BO encodings used in extended conditional branch mnemonics. */
1083#define BODNZF (0x0)
1084#define BODNZFP (0x1)
1085#define BODZF (0x2)
1086#define BODZFP (0x3)
1087#define BOF (0x4)
1088#define BOFP (0x5)
1089#define BODNZT (0x8)
1090#define BODNZTP (0x9)
1091#define BODZT (0xa)
1092#define BODZTP (0xb)
1093#define BOT (0xc)
1094#define BOTP (0xd)
1095#define BODNZ (0x10)
1096#define BODNZP (0x11)
1097#define BODZ (0x12)
1098#define BODZP (0x13)
1099#define BOU (0x14)
1100
1101/* The BI condition bit encodings used in extended conditional branch
1102 mnemonics. */
1103#define CBLT (0)
1104#define CBGT (1)
1105#define CBEQ (2)
1106#define CBSO (3)
1107
1108/* The TO encodings used in extended trap mnemonics. */
1109#define TOLGT (0x1)
1110#define TOLLT (0x2)
1111#define TOEQ (0x4)
1112#define TOLGE (0x5)
1113#define TOLNL (0x5)
1114#define TOLLE (0x6)
1115#define TOLNG (0x6)
1116#define TOGT (0x8)
1117#define TOGE (0xc)
1118#define TONL (0xc)
1119#define TOLT (0x10)
1120#define TOLE (0x14)
1121#define TONG (0x14)
1122#define TONE (0x18)
1123#define TOU (0x1f)
1124
1125/* Smaller names for the flags so each entry in the opcodes table will
1126 fit on a single line. */
1127#undef PPC
1128#define PPC PPC_OPCODE_PPC
1129#define POWER PPC_OPCODE_POWER
1130#define POWER2 PPC_OPCODE_POWER2
1131#define B32 PPC_OPCODE_32
1132#define B64 PPC_OPCODE_64
1133#define M601 PPC_OPCODE_601
1134
1135/* The opcode table.
1136
1137 The format of the opcode table is:
1138
1139 NAME OPCODE MASK FLAGS { OPERANDS }
1140
1141 NAME is the name of the instruction.
1142 OPCODE is the instruction opcode.
1143 MASK is the opcode mask; this is used to tell the disassembler
1144 which bits in the actual opcode must match OPCODE.
1145 FLAGS are flags indicated what processors support the instruction.
1146 OPERANDS is the list of operands.
1147
1148 The disassembler reads the table in order and prints the first
1149 instruction which matches, so this table is sorted to put more
1150 specific instructions before more general instructions. It is also
1151 sorted by major opcode. */
1152
1153const struct powerpc_opcode powerpc_opcodes[] = {
1154{ "tdlgti", OPTO(2,TOLGT), OPTO_MASK, PPC|B64, { RA, SI } },
1155{ "tdllti", OPTO(2,TOLLT), OPTO_MASK, PPC|B64, { RA, SI } },
1156{ "tdeqi", OPTO(2,TOEQ), OPTO_MASK, PPC|B64, { RA, SI } },
1157{ "tdlgei", OPTO(2,TOLGE), OPTO_MASK, PPC|B64, { RA, SI } },
1158{ "tdlnli", OPTO(2,TOLNL), OPTO_MASK, PPC|B64, { RA, SI } },
1159{ "tdllei", OPTO(2,TOLLE), OPTO_MASK, PPC|B64, { RA, SI } },
1160{ "tdlngi", OPTO(2,TOLNG), OPTO_MASK, PPC|B64, { RA, SI } },
1161{ "tdgti", OPTO(2,TOGT), OPTO_MASK, PPC|B64, { RA, SI } },
1162{ "tdgei", OPTO(2,TOGE), OPTO_MASK, PPC|B64, { RA, SI } },
1163{ "tdnli", OPTO(2,TONL), OPTO_MASK, PPC|B64, { RA, SI } },
1164{ "tdlti", OPTO(2,TOLT), OPTO_MASK, PPC|B64, { RA, SI } },
1165{ "tdlei", OPTO(2,TOLE), OPTO_MASK, PPC|B64, { RA, SI } },
1166{ "tdngi", OPTO(2,TONG), OPTO_MASK, PPC|B64, { RA, SI } },
1167{ "tdnei", OPTO(2,TONE), OPTO_MASK, PPC|B64, { RA, SI } },
1168{ "tdi", OP(2), OP_MASK, PPC|B64, { TO, RA, SI } },
1169
1170{ "twlgti", OPTO(3,TOLGT), OPTO_MASK, PPC, { RA, SI } },
1171{ "tlgti", OPTO(3,TOLGT), OPTO_MASK, POWER, { RA, SI } },
1172{ "twllti", OPTO(3,TOLLT), OPTO_MASK, PPC, { RA, SI } },
1173{ "tllti", OPTO(3,TOLLT), OPTO_MASK, POWER, { RA, SI } },
1174{ "tweqi", OPTO(3,TOEQ), OPTO_MASK, PPC, { RA, SI } },
1175{ "teqi", OPTO(3,TOEQ), OPTO_MASK, POWER, { RA, SI } },
1176{ "twlgei", OPTO(3,TOLGE), OPTO_MASK, PPC, { RA, SI } },
1177{ "tlgei", OPTO(3,TOLGE), OPTO_MASK, POWER, { RA, SI } },
1178{ "twlnli", OPTO(3,TOLNL), OPTO_MASK, PPC, { RA, SI } },
1179{ "tlnli", OPTO(3,TOLNL), OPTO_MASK, POWER, { RA, SI } },
1180{ "twllei", OPTO(3,TOLLE), OPTO_MASK, PPC, { RA, SI } },
1181{ "tllei", OPTO(3,TOLLE), OPTO_MASK, POWER, { RA, SI } },
1182{ "twlngi", OPTO(3,TOLNG), OPTO_MASK, PPC, { RA, SI } },
1183{ "tlngi", OPTO(3,TOLNG), OPTO_MASK, POWER, { RA, SI } },
1184{ "twgti", OPTO(3,TOGT), OPTO_MASK, PPC, { RA, SI } },
1185{ "tgti", OPTO(3,TOGT), OPTO_MASK, POWER, { RA, SI } },
1186{ "twgei", OPTO(3,TOGE), OPTO_MASK, PPC, { RA, SI } },
1187{ "tgei", OPTO(3,TOGE), OPTO_MASK, POWER, { RA, SI } },
1188{ "twnli", OPTO(3,TONL), OPTO_MASK, PPC, { RA, SI } },
1189{ "tnli", OPTO(3,TONL), OPTO_MASK, POWER, { RA, SI } },
1190{ "twlti", OPTO(3,TOLT), OPTO_MASK, PPC, { RA, SI } },
1191{ "tlti", OPTO(3,TOLT), OPTO_MASK, POWER, { RA, SI } },
1192{ "twlei", OPTO(3,TOLE), OPTO_MASK, PPC, { RA, SI } },
1193{ "tlei", OPTO(3,TOLE), OPTO_MASK, POWER, { RA, SI } },
1194{ "twngi", OPTO(3,TONG), OPTO_MASK, PPC, { RA, SI } },
1195{ "tngi", OPTO(3,TONG), OPTO_MASK, POWER, { RA, SI } },
1196{ "twnei", OPTO(3,TONE), OPTO_MASK, PPC, { RA, SI } },
1197{ "tnei", OPTO(3,TONE), OPTO_MASK, POWER, { RA, SI } },
1198{ "twi", OP(3), OP_MASK, PPC, { TO, RA, SI } },
1199{ "ti", OP(3), OP_MASK, POWER, { TO, RA, SI } },
1200
1201{ "mulli", OP(7), OP_MASK, PPC, { RT, RA, SI } },
1202{ "muli", OP(7), OP_MASK, POWER, { RT, RA, SI } },
1203
1204{ "subfic", OP(8), OP_MASK, PPC, { RT, RA, SI } },
1205{ "sfi", OP(8), OP_MASK, POWER, { RT, RA, SI } },
1206
1207{ "dozi", OP(9), OP_MASK, POWER|M601, { RT, RA, SI } },
1208
1209{ "cmplwi", OPL(10,0), OPL_MASK, PPC, { OBF, RA, UI } },
1210{ "cmpldi", OPL(10,1), OPL_MASK, PPC|B64, { OBF, RA, UI } },
1211{ "cmpli", OP(10), OP_MASK, PPC, { BF, L, RA, UI } },
1212{ "cmpli", OP(10), OP_MASK, POWER, { BF, RA, UI } },
1213
1214{ "cmpwi", OPL(11,0), OPL_MASK, PPC, { OBF, RA, SI } },
1215{ "cmpdi", OPL(11,1), OPL_MASK, PPC|B64, { OBF, RA, SI } },
1216{ "cmpi", OP(11), OP_MASK, PPC, { BF, L, RA, SI } },
1217{ "cmpi", OP(11), OP_MASK, POWER, { BF, RA, SI } },
1218
1219{ "addic", OP(12), OP_MASK, PPC, { RT, RA, SI } },
1220{ "ai", OP(12), OP_MASK, POWER, { RT, RA, SI } },
1221{ "subic", OP(12), OP_MASK, PPC, { RT, RA, NSI } },
1222
1223{ "addic.", OP(13), OP_MASK, PPC, { RT, RA, SI } },
1224{ "ai.", OP(13), OP_MASK, POWER, { RT, RA, SI } },
1225{ "subic.", OP(13), OP_MASK, PPC, { RT, RA, NSI } },
1226
1227{ "li", OP(14), DRA_MASK, PPC, { RT, SI } },
1228{ "lil", OP(14), DRA_MASK, POWER, { RT, SI } },
1229{ "addi", OP(14), OP_MASK, PPC, { RT, RA, SI } },
1230{ "cal", OP(14), OP_MASK, POWER, { RT, D, RA } },
1231{ "subi", OP(14), OP_MASK, PPC, { RT, RA, NSI } },
1232{ "la", OP(14), OP_MASK, PPC, { RT, D, RA } },
1233
1234{ "lis", OP(15), DRA_MASK, PPC, { RT, SISIGNOPT } },
1235{ "liu", OP(15), DRA_MASK, POWER, { RT, SISIGNOPT } },
1236{ "addis", OP(15), OP_MASK, PPC, { RT,RA,SISIGNOPT } },
1237{ "cau", OP(15), OP_MASK, POWER, { RT,RA,SISIGNOPT } },
1238{ "subis", OP(15), OP_MASK, PPC, { RT, RA, NSI } },
1239
1240{ "bdnz-", BBO(16,BODNZ,0,0), BBOYBI_MASK, PPC, { BDM } },
1241{ "bdnz+", BBO(16,BODNZ,0,0), BBOYBI_MASK, PPC, { BDP } },
1242{ "bdnz", BBO(16,BODNZ,0,0), BBOYBI_MASK, PPC, { BD } },
1243{ "bdn", BBO(16,BODNZ,0,0), BBOYBI_MASK, POWER, { BD } },
1244{ "bdnzl-", BBO(16,BODNZ,0,1), BBOYBI_MASK, PPC, { BDM } },
1245{ "bdnzl+", BBO(16,BODNZ,0,1), BBOYBI_MASK, PPC, { BDP } },
1246{ "bdnzl", BBO(16,BODNZ,0,1), BBOYBI_MASK, PPC, { BD } },
1247{ "bdnl", BBO(16,BODNZ,0,1), BBOYBI_MASK, POWER, { BD } },
1248{ "bdnza-", BBO(16,BODNZ,1,0), BBOYBI_MASK, PPC, { BDMA } },
1249{ "bdnza+", BBO(16,BODNZ,1,0), BBOYBI_MASK, PPC, { BDPA } },
1250{ "bdnza", BBO(16,BODNZ,1,0), BBOYBI_MASK, PPC, { BDA } },
1251{ "bdna", BBO(16,BODNZ,1,0), BBOYBI_MASK, POWER, { BDA } },
1252{ "bdnzla-", BBO(16,BODNZ,1,1), BBOYBI_MASK, PPC, { BDMA } },
1253{ "bdnzla+", BBO(16,BODNZ,1,1), BBOYBI_MASK, PPC, { BDPA } },
1254{ "bdnzla", BBO(16,BODNZ,1,1), BBOYBI_MASK, PPC, { BDA } },
1255{ "bdnla", BBO(16,BODNZ,1,1), BBOYBI_MASK, POWER, { BDA } },
1256{ "bdz-", BBO(16,BODZ,0,0), BBOYBI_MASK, PPC, { BDM } },
1257{ "bdz+", BBO(16,BODZ,0,0), BBOYBI_MASK, PPC, { BDP } },
1258{ "bdz", BBO(16,BODZ,0,0), BBOYBI_MASK, PPC|POWER, { BD } },
1259{ "bdzl-", BBO(16,BODZ,0,1), BBOYBI_MASK, PPC, { BDM } },
1260{ "bdzl+", BBO(16,BODZ,0,1), BBOYBI_MASK, PPC, { BDP } },
1261{ "bdzl", BBO(16,BODZ,0,1), BBOYBI_MASK, PPC|POWER, { BD } },
1262{ "bdza-", BBO(16,BODZ,1,0), BBOYBI_MASK, PPC, { BDMA } },
1263{ "bdza+", BBO(16,BODZ,1,0), BBOYBI_MASK, PPC, { BDPA } },
1264{ "bdza", BBO(16,BODZ,1,0), BBOYBI_MASK, PPC|POWER, { BDA } },
1265{ "bdzla-", BBO(16,BODZ,1,1), BBOYBI_MASK, PPC, { BDMA } },
1266{ "bdzla+", BBO(16,BODZ,1,1), BBOYBI_MASK, PPC, { BDPA } },
1267{ "bdzla", BBO(16,BODZ,1,1), BBOYBI_MASK, PPC|POWER, { BDA } },
1268{ "blt-", BBOCB(16,BOT,CBLT,0,0), BBOYCB_MASK, PPC, { CR, BDM } },
1269{ "blt+", BBOCB(16,BOT,CBLT,0,0), BBOYCB_MASK, PPC, { CR, BDP } },
1270{ "blt", BBOCB(16,BOT,CBLT,0,0), BBOYCB_MASK, PPC|POWER, { CR, BD } },
1271{ "bltl-", BBOCB(16,BOT,CBLT,0,1), BBOYCB_MASK, PPC, { CR, BDM } },
1272{ "bltl+", BBOCB(16,BOT,CBLT,0,1), BBOYCB_MASK, PPC, { CR, BDP } },
1273{ "bltl", BBOCB(16,BOT,CBLT,0,1), BBOYCB_MASK, PPC|POWER, { CR, BD } },
1274{ "blta-", BBOCB(16,BOT,CBLT,1,0), BBOYCB_MASK, PPC, { CR, BDMA } },
1275{ "blta+", BBOCB(16,BOT,CBLT,1,0), BBOYCB_MASK, PPC, { CR, BDPA } },
1276{ "blta", BBOCB(16,BOT,CBLT,1,0), BBOYCB_MASK, PPC|POWER, { CR, BDA } },
1277{ "bltla-", BBOCB(16,BOT,CBLT,1,1), BBOYCB_MASK, PPC, { CR, BDMA } },
1278{ "bltla+", BBOCB(16,BOT,CBLT,1,1), BBOYCB_MASK, PPC, { CR, BDPA } },
1279{ "bltla", BBOCB(16,BOT,CBLT,1,1), BBOYCB_MASK, PPC|POWER, { CR, BDA } },
1280{ "bgt-", BBOCB(16,BOT,CBGT,0,0), BBOYCB_MASK, PPC, { CR, BDM } },
1281{ "bgt+", BBOCB(16,BOT,CBGT,0,0), BBOYCB_MASK, PPC, { CR, BDP } },
1282{ "bgt", BBOCB(16,BOT,CBGT,0,0), BBOYCB_MASK, PPC|POWER, { CR, BD } },
1283{ "bgtl-", BBOCB(16,BOT,CBGT,0,1), BBOYCB_MASK, PPC, { CR, BDM } },
1284{ "bgtl+", BBOCB(16,BOT,CBGT,0,1), BBOYCB_MASK, PPC, { CR, BDP } },
1285{ "bgtl", BBOCB(16,BOT,CBGT,0,1), BBOYCB_MASK, PPC|POWER, { CR, BD } },
1286{ "bgta-", BBOCB(16,BOT,CBGT,1,0), BBOYCB_MASK, PPC, { CR, BDMA } },
1287{ "bgta+", BBOCB(16,BOT,CBGT,1,0), BBOYCB_MASK, PPC, { CR, BDPA } },
1288{ "bgta", BBOCB(16,BOT,CBGT,1,0), BBOYCB_MASK, PPC|POWER, { CR, BDA } },
1289{ "bgtla-", BBOCB(16,BOT,CBGT,1,1), BBOYCB_MASK, PPC, { CR, BDMA } },
1290{ "bgtla+", BBOCB(16,BOT,CBGT,1,1), BBOYCB_MASK, PPC, { CR, BDPA } },
1291{ "bgtla", BBOCB(16,BOT,CBGT,1,1), BBOYCB_MASK, PPC|POWER, { CR, BDA } },
1292{ "beq-", BBOCB(16,BOT,CBEQ,0,0), BBOYCB_MASK, PPC, { CR, BDM } },
1293{ "beq+", BBOCB(16,BOT,CBEQ,0,0), BBOYCB_MASK, PPC, { CR, BDP } },
1294{ "beq", BBOCB(16,BOT,CBEQ,0,0), BBOYCB_MASK, PPC|POWER, { CR, BD } },
1295{ "beql-", BBOCB(16,BOT,CBEQ,0,1), BBOYCB_MASK, PPC, { CR, BDM } },
1296{ "beql+", BBOCB(16,BOT,CBEQ,0,1), BBOYCB_MASK, PPC, { CR, BDP } },
1297{ "beql", BBOCB(16,BOT,CBEQ,0,1), BBOYCB_MASK, PPC|POWER, { CR, BD } },
1298{ "beqa-", BBOCB(16,BOT,CBEQ,1,0), BBOYCB_MASK, PPC, { CR, BDMA } },
1299{ "beqa+", BBOCB(16,BOT,CBEQ,1,0), BBOYCB_MASK, PPC, { CR, BDPA } },
1300{ "beqa", BBOCB(16,BOT,CBEQ,1,0), BBOYCB_MASK, PPC|POWER, { CR, BDA } },
1301{ "beqla-", BBOCB(16,BOT,CBEQ,1,1), BBOYCB_MASK, PPC, { CR, BDMA } },
1302{ "beqla+", BBOCB(16,BOT,CBEQ,1,1), BBOYCB_MASK, PPC, { CR, BDPA } },
1303{ "beqla", BBOCB(16,BOT,CBEQ,1,1), BBOYCB_MASK, PPC|POWER, { CR, BDA } },
1304{ "bso-", BBOCB(16,BOT,CBSO,0,0), BBOYCB_MASK, PPC, { CR, BDM } },
1305{ "bso+", BBOCB(16,BOT,CBSO,0,0), BBOYCB_MASK, PPC, { CR, BDP } },
1306{ "bso", BBOCB(16,BOT,CBSO,0,0), BBOYCB_MASK, PPC|POWER, { CR, BD } },
1307{ "bsol-", BBOCB(16,BOT,CBSO,0,1), BBOYCB_MASK, PPC, { CR, BDM } },
1308{ "bsol+", BBOCB(16,BOT,CBSO,0,1), BBOYCB_MASK, PPC, { CR, BDP } },
1309{ "bsol", BBOCB(16,BOT,CBSO,0,1), BBOYCB_MASK, PPC|POWER, { CR, BD } },
1310{ "bsoa-", BBOCB(16,BOT,CBSO,1,0), BBOYCB_MASK, PPC, { CR, BDMA } },
1311{ "bsoa+", BBOCB(16,BOT,CBSO,1,0), BBOYCB_MASK, PPC, { CR, BDPA } },
1312{ "bsoa", BBOCB(16,BOT,CBSO,1,0), BBOYCB_MASK, PPC|POWER, { CR, BDA } },
1313{ "bsola-", BBOCB(16,BOT,CBSO,1,1), BBOYCB_MASK, PPC, { CR, BDMA } },
1314{ "bsola+", BBOCB(16,BOT,CBSO,1,1), BBOYCB_MASK, PPC, { CR, BDPA } },
1315{ "bsola", BBOCB(16,BOT,CBSO,1,1), BBOYCB_MASK, PPC|POWER, { CR, BDA } },
1316{ "bun-", BBOCB(16,BOT,CBSO,0,0), BBOYCB_MASK, PPC, { CR, BDM } },
1317{ "bun+", BBOCB(16,BOT,CBSO,0,0), BBOYCB_MASK, PPC, { CR, BDP } },
1318{ "bun", BBOCB(16,BOT,CBSO,0,0), BBOYCB_MASK, PPC, { CR, BD } },
1319{ "bunl-", BBOCB(16,BOT,CBSO,0,1), BBOYCB_MASK, PPC, { CR, BDM } },
1320{ "bunl+", BBOCB(16,BOT,CBSO,0,1), BBOYCB_MASK, PPC, { CR, BDP } },
1321{ "bunl", BBOCB(16,BOT,CBSO,0,1), BBOYCB_MASK, PPC, { CR, BD } },
1322{ "buna-", BBOCB(16,BOT,CBSO,1,0), BBOYCB_MASK, PPC, { CR, BDMA } },
1323{ "buna+", BBOCB(16,BOT,CBSO,1,0), BBOYCB_MASK, PPC, { CR, BDPA } },
1324{ "buna", BBOCB(16,BOT,CBSO,1,0), BBOYCB_MASK, PPC, { CR, BDA } },
1325{ "bunla-", BBOCB(16,BOT,CBSO,1,1), BBOYCB_MASK, PPC, { CR, BDMA } },
1326{ "bunla+", BBOCB(16,BOT,CBSO,1,1), BBOYCB_MASK, PPC, { CR, BDPA } },
1327{ "bunla", BBOCB(16,BOT,CBSO,1,1), BBOYCB_MASK, PPC, { CR, BDA } },
1328{ "bge-", BBOCB(16,BOF,CBLT,0,0), BBOYCB_MASK, PPC, { CR, BDM } },
1329{ "bge+", BBOCB(16,BOF,CBLT,0,0), BBOYCB_MASK, PPC, { CR, BDP } },
1330{ "bge", BBOCB(16,BOF,CBLT,0,0), BBOYCB_MASK, PPC|POWER, { CR, BD } },
1331{ "bgel-", BBOCB(16,BOF,CBLT,0,1), BBOYCB_MASK, PPC, { CR, BDM } },
1332{ "bgel+", BBOCB(16,BOF,CBLT,0,1), BBOYCB_MASK, PPC, { CR, BDP } },
1333{ "bgel", BBOCB(16,BOF,CBLT,0,1), BBOYCB_MASK, PPC|POWER, { CR, BD } },
1334{ "bgea-", BBOCB(16,BOF,CBLT,1,0), BBOYCB_MASK, PPC, { CR, BDMA } },
1335{ "bgea+", BBOCB(16,BOF,CBLT,1,0), BBOYCB_MASK, PPC, { CR, BDPA } },
1336{ "bgea", BBOCB(16,BOF,CBLT,1,0), BBOYCB_MASK, PPC|POWER, { CR, BDA } },
1337{ "bgela-", BBOCB(16,BOF,CBLT,1,1), BBOYCB_MASK, PPC, { CR, BDMA } },
1338{ "bgela+", BBOCB(16,BOF,CBLT,1,1), BBOYCB_MASK, PPC, { CR, BDPA } },
1339{ "bgela", BBOCB(16,BOF,CBLT,1,1), BBOYCB_MASK, PPC|POWER, { CR, BDA } },
1340{ "bnl-", BBOCB(16,BOF,CBLT,0,0), BBOYCB_MASK, PPC, { CR, BDM } },
1341{ "bnl+", BBOCB(16,BOF,CBLT,0,0), BBOYCB_MASK, PPC, { CR, BDP } },
1342{ "bnl", BBOCB(16,BOF,CBLT,0,0), BBOYCB_MASK, PPC|POWER, { CR, BD } },
1343{ "bnll-", BBOCB(16,BOF,CBLT,0,1), BBOYCB_MASK, PPC, { CR, BDM } },
1344{ "bnll+", BBOCB(16,BOF,CBLT,0,1), BBOYCB_MASK, PPC, { CR, BDP } },
1345{ "bnll", BBOCB(16,BOF,CBLT,0,1), BBOYCB_MASK, PPC|POWER, { CR, BD } },
1346{ "bnla-", BBOCB(16,BOF,CBLT,1,0), BBOYCB_MASK, PPC, { CR, BDMA } },
1347{ "bnla+", BBOCB(16,BOF,CBLT,1,0), BBOYCB_MASK, PPC, { CR, BDPA } },
1348{ "bnla", BBOCB(16,BOF,CBLT,1,0), BBOYCB_MASK, PPC|POWER, { CR, BDA } },
1349{ "bnlla-", BBOCB(16,BOF,CBLT,1,1), BBOYCB_MASK, PPC, { CR, BDMA } },
1350{ "bnlla+", BBOCB(16,BOF,CBLT,1,1), BBOYCB_MASK, PPC, { CR, BDPA } },
1351{ "bnlla", BBOCB(16,BOF,CBLT,1,1), BBOYCB_MASK, PPC|POWER, { CR, BDA } },
1352{ "ble-", BBOCB(16,BOF,CBGT,0,0), BBOYCB_MASK, PPC, { CR, BDM } },
1353{ "ble+", BBOCB(16,BOF,CBGT,0,0), BBOYCB_MASK, PPC, { CR, BDP } },
1354{ "ble", BBOCB(16,BOF,CBGT,0,0), BBOYCB_MASK, PPC|POWER, { CR, BD } },
1355{ "blel-", BBOCB(16,BOF,CBGT,0,1), BBOYCB_MASK, PPC, { CR, BDM } },
1356{ "blel+", BBOCB(16,BOF,CBGT,0,1), BBOYCB_MASK, PPC, { CR, BDP } },
1357{ "blel", BBOCB(16,BOF,CBGT,0,1), BBOYCB_MASK, PPC|POWER, { CR, BD } },
1358{ "blea-", BBOCB(16,BOF,CBGT,1,0), BBOYCB_MASK, PPC, { CR, BDMA } },
1359{ "blea+", BBOCB(16,BOF,CBGT,1,0), BBOYCB_MASK, PPC, { CR, BDPA } },
1360{ "blea", BBOCB(16,BOF,CBGT,1,0), BBOYCB_MASK, PPC|POWER, { CR, BDA } },
1361{ "blela-", BBOCB(16,BOF,CBGT,1,1), BBOYCB_MASK, PPC, { CR, BDMA } },
1362{ "blela+", BBOCB(16,BOF,CBGT,1,1), BBOYCB_MASK, PPC, { CR, BDPA } },
1363{ "blela", BBOCB(16,BOF,CBGT,1,1), BBOYCB_MASK, PPC|POWER, { CR, BDA } },
1364{ "bng-", BBOCB(16,BOF,CBGT,0,0), BBOYCB_MASK, PPC, { CR, BDM } },
1365{ "bng+", BBOCB(16,BOF,CBGT,0,0), BBOYCB_MASK, PPC, { CR, BDP } },
1366{ "bng", BBOCB(16,BOF,CBGT,0,0), BBOYCB_MASK, PPC|POWER, { CR, BD } },
1367{ "bngl-", BBOCB(16,BOF,CBGT,0,1), BBOYCB_MASK, PPC, { CR, BDM } },
1368{ "bngl+", BBOCB(16,BOF,CBGT,0,1), BBOYCB_MASK, PPC, { CR, BDP } },
1369{ "bngl", BBOCB(16,BOF,CBGT,0,1), BBOYCB_MASK, PPC|POWER, { CR, BD } },
1370{ "bnga-", BBOCB(16,BOF,CBGT,1,0), BBOYCB_MASK, PPC, { CR, BDMA } },
1371{ "bnga+", BBOCB(16,BOF,CBGT,1,0), BBOYCB_MASK, PPC, { CR, BDPA } },
1372{ "bnga", BBOCB(16,BOF,CBGT,1,0), BBOYCB_MASK, PPC|POWER, { CR, BDA } },
1373{ "bngla-", BBOCB(16,BOF,CBGT,1,1), BBOYCB_MASK, PPC, { CR, BDMA } },
1374{ "bngla+", BBOCB(16,BOF,CBGT,1,1), BBOYCB_MASK, PPC, { CR, BDPA } },
1375{ "bngla", BBOCB(16,BOF,CBGT,1,1), BBOYCB_MASK, PPC|POWER, { CR, BDA } },
1376{ "bne-", BBOCB(16,BOF,CBEQ,0,0), BBOYCB_MASK, PPC, { CR, BDM } },
1377{ "bne+", BBOCB(16,BOF,CBEQ,0,0), BBOYCB_MASK, PPC, { CR, BDP } },
1378{ "bne", BBOCB(16,BOF,CBEQ,0,0), BBOYCB_MASK, PPC|POWER, { CR, BD } },
1379{ "bnel-", BBOCB(16,BOF,CBEQ,0,1), BBOYCB_MASK, PPC, { CR, BDM } },
1380{ "bnel+", BBOCB(16,BOF,CBEQ,0,1), BBOYCB_MASK, PPC, { CR, BDP } },
1381{ "bnel", BBOCB(16,BOF,CBEQ,0,1), BBOYCB_MASK, PPC|POWER, { CR, BD } },
1382{ "bnea-", BBOCB(16,BOF,CBEQ,1,0), BBOYCB_MASK, PPC, { CR, BDMA } },
1383{ "bnea+", BBOCB(16,BOF,CBEQ,1,0), BBOYCB_MASK, PPC, { CR, BDPA } },
1384{ "bnea", BBOCB(16,BOF,CBEQ,1,0), BBOYCB_MASK, PPC|POWER, { CR, BDA } },
1385{ "bnela-", BBOCB(16,BOF,CBEQ,1,1), BBOYCB_MASK, PPC, { CR, BDMA } },
1386{ "bnela+", BBOCB(16,BOF,CBEQ,1,1), BBOYCB_MASK, PPC, { CR, BDPA } },
1387{ "bnela", BBOCB(16,BOF,CBEQ,1,1), BBOYCB_MASK, PPC|POWER, { CR, BDA } },
1388{ "bns-", BBOCB(16,BOF,CBSO,0,0), BBOYCB_MASK, PPC, { CR, BDM } },
1389{ "bns+", BBOCB(16,BOF,CBSO,0,0), BBOYCB_MASK, PPC, { CR, BDP } },
1390{ "bns", BBOCB(16,BOF,CBSO,0,0), BBOYCB_MASK, PPC|POWER, { CR, BD } },
1391{ "bnsl-", BBOCB(16,BOF,CBSO,0,1), BBOYCB_MASK, PPC, { CR, BDM } },
1392{ "bnsl+", BBOCB(16,BOF,CBSO,0,1), BBOYCB_MASK, PPC, { CR, BDP } },
1393{ "bnsl", BBOCB(16,BOF,CBSO,0,1), BBOYCB_MASK, PPC|POWER, { CR, BD } },
1394{ "bnsa-", BBOCB(16,BOF,CBSO,1,0), BBOYCB_MASK, PPC, { CR, BDMA } },
1395{ "bnsa+", BBOCB(16,BOF,CBSO,1,0), BBOYCB_MASK, PPC, { CR, BDPA } },
1396{ "bnsa", BBOCB(16,BOF,CBSO,1,0), BBOYCB_MASK, PPC|POWER, { CR, BDA } },
1397{ "bnsla-", BBOCB(16,BOF,CBSO,1,1), BBOYCB_MASK, PPC, { CR, BDMA } },
1398{ "bnsla+", BBOCB(16,BOF,CBSO,1,1), BBOYCB_MASK, PPC, { CR, BDPA } },
1399{ "bnsla", BBOCB(16,BOF,CBSO,1,1), BBOYCB_MASK, PPC|POWER, { CR, BDA } },
1400{ "bnu-", BBOCB(16,BOF,CBSO,0,0), BBOYCB_MASK, PPC, { CR, BDM } },
1401{ "bnu+", BBOCB(16,BOF,CBSO,0,0), BBOYCB_MASK, PPC, { CR, BDP } },
1402{ "bnu", BBOCB(16,BOF,CBSO,0,0), BBOYCB_MASK, PPC, { CR, BD } },
1403{ "bnul-", BBOCB(16,BOF,CBSO,0,1), BBOYCB_MASK, PPC, { CR, BDM } },
1404{ "bnul+", BBOCB(16,BOF,CBSO,0,1), BBOYCB_MASK, PPC, { CR, BDP } },
1405{ "bnul", BBOCB(16,BOF,CBSO,0,1), BBOYCB_MASK, PPC, { CR, BD } },
1406{ "bnua-", BBOCB(16,BOF,CBSO,1,0), BBOYCB_MASK, PPC, { CR, BDMA } },
1407{ "bnua+", BBOCB(16,BOF,CBSO,1,0), BBOYCB_MASK, PPC, { CR, BDPA } },
1408{ "bnua", BBOCB(16,BOF,CBSO,1,0), BBOYCB_MASK, PPC, { CR, BDA } },
1409{ "bnula-", BBOCB(16,BOF,CBSO,1,1), BBOYCB_MASK, PPC, { CR, BDMA } },
1410{ "bnula+", BBOCB(16,BOF,CBSO,1,1), BBOYCB_MASK, PPC, { CR, BDPA } },
1411{ "bnula", BBOCB(16,BOF,CBSO,1,1), BBOYCB_MASK, PPC, { CR, BDA } },
1412{ "bdnzt-", BBO(16,BODNZT,0,0), BBOY_MASK, PPC, { BI, BDM } },
1413{ "bdnzt+", BBO(16,BODNZT,0,0), BBOY_MASK, PPC, { BI, BDP } },
1414{ "bdnzt", BBO(16,BODNZT,0,0), BBOY_MASK, PPC, { BI, BD } },
1415{ "bdnztl-", BBO(16,BODNZT,0,1), BBOY_MASK, PPC, { BI, BDM } },
1416{ "bdnztl+", BBO(16,BODNZT,0,1), BBOY_MASK, PPC, { BI, BDP } },
1417{ "bdnztl", BBO(16,BODNZT,0,1), BBOY_MASK, PPC, { BI, BD } },
1418{ "bdnzta-", BBO(16,BODNZT,1,0), BBOY_MASK, PPC, { BI, BDMA } },
1419{ "bdnzta+", BBO(16,BODNZT,1,0), BBOY_MASK, PPC, { BI, BDPA } },
1420{ "bdnzta", BBO(16,BODNZT,1,0), BBOY_MASK, PPC, { BI, BDA } },
1421{ "bdnztla-",BBO(16,BODNZT,1,1), BBOY_MASK, PPC, { BI, BDMA } },
1422{ "bdnztla+",BBO(16,BODNZT,1,1), BBOY_MASK, PPC, { BI, BDPA } },
1423{ "bdnztla", BBO(16,BODNZT,1,1), BBOY_MASK, PPC, { BI, BDA } },
1424{ "bdnzf-", BBO(16,BODNZF,0,0), BBOY_MASK, PPC, { BI, BDM } },
1425{ "bdnzf+", BBO(16,BODNZF,0,0), BBOY_MASK, PPC, { BI, BDP } },
1426{ "bdnzf", BBO(16,BODNZF,0,0), BBOY_MASK, PPC, { BI, BD } },
1427{ "bdnzfl-", BBO(16,BODNZF,0,1), BBOY_MASK, PPC, { BI, BDM } },
1428{ "bdnzfl+", BBO(16,BODNZF,0,1), BBOY_MASK, PPC, { BI, BDP } },
1429{ "bdnzfl", BBO(16,BODNZF,0,1), BBOY_MASK, PPC, { BI, BD } },
1430{ "bdnzfa-", BBO(16,BODNZF,1,0), BBOY_MASK, PPC, { BI, BDMA } },
1431{ "bdnzfa+", BBO(16,BODNZF,1,0), BBOY_MASK, PPC, { BI, BDPA } },
1432{ "bdnzfa", BBO(16,BODNZF,1,0), BBOY_MASK, PPC, { BI, BDA } },
1433{ "bdnzfla-",BBO(16,BODNZF,1,1), BBOY_MASK, PPC, { BI, BDMA } },
1434{ "bdnzfla+",BBO(16,BODNZF,1,1), BBOY_MASK, PPC, { BI, BDPA } },
1435{ "bdnzfla", BBO(16,BODNZF,1,1), BBOY_MASK, PPC, { BI, BDA } },
1436{ "bt-", BBO(16,BOT,0,0), BBOY_MASK, PPC, { BI, BDM } },
1437{ "bt+", BBO(16,BOT,0,0), BBOY_MASK, PPC, { BI, BDP } },
1438{ "bt", BBO(16,BOT,0,0), BBOY_MASK, PPC, { BI, BD } },
1439{ "bbt", BBO(16,BOT,0,0), BBOY_MASK, POWER, { BI, BD } },
1440{ "btl-", BBO(16,BOT,0,1), BBOY_MASK, PPC, { BI, BDM } },
1441{ "btl+", BBO(16,BOT,0,1), BBOY_MASK, PPC, { BI, BDP } },
1442{ "btl", BBO(16,BOT,0,1), BBOY_MASK, PPC, { BI, BD } },
1443{ "bbtl", BBO(16,BOT,0,1), BBOY_MASK, POWER, { BI, BD } },
1444{ "bta-", BBO(16,BOT,1,0), BBOY_MASK, PPC, { BI, BDMA } },
1445{ "bta+", BBO(16,BOT,1,0), BBOY_MASK, PPC, { BI, BDPA } },
1446{ "bta", BBO(16,BOT,1,0), BBOY_MASK, PPC, { BI, BDA } },
1447{ "bbta", BBO(16,BOT,1,0), BBOY_MASK, POWER, { BI, BDA } },
1448{ "btla-", BBO(16,BOT,1,1), BBOY_MASK, PPC, { BI, BDMA } },
1449{ "btla+", BBO(16,BOT,1,1), BBOY_MASK, PPC, { BI, BDPA } },
1450{ "btla", BBO(16,BOT,1,1), BBOY_MASK, PPC, { BI, BDA } },
1451{ "bbtla", BBO(16,BOT,1,1), BBOY_MASK, POWER, { BI, BDA } },
1452{ "bf-", BBO(16,BOF,0,0), BBOY_MASK, PPC, { BI, BDM } },
1453{ "bf+", BBO(16,BOF,0,0), BBOY_MASK, PPC, { BI, BDP } },
1454{ "bf", BBO(16,BOF,0,0), BBOY_MASK, PPC, { BI, BD } },
1455{ "bbf", BBO(16,BOF,0,0), BBOY_MASK, POWER, { BI, BD } },
1456{ "bfl-", BBO(16,BOF,0,1), BBOY_MASK, PPC, { BI, BDM } },
1457{ "bfl+", BBO(16,BOF,0,1), BBOY_MASK, PPC, { BI, BDP } },
1458{ "bfl", BBO(16,BOF,0,1), BBOY_MASK, PPC, { BI, BD } },
1459{ "bbfl", BBO(16,BOF,0,1), BBOY_MASK, POWER, { BI, BD } },
1460{ "bfa-", BBO(16,BOF,1,0), BBOY_MASK, PPC, { BI, BDMA } },
1461{ "bfa+", BBO(16,BOF,1,0), BBOY_MASK, PPC, { BI, BDPA } },
1462{ "bfa", BBO(16,BOF,1,0), BBOY_MASK, PPC, { BI, BDA } },
1463{ "bbfa", BBO(16,BOF,1,0), BBOY_MASK, POWER, { BI, BDA } },
1464{ "bfla-", BBO(16,BOF,1,1), BBOY_MASK, PPC, { BI, BDMA } },
1465{ "bfla+", BBO(16,BOF,1,1), BBOY_MASK, PPC, { BI, BDPA } },
1466{ "bfla", BBO(16,BOF,1,1), BBOY_MASK, PPC, { BI, BDA } },
1467{ "bbfla", BBO(16,BOF,1,1), BBOY_MASK, POWER, { BI, BDA } },
1468{ "bdzt-", BBO(16,BODZT,0,0), BBOY_MASK, PPC, { BI, BDM } },
1469{ "bdzt+", BBO(16,BODZT,0,0), BBOY_MASK, PPC, { BI, BDP } },
1470{ "bdzt", BBO(16,BODZT,0,0), BBOY_MASK, PPC, { BI, BD } },
1471{ "bdztl-", BBO(16,BODZT,0,1), BBOY_MASK, PPC, { BI, BDM } },
1472{ "bdztl+", BBO(16,BODZT,0,1), BBOY_MASK, PPC, { BI, BDP } },
1473{ "bdztl", BBO(16,BODZT,0,1), BBOY_MASK, PPC, { BI, BD } },
1474{ "bdzta-", BBO(16,BODZT,1,0), BBOY_MASK, PPC, { BI, BDMA } },
1475{ "bdzta+", BBO(16,BODZT,1,0), BBOY_MASK, PPC, { BI, BDPA } },
1476{ "bdzta", BBO(16,BODZT,1,0), BBOY_MASK, PPC, { BI, BDA } },
1477{ "bdztla-", BBO(16,BODZT,1,1), BBOY_MASK, PPC, { BI, BDMA } },
1478{ "bdztla+", BBO(16,BODZT,1,1), BBOY_MASK, PPC, { BI, BDPA } },
1479{ "bdztla", BBO(16,BODZT,1,1), BBOY_MASK, PPC, { BI, BDA } },
1480{ "bdzf-", BBO(16,BODZF,0,0), BBOY_MASK, PPC, { BI, BDM } },
1481{ "bdzf+", BBO(16,BODZF,0,0), BBOY_MASK, PPC, { BI, BDP } },
1482{ "bdzf", BBO(16,BODZF,0,0), BBOY_MASK, PPC, { BI, BD } },
1483{ "bdzfl-", BBO(16,BODZF,0,1), BBOY_MASK, PPC, { BI, BDM } },
1484{ "bdzfl+", BBO(16,BODZF,0,1), BBOY_MASK, PPC, { BI, BDP } },
1485{ "bdzfl", BBO(16,BODZF,0,1), BBOY_MASK, PPC, { BI, BD } },
1486{ "bdzfa-", BBO(16,BODZF,1,0), BBOY_MASK, PPC, { BI, BDMA } },
1487{ "bdzfa+", BBO(16,BODZF,1,0), BBOY_MASK, PPC, { BI, BDPA } },
1488{ "bdzfa", BBO(16,BODZF,1,0), BBOY_MASK, PPC, { BI, BDA } },
1489{ "bdzfla-", BBO(16,BODZF,1,1), BBOY_MASK, PPC, { BI, BDMA } },
1490{ "bdzfla+", BBO(16,BODZF,1,1), BBOY_MASK, PPC, { BI, BDPA } },
1491{ "bdzfla", BBO(16,BODZF,1,1), BBOY_MASK, PPC, { BI, BDA } },
1492{ "bc-", B(16,0,0), B_MASK, PPC, { BOE, BI, BDM } },
1493{ "bc+", B(16,0,0), B_MASK, PPC, { BOE, BI, BDP } },
1494{ "bc", B(16,0,0), B_MASK, PPC|POWER, { BO, BI, BD } },
1495{ "bcl-", B(16,0,1), B_MASK, PPC, { BOE, BI, BDM } },
1496{ "bcl+", B(16,0,1), B_MASK, PPC, { BOE, BI, BDP } },
1497{ "bcl", B(16,0,1), B_MASK, PPC|POWER, { BO, BI, BD } },
1498{ "bca-", B(16,1,0), B_MASK, PPC, { BOE, BI, BDMA } },
1499{ "bca+", B(16,1,0), B_MASK, PPC, { BOE, BI, BDPA } },
1500{ "bca", B(16,1,0), B_MASK, PPC|POWER, { BO, BI, BDA } },
1501{ "bcla-", B(16,1,1), B_MASK, PPC, { BOE, BI, BDMA } },
1502{ "bcla+", B(16,1,1), B_MASK, PPC, { BOE, BI, BDPA } },
1503{ "bcla", B(16,1,1), B_MASK, PPC|POWER, { BO, BI, BDA } },
1504
1505{ "sc", SC(17,1,0), 0xffffffff, PPC, { 0 } },
1506{ "svc", SC(17,0,0), SC_MASK, POWER, { LEV, FL1, FL2 } },
1507{ "svcl", SC(17,0,1), SC_MASK, POWER, { LEV, FL1, FL2 } },
1508{ "svca", SC(17,1,0), SC_MASK, POWER, { SV } },
1509{ "svcla", SC(17,1,1), SC_MASK, POWER, { SV } },
1510
1511{ "b", B(18,0,0), B_MASK, PPC|POWER, { LI } },
1512{ "bl", B(18,0,1), B_MASK, PPC|POWER, { LI } },
1513{ "ba", B(18,1,0), B_MASK, PPC|POWER, { LIA } },
1514{ "bla", B(18,1,1), B_MASK, PPC|POWER, { LIA } },
1515
1516{ "mcrf", XL(19,0), XLBB_MASK|(3<<21)|(3<<16), PPC|POWER, { BF, BFA } },
1517
1518{ "blr", XLO(19,BOU,16,0), XLBOBIBB_MASK, PPC, { 0 } },
1519{ "br", XLO(19,BOU,16,0), XLBOBIBB_MASK, POWER, { 0 } },
1520{ "blrl", XLO(19,BOU,16,1), XLBOBIBB_MASK, PPC, { 0 } },
1521{ "brl", XLO(19,BOU,16,1), XLBOBIBB_MASK, POWER, { 0 } },
1522{ "bdnzlr", XLO(19,BODNZ,16,0), XLBOBIBB_MASK, PPC, { 0 } },
1523{ "bdnzlr-", XLO(19,BODNZ,16,0), XLBOBIBB_MASK, PPC, { 0 } },
1524{ "bdnzlr+", XLO(19,BODNZP,16,0), XLBOBIBB_MASK, PPC, { 0 } },
1525{ "bdnzlrl", XLO(19,BODNZ,16,1), XLBOBIBB_MASK, PPC, { 0 } },
1526{ "bdnzlrl-",XLO(19,BODNZ,16,1), XLBOBIBB_MASK, PPC, { 0 } },
1527{ "bdnzlrl+",XLO(19,BODNZP,16,1), XLBOBIBB_MASK, PPC, { 0 } },
1528{ "bdzlr", XLO(19,BODZ,16,0), XLBOBIBB_MASK, PPC, { 0 } },
1529{ "bdzlr-", XLO(19,BODZ,16,0), XLBOBIBB_MASK, PPC, { 0 } },
1530{ "bdzlr+", XLO(19,BODZP,16,0), XLBOBIBB_MASK, PPC, { 0 } },
1531{ "bdzlrl", XLO(19,BODZ,16,1), XLBOBIBB_MASK, PPC, { 0 } },
1532{ "bdzlrl-", XLO(19,BODZ,16,1), XLBOBIBB_MASK, PPC, { 0 } },
1533{ "bdzlrl+", XLO(19,BODZP,16,1), XLBOBIBB_MASK, PPC, { 0 } },
1534{ "bltlr", XLOCB(19,BOT,CBLT,16,0), XLBOCBBB_MASK, PPC, { CR } },
1535{ "bltlr-", XLOCB(19,BOT,CBLT,16,0), XLBOCBBB_MASK, PPC, { CR } },
1536{ "bltlr+", XLOCB(19,BOTP,CBLT,16,0), XLBOCBBB_MASK, PPC, { CR } },
1537{ "bltr", XLOCB(19,BOT,CBLT,16,0), XLBOCBBB_MASK, POWER, { CR } },
1538{ "bltlrl", XLOCB(19,BOT,CBLT,16,1), XLBOCBBB_MASK, PPC, { CR } },
1539{ "bltlrl-", XLOCB(19,BOT,CBLT,16,1), XLBOCBBB_MASK, PPC, { CR } },
1540{ "bltlrl+", XLOCB(19,BOTP,CBLT,16,1), XLBOCBBB_MASK, PPC, { CR } },
1541{ "bltrl", XLOCB(19,BOT,CBLT,16,1), XLBOCBBB_MASK, POWER, { CR } },
1542{ "bgtlr", XLOCB(19,BOT,CBGT,16,0), XLBOCBBB_MASK, PPC, { CR } },
1543{ "bgtlr-", XLOCB(19,BOT,CBGT,16,0), XLBOCBBB_MASK, PPC, { CR } },
1544{ "bgtlr+", XLOCB(19,BOTP,CBGT,16,0), XLBOCBBB_MASK, PPC, { CR } },
1545{ "bgtr", XLOCB(19,BOT,CBGT,16,0), XLBOCBBB_MASK, POWER, { CR } },
1546{ "bgtlrl", XLOCB(19,BOT,CBGT,16,1), XLBOCBBB_MASK, PPC, { CR } },
1547{ "bgtlrl-", XLOCB(19,BOT,CBGT,16,1), XLBOCBBB_MASK, PPC, { CR } },
1548{ "bgtlrl+", XLOCB(19,BOTP,CBGT,16,1), XLBOCBBB_MASK, PPC, { CR } },
1549{ "bgtrl", XLOCB(19,BOT,CBGT,16,1), XLBOCBBB_MASK, POWER, { CR } },
1550{ "beqlr", XLOCB(19,BOT,CBEQ,16,0), XLBOCBBB_MASK, PPC, { CR } },
1551{ "beqlr-", XLOCB(19,BOT,CBEQ,16,0), XLBOCBBB_MASK, PPC, { CR } },
1552{ "beqlr+", XLOCB(19,BOTP,CBEQ,16,0), XLBOCBBB_MASK, PPC, { CR } },
1553{ "beqr", XLOCB(19,BOT,CBEQ,16,0), XLBOCBBB_MASK, POWER, { CR } },
1554{ "beqlrl", XLOCB(19,BOT,CBEQ,16,1), XLBOCBBB_MASK, PPC, { CR } },
1555{ "beqlrl-", XLOCB(19,BOT,CBEQ,16,1), XLBOCBBB_MASK, PPC, { CR } },
1556{ "beqlrl+", XLOCB(19,BOTP,CBEQ,16,1), XLBOCBBB_MASK, PPC, { CR } },
1557{ "beqrl", XLOCB(19,BOT,CBEQ,16,1), XLBOCBBB_MASK, POWER, { CR } },
1558{ "bsolr", XLOCB(19,BOT,CBSO,16,0), XLBOCBBB_MASK, PPC, { CR } },
1559{ "bsolr-", XLOCB(19,BOT,CBSO,16,0), XLBOCBBB_MASK, PPC, { CR } },
1560{ "bsolr+", XLOCB(19,BOTP,CBSO,16,0), XLBOCBBB_MASK, PPC, { CR } },
1561{ "bsor", XLOCB(19,BOT,CBSO,16,0), XLBOCBBB_MASK, POWER, { CR } },
1562{ "bsolrl", XLOCB(19,BOT,CBSO,16,1), XLBOCBBB_MASK, PPC, { CR } },
1563{ "bsolrl-", XLOCB(19,BOT,CBSO,16,1), XLBOCBBB_MASK, PPC, { CR } },
1564{ "bsolrl+", XLOCB(19,BOTP,CBSO,16,1), XLBOCBBB_MASK, PPC, { CR } },
1565{ "bsorl", XLOCB(19,BOT,CBSO,16,1), XLBOCBBB_MASK, POWER, { CR } },
1566{ "bunlr", XLOCB(19,BOT,CBSO,16,0), XLBOCBBB_MASK, PPC, { CR } },
1567{ "bunlr-", XLOCB(19,BOT,CBSO,16,0), XLBOCBBB_MASK, PPC, { CR } },
1568{ "bunlr+", XLOCB(19,BOTP,CBSO,16,0), XLBOCBBB_MASK, PPC, { CR } },
1569{ "bunlrl", XLOCB(19,BOT,CBSO,16,1), XLBOCBBB_MASK, PPC, { CR } },
1570{ "bunlrl-", XLOCB(19,BOT,CBSO,16,1), XLBOCBBB_MASK, PPC, { CR } },
1571{ "bunlrl+", XLOCB(19,BOTP,CBSO,16,1), XLBOCBBB_MASK, PPC, { CR } },
1572{ "bgelr", XLOCB(19,BOF,CBLT,16,0), XLBOCBBB_MASK, PPC, { CR } },
1573{ "bgelr-", XLOCB(19,BOF,CBLT,16,0), XLBOCBBB_MASK, PPC, { CR } },
1574{ "bgelr+", XLOCB(19,BOFP,CBLT,16,0), XLBOCBBB_MASK, PPC, { CR } },
1575{ "bger", XLOCB(19,BOF,CBLT,16,0), XLBOCBBB_MASK, POWER, { CR } },
1576{ "bgelrl", XLOCB(19,BOF,CBLT,16,1), XLBOCBBB_MASK, PPC, { CR } },
1577{ "bgelrl-", XLOCB(19,BOF,CBLT,16,1), XLBOCBBB_MASK, PPC, { CR } },
1578{ "bgelrl+", XLOCB(19,BOFP,CBLT,16,1), XLBOCBBB_MASK, PPC, { CR } },
1579{ "bgerl", XLOCB(19,BOF,CBLT,16,1), XLBOCBBB_MASK, POWER, { CR } },
1580{ "bnllr", XLOCB(19,BOF,CBLT,16,0), XLBOCBBB_MASK, PPC, { CR } },
1581{ "bnllr-", XLOCB(19,BOF,CBLT,16,0), XLBOCBBB_MASK, PPC, { CR } },
1582{ "bnllr+", XLOCB(19,BOFP,CBLT,16,0), XLBOCBBB_MASK, PPC, { CR } },
1583{ "bnlr", XLOCB(19,BOF,CBLT,16,0), XLBOCBBB_MASK, POWER, { CR } },
1584{ "bnllrl", XLOCB(19,BOF,CBLT,16,1), XLBOCBBB_MASK, PPC, { CR } },
1585{ "bnllrl-", XLOCB(19,BOF,CBLT,16,1), XLBOCBBB_MASK, PPC, { CR } },
1586{ "bnllrl+", XLOCB(19,BOFP,CBLT,16,1), XLBOCBBB_MASK, PPC, { CR } },
1587{ "bnlrl", XLOCB(19,BOF,CBLT,16,1), XLBOCBBB_MASK, POWER, { CR } },
1588{ "blelr", XLOCB(19,BOF,CBGT,16,0), XLBOCBBB_MASK, PPC, { CR } },
1589{ "blelr-", XLOCB(19,BOF,CBGT,16,0), XLBOCBBB_MASK, PPC, { CR } },
1590{ "blelr+", XLOCB(19,BOFP,CBGT,16,0), XLBOCBBB_MASK, PPC, { CR } },
1591{ "bler", XLOCB(19,BOF,CBGT,16,0), XLBOCBBB_MASK, POWER, { CR } },
1592{ "blelrl", XLOCB(19,BOF,CBGT,16,1), XLBOCBBB_MASK, PPC, { CR } },
1593{ "blelrl-", XLOCB(19,BOF,CBGT,16,1), XLBOCBBB_MASK, PPC, { CR } },
1594{ "blelrl+", XLOCB(19,BOFP,CBGT,16,1), XLBOCBBB_MASK, PPC, { CR } },
1595{ "blerl", XLOCB(19,BOF,CBGT,16,1), XLBOCBBB_MASK, POWER, { CR } },
1596{ "bnglr", XLOCB(19,BOF,CBGT,16,0), XLBOCBBB_MASK, PPC, { CR } },
1597{ "bnglr-", XLOCB(19,BOF,CBGT,16,0), XLBOCBBB_MASK, PPC, { CR } },
1598{ "bnglr+", XLOCB(19,BOFP,CBGT,16,0), XLBOCBBB_MASK, PPC, { CR } },
1599{ "bngr", XLOCB(19,BOF,CBGT,16,0), XLBOCBBB_MASK, POWER, { CR } },
1600{ "bnglrl", XLOCB(19,BOF,CBGT,16,1), XLBOCBBB_MASK, PPC, { CR } },
1601{ "bnglrl-", XLOCB(19,BOF,CBGT,16,1), XLBOCBBB_MASK, PPC, { CR } },
1602{ "bnglrl+", XLOCB(19,BOFP,CBGT,16,1), XLBOCBBB_MASK, PPC, { CR } },
1603{ "bngrl", XLOCB(19,BOF,CBGT,16,1), XLBOCBBB_MASK, POWER, { CR } },
1604{ "bnelr", XLOCB(19,BOF,CBEQ,16,0), XLBOCBBB_MASK, PPC, { CR } },
1605{ "bnelr-", XLOCB(19,BOF,CBEQ,16,0), XLBOCBBB_MASK, PPC, { CR } },
1606{ "bnelr+", XLOCB(19,BOFP,CBEQ,16,0), XLBOCBBB_MASK, PPC, { CR } },
1607{ "bner", XLOCB(19,BOF,CBEQ,16,0), XLBOCBBB_MASK, POWER, { CR } },
1608{ "bnelrl", XLOCB(19,BOF,CBEQ,16,1), XLBOCBBB_MASK, PPC, { CR } },
1609{ "bnelrl-", XLOCB(19,BOF,CBEQ,16,1), XLBOCBBB_MASK, PPC, { CR } },
1610{ "bnelrl+", XLOCB(19,BOFP,CBEQ,16,1), XLBOCBBB_MASK, PPC, { CR } },
1611{ "bnerl", XLOCB(19,BOF,CBEQ,16,1), XLBOCBBB_MASK, POWER, { CR } },
1612{ "bnslr", XLOCB(19,BOF,CBSO,16,0), XLBOCBBB_MASK, PPC, { CR } },
1613{ "bnslr-", XLOCB(19,BOF,CBSO,16,0), XLBOCBBB_MASK, PPC, { CR } },
1614{ "bnslr+", XLOCB(19,BOFP,CBSO,16,0), XLBOCBBB_MASK, PPC, { CR } },
1615{ "bnsr", XLOCB(19,BOF,CBSO,16,0), XLBOCBBB_MASK, POWER, { CR } },
1616{ "bnslrl", XLOCB(19,BOF,CBSO,16,1), XLBOCBBB_MASK, PPC, { CR } },
1617{ "bnslrl-", XLOCB(19,BOF,CBSO,16,1), XLBOCBBB_MASK, PPC, { CR } },
1618{ "bnslrl+", XLOCB(19,BOFP,CBSO,16,1), XLBOCBBB_MASK, PPC, { CR } },
1619{ "bnsrl", XLOCB(19,BOF,CBSO,16,1), XLBOCBBB_MASK, POWER, { CR } },
1620{ "bnulr", XLOCB(19,BOF,CBSO,16,0), XLBOCBBB_MASK, PPC, { CR } },
1621{ "bnulr-", XLOCB(19,BOF,CBSO,16,0), XLBOCBBB_MASK, PPC, { CR } },
1622{ "bnulr+", XLOCB(19,BOFP,CBSO,16,0), XLBOCBBB_MASK, PPC, { CR } },
1623{ "bnulrl", XLOCB(19,BOF,CBSO,16,1), XLBOCBBB_MASK, PPC, { CR } },
1624{ "bnulrl-", XLOCB(19,BOF,CBSO,16,1), XLBOCBBB_MASK, PPC, { CR } },
1625{ "bnulrl+", XLOCB(19,BOFP,CBSO,16,1), XLBOCBBB_MASK, PPC, { CR } },
1626{ "btlr", XLO(19,BOT,16,0), XLBOBB_MASK, PPC, { BI } },
1627{ "btlr-", XLO(19,BOT,16,0), XLBOBB_MASK, PPC, { BI } },
1628{ "btlr+", XLO(19,BOTP,16,0), XLBOBB_MASK, PPC, { BI } },
1629{ "bbtr", XLO(19,BOT,16,0), XLBOBB_MASK, POWER, { BI } },
1630{ "btlrl", XLO(19,BOT,16,1), XLBOBB_MASK, PPC, { BI } },
1631{ "btlrl-", XLO(19,BOT,16,1), XLBOBB_MASK, PPC, { BI } },
1632{ "btlrl+", XLO(19,BOTP,16,1), XLBOBB_MASK, PPC, { BI } },
1633{ "bbtrl", XLO(19,BOT,16,1), XLBOBB_MASK, POWER, { BI } },
1634{ "bflr", XLO(19,BOF,16,0), XLBOBB_MASK, PPC, { BI } },
1635{ "bflr-", XLO(19,BOF,16,0), XLBOBB_MASK, PPC, { BI } },
1636{ "bflr+", XLO(19,BOFP,16,0), XLBOBB_MASK, PPC, { BI } },
1637{ "bbfr", XLO(19,BOF,16,0), XLBOBB_MASK, POWER, { BI } },
1638{ "bflrl", XLO(19,BOF,16,1), XLBOBB_MASK, PPC, { BI } },
1639{ "bflrl-", XLO(19,BOF,16,1), XLBOBB_MASK, PPC, { BI } },
1640{ "bflrl+", XLO(19,BOFP,16,1), XLBOBB_MASK, PPC, { BI } },
1641{ "bbfrl", XLO(19,BOF,16,1), XLBOBB_MASK, POWER, { BI } },
1642{ "bdnztlr", XLO(19,BODNZT,16,0), XLBOBB_MASK, PPC, { BI } },
1643{ "bdnztlr-",XLO(19,BODNZT,16,0), XLBOBB_MASK, PPC, { BI } },
1644{ "bdnztlr+",XLO(19,BODNZTP,16,0), XLBOBB_MASK, PPC, { BI } },
1645{ "bdnztlrl",XLO(19,BODNZT,16,1), XLBOBB_MASK, PPC, { BI } },
1646{ "bdnztlrl-",XLO(19,BODNZT,16,1), XLBOBB_MASK, PPC, { BI } },
1647{ "bdnztlrl+",XLO(19,BODNZTP,16,1), XLBOBB_MASK, PPC, { BI } },
1648{ "bdnzflr", XLO(19,BODNZF,16,0), XLBOBB_MASK, PPC, { BI } },
1649{ "bdnzflr-",XLO(19,BODNZF,16,0), XLBOBB_MASK, PPC, { BI } },
1650{ "bdnzflr+",XLO(19,BODNZFP,16,0), XLBOBB_MASK, PPC, { BI } },
1651{ "bdnzflrl",XLO(19,BODNZF,16,1), XLBOBB_MASK, PPC, { BI } },
1652{ "bdnzflrl-",XLO(19,BODNZF,16,1), XLBOBB_MASK, PPC, { BI } },
1653{ "bdnzflrl+",XLO(19,BODNZFP,16,1), XLBOBB_MASK, PPC, { BI } },
1654{ "bdztlr", XLO(19,BODZT,16,0), XLBOBB_MASK, PPC, { BI } },
1655{ "bdztlr-", XLO(19,BODZT,16,0), XLBOBB_MASK, PPC, { BI } },
1656{ "bdztlr+", XLO(19,BODZTP,16,0), XLBOBB_MASK, PPC, { BI } },
1657{ "bdztlrl", XLO(19,BODZT,16,1), XLBOBB_MASK, PPC, { BI } },
1658{ "bdztlrl-",XLO(19,BODZT,16,1), XLBOBB_MASK, PPC, { BI } },
1659{ "bdztlrl+",XLO(19,BODZTP,16,1), XLBOBB_MASK, PPC, { BI } },
1660{ "bdzflr", XLO(19,BODZF,16,0), XLBOBB_MASK, PPC, { BI } },
1661{ "bdzflr-", XLO(19,BODZF,16,0), XLBOBB_MASK, PPC, { BI } },
1662{ "bdzflr+", XLO(19,BODZFP,16,0), XLBOBB_MASK, PPC, { BI } },
1663{ "bdzflrl", XLO(19,BODZF,16,1), XLBOBB_MASK, PPC, { BI } },
1664{ "bdzflrl-",XLO(19,BODZF,16,1), XLBOBB_MASK, PPC, { BI } },
1665{ "bdzflrl+",XLO(19,BODZFP,16,1), XLBOBB_MASK, PPC, { BI } },
1666{ "bclr", XLLK(19,16,0), XLYBB_MASK, PPC, { BO, BI } },
1667{ "bclrl", XLLK(19,16,1), XLYBB_MASK, PPC, { BO, BI } },
1668{ "bclr+", XLYLK(19,16,1,0), XLYBB_MASK, PPC, { BOE, BI } },
1669{ "bclrl+", XLYLK(19,16,1,1), XLYBB_MASK, PPC, { BOE, BI } },
1670{ "bclr-", XLYLK(19,16,0,0), XLYBB_MASK, PPC, { BOE, BI } },
1671{ "bclrl-", XLYLK(19,16,0,1), XLYBB_MASK, PPC, { BOE, BI } },
1672{ "bcr", XLLK(19,16,0), XLBB_MASK, POWER, { BO, BI } },
1673{ "bcrl", XLLK(19,16,1), XLBB_MASK, POWER, { BO, BI } },
1674
1675{ "crnot", XL(19,33), XL_MASK, PPC, { BT, BA, BBA } },
1676{ "crnor", XL(19,33), XL_MASK, PPC|POWER, { BT, BA, BB } },
1677
1678{ "rfi", XL(19,50), 0xffffffff, PPC|POWER, { 0 } },
1679{ "rfci", XL(19,51), 0xffffffff, PPC, { 0 } },
1680
1681{ "rfsvc", XL(19,82), 0xffffffff, POWER, { 0 } },
1682
1683{ "crandc", XL(19,129), XL_MASK, PPC|POWER, { BT, BA, BB } },
1684
1685{ "isync", XL(19,150), 0xffffffff, PPC, { 0 } },
1686{ "ics", XL(19,150), 0xffffffff, POWER, { 0 } },
1687
1688{ "crclr", XL(19,193), XL_MASK, PPC, { BT, BAT, BBA } },
1689{ "crxor", XL(19,193), XL_MASK, PPC|POWER, { BT, BA, BB } },
1690
1691{ "crnand", XL(19,225), XL_MASK, PPC|POWER, { BT, BA, BB } },
1692
1693{ "crand", XL(19,257), XL_MASK, PPC|POWER, { BT, BA, BB } },
1694
1695{ "crset", XL(19,289), XL_MASK, PPC, { BT, BAT, BBA } },
1696{ "creqv", XL(19,289), XL_MASK, PPC|POWER, { BT, BA, BB } },
1697
1698{ "crorc", XL(19,417), XL_MASK, PPC|POWER, { BT, BA, BB } },
1699
1700{ "crmove", XL(19,449), XL_MASK, PPC, { BT, BA, BBA } },
1701{ "cror", XL(19,449), XL_MASK, PPC|POWER, { BT, BA, BB } },
1702
1703{ "bctr", XLO(19,BOU,528,0), XLBOBIBB_MASK, PPC|POWER, { 0 } },
1704{ "bctrl", XLO(19,BOU,528,1), XLBOBIBB_MASK, PPC|POWER, { 0 } },
1705{ "bltctr", XLOCB(19,BOT,CBLT,528,0), XLBOCBBB_MASK, PPC, { CR } },
1706{ "bltctr-", XLOCB(19,BOT,CBLT,528,0), XLBOCBBB_MASK, PPC, { CR } },
1707{ "bltctr+", XLOCB(19,BOTP,CBLT,528,0), XLBOCBBB_MASK, PPC, { CR } },
1708{ "bltctrl", XLOCB(19,BOT,CBLT,528,1), XLBOCBBB_MASK, PPC, { CR } },
1709{ "bltctrl-",XLOCB(19,BOT,CBLT,528,1), XLBOCBBB_MASK, PPC, { CR } },
1710{ "bltctrl+",XLOCB(19,BOTP,CBLT,528,1), XLBOCBBB_MASK, PPC, { CR } },
1711{ "bgtctr", XLOCB(19,BOT,CBGT,528,0), XLBOCBBB_MASK, PPC, { CR } },
1712{ "bgtctr-", XLOCB(19,BOT,CBGT,528,0), XLBOCBBB_MASK, PPC, { CR } },
1713{ "bgtctr+", XLOCB(19,BOTP,CBGT,528,0), XLBOCBBB_MASK, PPC, { CR } },
1714{ "bgtctrl", XLOCB(19,BOT,CBGT,528,1), XLBOCBBB_MASK, PPC, { CR } },
1715{ "bgtctrl-",XLOCB(19,BOT,CBGT,528,1), XLBOCBBB_MASK, PPC, { CR } },
1716{ "bgtctrl+",XLOCB(19,BOTP,CBGT,528,1), XLBOCBBB_MASK, PPC, { CR } },
1717{ "beqctr", XLOCB(19,BOT,CBEQ,528,0), XLBOCBBB_MASK, PPC, { CR } },
1718{ "beqctr-", XLOCB(19,BOT,CBEQ,528,0), XLBOCBBB_MASK, PPC, { CR } },
1719{ "beqctr+", XLOCB(19,BOTP,CBEQ,528,0), XLBOCBBB_MASK, PPC, { CR } },
1720{ "beqctrl", XLOCB(19,BOT,CBEQ,528,1), XLBOCBBB_MASK, PPC, { CR } },
1721{ "beqctrl-",XLOCB(19,BOT,CBEQ,528,1), XLBOCBBB_MASK, PPC, { CR } },
1722{ "beqctrl+",XLOCB(19,BOTP,CBEQ,528,1), XLBOCBBB_MASK, PPC, { CR } },
1723{ "bsoctr", XLOCB(19,BOT,CBSO,528,0), XLBOCBBB_MASK, PPC, { CR } },
1724{ "bsoctr-", XLOCB(19,BOT,CBSO,528,0), XLBOCBBB_MASK, PPC, { CR } },
1725{ "bsoctr+", XLOCB(19,BOTP,CBSO,528,0), XLBOCBBB_MASK, PPC, { CR } },
1726{ "bsoctrl", XLOCB(19,BOT,CBSO,528,1), XLBOCBBB_MASK, PPC, { CR } },
1727{ "bsoctrl-",XLOCB(19,BOT,CBSO,528,1), XLBOCBBB_MASK, PPC, { CR } },
1728{ "bsoctrl+",XLOCB(19,BOTP,CBSO,528,1), XLBOCBBB_MASK, PPC, { CR } },
1729{ "bunctr", XLOCB(19,BOT,CBSO,528,0), XLBOCBBB_MASK, PPC, { CR } },
1730{ "bunctr-", XLOCB(19,BOT,CBSO,528,0), XLBOCBBB_MASK, PPC, { CR } },
1731{ "bunctr+", XLOCB(19,BOTP,CBSO,528,0), XLBOCBBB_MASK, PPC, { CR } },
1732{ "bunctrl", XLOCB(19,BOT,CBSO,528,1), XLBOCBBB_MASK, PPC, { CR } },
1733{ "bunctrl-",XLOCB(19,BOT,CBSO,528,1), XLBOCBBB_MASK, PPC, { CR } },
1734{ "bunctrl+",XLOCB(19,BOTP,CBSO,528,1), XLBOCBBB_MASK, PPC, { CR } },
1735{ "bgectr", XLOCB(19,BOF,CBLT,528,0), XLBOCBBB_MASK, PPC, { CR } },
1736{ "bgectr-", XLOCB(19,BOF,CBLT,528,0), XLBOCBBB_MASK, PPC, { CR } },
1737{ "bgectr+", XLOCB(19,BOFP,CBLT,528,0), XLBOCBBB_MASK, PPC, { CR } },
1738{ "bgectrl", XLOCB(19,BOF,CBLT,528,1), XLBOCBBB_MASK, PPC, { CR } },
1739{ "bgectrl-",XLOCB(19,BOF,CBLT,528,1), XLBOCBBB_MASK, PPC, { CR } },
1740{ "bgectrl+",XLOCB(19,BOFP,CBLT,528,1), XLBOCBBB_MASK, PPC, { CR } },
1741{ "bnlctr", XLOCB(19,BOF,CBLT,528,0), XLBOCBBB_MASK, PPC, { CR } },
1742{ "bnlctr-", XLOCB(19,BOF,CBLT,528,0), XLBOCBBB_MASK, PPC, { CR } },
1743{ "bnlctr+", XLOCB(19,BOFP,CBLT,528,0), XLBOCBBB_MASK, PPC, { CR } },
1744{ "bnlctrl", XLOCB(19,BOF,CBLT,528,1), XLBOCBBB_MASK, PPC, { CR } },
1745{ "bnlctrl-",XLOCB(19,BOF,CBLT,528,1), XLBOCBBB_MASK, PPC, { CR } },
1746{ "bnlctrl+",XLOCB(19,BOFP,CBLT,528,1), XLBOCBBB_MASK, PPC, { CR } },
1747{ "blectr", XLOCB(19,BOF,CBGT,528,0), XLBOCBBB_MASK, PPC, { CR } },
1748{ "blectr-", XLOCB(19,BOF,CBGT,528,0), XLBOCBBB_MASK, PPC, { CR } },
1749{ "blectr+", XLOCB(19,BOFP,CBGT,528,0), XLBOCBBB_MASK, PPC, { CR } },
1750{ "blectrl", XLOCB(19,BOF,CBGT,528,1), XLBOCBBB_MASK, PPC, { CR } },
1751{ "blectrl-",XLOCB(19,BOF,CBGT,528,1), XLBOCBBB_MASK, PPC, { CR } },
1752{ "blectrl+",XLOCB(19,BOFP,CBGT,528,1), XLBOCBBB_MASK, PPC, { CR } },
1753{ "bngctr", XLOCB(19,BOF,CBGT,528,0), XLBOCBBB_MASK, PPC, { CR } },
1754{ "bngctr-", XLOCB(19,BOF,CBGT,528,0), XLBOCBBB_MASK, PPC, { CR } },
1755{ "bngctr+", XLOCB(19,BOFP,CBGT,528,0), XLBOCBBB_MASK, PPC, { CR } },
1756{ "bngctrl", XLOCB(19,BOF,CBGT,528,1), XLBOCBBB_MASK, PPC, { CR } },
1757{ "bngctrl-",XLOCB(19,BOF,CBGT,528,1), XLBOCBBB_MASK, PPC, { CR } },
1758{ "bngctrl+",XLOCB(19,BOFP,CBGT,528,1), XLBOCBBB_MASK, PPC, { CR } },
1759{ "bnectr", XLOCB(19,BOF,CBEQ,528,0), XLBOCBBB_MASK, PPC, { CR } },
1760{ "bnectr-", XLOCB(19,BOF,CBEQ,528,0), XLBOCBBB_MASK, PPC, { CR } },
1761{ "bnectr+", XLOCB(19,BOFP,CBEQ,528,0), XLBOCBBB_MASK, PPC, { CR } },
1762{ "bnectrl", XLOCB(19,BOF,CBEQ,528,1), XLBOCBBB_MASK, PPC, { CR } },
1763{ "bnectrl-",XLOCB(19,BOF,CBEQ,528,1), XLBOCBBB_MASK, PPC, { CR } },
1764{ "bnectrl+",XLOCB(19,BOFP,CBEQ,528,1), XLBOCBBB_MASK, PPC, { CR } },
1765{ "bnsctr", XLOCB(19,BOF,CBSO,528,0), XLBOCBBB_MASK, PPC, { CR } },
1766{ "bnsctr-", XLOCB(19,BOF,CBSO,528,0), XLBOCBBB_MASK, PPC, { CR } },
1767{ "bnsctr+", XLOCB(19,BOFP,CBSO,528,0), XLBOCBBB_MASK, PPC, { CR } },
1768{ "bnsctrl", XLOCB(19,BOF,CBSO,528,1), XLBOCBBB_MASK, PPC, { CR } },
1769{ "bnsctrl-",XLOCB(19,BOF,CBSO,528,1), XLBOCBBB_MASK, PPC, { CR } },
1770{ "bnsctrl+",XLOCB(19,BOFP,CBSO,528,1), XLBOCBBB_MASK, PPC, { CR } },
1771{ "bnuctr", XLOCB(19,BOF,CBSO,528,0), XLBOCBBB_MASK, PPC, { CR } },
1772{ "bnuctr-", XLOCB(19,BOF,CBSO,528,0), XLBOCBBB_MASK, PPC, { CR } },
1773{ "bnuctr+", XLOCB(19,BOFP,CBSO,528,0), XLBOCBBB_MASK, PPC, { CR } },
1774{ "bnuctrl", XLOCB(19,BOF,CBSO,528,1), XLBOCBBB_MASK, PPC, { CR } },
1775{ "bnuctrl-",XLOCB(19,BOF,CBSO,528,1), XLBOCBBB_MASK, PPC, { CR } },
1776{ "bnuctrl+",XLOCB(19,BOFP,CBSO,528,1), XLBOCBBB_MASK, PPC, { CR } },
1777{ "btctr", XLO(19,BOT,528,0), XLBOBB_MASK, PPC, { BI } },
1778{ "btctr-", XLO(19,BOT,528,0), XLBOBB_MASK, PPC, { BI } },
1779{ "btctr+", XLO(19,BOTP,528,0), XLBOBB_MASK, PPC, { BI } },
1780{ "btctrl", XLO(19,BOT,528,1), XLBOBB_MASK, PPC, { BI } },
1781{ "btctrl-", XLO(19,BOT,528,1), XLBOBB_MASK, PPC, { BI } },
1782{ "btctrl+", XLO(19,BOTP,528,1), XLBOBB_MASK, PPC, { BI } },
1783{ "bfctr", XLO(19,BOF,528,0), XLBOBB_MASK, PPC, { BI } },
1784{ "bfctr-", XLO(19,BOF,528,0), XLBOBB_MASK, PPC, { BI } },
1785{ "bfctr+", XLO(19,BOFP,528,0), XLBOBB_MASK, PPC, { BI } },
1786{ "bfctrl", XLO(19,BOF,528,1), XLBOBB_MASK, PPC, { BI } },
1787{ "bfctrl-", XLO(19,BOF,528,1), XLBOBB_MASK, PPC, { BI } },
1788{ "bfctrl+", XLO(19,BOFP,528,1), XLBOBB_MASK, PPC, { BI } },
1789{ "bcctr", XLLK(19,528,0), XLYBB_MASK, PPC, { BO, BI } },
1790{ "bcctr-", XLYLK(19,528,0,0), XLYBB_MASK, PPC, { BOE, BI } },
1791{ "bcctr+", XLYLK(19,528,1,0), XLYBB_MASK, PPC, { BOE, BI } },
1792{ "bcctrl", XLLK(19,528,1), XLYBB_MASK, PPC, { BO, BI } },
1793{ "bcctrl-", XLYLK(19,528,0,1), XLYBB_MASK, PPC, { BOE, BI } },
1794{ "bcctrl+", XLYLK(19,528,1,1), XLYBB_MASK, PPC, { BOE, BI } },
1795{ "bcc", XLLK(19,528,0), XLBB_MASK, POWER, { BO, BI } },
1796{ "bccl", XLLK(19,528,1), XLBB_MASK, POWER, { BO, BI } },
1797
1798{ "rlwimi", M(20,0), M_MASK, PPC, { RA,RS,SH,MBE,ME } },
1799{ "rlimi", M(20,0), M_MASK, POWER, { RA,RS,SH,MBE,ME } },
1800
1801{ "rlwimi.", M(20,1), M_MASK, PPC, { RA,RS,SH,MBE,ME } },
1802{ "rlimi.", M(20,1), M_MASK, POWER, { RA,RS,SH,MBE,ME } },
1803
1804{ "rotlwi", MME(21,31,0), MMBME_MASK, PPC, { RA, RS, SH } },
1805{ "clrlwi", MME(21,31,0), MSHME_MASK, PPC, { RA, RS, MB } },
1806{ "rlwinm", M(21,0), M_MASK, PPC, { RA,RS,SH,MBE,ME } },
1807{ "rlinm", M(21,0), M_MASK, POWER, { RA,RS,SH,MBE,ME } },
1808{ "rotlwi.", MME(21,31,1), MMBME_MASK, PPC, { RA,RS,SH } },
1809{ "clrlwi.", MME(21,31,1), MSHME_MASK, PPC, { RA, RS, MB } },
1810{ "rlwinm.", M(21,1), M_MASK, PPC, { RA,RS,SH,MBE,ME } },
1811{ "rlinm.", M(21,1), M_MASK, POWER, { RA,RS,SH,MBE,ME } },
1812
1813{ "rlmi", M(22,0), M_MASK, POWER|M601, { RA,RS,RB,MBE,ME } },
1814{ "rlmi.", M(22,1), M_MASK, POWER|M601, { RA,RS,RB,MBE,ME } },
1815
1816{ "rotlw", MME(23,31,0), MMBME_MASK, PPC, { RA, RS, RB } },
1817{ "rlwnm", M(23,0), M_MASK, PPC, { RA,RS,RB,MBE,ME } },
1818{ "rlnm", M(23,0), M_MASK, POWER, { RA,RS,RB,MBE,ME } },
1819{ "rotlw.", MME(23,31,1), MMBME_MASK, PPC, { RA, RS, RB } },
1820{ "rlwnm.", M(23,1), M_MASK, PPC, { RA,RS,RB,MBE,ME } },
1821{ "rlnm.", M(23,1), M_MASK, POWER, { RA,RS,RB,MBE,ME } },
1822
1823{ "nop", OP(24), 0xffffffff, PPC, { 0 } },
1824{ "ori", OP(24), OP_MASK, PPC, { RA, RS, UI } },
1825{ "oril", OP(24), OP_MASK, POWER, { RA, RS, UI } },
1826
1827{ "oris", OP(25), OP_MASK, PPC, { RA, RS, UI } },
1828{ "oriu", OP(25), OP_MASK, POWER, { RA, RS, UI } },
1829
1830{ "xori", OP(26), OP_MASK, PPC, { RA, RS, UI } },
1831{ "xoril", OP(26), OP_MASK, POWER, { RA, RS, UI } },
1832
1833{ "xoris", OP(27), OP_MASK, PPC, { RA, RS, UI } },
1834{ "xoriu", OP(27), OP_MASK, POWER, { RA, RS, UI } },
1835
1836{ "andi.", OP(28), OP_MASK, PPC, { RA, RS, UI } },
1837{ "andil.", OP(28), OP_MASK, POWER, { RA, RS, UI } },
1838
1839{ "andis.", OP(29), OP_MASK, PPC, { RA, RS, UI } },
1840{ "andiu.", OP(29), OP_MASK, POWER, { RA, RS, UI } },
1841
1842{ "rotldi", MD(30,0,0), MDMB_MASK, PPC|B64, { RA, RS, SH6 } },
1843{ "clrldi", MD(30,0,0), MDSH_MASK, PPC|B64, { RA, RS, MB6 } },
1844{ "rldicl", MD(30,0,0), MD_MASK, PPC|B64, { RA, RS, SH6, MB6 } },
1845{ "rotldi.", MD(30,0,1), MDMB_MASK, PPC|B64, { RA, RS, SH6 } },
1846{ "clrldi.", MD(30,0,1), MDSH_MASK, PPC|B64, { RA, RS, MB6 } },
1847{ "rldicl.", MD(30,0,1), MD_MASK, PPC|B64, { RA, RS, SH6, MB6 } },
1848
1849{ "rldicr", MD(30,1,0), MD_MASK, PPC|B64, { RA, RS, SH6, ME6 } },
1850{ "rldicr.", MD(30,1,1), MD_MASK, PPC|B64, { RA, RS, SH6, ME6 } },
1851
1852{ "rldic", MD(30,2,0), MD_MASK, PPC|B64, { RA, RS, SH6, MB6 } },
1853{ "rldic.", MD(30,2,1), MD_MASK, PPC|B64, { RA, RS, SH6, MB6 } },
1854
1855{ "rldimi", MD(30,3,0), MD_MASK, PPC|B64, { RA, RS, SH6, MB6 } },
1856{ "rldimi.", MD(30,3,1), MD_MASK, PPC|B64, { RA, RS, SH6, MB6 } },
1857
1858{ "rotld", MDS(30,8,0), MDSMB_MASK, PPC|B64, { RA, RS, RB } },
1859{ "rldcl", MDS(30,8,0), MDS_MASK, PPC|B64, { RA, RS, RB, MB6 } },
1860{ "rotld.", MDS(30,8,1), MDSMB_MASK, PPC|B64, { RA, RS, RB } },
1861{ "rldcl.", MDS(30,8,1), MDS_MASK, PPC|B64, { RA, RS, RB, MB6 } },
1862
1863{ "rldcr", MDS(30,9,0), MDS_MASK, PPC|B64, { RA, RS, RB, ME6 } },
1864{ "rldcr.", MDS(30,9,1), MDS_MASK, PPC|B64, { RA, RS, RB, ME6 } },
1865
1866{ "cmpw", XCMPL(31,0,0), XCMPL_MASK, PPC, { OBF, RA, RB } },
1867{ "cmpd", XCMPL(31,0,1), XCMPL_MASK, PPC|B64, { OBF, RA, RB } },
1868{ "cmp", X(31,0), XCMP_MASK, PPC, { BF, L, RA, RB } },
1869{ "cmp", X(31,0), XCMPL_MASK, POWER, { BF, RA, RB } },
1870
1871{ "twlgt", XTO(31,4,TOLGT), XTO_MASK, PPC, { RA, RB } },
1872{ "tlgt", XTO(31,4,TOLGT), XTO_MASK, POWER, { RA, RB } },
1873{ "twllt", XTO(31,4,TOLLT), XTO_MASK, PPC, { RA, RB } },
1874{ "tllt", XTO(31,4,TOLLT), XTO_MASK, POWER, { RA, RB } },
1875{ "tweq", XTO(31,4,TOEQ), XTO_MASK, PPC, { RA, RB } },
1876{ "teq", XTO(31,4,TOEQ), XTO_MASK, POWER, { RA, RB } },
1877{ "twlge", XTO(31,4,TOLGE), XTO_MASK, PPC, { RA, RB } },
1878{ "tlge", XTO(31,4,TOLGE), XTO_MASK, POWER, { RA, RB } },
1879{ "twlnl", XTO(31,4,TOLNL), XTO_MASK, PPC, { RA, RB } },
1880{ "tlnl", XTO(31,4,TOLNL), XTO_MASK, POWER, { RA, RB } },
1881{ "twlle", XTO(31,4,TOLLE), XTO_MASK, PPC, { RA, RB } },
1882{ "tlle", XTO(31,4,TOLLE), XTO_MASK, POWER, { RA, RB } },
1883{ "twlng", XTO(31,4,TOLNG), XTO_MASK, PPC, { RA, RB } },
1884{ "tlng", XTO(31,4,TOLNG), XTO_MASK, POWER, { RA, RB } },
1885{ "twgt", XTO(31,4,TOGT), XTO_MASK, PPC, { RA, RB } },
1886{ "tgt", XTO(31,4,TOGT), XTO_MASK, POWER, { RA, RB } },
1887{ "twge", XTO(31,4,TOGE), XTO_MASK, PPC, { RA, RB } },
1888{ "tge", XTO(31,4,TOGE), XTO_MASK, POWER, { RA, RB } },
1889{ "twnl", XTO(31,4,TONL), XTO_MASK, PPC, { RA, RB } },
1890{ "tnl", XTO(31,4,TONL), XTO_MASK, POWER, { RA, RB } },
1891{ "twlt", XTO(31,4,TOLT), XTO_MASK, PPC, { RA, RB } },
1892{ "tlt", XTO(31,4,TOLT), XTO_MASK, POWER, { RA, RB } },
1893{ "twle", XTO(31,4,TOLE), XTO_MASK, PPC, { RA, RB } },
1894{ "tle", XTO(31,4,TOLE), XTO_MASK, POWER, { RA, RB } },
1895{ "twng", XTO(31,4,TONG), XTO_MASK, PPC, { RA, RB } },
1896{ "tng", XTO(31,4,TONG), XTO_MASK, POWER, { RA, RB } },
1897{ "twne", XTO(31,4,TONE), XTO_MASK, PPC, { RA, RB } },
1898{ "tne", XTO(31,4,TONE), XTO_MASK, POWER, { RA, RB } },
1899{ "trap", XTO(31,4,TOU), 0xffffffff, PPC, { 0 } },
1900{ "tw", X(31,4), X_MASK, PPC, { TO, RA, RB } },
1901{ "t", X(31,4), X_MASK, POWER, { TO, RA, RB } },
1902
1903{ "subfc", XO(31,8,0,0), XO_MASK, PPC, { RT, RA, RB } },
1904{ "sf", XO(31,8,0,0), XO_MASK, POWER, { RT, RA, RB } },
1905{ "subc", XO(31,8,0,0), XO_MASK, PPC, { RT, RB, RA } },
1906{ "subfc.", XO(31,8,0,1), XO_MASK, PPC, { RT, RA, RB } },
1907{ "sf.", XO(31,8,0,1), XO_MASK, POWER, { RT, RA, RB } },
1908{ "subc.", XO(31,8,0,1), XO_MASK, PPC, { RT, RB, RA } },
1909{ "subfco", XO(31,8,1,0), XO_MASK, PPC, { RT, RA, RB } },
1910{ "sfo", XO(31,8,1,0), XO_MASK, POWER, { RT, RA, RB } },
1911{ "subco", XO(31,8,1,0), XO_MASK, PPC, { RT, RB, RA } },
1912{ "subfco.", XO(31,8,1,1), XO_MASK, PPC, { RT, RA, RB } },
1913{ "sfo.", XO(31,8,1,1), XO_MASK, POWER, { RT, RA, RB } },
1914{ "subco.", XO(31,8,1,1), XO_MASK, PPC, { RT, RB, RA } },
1915
1916{ "mulhdu", XO(31,9,0,0), XO_MASK, PPC|B64, { RT, RA, RB } },
1917{ "mulhdu.", XO(31,9,0,1), XO_MASK, PPC|B64, { RT, RA, RB } },
1918
1919{ "addc", XO(31,10,0,0), XO_MASK, PPC, { RT, RA, RB } },
1920{ "a", XO(31,10,0,0), XO_MASK, POWER, { RT, RA, RB } },
1921{ "addc.", XO(31,10,0,1), XO_MASK, PPC, { RT, RA, RB } },
1922{ "a.", XO(31,10,0,1), XO_MASK, POWER, { RT, RA, RB } },
1923{ "addco", XO(31,10,1,0), XO_MASK, PPC, { RT, RA, RB } },
1924{ "ao", XO(31,10,1,0), XO_MASK, POWER, { RT, RA, RB } },
1925{ "addco.", XO(31,10,1,1), XO_MASK, PPC, { RT, RA, RB } },
1926{ "ao.", XO(31,10,1,1), XO_MASK, POWER, { RT, RA, RB } },
1927
1928{ "mulhwu", XO(31,11,0,0), XO_MASK, PPC, { RT, RA, RB } },
1929{ "mulhwu.", XO(31,11,0,1), XO_MASK, PPC, { RT, RA, RB } },
1930
1931{ "mfcr", X(31,19), XRARB_MASK, POWER|PPC, { RT } },
1932
1933{ "lwarx", X(31,20), X_MASK, PPC, { RT, RA, RB } },
1934
1935{ "ldx", X(31,21), X_MASK, PPC|B64, { RT, RA, RB } },
1936
1937{ "lwzx", X(31,23), X_MASK, PPC, { RT, RA, RB } },
1938{ "lx", X(31,23), X_MASK, POWER, { RT, RA, RB } },
1939
1940{ "slw", XRC(31,24,0), X_MASK, PPC, { RA, RS, RB } },
1941{ "sl", XRC(31,24,0), X_MASK, POWER, { RA, RS, RB } },
1942{ "slw.", XRC(31,24,1), X_MASK, PPC, { RA, RS, RB } },
1943{ "sl.", XRC(31,24,1), X_MASK, POWER, { RA, RS, RB } },
1944
1945{ "cntlzw", XRC(31,26,0), XRB_MASK, PPC, { RA, RS } },
1946{ "cntlz", XRC(31,26,0), XRB_MASK, POWER, { RA, RS } },
1947{ "cntlzw.", XRC(31,26,1), XRB_MASK, PPC, { RA, RS } },
1948{ "cntlz.", XRC(31,26,1), XRB_MASK, POWER, { RA, RS } },
1949
1950{ "sld", XRC(31,27,0), X_MASK, PPC|B64, { RA, RS, RB } },
1951{ "sld.", XRC(31,27,1), X_MASK, PPC|B64, { RA, RS, RB } },
1952
1953{ "and", XRC(31,28,0), X_MASK, PPC|POWER, { RA, RS, RB } },
1954{ "and.", XRC(31,28,1), X_MASK, PPC|POWER, { RA, RS, RB } },
1955
1956{ "maskg", XRC(31,29,0), X_MASK, POWER|M601, { RA, RS, RB } },
1957{ "maskg.", XRC(31,29,1), X_MASK, POWER|M601, { RA, RS, RB } },
1958
1959{ "cmplw", XCMPL(31,32,0), XCMPL_MASK, PPC, { OBF, RA, RB } },
1960{ "cmpld", XCMPL(31,32,1), XCMPL_MASK, PPC|B64, { OBF, RA, RB } },
1961{ "cmpl", X(31,32), XCMP_MASK, PPC, { BF, L, RA, RB } },
1962{ "cmpl", X(31,32), XCMPL_MASK, POWER, { BF, RA, RB } },
1963
1964{ "subf", XO(31,40,0,0), XO_MASK, PPC, { RT, RA, RB } },
1965{ "sub", XO(31,40,0,0), XO_MASK, PPC, { RT, RB, RA } },
1966{ "subf.", XO(31,40,0,1), XO_MASK, PPC, { RT, RA, RB } },
1967{ "sub.", XO(31,40,0,1), XO_MASK, PPC, { RT, RB, RA } },
1968{ "subfo", XO(31,40,1,0), XO_MASK, PPC, { RT, RA, RB } },
1969{ "subo", XO(31,40,1,0), XO_MASK, PPC, { RT, RB, RA } },
1970{ "subfo.", XO(31,40,1,1), XO_MASK, PPC, { RT, RA, RB } },
1971{ "subo.", XO(31,40,1,1), XO_MASK, PPC, { RT, RB, RA } },
1972
1973{ "ldux", X(31,53), X_MASK, PPC|B64, { RT, RAL, RB } },
1974
1975{ "dcbst", X(31,54), XRT_MASK, PPC, { RA, RB } },
1976
1977{ "lwzux", X(31,55), X_MASK, PPC, { RT, RAL, RB } },
1978{ "lux", X(31,55), X_MASK, POWER, { RT, RA, RB } },
1979
1980{ "cntlzd", XRC(31,58,0), XRB_MASK, PPC|B64, { RA, RS } },
1981{ "cntlzd.", XRC(31,58,1), XRB_MASK, PPC|B64, { RA, RS } },
1982
1983{ "andc", XRC(31,60,0), X_MASK, PPC|POWER, { RA, RS, RB } },
1984{ "andc.", XRC(31,60,1), X_MASK, PPC|POWER, { RA, RS, RB } },
1985
1986{ "tdlgt", XTO(31,68,TOLGT), XTO_MASK, PPC|B64, { RA, RB } },
1987{ "tdllt", XTO(31,68,TOLLT), XTO_MASK, PPC|B64, { RA, RB } },
1988{ "tdeq", XTO(31,68,TOEQ), XTO_MASK, PPC|B64, { RA, RB } },
1989{ "tdlge", XTO(31,68,TOLGE), XTO_MASK, PPC|B64, { RA, RB } },
1990{ "tdlnl", XTO(31,68,TOLNL), XTO_MASK, PPC|B64, { RA, RB } },
1991{ "tdlle", XTO(31,68,TOLLE), XTO_MASK, PPC|B64, { RA, RB } },
1992{ "tdlng", XTO(31,68,TOLNG), XTO_MASK, PPC|B64, { RA, RB } },
1993{ "tdgt", XTO(31,68,TOGT), XTO_MASK, PPC|B64, { RA, RB } },
1994{ "tdge", XTO(31,68,TOGE), XTO_MASK, PPC|B64, { RA, RB } },
1995{ "tdnl", XTO(31,68,TONL), XTO_MASK, PPC|B64, { RA, RB } },
1996{ "tdlt", XTO(31,68,TOLT), XTO_MASK, PPC|B64, { RA, RB } },
1997{ "tdle", XTO(31,68,TOLE), XTO_MASK, PPC|B64, { RA, RB } },
1998{ "tdng", XTO(31,68,TONG), XTO_MASK, PPC|B64, { RA, RB } },
1999{ "tdne", XTO(31,68,TONE), XTO_MASK, PPC|B64, { RA, RB } },
2000{ "td", X(31,68), X_MASK, PPC|B64, { TO, RA, RB } },
2001
2002{ "mulhd", XO(31,73,0,0), XO_MASK, PPC|B64, { RT, RA, RB } },
2003{ "mulhd.", XO(31,73,0,1), XO_MASK, PPC|B64, { RT, RA, RB } },
2004
2005{ "mulhw", XO(31,75,0,0), XO_MASK, PPC, { RT, RA, RB } },
2006{ "mulhw.", XO(31,75,0,1), XO_MASK, PPC, { RT, RA, RB } },
2007
2008{ "mfmsr", X(31,83), XRARB_MASK, PPC|POWER, { RT } },
2009
2010{ "ldarx", X(31,84), X_MASK, PPC|B64, { RT, RA, RB } },
2011
2012{ "dcbf", X(31,86), XRT_MASK, PPC, { RA, RB } },
2013
2014{ "lbzx", X(31,87), X_MASK, PPC|POWER, { RT, RA, RB } },
2015
2016{ "neg", XO(31,104,0,0), XORB_MASK, PPC|POWER, { RT, RA } },
2017{ "neg.", XO(31,104,0,1), XORB_MASK, PPC|POWER, { RT, RA } },
2018{ "nego", XO(31,104,1,0), XORB_MASK, PPC|POWER, { RT, RA } },
2019{ "nego.", XO(31,104,1,1), XORB_MASK, PPC|POWER, { RT, RA } },
2020
2021{ "mul", XO(31,107,0,0), XO_MASK, POWER|M601, { RT, RA, RB } },
2022{ "mul.", XO(31,107,0,1), XO_MASK, POWER|M601, { RT, RA, RB } },
2023{ "mulo", XO(31,107,1,0), XO_MASK, POWER|M601, { RT, RA, RB } },
2024{ "mulo.", XO(31,107,1,1), XO_MASK, POWER|M601, { RT, RA, RB } },
2025
2026{ "clf", X(31,118), XRB_MASK, POWER, { RT, RA } },
2027
2028{ "lbzux", X(31,119), X_MASK, PPC|POWER, { RT, RAL, RB } },
2029
2030{ "not", XRC(31,124,0), X_MASK, PPC|POWER, { RA, RS, RBS } },
2031{ "nor", XRC(31,124,0), X_MASK, PPC|POWER, { RA, RS, RB } },
2032{ "not.", XRC(31,124,1), X_MASK, PPC|POWER, { RA, RS, RBS } },
2033{ "nor.", XRC(31,124,1), X_MASK, PPC|POWER, { RA, RS, RB } },
2034
2035{ "subfe", XO(31,136,0,0), XO_MASK, PPC, { RT, RA, RB } },
2036{ "sfe", XO(31,136,0,0), XO_MASK, POWER, { RT, RA, RB } },
2037{ "subfe.", XO(31,136,0,1), XO_MASK, PPC, { RT, RA, RB } },
2038{ "sfe.", XO(31,136,0,1), XO_MASK, POWER, { RT, RA, RB } },
2039{ "subfeo", XO(31,136,1,0), XO_MASK, PPC, { RT, RA, RB } },
2040{ "sfeo", XO(31,136,1,0), XO_MASK, POWER, { RT, RA, RB } },
2041{ "subfeo.", XO(31,136,1,1), XO_MASK, PPC, { RT, RA, RB } },
2042{ "sfeo.", XO(31,136,1,1), XO_MASK, POWER, { RT, RA, RB } },
2043
2044{ "adde", XO(31,138,0,0), XO_MASK, PPC, { RT, RA, RB } },
2045{ "ae", XO(31,138,0,0), XO_MASK, POWER, { RT, RA, RB } },
2046{ "adde.", XO(31,138,0,1), XO_MASK, PPC, { RT, RA, RB } },
2047{ "ae.", XO(31,138,0,1), XO_MASK, POWER, { RT, RA, RB } },
2048{ "addeo", XO(31,138,1,0), XO_MASK, PPC, { RT, RA, RB } },
2049{ "aeo", XO(31,138,1,0), XO_MASK, POWER, { RT, RA, RB } },
2050{ "addeo.", XO(31,138,1,1), XO_MASK, PPC, { RT, RA, RB } },
2051{ "aeo.", XO(31,138,1,1), XO_MASK, POWER, { RT, RA, RB } },
2052
2053{ "mtcr", XFXM(31,144,0xff), XFXFXM_MASK|FXM_MASK, PPC|POWER, { RS }},
2054{ "mtcrf", X(31,144), XFXFXM_MASK, PPC|POWER, { FXM, RS } },
2055
2056{ "mtmsr", X(31,146), XRARB_MASK, PPC|POWER, { RS } },
2057
2058{ "stdx", X(31,149), X_MASK, PPC|B64, { RS, RA, RB } },
2059
2060{ "stwcx.", XRC(31,150,1), X_MASK, PPC, { RS, RA, RB } },
2061
2062{ "stwx", X(31,151), X_MASK, PPC, { RS, RA, RB } },
2063{ "stx", X(31,151), X_MASK, POWER, { RS, RA, RB } },
2064
2065{ "slq", XRC(31,152,0), X_MASK, POWER|M601, { RA, RS, RB } },
2066{ "slq.", XRC(31,152,1), X_MASK, POWER|M601, { RA, RS, RB } },
2067
2068{ "sle", XRC(31,153,0), X_MASK, POWER|M601, { RA, RS, RB } },
2069{ "sle.", XRC(31,153,1), X_MASK, POWER|M601, { RA, RS, RB } },
2070
2071{ "stdux", X(31,181), X_MASK, PPC|B64, { RS, RAS, RB } },
2072
2073{ "stwux", X(31,183), X_MASK, PPC, { RS, RAS, RB } },
2074{ "stux", X(31,183), X_MASK, POWER, { RS, RA, RB } },
2075
2076{ "sliq", XRC(31,184,0), X_MASK, POWER|M601, { RA, RS, SH } },
2077{ "sliq.", XRC(31,184,1), X_MASK, POWER|M601, { RA, RS, SH } },
2078
2079{ "subfze", XO(31,200,0,0), XORB_MASK, PPC, { RT, RA } },
2080{ "sfze", XO(31,200,0,0), XORB_MASK, POWER, { RT, RA } },
2081{ "subfze.", XO(31,200,0,1), XORB_MASK, PPC, { RT, RA } },
2082{ "sfze.", XO(31,200,0,1), XORB_MASK, POWER, { RT, RA } },
2083{ "subfzeo", XO(31,200,1,0), XORB_MASK, PPC, { RT, RA } },
2084{ "sfzeo", XO(31,200,1,0), XORB_MASK, POWER, { RT, RA } },
2085{ "subfzeo.",XO(31,200,1,1), XORB_MASK, PPC, { RT, RA } },
2086{ "sfzeo.", XO(31,200,1,1), XORB_MASK, POWER, { RT, RA } },
2087
2088{ "addze", XO(31,202,0,0), XORB_MASK, PPC, { RT, RA } },
2089{ "aze", XO(31,202,0,0), XORB_MASK, POWER, { RT, RA } },
2090{ "addze.", XO(31,202,0,1), XORB_MASK, PPC, { RT, RA } },
2091{ "aze.", XO(31,202,0,1), XORB_MASK, POWER, { RT, RA } },
2092{ "addzeo", XO(31,202,1,0), XORB_MASK, PPC, { RT, RA } },
2093{ "azeo", XO(31,202,1,0), XORB_MASK, POWER, { RT, RA } },
2094{ "addzeo.", XO(31,202,1,1), XORB_MASK, PPC, { RT, RA } },
2095{ "azeo.", XO(31,202,1,1), XORB_MASK, POWER, { RT, RA } },
2096
2097{ "mtsr", X(31,210), XRB_MASK|(1<<20), PPC|POWER|B32, { SR, RS } },
2098
2099{ "stdcx.", XRC(31,214,1), X_MASK, PPC|B64, { RS, RA, RB } },
2100
2101{ "stbx", X(31,215), X_MASK, PPC|POWER, { RS, RA, RB } },
2102
2103{ "sllq", XRC(31,216,0), X_MASK, POWER|M601, { RA, RS, RB } },
2104{ "sllq.", XRC(31,216,1), X_MASK, POWER|M601, { RA, RS, RB } },
2105
2106{ "sleq", XRC(31,217,0), X_MASK, POWER|M601, { RA, RS, RB } },
2107{ "sleq.", XRC(31,217,1), X_MASK, POWER|M601, { RA, RS, RB } },
2108
2109{ "subfme", XO(31,232,0,0), XORB_MASK, PPC, { RT, RA } },
2110{ "sfme", XO(31,232,0,0), XORB_MASK, POWER, { RT, RA } },
2111{ "subfme.", XO(31,232,0,1), XORB_MASK, PPC, { RT, RA } },
2112{ "sfme.", XO(31,232,0,1), XORB_MASK, POWER, { RT, RA } },
2113{ "subfmeo", XO(31,232,1,0), XORB_MASK, PPC, { RT, RA } },
2114{ "sfmeo", XO(31,232,1,0), XORB_MASK, POWER, { RT, RA } },
2115{ "subfmeo.",XO(31,232,1,1), XORB_MASK, PPC, { RT, RA } },
2116{ "sfmeo.", XO(31,232,1,1), XORB_MASK, POWER, { RT, RA } },
2117
2118{ "mulld", XO(31,233,0,0), XO_MASK, PPC|B64, { RT, RA, RB } },
2119{ "mulld.", XO(31,233,0,1), XO_MASK, PPC|B64, { RT, RA, RB } },
2120{ "mulldo", XO(31,233,1,0), XO_MASK, PPC|B64, { RT, RA, RB } },
2121{ "mulldo.", XO(31,233,1,1), XO_MASK, PPC|B64, { RT, RA, RB } },
2122
2123{ "addme", XO(31,234,0,0), XORB_MASK, PPC, { RT, RA } },
2124{ "ame", XO(31,234,0,0), XORB_MASK, POWER, { RT, RA } },
2125{ "addme.", XO(31,234,0,1), XORB_MASK, PPC, { RT, RA } },
2126{ "ame.", XO(31,234,0,1), XORB_MASK, POWER, { RT, RA } },
2127{ "addmeo", XO(31,234,1,0), XORB_MASK, PPC, { RT, RA } },
2128{ "ameo", XO(31,234,1,0), XORB_MASK, POWER, { RT, RA } },
2129{ "addmeo.", XO(31,234,1,1), XORB_MASK, PPC, { RT, RA } },
2130{ "ameo.", XO(31,234,1,1), XORB_MASK, POWER, { RT, RA } },
2131
2132{ "mullw", XO(31,235,0,0), XO_MASK, PPC, { RT, RA, RB } },
2133{ "muls", XO(31,235,0,0), XO_MASK, POWER, { RT, RA, RB } },
2134{ "mullw.", XO(31,235,0,1), XO_MASK, PPC, { RT, RA, RB } },
2135{ "muls.", XO(31,235,0,1), XO_MASK, POWER, { RT, RA, RB } },
2136{ "mullwo", XO(31,235,1,0), XO_MASK, PPC, { RT, RA, RB } },
2137{ "mulso", XO(31,235,1,0), XO_MASK, POWER, { RT, RA, RB } },
2138{ "mullwo.", XO(31,235,1,1), XO_MASK, PPC, { RT, RA, RB } },
2139{ "mulso.", XO(31,235,1,1), XO_MASK, POWER, { RT, RA, RB } },
2140
2141{ "mtsrin", X(31,242), XRA_MASK, PPC|B32, { RS, RB } },
2142{ "mtsri", X(31,242), XRA_MASK, POWER|B32, { RS, RB } },
2143
2144{ "dcbtst", X(31,246), XRT_MASK, PPC, { RA, RB } },
2145
2146{ "stbux", X(31,247), X_MASK, PPC|POWER, { RS, RAS, RB } },
2147
2148{ "slliq", XRC(31,248,0), X_MASK, POWER|M601, { RA, RS, SH } },
2149{ "slliq.", XRC(31,248,1), X_MASK, POWER|M601, { RA, RS, SH } },
2150
2151{ "doz", XO(31,264,0,0), XO_MASK, POWER|M601, { RT, RA, RB } },
2152{ "doz.", XO(31,264,0,1), XO_MASK, POWER|M601, { RT, RA, RB } },
2153{ "dozo", XO(31,264,1,0), XO_MASK, POWER|M601, { RT, RA, RB } },
2154{ "dozo.", XO(31,264,1,1), XO_MASK, POWER|M601, { RT, RA, RB } },
2155
2156{ "add", XO(31,266,0,0), XO_MASK, PPC, { RT, RA, RB } },
2157{ "cax", XO(31,266,0,0), XO_MASK, POWER, { RT, RA, RB } },
2158{ "add.", XO(31,266,0,1), XO_MASK, PPC, { RT, RA, RB } },
2159{ "cax.", XO(31,266,0,1), XO_MASK, POWER, { RT, RA, RB } },
2160{ "addo", XO(31,266,1,0), XO_MASK, PPC, { RT, RA, RB } },
2161{ "caxo", XO(31,266,1,0), XO_MASK, POWER, { RT, RA, RB } },
2162{ "addo.", XO(31,266,1,1), XO_MASK, PPC, { RT, RA, RB } },
2163{ "caxo.", XO(31,266,1,1), XO_MASK, POWER, { RT, RA, RB } },
2164
2165{ "lscbx", XRC(31,277,0), X_MASK, POWER|M601, { RT, RA, RB } },
2166{ "lscbx.", XRC(31,277,1), X_MASK, POWER|M601, { RT, RA, RB } },
2167
2168{ "dcbt", X(31,278), XRT_MASK, PPC, { RA, RB } },
2169
2170{ "lhzx", X(31,279), X_MASK, PPC|POWER, { RT, RA, RB } },
2171
2172{ "icbt", X(31,262), XRT_MASK, PPC, { RA, RB } },
2173
2174{ "eqv", XRC(31,284,0), X_MASK, PPC|POWER, { RA, RS, RB } },
2175{ "eqv.", XRC(31,284,1), X_MASK, PPC|POWER, { RA, RS, RB } },
2176
2177{ "tlbie", X(31,306), XRTRA_MASK, PPC, { RB } },
2178{ "tlbi", X(31,306), XRTRA_MASK, POWER, { RB } },
2179
2180{ "eciwx", X(31,310), X_MASK, PPC, { RT, RA, RB } },
2181
2182{ "lhzux", X(31,311), X_MASK, PPC|POWER, { RT, RAL, RB } },
2183
2184{ "xor", XRC(31,316,0), X_MASK, PPC|POWER, { RA, RS, RB } },
2185{ "xor.", XRC(31,316,1), X_MASK, PPC|POWER, { RA, RS, RB } },
2186
2187{ "mfdcr", X(31,323), X_MASK, PPC, { RT, SPR } },
2188
2189{ "div", XO(31,331,0,0), XO_MASK, POWER|M601, { RT, RA, RB } },
2190{ "div.", XO(31,331,0,1), XO_MASK, POWER|M601, { RT, RA, RB } },
2191{ "divo", XO(31,331,1,0), XO_MASK, POWER|M601, { RT, RA, RB } },
2192{ "divo.", XO(31,331,1,1), XO_MASK, POWER|M601, { RT, RA, RB } },
2193
2194{ "mfmq", XSPR(31,339,0), XSPR_MASK, POWER|M601, { RT } },
2195{ "mfxer", XSPR(31,339,1), XSPR_MASK, PPC|POWER, { RT } },
2196{ "mfrtcu", XSPR(31,339,4), XSPR_MASK, PPC|POWER, { RT } },
2197{ "mfrtcl", XSPR(31,339,5), XSPR_MASK, PPC|POWER, { RT } },
2198{ "mfdec", XSPR(31,339,6), XSPR_MASK, POWER|M601, { RT } },
2199{ "mflr", XSPR(31,339,8), XSPR_MASK, PPC|POWER, { RT } },
2200{ "mfctr", XSPR(31,339,9), XSPR_MASK, PPC|POWER, { RT } },
2201{ "mftid", XSPR(31,339,17), XSPR_MASK, POWER, { RT } },
2202{ "mfdsisr", XSPR(31,339,18), XSPR_MASK, PPC|POWER, { RT } },
2203{ "mfdar", XSPR(31,339,19), XSPR_MASK, PPC|POWER, { RT } },
2204{ "mfdec", XSPR(31,339,22), XSPR_MASK, PPC, { RT } },
2205{ "mfsdr0", XSPR(31,339,24), XSPR_MASK, POWER, { RT } },
2206{ "mfsdr1", XSPR(31,339,25), XSPR_MASK, PPC|POWER, { RT } },
2207{ "mfsrr0", XSPR(31,339,26), XSPR_MASK, PPC|POWER, { RT } },
2208{ "mfsrr1", XSPR(31,339,27), XSPR_MASK, PPC|POWER, { RT } },
2209{ "mfsprg", XSPR(31,339,272), XSPRG_MASK, PPC, { RT, SPRG } },
2210{ "mfasr", XSPR(31,339,280), XSPR_MASK, PPC|B64, { RT } },
2211{ "mfear", XSPR(31,339,282), XSPR_MASK, PPC, { RT } },
2212{ "mfpvr", XSPR(31,339,287), XSPR_MASK, PPC, { RT } },
2213{ "mfibatu", XSPR(31,339,528), XSPRBAT_MASK, PPC, { RT, SPRBAT } },
2214{ "mfibatl", XSPR(31,339,529), XSPRBAT_MASK, PPC, { RT, SPRBAT } },
2215{ "mfdbatu", XSPR(31,339,536), XSPRBAT_MASK, PPC, { RT, SPRBAT } },
2216{ "mfdbatl", XSPR(31,339,537), XSPRBAT_MASK, PPC, { RT, SPRBAT } },
2217{ "mfspr", X(31,339), X_MASK, PPC|POWER, { RT, SPR } },
2218
2219{ "lwax", X(31,341), X_MASK, PPC|B64, { RT, RA, RB } },
2220
2221{ "lhax", X(31,343), X_MASK, PPC|POWER, { RT, RA, RB } },
2222
2223{ "dccci", X(31,454), XRT_MASK, PPC, { RA, RB } },
2224
2225{ "abs", XO(31,360,0,0), XORB_MASK, POWER|M601, { RT, RA } },
2226{ "abs.", XO(31,360,0,1), XORB_MASK, POWER|M601, { RT, RA } },
2227{ "abso", XO(31,360,1,0), XORB_MASK, POWER|M601, { RT, RA } },
2228{ "abso.", XO(31,360,1,1), XORB_MASK, POWER|M601, { RT, RA } },
2229
2230{ "divs", XO(31,363,0,0), XO_MASK, POWER|M601, { RT, RA, RB } },
2231{ "divs.", XO(31,363,0,1), XO_MASK, POWER|M601, { RT, RA, RB } },
2232{ "divso", XO(31,363,1,0), XO_MASK, POWER|M601, { RT, RA, RB } },
2233{ "divso.", XO(31,363,1,1), XO_MASK, POWER|M601, { RT, RA, RB } },
2234
2235{ "tlbia", X(31,370), 0xffffffff, PPC, { 0 } },
2236
2237{ "mftbu", XSPR(31,371,269), XSPR_MASK, PPC, { RT } },
2238{ "mftb", X(31,371), X_MASK, PPC, { RT, TBR } },
2239
2240{ "lwaux", X(31,373), X_MASK, PPC|B64, { RT, RAL, RB } },
2241
2242{ "lhaux", X(31,375), X_MASK, PPC|POWER, { RT, RAL, RB } },
2243
2244{ "sthx", X(31,407), X_MASK, PPC|POWER, { RS, RA, RB } },
2245
2246{ "lfqx", X(31,791), X_MASK, POWER2, { FRT, RA, RB } },
2247
2248{ "lfqux", X(31,823), X_MASK, POWER2, { FRT, RA, RB } },
2249
2250{ "stfqx", X(31,919), X_MASK, POWER2, { FRS, RA, RB } },
2251
2252{ "stfqux", X(31,951), X_MASK, POWER2, { FRS, RA, RB } },
2253
2254{ "orc", XRC(31,412,0), X_MASK, PPC|POWER, { RA, RS, RB } },
2255{ "orc.", XRC(31,412,1), X_MASK, PPC|POWER, { RA, RS, RB } },
2256
2257{ "sradi", XS(31,413,0), XS_MASK, PPC|B64, { RA, RS, SH6 } },
2258{ "sradi.", XS(31,413,1), XS_MASK, PPC|B64, { RA, RS, SH6 } },
2259
2260{ "slbie", X(31,434), XRTRA_MASK, PPC|B64, { RB } },
2261
2262{ "ecowx", X(31,438), X_MASK, PPC, { RT, RA, RB } },
2263
2264{ "sthux", X(31,439), X_MASK, PPC|POWER, { RS, RAS, RB } },
2265
2266{ "mr", XRC(31,444,0), X_MASK, PPC|POWER, { RA, RS, RBS } },
2267{ "or", XRC(31,444,0), X_MASK, PPC|POWER, { RA, RS, RB } },
2268{ "mr.", XRC(31,444,1), X_MASK, PPC|POWER, { RA, RS, RBS } },
2269{ "or.", XRC(31,444,1), X_MASK, PPC|POWER, { RA, RS, RB } },
2270
2271{ "mtdcr", X(31,451), X_MASK, PPC, { SPR, RS } },
2272
2273{ "divdu", XO(31,457,0,0), XO_MASK, PPC|B64, { RT, RA, RB } },
2274{ "divdu.", XO(31,457,0,1), XO_MASK, PPC|B64, { RT, RA, RB } },
2275{ "divduo", XO(31,457,1,0), XO_MASK, PPC|B64, { RT, RA, RB } },
2276{ "divduo.", XO(31,457,1,1), XO_MASK, PPC|B64, { RT, RA, RB } },
2277
2278{ "divwu", XO(31,459,0,0), XO_MASK, PPC, { RT, RA, RB } },
2279{ "divwu.", XO(31,459,0,1), XO_MASK, PPC, { RT, RA, RB } },
2280{ "divwuo", XO(31,459,1,0), XO_MASK, PPC, { RT, RA, RB } },
2281{ "divwuo.", XO(31,459,1,1), XO_MASK, PPC, { RT, RA, RB } },
2282
2283{ "mtmq", XSPR(31,467,0), XSPR_MASK, POWER|M601, { RS } },
2284{ "mtxer", XSPR(31,467,1), XSPR_MASK, PPC|POWER, { RS } },
2285{ "mtlr", XSPR(31,467,8), XSPR_MASK, PPC|POWER, { RS } },
2286{ "mtctr", XSPR(31,467,9), XSPR_MASK, PPC|POWER, { RS } },
2287{ "mttid", XSPR(31,467,17), XSPR_MASK, POWER, { RS } },
2288{ "mtdsisr", XSPR(31,467,18), XSPR_MASK, PPC|POWER, { RS } },
2289{ "mtdar", XSPR(31,467,19), XSPR_MASK, PPC|POWER, { RS } },
2290{ "mtrtcu", XSPR(31,467,20), XSPR_MASK, PPC|POWER, { RS } },
2291{ "mtrtcl", XSPR(31,467,21), XSPR_MASK, PPC|POWER, { RS } },
2292{ "mtdec", XSPR(31,467,22), XSPR_MASK, PPC|POWER, { RS } },
2293{ "mtsdr0", XSPR(31,467,24), XSPR_MASK, POWER, { RS } },
2294{ "mtsdr1", XSPR(31,467,25), XSPR_MASK, PPC|POWER, { RS } },
2295{ "mtsrr0", XSPR(31,467,26), XSPR_MASK, PPC|POWER, { RS } },
2296{ "mtsrr1", XSPR(31,467,27), XSPR_MASK, PPC|POWER, { RS } },
2297{ "mtsprg", XSPR(31,467,272), XSPRG_MASK, PPC, { SPRG, RS } },
2298{ "mtasr", XSPR(31,467,280), XSPR_MASK, PPC|B64, { RS } },
2299{ "mtear", XSPR(31,467,282), XSPR_MASK, PPC, { RS } },
2300{ "mttbl", XSPR(31,467,284), XSPR_MASK, PPC, { RS } },
2301{ "mttbu", XSPR(31,467,285), XSPR_MASK, PPC, { RS } },
2302{ "mtibatu", XSPR(31,467,528), XSPRBAT_MASK, PPC, { SPRBAT, RS } },
2303{ "mtibatl", XSPR(31,467,529), XSPRBAT_MASK, PPC, { SPRBAT, RS } },
2304{ "mtdbatu", XSPR(31,467,536), XSPRBAT_MASK, PPC, { SPRBAT, RS } },
2305{ "mtdbatl", XSPR(31,467,537), XSPRBAT_MASK, PPC, { SPRBAT, RS } },
2306{ "mtspr", X(31,467), X_MASK, PPC|POWER, { SPR, RS } },
2307
2308{ "dcbi", X(31,470), XRT_MASK, PPC, { RA, RB } },
2309
2310{ "nand", XRC(31,476,0), X_MASK, PPC|POWER, { RA, RS, RB } },
2311{ "nand.", XRC(31,476,1), X_MASK, PPC|POWER, { RA, RS, RB } },
2312
2313{ "nabs", XO(31,488,0,0), XORB_MASK, POWER|M601, { RT, RA } },
2314{ "nabs.", XO(31,488,0,1), XORB_MASK, POWER|M601, { RT, RA } },
2315{ "nabso", XO(31,488,1,0), XORB_MASK, POWER|M601, { RT, RA } },
2316{ "nabso.", XO(31,488,1,1), XORB_MASK, POWER|M601, { RT, RA } },
2317
2318{ "divd", XO(31,489,0,0), XO_MASK, PPC|B64, { RT, RA, RB } },
2319{ "divd.", XO(31,489,0,1), XO_MASK, PPC|B64, { RT, RA, RB } },
2320{ "divdo", XO(31,489,1,0), XO_MASK, PPC|B64, { RT, RA, RB } },
2321{ "divdo.", XO(31,489,1,1), XO_MASK, PPC|B64, { RT, RA, RB } },
2322
2323{ "divw", XO(31,491,0,0), XO_MASK, PPC, { RT, RA, RB } },
2324{ "divw.", XO(31,491,0,1), XO_MASK, PPC, { RT, RA, RB } },
2325{ "divwo", XO(31,491,1,0), XO_MASK, PPC, { RT, RA, RB } },
2326{ "divwo.", XO(31,491,1,1), XO_MASK, PPC, { RT, RA, RB } },
2327
2328{ "slbia", X(31,498), 0xffffffff, PPC|B64, { 0 } },
2329
2330{ "cli", X(31,502), XRB_MASK, POWER, { RT, RA } },
2331
2332{ "mcrxr", X(31,512), XRARB_MASK|(3<<21), PPC|POWER, { BF } },
2333
2334{ "clcs", X(31,531), XRB_MASK, POWER|M601, { RT, RA } },
2335
2336{ "lswx", X(31,533), X_MASK, PPC, { RT, RA, RB } },
2337{ "lsx", X(31,533), X_MASK, POWER, { RT, RA, RB } },
2338
2339{ "lwbrx", X(31,534), X_MASK, PPC, { RT, RA, RB } },
2340{ "lbrx", X(31,534), X_MASK, POWER, { RT, RA, RB } },
2341
2342{ "lfsx", X(31,535), X_MASK, PPC|POWER, { FRT, RA, RB } },
2343
2344{ "srw", XRC(31,536,0), X_MASK, PPC, { RA, RS, RB } },
2345{ "sr", XRC(31,536,0), X_MASK, POWER, { RA, RS, RB } },
2346{ "srw.", XRC(31,536,1), X_MASK, PPC, { RA, RS, RB } },
2347{ "sr.", XRC(31,536,1), X_MASK, POWER, { RA, RS, RB } },
2348
2349{ "rrib", XRC(31,537,0), X_MASK, POWER|M601, { RA, RS, RB } },
2350{ "rrib.", XRC(31,537,1), X_MASK, POWER|M601, { RA, RS, RB } },
2351
2352{ "srd", XRC(31,539,0), X_MASK, PPC|B64, { RA, RS, RB } },
2353{ "srd.", XRC(31,539,1), X_MASK, PPC|B64, { RA, RS, RB } },
2354
2355{ "maskir", XRC(31,541,0), X_MASK, POWER|M601, { RA, RS, RB } },
2356{ "maskir.", XRC(31,541,1), X_MASK, POWER|M601, { RA, RS, RB } },
2357
2358{ "tlbsync", X(31,566), 0xffffffff, PPC, { 0 } },
2359
2360{ "lfsux", X(31,567), X_MASK, PPC|POWER, { FRT, RAS, RB } },
2361
2362{ "mfsr", X(31,595), XRB_MASK|(1<<20), PPC|POWER|B32, { RT, SR } },
2363
2364{ "lswi", X(31,597), X_MASK, PPC, { RT, RA, NB } },
2365{ "lsi", X(31,597), X_MASK, POWER, { RT, RA, NB } },
2366
2367{ "sync", X(31,598), 0xffffffff, PPC, { 0 } },
2368{ "dcs", X(31,598), 0xffffffff, POWER, { 0 } },
2369
2370{ "lfdx", X(31,599), X_MASK, PPC|POWER, { FRT, RA, RB } },
2371
2372{ "mfsri", X(31,627), X_MASK, POWER, { RT, RA, RB } },
2373
2374{ "dclst", X(31,630), XRB_MASK, POWER, { RS, RA } },
2375
2376{ "lfdux", X(31,631), X_MASK, PPC|POWER, { FRT, RAS, RB } },
2377
2378{ "mfsrin", X(31,659), XRA_MASK, PPC|B32, { RT, RB } },
2379
2380{ "stswx", X(31,661), X_MASK, PPC, { RS, RA, RB } },
2381{ "stsx", X(31,661), X_MASK, POWER, { RS, RA, RB } },
2382
2383{ "stwbrx", X(31,662), X_MASK, PPC, { RS, RA, RB } },
2384{ "stbrx", X(31,662), X_MASK, POWER, { RS, RA, RB } },
2385
2386{ "stfsx", X(31,663), X_MASK, PPC|POWER, { FRS, RA, RB } },
2387
2388{ "srq", XRC(31,664,0), X_MASK, POWER|M601, { RA, RS, RB } },
2389{ "srq.", XRC(31,664,1), X_MASK, POWER|M601, { RA, RS, RB } },
2390
2391{ "sre", XRC(31,665,0), X_MASK, POWER|M601, { RA, RS, RB } },
2392{ "sre.", XRC(31,665,1), X_MASK, POWER|M601, { RA, RS, RB } },
2393
2394{ "stfsux", X(31,695), X_MASK, PPC|POWER, { FRS, RAS, RB } },
2395
2396{ "sriq", XRC(31,696,0), X_MASK, POWER|M601, { RA, RS, SH } },
2397{ "sriq.", XRC(31,696,1), X_MASK, POWER|M601, { RA, RS, SH } },
2398
2399{ "stswi", X(31,725), X_MASK, PPC, { RS, RA, NB } },
2400{ "stsi", X(31,725), X_MASK, POWER, { RS, RA, NB } },
2401
2402{ "stfdx", X(31,727), X_MASK, PPC|POWER, { FRS, RA, RB } },
2403
2404{ "srlq", XRC(31,728,0), X_MASK, POWER|M601, { RA, RS, RB } },
2405{ "srlq.", XRC(31,728,1), X_MASK, POWER|M601, { RA, RS, RB } },
2406
2407{ "sreq", XRC(31,729,0), X_MASK, POWER|M601, { RA, RS, RB } },
2408{ "sreq.", XRC(31,729,1), X_MASK, POWER|M601, { RA, RS, RB } },
2409
2410{ "stfdux", X(31,759), X_MASK, PPC|POWER, { FRS, RAS, RB } },
2411
2412{ "srliq", XRC(31,760,0), X_MASK, POWER|M601, { RA, RS, SH } },
2413{ "srliq.", XRC(31,760,1), X_MASK, POWER|M601, { RA, RS, SH } },
2414
2415{ "lhbrx", X(31,790), X_MASK, PPC|POWER, { RT, RA, RB } },
2416
2417{ "sraw", XRC(31,792,0), X_MASK, PPC, { RA, RS, RB } },
2418{ "sra", XRC(31,792,0), X_MASK, POWER, { RA, RS, RB } },
2419{ "sraw.", XRC(31,792,1), X_MASK, PPC, { RA, RS, RB } },
2420{ "sra.", XRC(31,792,1), X_MASK, POWER, { RA, RS, RB } },
2421
2422{ "srad", XRC(31,794,0), X_MASK, PPC|B64, { RA, RS, RB } },
2423{ "srad.", XRC(31,794,1), X_MASK, PPC|B64, { RA, RS, RB } },
2424
2425{ "rac", X(31,818), X_MASK, POWER, { RT, RA, RB } },
2426
2427{ "srawi", XRC(31,824,0), X_MASK, PPC, { RA, RS, SH } },
2428{ "srai", XRC(31,824,0), X_MASK, POWER, { RA, RS, SH } },
2429{ "srawi.", XRC(31,824,1), X_MASK, PPC, { RA, RS, SH } },
2430{ "srai.", XRC(31,824,1), X_MASK, POWER, { RA, RS, SH } },
2431
2432{ "eieio", X(31,854), 0xffffffff, PPC, { 0 } },
2433
2434{ "sthbrx", X(31,918), X_MASK, PPC|POWER, { RS, RA, RB } },
2435
2436{ "sraq", XRC(31,920,0), X_MASK, POWER|M601, { RA, RS, RB } },
2437{ "sraq.", XRC(31,920,1), X_MASK, POWER|M601, { RA, RS, RB } },
2438
2439{ "srea", XRC(31,921,0), X_MASK, POWER|M601, { RA, RS, RB } },
2440{ "srea.", XRC(31,921,1), X_MASK, POWER|M601, { RA, RS, RB } },
2441
2442{ "extsh", XRC(31,922,0), XRB_MASK, PPC, { RA, RS } },
2443{ "exts", XRC(31,922,0), XRB_MASK, POWER, { RA, RS } },
2444{ "extsh.", XRC(31,922,1), XRB_MASK, PPC, { RA, RS } },
2445{ "exts.", XRC(31,922,1), XRB_MASK, POWER, { RA, RS } },
2446
2447{ "sraiq", XRC(31,952,0), X_MASK, POWER|M601, { RA, RS, SH } },
2448{ "sraiq.", XRC(31,952,1), X_MASK, POWER|M601, { RA, RS, SH } },
2449
2450{ "extsb", XRC(31,954,0), XRB_MASK, PPC, { RA, RS} },
2451{ "extsb.", XRC(31,954,1), XRB_MASK, PPC, { RA, RS} },
2452
2453{ "iccci", X(31,966), XRT_MASK, PPC, { RA, RB } },
2454
2455{ "icbi", X(31,982), XRT_MASK, PPC, { RA, RB } },
2456
2457{ "stfiwx", X(31,983), X_MASK, PPC, { FRS, RA, RB } },
2458
2459{ "extsw", XRC(31,986,0), XRB_MASK, PPC, { RA, RS } },
2460{ "extsw.", XRC(31,986,1), XRB_MASK, PPC, { RA, RS } },
2461
2462{ "dcbz", X(31,1014), XRT_MASK, PPC, { RA, RB } },
2463{ "dclz", X(31,1014), XRT_MASK, PPC, { RA, RB } },
2464
2465{ "lwz", OP(32), OP_MASK, PPC, { RT, D, RA } },
2466{ "l", OP(32), OP_MASK, POWER, { RT, D, RA } },
2467
2468{ "lwzu", OP(33), OP_MASK, PPC, { RT, D, RAL } },
2469{ "lu", OP(33), OP_MASK, POWER, { RT, D, RA } },
2470
2471{ "lbz", OP(34), OP_MASK, PPC|POWER, { RT, D, RA } },
2472
2473{ "lbzu", OP(35), OP_MASK, PPC|POWER, { RT, D, RAL } },
2474
2475{ "stw", OP(36), OP_MASK, PPC, { RS, D, RA } },
2476{ "st", OP(36), OP_MASK, POWER, { RS, D, RA } },
2477
2478{ "stwu", OP(37), OP_MASK, PPC, { RS, D, RAS } },
2479{ "stu", OP(37), OP_MASK, POWER, { RS, D, RA } },
2480
2481{ "stb", OP(38), OP_MASK, PPC|POWER, { RS, D, RA } },
2482
2483{ "stbu", OP(39), OP_MASK, PPC|POWER, { RS, D, RAS } },
2484
2485{ "lhz", OP(40), OP_MASK, PPC|POWER, { RT, D, RA } },
2486
2487{ "lhzu", OP(41), OP_MASK, PPC|POWER, { RT, D, RAL } },
2488
2489{ "lha", OP(42), OP_MASK, PPC|POWER, { RT, D, RA } },
2490
2491{ "lhau", OP(43), OP_MASK, PPC|POWER, { RT, D, RAL } },
2492
2493{ "sth", OP(44), OP_MASK, PPC|POWER, { RS, D, RA } },
2494
2495{ "sthu", OP(45), OP_MASK, PPC|POWER, { RS, D, RAS } },
2496
2497{ "lmw", OP(46), OP_MASK, PPC, { RT, D, RAM } },
2498{ "lm", OP(46), OP_MASK, POWER, { RT, D, RA } },
2499
2500{ "stmw", OP(47), OP_MASK, PPC, { RS, D, RA } },
2501{ "stm", OP(47), OP_MASK, POWER, { RS, D, RA } },
2502
2503{ "lfs", OP(48), OP_MASK, PPC|POWER, { FRT, D, RA } },
2504
2505{ "lfsu", OP(49), OP_MASK, PPC|POWER, { FRT, D, RAS } },
2506
2507{ "lfd", OP(50), OP_MASK, PPC|POWER, { FRT, D, RA } },
2508
2509{ "lfdu", OP(51), OP_MASK, PPC|POWER, { FRT, D, RAS } },
2510
2511{ "stfs", OP(52), OP_MASK, PPC|POWER, { FRS, D, RA } },
2512
2513{ "stfsu", OP(53), OP_MASK, PPC|POWER, { FRS, D, RAS } },
2514
2515{ "stfd", OP(54), OP_MASK, PPC|POWER, { FRS, D, RA } },
2516
2517{ "stfdu", OP(55), OP_MASK, PPC|POWER, { FRS, D, RAS } },
2518
2519{ "lfq", OP(56), OP_MASK, POWER2, { FRT, D, RA } },
2520
2521{ "lfqu", OP(57), OP_MASK, POWER2, { FRT, D, RA } },
2522
2523{ "ld", DSO(58,0), DS_MASK, PPC|B64, { RT, DS, RA } },
2524
2525{ "ldu", DSO(58,1), DS_MASK, PPC|B64, { RT, DS, RAL } },
2526
2527{ "lwa", DSO(58,2), DS_MASK, PPC|B64, { RT, DS, RA } },
2528
2529{ "fdivs", A(59,18,0), AFRC_MASK, PPC, { FRT, FRA, FRB } },
2530{ "fdivs.", A(59,18,1), AFRC_MASK, PPC, { FRT, FRA, FRB } },
2531
2532{ "fsubs", A(59,20,0), AFRC_MASK, PPC, { FRT, FRA, FRB } },
2533{ "fsubs.", A(59,20,1), AFRC_MASK, PPC, { FRT, FRA, FRB } },
2534
2535{ "fadds", A(59,21,0), AFRC_MASK, PPC, { FRT, FRA, FRB } },
2536{ "fadds.", A(59,21,1), AFRC_MASK, PPC, { FRT, FRA, FRB } },
2537
2538{ "fsqrts", A(59,22,0), AFRAFRC_MASK, PPC, { FRT, FRB } },
2539{ "fsqrts.", A(59,22,1), AFRAFRC_MASK, PPC, { FRT, FRB } },
2540
2541{ "fres", A(59,24,0), AFRAFRC_MASK, PPC, { FRT, FRB } },
2542{ "fres.", A(59,24,1), AFRAFRC_MASK, PPC, { FRT, FRB } },
2543
2544{ "fmuls", A(59,25,0), AFRB_MASK, PPC, { FRT, FRA, FRC } },
2545{ "fmuls.", A(59,25,1), AFRB_MASK, PPC, { FRT, FRA, FRC } },
2546
2547{ "fmsubs", A(59,28,0), A_MASK, PPC, { FRT,FRA,FRC,FRB } },
2548{ "fmsubs.", A(59,28,1), A_MASK, PPC, { FRT,FRA,FRC,FRB } },
2549
2550{ "fmadds", A(59,29,0), A_MASK, PPC, { FRT,FRA,FRC,FRB } },
2551{ "fmadds.", A(59,29,1), A_MASK, PPC, { FRT,FRA,FRC,FRB } },
2552
2553{ "fnmsubs", A(59,30,0), A_MASK, PPC, { FRT,FRA,FRC,FRB } },
2554{ "fnmsubs.",A(59,30,1), A_MASK, PPC, { FRT,FRA,FRC,FRB } },
2555
2556{ "fnmadds", A(59,31,0), A_MASK, PPC, { FRT,FRA,FRC,FRB } },
2557{ "fnmadds.",A(59,31,1), A_MASK, PPC, { FRT,FRA,FRC,FRB } },
2558
2559{ "stfq", OP(60), OP_MASK, POWER2, { FRS, D, RA } },
2560
2561{ "stfqu", OP(61), OP_MASK, POWER2, { FRS, D, RA } },
2562
2563{ "std", DSO(62,0), DS_MASK, PPC|B64, { RS, DS, RA } },
2564
2565{ "stdu", DSO(62,1), DS_MASK, PPC|B64, { RS, DS, RAS } },
2566
2567{ "fcmpu", X(63,0), X_MASK|(3<<21), PPC|POWER, { BF, FRA, FRB } },
2568
2569{ "frsp", XRC(63,12,0), XRA_MASK, PPC|POWER, { FRT, FRB } },
2570{ "frsp.", XRC(63,12,1), XRA_MASK, PPC|POWER, { FRT, FRB } },
2571
2572{ "fctiw", XRC(63,14,0), XRA_MASK, PPC, { FRT, FRB } },
2573{ "fcir", XRC(63,14,0), XRA_MASK, POWER2, { FRT, FRB } },
2574{ "fctiw.", XRC(63,14,1), XRA_MASK, PPC, { FRT, FRB } },
2575{ "fcir.", XRC(63,14,1), XRA_MASK, POWER2, { FRT, FRB } },
2576
2577{ "fctiwz", XRC(63,15,0), XRA_MASK, PPC, { FRT, FRB } },
2578{ "fcirz", XRC(63,15,0), XRA_MASK, POWER2, { FRT, FRB } },
2579{ "fctiwz.", XRC(63,15,1), XRA_MASK, PPC, { FRT, FRB } },
2580{ "fcirz.", XRC(63,15,1), XRA_MASK, POWER2, { FRT, FRB } },
2581
2582{ "fdiv", A(63,18,0), AFRC_MASK, PPC, { FRT, FRA, FRB } },
2583{ "fd", A(63,18,0), AFRC_MASK, POWER, { FRT, FRA, FRB } },
2584{ "fdiv.", A(63,18,1), AFRC_MASK, PPC, { FRT, FRA, FRB } },
2585{ "fd.", A(63,18,1), AFRC_MASK, POWER, { FRT, FRA, FRB } },
2586
2587{ "fsub", A(63,20,0), AFRC_MASK, PPC, { FRT, FRA, FRB } },
2588{ "fs", A(63,20,0), AFRC_MASK, POWER, { FRT, FRA, FRB } },
2589{ "fsub.", A(63,20,1), AFRC_MASK, PPC, { FRT, FRA, FRB } },
2590{ "fs.", A(63,20,1), AFRC_MASK, POWER, { FRT, FRA, FRB } },
2591
2592{ "fadd", A(63,21,0), AFRC_MASK, PPC, { FRT, FRA, FRB } },
2593{ "fa", A(63,21,0), AFRC_MASK, POWER, { FRT, FRA, FRB } },
2594{ "fadd.", A(63,21,1), AFRC_MASK, PPC, { FRT, FRA, FRB } },
2595{ "fa.", A(63,21,1), AFRC_MASK, POWER, { FRT, FRA, FRB } },
2596
2597{ "fsqrt", A(63,22,0), AFRAFRC_MASK, PPC|POWER2, { FRT, FRB } },
2598{ "fsqrt.", A(63,22,1), AFRAFRC_MASK, PPC|POWER2, { FRT, FRB } },
2599
2600{ "fsel", A(63,23,0), A_MASK, PPC, { FRT,FRA,FRC,FRB } },
2601{ "fsel.", A(63,23,1), A_MASK, PPC, { FRT,FRA,FRC,FRB } },
2602
2603{ "fmul", A(63,25,0), AFRB_MASK, PPC, { FRT, FRA, FRC } },
2604{ "fm", A(63,25,0), AFRB_MASK, POWER, { FRT, FRA, FRC } },
2605{ "fmul.", A(63,25,1), AFRB_MASK, PPC, { FRT, FRA, FRC } },
2606{ "fm.", A(63,25,1), AFRB_MASK, POWER, { FRT, FRA, FRC } },
2607
2608{ "frsqrte", A(63,26,0), AFRAFRC_MASK, PPC, { FRT, FRB } },
2609{ "frsqrte.",A(63,26,1), AFRAFRC_MASK, PPC, { FRT, FRB } },
2610
2611{ "fmsub", A(63,28,0), A_MASK, PPC, { FRT,FRA,FRC,FRB } },
2612{ "fms", A(63,28,0), A_MASK, POWER, { FRT,FRA,FRC,FRB } },
2613{ "fmsub.", A(63,28,1), A_MASK, PPC, { FRT,FRA,FRC,FRB } },
2614{ "fms.", A(63,28,1), A_MASK, POWER, { FRT,FRA,FRC,FRB } },
2615
2616{ "fmadd", A(63,29,0), A_MASK, PPC, { FRT,FRA,FRC,FRB } },
2617{ "fma", A(63,29,0), A_MASK, POWER, { FRT,FRA,FRC,FRB } },
2618{ "fmadd.", A(63,29,1), A_MASK, PPC, { FRT,FRA,FRC,FRB } },
2619{ "fma.", A(63,29,1), A_MASK, POWER, { FRT,FRA,FRC,FRB } },
2620
2621{ "fnmsub", A(63,30,0), A_MASK, PPC, { FRT,FRA,FRC,FRB } },
2622{ "fnms", A(63,30,0), A_MASK, POWER, { FRT,FRA,FRC,FRB } },
2623{ "fnmsub.", A(63,30,1), A_MASK, PPC, { FRT,FRA,FRC,FRB } },
2624{ "fnms.", A(63,30,1), A_MASK, POWER, { FRT,FRA,FRC,FRB } },
2625
2626{ "fnmadd", A(63,31,0), A_MASK, PPC, { FRT,FRA,FRC,FRB } },
2627{ "fnma", A(63,31,0), A_MASK, POWER, { FRT,FRA,FRC,FRB } },
2628{ "fnmadd.", A(63,31,1), A_MASK, PPC, { FRT,FRA,FRC,FRB } },
2629{ "fnma.", A(63,31,1), A_MASK, POWER, { FRT,FRA,FRC,FRB } },
2630
2631{ "fcmpo", X(63,30), X_MASK|(3<<21), PPC|POWER, { BF, FRA, FRB } },
2632
2633{ "mtfsb1", XRC(63,38,0), XRARB_MASK, PPC|POWER, { BT } },
2634{ "mtfsb1.", XRC(63,38,1), XRARB_MASK, PPC|POWER, { BT } },
2635
2636{ "fneg", XRC(63,40,0), XRA_MASK, PPC|POWER, { FRT, FRB } },
2637{ "fneg.", XRC(63,40,1), XRA_MASK, PPC|POWER, { FRT, FRB } },
2638
2639{ "mcrfs", X(63,64), XRB_MASK|(3<<21)|(3<<16), PPC|POWER, { BF, BFA } },
2640
2641{ "mtfsb0", XRC(63,70,0), XRARB_MASK, PPC|POWER, { BT } },
2642{ "mtfsb0.", XRC(63,70,1), XRARB_MASK, PPC|POWER, { BT } },
2643
2644{ "fmr", XRC(63,72,0), XRA_MASK, PPC|POWER, { FRT, FRB } },
2645{ "fmr.", XRC(63,72,1), XRA_MASK, PPC|POWER, { FRT, FRB } },
2646
2647{ "mtfsfi", XRC(63,134,0), XRA_MASK|(3<<21)|(1<<11), PPC|POWER, { BF, U } },
2648{ "mtfsfi.", XRC(63,134,1), XRA_MASK|(3<<21)|(1<<11), PPC|POWER, { BF, U } },
2649
2650{ "fnabs", XRC(63,136,0), XRA_MASK, PPC|POWER, { FRT, FRB } },
2651{ "fnabs.", XRC(63,136,1), XRA_MASK, PPC|POWER, { FRT, FRB } },
2652
2653{ "fabs", XRC(63,264,0), XRA_MASK, PPC|POWER, { FRT, FRB } },
2654{ "fabs.", XRC(63,264,1), XRA_MASK, PPC|POWER, { FRT, FRB } },
2655
2656{ "mffs", XRC(63,583,0), XRARB_MASK, PPC|POWER, { FRT } },
2657{ "mffs.", XRC(63,583,1), XRARB_MASK, PPC|POWER, { FRT } },
2658
2659{ "mtfsf", XFL(63,711,0), XFL_MASK, PPC|POWER, { FLM, FRB } },
2660{ "mtfsf.", XFL(63,711,1), XFL_MASK, PPC|POWER, { FLM, FRB } },
2661
2662{ "fctid", XRC(63,814,0), XRA_MASK, PPC|B64, { FRT, FRB } },
2663{ "fctid.", XRC(63,814,1), XRA_MASK, PPC|B64, { FRT, FRB } },
2664
2665{ "fctidz", XRC(63,815,0), XRA_MASK, PPC|B64, { FRT, FRB } },
2666{ "fctidz.", XRC(63,815,1), XRA_MASK, PPC|B64, { FRT, FRB } },
2667
2668{ "fcfid", XRC(63,846,0), XRA_MASK, PPC|B64, { FRT, FRB } },
2669{ "fcfid.", XRC(63,846,1), XRA_MASK, PPC|B64, { FRT, FRB } },
2670
2671};
2672
2673const int powerpc_num_opcodes = ARRAY_SIZE(powerpc_opcodes);
2674
2675/* The macro table. This is only used by the assembler. */
2676
2677const struct powerpc_macro powerpc_macros[] = {
2678{ "extldi", 4, PPC|B64, "rldicr %0,%1,%3,(%2)-1" },
2679{ "extldi.", 4, PPC|B64, "rldicr. %0,%1,%3,(%2)-1" },
2680{ "extrdi", 4, PPC|B64, "rldicl %0,%1,(%2)+(%3),64-(%2)" },
2681{ "extrdi.", 4, PPC|B64, "rldicl. %0,%1,(%2)+(%3),64-(%2)" },
2682{ "insrdi", 4, PPC|B64, "rldimi %0,%1,64-((%2)+(%3)),%3" },
2683{ "insrdi.", 4, PPC|B64, "rldimi. %0,%1,64-((%2)+(%3)),%3" },
2684{ "rotrdi", 3, PPC|B64, "rldicl %0,%1,64-(%2),0" },
2685{ "rotrdi.", 3, PPC|B64, "rldicl. %0,%1,64-(%2),0" },
2686{ "sldi", 3, PPC|B64, "rldicr %0,%1,%2,63-(%2)" },
2687{ "sldi.", 3, PPC|B64, "rldicr. %0,%1,%2,63-(%2)" },
2688{ "srdi", 3, PPC|B64, "rldicl %0,%1,64-(%2),%2" },
2689{ "srdi.", 3, PPC|B64, "rldicl. %0,%1,64-(%2),%2" },
2690{ "clrrdi", 3, PPC|B64, "rldicr %0,%1,0,63-(%2)" },
2691{ "clrrdi.", 3, PPC|B64, "rldicr. %0,%1,0,63-(%2)" },
2692{ "clrlsldi",4, PPC|B64, "rldic %0,%1,%3,(%2)-(%3)" },
2693{ "clrlsldi.",4, PPC|B64, "rldic. %0,%1,%3,(%2)-(%3)" },
2694
2695{ "extlwi", 4, PPC, "rlwinm %0,%1,%3,0,(%2)-1" },
2696{ "extlwi.", 4, PPC, "rlwinm. %0,%1,%3,0,(%2)-1" },
2697{ "extrwi", 4, PPC, "rlwinm %0,%1,(%2)+(%3),32-(%2),31" },
2698{ "extrwi.", 4, PPC, "rlwinm. %0,%1,(%2)+(%3),32-(%2),31" },
2699{ "inslwi", 4, PPC, "rlwimi %0,%1,32-(%3),%3,(%2)+(%3)-1" },
2700{ "inslwi.", 4, PPC, "rlwimi. %0,%1,32-(%3),%3,(%2)+(%3)-1" },
2701{ "insrwi", 4, PPC, "rlwimi %0,%1,32-((%2)+(%3)),%3,(%2)+(%3)-1" },
2702{ "insrwi.", 4, PPC, "rlwimi. %0,%1,32-((%2)+(%3)),%3,(%2)+(%3)-1"},
2703{ "rotrwi", 3, PPC, "rlwinm %0,%1,32-(%2),0,31" },
2704{ "rotrwi.", 3, PPC, "rlwinm. %0,%1,32-(%2),0,31" },
2705{ "slwi", 3, PPC, "rlwinm %0,%1,%2,0,31-(%2)" },
2706{ "sli", 3, POWER, "rlinm %0,%1,%2,0,31-(%2)" },
2707{ "slwi.", 3, PPC, "rlwinm. %0,%1,%2,0,31-(%2)" },
2708{ "sli.", 3, POWER, "rlinm. %0,%1,%2,0,31-(%2)" },
2709{ "srwi", 3, PPC, "rlwinm %0,%1,32-(%2),%2,31" },
2710{ "sri", 3, POWER, "rlinm %0,%1,32-(%2),%2,31" },
2711{ "srwi.", 3, PPC, "rlwinm. %0,%1,32-(%2),%2,31" },
2712{ "sri.", 3, POWER, "rlinm. %0,%1,32-(%2),%2,31" },
2713{ "clrrwi", 3, PPC, "rlwinm %0,%1,0,0,31-(%2)" },
2714{ "clrrwi.", 3, PPC, "rlwinm. %0,%1,0,0,31-(%2)" },
2715{ "clrlslwi",4, PPC, "rlwinm %0,%1,%3,(%2)-(%3),31-(%3)" },
2716{ "clrlslwi.",4, PPC, "rlwinm. %0,%1,%3,(%2)-(%3),31-(%3)" },
2717
2718};
2719
2720const int powerpc_num_macros = ARRAY_SIZE(powerpc_macros);
diff --git a/arch/ppc/xmon/ppc.h b/arch/ppc/xmon/ppc.h
deleted file mode 100644
index 2345ecba1fe9..000000000000
--- a/arch/ppc/xmon/ppc.h
+++ /dev/null
@@ -1,240 +0,0 @@
1/* ppc.h -- Header file for PowerPC opcode table
2 Copyright 1994 Free Software Foundation, Inc.
3 Written by Ian Lance Taylor, Cygnus Support
4
5This file is part of GDB, GAS, and the GNU binutils.
6
7GDB, GAS, and the GNU binutils are free software; you can redistribute
8them and/or modify them under the terms of the GNU General Public
9License as published by the Free Software Foundation; either version
101, or (at your option) any later version.
11
12GDB, GAS, and the GNU binutils are distributed in the hope that they
13will be useful, but WITHOUT ANY WARRANTY; without even the implied
14warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
15the GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with this file; see the file COPYING. If not, write to the Free
19Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
20
21#ifndef PPC_H
22#define PPC_H
23
24/* The opcode table is an array of struct powerpc_opcode. */
25
26struct powerpc_opcode
27{
28 /* The opcode name. */
29 const char *name;
30
31 /* The opcode itself. Those bits which will be filled in with
32 operands are zeroes. */
33 unsigned long opcode;
34
35 /* The opcode mask. This is used by the disassembler. This is a
36 mask containing ones indicating those bits which must match the
37 opcode field, and zeroes indicating those bits which need not
38 match (and are presumably filled in by operands). */
39 unsigned long mask;
40
41 /* One bit flags for the opcode. These are used to indicate which
42 specific processors support the instructions. The defined values
43 are listed below. */
44 unsigned long flags;
45
46 /* An array of operand codes. Each code is an index into the
47 operand table. They appear in the order which the operands must
48 appear in assembly code, and are terminated by a zero. */
49 unsigned char operands[8];
50};
51
52/* The table itself is sorted by major opcode number, and is otherwise
53 in the order in which the disassembler should consider
54 instructions. */
55extern const struct powerpc_opcode powerpc_opcodes[];
56extern const int powerpc_num_opcodes;
57
58/* Values defined for the flags field of a struct powerpc_opcode. */
59
60/* Opcode is defined for the PowerPC architecture. */
61#define PPC_OPCODE_PPC (01)
62
63/* Opcode is defined for the POWER (RS/6000) architecture. */
64#define PPC_OPCODE_POWER (02)
65
66/* Opcode is defined for the POWER2 (Rios 2) architecture. */
67#define PPC_OPCODE_POWER2 (04)
68
69/* Opcode is only defined on 32 bit architectures. */
70#define PPC_OPCODE_32 (010)
71
72/* Opcode is only defined on 64 bit architectures. */
73#define PPC_OPCODE_64 (020)
74
75/* Opcode is supported by the Motorola PowerPC 601 processor. The 601
76 is assumed to support all PowerPC (PPC_OPCODE_PPC) instructions,
77 but it also supports many additional POWER instructions. */
78#define PPC_OPCODE_601 (040)
79
80/* A macro to extract the major opcode from an instruction. */
81#define PPC_OP(i) (((i) >> 26) & 0x3f)
82
83/* The operands table is an array of struct powerpc_operand. */
84
85struct powerpc_operand
86{
87 /* The number of bits in the operand. */
88 int bits;
89
90 /* How far the operand is left shifted in the instruction. */
91 int shift;
92
93 /* Insertion function. This is used by the assembler. To insert an
94 operand value into an instruction, check this field.
95
96 If it is NULL, execute
97 i |= (op & ((1 << o->bits) - 1)) << o->shift;
98 (i is the instruction which we are filling in, o is a pointer to
99 this structure, and op is the opcode value; this assumes twos
100 complement arithmetic).
101
102 If this field is not NULL, then simply call it with the
103 instruction and the operand value. It will return the new value
104 of the instruction. If the ERRMSG argument is not NULL, then if
105 the operand value is illegal, *ERRMSG will be set to a warning
106 string (the operand will be inserted in any case). If the
107 operand value is legal, *ERRMSG will be unchanged (most operands
108 can accept any value). */
109 unsigned long (*insert) PARAMS ((unsigned long instruction, long op,
110 const char **errmsg));
111
112 /* Extraction function. This is used by the disassembler. To
113 extract this operand type from an instruction, check this field.
114
115 If it is NULL, compute
116 op = ((i) >> o->shift) & ((1 << o->bits) - 1);
117 if ((o->flags & PPC_OPERAND_SIGNED) != 0
118 && (op & (1 << (o->bits - 1))) != 0)
119 op -= 1 << o->bits;
120 (i is the instruction, o is a pointer to this structure, and op
121 is the result; this assumes twos complement arithmetic).
122
123 If this field is not NULL, then simply call it with the
124 instruction value. It will return the value of the operand. If
125 the INVALID argument is not NULL, *INVALID will be set to
126 non-zero if this operand type can not actually be extracted from
127 this operand (i.e., the instruction does not match). If the
128 operand is valid, *INVALID will not be changed. */
129 long (*extract) PARAMS ((unsigned long instruction, int *invalid));
130
131 /* One bit syntax flags. */
132 unsigned long flags;
133};
134
135/* Elements in the table are retrieved by indexing with values from
136 the operands field of the powerpc_opcodes table. */
137
138extern const struct powerpc_operand powerpc_operands[];
139
140/* Values defined for the flags field of a struct powerpc_operand. */
141
142/* This operand takes signed values. */
143#define PPC_OPERAND_SIGNED (01)
144
145/* This operand takes signed values, but also accepts a full positive
146 range of values when running in 32 bit mode. That is, if bits is
147 16, it takes any value from -0x8000 to 0xffff. In 64 bit mode,
148 this flag is ignored. */
149#define PPC_OPERAND_SIGNOPT (02)
150
151/* This operand does not actually exist in the assembler input. This
152 is used to support extended mnemonics such as mr, for which two
153 operands fields are identical. The assembler should call the
154 insert function with any op value. The disassembler should call
155 the extract function, ignore the return value, and check the value
156 placed in the valid argument. */
157#define PPC_OPERAND_FAKE (04)
158
159/* The next operand should be wrapped in parentheses rather than
160 separated from this one by a comma. This is used for the load and
161 store instructions which want their operands to look like
162 reg,displacement(reg)
163 */
164#define PPC_OPERAND_PARENS (010)
165
166/* This operand may use the symbolic names for the CR fields, which
167 are
168 lt 0 gt 1 eq 2 so 3 un 3
169 cr0 0 cr1 1 cr2 2 cr3 3
170 cr4 4 cr5 5 cr6 6 cr7 7
171 These may be combined arithmetically, as in cr2*4+gt. These are
172 only supported on the PowerPC, not the POWER. */
173#define PPC_OPERAND_CR (020)
174
175/* This operand names a register. The disassembler uses this to print
176 register names with a leading 'r'. */
177#define PPC_OPERAND_GPR (040)
178
179/* This operand names a floating point register. The disassembler
180 prints these with a leading 'f'. */
181#define PPC_OPERAND_FPR (0100)
182
183/* This operand is a relative branch displacement. The disassembler
184 prints these symbolically if possible. */
185#define PPC_OPERAND_RELATIVE (0200)
186
187/* This operand is an absolute branch address. The disassembler
188 prints these symbolically if possible. */
189#define PPC_OPERAND_ABSOLUTE (0400)
190
191/* This operand is optional, and is zero if omitted. This is used for
192 the optional BF and L fields in the comparison instructions. The
193 assembler must count the number of operands remaining on the line,
194 and the number of operands remaining for the opcode, and decide
195 whether this operand is present or not. The disassembler should
196 print this operand out only if it is not zero. */
197#define PPC_OPERAND_OPTIONAL (01000)
198
199/* This flag is only used with PPC_OPERAND_OPTIONAL. If this operand
200 is omitted, then for the next operand use this operand value plus
201 1, ignoring the next operand field for the opcode. This wretched
202 hack is needed because the Power rotate instructions can take
203 either 4 or 5 operands. The disassembler should print this operand
204 out regardless of the PPC_OPERAND_OPTIONAL field. */
205#define PPC_OPERAND_NEXT (02000)
206
207/* This operand should be regarded as a negative number for the
208 purposes of overflow checking (i.e., the normal most negative
209 number is disallowed and one more than the normal most positive
210 number is allowed). This flag will only be set for a signed
211 operand. */
212#define PPC_OPERAND_NEGATIVE (04000)
213
214/* The POWER and PowerPC assemblers use a few macros. We keep them
215 with the operands table for simplicity. The macro table is an
216 array of struct powerpc_macro. */
217
218struct powerpc_macro
219{
220 /* The macro name. */
221 const char *name;
222
223 /* The number of operands the macro takes. */
224 unsigned int operands;
225
226 /* One bit flags for the opcode. These are used to indicate which
227 specific processors support the instructions. The values are the
228 same as those for the struct powerpc_opcode flags field. */
229 unsigned long flags;
230
231 /* A format string to turn the macro into a normal instruction.
232 Each %N in the string is replaced with operand number N (zero
233 based). */
234 const char *format;
235};
236
237extern const struct powerpc_macro powerpc_macros[];
238extern const int powerpc_num_macros;
239
240#endif /* PPC_H */
diff --git a/arch/ppc/xmon/privinst.h b/arch/ppc/xmon/privinst.h
deleted file mode 100644
index c492a35687bd..000000000000
--- a/arch/ppc/xmon/privinst.h
+++ /dev/null
@@ -1,90 +0,0 @@
1/*
2 * Copyright (C) 1996 Paul Mackerras.
3 */
4
5#define GETREG(reg) \
6 static inline int get_ ## reg (void) \
7 { int ret; asm volatile ("mf" #reg " %0" : "=r" (ret) :); return ret; }
8
9#define SETREG(reg) \
10 static inline void set_ ## reg (int val) \
11 { asm volatile ("mt" #reg " %0" : : "r" (val)); }
12
13GETREG(msr)
14SETREG(msr)
15GETREG(cr)
16
17#define GSETSPR(n, name) \
18 static inline int get_ ## name (void) \
19 { int ret; asm volatile ("mfspr %0," #n : "=r" (ret) : ); return ret; } \
20 static inline void set_ ## name (int val) \
21 { asm volatile ("mtspr " #n ",%0" : : "r" (val)); }
22
23GSETSPR(0, mq)
24GSETSPR(1, xer)
25GSETSPR(4, rtcu)
26GSETSPR(5, rtcl)
27GSETSPR(8, lr)
28GSETSPR(9, ctr)
29GSETSPR(18, dsisr)
30GSETSPR(19, dar)
31GSETSPR(22, dec)
32GSETSPR(25, sdr1)
33GSETSPR(26, srr0)
34GSETSPR(27, srr1)
35GSETSPR(272, sprg0)
36GSETSPR(273, sprg1)
37GSETSPR(274, sprg2)
38GSETSPR(275, sprg3)
39GSETSPR(282, ear)
40GSETSPR(287, pvr)
41#ifndef CONFIG_8xx
42GSETSPR(528, bat0u)
43GSETSPR(529, bat0l)
44GSETSPR(530, bat1u)
45GSETSPR(531, bat1l)
46GSETSPR(532, bat2u)
47GSETSPR(533, bat2l)
48GSETSPR(534, bat3u)
49GSETSPR(535, bat3l)
50GSETSPR(1008, hid0)
51GSETSPR(1009, hid1)
52GSETSPR(1010, iabr)
53GSETSPR(1013, dabr)
54GSETSPR(1023, pir)
55#else
56GSETSPR(144, cmpa)
57GSETSPR(145, cmpb)
58GSETSPR(146, cmpc)
59GSETSPR(147, cmpd)
60GSETSPR(158, ictrl)
61#endif
62
63static inline int get_sr(int n)
64{
65 int ret;
66
67 asm (" mfsrin %0,%1" : "=r" (ret) : "r" (n << 28));
68 return ret;
69}
70
71static inline void set_sr(int n, int val)
72{
73 asm ("mtsrin %0,%1" : : "r" (val), "r" (n << 28));
74}
75
76static inline void store_inst(void *p)
77{
78 asm volatile ("dcbst 0,%0; sync; icbi 0,%0; isync" : : "r" (p));
79}
80
81static inline void cflush(void *p)
82{
83 asm volatile ("dcbf 0,%0; icbi 0,%0" : : "r" (p));
84}
85
86static inline void cinval(void *p)
87{
88 asm volatile ("dcbi 0,%0; icbi 0,%0" : : "r" (p));
89}
90
diff --git a/arch/ppc/xmon/setjmp.c b/arch/ppc/xmon/setjmp.c
deleted file mode 100644
index 28352bac2ae6..000000000000
--- a/arch/ppc/xmon/setjmp.c
+++ /dev/null
@@ -1,29 +0,0 @@
1/*
2 * Copyright (C) 1996 Paul Mackerras.
3 *
4 * NB this file must be compiled with -O2.
5 */
6
7int
8xmon_setjmp(long *buf)
9{
10 asm ("mflr 0; stw 0,0(%0);"
11 "stw 1,4(%0); stw 2,8(%0);"
12 "mfcr 0; stw 0,12(%0);"
13 "stmw 13,16(%0)"
14 : : "r" (buf));
15 /* XXX should save fp regs as well */
16 return 0;
17}
18
19void
20xmon_longjmp(long *buf, int val)
21{
22 if (val == 0)
23 val = 1;
24 asm ("lmw 13,16(%0);"
25 "lwz 0,12(%0); mtcrf 0x38,0;"
26 "lwz 0,0(%0); lwz 1,4(%0); lwz 2,8(%0);"
27 "mtlr 0; mr 3,%1"
28 : : "r" (buf), "r" (val));
29}
diff --git a/arch/ppc/xmon/start.c b/arch/ppc/xmon/start.c
deleted file mode 100644
index 9056fe58aaa1..000000000000
--- a/arch/ppc/xmon/start.c
+++ /dev/null
@@ -1,342 +0,0 @@
1/*
2 * Copyright (C) 1996 Paul Mackerras.
3 */
4#include <linux/string.h>
5#include <asm/machdep.h>
6#include <asm/io.h>
7#include <asm/page.h>
8#include <linux/kernel.h>
9#include <linux/errno.h>
10#include <linux/sysrq.h>
11#include <linux/bitops.h>
12#include <asm/xmon.h>
13#include <asm/errno.h>
14#include <asm/processor.h>
15#include <asm/delay.h>
16#include <asm/btext.h>
17#include <asm/ibm4xx.h>
18
19static volatile unsigned char *sccc, *sccd;
20unsigned int TXRDY, RXRDY, DLAB;
21static int xmon_expect(const char *str, unsigned int timeout);
22
23static int via_modem;
24
25#define TB_SPEED 25000000
26
27static inline unsigned int readtb(void)
28{
29 unsigned int ret;
30
31 asm volatile("mftb %0" : "=r" (ret) :);
32 return ret;
33}
34
35void buf_access(void)
36{
37 if (DLAB)
38 sccd[3] &= ~DLAB; /* reset DLAB */
39}
40
41
42#ifdef CONFIG_MAGIC_SYSRQ
43static void sysrq_handle_xmon(int key, struct pt_regs *regs,
44 struct tty_struct *tty)
45{
46 xmon(regs);
47}
48
49static struct sysrq_key_op sysrq_xmon_op =
50{
51 .handler = sysrq_handle_xmon,
52 .help_msg = "Xmon",
53 .action_msg = "Entering xmon",
54};
55#endif
56
57void
58xmon_map_scc(void)
59{
60#if defined(CONFIG_405GP)
61 sccd = (volatile unsigned char *)0xef600300;
62#elif defined(CONFIG_440EP)
63 sccd = (volatile unsigned char *) ioremap(PPC440EP_UART0_ADDR, 8);
64#elif defined(CONFIG_440SP)
65 sccd = (volatile unsigned char *) ioremap64(PPC440SP_UART0_ADDR, 8);
66#elif defined(CONFIG_440SPE)
67 sccd = (volatile unsigned char *) ioremap64(PPC440SPE_UART0_ADDR, 8);
68#elif defined(CONFIG_44x)
69 /* This is the default for 44x platforms. Any boards that have a
70 different UART address need to be put in cases before this or the
71 port will be mapped incorrectly */
72 sccd = (volatile unsigned char *) ioremap64(PPC440GP_UART0_ADDR, 8);
73#endif /* platform */
74
75#ifndef CONFIG_PPC_PREP
76 sccc = sccd + 5;
77 TXRDY = 0x20;
78 RXRDY = 1;
79 DLAB = 0x80;
80#endif
81
82 register_sysrq_key('x', &sysrq_xmon_op);
83}
84
85static int scc_initialized;
86
87void xmon_init_scc(void);
88
89int
90xmon_write(void *handle, void *ptr, int nb)
91{
92 char *p = ptr;
93 int i, c, ct;
94
95#ifdef CONFIG_SMP
96 static unsigned long xmon_write_lock;
97 int lock_wait = 1000000;
98 int locked;
99
100 while ((locked = test_and_set_bit(0, &xmon_write_lock)) != 0)
101 if (--lock_wait == 0)
102 break;
103#endif
104
105 if (!scc_initialized)
106 xmon_init_scc();
107 ct = 0;
108 for (i = 0; i < nb; ++i) {
109 while ((*sccc & TXRDY) == 0)
110 ;
111 c = p[i];
112 if (c == '\n' && !ct) {
113 c = '\r';
114 ct = 1;
115 --i;
116 } else {
117 ct = 0;
118 }
119 buf_access();
120 *sccd = c;
121 eieio();
122 }
123
124#ifdef CONFIG_SMP
125 if (!locked)
126 clear_bit(0, &xmon_write_lock);
127#endif
128 return nb;
129}
130
131int xmon_wants_key;
132
133
134int
135xmon_read(void *handle, void *ptr, int nb)
136{
137 char *p = ptr;
138 int i;
139
140 if (!scc_initialized)
141 xmon_init_scc();
142 for (i = 0; i < nb; ++i) {
143 while ((*sccc & RXRDY) == 0)
144 ;
145 buf_access();
146 *p++ = *sccd;
147 }
148 return i;
149}
150
151int
152xmon_read_poll(void)
153{
154 if ((*sccc & RXRDY) == 0) {
155 ;
156 return -1;
157 }
158 buf_access();
159 return *sccd;
160}
161
162void
163xmon_init_scc(void)
164{
165 scc_initialized = 1;
166 if (via_modem) {
167 for (;;) {
168 xmon_write(NULL, "ATE1V1\r", 7);
169 if (xmon_expect("OK", 5)) {
170 xmon_write(NULL, "ATA\r", 4);
171 if (xmon_expect("CONNECT", 40))
172 break;
173 }
174 xmon_write(NULL, "+++", 3);
175 xmon_expect("OK", 3);
176 }
177 }
178}
179
180
181void *xmon_stdin;
182void *xmon_stdout;
183void *xmon_stderr;
184
185void
186xmon_init(int arg)
187{
188 xmon_map_scc();
189}
190
191int
192xmon_putc(int c, void *f)
193{
194 char ch = c;
195
196 if (c == '\n')
197 xmon_putc('\r', f);
198 return xmon_write(f, &ch, 1) == 1? c: -1;
199}
200
201int
202xmon_putchar(int c)
203{
204 return xmon_putc(c, xmon_stdout);
205}
206
207int
208xmon_fputs(char *str, void *f)
209{
210 int n = strlen(str);
211
212 return xmon_write(f, str, n) == n? 0: -1;
213}
214
215int
216xmon_readchar(void)
217{
218 char ch;
219
220 for (;;) {
221 switch (xmon_read(xmon_stdin, &ch, 1)) {
222 case 1:
223 return ch;
224 case -1:
225 xmon_printf("read(stdin) returned -1\r\n", 0, 0);
226 return -1;
227 }
228 }
229}
230
231static char line[256];
232static char *lineptr;
233static int lineleft;
234
235int xmon_expect(const char *str, unsigned int timeout)
236{
237 int c;
238 unsigned int t0;
239
240 timeout *= TB_SPEED;
241 t0 = readtb();
242 do {
243 lineptr = line;
244 for (;;) {
245 c = xmon_read_poll();
246 if (c == -1) {
247 if (readtb() - t0 > timeout)
248 return 0;
249 continue;
250 }
251 if (c == '\n')
252 break;
253 if (c != '\r' && lineptr < &line[sizeof(line) - 1])
254 *lineptr++ = c;
255 }
256 *lineptr = 0;
257 } while (strstr(line, str) == NULL);
258 return 1;
259}
260
261int
262xmon_getchar(void)
263{
264 int c;
265
266 if (lineleft == 0) {
267 lineptr = line;
268 for (;;) {
269 c = xmon_readchar();
270 if (c == -1 || c == 4)
271 break;
272 if (c == '\r' || c == '\n') {
273 *lineptr++ = '\n';
274 xmon_putchar('\n');
275 break;
276 }
277 switch (c) {
278 case 0177:
279 case '\b':
280 if (lineptr > line) {
281 xmon_putchar('\b');
282 xmon_putchar(' ');
283 xmon_putchar('\b');
284 --lineptr;
285 }
286 break;
287 case 'U' & 0x1F:
288 while (lineptr > line) {
289 xmon_putchar('\b');
290 xmon_putchar(' ');
291 xmon_putchar('\b');
292 --lineptr;
293 }
294 break;
295 default:
296 if (lineptr >= &line[sizeof(line) - 1])
297 xmon_putchar('\a');
298 else {
299 xmon_putchar(c);
300 *lineptr++ = c;
301 }
302 }
303 }
304 lineleft = lineptr - line;
305 lineptr = line;
306 }
307 if (lineleft == 0)
308 return -1;
309 --lineleft;
310 return *lineptr++;
311}
312
313char *
314xmon_fgets(char *str, int nb, void *f)
315{
316 char *p;
317 int c;
318
319 for (p = str; p < str + nb - 1; ) {
320 c = xmon_getchar();
321 if (c == -1) {
322 if (p == str)
323 return NULL;
324 break;
325 }
326 *p++ = c;
327 if (c == '\n')
328 break;
329 }
330 *p = 0;
331 return str;
332}
333
334void
335xmon_enter(void)
336{
337}
338
339void
340xmon_leave(void)
341{
342}
diff --git a/arch/ppc/xmon/start_8xx.c b/arch/ppc/xmon/start_8xx.c
deleted file mode 100644
index 30974068c223..000000000000
--- a/arch/ppc/xmon/start_8xx.c
+++ /dev/null
@@ -1,287 +0,0 @@
1/*
2 * Copyright (C) 1996 Paul Mackerras.
3 * Copyright (C) 2000 Dan Malek.
4 * Quick hack of Paul's code to make XMON work on 8xx processors. Lots
5 * of assumptions, like the SMC1 is used, it has been initialized by the
6 * loader at some point, and we can just stuff and suck bytes.
7 * We rely upon the 8xx uart driver to support us, as the interface
8 * changes between boot up and operational phases of the kernel.
9 */
10#include <linux/string.h>
11#include <asm/machdep.h>
12#include <asm/io.h>
13#include <asm/page.h>
14#include <linux/kernel.h>
15#include <asm/8xx_immap.h>
16#include <asm/mpc8xx.h>
17#include <asm/cpm1.h>
18
19extern void xmon_printf(const char *fmt, ...);
20extern int xmon_8xx_write(char *str, int nb);
21extern int xmon_8xx_read_poll(void);
22extern int xmon_8xx_read_char(void);
23void prom_drawhex(uint);
24void prom_drawstring(const char *str);
25
26static int use_screen = 1; /* default */
27
28#define TB_SPEED 25000000
29
30static inline unsigned int readtb(void)
31{
32 unsigned int ret;
33
34 asm volatile("mftb %0" : "=r" (ret) :);
35 return ret;
36}
37
38void buf_access(void)
39{
40}
41
42void
43xmon_map_scc(void)
44{
45
46 cpmp = (cpm8xx_t *)&(((immap_t *)IMAP_ADDR)->im_cpm);
47 use_screen = 0;
48
49 prom_drawstring("xmon uses serial port\n");
50}
51
52static int scc_initialized = 0;
53
54void xmon_init_scc(void);
55
56int
57xmon_write(void *handle, void *ptr, int nb)
58{
59 char *p = ptr;
60 int i, c, ct;
61
62 if (!scc_initialized)
63 xmon_init_scc();
64
65 return(xmon_8xx_write(ptr, nb));
66}
67
68int xmon_wants_key;
69
70int
71xmon_read(void *handle, void *ptr, int nb)
72{
73 char *p = ptr;
74 int i;
75
76 if (!scc_initialized)
77 xmon_init_scc();
78
79 for (i = 0; i < nb; ++i) {
80 *p++ = xmon_8xx_read_char();
81 }
82 return i;
83}
84
85int
86xmon_read_poll(void)
87{
88 return(xmon_8xx_read_poll());
89}
90
91void
92xmon_init_scc()
93{
94 scc_initialized = 1;
95}
96
97#if 0
98extern int (*prom_entry)(void *);
99
100int
101xmon_exit(void)
102{
103 struct prom_args {
104 char *service;
105 } args;
106
107 for (;;) {
108 args.service = "exit";
109 (*prom_entry)(&args);
110 }
111}
112#endif
113
114void *xmon_stdin;
115void *xmon_stdout;
116void *xmon_stderr;
117
118void
119xmon_init(void)
120{
121}
122
123int
124xmon_putc(int c, void *f)
125{
126 char ch = c;
127
128 if (c == '\n')
129 xmon_putc('\r', f);
130 return xmon_write(f, &ch, 1) == 1? c: -1;
131}
132
133int
134xmon_putchar(int c)
135{
136 return xmon_putc(c, xmon_stdout);
137}
138
139int
140xmon_fputs(char *str, void *f)
141{
142 int n = strlen(str);
143
144 return xmon_write(f, str, n) == n? 0: -1;
145}
146
147int
148xmon_readchar(void)
149{
150 char ch;
151
152 for (;;) {
153 switch (xmon_read(xmon_stdin, &ch, 1)) {
154 case 1:
155 return ch;
156 case -1:
157 xmon_printf("read(stdin) returned -1\r\n", 0, 0);
158 return -1;
159 }
160 }
161}
162
163static char line[256];
164static char *lineptr;
165static int lineleft;
166
167#if 0
168int xmon_expect(const char *str, unsigned int timeout)
169{
170 int c;
171 unsigned int t0;
172
173 timeout *= TB_SPEED;
174 t0 = readtb();
175 do {
176 lineptr = line;
177 for (;;) {
178 c = xmon_read_poll();
179 if (c == -1) {
180 if (readtb() - t0 > timeout)
181 return 0;
182 continue;
183 }
184 if (c == '\n')
185 break;
186 if (c != '\r' && lineptr < &line[sizeof(line) - 1])
187 *lineptr++ = c;
188 }
189 *lineptr = 0;
190 } while (strstr(line, str) == NULL);
191 return 1;
192}
193#endif
194
195int
196xmon_getchar(void)
197{
198 int c;
199
200 if (lineleft == 0) {
201 lineptr = line;
202 for (;;) {
203 c = xmon_readchar();
204 if (c == -1 || c == 4)
205 break;
206 if (c == '\r' || c == '\n') {
207 *lineptr++ = '\n';
208 xmon_putchar('\n');
209 break;
210 }
211 switch (c) {
212 case 0177:
213 case '\b':
214 if (lineptr > line) {
215 xmon_putchar('\b');
216 xmon_putchar(' ');
217 xmon_putchar('\b');
218 --lineptr;
219 }
220 break;
221 case 'U' & 0x1F:
222 while (lineptr > line) {
223 xmon_putchar('\b');
224 xmon_putchar(' ');
225 xmon_putchar('\b');
226 --lineptr;
227 }
228 break;
229 default:
230 if (lineptr >= &line[sizeof(line) - 1])
231 xmon_putchar('\a');
232 else {
233 xmon_putchar(c);
234 *lineptr++ = c;
235 }
236 }
237 }
238 lineleft = lineptr - line;
239 lineptr = line;
240 }
241 if (lineleft == 0)
242 return -1;
243 --lineleft;
244 return *lineptr++;
245}
246
247char *
248xmon_fgets(char *str, int nb, void *f)
249{
250 char *p;
251 int c;
252
253 for (p = str; p < str + nb - 1; ) {
254 c = xmon_getchar();
255 if (c == -1) {
256 if (p == str)
257 return 0;
258 break;
259 }
260 *p++ = c;
261 if (c == '\n')
262 break;
263 }
264 *p = 0;
265 return str;
266}
267
268void
269prom_drawhex(uint val)
270{
271 unsigned char buf[10];
272
273 int i;
274 for (i = 7; i >= 0; i--)
275 {
276 buf[i] = "0123456789abcdef"[val & 0x0f];
277 val >>= 4;
278 }
279 buf[8] = '\0';
280 xmon_fputs(buf, xmon_stdout);
281}
282
283void
284prom_drawstring(const char *str)
285{
286 xmon_fputs(str, xmon_stdout);
287}
diff --git a/arch/ppc/xmon/subr_prf.c b/arch/ppc/xmon/subr_prf.c
deleted file mode 100644
index 126624f3f2ed..000000000000
--- a/arch/ppc/xmon/subr_prf.c
+++ /dev/null
@@ -1,55 +0,0 @@
1/*
2 * Written by Cort Dougan to replace the version originally used
3 * by Paul Mackerras, which came from NetBSD and thus had copyright
4 * conflicts with Linux.
5 *
6 * This file makes liberal use of the standard linux utility
7 * routines to reduce the size of the binary. We assume we can
8 * trust some parts of Linux inside the debugger.
9 * -- Cort (cort@cs.nmt.edu)
10 *
11 * Copyright (C) 1999 Cort Dougan.
12 */
13
14#include <linux/kernel.h>
15#include <linux/string.h>
16#include <stdarg.h>
17#include "nonstdio.h"
18
19extern int xmon_write(void *, void *, int);
20
21void
22xmon_vfprintf(void *f, const char *fmt, va_list ap)
23{
24 static char xmon_buf[2048];
25 int n;
26
27 n = vsprintf(xmon_buf, fmt, ap);
28 xmon_write(f, xmon_buf, n);
29}
30
31void
32xmon_printf(const char *fmt, ...)
33{
34 va_list ap;
35
36 va_start(ap, fmt);
37 xmon_vfprintf(stdout, fmt, ap);
38 va_end(ap);
39}
40
41void
42xmon_fprintf(void *f, const char *fmt, ...)
43{
44 va_list ap;
45
46 va_start(ap, fmt);
47 xmon_vfprintf(f, fmt, ap);
48 va_end(ap);
49}
50
51void
52xmon_puts(char *s)
53{
54 xmon_write(stdout, s, strlen(s));
55}
diff --git a/arch/ppc/xmon/xmon.c b/arch/ppc/xmon/xmon.c
deleted file mode 100644
index b1a91744fd2d..000000000000
--- a/arch/ppc/xmon/xmon.c
+++ /dev/null
@@ -1,1780 +0,0 @@
1/*
2 * Routines providing a simple monitor for use on the PowerMac.
3 *
4 * Copyright (C) 1996 Paul Mackerras.
5 */
6#include <linux/errno.h>
7#include <linux/sched.h>
8#include <linux/smp.h>
9#include <linux/interrupt.h>
10#include <linux/bitops.h>
11#include <linux/kallsyms.h>
12#include <asm/ptrace.h>
13#include <asm/string.h>
14#include <asm/machdep.h>
15#include <asm/xmon.h>
16#include "nonstdio.h"
17#include "privinst.h"
18
19#define scanhex xmon_scanhex
20#define skipbl xmon_skipbl
21
22#ifdef CONFIG_SMP
23static unsigned long cpus_in_xmon = 0;
24static unsigned long got_xmon = 0;
25static volatile int take_xmon = -1;
26#endif /* CONFIG_SMP */
27
28static unsigned adrs;
29static int size = 1;
30static unsigned ndump = 64;
31static unsigned nidump = 16;
32static unsigned ncsum = 4096;
33static int termch;
34
35static u_int bus_error_jmp[100];
36#define setjmp xmon_setjmp
37#define longjmp xmon_longjmp
38
39/* Breakpoint stuff */
40struct bpt {
41 unsigned address;
42 unsigned instr;
43 unsigned count;
44 unsigned char enabled;
45};
46
47#define NBPTS 16
48static struct bpt bpts[NBPTS];
49static struct bpt dabr;
50static struct bpt iabr;
51static unsigned bpinstr = 0x7fe00008; /* trap */
52
53/* Prototypes */
54extern void (*debugger_fault_handler)(struct pt_regs *);
55static int cmds(struct pt_regs *);
56static int mread(unsigned, void *, int);
57static int mwrite(unsigned, void *, int);
58static void handle_fault(struct pt_regs *);
59static void byterev(unsigned char *, int);
60static void memex(void);
61static int bsesc(void);
62static void dump(void);
63static void prdump(unsigned, int);
64#ifdef __MWERKS__
65static void prndump(unsigned, int);
66static int nvreadb(unsigned);
67#endif
68static int ppc_inst_dump(unsigned, int);
69void print_address(unsigned);
70static int getsp(void);
71static void dump_hash_table(void);
72static void backtrace(struct pt_regs *);
73static void excprint(struct pt_regs *);
74static void prregs(struct pt_regs *);
75static void memops(int);
76static void memlocate(void);
77static void memzcan(void);
78static void memdiffs(unsigned char *, unsigned char *, unsigned, unsigned);
79int skipbl(void);
80int scanhex(unsigned *valp);
81static void scannl(void);
82static int hexdigit(int);
83void getstring(char *, int);
84static void flush_input(void);
85static int inchar(void);
86static void take_input(char *);
87/* static void openforth(void); */
88static unsigned read_spr(int);
89static void write_spr(int, unsigned);
90static void super_regs(void);
91static void symbol_lookup(void);
92static void remove_bpts(void);
93static void insert_bpts(void);
94static struct bpt *at_breakpoint(unsigned pc);
95static void bpt_cmds(void);
96void cacheflush(void);
97#ifdef CONFIG_SMP
98static void cpu_cmd(void);
99#endif /* CONFIG_SMP */
100static void csum(void);
101static void bootcmds(void);
102static void proccall(void);
103static void printtime(void);
104
105extern int print_insn_big_powerpc(FILE *, unsigned long, unsigned);
106extern void printf(const char *fmt, ...);
107extern int putchar(int ch);
108extern int setjmp(u_int *);
109extern void longjmp(u_int *, int);
110
111extern void xmon_enter(void);
112extern void xmon_leave(void);
113
114static unsigned start_tb[NR_CPUS][2];
115static unsigned stop_tb[NR_CPUS][2];
116
117#define GETWORD(v) (((v)[0] << 24) + ((v)[1] << 16) + ((v)[2] << 8) + (v)[3])
118
119#define isxdigit(c) (('0' <= (c) && (c) <= '9') \
120 || ('a' <= (c) && (c) <= 'f') \
121 || ('A' <= (c) && (c) <= 'F'))
122#define isalnum(c) (('0' <= (c) && (c) <= '9') \
123 || ('a' <= (c) && (c) <= 'z') \
124 || ('A' <= (c) && (c) <= 'Z'))
125#define isspace(c) (c == ' ' || c == '\t' || c == 10 || c == 13 || c == 0)
126
127static char *help_string = "\
128Commands:\n\
129 d dump bytes\n\
130 di dump instructions\n\
131 df dump float values\n\
132 dd dump double values\n\
133 e print exception information\n\
134 h dump hash table\n\
135 m examine/change memory\n\
136 mm move a block of memory\n\
137 ms set a block of memory\n\
138 md compare two blocks of memory\n\
139 r print registers\n\
140 S print special registers\n\
141 t print backtrace\n\
142 la lookup address\n\
143 ls lookup symbol\n\
144 C checksum\n\
145 p call function with arguments\n\
146 T print time\n\
147 x exit monitor\n\
148 zr reboot\n\
149 zh halt\n\
150";
151
152static int xmon_trace[NR_CPUS];
153#define SSTEP 1 /* stepping because of 's' command */
154#define BRSTEP 2 /* stepping over breakpoint */
155
156#ifdef CONFIG_4xx
157#define MSR_SSTEP_ENABLE 0x200
158#else
159#define MSR_SSTEP_ENABLE 0x400
160#endif
161
162static struct pt_regs *xmon_regs[NR_CPUS];
163
164extern inline void sync(void)
165{
166 asm volatile("sync; isync");
167}
168
169extern inline void __delay(unsigned int loops)
170{
171 if (loops != 0)
172 __asm__ __volatile__("mtctr %0; 1: bdnz 1b" : :
173 "r" (loops) : "ctr");
174}
175
176/* Print an address in numeric and symbolic form (if possible) */
177static void xmon_print_symbol(unsigned long address, const char *mid,
178 const char *after)
179{
180 char *modname;
181 const char *name = NULL;
182 unsigned long offset, size;
183 static char tmpstr[128];
184
185 printf("%.8lx", address);
186 if (setjmp(bus_error_jmp) == 0) {
187 debugger_fault_handler = handle_fault;
188 sync();
189 name = kallsyms_lookup(address, &size, &offset, &modname,
190 tmpstr);
191 sync();
192 /* wait a little while to see if we get a machine check */
193 __delay(200);
194 }
195 debugger_fault_handler = NULL;
196
197 if (name) {
198 printf("%s%s+%#lx/%#lx", mid, name, offset, size);
199 if (modname)
200 printf(" [%s]", modname);
201 }
202 printf("%s", after);
203}
204
205static void get_tb(unsigned *p)
206{
207 unsigned hi, lo, hiagain;
208
209 if ((get_pvr() >> 16) == 1)
210 return;
211
212 do {
213 asm volatile("mftbu %0; mftb %1; mftbu %2"
214 : "=r" (hi), "=r" (lo), "=r" (hiagain));
215 } while (hi != hiagain);
216 p[0] = hi;
217 p[1] = lo;
218}
219
220static inline void xmon_enable_sstep(struct pt_regs *regs)
221{
222 regs->msr |= MSR_SSTEP_ENABLE;
223#ifdef CONFIG_4xx
224 mtspr(SPRN_DBCR0, mfspr(SPRN_DBCR0) | DBCR0_IC | DBCR0_IDM);
225#endif
226}
227
228int xmon(struct pt_regs *excp)
229{
230 struct pt_regs regs;
231 int msr, cmd;
232
233 get_tb(stop_tb[smp_processor_id()]);
234 if (excp == NULL) {
235 asm volatile ("stw 0,0(%0)\n\
236 lwz 0,0(1)\n\
237 stw 0,4(%0)\n\
238 stmw 2,8(%0)" : : "b" (&regs));
239 regs.nip = regs.link = ((unsigned long *)regs.gpr[1])[1];
240 regs.msr = get_msr();
241 regs.ctr = get_ctr();
242 regs.xer = get_xer();
243 regs.ccr = get_cr();
244 regs.trap = 0;
245 excp = &regs;
246 }
247
248 msr = get_msr();
249 set_msr(msr & ~0x8000); /* disable interrupts */
250 xmon_regs[smp_processor_id()] = excp;
251 xmon_enter();
252 excprint(excp);
253#ifdef CONFIG_SMP
254 if (test_and_set_bit(smp_processor_id(), &cpus_in_xmon))
255 for (;;)
256 ;
257 while (test_and_set_bit(0, &got_xmon)) {
258 if (take_xmon == smp_processor_id()) {
259 take_xmon = -1;
260 break;
261 }
262 }
263 /*
264 * XXX: breakpoints are removed while any cpu is in xmon
265 */
266#endif /* CONFIG_SMP */
267 remove_bpts();
268 cmd = cmds(excp);
269 if (cmd == 's') {
270 xmon_trace[smp_processor_id()] = SSTEP;
271 xmon_enable_sstep(excp);
272 } else if (at_breakpoint(excp->nip)) {
273 xmon_trace[smp_processor_id()] = BRSTEP;
274 xmon_enable_sstep(excp);
275 } else {
276 xmon_trace[smp_processor_id()] = 0;
277 insert_bpts();
278 }
279 xmon_leave();
280 xmon_regs[smp_processor_id()] = NULL;
281#ifdef CONFIG_SMP
282 clear_bit(0, &got_xmon);
283 clear_bit(smp_processor_id(), &cpus_in_xmon);
284#endif /* CONFIG_SMP */
285 set_msr(msr); /* restore interrupt enable */
286 get_tb(start_tb[smp_processor_id()]);
287
288 return cmd != 'X';
289}
290
291irqreturn_t
292xmon_irq(int irq, void *d, struct pt_regs *regs)
293{
294 unsigned long flags;
295 local_irq_save(flags);
296 printf("Keyboard interrupt\n");
297 xmon(regs);
298 local_irq_restore(flags);
299 return IRQ_HANDLED;
300}
301
302int
303xmon_bpt(struct pt_regs *regs)
304{
305 struct bpt *bp;
306
307 bp = at_breakpoint(regs->nip);
308 if (!bp)
309 return 0;
310 if (bp->count) {
311 --bp->count;
312 remove_bpts();
313 excprint(regs);
314 xmon_trace[smp_processor_id()] = BRSTEP;
315 xmon_enable_sstep(regs);
316 } else {
317 xmon(regs);
318 }
319 return 1;
320}
321
322int
323xmon_sstep(struct pt_regs *regs)
324{
325 if (!xmon_trace[smp_processor_id()])
326 return 0;
327 if (xmon_trace[smp_processor_id()] == BRSTEP) {
328 xmon_trace[smp_processor_id()] = 0;
329 insert_bpts();
330 } else {
331 xmon(regs);
332 }
333 return 1;
334}
335
336int
337xmon_dabr_match(struct pt_regs *regs)
338{
339 if (dabr.enabled && dabr.count) {
340 --dabr.count;
341 remove_bpts();
342 excprint(regs);
343 xmon_trace[smp_processor_id()] = BRSTEP;
344 regs->msr |= 0x400;
345 } else {
346 dabr.instr = regs->nip;
347 xmon(regs);
348 }
349 return 1;
350}
351
352int
353xmon_iabr_match(struct pt_regs *regs)
354{
355 if (iabr.enabled && iabr.count) {
356 --iabr.count;
357 remove_bpts();
358 excprint(regs);
359 xmon_trace[smp_processor_id()] = BRSTEP;
360 regs->msr |= 0x400;
361 } else {
362 xmon(regs);
363 }
364 return 1;
365}
366
367static struct bpt *
368at_breakpoint(unsigned pc)
369{
370 int i;
371 struct bpt *bp;
372
373 if (dabr.enabled && pc == dabr.instr)
374 return &dabr;
375 if (iabr.enabled && pc == iabr.address)
376 return &iabr;
377 bp = bpts;
378 for (i = 0; i < NBPTS; ++i, ++bp)
379 if (bp->enabled && pc == bp->address)
380 return bp;
381 return NULL;
382}
383
384static void
385insert_bpts(void)
386{
387 int i;
388 struct bpt *bp;
389
390 bp = bpts;
391 for (i = 0; i < NBPTS; ++i, ++bp) {
392 if (!bp->enabled)
393 continue;
394 if (mread(bp->address, &bp->instr, 4) != 4
395 || mwrite(bp->address, &bpinstr, 4) != 4) {
396 printf("Couldn't insert breakpoint at %x, disabling\n",
397 bp->address);
398 bp->enabled = 0;
399 }
400 store_inst((void *) bp->address);
401 }
402#if ! (defined(CONFIG_8xx) || defined(CONFIG_4xx))
403 if (dabr.enabled)
404 set_dabr(dabr.address);
405 if (iabr.enabled)
406 set_iabr(iabr.address);
407#endif
408}
409
410static void
411remove_bpts(void)
412{
413 int i;
414 struct bpt *bp;
415 unsigned instr;
416
417#if ! (defined(CONFIG_8xx) || defined(CONFIG_4xx))
418 set_dabr(0);
419 set_iabr(0);
420#endif
421 bp = bpts;
422 for (i = 0; i < NBPTS; ++i, ++bp) {
423 if (!bp->enabled)
424 continue;
425 if (mread(bp->address, &instr, 4) == 4
426 && instr == bpinstr
427 && mwrite(bp->address, &bp->instr, 4) != 4)
428 printf("Couldn't remove breakpoint at %x\n",
429 bp->address);
430 store_inst((void *) bp->address);
431 }
432}
433
434static char *last_cmd;
435
436/* Command interpreting routine */
437static int
438cmds(struct pt_regs *excp)
439{
440 int cmd;
441
442 last_cmd = NULL;
443 for(;;) {
444#ifdef CONFIG_SMP
445 printf("%d:", smp_processor_id());
446#endif /* CONFIG_SMP */
447 printf("mon> ");
448 fflush(stdout);
449 flush_input();
450 termch = 0;
451 cmd = skipbl();
452 if( cmd == '\n' ) {
453 if (last_cmd == NULL)
454 continue;
455 take_input(last_cmd);
456 last_cmd = NULL;
457 cmd = inchar();
458 }
459 switch (cmd) {
460 case 'm':
461 cmd = inchar();
462 switch (cmd) {
463 case 'm':
464 case 's':
465 case 'd':
466 memops(cmd);
467 break;
468 case 'l':
469 memlocate();
470 break;
471 case 'z':
472 memzcan();
473 break;
474 default:
475 termch = cmd;
476 memex();
477 }
478 break;
479 case 'd':
480 dump();
481 break;
482 case 'l':
483 symbol_lookup();
484 break;
485 case 'r':
486 if (excp != NULL)
487 prregs(excp); /* print regs */
488 break;
489 case 'e':
490 if (excp == NULL)
491 printf("No exception information\n");
492 else
493 excprint(excp);
494 break;
495 case 'S':
496 super_regs();
497 break;
498 case 't':
499 backtrace(excp);
500 break;
501 case 'f':
502 cacheflush();
503 break;
504 case 'h':
505 dump_hash_table();
506 break;
507 case 's':
508 case 'x':
509 case EOF:
510 return cmd;
511 case '?':
512 printf(help_string);
513 break;
514 default:
515 printf("Unrecognized command: ");
516 if( ' ' < cmd && cmd <= '~' )
517 putchar(cmd);
518 else
519 printf("\\x%x", cmd);
520 printf(" (type ? for help)\n");
521 break;
522 case 'b':
523 bpt_cmds();
524 break;
525 case 'C':
526 csum();
527 break;
528#ifdef CONFIG_SMP
529 case 'c':
530 cpu_cmd();
531 break;
532#endif /* CONFIG_SMP */
533 case 'z':
534 bootcmds();
535 break;
536 case 'p':
537 proccall();
538 break;
539 case 'T':
540 printtime();
541 break;
542 }
543 }
544}
545
546extern unsigned tb_to_us;
547
548#define mulhwu(x,y) \
549({unsigned z; asm ("mulhwu %0,%1,%2" : "=r" (z) : "r" (x), "r" (y)); z;})
550
551static void printtime(void)
552{
553 unsigned int delta;
554
555 delta = stop_tb[smp_processor_id()][1]
556 - start_tb[smp_processor_id()][1];
557 delta = mulhwu(tb_to_us, delta);
558 printf("%u.%06u seconds\n", delta / 1000000, delta % 1000000);
559}
560
561static void bootcmds(void)
562{
563 int cmd;
564
565 cmd = inchar();
566 if (cmd == 'r')
567 ppc_md.restart(NULL);
568 else if (cmd == 'h')
569 ppc_md.halt();
570 else if (cmd == 'p')
571 ppc_md.power_off();
572}
573
574#ifdef CONFIG_SMP
575static void cpu_cmd(void)
576{
577 unsigned cpu;
578 int timeout;
579 int cmd;
580
581 cmd = inchar();
582 if (cmd == 'i') {
583 /* interrupt other cpu(s) */
584 cpu = MSG_ALL_BUT_SELF;
585 if (scanhex(&cpu))
586 smp_send_xmon_break(cpu);
587 return;
588 }
589 termch = cmd;
590 if (!scanhex(&cpu)) {
591 /* print cpus waiting or in xmon */
592 printf("cpus stopped:");
593 for (cpu = 0; cpu < NR_CPUS; ++cpu) {
594 if (test_bit(cpu, &cpus_in_xmon)) {
595 printf(" %d", cpu);
596 if (cpu == smp_processor_id())
597 printf("*", cpu);
598 }
599 }
600 printf("\n");
601 return;
602 }
603 /* try to switch to cpu specified */
604 take_xmon = cpu;
605 timeout = 10000000;
606 while (take_xmon >= 0) {
607 if (--timeout == 0) {
608 /* yes there's a race here */
609 take_xmon = -1;
610 printf("cpu %u didn't take control\n", cpu);
611 return;
612 }
613 }
614 /* now have to wait to be given control back */
615 while (test_and_set_bit(0, &got_xmon)) {
616 if (take_xmon == smp_processor_id()) {
617 take_xmon = -1;
618 break;
619 }
620 }
621}
622#endif /* CONFIG_SMP */
623
624
625static unsigned short fcstab[256] = {
626 0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf,
627 0x8c48, 0x9dc1, 0xaf5a, 0xbed3, 0xca6c, 0xdbe5, 0xe97e, 0xf8f7,
628 0x1081, 0x0108, 0x3393, 0x221a, 0x56a5, 0x472c, 0x75b7, 0x643e,
629 0x9cc9, 0x8d40, 0xbfdb, 0xae52, 0xdaed, 0xcb64, 0xf9ff, 0xe876,
630 0x2102, 0x308b, 0x0210, 0x1399, 0x6726, 0x76af, 0x4434, 0x55bd,
631 0xad4a, 0xbcc3, 0x8e58, 0x9fd1, 0xeb6e, 0xfae7, 0xc87c, 0xd9f5,
632 0x3183, 0x200a, 0x1291, 0x0318, 0x77a7, 0x662e, 0x54b5, 0x453c,
633 0xbdcb, 0xac42, 0x9ed9, 0x8f50, 0xfbef, 0xea66, 0xd8fd, 0xc974,
634 0x4204, 0x538d, 0x6116, 0x709f, 0x0420, 0x15a9, 0x2732, 0x36bb,
635 0xce4c, 0xdfc5, 0xed5e, 0xfcd7, 0x8868, 0x99e1, 0xab7a, 0xbaf3,
636 0x5285, 0x430c, 0x7197, 0x601e, 0x14a1, 0x0528, 0x37b3, 0x263a,
637 0xdecd, 0xcf44, 0xfddf, 0xec56, 0x98e9, 0x8960, 0xbbfb, 0xaa72,
638 0x6306, 0x728f, 0x4014, 0x519d, 0x2522, 0x34ab, 0x0630, 0x17b9,
639 0xef4e, 0xfec7, 0xcc5c, 0xddd5, 0xa96a, 0xb8e3, 0x8a78, 0x9bf1,
640 0x7387, 0x620e, 0x5095, 0x411c, 0x35a3, 0x242a, 0x16b1, 0x0738,
641 0xffcf, 0xee46, 0xdcdd, 0xcd54, 0xb9eb, 0xa862, 0x9af9, 0x8b70,
642 0x8408, 0x9581, 0xa71a, 0xb693, 0xc22c, 0xd3a5, 0xe13e, 0xf0b7,
643 0x0840, 0x19c9, 0x2b52, 0x3adb, 0x4e64, 0x5fed, 0x6d76, 0x7cff,
644 0x9489, 0x8500, 0xb79b, 0xa612, 0xd2ad, 0xc324, 0xf1bf, 0xe036,
645 0x18c1, 0x0948, 0x3bd3, 0x2a5a, 0x5ee5, 0x4f6c, 0x7df7, 0x6c7e,
646 0xa50a, 0xb483, 0x8618, 0x9791, 0xe32e, 0xf2a7, 0xc03c, 0xd1b5,
647 0x2942, 0x38cb, 0x0a50, 0x1bd9, 0x6f66, 0x7eef, 0x4c74, 0x5dfd,
648 0xb58b, 0xa402, 0x9699, 0x8710, 0xf3af, 0xe226, 0xd0bd, 0xc134,
649 0x39c3, 0x284a, 0x1ad1, 0x0b58, 0x7fe7, 0x6e6e, 0x5cf5, 0x4d7c,
650 0xc60c, 0xd785, 0xe51e, 0xf497, 0x8028, 0x91a1, 0xa33a, 0xb2b3,
651 0x4a44, 0x5bcd, 0x6956, 0x78df, 0x0c60, 0x1de9, 0x2f72, 0x3efb,
652 0xd68d, 0xc704, 0xf59f, 0xe416, 0x90a9, 0x8120, 0xb3bb, 0xa232,
653 0x5ac5, 0x4b4c, 0x79d7, 0x685e, 0x1ce1, 0x0d68, 0x3ff3, 0x2e7a,
654 0xe70e, 0xf687, 0xc41c, 0xd595, 0xa12a, 0xb0a3, 0x8238, 0x93b1,
655 0x6b46, 0x7acf, 0x4854, 0x59dd, 0x2d62, 0x3ceb, 0x0e70, 0x1ff9,
656 0xf78f, 0xe606, 0xd49d, 0xc514, 0xb1ab, 0xa022, 0x92b9, 0x8330,
657 0x7bc7, 0x6a4e, 0x58d5, 0x495c, 0x3de3, 0x2c6a, 0x1ef1, 0x0f78
658};
659
660#define FCS(fcs, c) (((fcs) >> 8) ^ fcstab[((fcs) ^ (c)) & 0xff])
661
662static void
663csum(void)
664{
665 unsigned int i;
666 unsigned short fcs;
667 unsigned char v;
668
669 if (!scanhex(&adrs))
670 return;
671 if (!scanhex(&ncsum))
672 return;
673 fcs = 0xffff;
674 for (i = 0; i < ncsum; ++i) {
675 if (mread(adrs+i, &v, 1) == 0) {
676 printf("csum stopped at %x\n", adrs+i);
677 break;
678 }
679 fcs = FCS(fcs, v);
680 }
681 printf("%x\n", fcs);
682}
683
684static void
685bpt_cmds(void)
686{
687 int cmd;
688 unsigned a;
689 int mode, i;
690 struct bpt *bp;
691
692 cmd = inchar();
693 switch (cmd) {
694#if ! (defined(CONFIG_8xx) || defined(CONFIG_4xx))
695 case 'd':
696 mode = 7;
697 cmd = inchar();
698 if (cmd == 'r')
699 mode = 5;
700 else if (cmd == 'w')
701 mode = 6;
702 else
703 termch = cmd;
704 cmd = inchar();
705 if (cmd == 'p')
706 mode &= ~4;
707 else
708 termch = cmd;
709 dabr.address = 0;
710 dabr.count = 0;
711 dabr.enabled = scanhex(&dabr.address);
712 scanhex(&dabr.count);
713 if (dabr.enabled)
714 dabr.address = (dabr.address & ~7) | mode;
715 break;
716 case 'i':
717 cmd = inchar();
718 if (cmd == 'p')
719 mode = 2;
720 else
721 mode = 3;
722 iabr.address = 0;
723 iabr.count = 0;
724 iabr.enabled = scanhex(&iabr.address);
725 if (iabr.enabled)
726 iabr.address |= mode;
727 scanhex(&iabr.count);
728 break;
729#endif
730 case 'c':
731 if (!scanhex(&a)) {
732 /* clear all breakpoints */
733 for (i = 0; i < NBPTS; ++i)
734 bpts[i].enabled = 0;
735 iabr.enabled = 0;
736 dabr.enabled = 0;
737 printf("All breakpoints cleared\n");
738 } else {
739 bp = at_breakpoint(a);
740 if (bp == 0) {
741 printf("No breakpoint at %x\n", a);
742 } else {
743 bp->enabled = 0;
744 }
745 }
746 break;
747 default:
748 termch = cmd;
749 if (!scanhex(&a)) {
750 /* print all breakpoints */
751 printf("type address count\n");
752 if (dabr.enabled) {
753 printf("data %.8x %8x [", dabr.address & ~7,
754 dabr.count);
755 if (dabr.address & 1)
756 printf("r");
757 if (dabr.address & 2)
758 printf("w");
759 if (!(dabr.address & 4))
760 printf("p");
761 printf("]\n");
762 }
763 if (iabr.enabled)
764 printf("inst %.8x %8x\n", iabr.address & ~3,
765 iabr.count);
766 for (bp = bpts; bp < &bpts[NBPTS]; ++bp)
767 if (bp->enabled)
768 printf("trap %.8x %8x\n", bp->address,
769 bp->count);
770 break;
771 }
772 bp = at_breakpoint(a);
773 if (bp == 0) {
774 for (bp = bpts; bp < &bpts[NBPTS]; ++bp)
775 if (!bp->enabled)
776 break;
777 if (bp >= &bpts[NBPTS]) {
778 printf("Sorry, no free breakpoints\n");
779 break;
780 }
781 }
782 bp->enabled = 1;
783 bp->address = a;
784 bp->count = 0;
785 scanhex(&bp->count);
786 break;
787 }
788}
789
790static void
791backtrace(struct pt_regs *excp)
792{
793 unsigned sp;
794 unsigned stack[2];
795 struct pt_regs regs;
796 extern char ret_from_except, ret_from_except_full, ret_from_syscall;
797
798 printf("backtrace:\n");
799
800 if (excp != NULL)
801 sp = excp->gpr[1];
802 else
803 sp = getsp();
804 scanhex(&sp);
805 scannl();
806 for (; sp != 0; sp = stack[0]) {
807 if (mread(sp, stack, sizeof(stack)) != sizeof(stack))
808 break;
809 printf("[%.8lx] ", stack[0]);
810 xmon_print_symbol(stack[1], " ", "\n");
811 if (stack[1] == (unsigned) &ret_from_except
812 || stack[1] == (unsigned) &ret_from_except_full
813 || stack[1] == (unsigned) &ret_from_syscall) {
814 if (mread(sp+16, &regs, sizeof(regs)) != sizeof(regs))
815 break;
816 printf("exception:%x [%x] %x\n", regs.trap, sp+16,
817 regs.nip);
818 sp = regs.gpr[1];
819 if (mread(sp, stack, sizeof(stack)) != sizeof(stack))
820 break;
821 }
822 }
823}
824
825int
826getsp(void)
827{
828 int x;
829
830 asm("mr %0,1" : "=r" (x) :);
831 return x;
832}
833
834void
835excprint(struct pt_regs *fp)
836{
837 int trap;
838
839#ifdef CONFIG_SMP
840 printf("cpu %d: ", smp_processor_id());
841#endif /* CONFIG_SMP */
842 printf("vector: %x at pc=", fp->trap);
843 xmon_print_symbol(fp->nip, ": ", ", lr=");
844 xmon_print_symbol(fp->link, ": ", "\n");
845 printf("msr = %x, sp = %x [%x]\n", fp->msr, fp->gpr[1], fp);
846 trap = TRAP(fp);
847 if (trap == 0x300 || trap == 0x600)
848 printf("dar = %x, dsisr = %x\n", fp->dar, fp->dsisr);
849 if (current)
850 printf("current = %x, pid = %d, comm = %s\n",
851 current, current->pid, current->comm);
852}
853
854void
855prregs(struct pt_regs *fp)
856{
857 int n;
858 unsigned base;
859
860 if (scanhex(&base))
861 fp = (struct pt_regs *) base;
862 for (n = 0; n < 32; ++n) {
863 printf("R%.2d = %.8x%s", n, fp->gpr[n],
864 (n & 3) == 3? "\n": " ");
865 if (n == 12 && !FULL_REGS(fp)) {
866 printf("\n");
867 break;
868 }
869 }
870 printf("pc = %.8x msr = %.8x lr = %.8x cr = %.8x\n",
871 fp->nip, fp->msr, fp->link, fp->ccr);
872 printf("ctr = %.8x xer = %.8x trap = %4x\n",
873 fp->ctr, fp->xer, fp->trap);
874}
875
876void
877cacheflush(void)
878{
879 int cmd;
880 unsigned nflush;
881
882 cmd = inchar();
883 if (cmd != 'i')
884 termch = cmd;
885 scanhex(&adrs);
886 if (termch != '\n')
887 termch = 0;
888 nflush = 1;
889 scanhex(&nflush);
890 nflush = (nflush + 31) / 32;
891 if (cmd != 'i') {
892 for (; nflush > 0; --nflush, adrs += 0x20)
893 cflush((void *) adrs);
894 } else {
895 for (; nflush > 0; --nflush, adrs += 0x20)
896 cinval((void *) adrs);
897 }
898}
899
900unsigned int
901read_spr(int n)
902{
903 unsigned int instrs[2];
904 int (*code)(void);
905
906 instrs[0] = 0x7c6002a6 + ((n & 0x1F) << 16) + ((n & 0x3e0) << 6);
907 instrs[1] = 0x4e800020;
908 store_inst(instrs);
909 store_inst(instrs+1);
910 code = (int (*)(void)) instrs;
911 return code();
912}
913
914void
915write_spr(int n, unsigned int val)
916{
917 unsigned int instrs[2];
918 int (*code)(unsigned int);
919
920 instrs[0] = 0x7c6003a6 + ((n & 0x1F) << 16) + ((n & 0x3e0) << 6);
921 instrs[1] = 0x4e800020;
922 store_inst(instrs);
923 store_inst(instrs+1);
924 code = (int (*)(unsigned int)) instrs;
925 code(val);
926}
927
928static unsigned int regno;
929extern char exc_prolog;
930extern char dec_exc;
931
932void
933super_regs(void)
934{
935 int i, cmd;
936 unsigned val;
937
938 cmd = skipbl();
939 if (cmd == '\n') {
940 printf("msr = %x, pvr = %x\n", get_msr(), get_pvr());
941 printf("sprg0-3 = %x %x %x %x\n", get_sprg0(), get_sprg1(),
942 get_sprg2(), get_sprg3());
943 printf("srr0 = %x, srr1 = %x\n", get_srr0(), get_srr1());
944#ifdef CONFIG_PPC_STD_MMU
945 printf("sr0-15 =");
946 for (i = 0; i < 16; ++i)
947 printf(" %x", get_sr(i));
948 printf("\n");
949#endif
950 asm("mr %0,1" : "=r" (i) :);
951 printf("sp = %x ", i);
952 asm("mr %0,2" : "=r" (i) :);
953 printf("toc = %x\n", i);
954 return;
955 }
956
957 scanhex(&regno);
958 switch (cmd) {
959 case 'w':
960 val = read_spr(regno);
961 scanhex(&val);
962 write_spr(regno, val);
963 /* fall through */
964 case 'r':
965 printf("spr %x = %x\n", regno, read_spr(regno));
966 break;
967 case 's':
968 val = get_sr(regno);
969 scanhex(&val);
970 set_sr(regno, val);
971 break;
972 case 'm':
973 val = get_msr();
974 scanhex(&val);
975 set_msr(val);
976 break;
977 }
978 scannl();
979}
980
981#ifndef CONFIG_PPC_STD_MMU
982static void
983dump_hash_table(void)
984{
985 printf("This CPU doesn't have a hash table.\n");
986}
987#else
988
989static void
990dump_hash_table_seg(unsigned seg, unsigned start, unsigned end)
991{
992 extern void *Hash;
993 extern unsigned long Hash_size;
994 unsigned *htab = Hash;
995 unsigned hsize = Hash_size;
996 unsigned v, hmask, va, last_va = 0;
997 int found, last_found, i;
998 unsigned *hg, w1, last_w2 = 0, last_va0 = 0;
999
1000 last_found = 0;
1001 hmask = hsize / 64 - 1;
1002 va = start;
1003 start = (start >> 12) & 0xffff;
1004 end = (end >> 12) & 0xffff;
1005 for (v = start; v < end; ++v) {
1006 found = 0;
1007 hg = htab + (((v ^ seg) & hmask) * 16);
1008 w1 = 0x80000000 | (seg << 7) | (v >> 10);
1009 for (i = 0; i < 8; ++i, hg += 2) {
1010 if (*hg == w1) {
1011 found = 1;
1012 break;
1013 }
1014 }
1015 if (!found) {
1016 w1 ^= 0x40;
1017 hg = htab + ((~(v ^ seg) & hmask) * 16);
1018 for (i = 0; i < 8; ++i, hg += 2) {
1019 if (*hg == w1) {
1020 found = 1;
1021 break;
1022 }
1023 }
1024 }
1025 if (!(last_found && found && (hg[1] & ~0x180) == last_w2 + 4096)) {
1026 if (last_found) {
1027 if (last_va != last_va0)
1028 printf(" ... %x", last_va);
1029 printf("\n");
1030 }
1031 if (found) {
1032 printf("%x to %x", va, hg[1]);
1033 last_va0 = va;
1034 }
1035 last_found = found;
1036 }
1037 if (found) {
1038 last_w2 = hg[1] & ~0x180;
1039 last_va = va;
1040 }
1041 va += 4096;
1042 }
1043 if (last_found)
1044 printf(" ... %x\n", last_va);
1045}
1046
1047static unsigned hash_ctx;
1048static unsigned hash_start;
1049static unsigned hash_end;
1050
1051static void
1052dump_hash_table(void)
1053{
1054 int seg;
1055 unsigned seg_start, seg_end;
1056
1057 hash_ctx = 0;
1058 hash_start = 0;
1059 hash_end = 0xfffff000;
1060 scanhex(&hash_ctx);
1061 scanhex(&hash_start);
1062 scanhex(&hash_end);
1063 printf("Mappings for context %x\n", hash_ctx);
1064 seg_start = hash_start;
1065 for (seg = hash_start >> 28; seg <= hash_end >> 28; ++seg) {
1066 seg_end = (seg << 28) | 0x0ffff000;
1067 if (seg_end > hash_end)
1068 seg_end = hash_end;
1069 dump_hash_table_seg((hash_ctx << 4) + (seg * 0x111),
1070 seg_start, seg_end);
1071 seg_start = seg_end + 0x1000;
1072 }
1073}
1074#endif /* CONFIG_PPC_STD_MMU */
1075
1076/*
1077 * Stuff for reading and writing memory safely
1078 */
1079
1080int
1081mread(unsigned adrs, void *buf, int size)
1082{
1083 volatile int n;
1084 char *p, *q;
1085
1086 n = 0;
1087 if( setjmp(bus_error_jmp) == 0 ){
1088 debugger_fault_handler = handle_fault;
1089 sync();
1090 p = (char *) adrs;
1091 q = (char *) buf;
1092 switch (size) {
1093 case 2: *(short *)q = *(short *)p; break;
1094 case 4: *(int *)q = *(int *)p; break;
1095 default:
1096 for( ; n < size; ++n ) {
1097 *q++ = *p++;
1098 sync();
1099 }
1100 }
1101 sync();
1102 /* wait a little while to see if we get a machine check */
1103 __delay(200);
1104 n = size;
1105 }
1106 debugger_fault_handler = NULL;
1107 return n;
1108}
1109
1110int
1111mwrite(unsigned adrs, void *buf, int size)
1112{
1113 volatile int n;
1114 char *p, *q;
1115
1116 n = 0;
1117 if( setjmp(bus_error_jmp) == 0 ){
1118 debugger_fault_handler = handle_fault;
1119 sync();
1120 p = (char *) adrs;
1121 q = (char *) buf;
1122 switch (size) {
1123 case 2: *(short *)p = *(short *)q; break;
1124 case 4: *(int *)p = *(int *)q; break;
1125 default:
1126 for( ; n < size; ++n ) {
1127 *p++ = *q++;
1128 sync();
1129 }
1130 }
1131 sync();
1132 n = size;
1133 } else {
1134 printf("*** Error writing address %x\n", adrs + n);
1135 }
1136 debugger_fault_handler = NULL;
1137 return n;
1138}
1139
1140static int fault_type;
1141static int fault_except;
1142static char *fault_chars[] = { "--", "**", "##" };
1143
1144static void
1145handle_fault(struct pt_regs *regs)
1146{
1147 fault_except = TRAP(regs);
1148 fault_type = TRAP(regs) == 0x200? 0: TRAP(regs) == 0x300? 1: 2;
1149 longjmp(bus_error_jmp, 1);
1150}
1151
1152#define SWAP(a, b, t) ((t) = (a), (a) = (b), (b) = (t))
1153
1154void
1155byterev(unsigned char *val, int size)
1156{
1157 int t;
1158
1159 switch (size) {
1160 case 2:
1161 SWAP(val[0], val[1], t);
1162 break;
1163 case 4:
1164 SWAP(val[0], val[3], t);
1165 SWAP(val[1], val[2], t);
1166 break;
1167 }
1168}
1169
1170static int brev;
1171static int mnoread;
1172
1173void
1174memex(void)
1175{
1176 int cmd, inc, i, nslash;
1177 unsigned n;
1178 unsigned char val[4];
1179
1180 last_cmd = "m\n";
1181 scanhex(&adrs);
1182 while ((cmd = skipbl()) != '\n') {
1183 switch( cmd ){
1184 case 'b': size = 1; break;
1185 case 'w': size = 2; break;
1186 case 'l': size = 4; break;
1187 case 'r': brev = !brev; break;
1188 case 'n': mnoread = 1; break;
1189 case '.': mnoread = 0; break;
1190 }
1191 }
1192 if( size <= 0 )
1193 size = 1;
1194 else if( size > 4 )
1195 size = 4;
1196 for(;;){
1197 if (!mnoread)
1198 n = mread(adrs, val, size);
1199 printf("%.8x%c", adrs, brev? 'r': ' ');
1200 if (!mnoread) {
1201 if (brev)
1202 byterev(val, size);
1203 putchar(' ');
1204 for (i = 0; i < n; ++i)
1205 printf("%.2x", val[i]);
1206 for (; i < size; ++i)
1207 printf("%s", fault_chars[fault_type]);
1208 }
1209 putchar(' ');
1210 inc = size;
1211 nslash = 0;
1212 for(;;){
1213 if( scanhex(&n) ){
1214 for (i = 0; i < size; ++i)
1215 val[i] = n >> (i * 8);
1216 if (!brev)
1217 byterev(val, size);
1218 mwrite(adrs, val, size);
1219 inc = size;
1220 }
1221 cmd = skipbl();
1222 if (cmd == '\n')
1223 break;
1224 inc = 0;
1225 switch (cmd) {
1226 case '\'':
1227 for(;;){
1228 n = inchar();
1229 if( n == '\\' )
1230 n = bsesc();
1231 else if( n == '\'' )
1232 break;
1233 for (i = 0; i < size; ++i)
1234 val[i] = n >> (i * 8);
1235 if (!brev)
1236 byterev(val, size);
1237 mwrite(adrs, val, size);
1238 adrs += size;
1239 }
1240 adrs -= size;
1241 inc = size;
1242 break;
1243 case ',':
1244 adrs += size;
1245 break;
1246 case '.':
1247 mnoread = 0;
1248 break;
1249 case ';':
1250 break;
1251 case 'x':
1252 case EOF:
1253 scannl();
1254 return;
1255 case 'b':
1256 case 'v':
1257 size = 1;
1258 break;
1259 case 'w':
1260 size = 2;
1261 break;
1262 case 'l':
1263 size = 4;
1264 break;
1265 case '^':
1266 adrs -= size;
1267 break;
1268 break;
1269 case '/':
1270 if (nslash > 0)
1271 adrs -= 1 << nslash;
1272 else
1273 nslash = 0;
1274 nslash += 4;
1275 adrs += 1 << nslash;
1276 break;
1277 case '\\':
1278 if (nslash < 0)
1279 adrs += 1 << -nslash;
1280 else
1281 nslash = 0;
1282 nslash -= 4;
1283 adrs -= 1 << -nslash;
1284 break;
1285 case 'm':
1286 scanhex(&adrs);
1287 break;
1288 case 'n':
1289 mnoread = 1;
1290 break;
1291 case 'r':
1292 brev = !brev;
1293 break;
1294 case '<':
1295 n = size;
1296 scanhex(&n);
1297 adrs -= n;
1298 break;
1299 case '>':
1300 n = size;
1301 scanhex(&n);
1302 adrs += n;
1303 break;
1304 }
1305 }
1306 adrs += inc;
1307 }
1308}
1309
1310int
1311bsesc(void)
1312{
1313 int c;
1314
1315 c = inchar();
1316 switch( c ){
1317 case 'n': c = '\n'; break;
1318 case 'r': c = '\r'; break;
1319 case 'b': c = '\b'; break;
1320 case 't': c = '\t'; break;
1321 }
1322 return c;
1323}
1324
1325void
1326dump(void)
1327{
1328 int c;
1329
1330 c = inchar();
1331 if ((isxdigit(c) && c != 'f' && c != 'd') || c == '\n')
1332 termch = c;
1333 scanhex(&adrs);
1334 if( termch != '\n')
1335 termch = 0;
1336 if( c == 'i' ){
1337 scanhex(&nidump);
1338 if( nidump == 0 )
1339 nidump = 16;
1340 adrs += ppc_inst_dump(adrs, nidump);
1341 last_cmd = "di\n";
1342 } else {
1343 scanhex(&ndump);
1344 if( ndump == 0 )
1345 ndump = 64;
1346 prdump(adrs, ndump);
1347 adrs += ndump;
1348 last_cmd = "d\n";
1349 }
1350}
1351
1352void
1353prdump(unsigned adrs, int ndump)
1354{
1355 register int n, m, c, r, nr;
1356 unsigned char temp[16];
1357
1358 for( n = ndump; n > 0; ){
1359 printf("%.8x", adrs);
1360 putchar(' ');
1361 r = n < 16? n: 16;
1362 nr = mread(adrs, temp, r);
1363 adrs += nr;
1364 for( m = 0; m < r; ++m ){
1365 putchar((m & 3) == 0 && m > 0? '.': ' ');
1366 if( m < nr )
1367 printf("%.2x", temp[m]);
1368 else
1369 printf("%s", fault_chars[fault_type]);
1370 }
1371 for(; m < 16; ++m )
1372 printf(" ");
1373 printf(" |");
1374 for( m = 0; m < r; ++m ){
1375 if( m < nr ){
1376 c = temp[m];
1377 putchar(' ' <= c && c <= '~'? c: '.');
1378 } else
1379 putchar(' ');
1380 }
1381 n -= r;
1382 for(; m < 16; ++m )
1383 putchar(' ');
1384 printf("|\n");
1385 if( nr < r )
1386 break;
1387 }
1388}
1389
1390int
1391ppc_inst_dump(unsigned adr, int count)
1392{
1393 int nr, dotted;
1394 unsigned first_adr;
1395 unsigned long inst, last_inst = 0;
1396 unsigned char val[4];
1397
1398 dotted = 0;
1399 for (first_adr = adr; count > 0; --count, adr += 4){
1400 nr = mread(adr, val, 4);
1401 if( nr == 0 ){
1402 const char *x = fault_chars[fault_type];
1403 printf("%.8x %s%s%s%s\n", adr, x, x, x, x);
1404 break;
1405 }
1406 inst = GETWORD(val);
1407 if (adr > first_adr && inst == last_inst) {
1408 if (!dotted) {
1409 printf(" ...\n");
1410 dotted = 1;
1411 }
1412 continue;
1413 }
1414 dotted = 0;
1415 last_inst = inst;
1416 printf("%.8x ", adr);
1417 printf("%.8x\t", inst);
1418 print_insn_big_powerpc(stdout, inst, adr); /* always returns 4 */
1419 printf("\n");
1420 }
1421 return adr - first_adr;
1422}
1423
1424void
1425print_address(unsigned addr)
1426{
1427 printf("0x%x", addr);
1428}
1429
1430/*
1431 * Memory operations - move, set, print differences
1432 */
1433static unsigned mdest; /* destination address */
1434static unsigned msrc; /* source address */
1435static unsigned mval; /* byte value to set memory to */
1436static unsigned mcount; /* # bytes to affect */
1437static unsigned mdiffs; /* max # differences to print */
1438
1439void
1440memops(int cmd)
1441{
1442 scanhex(&mdest);
1443 if( termch != '\n' )
1444 termch = 0;
1445 scanhex(cmd == 's'? &mval: &msrc);
1446 if( termch != '\n' )
1447 termch = 0;
1448 scanhex(&mcount);
1449 switch( cmd ){
1450 case 'm':
1451 memmove((void *)mdest, (void *)msrc, mcount);
1452 break;
1453 case 's':
1454 memset((void *)mdest, mval, mcount);
1455 break;
1456 case 'd':
1457 if( termch != '\n' )
1458 termch = 0;
1459 scanhex(&mdiffs);
1460 memdiffs((unsigned char *)mdest, (unsigned char *)msrc, mcount, mdiffs);
1461 break;
1462 }
1463}
1464
1465void
1466memdiffs(unsigned char *p1, unsigned char *p2, unsigned nb, unsigned maxpr)
1467{
1468 unsigned n, prt;
1469
1470 prt = 0;
1471 for( n = nb; n > 0; --n )
1472 if( *p1++ != *p2++ )
1473 if( ++prt <= maxpr )
1474 printf("%.8x %.2x # %.8x %.2x\n", (unsigned)p1 - 1,
1475 p1[-1], (unsigned)p2 - 1, p2[-1]);
1476 if( prt > maxpr )
1477 printf("Total of %d differences\n", prt);
1478}
1479
1480static unsigned mend;
1481static unsigned mask;
1482
1483void
1484memlocate(void)
1485{
1486 unsigned a, n;
1487 unsigned char val[4];
1488
1489 last_cmd = "ml";
1490 scanhex(&mdest);
1491 if (termch != '\n') {
1492 termch = 0;
1493 scanhex(&mend);
1494 if (termch != '\n') {
1495 termch = 0;
1496 scanhex(&mval);
1497 mask = ~0;
1498 if (termch != '\n') termch = 0;
1499 scanhex(&mask);
1500 }
1501 }
1502 n = 0;
1503 for (a = mdest; a < mend; a += 4) {
1504 if (mread(a, val, 4) == 4
1505 && ((GETWORD(val) ^ mval) & mask) == 0) {
1506 printf("%.8x: %.8x\n", a, GETWORD(val));
1507 if (++n >= 10)
1508 break;
1509 }
1510 }
1511}
1512
1513static unsigned mskip = 0x1000;
1514static unsigned mlim = 0xffffffff;
1515
1516void
1517memzcan(void)
1518{
1519 unsigned char v;
1520 unsigned a;
1521 int ok, ook;
1522
1523 scanhex(&mdest);
1524 if (termch != '\n') termch = 0;
1525 scanhex(&mskip);
1526 if (termch != '\n') termch = 0;
1527 scanhex(&mlim);
1528 ook = 0;
1529 for (a = mdest; a < mlim; a += mskip) {
1530 ok = mread(a, &v, 1);
1531 if (ok && !ook) {
1532 printf("%.8x .. ", a);
1533 fflush(stdout);
1534 } else if (!ok && ook)
1535 printf("%.8x\n", a - mskip);
1536 ook = ok;
1537 if (a + mskip < a)
1538 break;
1539 }
1540 if (ook)
1541 printf("%.8x\n", a - mskip);
1542}
1543
1544void proccall(void)
1545{
1546 unsigned int args[8];
1547 unsigned int ret;
1548 int i;
1549 typedef unsigned int (*callfunc_t)(unsigned int, unsigned int,
1550 unsigned int, unsigned int, unsigned int,
1551 unsigned int, unsigned int, unsigned int);
1552 callfunc_t func;
1553
1554 scanhex(&adrs);
1555 if (termch != '\n')
1556 termch = 0;
1557 for (i = 0; i < 8; ++i)
1558 args[i] = 0;
1559 for (i = 0; i < 8; ++i) {
1560 if (!scanhex(&args[i]) || termch == '\n')
1561 break;
1562 termch = 0;
1563 }
1564 func = (callfunc_t) adrs;
1565 ret = 0;
1566 if (setjmp(bus_error_jmp) == 0) {
1567 debugger_fault_handler = handle_fault;
1568 sync();
1569 ret = func(args[0], args[1], args[2], args[3],
1570 args[4], args[5], args[6], args[7]);
1571 sync();
1572 printf("return value is %x\n", ret);
1573 } else {
1574 printf("*** %x exception occurred\n", fault_except);
1575 }
1576 debugger_fault_handler = NULL;
1577}
1578
1579/* Input scanning routines */
1580int
1581skipbl(void)
1582{
1583 int c;
1584
1585 if( termch != 0 ){
1586 c = termch;
1587 termch = 0;
1588 } else
1589 c = inchar();
1590 while( c == ' ' || c == '\t' )
1591 c = inchar();
1592 return c;
1593}
1594
1595#define N_PTREGS 44
1596static char *regnames[N_PTREGS] = {
1597 "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
1598 "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",
1599 "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23",
1600 "r24", "r25", "r26", "r27", "r28", "r29", "r30", "r31",
1601 "pc", "msr", "or3", "ctr", "lr", "xer", "ccr", "mq",
1602 "trap", "dar", "dsisr", "res"
1603};
1604
1605int
1606scanhex(unsigned *vp)
1607{
1608 int c, d;
1609 unsigned v;
1610
1611 c = skipbl();
1612 if (c == '%') {
1613 /* parse register name */
1614 char regname[8];
1615 int i;
1616
1617 for (i = 0; i < sizeof(regname) - 1; ++i) {
1618 c = inchar();
1619 if (!isalnum(c)) {
1620 termch = c;
1621 break;
1622 }
1623 regname[i] = c;
1624 }
1625 regname[i] = 0;
1626 for (i = 0; i < N_PTREGS; ++i) {
1627 if (strcmp(regnames[i], regname) == 0) {
1628 unsigned *rp = (unsigned *)
1629 xmon_regs[smp_processor_id()];
1630 if (rp == NULL) {
1631 printf("regs not available\n");
1632 return 0;
1633 }
1634 *vp = rp[i];
1635 return 1;
1636 }
1637 }
1638 printf("invalid register name '%%%s'\n", regname);
1639 return 0;
1640 } else if (c == '$') {
1641 static char symname[128];
1642 int i;
1643 for (i=0; i<63; i++) {
1644 c = inchar();
1645 if (isspace(c)) {
1646 termch = c;
1647 break;
1648 }
1649 symname[i] = c;
1650 }
1651 symname[i++] = 0;
1652 *vp = 0;
1653 if (setjmp(bus_error_jmp) == 0) {
1654 debugger_fault_handler = handle_fault;
1655 sync();
1656 *vp = kallsyms_lookup_name(symname);
1657 sync();
1658 }
1659 debugger_fault_handler = NULL;
1660 if (!(*vp)) {
1661 printf("unknown symbol\n");
1662 return 0;
1663 }
1664 return 1;
1665 }
1666
1667 d = hexdigit(c);
1668 if( d == EOF ){
1669 termch = c;
1670 return 0;
1671 }
1672 v = 0;
1673 do {
1674 v = (v << 4) + d;
1675 c = inchar();
1676 d = hexdigit(c);
1677 } while( d != EOF );
1678 termch = c;
1679 *vp = v;
1680 return 1;
1681}
1682
1683void
1684scannl(void)
1685{
1686 int c;
1687
1688 c = termch;
1689 termch = 0;
1690 while( c != '\n' )
1691 c = inchar();
1692}
1693
1694int hexdigit(int c)
1695{
1696 if( '0' <= c && c <= '9' )
1697 return c - '0';
1698 if( 'A' <= c && c <= 'F' )
1699 return c - ('A' - 10);
1700 if( 'a' <= c && c <= 'f' )
1701 return c - ('a' - 10);
1702 return EOF;
1703}
1704
1705void
1706getstring(char *s, int size)
1707{
1708 int c;
1709
1710 c = skipbl();
1711 do {
1712 if( size > 1 ){
1713 *s++ = c;
1714 --size;
1715 }
1716 c = inchar();
1717 } while( c != ' ' && c != '\t' && c != '\n' );
1718 termch = c;
1719 *s = 0;
1720}
1721
1722static char line[256];
1723static char *lineptr;
1724
1725void
1726flush_input(void)
1727{
1728 lineptr = NULL;
1729}
1730
1731int
1732inchar(void)
1733{
1734 if (lineptr == NULL || *lineptr == 0) {
1735 if (fgets(line, sizeof(line), stdin) == NULL) {
1736 lineptr = NULL;
1737 return EOF;
1738 }
1739 lineptr = line;
1740 }
1741 return *lineptr++;
1742}
1743
1744void
1745take_input(char *str)
1746{
1747 lineptr = str;
1748}
1749
1750static void
1751symbol_lookup(void)
1752{
1753 int type = inchar();
1754 unsigned addr;
1755 static char tmp[128];
1756
1757 switch (type) {
1758 case 'a':
1759 if (scanhex(&addr))
1760 xmon_print_symbol(addr, ": ", "\n");
1761 termch = 0;
1762 break;
1763 case 's':
1764 getstring(tmp, 64);
1765 if (setjmp(bus_error_jmp) == 0) {
1766 debugger_fault_handler = handle_fault;
1767 sync();
1768 addr = kallsyms_lookup_name(tmp);
1769 if (addr)
1770 printf("%s: %lx\n", tmp, addr);
1771 else
1772 printf("Symbol '%s' not found.\n", tmp);
1773 sync();
1774 }
1775 debugger_fault_handler = NULL;
1776 termch = 0;
1777 break;
1778 }
1779}
1780